.start-card {
  overflow: hidden;
  border: 3px solid var(--ink);
  background: var(--panel);
  box-shadow: 10px 10px 0 var(--shadow);
}

.game-heading {
  display: flex;
  gap: 28px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 26px 30px 24px;
  border-bottom: 3px solid var(--ink);
}

.game-heading .eyebrow {
  margin-bottom: 8px;
}

.game-heading h1 {
  max-width: none;
  font-size: clamp(2.2rem, 7vw, 5.2rem);
  line-height: 0.9;
  text-shadow: 4px 4px 0 #5b2a38;
}

.attempt-count {
  display: grid;
  flex: 0 0 auto;
  gap: 7px;
  min-width: 112px;
  text-align: right;
}

.attempt-count span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.attempt-count strong {
  color: var(--gold);
  font-size: 1.5rem;
}

.test-stage {
  display: flex;
  min-height: 500px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 46px 24px 40px;
  background:
    linear-gradient(180deg, transparent 74%, rgba(0, 0, 0, 0.26) 74%),
    repeating-linear-gradient(90deg, transparent 0 44px, rgba(255, 255, 255, 0.018) 44px 46px);
  text-align: center;
  transition: background-color 120ms ease;
}

.light-gantry {
  display: grid;
  grid-template-columns: repeat(5, minmax(40px, 72px));
  gap: clamp(10px, 2vw, 22px);
  padding: 22px clamp(18px, 4vw, 38px);
  border: 3px solid var(--ink);
  background: #0c0a12;
  box-shadow: 7px 7px 0 var(--shadow);
}

.start-light {
  display: block;
  width: clamp(34px, 7vw, 58px);
  aspect-ratio: 1;
  border: 4px solid #51485d;
  background: #201a29;
  box-shadow: inset 0 0 0 5px #100d16;
}

.start-light.is-on {
  border-color: #ff8c94;
  background: var(--red);
  box-shadow:
    inset 0 0 0 5px #a5243b,
    0 0 24px rgba(237, 78, 92, 0.62);
}

.game-status {
  width: min(660px, 100%);
  min-height: 154px;
  padding-top: 28px;
}

.status-label {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.game-status h2 {
  margin: 0;
  font-size: clamp(1.8rem, 5vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.045em;
}

.game-status p:last-child {
  margin: 16px auto 0;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1rem;
  line-height: 1.55;
}

.reaction-pad {
  display: flex;
  width: min(520px, 100%);
  min-height: 84px;
  align-items: center;
  justify-content: center;
  gap: 20px;
  border: 3px solid var(--ink);
  border-radius: 0;
  background: #241d33;
  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;
}

.reaction-pad:focus-visible,
.related-links a:focus-visible,
.faq summary:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}

.reaction-pad kbd {
  width: auto;
  min-width: 86px;
  padding: 0 10px;
}

.test-stage .primary-button {
  margin-top: 24px;
}

.test-stage[data-state="sequence"] .primary-button,
.test-stage[data-state="waiting"] .primary-button,
.test-stage[data-state="ready"] .primary-button {
  display: none;
}

.test-stage:not([data-state="sequence"]):not([data-state="waiting"]):not([data-state="ready"]) .reaction-pad {
  opacity: 0.45;
}

.test-stage[data-state="ready"] {
  background-color: #163825;
}

.test-stage[data-state="ready"] .reaction-pad {
  background: var(--green);
  color: #0c2515;
  transform: translate(3px, 3px);
  box-shadow: 3px 3px 0 var(--shadow);
}

.test-stage[data-state="false-start"] {
  background-color: #3d1724;
}

.test-stage[data-state="complete"] {
  background-color: #322617;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  border-top: 3px solid var(--ink);
}

.stats div {
  display: grid;
  min-height: 112px;
  place-items: center;
  align-content: center;
  gap: 8px;
}

.stats div + div {
  border-left: 2px solid var(--line);
}

.stats dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.stats dd {
  margin: 0;
  color: var(--gold);
  font-size: clamp(1.35rem, 4vw, 2.25rem);
  font-weight: 900;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  padding: 78px 18px 48px;
}

.content-block h2,
.faq h2,
.related h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.steps {
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
  border-top: 2px solid var(--line);
}

.steps li {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 2px solid var(--line);
}

.steps li span {
  color: var(--gold);
  font-weight: 800;
}

.steps p,
.prose p,
.faq p {
  margin: 0;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1rem;
  line-height: 1.7;
}

.prose h2 {
  margin-bottom: 28px;
}

.prose p + p {
  margin-top: 18px;
}

.faq,
.related {
  padding: 54px 18px 64px;
  border-top: 2px solid var(--line);
}

.faq-list {
  margin-top: 30px;
  border-top: 2px solid var(--line);
}

.faq details {
  border-bottom: 2px solid var(--line);
}

.faq summary {
  padding: 22px 42px 22px 0;
  color: var(--ink);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.4;
}

.faq details p {
  max-width: 850px;
  padding: 0 0 22px;
}

.related-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 28px;
}

.related-links a {
  min-height: 58px;
  padding: 18px;
  border: 2px solid var(--line);
  color: var(--ink);
  font-weight: 800;
  line-height: 1.35;
  text-decoration: none;
}

.related-links a:hover {
  border-color: var(--gold);
  color: var(--gold);
}

@media (max-width: 720px) {
  .start-card {
    box-shadow: 6px 6px 0 var(--shadow);
  }

  .game-heading {
    align-items: center;
    padding: 20px 16px;
  }

  .game-heading h1 {
    font-size: clamp(2rem, 12vw, 3.7rem);
  }

  .attempt-count {
    min-width: 76px;
  }

  .test-stage {
    min-height: 470px;
    padding: 38px 14px 32px;
  }

  .light-gantry {
    grid-template-columns: repeat(5, minmax(32px, 1fr));
    width: 100%;
    gap: 8px;
    padding: 16px 12px;
  }

  .start-light {
    width: 100%;
  }

  .game-status {
    min-height: 176px;
  }

  .reaction-pad {
    min-height: 72px;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    font-size: 0.84rem;
  }

  .reaction-pad kbd {
    display: none;
  }

  .stats div {
    min-height: 92px;
  }

  .stats dt {
    font-size: 0.66rem;
  }

  .content-grid {
    grid-template-columns: 1fr;
    gap: 54px;
    padding: 62px 8px 42px;
  }

  .faq,
  .related {
    padding-right: 8px;
    padding-left: 8px;
  }

  .related-links {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .test-stage {
    transition: none;
  }
}
