:root {
  color-scheme: light;
  --bg: #eef1ea;
  --surface: #fbfaf5;
  --surface-soft: #f4f2e9;
  --text: #30352f;
  --muted: #697064;
  --line: #d8d8cc;
  --accent: #6f8f7b;
  --accent-deep: #486756;
  --good-bg: #e7efe7;
  --good: #3e684d;
  --try-bg: #f1eadf;
  --try: #795f43;
  --shadow: 0 18px 50px rgba(63, 68, 59, 0.10);
}

body.dim {
  color-scheme: dark;
  --bg: #20251f;
  --surface: #2b3029;
  --surface-soft: #252a24;
  --text: #e6e5dc;
  --muted: #b8baae;
  --line: #474d43;
  --accent: #9ab49f;
  --accent-deep: #c0d0bd;
  --good-bg: #334235;
  --good: #c4ddc0;
  --try-bg: #433c31;
  --try: #ead5b6;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.20);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,.38), transparent 36rem),
    var(--bg);
  color: var(--text);
  transition: background-color 180ms ease, color 180ms ease;
}

button, select {
  font: inherit;
}

.app {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0;
}

.hero, .controls, .practice-card, .progress {
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding: 28px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-deep);
  font-size: .82rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.9rem);
  line-height: 1;
  letter-spacing: -0.055em;
}

.intro {
  max-width: 590px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.55;
}

.controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px;
  margin-bottom: 18px;
}

.controls label {
  color: var(--muted);
  font-weight: 650;
  margin-left: 6px;
}

select, button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  min-height: 44px;
  padding: 0 18px;
}

button {
  cursor: pointer;
  font-weight: 750;
}

button:hover, select:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
}

button:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 3px;
}

#newTime {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  color: var(--surface);
}

.ghost-button {
  background: transparent;
  color: var(--accent-deep);
}

.practice-card {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: clamp(22px, 5vw, 46px);
  align-items: center;
  padding: clamp(22px, 5vw, 42px);
}

.clock-wrap {
  display: grid;
  place-items: center;
  padding: 16px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--surface-soft), color-mix(in srgb, var(--surface) 70%, var(--bg)));
}

#clock {
  width: min(100%, 380px);
  height: auto;
  filter: drop-shadow(0 12px 20px rgba(50, 54, 48, .08));
}

.clock-face {
  fill: var(--surface);
  stroke: var(--line);
  stroke-width: 4;
}

.tick {
  stroke: color-mix(in srgb, var(--muted) 58%, transparent);
  stroke-linecap: round;
}

.tick.major {
  stroke: var(--muted);
  stroke-width: 3.2;
}

.clock-number {
  fill: var(--text);
  font-size: 22px;
  font-weight: 720;
  text-anchor: middle;
  dominant-baseline: middle;
}

.hand {
  stroke: var(--text);
  stroke-linecap: round;
  transform-origin: 160px 160px;
  transition: transform 280ms ease;
}

.hour-hand { stroke-width: 9; }
.minute-hand { stroke-width: 6; stroke: var(--accent-deep); }
.pin { fill: var(--accent-deep); }

.prompt {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 700;
}

.answers {
  display: grid;
  gap: 12px;
}

.answer {
  width: 100%;
  min-height: 58px;
  border-radius: 18px;
  background: var(--surface-soft);
  text-align: left;
  padding: 0 20px;
  font-size: 1.15rem;
}

.answer[disabled] {
  cursor: default;
  opacity: .95;
}

.answer.correct {
  background: var(--good-bg);
  border-color: color-mix(in srgb, var(--good) 45%, var(--line));
  color: var(--good);
}

.answer.incorrect {
  background: var(--try-bg);
  border-color: color-mix(in srgb, var(--try) 45%, var(--line));
  color: var(--try);
}

.feedback {
  min-height: 32px;
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.45;
  font-weight: 650;
}

.feedback.good { color: var(--good); }
.feedback.try { color: var(--try); }

.helper {
  margin-top: 18px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface-soft) 76%, transparent);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px 14px;
}

summary {
  cursor: pointer;
  font-weight: 750;
  color: var(--accent-deep);
}

.helper p {
  margin: 10px 0 0;
  line-height: 1.5;
}

.read-hint {
  min-height: 38px;
  margin-top: 12px;
  padding: 0 14px;
  background: transparent;
  color: var(--accent-deep);
  font-size: .95rem;
}

.progress {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding: 16px;
}

.progress > div {
  min-width: 120px;
  padding: 12px 16px;
  border-radius: 18px;
  background: var(--surface-soft);
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 700;
}

.progress strong {
  font-size: 1.7rem;
}

#reset {
  margin-left: auto;
}

@media (max-width: 760px) {
  .app { width: min(100% - 20px, 560px); padding: 18px 0; }
  .hero { flex-direction: column; padding: 22px; border-radius: 24px; }
  .practice-card { grid-template-columns: 1fr; padding: 18px; border-radius: 24px; }
  .clock-wrap { padding: 10px; }
  .progress { flex-wrap: wrap; }
  #reset { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
