* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
:root {
  --bg: #FFFFFF;
  /* --bg: #0f0f0e; */
  --surface: #1a1a18;
  --btn-bg: #2A2A28;
  --btn-colour: #F8F8F8;
  --btn-restart-hover: #9E9E9E;
  --text: #0f0f0e ;
  --pause-btn: #e8e6e3;
  /* --text: #e8e6e3 ; */
  --dm-button: #F0F0F0;
  --dm-text: #6B6B68;
  --muted: #6b6b68;
  --accent: #7c9c7a;
  --accent-dim: rgba(124, 156, 122, 0.25);
}
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  transition: background-color 0.5s ease, color 0.5s ease;
}
body.dark {
  --bg: #0f0f0e;
  --text: #e8e6e3;
  --btn-bg: #2A2A28;
  --btn-colour: #F8F8F8;
  --muted: #6b6b68;
  --accent: #7c9c7a;
  --accent-dim: rgba(124, 156, 122, 0.25);
  --surface: #1a1a18;
}
.mode-toggles {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  display: flex;
  gap: 0.4rem;
}
.mode-btn {
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  padding: 0.35rem 0.7rem;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--muted);
  transition: background 0.2s, color 0.2s;
}
.mode-btn:hover {
  background: rgba(0, 0, 0, 0.11);
}
body.dark #dark-toggle {
  background: var(--dm-button);
  color: var(--dm-text);
}
main {
  text-align: center;
  max-width: 20rem;
}
h1 {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;ç
  color: var(--muted);
  margin-bottom: 2.5rem;
}
.timer {
  font-variant-numeric: tabular-nums;
  font-size: clamp(3.5rem, 15vw, 5rem);
  font-weight: 300;
  line-height: 1;
  margin-bottom: 2rem;
  color: var(--text);
  cursor: text;
  user-select: none;
}
.timer:focus {
  outline: none;
}
.timer.done {
  color: var(--accent);
}
.cursor {
  color: var(--text);
  font-weight: 100;
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
button {
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
button:active {
  transform: scale(0.97);
}

.btn-start, .btn-restart {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-start {
  background: var(--btn-bg);
  color: var(--btn-colour);
}
.btn-start:hover {
  background: #444442;
}
.btn-start:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.icon {
  width: 1.2rem;
  height: 1.2rem;
}
.icon-pause {
  display: none;
}
.btn-start.playing .icon-play {
  display: none;
}
.btn-start.playing .icon-pause {
  display: block;
}
.btn-restart {
  background: rgba(0, 0, 0, 0.07);
  color: var(--text);
}
.btn-restart:hover {
  background: rgba(0, 0, 0, 0.13);
}
.presets {
  margin-top: 2rem;
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}
.presets button {
  font-size: 0.8rem;
  padding: 0.45rem 0.85rem;
  background: var(--accent-dim);
  color: var(--accent);
}
.presets button:hover {
  background: rgba(124, 156, 122, 0.4);
}
.hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2rem;
  line-height: 1.5;
}
