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

.game-heading {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 30px;
  align-items: end;
  padding: 30px 34px;
  border-bottom: 3px solid var(--ink);
}

.eyebrow,
.section-kicker,
.stage-kicker {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.game-heading h1 {
  max-width: 790px;
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 5rem);
  line-height: 0.92;
  letter-spacing: -0.06em;
}

.lede {
  max-width: 690px;
  margin: 18px 0 0;
  color: var(--muted);
  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.72rem;
  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(4, 1fr);
  border-bottom: 3px solid var(--ink);
}

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

.stat:last-child { border-right: 0; }
.stat strong { font-size: clamp(1rem, 2.5vw, 1.45rem); }

.game-stage {
  min-height: 610px;
  padding: 38px 34px 30px;
  background:
    linear-gradient(rgba(247, 201, 72, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(247, 201, 72, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 50% 26%, #2a2039 0, transparent 54%);
  background-size: 24px 24px, 24px 24px, auto;
}

.signal-panel {
  display: flex;
  min-height: 400px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.traffic-light {
  display: grid;
  width: 140px;
  height: 140px;
  margin: 4px 0 22px;
  place-items: center;
  border: 6px solid var(--line);
  background: #211a2e;
  box-shadow: 8px 8px 0 var(--shadow);
  color: var(--muted);
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
}

.traffic-light[data-signal="green"] {
  border-color: var(--green);
  background: #174528;
  box-shadow: 0 0 42px rgba(83, 221, 131, 0.38), 8px 8px 0 var(--shadow);
  color: var(--green);
}

.traffic-light[data-signal="red"] {
  border-color: var(--red);
  background: #501927;
  box-shadow: 0 0 42px rgba(237, 78, 92, 0.38), 8px 8px 0 var(--shadow);
  color: var(--red);
  font-size: 4rem;
}

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

.signal-panel h2 {
  margin: 0;
  font-size: clamp(1.55rem, 4vw, 2.65rem);
  letter-spacing: -0.04em;
}

.signal-panel > p:not(.stage-kicker):not(.sr-only) {
  max-width: 680px;
  min-height: 48px;
  margin: 14px 0 12px;
  color: var(--muted);
  line-height: 1.55;
}

.rules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: min(520px, 100%);
  margin: 8px 0 18px;
}

.rules div {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 13px;
  border: 2px solid var(--line);
  background: #171220;
  font-size: 0.8rem;
}

.green-dot,
.red-dot { width: 14px; height: 14px; border: 2px solid var(--ink); }
.green-dot { background: var(--green); }
.red-dot { background: var(--red); }

.result-flash {
  display: flex;
  min-height: 48px;
  margin-bottom: 14px;
  flex-direction: column;
  justify-content: center;
}

.result-flash[hidden] { display: none; }
.result-flash strong { font-size: 1.75rem; }
.result-flash span { color: var(--muted); font-size: 0.82rem; }

.response-button {
  display: flex;
  width: min(650px, 100%);
  min-height: 96px;
  margin: 18px auto 0;
  align-items: center;
  justify-content: center;
  gap: 22px;
  border: 3px solid var(--ink);
  border-radius: 0;
  background: #2a2039;
  box-shadow: 6px 6px 0 var(--shadow);
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
  letter-spacing: 0.08em;
  touch-action: manipulation;
  user-select: none;
}

.key-pair { display: flex; gap: 8px; }
.key-pair kbd { width: auto; min-width: 76px; padding: 0 9px; font-size: 0.75rem; }
.response-button:hover:not(:disabled) { background: #392b4b; }
.response-button:active:not(:disabled),
.response-button.is-pressed { transform: translate(3px, 3px); box-shadow: 3px 3px 0 var(--shadow); }
.response-button:focus-visible { outline: 4px solid var(--gold); outline-offset: 3px; }
.response-button:disabled { cursor: not-allowed; opacity: 0.46; }

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

.game-stage[data-state="waiting"] .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 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); 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; 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, 1fr); gap: 12px; margin-top: 28px; }
.related-links a { display: flex; min-height: 112px; 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 waiting-pulse {
  0%, 49% { border-color: var(--line); color: var(--muted); }
  50%, 100% { border-color: var(--gold); color: var(--gold); }
}

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

@media (max-width: 620px) {
  .traffic-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(2.2rem, 11.5vw, 3.7rem); }
  .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: 30px 14px 24px; }
  .signal-panel { min-height: 430px; }
  .traffic-light { width: 112px; height: 112px; font-size: 2.4rem; }
  .traffic-light[data-signal="red"] { font-size: 3.2rem; }
  .rules { gap: 8px; }
  .rules div { flex-direction: column; font-size: 0.7rem; }
  .response-button { min-height: 100px; flex-direction: column; gap: 10px; }
  .key-pair kbd { min-width: 70px; }
  .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: 90px; }
}

@media (prefers-reduced-motion: reduce) {
  .game-stage[data-state="waiting"] .traffic-light { animation: none; }
  .deadline-fill { transition: none !important; }
}
