.trainer-shell { position: relative; z-index: 1; width: min(calc(100% - 32px), var(--ng-max)); margin: 0 auto; padding: clamp(42px, 7vw, 92px) 0 max(70px, env(safe-area-inset-bottom)); }
.game-state { min-height: calc(100dvh - 190px); }
.game-state:not(.is-active) { display: none; }

.game-state--intro { display: grid; grid-template-columns: minmax(0, 1.28fr) minmax(300px, .72fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.game-state--intro > * { min-width: 0; }
.intro-copy h1 { max-width: 780px; margin: 20px 0; font-size: clamp(3.25rem, 7.1vw, 7rem); line-height: .88; letter-spacing: -.075em; }
.intro-copy h1 em { color: var(--ng-accent); font-style: normal; text-shadow: 0 0 55px rgba(98, 245, 210, .18); }
.lead { max-width: 680px; margin: 0; color: var(--ng-muted); font-size: clamp(1.05rem, 1.8vw, 1.3rem); }
.intro-actions, .result-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.session-highlights { display: flex; gap: 0; margin: 42px 0 0; padding: 0; list-style: none; }
.session-highlights li { min-width: 130px; padding-right: 26px; margin-right: 26px; border-right: 1px solid var(--ng-border); display: grid; }
.session-highlights li:last-child { border: 0; }
.session-highlights strong { font-size: 2rem; line-height: 1; }
.session-highlights span { margin-top: 7px; color: var(--ng-muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }

.setup-panel { padding: clamp(24px, 3vw, 38px); }
.setup-panel h2 { margin: 8px 0 26px; font-size: 2rem; }
.field-label, .pace-selector legend { display: block; margin-bottom: 9px; color: var(--ng-muted); font-size: .82rem; font-weight: 750; }
.setup-panel select { width: 100%; min-height: 52px; padding: 0 15px; border: 1px solid var(--ng-border); border-radius: 14px; background: #0a2026; color: var(--ng-text); }
.pace-selector { display: grid; gap: 8px; margin: 24px 0 0; padding: 0; border: 0; }
.pace-selector label { min-height: 58px; padding: 10px 14px; display: flex; gap: 12px; align-items: center; border: 1px solid rgba(111,247,222,.12); border-radius: 15px; background: rgba(255,255,255,.025); cursor: pointer; }
.pace-selector label:has(input:checked) { border-color: var(--ng-border-strong); background: rgba(98,245,210,.08); }
.pace-selector input { width: 20px; height: 20px; accent-color: var(--ng-accent); }
.pace-selector span { display: grid; font-weight: 700; }
.pace-selector small { color: var(--ng-muted); font-weight: 450; }

.how-panel { grid-column: 1 / -1; margin-top: clamp(28px, 5vw, 70px); padding-top: 34px; border-top: 1px solid var(--ng-border); }
.how-panel h2 { margin: 8px 0 26px; font-size: clamp(1.8rem, 4vw, 3rem); }
.how-panel ol { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 0; padding: 0; list-style: none; }
.how-panel li { min-height: 150px; padding: 22px; display: flex; gap: 18px; border: 1px solid rgba(111,247,222,.13); border-radius: var(--ng-radius); background: rgba(6,18,24,.5); }
.how-panel li > span { color: var(--ng-accent); font-weight: 850; }
.how-panel strong { font-size: 1.05rem; }
.how-panel p { margin: 8px 0 0; color: var(--ng-muted); }

.game-state--focus, .game-state--result, .game-state--summary { min-height: calc(100dvh - 190px); display: none; place-items: center; align-content: center; text-align: center; }
.game-state--focus.is-active, .game-state--result.is-active, .game-state--summary.is-active { display: grid; }
.game-state--focus h2, .game-state--result h2, .game-state--summary h2 { max-width: 900px; margin: 14px auto; font-size: clamp(2.2rem, 6vw, 5.8rem); line-height: .95; letter-spacing: -.05em; }
.round-meta { color: var(--ng-muted); font-size: .82rem; font-weight: 750; letter-spacing: .11em; text-transform: uppercase; }
.prepare-count { width: clamp(120px, 18vw, 190px); aspect-ratio: 1; margin-top: 40px; display: grid; place-items: center; border: 1px solid var(--ng-border-strong); border-radius: 50%; background: rgba(98,245,210,.05); color: var(--ng-accent); font-size: clamp(4rem, 12vw, 8rem); font-weight: 850; box-shadow: 0 0 80px rgba(98,245,210,.1); }
.number-sequence { max-width: 96vw; color: var(--ng-text); font-size: clamp(3rem, 11vw, 9rem); font-weight: 800; letter-spacing: clamp(.04em, .8vw, .12em); line-height: 1; overflow-wrap: anywhere; text-shadow: 0 0 50px rgba(98,245,210,.22); }
.time-track { width: min(620px, 80vw); height: 4px; margin-top: 52px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.1); }
.time-track span { display: block; width: 100%; height: 100%; background: var(--ng-accent); transform-origin: left; }
.answer-input { width: min(820px, 92vw); min-height: 100px; margin: 28px 0 8px; padding: 12px 22px; border: 1px solid var(--ng-border-strong); border-radius: var(--ng-radius); background: rgba(4,15,20,.72); color: var(--ng-text); text-align: center; font-size: clamp(2rem, 8vw, 5.8rem); font-weight: 800; letter-spacing: .08em; caret-color: var(--ng-accent); }
.input-hint { margin: 0 0 18px; color: var(--ng-muted); }
.number-pad { width: min(360px, 100%); display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.number-pad button { min-height: 56px; border: 1px solid var(--ng-border); border-radius: 16px; background: rgba(255,255,255,.045); color: var(--ng-text); font-size: 1.35rem; font-weight: 760; cursor: pointer; }
.number-pad button[data-submit-answer] { background: var(--ng-accent); color: var(--ng-accent-ink); }
.number-pad button[data-delete] { color: var(--ng-danger); }

.result-lead { max-width: 620px; margin: 0 auto 24px; color: var(--ng-muted); font-size: 1.1rem; }
.result-compare { width: min(720px, 100%); padding: 22px; text-align: left; }
.result-compare > div:not(.digit-comparison) { display: flex; justify-content: space-between; gap: 20px; padding: 10px 0; border-bottom: 1px solid rgba(111,247,222,.11); }
.result-compare span { color: var(--ng-muted); }
.result-compare output { overflow-wrap: anywhere; font-weight: 780; letter-spacing: .08em; }
.digit-comparison { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; padding-top: 18px; }
.digit-comparison span { width: 32px; height: 42px; display: grid; place-items: center; border-radius: 9px; color: var(--ng-text); background: rgba(125,246,178,.1); }
.digit-comparison .is-wrong { background: rgba(255,123,152,.16); color: #ffb2c3; border: 1px solid rgba(255,123,152,.45); }
.result-stats, .summary-grid { width: min(720px, 100%); display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.result-stats > div, .summary-grid article { padding: 18px; display: grid; }
.result-stats strong, .summary-grid strong { font-size: 1.8rem; }
.result-stats span, .summary-grid span { color: var(--ng-muted); font-size: .8rem; }
.summary-grid { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 820px) {
  .trainer-shell { width: min(calc(100% - 24px), 680px); padding-top: 42px; }
  .game-state--intro { grid-template-columns: 1fr; }
  .intro-copy h1 { font-size: clamp(3.2rem, 14vw, 6rem); }
  .setup-panel { order: 2; }
  .how-panel { order: 3; }
  .how-panel ol { grid-template-columns: 1fr; }
  .how-panel li { min-height: 0; }
  .session-highlights { overflow-x: auto; padding-bottom: 8px; }
  .session-highlights li { min-width: 112px; padding-right: 16px; margin-right: 16px; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .trainer-shell { width: calc(100% - 20px); padding-top: 34px; }
  .intro-copy h1 { margin: 16px 0; font-size: clamp(2.9rem, 15vw, 4.8rem); }
  .intro-actions, .result-actions { display: grid; }
  .intro-actions .button, .result-actions .button { width: 100%; }
  .game-state--focus, .game-state--result, .game-state--summary { min-height: calc(100dvh - 150px); }
  .answer-input { min-height: 82px; font-size: clamp(1.8rem, 11vw, 3.8rem); }
  .number-pad { width: 100%; }
  .number-pad button { min-height: 58px; }
  .result-stats { grid-template-columns: 1fr 1fr; }
  .result-stats > div:last-child { grid-column: 1 / -1; }
}
