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

.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: 850px;
  font-size: clamp(2.2rem, 6.8vw, 4.8rem);
  line-height: 0.94;
}

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

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

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

.trial-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, 1fr);
  border-bottom: 3px solid var(--ink);
}

.stat {
  min-width: 0;
  padding: 18px 20px;
  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: 740px;
  flex-direction: column;
  align-items: center;
  padding: 34px 28px 30px;
  background:
    linear-gradient(rgba(88, 199, 215, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88, 199, 215, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 50% 43%, #263044 0, transparent 52%);
  background-size: 24px 24px, 24px 24px, auto;
}

.stage-copy {
  min-height: 112px;
  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.5rem, 4vw, 2.55rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

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

.deadline-track {
  flex: none;
  margin: 4px auto 16px;
}

.vision-field {
  position: relative;
  width: min(700px, 94vw);
  aspect-ratio: 16 / 8.6;
  overflow: hidden;
  border: 3px solid var(--line);
  background:
    linear-gradient(rgba(88, 199, 215, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88, 199, 215, 0.05) 1px, transparent 1px),
    #151321;
  background-size: 32px 32px;
  box-shadow: 7px 7px 0 var(--shadow);
}

.vision-field::before,
.vision-field::after {
  position: absolute;
  background: rgba(88, 199, 215, 0.08);
  content: "";
  pointer-events: none;
}

.vision-field::before {
  top: 50%;
  right: 0;
  left: 0;
  height: 1px;
}

.vision-field::after {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
}

.scan-line {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44%;
  aspect-ratio: 1;
  border: 1px solid rgba(88, 199, 215, 0.12);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.scan-line::before,
.scan-line::after {
  position: absolute;
  border: 1px solid rgba(88, 199, 215, 0.1);
  border-radius: 50%;
  content: "";
}

.scan-line::before { inset: 20%; }
.scan-line::after { inset: -34%; }

.fixation {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  width: 58px;
  height: 58px;
  border: 2px solid var(--blue);
  background: #171626;
  box-shadow: 0 0 18px rgba(88, 199, 215, 0.3), 4px 4px 0 var(--shadow);
  transform: translate(-50%, -50%);
}

.fixation::before,
.fixation::after,
.fixation span::before,
.fixation span::after {
  position: absolute;
  background: var(--blue);
  content: "";
}

.fixation::before { top: 10px; bottom: 10px; left: 26px; width: 3px; }
.fixation::after { top: 26px; right: 10px; left: 10px; height: 3px; }
.fixation span::before { top: -2px; left: 24px; width: 7px; height: 7px; }
.fixation span::after { bottom: -2px; left: 24px; width: 7px; height: 7px; }

.fixation-label {
  position: absolute;
  top: calc(50% + 42px);
  left: 50%;
  z-index: 3;
  padding: 3px 6px;
  background: #151321;
  color: var(--blue);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  transform: translateX(-50%);
  white-space: nowrap;
}

.edge-signal {
  position: absolute;
  z-index: 4;
  display: none;
  min-width: 74px;
  min-height: 66px;
  align-items: center;
  justify-content: center;
  border: 3px solid #fff1a1;
  background: var(--gold);
  box-shadow: 0 0 28px rgba(247, 201, 72, 0.62), 5px 5px 0 var(--shadow);
  color: #21190e;
  text-align: center;
}

.edge-signal b {
  display: block;
  font-size: 2.35rem;
  line-height: 0.9;
}

.edge-signal small {
  display: block;
  margin-top: 3px;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.signal-up { top: 14px; left: 50%; transform: translateX(-50%); }
.signal-right { top: 50%; right: 14px; transform: translateY(-50%); }
.signal-down { bottom: 14px; left: 50%; transform: translateX(-50%); }
.signal-left { top: 50%; left: 14px; transform: translateY(-50%); }
.edge-signal.is-active { display: grid; }

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

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

.feedback[hidden] { display: none; }

.feedback strong {
  color: var(--green);
  font-size: 1.35rem;
}

.feedback span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.direction-pad {
  display: grid;
  width: min(560px, 100%);
  grid-template-areas:
    ". up ."
    "left . right"
    ". down .";
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 22px;
}

.direction-up { grid-area: up; }
.direction-right { grid-area: right; }
.direction-down { grid-area: down; }
.direction-left { grid-area: left; }

.direction-button {
  display: grid;
  min-height: 72px;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  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;
  touch-action: manipulation;
  transition: transform 80ms ease, box-shadow 80ms ease, background 100ms ease;
  user-select: none;
}

.direction-button > span {
  color: var(--gold);
  font-size: 2rem;
  font-weight: 900;
}

.direction-button b {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

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

.direction-button:hover { background: #302540; }

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

.direction-button:focus-visible {
  z-index: 2;
  outline: 4px solid var(--blue);
  outline-offset: 3px;
}

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

.game-stage[data-state="waiting"] .fixation {
  animation: fixation-pulse 900ms steps(2, end) infinite;
}

.game-stage[data-state="active"] .vision-field { border-color: var(--gold); }

.game-stage[data-state="wrong"],
.game-stage[data-state="early"],
.game-stage[data-state="game-over"] {
  background-color: #351521;
}

.game-stage[data-state="complete"] { background-color: #2d2515; }

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

.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(5, 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: 0.76rem; font-weight: 400; }

@keyframes fixation-pulse {
  0%, 49% { border-color: var(--blue); }
  50%, 100% { border-color: var(--gold); }
}

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

@media (max-width: 620px) {
  .peripheral-shell { width: min(100% - 18px, 600px); padding-top: 10px; }
  .game-heading { gap: 20px; padding: 24px 18px; }
  .game-heading h1 { font-size: clamp(2.05rem, 11vw, 3.7rem); }
  .game-card > .mode-panel { padding: 18px 14px; }
  .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: 700px; padding: 28px 12px 24px; }
  .stage-copy { min-height: 122px; }
  .vision-field { width: 100%; aspect-ratio: 1.08; }
  .edge-signal { min-width: 62px; min-height: 58px; }
  .edge-signal b { font-size: 2rem; }
  .signal-up { top: 9px; }
  .signal-right { right: 9px; }
  .signal-down { bottom: 9px; }
  .signal-left { left: 9px; }
  .fixation { width: 52px; height: 52px; }
  .fixation::before { top: 9px; bottom: 9px; left: 23px; }
  .fixation::after { top: 23px; right: 9px; left: 9px; }
  .fixation span::before { left: 21px; }
  .fixation span::after { left: 21px; }
  .direction-pad { gap: 7px; }
  .direction-button { min-height: 66px; grid-template-columns: 1fr; gap: 1px; padding: 7px 5px; }
  .direction-button > span { font-size: 1.65rem; line-height: 1; }
  .direction-button kbd { display: none; }
  .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 (prefers-reduced-motion: reduce) {
  .game-stage[data-state="waiting"] .fixation { animation: none; }
  .direction-button { transition: none; }
}
