.timer-shell {
  width: min(1080px, calc(100% - 32px));
}

.game-card {
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 5px;
  background: var(--panel);
  box-shadow: 10px 10px 0 var(--shadow);
}

.game-heading {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: end;
  padding: 30px 34px;
  border-bottom: 3px solid var(--ink);
}

.game-heading .eyebrow,
.section-kicker {
  margin: 0;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.game-heading .eyebrow { margin-bottom: 10px; }

.game-heading h1 {
  max-width: 830px;
  margin: 0;
  font-size: clamp(2.25rem, 7vw, 4.75rem);
  line-height: 0.94;
}

.lede {
  max-width: 730px;
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.progress-box {
  min-width: 150px;
  padding: 16px;
  border: 2px solid var(--line);
  border-radius: 5px;
  background: #0a2026;
  text-align: center;
}

.progress-box > span,
.stat > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.progress-box strong {
  color: var(--gold);
  font-size: 1.6rem;
}

.mode-panel {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 2px solid var(--line);
  background: #0a2026;
}

.mode-switch {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.mode-switch button {
  padding: 10px 14px;
  border: 2px solid var(--line);
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.mode-switch button[aria-pressed="true"] {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--night);
}

.mode-description {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
  text-align: right;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 3px solid var(--ink);
}

.stat {
  min-width: 0;
  padding: 18px 12px;
  border-right: 2px solid var(--line);
  text-align: center;
}

.stat:last-child { border-right: 0; }
.stat strong { font-size: clamp(1.05rem, 3vw, 1.55rem); }

.timer-stage {
  display: flex;
  min-height: 660px;
  flex-direction: column;
  align-items: center;
  padding: 25px 28px 34px;
  background:
    linear-gradient(rgba(88, 199, 215, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88, 199, 215, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 50% 40%, #173b45 0, transparent 58%);
  background-size: 24px 24px, 24px 24px, auto;
}

.target-row {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.target-row strong {
  color: var(--gold);
  font-size: 1rem;
}

.stage-copy {
  min-height: 132px;
  padding-top: 22px;
  text-align: center;
}

.stage-kicker {
  margin: 0 0 9px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.stage-copy h2 {
  margin: 0;
  font-size: clamp(1.5rem, 5vw, 2.5rem);
}

.stage-copy > p:not(.stage-kicker) {
  max-width: 620px;
  margin: 10px auto 0;
  color: var(--muted);
  line-height: 1.5;
}

.clock-face {
  display: grid;
  width: min(540px, 100%);
  min-height: 150px;
  grid-template-columns: auto 1fr;
  grid-template-rows: 1fr auto;
  gap: 2px 18px;
  align-items: center;
  padding: 24px 28px;
  border: 4px solid var(--ink);
  border-radius: 5px;
  background: #0a2026;
  box-shadow: 7px 7px 0 var(--shadow);
}

.clock-icon {
  position: relative;
  display: block;
  width: 72px;
  height: 72px;
  grid-row: 1 / 3;
  border: 5px solid var(--blue);
  border-radius: 50%;
}

.clock-icon::before {
  position: absolute;
  top: -13px;
  left: 50%;
  width: 26px;
  height: 8px;
  border-radius: 3px;
  background: var(--blue);
  content: "";
  transform: translateX(-50%);
}

.clock-icon i {
  position: absolute;
  top: 12px;
  left: 50%;
  width: 4px;
  height: 22px;
  border-radius: 3px;
  background: var(--gold);
  transform: translateX(-50%);
  transform-origin: 50% 20px;
}

.timer-stage[data-state="active"] .clock-icon i {
  animation: clock-hand 1s steps(8, end) infinite;
}

.clock-face output {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-size: clamp(2.35rem, 9vw, 4.8rem);
  font-weight: 900;
  letter-spacing: 0.05em;
  line-height: 1;
}

.clock-face.is-hidden output {
  color: var(--blue);
  letter-spacing: 0.12em;
}

.clock-face small {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

.meter-panel {
  width: min(540px, 100%);
  margin-top: 18px;
}

.meter-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.meter-copy strong { color: var(--green); }

.tolerance-track,
.countdown-track {
  position: relative;
  height: 18px;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 5px;
  background: #071a1f;
}

.tolerance-track span {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 50%;
  width: calc(var(--tolerance-width, 50) * 1%);
  max-width: calc(100% - 4px);
  border-radius: 3px;
  background: var(--green);
  opacity: 0.78;
  transform: translateX(-50%);
  transition: width 180ms ease;
}

.tolerance-track i {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--ink);
  transform: translateX(-50%);
}

.countdown-track {
  height: 7px;
  margin-top: 7px;
  border-width: 1px;
}

.countdown-track span {
  display: block;
  width: calc(var(--countdown-progress, 0) * 1%);
  height: 100%;
  border-radius: 3px;
  background: var(--blue);
}

.round-result {
  display: flex;
  min-height: 32px;
  gap: 10px;
  align-items: baseline;
  justify-content: center;
  margin-top: 14px;
}

.round-result[hidden] { visibility: hidden; }
.round-result strong { font-size: 1.25rem; }
.round-result span { color: var(--muted); font-size: 0.78rem; }

.stop-button {
  display: flex;
  width: min(480px, 100%);
  min-height: 92px;
  flex-direction: column;
  gap: 7px;
  align-items: center;
  justify-content: center;
  margin-top: 15px;
  border: 4px solid var(--ink);
  border-bottom-width: 9px;
  border-radius: 5px;
  background: var(--blue);
  color: var(--night);
  cursor: pointer;
  touch-action: manipulation;
}

.stop-button strong {
  font-size: clamp(1.75rem, 6vw, 2.65rem);
  letter-spacing: 0.1em;
}

.stop-button span {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.stop-button kbd {
  width: auto;
  height: auto;
  padding: 2px 7px;
  border-color: #164f59;
  border-radius: 3px;
  background: #164f59;
  color: var(--ink);
}

.stop-button:not(:disabled):active,
.stop-button.is-pressed {
  border-bottom-width: 4px;
  transform: translateY(5px);
}

.stop-button:disabled {
  border-color: var(--line);
  background: #112f37;
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.68;
}

.timer-stage[data-state="feedback-hit"] .clock-face { border-color: var(--green); }
.timer-stage[data-state="feedback-miss"] .clock-face,
.timer-stage[data-state="game-over"] .clock-face { border-color: var(--red); }

.primary-button {
  min-width: min(380px, 100%);
  margin-top: 16px;
  border-radius: 5px;
}

.mode-switch button:focus-visible,
.stop-button:focus-visible,
.primary-button:focus-visible,
.related-links a:focus-visible,
.faq-list summary:focus-visible {
  outline: 4px solid var(--blue);
  outline-offset: 4px;
}

.control-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.5;
  text-align: center;
}

.content-section,
.faq-section,
.related-section { margin-top: 48px; }

.content-section h2,
.faq-section h2,
.related-section h2,
.info-panel h2 { margin: 8px 0 0; }

.steps-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 0;
  list-style: none;
}

.steps-list li,
.info-panel,
.faq-list details,
.related-links a {
  border: 2px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
}

.steps-list li {
  display: flex;
  gap: 14px;
  padding: 20px;
}

.steps-list li > span {
  color: var(--gold);
  font-size: 1.25rem;
  font-weight: 900;
}

.steps-list p,
.info-panel p,
.faq-list p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.reading-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 32px;
}

.info-panel { padding: 26px; }
.info-panel .section-kicker { margin: 0; }
.info-panel h2 { margin-bottom: 16px; }
.info-panel p + p { margin-top: 12px; }

.faq-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.faq-list details { padding: 18px 20px; }
.faq-list summary { color: var(--ink); font-weight: 800; cursor: pointer; }
.faq-list p { margin-top: 12px; }

.related-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.related-links a {
  display: flex;
  gap: 5px;
  flex-direction: column;
  padding: 18px;
  color: var(--ink);
  text-decoration: none;
}

.related-links a:hover { border-color: var(--gold); }
.related-links small { color: var(--muted); }

@keyframes clock-hand {
  to { transform: translateX(-50%) rotate(360deg); }
}

@media (max-width: 720px) {
  .timer-shell { width: min(100% - 20px, 1080px); }
  .topbar { align-items: flex-start; }
  .topbar-meta { flex-wrap: wrap; justify-content: flex-end; }
  .game-heading { grid-template-columns: 1fr; gap: 18px; padding: 24px 20px; }
  .progress-box { min-width: 0; }
  .mode-panel { align-items: stretch; flex-direction: column; }
  .mode-switch button { flex: 1; }
  .mode-description { text-align: left; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n + 2) { border-bottom: 2px solid var(--line); }
  .timer-stage { min-height: 640px; padding: 22px 14px 30px; }
  .clock-face { padding: 22px 20px; }
  .steps-list,
  .reading-grid,
  .related-links { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .topbar-meta { max-width: 210px; }
  .topbar-link { font-size: 0.63rem; }
  .game-heading h1 { font-size: clamp(2rem, 12vw, 3rem); }
  .stage-copy { min-height: 150px; }
  .clock-face { min-height: 132px; grid-template-columns: 58px 1fr; gap: 2px 12px; padding: 20px 16px; }
  .clock-icon { width: 54px; height: 54px; border-width: 4px; }
  .clock-icon i { top: 9px; height: 17px; transform-origin: 50% 16px; }
  .clock-face output { font-size: clamp(2rem, 13vw, 3.25rem); }
}

@media (prefers-reduced-motion: reduce) {
  .clock-icon i { animation: none !important; }
  .tolerance-track span { transition: none; }
}
