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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.game-card {
  overflow: hidden;
  border: 3px solid var(--ink);
  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 {
  margin-bottom: 10px;
}

.game-heading h1 {
  max-width: 800px;
  font-size: clamp(2.3rem, 6.8vw, 4.9rem);
  line-height: .92;
}

.lede {
  max-width: 710px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

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

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

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

.game-card > .mode-panel {
  margin: 0;
  padding: 20px 24px;
  border-bottom: 3px solid var(--ink);
}

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

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

.stat:last-child {
  border-right: 0;
}

.stat strong {
  color: var(--ink);
  font-size: clamp(1.05rem, 3vw, 1.65rem);
}

.game-stage {
  display: flex;
  min-height: 780px;
  flex-direction: column;
  align-items: center;
  padding: 34px 28px 32px;
  background:
    linear-gradient(rgba(247, 201, 72, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(247, 201, 72, .025) 1px, transparent 1px),
    radial-gradient(circle at 50% 38%, #2b2337 0, transparent 56%);
  background-size: 24px 24px, 24px 24px, auto;
}

.stage-copy {
  min-height: 108px;
  text-align: center;
}

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

.stage-copy h2 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2.55rem);
  letter-spacing: -.04em;
}

.stage-copy > p:last-child {
  max-width: 660px;
  margin: 11px auto 0;
  color: var(--muted);
  font-size: .94rem;
  line-height: 1.5;
}

.clock-wrap {
  display: grid;
  width: min(310px, calc(100vw - 72px));
  place-items: center;
  margin: 6px auto 16px;
  aspect-ratio: 1;
}

.clock-face {
  position: relative;
  width: 100%;
  height: 100%;
  border: 8px solid var(--ink);
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #221a2d 0 7%, transparent 7.5%),
    repeating-conic-gradient(from -1deg, #4a4058 0 2deg, transparent 2deg 30deg),
    #100c17;
  box-shadow: 0 0 0 4px var(--gold), 10px 10px 0 var(--shadow);
}

.clock-number {
  position: absolute;
  z-index: 2;
  color: var(--ink);
  font-size: clamp(.8rem, 3vw, 1.05rem);
  font-weight: 900;
  line-height: 1;
  text-shadow: 2px 2px 0 var(--shadow);
}

.number-12 { top: 18px; left: 50%; transform: translateX(-50%); }
.number-3 { top: 50%; right: 20px; transform: translateY(-50%); }
.number-6 { bottom: 18px; left: 50%; transform: translateX(-50%); }
.number-9 { top: 50%; left: 20px; transform: translateY(-50%); }

.tick {
  position: absolute;
  z-index: 1;
  display: block;
  width: 8px;
  height: 24px;
  background: var(--gold);
  box-shadow: 2px 2px 0 #08060c;
}

.tick-12 { top: 0; left: calc(50% - 4px); }
.tick-6 { bottom: 0; left: calc(50% - 4px); }
.tick-3 { top: calc(50% - 12px); right: 8px; transform: rotate(90deg); }
.tick-9 { top: calc(50% - 12px); left: 8px; transform: rotate(90deg); }

.clock-hand {
  position: absolute;
  z-index: 4;
  bottom: 50%;
  left: calc(50% - 7px);
  display: block;
  width: 14px;
  height: 36%;
  border: 3px solid #08060c;
  background: var(--blue);
  box-shadow: 4px 0 0 rgba(0, 0, 0, .28);
  transform: rotate(var(--hand-angle, 0deg));
  transform-origin: 50% 100%;
  transition: transform 100ms steps(2, end), opacity 100ms linear;
}

.clock-hand::before {
  position: absolute;
  top: -13px;
  left: -8px;
  width: 24px;
  height: 24px;
  border-top: 4px solid var(--blue);
  border-left: 4px solid var(--blue);
  content: "";
  transform: rotate(45deg);
}

.clock-pin {
  position: absolute;
  z-index: 5;
  top: calc(50% - 13px);
  left: calc(50% - 13px);
  width: 26px;
  height: 26px;
  border: 4px solid #08060c;
  border-radius: 50%;
  background: var(--red);
}

.game-stage:not([data-state="active"]) .clock-hand {
  opacity: .38;
}

.game-stage[data-state="countdown"] .clock-face {
  animation: ready-pulse 650ms steps(2, end) infinite;
}

.game-stage[data-state="active"] .clock-face {
  box-shadow: 0 0 0 4px var(--blue), 0 0 32px rgba(88, 199, 215, .23), 10px 10px 0 var(--shadow);
}

.timing-wrap {
  width: min(560px, 100%);
  margin: 0 auto 12px;
}

.timing-wrap[hidden] {
  display: none;
}

.timing-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .1em;
}

.timing-label output {
  color: var(--gold);
}

.timing-wrap .deadline-track {
  width: 100%;
  height: 14px;
  margin: 0;
  border: 2px solid var(--line);
  background: #0c0912;
}

.deadline-fill {
  background: var(--green);
  will-change: transform;
}

.deadline-fill.is-danger {
  background: var(--red);
}

.result-flash {
  display: flex;
  min-height: 42px;
  margin: 1px 0 13px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.result-flash[hidden] {
  display: none;
}

.result-flash strong {
  color: var(--green);
  font-size: 1.6rem;
}

.result-flash span {
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.35;
  text-align: center;
}

.direction-pad {
  display: grid;
  width: min(480px, 100%);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, auto);
  gap: 10px;
  margin: 22px auto 0;
}

.direction-up { grid-area: 1 / 2; }
.direction-left { grid-area: 2 / 1; }
.direction-right { grid-area: 2 / 3; }
.direction-down { grid-area: 3 / 2; }

.direction-button {
  display: flex;
  min-width: 0;
  min-height: 100px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 6px;
  border: 3px solid var(--ink);
  border-radius: 0;
  background: #231b30;
  box-shadow: 5px 5px 0 var(--shadow);
  color: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 80ms ease, box-shadow 80ms ease, background 100ms ease;
  user-select: none;
}

.direction-button > span {
  color: var(--blue);
  font-size: clamp(1.9rem, 6vw, 3.15rem);
  font-weight: 900;
  line-height: .9;
}

.direction-button strong {
  font-size: .8rem;
  letter-spacing: .08em;
}

.direction-button small {
  display: flex;
  gap: 4px;
  margin-top: 3px;
}

.direction-button kbd {
  width: 27px;
  height: 27px;
  border-color: var(--line);
  font-size: .7rem;
}

.direction-button:disabled {
  cursor: default;
  opacity: .45;
}

.direction-button:not(:disabled):hover {
  background: #302540;
}

.direction-button:not(:disabled):active,
.direction-button.is-pressed {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--shadow);
}

.direction-button:focus-visible {
  outline: 4px solid var(--gold);
  outline-offset: 3px;
}

.control-note {
  max-width: 680px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.5;
  text-align: center;
}

.game-stage[data-state="active"] .primary-button,
.game-stage[data-state="feedback"] .primary-button,
.game-stage[data-state="countdown"] .primary-button {
  visibility: hidden;
}

.game-stage[data-state="complete"] { background-color: #1d3128; }
.game-stage[data-state="game-over"] { background-color: #351521; }
.game-stage[data-state="cancelled"] { background-color: #241a31; }

.content-section {
  display: grid;
  grid-template-columns: .85fr 1.6fr;
  gap: 64px;
  padding: 76px 18px 58px;
}

.content-section h2,
.info-panel h2,
.faq-section h2,
.related-section h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.08;
  letter-spacing: -.05em;
}

.steps-list {
  margin: 0;
  padding: 0;
  border-top: 2px solid var(--line);
  list-style: none;
}

.steps-list li {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 18px;
  padding: 20px 0;
  border-bottom: 2px solid var(--line);
}

.steps-list span {
  color: var(--gold);
  font-weight: 800;
}

.steps-list p,
.info-panel p,
.faq-list p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.reading-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.info-panel {
  padding: 30px;
  border: 2px solid var(--line);
  background: var(--panel);
}

.info-panel h2 { margin-bottom: 22px; }
.info-panel > p:not(.section-kicker) + p { margin-top: 16px; }
.faq-section,
.related-section { padding: 72px 18px 0; }
.faq-list { margin-top: 28px; border-top: 2px solid var(--line); }
.faq-list details { border-bottom: 2px solid var(--line); }
.faq-list summary { padding: 22px 44px 22px 0; color: var(--ink); cursor: pointer; font-size: 1.05rem; font-weight: 800; line-height: 1.4; }
.faq-list details p { max-width: 850px; padding: 0 0 24px; }

.related-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.related-links a {
  display: flex;
  min-height: 118px;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  border: 2px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-weight: 800;
  line-height: 1.35;
  text-decoration: none;
}

.related-links a:hover,
.related-links a:focus-visible { border-color: var(--gold); outline: 0; }
.related-links small { color: var(--muted); font-size: .76rem; font-weight: 400; }

@keyframes ready-pulse {
  0%, 49% { opacity: .45; }
  50%, 100% { opacity: 1; }
}

@media (max-width: 820px) {
  .game-heading { grid-template-columns: 1fr; }
  .progress-box { display: flex; align-items: center; justify-content: space-between; }
  .progress-box > span { margin: 0; }
  .related-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 650px) {
  .clock-shell { width: min(100% - 18px, 620px); padding-top: 10px; }
  .game-card { box-shadow: 6px 6px 0 var(--shadow); }
  .game-heading { gap: 20px; padding: 24px 18px; }
  .game-heading h1 { font-size: clamp(2rem, 10.3vw, 3.5rem); overflow-wrap: anywhere; }
  .game-card > .mode-panel { padding-inline: 16px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n + 2) { border-bottom: 2px solid var(--line); }
  .game-stage { min-height: 735px; padding: 28px 10px 24px; }
  .stage-copy { min-height: 126px; }
  .clock-wrap { width: min(250px, calc(100vw - 62px)); }
  .clock-face { border-width: 6px; box-shadow: 0 0 0 3px var(--gold), 6px 6px 0 var(--shadow); }
  .number-12 { top: 14px; }
  .number-3 { right: 16px; }
  .number-6 { bottom: 14px; }
  .number-9 { left: 16px; }
  .clock-hand { left: calc(50% - 6px); width: 12px; border-width: 2px; }
  .clock-hand::before { top: -11px; left: -7px; width: 20px; height: 20px; }
  .direction-pad { width: min(390px, 100%); gap: 7px; }
  .direction-button { min-height: 88px; padding: 8px 3px; border-width: 2px; box-shadow: 4px 4px 0 var(--shadow); }
  .direction-button small { display: none; }
  .direction-button strong { font-size: .7rem; overflow-wrap: anywhere; }
  .content-section,
  .reading-grid { grid-template-columns: 1fr; }
  .content-section { gap: 30px; padding: 58px 8px 44px; }
  .info-panel { padding: 24px 20px; }
  .faq-section,
  .related-section { padding: 58px 8px 0; }
  .related-links { grid-template-columns: 1fr; }
  .related-links a { min-height: 92px; }
}

@media (max-width: 350px) {
  .clock-wrap { width: 220px; }
  .direction-button { min-height: 82px; }
}

@media (prefers-reduced-motion: reduce) {
  .game-stage[data-state="countdown"] .clock-face { animation: none; }
  .clock-hand,
  .direction-button { transition: none !important; }
}
