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

.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: minmax(0, 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: 850px; font-size: clamp(2.25rem, 6.2vw, 4.75rem); line-height: 0.94; overflow-wrap: anywhere; }
.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: 0.7rem; font-weight: 800; letter-spacing: 0.08em; }
.progress-box strong { color: var(--gold); font-size: 1.6rem; }

.stats-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-bottom: 3px solid var(--ink); }
.stat { min-width: 0; padding: 16px 8px; border-right: 2px solid var(--line); text-align: center; }
.stat:last-child { border-right: 0; }
.stat strong { font-size: clamp(1rem, 2.4vw, 1.4rem); overflow-wrap: anywhere; }

.game-stage {
  min-height: 650px;
  padding: 38px 34px 30px;
  background:
    linear-gradient(rgba(93, 217, 231, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(93, 217, 231, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 50% 27%, #2a2039 0, transparent 53%);
  background-size: 24px 24px, 24px 24px, auto;
}

.game-stage[data-state="feedback"][data-result="incorrect"],
.game-stage[data-state="game-over"] { background-color: #351521; }
.game-stage[data-state="complete"] { background-color: #2d2515; }

.prompt-panel { display: flex; min-height: 470px; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.stage-kicker { margin: 0 0 12px; color: var(--gold); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.14em; }
.prompt-panel h2 { margin: 0; font-size: clamp(1.45rem, 3.8vw, 2.6rem); letter-spacing: -0.04em; }
.prompt-panel > p:not(.stage-kicker) { max-width: 680px; min-height: 48px; margin: 14px 0 16px; color: var(--muted); line-height: 1.55; }

.arrow-display {
  position: relative;
  display: grid;
  width: min(260px, 78vw);
  height: 178px;
  margin: 2px 0 22px;
  place-items: center;
  overflow: hidden;
  border: 4px solid var(--line);
  background: #181221;
  box-shadow: 8px 8px 0 var(--shadow);
}

.arrow-display::before {
  position: absolute;
  inset: 12px;
  border: 2px dashed rgba(93, 217, 231, 0.2);
  content: "";
}

.arrow-symbol {
  position: relative;
  z-index: 2;
  color: var(--muted);
  font-size: clamp(6rem, 18vw, 9rem);
  font-weight: 950;
  line-height: 0.8;
  text-shadow: 5px 5px 0 #0d0a12;
}

.game-stage[data-state="preview"] .arrow-display { border-color: var(--gold); }
.game-stage[data-state="preview"] .arrow-symbol { color: var(--gold); }
.game-stage[data-state="active"] .arrow-display { border-color: var(--blue); box-shadow: 8px 8px 0 var(--shadow), 0 0 32px rgba(93, 217, 231, 0.22); }
.game-stage[data-state="active"] .arrow-symbol { color: var(--blue); }
.arrow-display.is-flashing .arrow-symbol { animation: arrow-flash 260ms steps(3, end); }
.arrow-display.is-flashing .flash-lines i { animation: line-flash 320ms steps(3, end); }

.scan-corner { position: absolute; z-index: 3; width: 18px; height: 18px; border-color: var(--blue); }
.scan-corner.top-left { top: 8px; left: 8px; border-top: 3px solid; border-left: 3px solid; }
.scan-corner.top-right { top: 8px; right: 8px; border-top: 3px solid; border-right: 3px solid; }
.scan-corner.bottom-left { bottom: 8px; left: 8px; border-bottom: 3px solid; border-left: 3px solid; }
.scan-corner.bottom-right { right: 8px; bottom: 8px; border-right: 3px solid; border-bottom: 3px solid; }
.flash-lines { position: absolute; inset: 0; pointer-events: none; }
.flash-lines i { position: absolute; top: 50%; width: 26px; height: 3px; background: var(--blue); opacity: 0; }
.flash-lines i:nth-child(1) { left: 9px; transform: translateY(-31px); }
.flash-lines i:nth-child(2) { right: 9px; transform: translateY(-1px); }
.flash-lines i:nth-child(3) { left: 14px; transform: translateY(28px); }

.timing-wrap { width: min(560px, 100%); margin: 0 0 15px; }
.timing-wrap[hidden] { display: none; }
.timing-labels { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; color: var(--muted); font-size: 0.67rem; font-weight: 850; letter-spacing: 0.1em; }
.deadline-track { height: 15px; overflow: hidden; border: 3px solid var(--line); background: #0e0b14; }
.deadline-fill { display: block; width: 100%; height: 100%; transform: scaleX(1); transform-origin: left; background: repeating-linear-gradient(90deg, var(--blue) 0 18px, #2f99a8 18px 21px); }
.deadline-fill.is-danger { background: repeating-linear-gradient(90deg, var(--red) 0 18px, #9c3141 18px 21px); }

.result-flash { display: flex; min-height: 52px; margin-bottom: 12px; flex-direction: column; justify-content: center; }
.result-flash[hidden] { display: none; }
.result-flash strong { color: var(--green); font-size: 1.8rem; }
.result-flash span { color: var(--muted); font-size: 0.84rem; }

.change-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  width: min(560px, 100%);
  min-height: 104px;
  margin: 8px auto 0;
  align-items: center;
  gap: 18px;
  padding: 15px 28px;
  border: 4px solid var(--ink);
  border-radius: 0;
  background: var(--blue);
  box-shadow: 7px 7px 0 var(--shadow);
  color: #10131c;
  cursor: pointer;
  text-align: left;
  touch-action: manipulation;
  user-select: none;
}

.change-button:disabled { cursor: default; filter: saturate(0.35); opacity: 0.48; }
.change-button:not(:disabled):hover { background: #88eff8; }
.change-button:not(:disabled):active,
.change-button.is-pressed { transform: translate(3px, 3px); box-shadow: 4px 4px 0 var(--shadow); }
.change-button:focus-visible { outline: 4px solid var(--gold); outline-offset: 3px; }
.change-icon { font-size: 3.5rem; font-weight: 950; line-height: 1; }
.change-button strong { display: block; font-size: 1.45rem; letter-spacing: 0.08em; }
.change-button small { display: block; margin-top: 5px; color: #1d4e56; font-size: 0.72rem; font-weight: 850; letter-spacing: 0.08em; }
.control-note { max-width: 720px; margin: 19px auto 0; color: var(--muted); font-size: 0.86rem; line-height: 1.5; text-align: center; }
.game-stage[data-state="preview"] .primary-button,
.game-stage[data-state="active"] .primary-button,
.game-stage[data-state="feedback"] .primary-button { visibility: hidden; }

.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 minmax(0, 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: repeat(2, minmax(0, 1fr)); gap: 22px; }
.info-panel { min-width: 0; padding: 30px; border: 2px solid var(--line); background: var(--panel); }
.info-panel h2 { margin-bottom: 22px; overflow-wrap: anywhere; }
.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(5, 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; overflow-wrap: anywhere; 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 arrow-flash {
  0% { transform: scale(0.56); opacity: 0; }
  45% { transform: scale(1.16); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes line-flash {
  0% { opacity: 0; transform: translateX(0); }
  45% { opacity: 1; }
  100% { opacity: 0; transform: translateX(18px); }
}

@media (max-width: 820px) {
  .game-heading { grid-template-columns: minmax(0, 1fr); }
  .progress-box { display: flex; align-items: center; justify-content: space-between; }
  .progress-box > span { margin: 0; }
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-right: 0; }
  .stat:nth-child(-n + 3) { border-bottom: 2px solid var(--line); }
  .stat:nth-child(4) { grid-column: span 1; }
  .stat:nth-child(5) { grid-column: span 2; border-right: 0; }
  .related-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .change-shell { width: min(100% - 18px, 600px); 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.5vw, 3.5rem); }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(odd), .stat:nth-child(even) { grid-column: span 1; border-right: 2px solid var(--line); border-bottom: 2px solid var(--line); }
  .stat:nth-child(even) { border-right: 0; }
  .stat:nth-child(5) { grid-column: span 2; border-right: 0; border-bottom: 0; }
  .game-stage { min-height: 690px; padding: 32px 14px 24px; }
  .prompt-panel { min-height: 480px; }
  .arrow-display { width: min(220px, 76vw); height: 154px; }
  .arrow-symbol { font-size: 6.5rem; }
  .change-button { min-height: 108px; gap: 12px; padding: 13px 17px; }
  .change-icon { font-size: 2.85rem; }
  .change-button strong { font-size: 1.18rem; }
  .content-section,
  .reading-grid { grid-template-columns: minmax(0, 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: minmax(0, 1fr); }
  .related-links a { min-height: 92px; }
}

@media (max-width: 360px) {
  .change-shell { width: calc(100% - 12px); }
  .game-heading { padding-inline: 13px; }
  .game-stage { padding-inline: 10px; }
  .arrow-display { width: min(202px, 75vw); }
  .change-button { padding-inline: 12px; }
  .change-button small { letter-spacing: 0.03em; }
}

@media (prefers-reduced-motion: reduce) {
  .arrow-display.is-flashing .arrow-symbol,
  .arrow-display.is-flashing .flash-lines i { animation: none; }
  .deadline-fill { transition: none !important; }
  .change-button { transition: none; }
}
