:root {
  --bg-top: #0b1324;
  --bg-bottom: #1c2c4a;
  --ink: #e8f0ff;
  --muted: #9fb2d4;
  --accent: #9ad7ff;
  --accent-2: #c7b8ff;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.12);
  --track: rgba(255, 255, 255, 0.08);
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  background: linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

body.break {
  --bg-top: #10202a;
  --bg-bottom: #24414a;
  --accent: #a8f0d6;
}

#snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.app {
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 24px 16px;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand h1 {
  margin: 0;
  font-weight: 300;
  letter-spacing: 0.3em;
  font-size: 1.4rem;
  text-transform: uppercase;
}

button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.chip {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--muted);
}

.modes {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
}
.mode {
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9rem;
  transition: background 0.2s, color 0.2s;
}
.mode.active { background: rgba(255, 255, 255, 0.12); color: var(--ink); }

.circle { position: relative; width: min(78vw, 320px); aspect-ratio: 1; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 6; }
.track { stroke: var(--track); }
.progress {
  stroke: var(--accent);
  stroke-linecap: round;
  filter: drop-shadow(0 0 8px var(--accent));
  transition: stroke-dashoffset 0.4s linear, stroke 0.6s;
}

.readout {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}
.time {
  font-size: clamp(3rem, 14vw, 4.5rem);
  font-weight: 200;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
.label { color: var(--muted); text-transform: uppercase; letter-spacing: 0.25em; font-size: 0.75rem; }

.controls { display: flex; align-items: center; gap: 18px; }
.primary {
  min-width: 140px;
  padding: 14px 28px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg-top);
  font-weight: 600;
  letter-spacing: 0.05em;
  transition: transform 0.1s;
}
.primary:active { transform: scale(0.97); }
.icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  font-size: 1.2rem;
}

.stats { color: var(--muted); font-size: 0.9rem; }
.stats b { color: var(--ink); }

.settings {
  width: min(100%, 320px);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 10px 16px;
  color: var(--muted);
  font-size: 0.9rem;
}
.settings summary { cursor: pointer; }
.settings label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}
.settings input[type="number"] {
  width: 64px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.2);
  color: var(--ink);
}
.settings input[type="range"] { width: 130px; accent-color: var(--accent); }

.hint { color: var(--muted); opacity: 0.6; font-size: 0.75rem; text-align: center; }

@media (max-height: 640px) {
  .app { gap: 12px; }
  .hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .progress { transition: none; }
}
