.lane-shell {
  width: min(1080px, 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.35rem, 7vw, 5rem); line-height: 0.94; }

.lede {
  max-width: 720px;
  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: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

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

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 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 { overflow-wrap: anywhere; font-size: clamp(1rem, 3vw, 1.65rem); }

.game-stage {
  min-height: 820px;
  padding: 32px 28px 30px;
  background:
    linear-gradient(rgba(88, 199, 215, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88, 199, 215, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 50% 22%, #29203a 0, transparent 56%);
  background-size: 24px 24px, 24px 24px, auto;
}

.stage-copy { min-height: 120px; text-align: center; }
.stage-kicker { margin: 0 0 10px; color: var(--gold); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.14em; }
.stage-copy h2 { margin: 0; font-size: clamp(1.45rem, 4vw, 2.6rem); letter-spacing: -0.04em; }
.stage-copy > p:last-child { max-width: 680px; min-height: 45px; margin: 10px auto 0; color: var(--muted); font-size: 0.94rem; line-height: 1.55; }

.deadline-wrap { width: min(760px, 100%); margin: 0 auto 12px; }
.deadline-labels { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 7px; color: var(--muted); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.1em; }
.deadline-track { height: 14px; overflow: hidden; border: 2px solid var(--line); background: #171220; }
.deadline-fill { display: block; width: 100%; height: 100%; transform: scaleX(0); transform-origin: left center; background: var(--green); }
.deadline-track.is-active .deadline-fill { box-shadow: inset -10px 0 0 var(--gold); }

.road {
  position: relative;
  width: min(760px, 100%);
  height: 420px;
  overflow: hidden;
  margin: 0 auto;
  border: 3px solid var(--ink);
  background: #171220;
  box-shadow: 7px 7px 0 var(--shadow);
  isolation: isolate;
}

.road::before,
.road::after {
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  width: 3px;
  background: repeating-linear-gradient(to bottom, var(--gold) 0 18px, transparent 18px 34px);
  content: "";
  opacity: 0.72;
}

.road::before { left: 33.333%; }
.road::after { right: 33.333%; }

.road-grid {
  position: absolute;
  z-index: 0;
  inset: 0;
  background:
    linear-gradient(rgba(88, 199, 215, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88, 199, 215, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, #20182d, #120f1d);
  background-size: 22px 22px, 22px 22px, auto;
}

.lane-numbers {
  position: absolute;
  z-index: 1;
  inset: 10px 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  color: rgba(246, 239, 227, 0.36);
  font-size: 0.72rem;
  font-weight: 900;
  text-align: center;
}

.wall {
  --approach-time: 2200ms;
  position: absolute;
  z-index: 4;
  top: 26px;
  left: 0;
  display: grid;
  width: 100%;
  grid-template-columns: repeat(3, 1fr);
  transform: translateY(0) scale(0.45);
  opacity: 0;
  transform-origin: center top;
  pointer-events: none;
}

.wall.is-visible { opacity: 1; }
.wall.is-moving { transform: translateY(290px) scale(1); transition: transform var(--approach-time) linear; }
.wall.is-cleared { opacity: 0.3; filter: saturate(0.4); }
.wall.is-crash { filter: drop-shadow(0 0 12px var(--red)); }

.wall-block {
  display: block;
  height: 76px;
  margin: 0 8px;
  border: 4px solid var(--ink);
  background:
    repeating-linear-gradient(135deg, var(--red) 0 14px, #f7c948 14px 28px);
  box-shadow: 5px 5px 0 var(--shadow);
}

.wall-block::after {
  display: block;
  width: 20px;
  height: 20px;
  margin: 24px auto 0;
  border: 3px solid var(--paper);
  background: var(--red);
  content: "";
}

.wall-block.is-gap { visibility: hidden; }

.runner {
  position: absolute;
  z-index: 3;
  bottom: 18px;
  left: calc((var(--lane, 2) - 0.5) * 33.333%);
  width: 54px;
  height: 58px;
  transform: translateX(-50%);
  transition: left 100ms steps(2, end);
}

.runner[data-lane="1"] { --lane: 1; }
.runner[data-lane="2"] { --lane: 2; }
.runner[data-lane="3"] { --lane: 3; }

.runner::before,
.runner::after,
.runner span {
  position: absolute;
  background: var(--blue);
  box-shadow: 4px 4px 0 var(--shadow);
  content: "";
}

.runner span { inset: 14px 5px 4px; border: 4px solid var(--ink); }
.runner::before { top: 0; left: 15px; width: 24px; height: 20px; border: 4px solid var(--ink); }
.runner::after { right: 0; bottom: 0; left: 0; height: 13px; border: 4px solid var(--ink); background: var(--paper); }

.road-message {
  position: absolute;
  z-index: 5;
  top: 46%;
  right: 20px;
  left: 20px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.74rem, 2vw, 0.92rem);
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1.5;
  text-align: center;
}

.lane-buttons,
.step-buttons {
  display: grid;
  width: min(760px, 100%);
  gap: 10px;
  margin: 18px auto 0;
}

.lane-buttons { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.step-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 10px; }

.lane-buttons button,
.step-buttons button {
  display: flex;
  min-width: 0;
  min-height: 64px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 12px;
  border: 3px solid var(--ink);
  border-radius: 0;
  background: #231b30;
  box-shadow: 4px 4px 0 var(--shadow);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  touch-action: manipulation;
}

.lane-buttons button.is-current { border-color: var(--blue); background: #20313d; }
.lane-buttons button:disabled,
.step-buttons button:disabled { cursor: default; opacity: 0.5; }
.lane-buttons button:not(:disabled):hover,
.step-buttons button:not(:disabled):hover { background: #302540; }
.lane-buttons button:not(:disabled):active,
.step-buttons button:not(:disabled):active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--shadow); }
.lane-buttons button:focus-visible,
.step-buttons button:focus-visible { outline: 4px solid var(--gold); outline-offset: 3px; }
.lane-buttons kbd,
.step-buttons kbd { width: 30px; height: 30px; border-color: var(--line); }
.step-buttons button > span[aria-hidden="true"] { color: var(--blue); font-size: 1.6rem; line-height: 1; }

.feedback {
  display: flex;
  min-height: 45px;
  margin: 16px 0 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.feedback[hidden] { display: none; }
.feedback strong { font-size: 1.35rem; }
.feedback span { margin-top: 3px; color: var(--muted); font-size: 0.78rem; }
.primary-button { display: block; margin: 18px auto 0; }
.control-note { max-width: 820px; margin: 16px auto 0; color: var(--muted); font-size: 0.82rem; line-height: 1.55; text-align: center; }

.game-stage[data-state="countdown"] .road { animation: road-ready 520ms steps(2, end) infinite; }
.game-stage[data-state="active"] .primary-button,
.game-stage[data-state="countdown"] .primary-button,
.game-stage[data-state="feedback"] .primary-button { visibility: hidden; }
.game-stage[data-state="game-over"] { background-color: #351521; }
.game-stage[data-state="complete"] { background-color: #2d2515; }
.game-stage[data-state="cancelled"] { background-color: #241a31; }

.content-section {
  display: grid;
  grid-template-columns: 0.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: -0.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-width: 0; 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: 0.76rem; font-weight: 400; }

@keyframes road-ready { 0%, 49% { border-color: var(--ink); } 50%, 100% { border-color: var(--gold); } }

@media (max-width: 900px) {
  .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) {
  .lane-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, 11vw, 3.6rem); }
  .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: 760px; padding: 26px 10px 24px; }
  .stage-copy { min-height: 135px; }
  .road { height: 340px; box-shadow: 4px 4px 0 var(--shadow); }
  .wall.is-moving { transform: translateY(218px) scale(1); }
  .wall-block { height: 68px; margin: 0 4px; border-width: 3px; }
  .wall-block::after { margin-top: 21px; }
  .runner { bottom: 14px; width: 48px; height: 53px; }
  .lane-buttons,
  .step-buttons { gap: 7px; }
  .lane-buttons button,
  .step-buttons button { min-height: 61px; gap: 6px; padding: 8px 6px; font-size: 0.67rem; }
  .lane-buttons kbd,
  .step-buttons kbd { width: 26px; height: 26px; font-size: 0.7rem; }
  .step-buttons button { flex-wrap: wrap; }
  .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: 360px) {
  .game-stage { padding-right: 7px; padding-left: 7px; }
  .lane-buttons button { flex-direction: column; }
  .road { height: 320px; }
  .wall.is-moving { transform: translateY(198px) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .runner { transition: none; }
  .game-stage[data-state="countdown"] .road { animation: none; }
  .wall.is-moving { transform: translateY(115px) scale(0.78); transition: none; }
}
