.rotation-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: 820px; font-size: clamp(2.35rem, 7vw, 5rem); line-height: .94; }
.lede { max-width: 750px; 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; }

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

.game-stage {
  min-height: 675px; padding: 34px 30px 30px;
  background: linear-gradient(rgba(88,199,215,.035) 1px,transparent 1px), linear-gradient(90deg,rgba(88,199,215,.035) 1px,transparent 1px), radial-gradient(circle at 50% 27%,#29203a 0,transparent 55%);
  background-size: 24px 24px,24px 24px,auto;
}
.prompt-panel { display: flex; min-height: 450px; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.stage-kicker { margin: 0 0 12px; color: var(--gold); font-size: .78rem; font-weight: 800; letter-spacing: .14em; }
.prompt-panel h2 { margin: 0; font-size: clamp(1.45rem,4vw,2.5rem); letter-spacing: -.04em; }
.prompt-panel > p:not(.stage-kicker,.sr-only) { max-width: 700px; min-height: 45px; margin: 10px 0 12px; color: var(--muted); font-size: .95rem; line-height: 1.55; }

.figure-pair { display: grid; width: min(700px,100%); grid-template-columns: 1fr auto 1fr; gap: 22px; align-items: center; margin: 0 auto 17px; }
.figure-column { min-width: 0; text-align: center; }
.figure-label { display: block; margin: 0 0 8px; color: var(--muted); font-size: .7rem; font-weight: 800; letter-spacing: .12em; }
.versus { color: var(--gold); font-size: 2.2rem; font-weight: 900; }
.pixel-board {
  --cell: clamp(22px,5vw,35px);
  display: grid; width: calc(var(--cell) * 5 + 12px); height: calc(var(--cell) * 5 + 12px);
  grid-template-columns: repeat(5,var(--cell)); grid-template-rows: repeat(5,var(--cell));
  padding: 6px; margin: auto; border: 2px solid var(--line); background: #171220;
  box-shadow: 6px 6px 0 var(--shadow);
}
.pixel-cell { width: var(--cell); height: var(--cell); border: 2px solid #171220; background: var(--blue); box-shadow: inset -4px -4px 0 rgba(0,0,0,.18), inset 3px 3px 0 rgba(255,255,255,.13); }
.figure-column:last-child .pixel-cell { background: var(--gold); }
.pixel-board.is-hidden .pixel-cell { display: none; }
.pixel-board.is-hidden::after { content: "?"; grid-area: 1 / 1 / 6 / 6; place-self: center; color: var(--muted); font-size: 5rem; font-weight: 900; }

.feedback { display: flex; min-height: 40px; margin: 0 0 12px; flex-direction: column; align-items: center; justify-content: center; }
.feedback[hidden] { display: none; }
.feedback strong { color: var(--green); font-size: 1.35rem; }
.feedback span { color: var(--muted); font-size: .82rem; }
.deadline-track { width: min(520px,90%); height: 8px; margin: 0 auto 14px; overflow: hidden; border: 1px solid var(--line); background: #171220; }
.deadline-track[hidden] { display: none; }
.deadline-fill { display: block; width: 100%; height: 100%; transform-origin: left; background: var(--gold); }
.deadline-fill.is-danger { background: var(--red); }

.answer-pad { display: grid; max-width: 720px; grid-template-columns: repeat(2,1fr); gap: 14px; margin: 20px auto 0; }
.answer-button {
  display: grid; min-height: 94px; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 3px 15px; align-items: center;
  padding: 16px 20px; 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; user-select: none;
  transition: transform 80ms ease,box-shadow 80ms ease,background 100ms ease;
}
.answer-button kbd { grid-row: 1 / 3; width: 40px; height: 40px; border-color: var(--line); }
.answer-button strong { align-self: end; font-size: 1rem; letter-spacing: .08em; text-align: left; }
.answer-button small { align-self: start; color: var(--muted); font-size: .7rem; text-align: left; }
.answer-button:disabled { cursor: default; opacity: .48; }
.answer-button:not(:disabled):hover { background: #302540; }
.answer-button:not(:disabled):active,.answer-button.is-pressed { transform: translate(3px,3px); box-shadow: 2px 2px 0 var(--shadow); }
.answer-button:focus-visible { outline: 4px solid var(--gold); outline-offset: 3px; }
.control-note { margin: 18px 0 0; color: var(--muted); font-size: .84rem; line-height: 1.5; text-align: center; }

.game-stage[data-state="countdown"] .figure-pair { animation: ready-pulse .72s steps(2,end) infinite; }
.game-stage[data-state="active"] .figure-pair { animation: figure-arrive 130ms steps(2,end); }
.content-section { display: grid; grid-template-columns: minmax(240px,.8fr) 1.2fr; gap: 54px; padding: 76px 12px 52px; }
.content-heading h2,.faq-section > h2,.related-section > h2 { max-width: 760px; font-size: clamp(1.8rem,4vw,3rem); line-height: 1.08; }
.steps-list { display: grid; gap: 13px; margin: 0; padding: 0; list-style: none; }
.steps-list li { display: grid; grid-template-columns: 52px 1fr; gap: 16px; align-items: center; padding: 18px; border: 2px solid var(--line); background: #171220; }
.steps-list span { color: var(--gold); font-size: 1.45rem; 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; }
.info-panel { padding: 30px; border: 3px solid var(--ink); background: var(--panel); box-shadow: 7px 7px 0 var(--shadow); }
.info-panel h2 { margin: 8px 0 18px; font-size: clamp(1.35rem,3vw,2rem); }
.info-panel p + p { margin-top: 14px; }
.faq-section,.related-section { padding: 76px 12px 0; }
.faq-list { display: grid; gap: 12px; margin-top: 26px; }
.faq-list details { border: 2px solid var(--line); background: #171220; }
.faq-list summary { padding: 18px 20px; color: var(--ink); font-weight: 800; cursor: pointer; }
.faq-list details p { padding: 0 20px 20px; }
.related-section { padding-bottom: 76px; }
.related-links { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-top: 26px; }
.related-links a { display: flex; min-height: 100px; flex-direction: column; justify-content: center; gap: 7px; padding: 18px; border: 2px solid var(--line); background: #171220; color: var(--ink); 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: .42; } 50%,100% { opacity: 1; } }
@keyframes figure-arrive { from { transform: scale(.94); } to { transform: scale(1); } }

@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,1fr); }
}

@media (max-width: 650px) {
  .rotation-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(2.15rem,11.5vw,3.65rem); overflow-wrap: anywhere; }
  .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); }
  .game-stage { min-height: 650px; padding: 26px 10px 24px; }
  .prompt-panel { min-height: 425px; }
  .figure-pair { gap: 7px; }
  .versus { font-size: 1.3rem; }
  .pixel-board { --cell: clamp(19px,9.5vw,30px); box-shadow: 4px 4px 0 var(--shadow); }
  .answer-pad { gap: 8px; }
  .answer-button { min-width: 0; grid-template-columns: 1fr; grid-template-rows: auto auto; justify-items: center; gap: 5px; padding: 13px 7px; }
  .answer-button kbd { display: none; }
  .answer-button strong,.answer-button small { text-align: center; }
  .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-section { padding-bottom: 58px; }
  .related-links { grid-template-columns: 1fr; }
  .related-links a { min-height: 92px; }
}

@media (max-width: 390px) {
  .figure-label { font-size: .6rem; letter-spacing: .07em; }
  .pixel-board { --cell: clamp(17px,9vw,26px); }
  .answer-button strong { font-size: .84rem; }
  .answer-button small { font-size: .6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .game-stage[data-state="countdown"] .figure-pair,.game-stage[data-state="active"] .figure-pair { animation: none; }
  .answer-button { transition: none; }
  .deadline-fill { transition: none !important; }
}
