/* Multiplayer presentation only. Shared tokens keep the MVP easy to adjust. */
.multiplayer-page {
    --bg: #10141d;
    --surface: #1a202c;
    --inset: #121822;
    --line: #3c4659;
    --text: #f6f7f2;
    --muted: #b0b9c9;
    --accent: #deff78;
    --selection: #bdd2ff;
    --good: #a4edb4;
    --bad: #ffb0a9;
    --radius: 20px;
    --radius-sm: 12px;
    --space: 16px;
    margin: 0;
    min-height: 100vh;
    min-height: 100svh;
    background: radial-gradient(ellipse at 50% 0, #263329 0, transparent 52%), var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
.multiplayer-shell { max-width: 760px; margin: 0 auto; padding: 36px 20px 20px; }
.multiplayer-shell [hidden] { display: none !important; }
.multiplayer-shell * { box-sizing: border-box; }
.game-masthead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space); margin-bottom: 24px; }
.site-brand { color: var(--text); font-size: 28px; font-weight: 900; letter-spacing: -.055em; line-height: 1; text-decoration: none; }
.site-brand:hover { color: var(--accent); }
.edition-label { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .15em; border: 1px solid var(--line); border-radius: 99px; padding: 7px 10px; white-space: nowrap; }
.game-surface { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; box-shadow: 0 24px 64px #0003; }
.game-footer { margin-top: 20px; text-align: center; font-size: 12px; color: var(--muted); }
.multiplayer-shell :where(h1, h2, p, ol, ul) { margin-top: 0; }
.multiplayer-shell h1 { font-size: clamp(28px, 4vw, 38px); font-weight: 800; line-height: 1.15; letter-spacing: -.04em; margin-bottom: 16px; }
.multiplayer-shell h2 { font-size: 16px; font-weight: 750; margin-bottom: 0; }
.multiplayer-shell .eyebrow { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .14em; margin-bottom: 10px; }
.multiplayer-shell .intro-copy { color: var(--muted); font-size: 17px; }
.multiplayer-shell .form-text, .multiplayer-shell .text-muted { color: var(--muted) !important; font-size: 12px; }
.multiplayer-shell .form-text { margin: 8px 0 0; }
.multiplayer-shell .form-label, .multiplayer-shell legend { color: var(--text); font-size: 15px; font-weight: 700; margin: 0 0 10px; }
.multiplayer-shell .field-group { margin-bottom: 24px; }
.multiplayer-shell button, .multiplayer-shell input, .multiplayer-shell .btn { min-height: 48px; }
.multiplayer-shell .btn { border-radius: var(--radius-sm); padding: 14px 20px; font-size: 13px; font-weight: 800; letter-spacing: .04em; line-height: 1.4; border: 1px solid transparent; box-shadow: none; transition: background-color .15s, border-color .15s, transform .15s; }
.multiplayer-shell .btn:active:not(:disabled) { transform: translateY(1px); }
.multiplayer-shell .btn-primary { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.multiplayer-shell .btn-primary:hover:not(:disabled) { background: #eaffad; border-color: #eaffad; }
.multiplayer-shell .btn-outline-secondary { background: transparent; color: var(--text); border-color: var(--line); }
.multiplayer-shell .btn-outline-secondary:hover:not(:disabled) { background: #293346; border-color: #738199; }
.multiplayer-shell .btn:disabled { opacity: 1; cursor: not-allowed; color: #a1abbc; background: #2b3342; border-color: #465168; }
.multiplayer-shell .full-width { width: 100%; }
.multiplayer-shell :is(button, a, input):focus-visible, .btn-check:focus-visible + .difficulty-choice { outline: 3px solid var(--selection); outline-offset: 4px; box-shadow: none; }
.multiplayer-shell .form-control { background: var(--inset); color: var(--text); border: 1px solid #59667c; border-radius: var(--radius-sm); font-size: 16px; padding: 12px 14px; box-shadow: none; }
.multiplayer-shell .form-control:focus { border-color: var(--accent); }
.multiplayer-shell .form-control::placeholder { color: #9da8bb; opacity: 1; }
.multiplayer-shell input[type=number] { color-scheme: dark; }
.multiplayer-shell input:-webkit-autofill { -webkit-text-fill-color: var(--text); box-shadow: 0 0 0 1000px var(--inset) inset; }
.multiplayer-shell[data-page=create] { max-width: 640px; }
.multiplayer-shell[data-page=create] .site-brand { font-size: clamp(38px, 8vw, 56px); }
.create-intro { margin-bottom: 28px; }
.landing-hero { text-align: center; padding: 32px 0; }
.multiplayer-shell .landing-hero h1 { font-size: clamp(36px, 7vw, 56px); }
.landing-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 32px; }
.landing-actions .btn { flex: 1 1 200px; }
.create-intro h1 { margin-bottom: 8px; font-size: clamp(25px, 4vw, 32px); }
.game-facts { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 11px; color: var(--muted); }
.game-facts span::before { content: '·'; color: var(--accent); margin-right: 6px; font-weight: 900; }
.difficulty-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.difficulty-choice { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 2px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--inset); cursor: pointer; }
.difficulty-choice strong { font-size: 22px; line-height: 1.25; font-weight: 800; }
.difficulty-choice span { font-size: 11px; font-weight: 600; }
.difficulty-choice:hover { border-color: var(--accent); }
.btn-check:checked + .difficulty-choice { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.players-setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.players-setting .form-label { margin: 0; }
.players-setting .form-control { width: 86px; flex: 0 0 86px; font-size: 22px; font-weight: 750; text-align: center; }
.join-by-code { border-top: 1px solid var(--line); padding-top: 24px; margin-top: 24px; }
.join-by-code h2 { margin-bottom: 12px; }
.code-entry { display: flex; gap: 10px; }
.code-entry input { min-width: 0; text-transform: uppercase; letter-spacing: .1em; }
.code-entry .btn { white-space: nowrap; }
.invite-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--inset); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 20px; }
.invite-card .eyebrow { margin-bottom: 4px; }
.multiplayer-shell .game-code { font-size: clamp(26px, 5.5vw, 36px); font-weight: 850; letter-spacing: .12em; color: var(--accent); line-height: 1.2; margin: 0; overflow-wrap: anywhere; }
.invite-card .btn { min-height: 44px; padding: 10px 14px; white-space: nowrap; }
#copy-status:empty { margin: 0; }
.roster-heading, .leaderboard-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 24px 0 12px; }
.count-badge { font-size: 13px; font-variant-numeric: tabular-nums; background: #303b50; padding: 5px 12px; border-radius: 99px; }
.multiplayer-shell .list-group { padding: 0; margin-bottom: 0; list-style: none; border-radius: var(--radius-sm); }
.multiplayer-shell .list-group-item { background: var(--inset); color: var(--text); border-color: var(--line); padding: 13px 16px; overflow-wrap: anywhere; font-size: 15px; }
.player-roster .list-group-item > span:first-child::before { content: ''; width: 8px; height: 8px; display: inline-block; vertical-align: middle; border-radius: 50%; background: var(--selection); margin-right: 12px; }
.player-roster .list-group-item[data-online=false] > span:first-child::before { background: var(--muted); }
.empty-roster { border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 24px 20px; color: var(--muted); text-align: center; font-size: 14px; }
.status-message { background: #243047; border: 1px solid #465a79; border-radius: var(--radius-sm); color: #d9e6ff; padding: 14px 16px; font-size: 14px; margin: 20px 0; }
#game-message[data-tone=notice] { background: #392f21; border-color: #7d6743; color: #f4d5a3; }
.lobby-actions { display: grid; gap: 12px; margin-top: 18px; }
.lobby-actions:empty { margin: 0; }
#start-help { text-align: center; }
#join-form .form-text { margin-bottom: 20px; }
#new-game-link { margin-top: 18px; }
.countdown-panel { text-align: center; padding: 52px 0 40px; }
.multiplayer-shell .countdown-display { font-size: clamp(120px, 28vw, 200px); font-weight: 900; color: var(--accent); line-height: 1.1; letter-spacing: -.06em; margin: 20px 0; font-variant-numeric: tabular-nums; }
.countdown-display > span { display: block; animation: countdown-pop .4s ease-out both; }
@keyframes countdown-pop { from { opacity: .25; transform: scale(.82); } to { opacity: 1; transform: scale(1); } }
.multiplayer-shell[data-status=countdown] .screen-title { text-align: center; }
.multiplayer-shell[data-status=playing] .screen-title { font-size: 23px; margin-bottom: 20px; }
.flag-stage { border-radius: var(--radius-sm); background: #e8ece9; padding: 20px; margin-bottom: 16px; }
.question-flag { display: block; width: 100%; height: 200px; object-fit: contain; filter: drop-shadow(0 4px 8px #0002); }
.timer-heading { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .12em; margin-bottom: 8px; }
.timer-readout { display: flex; gap: 4px; align-items: baseline; font-size: 12px; }
#question-timer { color: var(--text); font-size: 23px; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.timer-track { overflow: hidden; height: 5px; border-radius: 99px; background: #3d4759; margin-bottom: 20px; }
#question-progress { display: block; width: 100%; height: 100%; background: var(--accent); transform-origin: left; }
.question-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.multiplayer-shell .question-option { display: flex; align-items: center; justify-content: center; position: relative; min-height: 82px; padding: 18px 16px; color: var(--text); background: #242e40; border: 1px solid #596a86; font-size: 16px; font-weight: 650; letter-spacing: 0; overflow-wrap: anywhere; }
.multiplayer-shell .question-option:hover:not(:disabled) { background: #33425b; border-color: var(--selection); }
.multiplayer-shell .question-option:disabled { color: #c2cadd; background: #202938; border-color: #465168; opacity: 1; }
.multiplayer-shell .question-option[aria-pressed=true] { color: #fff; background: #354e7d; border: 2px solid var(--selection); padding-top: 24px; }
.question-option[aria-pressed=true]::after { content: 'LOCKED'; position: absolute; top: 6px; right: 8px; font-size: 8px; font-weight: 800; letter-spacing: .12em; color: #d1e0ff; }
.answer-status { min-height: 24px; margin: 18px 0 0; text-align: center; color: var(--muted); font-size: 13px; }
.answer-status[data-locked=true] { color: var(--selection); font-weight: 750; }
.result-panel, .finished-panel { text-align: center; }
.multiplayer-shell[data-status=question_result] .screen-title { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-align: center; margin-bottom: 24px; text-transform: uppercase; }
.result-headline h2 { font-size: clamp(30px, 7vw, 44px); font-weight: 900; letter-spacing: -.04em; line-height: 1.1; }
#result-points { font-size: 38px; font-weight: 850; letter-spacing: -.04em; margin: 4px 0 20px; }
.result-panel[data-outcome=correct] .result-headline { color: var(--good); }
.result-panel[data-outcome=wrong] .result-headline { color: var(--bad); }
.correct-answer { margin-bottom: 0; }
.correct-answer .eyebrow { display: block; margin-bottom: 2px; }
#correct-label { display: block; font-size: 23px; font-weight: 750; line-height: 1.3; }
.result-options { gap: 8px; margin-top: 16px; }
.result-option { border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.result-option.is-correct { border-color: #588567; color: #c3f5cd; background: #243f31; }
.result-option.is-wrong { border-color: #946360; color: #ffd3cd; background: #482f33; }
.leaderboard-heading { text-align: left; }
.leaderboard-heading > span { font-size: 9px; font-weight: 750; letter-spacing: .12em; color: var(--muted); }
.leaderboard .list-group-item { text-align: left; font-size: 14px; padding: 12px 14px; }
.leaderboard .list-group-item strong { flex-shrink: 0; align-self: center; color: var(--text); font-variant-numeric: tabular-nums; }
.leaderboard .list-group-item[data-rank="1"] { background: #303b2b; border-color: #626e47; }
.leaderboard .list-group-item[data-rank="1"] strong { color: var(--accent); }
.intermission-timer { margin: 20px 0 0; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.multiplayer-shell[data-status=finished] .screen-title { text-align: center; font-size: clamp(36px, 9vw, 52px); font-weight: 900; }
.winner-banner { background: #303b2b; border: 1px solid #73864a; color: var(--accent); font-size: clamp(22px, 5vw, 32px); font-weight: 800; line-height: 1.25; letter-spacing: -.025em; border-radius: var(--radius-sm); padding: 26px 18px; overflow-wrap: anywhere; margin: 16px 0 26px; }
.finished-panel > .btn { margin-top: 26px; }
.multiplayer-shell .alert { border-radius: var(--radius-sm); padding: 14px 16px; font-size: 14px; margin: 16px 0; overflow-wrap: anywhere; }
.multiplayer-shell .alert-danger { color: #ffcec7; background: #442c32; border: 1px solid #966168; }
.multiplayer-shell .alert-warning { color: #f4d5a3; background: #392f21; border: 1px solid #7d6743; }
.loading-message, .empty-state { text-align: center; }
.empty-state { padding: 28px 0; }
.empty-state > p:not(.eyebrow) { color: var(--muted); max-width: 32ch; margin: 0 auto 24px; }
@media (max-width: 480px) {
    .multiplayer-shell { padding: 22px 14px 16px; }
    .game-masthead { margin-bottom: 18px; }
    .site-brand { font-size: 25px; }
    .game-surface { padding: 22px 18px; border-radius: 16px; }
    .edition-label { font-size: 8px; padding: 6px 8px; }
    .game-facts { gap: 6px 10px; font-size: 10px; }
    .difficulty-grid { gap: 6px; }
    .difficulty-choice { border-radius: 9px; }
    .difficulty-choice span { font-size: 10px; }
    .code-entry .btn { padding-inline: 12px; font-size: 11px; }
    .invite-card { padding: 16px 12px; gap: 10px; }
    .invite-card .btn { padding: 10px; font-size: 11px; }
    .countdown-panel { padding: 36px 0; }
    .multiplayer-shell[data-status=playing] .game-surface { padding: 18px 16px; }
    .multiplayer-shell[data-status=playing] .screen-title { font-size: 20px; margin-bottom: 14px; }
    .flag-stage { padding: 14px; margin-bottom: 12px; }
    .question-flag { height: clamp(120px, 21svh, 170px); }
    .timer-track { margin-bottom: 14px; }
    .question-options { gap: 9px; }
    .multiplayer-shell .question-option { min-height: 78px; font-size: 13px; padding: 16px 10px; }
    .multiplayer-shell .question-option[aria-pressed=true] { padding-top: 24px; }
    .answer-status { font-size: 11px; margin-top: 14px; }
    .result-headline h2 { font-size: 32px; }
    #result-points { font-size: 32px; margin-bottom: 16px; }
    .game-footer { font-size: 10px; margin-top: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .multiplayer-shell .btn { transition: none; }
    .countdown-display > span { animation: none; }
}

/* Mode and category choices use the existing game palette and selection treatment. */
.mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.mode-grid .difficulty-choice { min-width: 0; padding: 1rem .5rem; }
.mode-grid .difficulty-choice strong { font-size: 1rem; }
.site-brand img { display: block; width: 200px; max-width: 100%; height: auto; }
#capital-prompt { text-align: center; }
#question-country { font-size: clamp(1.5rem, 6vw, 2.5rem); margin: .5rem 0; }
#capital-prompt { color: var(--bg); }
#capital-prompt .eyebrow { color: #4c596b; }
