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

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

.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 {
  margin: 0;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.game-heading h1 {
  max-width: 800px;
  margin: 10px 0 0;
  font-size: clamp(2.2rem, 7vw, 4.8rem);
  line-height: 0.94;
}

.lede {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.score-box {
  min-width: 160px;
  padding: 16px;
  border: 2px solid var(--line);
  border-radius: 5px;
  background: #0a2026;
  text-align: center;
}

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

.score-box strong {
  color: var(--gold);
  font-size: 2rem;
}

.mode-panel {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 2px solid var(--line);
  background: #0a2026;
}

.mode-switch {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.mode-switch button {
  padding: 10px 14px;
  border: 2px solid var(--line);
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.mode-switch button[aria-pressed="true"] {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--night);
}

.mode-switch button:disabled { cursor: not-allowed; opacity: 0.65; }

.mode-description {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
  text-align: right;
}

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

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

.stat:last-child { border-right: 0; }
.stat strong { font-size: clamp(1.05rem, 3vw, 1.55rem); }

.tap-stage {
  display: flex;
  min-height: 600px;
  flex-direction: column;
  align-items: center;
  padding: 28px 28px 34px;
  background:
    linear-gradient(rgba(88, 199, 215, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88, 199, 215, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 50% 38%, #173b45 0, transparent 62%);
  background-size: 24px 24px, 24px 24px, auto;
}

.stage-copy {
  min-height: 135px;
  text-align: center;
}

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

.stage-copy h2 {
  margin: 0;
  font-size: clamp(1.55rem, 5vw, 2.6rem);
}

.stage-copy > p:not(.stage-kicker) {
  max-width: 680px;
  margin: 10px auto 0;
  color: var(--muted);
  line-height: 1.5;
}

.timing-wrap {
  width: min(850px, 100%);
  margin-bottom: 20px;
}

.timing-labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.timing-labels strong { color: var(--ink); font-size: 1rem; }

.timing-bar {
  position: relative;
  height: 24px;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 5px;
  background: #071a1f;
  box-shadow: 4px 4px 0 var(--shadow);
}

.timing-bar > span {
  position: absolute;
  inset: 0;
  background: var(--gold);
  transform: scaleX(1);
  transform-origin: left center;
  will-change: transform;
}

.timing-bar[data-urgent="true"] > span { background: var(--red); }

.timing-bar i {
  position: absolute;
  z-index: 1;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(7, 26, 31, 0.38);
}

.timing-bar i:nth-of-type(1) { left: 25%; }
.timing-bar i:nth-of-type(2) { left: 50%; }
.timing-bar i:nth-of-type(3) { left: 75%; }

.tap-zones {
  position: relative;
  display: grid;
  width: min(850px, 100%);
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.tap-zone {
  display: flex;
  min-height: 210px;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  justify-content: center;
  border: 4px solid var(--line);
  border-bottom-width: 10px;
  border-radius: 5px;
  background: #0e2a31;
  color: var(--muted);
  cursor: pointer;
  touch-action: manipulation;
  transition: background 80ms linear, border-color 80ms linear, color 80ms linear, transform 80ms linear;
}

.tap-zone strong {
  font-size: clamp(2rem, 7vw, 4rem);
  letter-spacing: 0.06em;
}

.tap-zone kbd {
  display: grid;
  width: 48px;
  height: 44px;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 5px;
  background: rgba(7, 26, 31, 0.45);
  color: inherit;
  font-size: 1.2rem;
  font-weight: 900;
}

.next-badge {
  min-height: 1em;
  color: transparent;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.tap-stage[data-state="running"][data-expected="left"] .tap-left,
.tap-stage[data-state="running"][data-expected="right"] .tap-right {
  border-color: var(--gold);
  background: #284129;
  box-shadow: 0 0 0 3px rgba(247, 201, 72, 0.2), 7px 7px 0 var(--shadow);
  color: var(--ink);
}

.tap-stage[data-state="running"][data-expected="left"] .tap-left .next-badge,
.tap-stage[data-state="running"][data-expected="right"] .tap-right .next-badge {
  color: var(--gold);
}

.tap-zone:not(:disabled):active,
.tap-zone.is-pressed {
  border-bottom-width: 4px;
  transform: translateY(6px);
}

.tap-zone:disabled { cursor: not-allowed; opacity: 0.68; }

.tap-zone:focus-visible,
.mode-switch button:focus-visible,
.primary-button:focus-visible {
  outline: 4px solid var(--blue);
  outline-offset: 4px;
}

.tap-stage[data-flash="wrong"] .tap-zone {
  border-color: var(--red);
  background: #3f2227;
}

.sequence-marker {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--night);
  color: var(--blue);
  font-size: 2rem;
  font-weight: 900;
  transform: translate(-50%, -50%);
}

.quota-line {
  margin: 18px 0 0;
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.feedback {
  min-height: 1.4em;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-align: center;
}

.feedback[data-kind="correct"] { color: var(--green); }
.feedback[data-kind="wrong"] { color: var(--red); }

.primary-button {
  min-width: min(390px, 100%);
  margin-top: 8px;
}

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

.content-section,
.faq-section,
.related-section { margin-top: 48px; }

.content-section h2,
.faq-section h2,
.related-section h2,
.info-panel h2 { margin: 8px 0 0; }

.steps-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 0;
  list-style: none;
}

.steps-list li,
.info-panel,
.faq-list details,
.related-links a {
  border: 2px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
}

.steps-list li {
  display: flex;
  gap: 14px;
  padding: 20px;
}

.steps-list li > span {
  color: var(--gold);
  font-size: 1.25rem;
  font-weight: 900;
}

.steps-list p,
.info-panel p,
.faq-list p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.reading-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 32px;
}

.info-panel { padding: 26px; }
.info-panel .section-kicker { margin: 0; }
.info-panel h2 { margin-bottom: 16px; }
.info-panel p + p { margin-top: 12px; }

.faq-list { display: grid; gap: 10px; margin-top: 18px; }
.faq-list details { padding: 18px 20px; }
.faq-list summary { font-weight: 800; cursor: pointer; }
.faq-list p { margin-top: 12px; }

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

.related-links a {
  display: flex;
  gap: 5px;
  flex-direction: column;
  padding: 18px;
  color: var(--ink);
  text-decoration: none;
}

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

@media (max-width: 720px) {
  .tap-shell { width: min(100% - 20px, 1080px); }
  .topbar { align-items: flex-start; }
  .topbar-meta { flex-wrap: wrap; justify-content: flex-end; }
  .game-heading { grid-template-columns: 1fr; gap: 18px; padding: 24px 20px; }
  .score-box { min-width: 0; }
  .mode-panel { align-items: stretch; flex-direction: column; }
  .mode-switch button { flex: 1; }
  .mode-description { text-align: left; }
  .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); }
  .tap-stage { min-height: 570px; padding: 24px 14px 30px; }
  .tap-zone { min-height: 190px; }
  .steps-list,
  .reading-grid,
  .related-links { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .topbar-meta { max-width: 210px; }
  .topbar-link { font-size: 0.63rem; }
  .game-heading h1 { font-size: clamp(2rem, 12vw, 3rem); }
  .tap-zones { gap: 10px; }
  .tap-zone { min-height: 180px; padding: 10px; }
  .tap-zone strong { font-size: clamp(1.55rem, 10vw, 2.25rem); }
  .sequence-marker { width: 44px; height: 44px; font-size: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .tap-zone { transition: none; }
  .timing-bar > span { will-change: auto; }
}
