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

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

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

.test-heading .eyebrow { margin-bottom: 10px; }
.test-heading h1 { max-width: 760px; font-size: clamp(2.2rem, 7vw, 4.8rem); line-height: .94; }
.lede { max-width: 680px; margin: 18px 0 0; color: var(--muted); font-size: 1rem; line-height: 1.6; }

.progress-box {
  min-width: 168px;
  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: .76rem;
  font-weight: 800;
  letter-spacing: .1em;
}

.progress-box strong { color: var(--gold); font-size: 1.6rem; }
.test-card > .mode-panel { margin: 0; padding: 22px 24px; border-bottom: 3px solid var(--ink); background: #16111f; }

.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.08rem, 3vw, 1.7rem); }

.test-stage {
  display: flex;
  min-height: 640px;
  flex-direction: column;
  align-items: center;
  padding: 40px 34px 32px;
  background:
    linear-gradient(rgba(247, 201, 72, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(247, 201, 72, .025) 1px, transparent 1px),
    radial-gradient(circle at 50% 42%, #2a2039 0, transparent 55%);
  background-size: 24px 24px, 24px 24px, auto;
  transition: background-color 120ms ease;
}

.status-copy { width: 100%; max-width: 700px; min-height: 132px; text-align: center; }
.stage-kicker { margin: 0 0 10px; color: var(--gold); font-size: .78rem; font-weight: 800; letter-spacing: .14em; }
.status-copy h2 { margin: 0; color: var(--ink); font-size: clamp(1.6rem, 4vw, 2.8rem); letter-spacing: -.04em; }
.status-copy > p:last-child { max-width: 650px; margin: 14px auto 0; color: var(--muted); font-size: .96rem; line-height: 1.55; }

.hold-pad {
  display: flex;
  width: min(700px, 100%);
  min-height: 270px;
  flex-direction: column;
  gap: 13px;
  align-items: center;
  justify-content: center;
  padding: 26px;
  border: 4px solid var(--ink);
  border-radius: 0;
  background: #211a2e;
  box-shadow: 8px 8px 0 var(--shadow);
  color: var(--ink);
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: background 100ms ease, box-shadow 80ms ease, transform 80ms ease;
}

.hold-pad.is-held { transform: translate(5px, 5px); box-shadow: 3px 3px 0 var(--shadow); }
.hold-pad:focus-visible,
.related-links a:focus-visible,
.faq-list summary:focus-visible { outline: 4px solid var(--blue); outline-offset: 4px; }

.signal-core {
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
  border: 4px solid #554967;
  background: #30273d;
  box-shadow: inset 0 0 0 7px #17121f;
  color: #a497b7;
  font-size: 3.5rem;
  line-height: 1;
}

.signal-action { font-size: 1rem; font-weight: 900; letter-spacing: .16em; }
.signal-keys { display: flex; gap: 8px; }
.signal-keys kbd { width: auto; min-width: 74px; padding: 0 8px; color: var(--muted); font-size: .72rem; }

.timing-block { width: min(700px, 100%); min-height: 48px; margin-top: 16px; visibility: hidden; }
.test-stage[data-state="signal"] .timing-block { visibility: visible; }
.timing-label { display: block; margin-bottom: 7px; color: var(--muted); font-size: .68rem; font-weight: 900; letter-spacing: .14em; text-align: center; }
.deadline-track { width: 100%; height: 18px; overflow: hidden; border: 3px solid var(--ink); background: #120f1d; box-shadow: 3px 3px 0 var(--shadow); }
.deadline-fill { display: block; width: 100%; height: 100%; background: var(--green); transform: scaleX(1); transform-origin: left center; }
.deadline-fill.is-danger { background: var(--red); }

.test-stage > .primary-button { margin-top: 20px; }
.control-note { max-width: 700px; margin: 20px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.5; text-align: center; }

.test-stage[data-state="ready-hold"] .primary-button,
.test-stage[data-state="waiting"] .primary-button,
.test-stage[data-state="signal"] .primary-button,
.test-stage[data-mode="endless"][data-state="result"] .primary-button { visibility: hidden; }

.test-stage[data-state="waiting"] .hold-pad { border-color: var(--gold); background: #342a1c; }
.test-stage[data-state="waiting"] .signal-core { border-color: var(--gold); color: var(--gold); animation: holding-pulse 900ms steps(2, end) infinite; }
.test-stage[data-state="signal"] { background-color: #123720; }
.test-stage[data-state="signal"] .hold-pad { border-color: #b9ffd0; background: var(--green); box-shadow: 3px 3px 0 #071a0d, 0 0 42px rgba(83, 221, 131, .3); color: #082313; }
.test-stage[data-state="signal"] .signal-core { border-color: #082313; background: #b9ffd0; box-shadow: inset 0 0 0 7px #4fce7b; color: #082313; }
.test-stage[data-state="signal"] .signal-keys kbd { border-color: #287846; background: #8bf2ad; color: #082313; }
.test-stage[data-state="false-start"],
.test-stage[data-state="timeout"],
.test-stage[data-state="game-over"] { background-color: #351521; }
.test-stage[data-state="complete"] { background-color: #2d2515; }
.test-stage[data-state="result"] { background-color: #153244; }

.content-section { display: grid; grid-template-columns: .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: -.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); }
.related-links small { color: var(--muted); font-size: .76rem; font-weight: 400; }

@keyframes holding-pulse {
  0%, 49% { color: #796a3d; }
  50%, 100% { color: var(--gold); }
}

@media (max-width: 820px) {
  .test-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) {
  .hold-shell { width: min(100% - 18px, 600px); padding-top: 10px; }
  .topbar { align-items: flex-start; }
  .topbar-meta { flex-wrap: wrap; justify-content: flex-end; }
  .best-label,
  #saved-best { display: none; }
  .language-chip { margin-left: 0; }
  .test-card { box-shadow: 6px 6px 0 var(--shadow); }
  .test-heading { gap: 20px; padding: 24px 18px; }
  .test-heading h1 { font-size: clamp(2rem, 10.5vw, 3.5rem); overflow-wrap: anywhere; }
  .test-card > .mode-panel { padding-inline: 16px; }
  .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); }
  .test-stage { min-height: 610px; padding: 32px 14px 24px; }
  .status-copy { min-height: 158px; }
  .hold-pad { min-height: 236px; padding: 20px 12px; }
  .signal-core { width: 96px; height: 96px; font-size: 3rem; }
  .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) {
  .test-stage,
  .hold-pad,
  .signal-core { transition: none; }
  .test-stage[data-state="waiting"] .signal-core { animation: none; }
  .deadline-fill { transition-duration: 0s !important; }
}
