/* Pocket Arena — a payment path, not a terminal. All assets are local. */
:root {
  color-scheme: dark;
  --bg: #111310;
  --surface: #1b1e19;
  --surface-raised: #252922;
  --ink: #f5f5ee;
  --muted: #b2b7aa;
  --dim: #909889;
  --line: #3a4034;
  --coral: #ff5a36;
  --green: #c6f16b;
  --dark-on-accent: #151b0d;
  --danger: #ff9b83;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --display: "Bricolage Grotesque", var(--font);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input, textarea { font: inherit; }
button, a, input, textarea, summary { -webkit-tap-highlight-color: transparent; }
button, summary { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:hover { color: var(--green); }
button:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--green); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; }
p { text-wrap: pretty; }
button, a, textarea, .patch-option { transition: background-color 180ms, color 180ms, border-color 180ms, transform 180ms var(--ease); }
::selection { color: var(--bg); background: var(--green); }
.skip-link { position: fixed; top: 8px; left: 12px; z-index: 20; padding: 12px 18px; color: var(--bg); background: var(--green); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.site-header { max-width: 1264px; margin: 0 auto; padding: 26px 40px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.wordmark { min-height: 44px; display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font-family: var(--display); font-size: 15px; font-weight: 800; line-height: 1; letter-spacing: -.025em; }
.wordmark > span:last-child { display: flex; flex-direction: column; gap: 3px; }
.wordmark-light { font-weight: 450; letter-spacing: .07em; font-size: 12px; }
.brand-symbol { display: grid; place-items: center; height: 34px; width: 34px; background: var(--coral); color: var(--bg); font-size: 30px; font-weight: 800; }
.arena-link { display: inline-flex; align-items: center; gap: 16px; min-height: 44px; font-size: 13px; text-decoration: none; color: var(--muted); }
.arena-link span { font-size: 21px; color: var(--coral); }
.arena-layout { max-width: 1184px; margin: 40px auto 0; padding: 0 40px; display: grid; grid-template-columns: minmax(0, 620px) minmax(280px, 340px); column-gap: 100px; align-items: start; }
.play-column, .ranking-column { min-width: 0; }
.opening-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; margin-bottom: 25px; }
.event-tag { display: inline-flex; align-items: center; gap: 8px; }
.event-tag::before { content: ''; display: inline-block; width: 7px; height: 7px; background: var(--coral); }
.duration { font-variant-numeric: tabular-nums; white-space: nowrap; }
.lobby h1 { font-size: 58px; font-weight: 850; line-height: 1.14; letter-spacing: -.035em; }
.coral-text { color: var(--coral); }
.opening-copy { font-size: 16px; line-height: 1.8; color: var(--muted); margin-top: 22px; }
.welcome-transfer { margin: 32px 0 0; padding: 21px 22px 17px; background: var(--surface); border-radius: 12px; }
.transfer-caption { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; }
.scheme-label { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; }
.transfer-track { display: flex; align-items: center; gap: 10px; margin: 20px 0 12px; }
.transfer-end { display: grid; place-items: center; height: 48px; width: 56px; border: 1px solid var(--muted); border-radius: 6px; font-weight: 700; font-size: 13px; }
.transfer-end.ledger-end { border-color: var(--green); color: var(--green); }
.transfer-line { flex: 1; min-width: 5px; height: 2px; background: var(--line); position: relative; }
.transfer-line::after { content: ''; position: absolute; right: -1px; top: -3px; width: 7px; height: 7px; border-top: 2px solid var(--dim); border-right: 2px solid var(--dim); transform: rotate(45deg); }
.gate-symbol { display: grid; place-items: center; width: 42px; height: 42px; background: var(--coral); color: var(--bg); font-size: 30px; font-weight: 700; border-radius: 50%; }
.transfer-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.welcome-stages { list-style: none; display: flex; padding: 0; margin: 26px 0; gap: 18px; justify-content: space-between; }
.welcome-stages li { display: flex; align-items: flex-start; gap: 10px; flex: 1; }
.welcome-stages li > span { color: var(--coral); font-family: var(--display); font-size: 22px; line-height: 1.35; }
.welcome-stages strong { display: block; font-size: 14px; line-height: 1.6; font-weight: 600; }
.welcome-stages small { display: block; font-size: 12px; color: var(--muted); line-height: 1.6; margin-top: 2px; }
.entry-actions { padding-top: 4px; }
.availability { display: flex; align-items: baseline; gap: 7px; font-size: 12px; margin-bottom: 12px; color: var(--muted); }
.availability::before { content: ''; flex: 0 0 6px; height: 6px; border-radius: 50%; background: var(--dim); }
.availability[data-state="ready"]::before { background: var(--green); }
.availability[data-state="error"], .availability[data-state="unavailable"] { color: var(--danger); }
.availability[data-state="error"]::before, .availability[data-state="unavailable"]::before { background: var(--coral); }
.button { min-height: 52px; padding: 12px 19px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; border: 0; border-radius: 8px; text-decoration: none; font-size: 15px; font-weight: 700; line-height: 1.5; }
.button.primary { background: var(--coral); color: #170d08; }
.button.primary:hover:not(:disabled) { background: #ff795b; color: #170d08; }
.button.primary:active:not(:disabled), .button.secondary:active:not(:disabled) { transform: scale(.98); }
.button.primary > span[aria-hidden] { font-size: 24px; font-weight: 500; line-height: 1; }
.button.secondary { background: var(--surface-raised); color: var(--ink); }
.button.secondary:hover:not(:disabled) { background: #343a2d; }
.button.quiet { background: transparent; color: var(--muted); font-size: 13px; min-height: 48px; font-weight: 500; }
.button.quiet:hover:not(:disabled) { background: var(--surface); color: var(--ink); }
.button-sub { font-size: 12px; color: var(--dim); font-weight: 400; }
.start-button { width: 100%; justify-content: space-between; }
.entry-actions > .quiet { width: 100%; margin-top: 4px; }
.safety-note { text-align: center; font-size: 12px; color: var(--muted); margin-top: 1px; }
.text-button { background: transparent; border: 0; min-height: 44px; padding: 9px 0; color: var(--muted); font-size: 12px; text-decoration: underline; text-underline-offset: 4px; }
.text-button:hover:not(:disabled) { color: var(--ink); }
.inline-error { padding: 16px; border-radius: 8px; color: var(--danger); background: var(--surface); }
.ranking-column { padding-top: 6px; position: sticky; top: 32px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-heading h2 { font-size: 20px; letter-spacing: -.02em; font-weight: 700; }
.small-arrow { color: var(--coral); padding-left: 8px; }
.board-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; color: var(--muted); }
.board-status::before { content: ''; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--dim); }
.board-status[data-state="online"] { color: var(--green); }
.board-status[data-state="online"]::before { background: var(--green); }
.board-status[data-state="offline"], .board-status[data-state="reconnecting"] { color: var(--danger); }
.board-status[data-state="offline"]::before, .board-status[data-state="reconnecting"]::before { background: var(--coral); }
.board-context { color: var(--muted); font-size: 12px; margin: 12px 0 22px; }
.board-metrics { display: flex; align-items: center; gap: 18px; padding: 13px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.board-metrics strong { margin-left: 5px; color: var(--ink); font-variant-numeric: tabular-nums; font-size: 14px; }
.board-metrics > span:last-child { margin-left: auto; font-size: 12px; }
.leaderboard { padding: 0; margin: 0; list-style: none; }
.ranking-row { display: flex; align-items: center; gap: 11px; min-height: 55px; padding: 10px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.ranking-rank { width: 22px; flex: 0 0 22px; color: var(--muted); font-size: 13px; font-family: var(--display); }
.ranking-identity { color: var(--ink); font-size: 14px; font-weight: 600; flex: 1; overflow-wrap: anywhere; }
.ranking-progress { color: var(--muted); font-size: 12px; }
.ranking-score { color: var(--ink); font-family: var(--display); font-size: 21px; min-width: 40px; text-align: right; font-weight: 650; }
.ranking-row.is-first .ranking-rank, .ranking-row.is-first .ranking-score { color: var(--green); }
.ranking-row.is-you .ranking-identity { color: var(--green); }
.board-empty { padding: 34px 0; color: var(--muted); font-size: 13px; line-height: 1.9; border-bottom: 1px solid var(--line); }
.board-refresh { margin-top: 14px; color: var(--dim); font-size: 12px; font-variant-numeric: tabular-nums; }
.practice-board-note { font-size: 12px; color: var(--green); background: var(--surface); padding: 12px; border-radius: 6px; margin-top: 16px; }
.arena-note { display: flex; gap: 20px; margin-top: 48px; color: var(--muted); font-size: 12px; line-height: 1.9; }
.arena-note > span { color: var(--coral); font-size: 38px; line-height: 1.2; }
.arena-note a { color: var(--ink); }
.site-footer { max-width: 1184px; margin: 74px auto 0; padding: 25px 40px; display: flex; justify-content: space-between; gap: 20px; font-size: 12px; color: var(--dim); }

/* Challenge, one decision at a time. */
.activity-status { color: var(--muted); font-size: 12px; margin: -9px 0 20px; line-height: 1.7; }
.arena-note a { display: inline-flex; min-height: 44px; align-items: center; }
.result-panel:not([hidden]) .proof-rail > li { animation: proof-arrive 320ms var(--ease) both; }
.result-panel:not([hidden]) .proof-rail > li:nth-child(2) { animation-delay: 80ms; }
.result-panel:not([hidden]) .proof-rail > li:nth-child(3) { animation-delay: 160ms; }
@keyframes proof-arrive { from { transform: translateY(7px); opacity: .5; } to { transform: translateY(0); opacity: 1; } }
.welcome-transfer .gate-symbol { animation: gate-ready 550ms var(--ease); }
@keyframes gate-ready { from { transform: scale(.82); } to { transform: scale(1); } }
.session-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 24px; }
.session-bar > div { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.mode-badge { display: inline-block; color: var(--green); font-size: 12px; line-height: 1.8; padding: 2px 7px; border: 1px solid #536b2e; border-radius: 4px; }
.mode-badge[data-mode="practice"] { color: var(--danger); border-color: #80523e; }
.anonymous-id { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.session-score { font-size: 12px; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.stage-progress { display: flex; margin: 0 0 27px; padding: 0; list-style: none; }
.stage-progress li { flex: 1; display: flex; align-items: center; gap: 7px; color: var(--dim); font-size: 12px; position: relative; }
.stage-progress li:not(:last-child)::after { content: ''; height: 1px; background: var(--line); flex: 1; margin: 0 12px 0 4px; }
.stage-number { display: grid; place-items: center; width: 23px; height: 23px; border: 1px solid var(--line); border-radius: 50%; font-size: 12px; }
.stage-progress li.is-current { color: var(--coral); }
.stage-progress li.is-current .stage-number { background: var(--coral); color: var(--bg); border-color: var(--coral); font-weight: 700; }
.stage-progress li.is-complete { color: var(--green); }
.stage-progress li.is-complete .stage-number { border-color: #789744; color: var(--green); }
.task-heading { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--muted); margin-bottom: 11px; }
.attempt-count { font-variant-numeric: tabular-nums; }
.task-title { font-size: 34px; font-weight: 800; letter-spacing: -.025em; line-height: 1.22; scroll-margin-top: 22px; }
.task-objective { color: var(--muted); font-size: 14px; margin-top: 14px; line-height: 1.8; }
.mandate-box { margin-top: 23px; padding: 17px 18px 8px; background: var(--surface); border-radius: 8px; }
.mandate-box > p { font-size: 14px; color: var(--ink); line-height: 1.85; margin-bottom: 9px; }
.mandate-label { display: inline-block; color: var(--green); font-size: 12px; margin-right: 11px; }
.mandate-box > p:nth-child(2) { color: var(--muted); }
.mandate-box > p:nth-child(2) .mandate-label { color: var(--muted); }
summary { cursor: pointer; min-height: 44px; padding: 11px 0; color: var(--muted); font-size: 12px; }
summary::marker { color: var(--coral); }
.scenario-details { border-top: 1px solid var(--line); }
.scenario-details p { font-size: 14px; line-height: 1.85; color: var(--muted); padding-bottom: 12px; }
.play-form { margin-top: 27px; }
.field-heading { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; gap: 8px; }
.field-heading label { font-size: 14px; font-weight: 600; }
.field-heading > span { font-size: 12px; color: var(--muted); }
.templates { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.template-button { min-height: 44px; background: transparent; border: 1px solid var(--line); border-radius: 6px; padding: 8px 13px; color: var(--muted); font-size: 12px; }
.template-button:hover:not(:disabled), .template-button[aria-pressed="true"] { border-color: var(--green); color: var(--green); background: #242e19; }
textarea { display: block; width: 100%; min-height: 138px; padding: 15px 16px; border: 1px solid #58604e; border-radius: 8px; color: var(--ink); background: #171a15; resize: vertical; font-size: 16px; line-height: 1.75; }
textarea::placeholder { color: var(--muted); }
textarea:focus { border-color: var(--green); }
.input-footer { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); margin-top: 8px; }
#char-count { white-space: nowrap; font-variant-numeric: tabular-nums; }
.submit-button { width: 100%; justify-content: space-between; margin-top: 23px; }
.form-caption { font-size: 12px; color: var(--muted); text-align: center; margin-top: 9px; }
.patch-fields { border: 0; margin: 0; padding: 0; }
.patch-fields legend { font-size: 15px; font-weight: 700; padding: 0; margin-bottom: 5px; }
.field-description { font-size: 14px; color: var(--muted); margin-bottom: 15px; }
.patch-option { display: flex; align-items: center; gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--line); cursor: pointer; min-height: 76px; }
.patch-option input { accent-color: var(--green); width: 22px; height: 22px; flex: 0 0 22px; margin: 0; cursor: pointer; }
.patch-option > span:nth-child(2) { flex: 1; }
.patch-option strong { font-size: 15px; font-weight: 600; display: block; }
.patch-option small { font-size: 13px; color: var(--muted); display: block; margin-top: 3px; }
.patch-check { width: 20px; color: var(--green); opacity: 0; }
.patch-option:has(input:checked) .patch-check { opacity: 1; }
.patch-option:has(input:checked) strong { color: var(--green); }
.patch-option:hover { background: #1a1f15; }
.dangerous-option strong { color: var(--danger); }
.processing-panel { display: flex; align-items: flex-start; gap: 18px; padding: 22px 20px; margin-top: 22px; background: var(--surface); border-radius: 8px; }
.processing-panel strong { font-size: 14px; }
.processing-panel p { margin: 6px 0; color: var(--muted); font-size: 12px; }
.processing-panel span:last-child { color: var(--dim); font-size: 12px; font-variant-numeric: tabular-nums; }
.processing-orbit { width: 24px; height: 24px; flex: 0 0 24px; border: 2px solid var(--line); border-top-color: var(--coral); border-radius: 50%; margin-top: 2px; animation: processing-spin 1s linear infinite; }
@keyframes processing-spin { to { transform: rotate(360deg); } }
.error-panel { margin-top: 22px; border: 1px solid #88513d; background: #281c16; border-radius: 8px; padding: 17px 18px; }
.error-panel > strong { color: var(--danger); font-size: 14px; }
.error-panel > p { color: var(--ink); font-size: 12px; margin-top: 7px; overflow-wrap: anywhere; }
.error-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 17px; margin-top: 11px; }
.error-actions .button { min-height: 44px; font-size: 12px; padding: 10px 14px; }
.result-panel { margin-top: 28px; padding-top: 26px; border-top: 1px solid var(--line); scroll-margin-top: 20px; }
.result-heading { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 11px; }
.result-flag { font-size: 12px; color: var(--muted); }
.result-points { color: var(--green); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.result-panel h2 { font-size: 25px; font-weight: 750; letter-spacing: -.02em; overflow-wrap: anywhere; }
.result-summary { color: var(--muted); font-size: 14px; line-height: 1.85; margin-top: 11px; }
.funds-journey { display: flex; flex-wrap: wrap; align-items: center; margin: 24px 0; padding: 22px 20px 15px; background: var(--surface); border-radius: 10px; }
.funds-node { flex: 0 0 95px; }
.funds-node > span { display: block; color: var(--muted); font-size: 12px; }
.funds-node strong { display: block; font-family: var(--display); font-size: 29px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.4; }
.destination-node { text-align: right; }
.destination-node strong { color: var(--green); }
.funds-conduit { flex: 1; position: relative; height: 3px; min-width: 30px; background: var(--line); margin: 0 6px; }
.funds-gate { position: absolute; width: 30px; height: 30px; background: var(--bg); border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; left: calc(50% - 15px); top: -14px; color: var(--muted); font-size: 15px; }
.funds-packet { position: absolute; width: 15px; height: 7px; top: -2px; left: 0; border-radius: 2px; background: var(--green); opacity: 0; }
.funds-outcome { flex: 0 0 100%; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); margin-top: 15px; padding-top: 12px; text-align: center; }
.funds-journey[data-movement="executed"] .funds-conduit { background: #607d36; }
.funds-journey[data-movement="executed"] .funds-gate { color: var(--green); border-color: #607d36; }
.funds-journey[data-movement="blocked"] .funds-gate { color: var(--coral); }
.funds-journey[data-movement="blocked"] .funds-gate::before { content: ''; position: absolute; width: 2px; height: 20px; background: var(--coral); transform: rotate(-30deg); }
.funds-journey.is-moving .funds-packet { animation: funds-travel 1.25s var(--ease) var(--payment-count, 1); }
@keyframes funds-travel { 0% { left: 0; opacity: 0; } 8% { opacity: 1; } 82% { left: calc(100% - 15px); opacity: 1; } 100% { left: calc(100% - 15px); opacity: 0; } }
.proof-rail { padding: 0; margin: 0; list-style: none; }
.proof-rail > li { padding: 0 0 19px; }
.proof-rail > li:not(:last-child) { border-bottom: 1px solid var(--line); margin-bottom: 19px; }
.proof-rail-title { display: flex; align-items: center; gap: 10px; }
.proof-number { display: grid; place-items: center; width: 22px; height: 22px; background: var(--surface-raised); color: var(--muted); font-size: 12px; border-radius: 50%; }
.proof-rail-title h3 { font-size: 14px; font-weight: 650; }
.proof-label { color: var(--muted); font-size: 12px; margin-left: auto; }
.proof-content { padding: 11px 0 0 32px; }
.proof-empty { color: var(--muted); font-size: 14px; line-height: 1.85; }
.payment-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 8px 0; }
.payment-row > div { min-width: 0; }
.payment-recipient { display: block; font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.payment-order { font-size: 12px; color: var(--muted); display: block; overflow-wrap: anywhere; }
.payment-amount { font-size: 14px; font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.payment-amount.is-executed { color: var(--green); }
.evidence-item { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; }
.evidence-marker { color: var(--muted); font-size: 16px; flex: 0 0 16px; line-height: 1.5; }
.evidence-item[data-kind="blocked"] .evidence-marker { color: var(--coral); }
.evidence-item[data-kind="executed"] .evidence-marker, .evidence-item[data-kind="allowed"] .evidence-marker { color: var(--green); }
.evidence-item > div { min-width: 0; }
.evidence-title { font-size: 14px; font-weight: 600; display: block; overflow-wrap: anywhere; }
.evidence-detail { font-size: 14px; color: var(--muted); line-height: 1.8; margin-top: 2px; overflow-wrap: anywhere; }
.fixture-notice { font-size: 12px; color: var(--green); margin-bottom: 7px; line-height: 1.8; }
.result-checks { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 17px; }
.check-chip { font-size: 12px; padding: 4px 8px; background: #302019; border-radius: 4px; color: var(--danger); }
.check-chip[data-good="true"] { color: var(--green); background: #252f1b; }
.model-reply { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.model-reply summary { font-size: 12px; }
.model-reply summary > span { color: var(--dim); font-size: 12px; margin-left: 10px; }
.model-reply pre { margin: 0 0 15px; font-family: var(--font); font-size: 14px; line-height: 1.85; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 350px; overflow: auto; }
.next-hint { color: var(--ink); font-size: 14px; margin: 18px 0 0; }
.next-actions { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 20px; }
.next-actions .primary, .next-actions .secondary { flex: 1 1 100%; }
.next-actions .text-button { margin: auto; }
.session-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; padding-top: 20px; margin-top: 22px; border-top: 1px solid var(--line); }
.session-footer > span { font-size: 12px; color: var(--dim); }
.completion { padding-top: 27px; margin-top: 20px; }
.completion-mark { display: block; font-size: 52px; line-height: 1; color: var(--coral); margin-bottom: 15px; }
.completion h2 { font-size: 31px; letter-spacing: -.025em; line-height: 1.3; }
.completion > p { font-size: 13px; color: var(--muted); margin-top: 15px; }
.completion .completion-lesson { color: var(--ink); margin-top: 20px; }
.completion .button { margin-top: 24px; width: 100%; justify-content: space-between; }

/* Projection: generous QR, strict 16:9 proportions, readable from the back row. */
.screen-page { min-height: 100svh; }
.screen-shell { padding: 3vh 4.7vw 2vh; max-width: 1920px; margin: auto; min-height: 100svh; display: flex; flex-direction: column; }
.screen-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.screen-header .wordmark { font-size: 20px; }
.screen-header .brand-symbol { width: 42px; height: 42px; font-size: 37px; }
.screen-header .wordmark-light { font-size: 16px; }
.screen-header-meta { text-align: right; color: var(--muted); font-size: 13px; }
.screen-header-meta p + p { margin-top: 4px; color: var(--dim); font-size: 12px; }
.screen-body { display: grid; grid-template-columns: minmax(360px, .95fr) minmax(400px, 1.05fr); column-gap: 7vw; flex: 1; padding-top: 3vh; }
.screen-invitation { display: flex; flex-direction: column; align-items: flex-start; }
.screen-invitation h1 { font-size: clamp(36px, 4vw, 72px); line-height: 1.17; font-weight: 850; letter-spacing: -.035em; }
.screen-invitation h1 > span { color: var(--coral); }
.screen-invitation > p { font-size: clamp(14px, 1.25vw, 22px); color: var(--muted); margin-top: 2vh; }
.screen-qr-line { display: flex; align-items: center; gap: 2vw; margin-top: 3vh; }
.screen-qr { width: clamp(175px, min(19vw, 27vh), 330px); height: auto; aspect-ratio: 1; background: #fff; border: 12px solid #fff; border-radius: 8px; }
.screen-scan-copy { font-size: clamp(13px, 1.15vw, 20px); color: var(--muted); }
.screen-scan-copy strong { display: block; color: var(--green); font-size: clamp(24px, 2.2vw, 38px); font-weight: 650; margin-bottom: 10px; }
.screen-scan-copy span { display: block; margin-top: 5px; }
.screen-root-link { display: block; min-height: 44px; font-family: var(--display); color: var(--ink); font-size: clamp(20px, 2.1vw, 36px); text-decoration: none; margin-top: 1.5vh; letter-spacing: -.025em; word-break: break-word; }
.screen-root-link::after { content: ' ↗'; color: var(--coral); }
.screen-simulation { font-size: 12px; color: var(--muted); margin-top: 1.3vh; }
.screen-ranking { min-width: 0; }
.screen-ranking .section-heading h2 { font-size: clamp(22px, 2.1vw, 36px); }
.screen-ranking .board-status { font-size: clamp(12px, .9vw, 16px); }
.screen-ranking .board-context { margin: 1.4vh 0 1.7vh; font-size: clamp(12px, .9vw, 15px); }
.screen-ranking .board-metrics { padding: 1.2vh 0; font-size: clamp(12px, .9vw, 15px); gap: 24px; }
.screen-ranking .board-metrics strong { font-size: clamp(16px, 1.4vw, 24px); }
.screen-ranking .board-metrics > span:last-child { font-size: clamp(12px, .8vw, 14px); }
.screen-ranking .ranking-row { min-height: 3.8vh; padding: .3vh 0; gap: 20px; line-height: 1.2; }
.screen-ranking .ranking-rank { font-size: clamp(14px, 1.2vw, 21px); width: 28px; flex-basis: 28px; }
.screen-ranking .ranking-identity { font-size: clamp(14px, 1.2vw, 21px); }
.screen-ranking .ranking-progress { font-size: clamp(12px, .9vw, 16px); }
.screen-ranking .ranking-score { font-size: clamp(20px, 1.8vw, 31px); min-width: 55px; line-height: 1.15; }
.screen-ranking .board-refresh { font-size: clamp(12px, .8vw, 14px); margin-top: 1.2vh; }
.screen-ranking .board-empty { padding: 5vh 0; font-size: clamp(14px, 1.3vw, 22px); line-height: 1.9; }
.screen-footer { display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: clamp(12px, .85vw, 14px); border-top: 1px solid var(--line); margin-top: 2vh; padding-top: 1.2vh; align-items: center; }
.screen-footer a { color: var(--ink); text-decoration: none; display: inline-flex; min-height: 44px; align-items: center; }

@media (min-width: 1440px) {
  .arena-layout { margin-top: 65px; }
  .lobby h1 { font-size: 66px; }
}
@media (max-width: 1050px) {
  .arena-layout { column-gap: 48px; grid-template-columns: minmax(0, 1.45fr) minmax(260px, 1fr); padding: 0 32px; }
  .lobby h1 { font-size: 48px; }
  .welcome-stages { gap: 10px; }
  .welcome-stages li { gap: 7px; }
  .screen-body { column-gap: 4vw; grid-template-columns: minmax(300px, .9fr) minmax(340px, 1.1fr); }
}
@media (max-width: 760px) {
  .site-header { padding: 17px 22px; }
  .arena-layout { display: block; max-width: 580px; padding: 0 22px; margin-top: 20px; }
  .lobby h1 { font-size: 49px; }
  .opening-meta { margin-bottom: 22px; font-size: 12px; }
  .opening-copy { font-size: 16px; margin-top: 18px; }
  .welcome-transfer { margin-top: 25px; padding: 17px 18px 15px; }
  .welcome-stages { margin: 24px 0; }
  .welcome-stages strong { font-size: 13px; }
  .welcome-stages small { font-size: 12px; }
  .ranking-column { position: static; margin-top: 50px; padding-top: 28px; border-top: 1px solid var(--line); }
  .arena-note { margin-top: 30px; }
  .site-footer { max-width: 580px; padding: 24px 22px 28px; margin-top: 35px; flex-direction: column; gap: 5px; }
  .task-title { font-size: 29px; }
  .task-objective { font-size: 14px; }
  .session-bar { padding-bottom: 21px; }
  .session-bar > div { gap: 6px 9px; }
  .session-score { font-size: 12px; }
  .stage-progress { margin-bottom: 24px; }
  .mandate-box { margin-top: 20px; padding: 15px 15px 6px; }
  .mandate-box > p { font-size: 14px; }
  .play-form { margin-top: 24px; }
  .result-panel h2 { font-size: 23px; }
  .screen-shell { padding: 24px; }
  .screen-body { display: block; }
  .screen-invitation h1 { font-size: 43px; }
  .screen-invitation > p { font-size: 15px; }
  .screen-qr { width: 210px; }
  .screen-qr-line { gap: 24px; margin-top: 24px; }
  .screen-scan-copy { font-size: 13px; }
  .screen-scan-copy strong { font-size: 28px; }
  .screen-root-link { font-size: 26px; }
  .screen-ranking { margin-top: 38px; }
  .screen-ranking .ranking-row { min-height: 46px; }
  .screen-header-meta { font-size: 12px; }
  .screen-header-meta p + p { font-size: 12px; }
  .screen-footer { flex-direction: column; gap: 8px; font-size: 12px; margin-top: 30px; padding-top: 20px; }
}
@media (max-width: 375px) {
  .site-header { padding-right: 18px; padding-left: 18px; }
  .arena-layout { padding: 0 18px; margin-top: 14px; }
  .lobby h1 { font-size: 43px; }
  .welcome-stages { gap: 6px; }
  .welcome-stages li { gap: 6px; }
  .welcome-stages small { font-size: 12px; }
  .arena-link { gap: 9px; font-size: 12px; }
  .task-title { font-size: 27px; }
  .session-bar { align-items: flex-start; }
  .session-bar > div { flex-direction: column; align-items: flex-start; }
  .funds-node { flex-basis: 82px; }
  .funds-node strong { font-size: 26px; }
  .funds-journey { padding: 18px 16px 13px; }
  .proof-content { padding-left: 24px; }
  .proof-label { font-size: 12px; }
  .template-button { padding: 8px 10px; font-size: 12px; }
  .input-footer { font-size: 12px; }
  .screen-qr { width: 180px; }
  .screen-qr-line { gap: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .funds-packet { display: none; }
  .processing-orbit { border-color: var(--line); border-top-color: var(--coral); }
}
