@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:ital,wght@1,700&display=swap');

:root {
    --bg: #07110f;
    --panel: #101d1a;
    --panel-2: #152521;
    --line: rgba(219, 231, 216, .13);
    --text: #f4f2e8;
    --muted: #91a49c;
    --gold: #e4b85a;
    --gold-bright: #ffd77b;
    --green: #36a875;
    --felt: #0c513c;
    --felt-dark: #073b2d;
    --red: #d66565;
    --card: #f6f0df;
    --ink: #18201d;
    --shadow: 0 24px 70px rgba(0, 0, 0, .38);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background: radial-gradient(circle at 50% -20%, #17352b 0, var(--bg) 43%); font-family: "DM Sans", ui-sans-serif, system-ui, sans-serif; line-height: 1.45; }
button, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.ambient-glow { position: fixed; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(228,184,90,.025) 1px, transparent 1px), linear-gradient(rgba(228,184,90,.02) 1px, transparent 1px); background-size: 52px 52px; mask-image: linear-gradient(to bottom, black, transparent 70%); }
.container { position: relative; width: min(1440px, 100%); margin: auto; padding: 8px 22px 52px; }

.container:has(#lobby-section:not(.hidden)) { width: 100%; max-width: none; padding: 0; }
body:has(#lobby-section:not(.hidden)) { background: #050606; }
body:has(#lobby-section:not(.hidden)) .ambient-glow { display: none; }
[data-theme-mode="light"] body:has(#lobby-section:not(.hidden)) { background: #f5f4ef; }
.lobby-shell { --selector-accent: var(--gold); --selector-frame: color-mix(in srgb, var(--panel) 92%, #113d30); --active-game-tab: 0; display: flex; flex-direction: column; min-height: 100dvh; padding: clamp(10px, 1.5vw, 20px); }
.lobby-shell[data-selected-game="briscola_venceslao"] { --selector-accent: #67d2ad; --selector-frame: color-mix(in srgb, var(--panel) 83%, #164735); --active-game-tab: 1; }
.game-selector { position: relative; z-index: 1; padding: 0 clamp(16px, 3vw, 40px); }
.game-selector-tabs { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(440px, 100%); }
.game-selector-bridge { position: absolute; inset: 0 auto 0 0; width: 50%; background: var(--selector-frame); border-radius: 14px 14px 0 0; transform: translateX(calc(var(--active-game-tab) * 100%)); transition: transform .48s cubic-bezier(.22,1,.36,1), background .48s ease; pointer-events: none; }
.game-selector-bridge::before, .game-selector-bridge::after { content: ''; position: absolute; bottom: 0; width: 18px; height: 18px; }
.game-selector-bridge::before { left: -18px; background: radial-gradient(circle at top left, transparent 18px, var(--selector-frame) 18.5px); }
.game-selector-bridge::after { right: -18px; background: radial-gradient(circle at top right, transparent 18px, var(--selector-frame) 18.5px); }
.game-selector-tab { position: relative; display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 48px; padding: 8px 12px; color: var(--muted); background: transparent; border: 0; font-weight: 800; transition: color .3s; }
.game-selector-tab:hover, .game-selector-tab.is-active { color: var(--text); }
.game-selector-tab:focus-visible { outline: 2px solid var(--selector-accent); outline-offset: -5px; border-radius: 14px 14px 0 0; }
.game-selector-tab strong { font-size: clamp(.83rem, 1.1vw, .98rem); line-height: 1.15; }
.game-portal { position: relative; flex: 1; min-height: calc(100dvh - 88px); background: var(--selector-frame); border-radius: 20px; transition: background .48s ease; }
.game-portal .account-bar { position: absolute; top: 18px; right: 20px; }
.lobby-content { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(360px, .88fr); align-items: center; gap: clamp(32px, 6vw, 94px); min-height: inherit; padding: clamp(38px, 6vh, 78px) clamp(20px, 5vw, 76px); }
.lobby-intro { display: grid; }
.lobby-game-intro { grid-area: 1 / 1; opacity: 1; visibility: visible; transform: translateY(0); transition: opacity .38s ease, transform .38s cubic-bezier(.22,1,.36,1), visibility .38s; }
.lobby-shell[data-selected-game="bisca"] .lobby-game-intro[data-game-intro="briscola_venceslao"],
.lobby-shell[data-selected-game="briscola_venceslao"] .lobby-game-intro[data-game-intro="bisca"] { opacity: 0; visibility: hidden; transform: translateY(8px); pointer-events: none; }
.lobby-discover-actions { grid-row: 2; }
.lobby-game-intro h1 { max-width: 740px; }
.lobby-game-intro[data-game-intro="briscola_venceslao"] h1 { font-size: clamp(3rem, 6vw, 5.8rem); }
.lobby-shell[data-selected-game="briscola_venceslao"] .lobby-intro h1 em { color: var(--selector-accent); }
.lobby-shell[data-selected-game="briscola_venceslao"] .eyebrow { color: var(--selector-accent); }
.lobby-shell[data-selected-game="briscola_venceslao"] .btn-primary { background: var(--selector-accent); border-color: var(--selector-accent); color: #0b281d; }
.lobby-shell[data-selected-game="briscola_venceslao"] .variant-drawer { display: none; }
.visibility-choice small .selected-game-name { display: inline; }
.lobby-intro { align-self: center; }
.eyebrow, .status-label { color: var(--gold); font-size: .65rem; font-weight: 700; letter-spacing: .16em; }
.lobby-intro h1 { margin: 18px 0 22px; font-size: clamp(3.3rem, 7vw, 6.4rem); font-weight: 600; letter-spacing: -.07em; line-height: .91; }
.lobby-intro h1 em { color: var(--gold); font-family: "Playfair Display", Georgia, serif; font-weight: 700; }
.suit-row { display: flex; gap: 12px; margin-top: 36px; }
.suit-row span { display: grid; place-items: center; width: 48px; height: 58px; background: #ebe6d7; border: 1px solid #b9ae91; border-radius: 7px; box-shadow: 0 8px 20px rgba(0,0,0,.24); font-size: 1.35rem; transform: rotate(-5deg); }
.suit-row span:nth-child(even) { transform: translateY(5px) rotate(5deg); }
.public-tables { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); text-align: left; }
.public-tables-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.public-tables h2 { margin: 3px 0 0; font-size: 1.45rem; letter-spacing: -.035em; }
.public-tables-count { color: var(--gold); font-size: .75rem; font-weight: 700; white-space: nowrap; }
.public-tables > p { margin: 6px 0 14px; color: var(--muted); font-size: .82rem; }
.public-tables > label { display: block; margin: 0 0 5px; color: #bdc9c3; font-size: .75rem; font-weight: 600; }
.public-tables > input { margin-bottom: 12px; }
.public-tables-list { display: grid; gap: 9px; max-height: 360px; overflow-y: auto; }
.public-tables-status { margin: 0; padding: 16px 12px; color: var(--muted); background: rgba(255,255,255,.025); border-radius: 9px; font-size: .82rem; }
.public-table-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; padding: 12px; background: rgba(255,255,255,.035); border: 1px solid var(--line); border-radius: 10px; }
.public-table-details { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.public-table-details strong, .public-table-details span { overflow-wrap: anywhere; }
.public-table-details strong { font-size: .88rem; }
.public-table-details span { color: var(--muted); font-size: .75rem; }
.public-table-card .btn { flex: none; white-space: nowrap; }
.visibility-choice, .variant-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 7px 0 0; padding: 0; border: 0; }
.variant-drawer { margin-top: 2px; border: 1px solid var(--line); border-radius: 9px; }
.variant-drawer > summary { display: flex; align-items: center; justify-content: space-between; padding: 11px 13px; color: var(--text); cursor: pointer; font-size: .82rem; font-weight: 700; list-style: none; }
.variant-drawer > summary::-webkit-details-marker { display: none; }
.variant-drawer > summary::after { content: '⌄'; color: var(--gold); font-size: 1rem; }
.variant-drawer[open] > summary::after { content: '⌃'; }
.variant-drawer > summary span { margin-left: auto; padding-right: 10px; color: var(--gold-bright); font-size: .72rem; }
.variant-drawer .variant-choice { margin: 0; padding: 0 10px 10px; }
.visibility-choice legend, .variant-choice legend { margin-bottom: 8px; color: #bdc9c3; font-size: .78rem; font-weight: 600; }
.visibility-choice label, .variant-choice label { display: flex; align-items: flex-start; gap: 7px; margin: 0; padding: 10px; color: var(--text); background: rgba(255,255,255,.025); border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.visibility-choice label:has(input:checked), .variant-choice label:has(input:checked) { border-color: var(--gold); background: rgba(228,184,90,.1); }
.visibility-choice input, .variant-choice input { flex: none; margin: 3px 0 0; accent-color: var(--gold); }
.visibility-choice span, .variant-choice span { display: flex; flex-direction: column; gap: 3px; }
.visibility-choice strong, .variant-choice strong { font-size: .82rem; }
.visibility-choice small, .variant-choice small { color: var(--muted); font-size: .68rem; font-weight: 400; line-height: 1.3; }
.join-table-details { min-height: 1.5em; margin: 0; color: var(--muted); font-size: .75rem; }
.join-table-details.is-variant { color: var(--gold-bright); font-weight: 700; }
.public-table-variant { color: var(--gold-bright) !important; font-weight: 700; }
.half-heart { display: inline-block; width: .55em; overflow: hidden; vertical-align: baseline; white-space: nowrap; }
.lives-count .life-total { margin-left: 3px; color: var(--text); font-size: .8em; font-variant-numeric: tabular-nums; }
.game-variant-badge { grid-column: 1; justify-self: start; max-width: 100%; overflow: hidden; padding: 4px 7px; color: var(--gold-bright); background: rgba(228,184,90,.1); border: 1px solid rgba(228,184,90,.32); border-radius: 7px; font-size: .65rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.card-license-drawer { margin: 24px 0 0; color: var(--muted); font-size: .7rem; }
.card-license-drawer summary { color: #cbd4cf; cursor: pointer; font-weight: 700; list-style: none; }
.card-license-drawer summary::before { content: '＋'; display: inline-block; width: 1.1em; color: var(--gold); }
.card-license-drawer[open] summary::before { content: '−'; }
.card-license-copy { padding: 8px 0 0 18px; line-height: 1.45; }
.card-license-copy p { margin: 0 0 7px; }
.card-license-copy ul { padding-left: 18px; margin: 0 0 7px; }
.card-license-copy a { color: var(--gold-bright); }
[data-theme-mode="light"] .card-license-drawer summary { color: var(--text); }

.lobby-panel { position: relative; align-self: center; min-height: 472px; padding: 10px 30px 24px; background: rgba(16,29,26,.96); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.install-app-btn { display: flex; align-items: center; justify-content: space-between; width: 100%; margin: 0 0 14px; padding: 10px 13px; color: var(--gold-bright); background: rgba(228,184,90,.09); border: 1px solid rgba(228,184,90,.35); border-radius: 8px; font-weight: 700; }
.install-app-btn:hover { background: rgba(228,184,90,.16); border-color: var(--gold); }
.lobby-tabs { display: grid; grid-template-columns: 1fr 1fr; margin: 0 -14px 26px; padding: 6px; background: rgba(0,0,0,.2); border-radius: 12px; }
.lobby-tab { padding: 10px; color: var(--muted); background: transparent; border: 0; border-radius: 8px; font-weight: 600; }
.lobby-tab.active { color: var(--text); background: var(--panel-2); box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.lobby-form { display: flex; flex-direction: column; gap: 10px; min-height: 260px; }
.lobby-form label { margin-top: 4px; color: #bdc9c3; font-size: .78rem; font-weight: 600; }
.lobby-form > small { color: var(--muted); text-align: center; font-size: .72rem; }
input[type="text"], input[type="number"] { width: 100%; min-height: 46px; padding: 10px 13px; color: var(--text); background: #091410; border: 1px solid var(--line); border-radius: 9px; outline: none; }
input::placeholder { color: #61736b; }
input:focus { border-color: rgba(228,184,90,.72); box-shadow: 0 0 0 3px rgba(228,184,90,.11); }
.code-input { text-transform: uppercase; letter-spacing: .22em; font-weight: 700; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 15px; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; font-weight: 700; transition: border-color .15s, background .15s, transform .15s; }
.btn:hover:not(:disabled) { border-color: rgba(228,184,90,.58); transform: translateY(-1px); }
.btn:disabled { opacity: .42; cursor: not-allowed; }
.btn-primary { color: #20190c; background: linear-gradient(135deg, var(--gold-bright), var(--gold)); border-color: transparent; }
.btn-secondary { background: #1b302a; }
.btn-quiet { min-height: 36px; color: var(--muted); background: transparent; }
.btn-block { width: 100%; min-height: 48px; margin-top: 8px; justify-content: space-between; padding-inline: 18px; }
.lobby-discover-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 24px; margin-top: 30px; }
.leaderboard-open-btn { min-height: 40px; padding: 8px 14px; color: var(--text); background: var(--panel-2); border: 1px solid var(--gold); border-radius: 9px; font: inherit; font-size: .88rem; font-weight: 800; }
.leaderboard-open-btn:hover, .leaderboard-open-btn:focus-visible { color: var(--gold-bright); background: var(--panel); }
.rules-open-btn { display: inline-flex; align-items: baseline; justify-content: center; gap: 12px; min-height: 40px; padding: 8px 2px; color: var(--text); background: transparent; border: 0; border-radius: 5px; font: inherit; font-size: .88rem; font-weight: 600; white-space: nowrap; }
.rules-open-btn:hover, .rules-open-btn:focus-visible { color: var(--gold-bright); }
.rules-open-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.rules-open-btn span { color: var(--muted); font-size: .78rem; font-weight: 400; }
.rules-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 20px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.rules-modal-grid { margin: 0; padding: 0; border: 0; }
.rules-grid p { display: flex; flex-direction: column; gap: 5px; margin: 0; font-size: .8rem; }
.rules-grid b { color: var(--text); }
.rules-grid span { color: var(--muted); }

.messages { position: fixed; z-index: 1200; top: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100vw - 36px)); pointer-events: none; }
.message { padding: 11px 13px; color: var(--text); background: #23332e; border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 8px; box-shadow: 0 12px 30px rgba(0,0,0,.35); pointer-events: auto; font-size: .82rem; }
.message.success { border-left-color: var(--green); }
.message.error { border-left-color: var(--red); }

.game-shell { animation: appear .25s ease-out; }
@keyframes appear { from { opacity: 0; transform: translateY(5px); } }
.game-toolbar { display: flex; align-items: center; gap: 8px; height: 39px; margin-bottom: 6px; }
.code-chip { height: 36px; padding: 0 13px; color: var(--gold); background: #17251f; border: 1px solid rgba(228,184,90,.25); border-radius: 8px; font-size: .75rem; font-weight: 800; letter-spacing: .1em; }
.invite-link { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.invite-link input { width: min(32vw, 340px); min-height: 36px; padding: 7px 10px; color: var(--muted); font-size: .72rem; }
.game-toolbar .btn { min-height: 36px; padding-block: 6px; font-size: .75rem; }
.game-status-bar { display: grid; grid-template-columns: 1fr; align-items: center; gap: 20px; height: 60px; padding: 8px 16px; margin-bottom: 8px; background: rgba(16,29,26,.9); border: 1px solid var(--line); border-radius: 10px; }
.status-metrics { display: flex; align-items: center; justify-content: center; height: 40px; border-inline: 1px solid var(--line); }
.status-metrics > span { display: flex; flex-direction: column; align-items: center; min-width: 76px; }
.status-metrics small, .seat-stats small, .turn-flow small { color: var(--muted); font-size: .58rem; font-weight: 700; letter-spacing: .13em; }
.status-metrics strong { font-size: 1.08rem; font-variant-numeric: tabular-nums; }
.status-metrics i { margin: 0 2px; color: #5d7068; font-style: normal; }

.table-stage { margin-bottom: 8px; }
.table-rim { height: 720px; padding: 10px; background: linear-gradient(145deg, #49361d, #20170d 42%, #5e4727 70%, #1c150c); border: 1px solid #715936; border-radius: 42% / 14%; box-shadow: 0 30px 70px rgba(0,0,0,.42), inset 0 2px 1px rgba(255,255,255,.16); }
.table-felt { position: relative; width: 100%; height: 100%; overflow: visible; background: radial-gradient(ellipse at 50% 44%, var(--felt-bright, #126148), var(--felt) 54%, var(--felt-dark) 100%); border: 2px solid rgba(0,0,0,.48); border-radius: 47% / 16%; box-shadow: inset 0 0 70px rgba(0,0,0,.45), inset 0 0 0 6px rgba(255,255,255,.025); }
.felt-texture { position: absolute; inset: 0; opacity: .16; background-image: repeating-linear-gradient(35deg, transparent 0 3px, rgba(255,255,255,.035) 3px 4px); }
.players-list { position: absolute; z-index: 10; inset: 0; pointer-events: none; }
.player-badge { --seat-scale: 1; position: absolute; z-index: 3; display: flex; flex-direction: column; width: 198px; height: 154px; padding: 11px 12px; color: var(--text); background: rgba(8,22,17,.94); border: 1px solid rgba(191,211,201,.2); border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,.32); transform: translate(-50%, -50%); transition: border-color .18s, box-shadow .18s, background .18s; pointer-events: auto; }
.player-badge:has(.seat-chat-popover) { z-index: 50; }
.player-badge.is-you { border-color: rgba(228,184,90,.48); }
.player-badge.is-active { background: #172d25; border-color: var(--gold-bright); box-shadow: 0 0 0 3px rgba(228,184,90,.16), 0 12px 30px rgba(0,0,0,.4); }
.player-badge.is-next { border-color: rgba(76,196,139,.75); box-shadow: 0 0 0 2px rgba(76,196,139,.12), 0 10px 25px rgba(0,0,0,.3); }
.player-badge.is-spectator { opacity: .72; filter: saturate(.65); }
.players-list.few-players .player-badge { width: 240px; height: 174px; padding: 13px 15px; }
.seat-chat-popover { position: absolute; z-index: 30; bottom: calc(100% + 10px); left: 50%; width: max-content; min-width: 70px; max-width: 230px; padding: 9px 11px; color: #1b251f; background: #fffdf5; border: 1px solid rgba(24,39,31,.18); border-radius: 12px 12px 12px 4px; box-shadow: 0 10px 26px rgba(0,0,0,.3); transform: translateX(-50%); font-size: .74rem; font-weight: 600; line-height: 1.3; pointer-events: none; animation: chat-pop .18s ease-out; }
.seat-chat-text { display: -webkit-box; max-height: 76px; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow-wrap: anywhere; }
.seat-chat-popover::after { content: ""; position: absolute; top: 100%; left: 50%; border: 6px solid transparent; border-top-color: #fffdf5; transform: translateX(-50%); }
.seat-chat-popover.below { top: calc(100% + 10px); bottom: auto; border-radius: 4px 12px 12px; }
.seat-chat-popover.below::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: #fffdf5; }
@keyframes chat-pop { from { opacity: 0; transform: translate(-50%, 5px) scale(.96); } }
.seat-header { display: flex; align-items: center; gap: 8px; min-height: 29px; }
.player-avatar { display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; color: #14251e; background: #b8cbc1; border-radius: 50%; font-size: .76rem; font-weight: 800; }
.is-active .player-avatar { background: var(--gold-bright); }
.is-next .player-avatar { background: #65cf9d; }
.player-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .83rem; font-weight: 800; }
.seat-header .player-name { flex: 1 1 auto; }
.hand-visibility-toggle { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 25px; height: 25px; padding: 4px; color: var(--muted); background: transparent; border: 1px solid rgba(191,211,201,.2); border-radius: 6px; cursor: pointer; }
.hand-visibility-toggle:hover, .hand-visibility-toggle:focus-visible { color: var(--text); border-color: var(--gold); }
.hand-visibility-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.turn-marker { margin-left: auto; padding: 3px 6px; color: #241b0c; background: var(--gold-bright); border-radius: 99px; font-size: .52rem; font-weight: 900; letter-spacing: .08em; }
.next-marker { margin-left: auto; padding: 3px 6px; color: #092117; background: #65cf9d; border-radius: 99px; font-size: .52rem; font-weight: 900; letter-spacing: .08em; }
.seat-subtitle { height: 22px; padding: 2px 0 0 36px; overflow: hidden; color: var(--muted); font-size: .64rem; white-space: nowrap; }
.seat-subtitle:empty { display: none; }
.seat-header .lives-count { margin-left: auto; font-size: .62rem; white-space: nowrap; }
.lives-count { color: #e7aaaa; }
.babbeo-badge { color: var(--gold-bright); font-weight: 800; }
.seat-body { display: grid; grid-template-columns: 74px 1fr; gap: 8px; height: 78px; padding-top: 7px; border-top: 1px solid rgba(255,255,255,.09); }
.seat-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.seat-stats span { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.seat-stats strong { font-size: 1rem; font-variant-numeric: tabular-nums; }
.table-card-slot { position: relative; display: grid; place-items: center; min-width: 0; height: 68px; color: rgba(255,255,255,.23); background: rgba(0,0,0,.15); border: 1px dashed rgba(255,255,255,.13); border-radius: 7px; }
.table-card-slot::before { content: "PLAYED"; position: absolute; top: 3px; left: 5px; color: rgba(255,255,255,.4); font-size: .42rem; letter-spacing: .1em; }
.table-playing-card { position: relative; display: flex; align-items: center; justify-content: center; gap: 5px; width: 66px; height: 65px; color: var(--ink); background: var(--card); border: 1px solid #c8bfa6; border-radius: 6px; box-shadow: 0 3px 8px rgba(0,0,0,.35); line-height: 1; }
.table-playing-card.image-card { overflow: hidden; padding: 0; }
.table-playing-card.image-card img { width: 100%; height: 100%; object-fit: contain; }
.table-card-rank { font-family: Georgia, serif; font-size: 1.42rem; font-weight: 900; }
.table-card-suit { font-size: 1.55rem; }
.ace-direction-arrow { position: absolute; z-index: 2; top: 4px; left: 50%; display: grid; place-items: center; width: 22px; height: 22px; color: #211a0c; background: var(--gold-bright); border-radius: 50%; font-size: 1.05rem; font-weight: 900; line-height: 1; transform: translateX(-50%); }
.ace-direction-arrow.arrow-down { top: auto; bottom: 4px; }
.card-hidden { color: white; background: repeating-linear-gradient(45deg, #1b526d 0 4px, #194760 4px 8px); border-color: #77a6b9; font-size: 1.15rem; }
.turn-flow div { display: flex; flex-direction: column; min-width: 0; }
.turn-flow b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .7rem; }
.flow-arrow { color: var(--gold); }
.table-caption { display: flex; align-items: center; gap: 18px; min-height: 48px; padding: 5px 18px; color: var(--muted); font-size: .68rem; }
.round-actions { display: flex; align-items: center; justify-content: flex-end; min-height: 38px; margin-left: auto; }
.round-actions:empty { min-height: 0; }
.round-actions .btn { min-height: 38px; padding: 7px 18px; }
.history-bubble { padding: 4px 9px; color: var(--gold-bright); background: rgba(228,184,90,.12); border: 1px solid rgba(228,184,90,.35); border-radius: 99px; font-size: .64rem; }
.history-bubble:hover { background: rgba(228,184,90,.25); }
.legend-dot { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; }

.host-controls { display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 13px 18px; margin-bottom: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.host-controls > div { display: flex; flex-direction: column; margin-right: auto; }
.host-controls > div span { color: var(--muted); font-size: .72rem; }
.mobile-chat-form { display: none; }
.setup-control { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .72rem; }
.setup-control input { width: 60px; min-height: 38px; padding: 6px 8px; text-align: center; }
.standings-panel { padding: 20px; margin: 40px 0 16px; background: var(--panel); border: 1px solid rgba(228,184,90,.5); border-radius: 12px; }
.standings-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.standings-heading h2 { margin: 2px 0 0; font-size: 1.15rem; }
.standings-winner { color: var(--gold); font-weight: 800; }
.standings-list { display: grid; gap: 6px; }
.standing-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto auto auto auto; align-items: center; gap: 8px; padding: 9px 12px; color: var(--muted); background: rgba(255,255,255,.035); border-radius: 7px; }
.standing-row.winner-row { color: var(--text); background: rgba(228,184,90,.1); outline: 1px solid rgba(228,184,90,.3); }
.standing-rank, .winner-mark { color: var(--gold); }
.standing-lives { white-space: nowrap; }
.standing-lives b { margin-left: 4px; color: var(--text); font-variant-numeric: tabular-nums; }
.standing-elo { min-width: 58px; text-align: right; font-size: .78rem; font-variant-numeric: tabular-nums; }
.standing-elo-result { min-width: 58px; text-align: right; color: var(--text); font-size: .78rem; font-variant-numeric: tabular-nums; }
.standing-elo.positive { color: #76d69a; }
.standing-elo.negative { color: #ed8f8f; }
.perfect-mark { display: block; font-size: .5rem; text-transform: uppercase; letter-spacing: .08em; }

.hand-dock { position: absolute; z-index: 30; bottom: -18px; left: 50%; width: min(820px, calc(100% - 150px)); height: 138px; transform: translateX(-50%); }
.hand-heading { position: absolute; z-index: 3; top: 0; right: 12px; left: 12px; display: flex; align-items: center; justify-content: space-between; height: 22px; pointer-events: none; }
#hand-hint { color: #bed0c8; font-size: .66rem; text-shadow: 0 1px 2px #05231a; }
.game-actions { position: absolute; z-index: 5; top: -49px; left: 50%; display: flex; align-items: center; justify-content: center; width: min(720px, 100%); min-height: 46px; transform: translateX(-50%); }
.betting-form { display: flex; align-items: center; justify-content: center; gap: 10px; width: auto; min-height: 44px; padding: 5px 9px; background: rgba(5,27,20,.92); border: 1px solid rgba(255,255,255,.12); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.3); backdrop-filter: blur(5px); }
.your-betting-turn { background: rgba(55,43,17,.96); border-color: rgba(228,184,90,.55); }
.your-turn-label { color: var(--gold-bright); font-size: .75rem; }
.bet-label, .bet-display, .waiting-message { color: var(--muted); font-size: .8rem; }
.game-actions > .bet-display,
.game-actions > .waiting-message { margin: 0; padding: 7px 12px; color: #dbe8e2; background: rgba(5,27,20,.9); border: 1px solid rgba(255,255,255,.12); border-radius: 9px; box-shadow: 0 6px 18px rgba(0,0,0,.24); }
.bet-options { display: flex; gap: 6px; }
.bet-control-wrap { position: relative; width: max-content; max-width: 100%; min-width: 0; }
.bet-selection-hint { position: absolute; z-index: 4; bottom: calc(100% + 6px); left: 50%; width: max-content; max-width: min(360px, calc(100vw - 24px)); padding: 5px 9px; color: var(--gold-bright); background: rgba(5,27,20,.96); border: 1px solid rgba(228,184,90,.55); border-radius: 7px; box-shadow: 0 5px 16px rgba(0,0,0,.28); font-size: .72rem; line-height: 1.25; text-align: center; white-space: nowrap; transform: translateX(-50%); pointer-events: none; }
.bet-options.bet-change-countdown,
.bet-options.bet-change-notice {
    margin: 0;
    min-height: 36px;
    padding: 6px 10px;
    align-items: center;
    justify-content: center;
    color: var(--gold-bright);
    background: rgba(55,43,17,.96);
    border: 1px solid rgba(228,184,90,.55);
    border-radius: 9px;
    box-shadow: 0 6px 18px rgba(0,0,0,.24);
    font-size: .78rem;
}
.bet-options.bet-change-countdown strong { font-variant-numeric: tabular-nums; }
.bet-options.bet-change-notice { color: #ffe4a0; }
.bet-choice { min-width: 38px; min-height: 36px; padding: 6px 10px; }
.bet-choice:hover:not(:disabled) { color: #1d160a; background: var(--gold); }
.cards-row { position: absolute; inset: 16px 0 0; display: flex; align-items: flex-end; justify-content: center; height: 122px; padding: 5px 20px 2px; overflow-x: auto; overflow-y: hidden; background: linear-gradient(to bottom, transparent, rgba(4,25,18,.72) 38%, rgba(4,20,15,.92)); border: 0; border-radius: 45% 45% 10px 10px / 22% 22% 10px 10px; scrollbar-width: thin; }
.cards-row.is-short-hand { justify-content: center; overflow-x: hidden; }
.cards-row .round-continue-action { align-self: center; width: min(280px, calc(100% - 40px)); }
.no-cards { width: 100%; color: var(--muted); text-align: center; }
.card { position: relative; flex: 0 0 80px; width: 80px; height: 112px; overflow: hidden; color: var(--ink); background: linear-gradient(135deg, #fffaf0, var(--card)); border: 1px solid #c8bfa6; border-radius: 8px; box-shadow: 0 5px 11px rgba(0,0,0,.3); transition: transform .15s, box-shadow .15s, opacity .15s; }
.card.is-front,
.card.is-front:hover { z-index: 40; }
.card.suit-denari { background: linear-gradient(145deg, #ffe5e1, #f4b9b0); }
.card.suit-coppe { background: linear-gradient(145deg, #fff5ad, #f5dd71); }
.card.suit-spade { background: linear-gradient(145deg, #e2f1ff, #bcdcff); }
.card.suit-bastoni { background: linear-gradient(145deg, #eadfce, #d2b995); }
.card + .card { margin-left: -5px; }
.card.clickable { cursor: pointer; box-shadow: 0 0 0 2px rgba(228,184,90,.7), 0 7px 15px rgba(0,0,0,.35); }
.card.clickable:hover { z-index: 2; transform: translateY(-8px); box-shadow: 0 0 0 2px var(--gold-bright), 0 15px 22px rgba(0,0,0,.42); }
.card.playing { transform: translateY(-14px) scale(.96); opacity: .7; }
.card.disabled { opacity: .55; filter: saturate(.65); cursor: not-allowed; }
.card.premove-selected { outline: 3px dashed var(--gold-bright); outline-offset: 3px; opacity: 1; filter: none; }
.card.premove-available { cursor: crosshair; }
.premove-controls { display: flex; align-items: center; gap: 8px; padding: 5px 7px 5px 12px; color: var(--gold-bright); background: rgba(5,27,20,.92); border: 1px solid rgba(228,184,90,.42); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.3); font-size: .72rem; }
.premove-controls .btn { min-height: 36px; color: var(--text); border-color: rgba(228,184,90,.36); }
.strength-choice { position: absolute; z-index: 5; inset: 0; display: grid; grid-template-rows: 1fr 1fr; overflow: hidden; opacity: 0; pointer-events: none; background: rgba(7,18,14,.76); backdrop-filter: blur(2px); transition: opacity .14s; }
.has-strength-choice:focus-within .strength-choice,
.has-strength-choice .strength-choice.is-open { opacity: 1; pointer-events: auto; }
@media (hover: hover) and (pointer: fine) {
    .has-strength-choice:hover .strength-choice { opacity: 1; pointer-events: auto; }
}
.strength-choice button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 0; color: #fff; background: rgba(19,73,103,.72); border: 0; font-size: .56rem; font-weight: 900; letter-spacing: .08em; }
.strength-choice .strength-high { grid-row: 1; color: #261c09; background: rgba(240,190,80,.92); }
.strength-choice .strength-low { grid-row: 2; color: #fff; background: rgba(19,73,103,.72); border-top: 1px solid rgba(255,255,255,.5); }
.strength-choice button:hover,
.strength-choice button:focus-visible { filter: brightness(1.18); outline: 3px solid white; outline-offset: -3px; }
.strength-choice button:disabled { opacity: .55; }
.strength-choice b { font-size: 1.35rem; line-height: 1; }
.card-top-left { position: absolute; top: 7px; left: 7px; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.card .rank { display: flex; flex-direction: column; align-items: center; max-width: 80px; font-size: .7rem; font-weight: 800; text-align: center; }
.card .rank strong { font-size: 1.65rem; line-height: .95; }
.card .rank small { margin-top: 3px; font-size: .58rem; }
.card .suit-icon { font-size: .9rem; }
.card-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.card .suit-icon.large { font-size: 2.7rem; }
.face-down { display: grid; place-items: center; color: white; background: repeating-linear-gradient(45deg, #1b526d 0 6px, #194760 6px 12px) !important; border: 4px double #bdd1d9; }
.card-art { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.card-back-mark { font-size: 2.5rem; }

.chat-widget { position: fixed; z-index: 55; right: 22px; bottom: 22px; }
.chat-toggle { position: relative; display: grid; place-items: center; width: 54px; height: 54px; color: #20190c; background: linear-gradient(135deg, var(--gold-bright), var(--gold)); border: 0; border-radius: 50%; box-shadow: 0 12px 30px rgba(0,0,0,.42); }
.chat-toggle svg { width: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.chat-unread { position: absolute; top: -3px; right: -2px; display: grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; color: white; background: var(--red); border: 2px solid var(--bg); border-radius: 99px; font-size: .62rem; font-weight: 800; }
.chat-panel { position: absolute; right: 0; bottom: 0; display: grid; grid-template-rows: 58px 1fr 56px; width: min(350px, calc(100vw - 28px)); height: min(460px, calc(100vh - 44px)); overflow: hidden; background: #101d1a; border: 1px solid rgba(228,184,90,.28); border-radius: 15px; box-shadow: 0 25px 70px rgba(0,0,0,.55); }
.chat-panel { z-index: 56; }
.chat-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.chat-header > div { display: flex; flex-direction: column; }
.chat-header small { color: var(--muted); font-size: .62rem; }
.chat-header button { width: 32px; height: 32px; color: var(--muted); background: transparent; border: 0; font-size: 1.5rem; }
.chat-messages { display: flex; flex-direction: column; gap: 10px; padding: 14px; overflow-y: auto; }
.chat-empty { margin: auto; color: var(--muted); font-size: .75rem; text-align: center; }
.chat-message { align-self: flex-start; max-width: 88%; }
.chat-message.is-mine { align-self: flex-end; }
.chat-message-head { display: flex; gap: 7px; margin: 0 5px 3px; color: var(--muted); font-size: .6rem; }
.chat-message-head strong { color: #c3d0ca; }
.chat-message.is-mine .chat-message-head { justify-content: flex-end; }
.chat-message-body { padding: 8px 10px; overflow-wrap: anywhere; color: #dfe7e2; background: #1b302a; border-radius: 4px 11px 11px 11px; font-size: .78rem; }
.chat-message.is-mine .chat-message-body { color: #281f0d; background: var(--gold); border-radius: 11px 4px 11px 11px; }
.chat-form { display: grid; grid-template-columns: 1fr 38px; gap: 7px; padding: 9px; border-top: 1px solid var(--line); }
.chat-form input { min-height: 38px; }
.chat-form button { color: #20190c; background: var(--gold); border: 0; border-radius: 8px; font-size: 1.05rem; font-weight: 900; }

.turn-history-panel { position: fixed; z-index: 1500; right: 20px; bottom: 76px; width: min(350px, calc(100vw - 32px)); max-height: min(470px, calc(100vh - 110px)); overflow: hidden; color: var(--text); background: var(--panel); border: 1px solid rgba(228,184,90,.45); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.turn-history-heading { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.turn-history-heading button { color: var(--muted); background: transparent; border: 0; font-size: 1.35rem; }
.turn-history-content { max-height: min(410px, calc(100vh - 170px)); padding: 10px; overflow-y: auto; }
.history-empty { padding: 18px; color: var(--muted); text-align: center; font-size: .76rem; }
.history-turn { padding: 10px; margin-bottom: 8px; background: rgba(255,255,255,.045); border-radius: 9px; }
.history-turn > strong { margin-right: 7px; }
.history-turn > small { color: var(--muted); }
.history-hand { display: flex; justify-content: space-between; gap: 10px; padding-top: 7px; margin-top: 7px; border-top: 1px solid var(--line); color: var(--muted); font-size: .72rem; }
.history-hand b { color: var(--text); }
.history-cards { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.history-cards span { padding: 2px 5px; color: var(--text); background: rgba(255,255,255,.08); border-radius: 4px; font-size: .66rem; }

.turn-summary-modal { position: fixed; z-index: 2000; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(1,13,9,.64); backdrop-filter: blur(5px); }
.turn-summary-card { position: relative; width: min(430px, 100%); padding: 27px; color: var(--text); background: var(--panel); border: 1px solid rgba(228,184,90,.6); border-radius: 18px; box-shadow: 0 25px 90px rgba(0,0,0,.55); animation: summary-pop .22s ease-out; }
.turn-summary-card h2 { margin: 5px 0 18px; font-size: 1.35rem; }
.turn-summary-card p { margin: 8px 0; padding: 10px 12px; color: var(--muted); background: rgba(255,255,255,.045); border-radius: 8px; }
.turn-summary-card p strong { color: var(--text); }
.turn-summary-card .btn { width: 100%; justify-content: center; margin-top: 18px; }
.turn-summary-close { position: absolute; top: 8px; right: 12px; color: var(--muted); background: transparent; border: 0; font-size: 1.6rem; }
@keyframes summary-pop { from { opacity: 0; transform: translateY(10px) scale(.97); } }

[data-theme-mode="light"] {
    --bg: #eeeae0;
    --panel: #fbfaf5;
    --panel-2: #f2eee4;
    --line: rgba(29, 52, 43, .16);
    --text: #17241f;
    --muted: #63756d;
    --gold: #b77a18;
    --gold-bright: #d99a2e;
    --ink: #17201d;
    color-scheme: light;
}
[data-theme-mode="light"] body { background: radial-gradient(circle at 50% -20%, #fffdf7 0, #eeeae0 48%); }
[data-theme-mode="light"] .ambient-glow { opacity: .35; }
[data-theme-mode="light"] .lobby-panel,
[data-theme-mode="light"] .game-status-bar { background: rgba(251,250,245,.94); box-shadow: 0 20px 60px rgba(42,52,47,.12); }
[data-theme-mode="light"] .lobby-shell[data-selected-game="briscola_venceslao"] { --selector-accent: #237957; }
[data-theme-mode="light"] .lobby-form label,
[data-theme-mode="light"] .public-tables > label,
[data-theme-mode="light"] .visibility-choice legend,
[data-theme-mode="light"] .variant-choice legend { color: var(--text); }
[data-theme-mode="light"] input[type="text"],
[data-theme-mode="light"] input[type="number"] { color: var(--text); background: #fff; }
[data-theme-mode="light"] .lobby-tabs,
[data-theme-mode="light"] .code-chip { background: #e6e1d5; }
[data-theme-mode="light"] .btn-secondary { background: #e4e9e4; }
[data-theme-mode="light"] .btn-quiet { color: #4f625a; }
[data-theme-mode="light"] .message { background: #fff; box-shadow: 0 12px 30px rgba(39,52,46,.16); }
[data-theme-mode="light"] .host-controls,
[data-theme-mode="light"] .standings-panel { box-shadow: 0 10px 30px rgba(42,52,47,.08); }
[data-theme-mode="light"] .chat-panel { background: #fbfaf5; box-shadow: 0 25px 70px rgba(30,43,37,.25); }
[data-theme-mode="light"] .chat-message-body { color: #263830; background: #e4ebe6; }
[data-theme-mode="light"] .chat-header small,
[data-theme-mode="light"] .chat-message-head strong { color: #5f7169; }
.table-felt {
    --text: #f4f2e8;
    --muted: #91a49c;
    --gold: var(--theme-table-accent, #e4b85a);
    --gold-bright: var(--theme-table-accent-bright, #ffd77b);
    color: var(--text);
}

/* Account, profile, friends, and replay UI */
.account-bar { position: fixed; z-index: 1050; top: max(12px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); display: flex; gap: 7px; max-width: calc(100vw - 24px); }
.account-button { min-height: 38px; padding: 8px 12px; color: var(--text); background: rgba(16,29,26,.94); border: 1px solid var(--line); border-radius: 99px; font: inherit; font-size: .72rem; font-weight: 800; white-space: nowrap; box-shadow: 0 7px 20px rgba(0,0,0,.18); }
.account-primary { color: #241b0c; background: var(--gold); }
.notification-button { position: relative; }
.notification-badge { position: absolute; top: -7px; right: -4px; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; color: white; background: var(--red); border: 2px solid var(--bg); border-radius: 99px; font-size: .58rem; }
.social-modal { position: fixed; z-index: 3000; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(1,13,9,.78); backdrop-filter: blur(6px); }
.social-card { width: min(760px, 100%); max-height: min(850px, calc(100dvh - 24px)); overflow: hidden; color: var(--text); background: var(--panel); border: 1px solid rgba(228,184,90,.45); border-radius: 18px; box-shadow: 0 30px 100px rgba(0,0,0,.6); }
.social-card > header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.social-header-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.social-back { min-height: 30px; padding: 4px 9px; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); border-radius: 99px; font-size: .7rem; font-weight: 700; white-space: nowrap; }
.social-back:hover, .social-back:focus-visible { color: var(--gold-bright); border-color: var(--gold); }
.social-card h2 { margin: 3px 0 0; font-size: 1.45rem; }
.social-close { width: 42px; height: 42px; color: var(--muted); background: transparent; border: 0; font-size: 1.8rem; }
.announcement-open { overflow: hidden; }
.announcement-overlay { position: fixed; z-index: 4000; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(2, 12, 10, .78); backdrop-filter: blur(10px); }
.announcement-card { display: grid; grid-template-columns: 5px minmax(0, 1fr); width: min(680px, 100%); max-height: min(760px, calc(100dvh - 40px)); overflow: hidden; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 32px 100px rgba(0,0,0,.48); }
.announcement-accent { background: linear-gradient(180deg, var(--gold-bright), var(--gold) 55%, transparent); }
.announcement-content { min-height: 0; overflow-y: auto; padding: clamp(24px, 5vw, 40px); }
.announcement-eyebrow { color: var(--gold-bright); font-size: .66rem; font-weight: 800; letter-spacing: .18em; }
.announcement-header h2 { margin: 9px 0 8px; font-family: "Playfair Display", Georgia, serif; font-size: clamp(2rem, 5vw, 2.9rem); font-weight: 700; letter-spacing: -.035em; line-height: 1.1; }
.announcement-header p { max-width: 46ch; margin: 0; color: var(--muted); font-size: .94rem; }
.announcement-features { display: grid; margin-top: 30px; border-top: 1px solid var(--line); }
.announcement-feature { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 14px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.announcement-feature-number { padding-top: 3px; color: var(--gold-bright); font-size: .72rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.announcement-feature h3 { margin: 0 0 7px; font-size: 1.12rem; line-height: 1.25; }
.announcement-feature p { margin: 0; color: var(--muted); font-size: .84rem; line-height: 1.55; }
.announcement-feature .announcement-how-to { margin-top: 10px; color: var(--text); }
.announcement-how-to strong { color: var(--gold-bright); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; }
.announcement-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 26px; }
.announcement-footer .btn { min-width: 132px; min-height: 44px; }
.announcement-error { margin: 0; color: var(--red); font-size: .78rem; }
.social-content { max-height: calc(100dvh - 120px); padding: 18px 20px 24px; overflow: auto; overscroll-behavior: contain; }
.keyboard-shortcuts { display: grid; gap: 8px; }
.keyboard-shortcuts > p { margin: 0 0 6px; color: var(--muted); font-size: .8rem; }
.keyboard-shortcut-row { display: grid; grid-template-columns: minmax(125px, 175px) minmax(0, 1fr); align-items: center; gap: 14px; min-height: 38px; padding: 6px 10px; background: rgba(255,255,255,.035); border: 1px solid var(--line); border-radius: 8px; font-size: .78rem; }
.keyboard-shortcut-row kbd { justify-self: start; padding: 4px 7px; color: var(--gold-bright); background: var(--panel-2); border: 1px solid rgba(228,184,90,.25); border-radius: 5px; font-family: inherit; font-size: .7rem; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.social-card.leaderboard-card { display: flex; flex-direction: column; }
.leaderboard-card > header { flex: none; }
.leaderboard-card > .social-content { min-height: 0; max-height: none; overflow-y: auto; scrollbar-gutter: stable; }
.social-card.profile-card { display: flex; flex-direction: column; height: min(760px, calc(100dvh - 32px)); }
.profile-card > .social-content.profile-content { display: flex; flex: 1; flex-direction: column; min-height: 0; max-height: none; overflow: hidden; }
.profile-content #profile-pane { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; margin-bottom: 16px; background: rgba(255,255,255,.05); border-radius: 10px; }
.auth-tabs button { padding: 10px; color: var(--muted); background: transparent; border: 0; border-radius: 7px; font-weight: 800; }
.auth-tabs button.active { color: var(--text); background: rgba(228,184,90,.16); }
.stack-form { display: grid; gap: 13px; }
.stack-form label { display: grid; gap: 6px; color: var(--muted); font-size: .72rem; font-weight: 700; }
.stack-form input, .social-search input { width: 100%; min-height: 46px; padding: 10px 12px; color: var(--text); background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 8px; font-size: 16px; }
.form-note, .form-error { margin: 0; color: var(--muted); font-size: .7rem; }
.form-error { color: #f58d8d; }
.profile-hero { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 16px; margin-bottom: 16px; background: rgba(228,184,90,.1); border-radius: 12px; }
.profile-hero h3 { margin: 0 0 4px; font-size: 1.35rem; overflow-wrap: anywhere; }
.profile-hero p { margin: 0; color: var(--muted); }
.public-profile-hero { align-items: center; gap: 14px; padding: 18px; background: linear-gradient(125deg, rgba(228,184,90,.15), rgba(228,184,90,.045) 62%, rgba(255,255,255,.025)); border: 1px solid rgba(228,184,90,.2); }
.public-profile-identity { display: flex; align-items: center; gap: 13px; min-width: 0; }
.public-profile-avatar { display: grid; flex: 0 0 54px; width: 54px; height: 54px; place-items: center; color: #241b0b; background: linear-gradient(145deg, var(--gold-bright), var(--gold)); border: 3px solid rgba(255,255,255,.12); border-radius: 17px; box-shadow: 0 7px 18px rgba(0,0,0,.2); font-size: 1.35rem; font-weight: 900; }
.public-profile-identity > div { min-width: 0; }
.public-profile-identity .eyebrow { display: block; margin-bottom: 5px; font-size: .58rem; }
.public-profile-hero h3 { font-size: clamp(1.1rem, 3vw, 1.45rem); }
.public-profile-hero p { font-size: .76rem; }
.public-profile-elo { min-width: 126px; justify-items: end; padding: 10px 12px; background: rgba(5,17,13,.24); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; }
.public-profile-elo > small { color: var(--muted); font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; }
.public-profile-elo .elo-variant-control { justify-items: end; }
.public-profile-friend-action { grid-column: 1 / -1; display: flex; align-items: center; min-height: 43px; padding-top: 11px; margin-top: 0; border-top: 1px solid rgba(255,255,255,.09); }
.public-profile-friend-action .profile-friend-state { min-height: 30px; }
.mini-btn.profile-friend-btn { min-height: 36px; padding: 7px 13px; font-size: .75rem; font-weight: 800; }
.profile-friend-state { display: inline-flex; align-items: center; min-height: 32px; padding: 5px 10px; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); border-radius: 99px; font-size: .72rem; font-weight: 700; }
.elo-number { display: grid; justify-items: end; gap: 3px; color: var(--gold-bright); font-size: 1.7rem; font-weight: 900; text-align: right; }
.elo-number .elo-display-value { line-height: 1.1; }
.elo-number small { display: block; color: var(--muted); font-size: .56rem; letter-spacing: .1em; }
.elo-variant-control { display: inline-grid; gap: 4px; color: var(--muted); font-size: .62rem; font-weight: 700; text-align: left; }
.elo-variant-select { min-height: 34px; padding: 5px 8px; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 7px; font: inherit; }
.profile-tabs { grid-template-columns: repeat(3, minmax(0,1fr)); margin: 0 -14px 18px; }
.leaderboard-controls { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; margin-bottom: 14px; }
.leaderboard-tabs { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); min-width: 0; margin: 0; }
.leaderboard-controls .elo-variant-control { margin: 0; }
.leaderboard-list { display: grid; gap: 7px; }
.leaderboard-row { display: grid; grid-template-columns: 40px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 11px 13px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; }
.leaderboard-rank { color: var(--gold-bright); font-weight: 900; font-variant-numeric: tabular-nums; }
.leaderboard-player { display: grid; min-width: 0; gap: 3px; }
.leaderboard-player small { color: var(--muted); font-size: .67rem; }
.leaderboard-rating { color: var(--text); font-weight: 900; font-variant-numeric: tabular-nums; }
.leaderboard-more { width: 100%; margin-top: 13px; }
.public-profile-link { color: inherit; text-decoration: underline; text-decoration-color: rgba(228,184,90,.48); text-underline-offset: 3px; cursor: pointer; }
.public-profile-link:hover, .public-profile-link:focus-visible { color: var(--gold-bright); text-decoration-color: currentColor; }
.player-name.public-profile-link { display: inline-block; pointer-events: auto; }
.leaderboard-visibility-option { display: flex !important; align-items: center; gap: 10px !important; margin: 5px 0 0; padding: 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; color: var(--text) !important; font-size: .83rem !important; }
.leaderboard-visibility-option input { width: 20px; height: 20px; margin: 0; accent-color: var(--gold); }
.leaderboard-visibility-option small { display: block; margin-top: 3px; color: var(--muted); font-size: .68rem; font-weight: 400; }
.profile-dashboard { display: grid; gap: 20px; }
.profile-stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
.profile-stat { display: grid; gap: 4px; min-width: 0; padding: 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; }
.profile-stat small { color: var(--muted); font-size: .56rem; font-weight: 800; letter-spacing: .1em; }
.profile-stat strong { overflow: hidden; color: var(--text); font-size: 1.12rem; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.profile-section { display: grid; gap: 11px; min-width: 0; }
.profile-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.profile-section-heading h3 { margin: 2px 0 0; font-size: 1rem; }
.profile-range, .profile-history-filters label { display: grid; gap: 4px; color: var(--muted); font-size: .62rem; font-weight: 700; }
.profile-range select, .profile-history-filters select { min-height: 35px; padding: 5px 8px; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 7px; font: inherit; }
.profile-chart-scroll { overflow-x: auto; overscroll-behavior-inline: contain; }
.elo-chart { display: block; width: 100%; min-width: 420px; height: auto; overflow: visible; }
.elo-chart line { stroke: var(--line); stroke-width: 1; }
.elo-chart text { fill: var(--muted); font: 11px "DM Sans", sans-serif; }
.elo-chart .elo-chart-line { fill: none; stroke: var(--gold-bright); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.elo-chart circle { fill: var(--gold-bright); stroke: var(--panel); stroke-width: 2; }
.profile-chart-state { min-height: 150px; padding: 8px 0; }
.profile-elo-change { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: .7rem; }
.profile-elo-change strong { color: var(--text); font-size: .78rem; }
.profile-elo-change strong.positive { color: var(--green); }
.profile-elo-change strong.negative { color: var(--red); }
.profile-history-filters { display: flex; gap: 7px; }
.profile-history-more { width: 100%; }
.social-section { display: grid; gap: 10px; }
.social-section h3 { margin: 8px 0 2px; }
.social-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 11px 12px; background: rgba(255,255,255,.045); border-radius: 9px; }
.social-row span { min-width: 0; overflow-wrap: anywhere; }
.social-row small { display: block; color: var(--muted); }
.social-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.mini-btn { min-height: 34px; padding: 6px 9px; color: var(--text); background: rgba(255,255,255,.08); border: 1px solid var(--line); border-radius: 7px; font-size: .68rem; }
.mini-btn.primary { color: #211907; background: var(--gold); }
.mini-btn.danger { color: #ffaaaa; }
.social-search { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.history-card { background: rgba(255,255,255,.045); border-radius: 9px; }
.history-open { width: 100%; color: var(--text); border: 0; background: transparent; font: inherit; text-align: left; cursor: pointer; }
.history-winner { padding: 0 12px 11px; color: var(--muted); font-size: .7rem; }
.history-card:hover { background: rgba(228,184,90,.1); }
.settings-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.settings-grid label { display: grid; gap: 6px; color: var(--muted); font-size: .72rem; }
.settings-grid select { min-height: 44px; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.replay-turn { margin-bottom: 12px; padding: 12px; background: rgba(255,255,255,.04); border-radius: 10px; }
.replay-hand { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: .72rem; }
.replay-cards { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.replay-cards span { padding: 4px 6px; background: rgba(255,255,255,.07); border-radius: 5px; }
.invite-picker { display: grid; gap: 8px; }
.invite-check { display: flex; align-items: center; gap: 9px; padding: 10px; background: rgba(255,255,255,.04); border-radius: 8px; }

[data-theme-mode="light"] .account-button { background: rgba(251,250,245,.96); }
[data-theme-mode="light"] .account-primary { background: var(--gold); }
[data-theme-mode="light"] .stack-form input { background: white; }

@media (max-width: 900px) {
    .container { padding-inline: 16px; }
    .lobby-shell { padding: 12px; }
    .lobby-content { grid-template-columns: 1fr; gap: 30px; padding: 46px 28px; }
    .lobby-intro { align-self: auto; text-align: center; }
    .suit-row { justify-content: center; }
    .lobby-panel { align-self: auto; width: min(500px, 100%); margin-inline: auto; }
    .lobby-discover-actions { justify-content: center; margin-top: 28px; }
    .rules-open-btn { text-align: center; }
    .table-rim { height: 680px; border-radius: 34% / 12%; }
    .table-felt { border-radius: 33% / 11%; }
    .player-badge { width: 154px; height: 146px; padding: 9px; }
    .seat-body { grid-template-columns: 62px 1fr; }
}

@media (max-width: 680px) {
    /* Mobile is a different table layout, not a scaled-down desktop table. */
    body { min-height: 100dvh; }
    .account-bar { position: relative; top: auto; right: auto; z-index: 1050; justify-content: flex-end; width: 100%; padding: max(7px, env(safe-area-inset-top)) 8px 0; overflow-x: auto; }
    .account-button { min-height: 36px; padding: 7px 10px; }
    .social-modal { padding: 6px; align-items: end; }
    .social-card { max-height: calc(100dvh - 10px); border-radius: 16px 16px 8px 8px; }
    .rules-modal-grid { grid-template-columns: 1fr; gap: 18px; }
    .announcement-overlay { align-items: end; padding: 8px; }
    .announcement-card { max-height: calc(100dvh - 16px); border-radius: 18px; }
    .announcement-content { padding: 24px 20px 20px; }
    .announcement-feature { grid-template-columns: 26px minmax(0, 1fr); gap: 10px; padding: 18px 0; }
    .announcement-footer { justify-content: flex-end; }
    .social-content { max-height: calc(100dvh - 83px); padding: 14px; }
    .public-profile-hero { gap: 10px; padding: 14px; }
    .public-profile-identity { gap: 9px; }
    .public-profile-avatar { flex-basis: 46px; width: 46px; height: 46px; border-radius: 14px; font-size: 1.15rem; }
    .public-profile-elo { min-width: 112px; padding: 8px 9px; font-size: 1.45rem; }
    .social-card.profile-card { height: calc(100dvh - 10px); max-height: none; }
    .profile-card > .social-content.profile-content { max-height: none; }
    .settings-grid { grid-template-columns: 1fr; }
    .profile-stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .leaderboard-row { grid-template-columns: 28px minmax(0,1fr) auto; gap: 7px; padding: 10px; }
    .profile-section-heading { align-items: flex-start; flex-wrap: wrap; }
    .profile-history-filters { width: 100%; }
    .profile-history-filters label { flex: 1; }
    .social-row { grid-template-columns: 1fr; }
    .social-actions { justify-content: flex-start; }
    .container { padding: max(6px, env(safe-area-inset-top)) 8px calc(62px + env(safe-area-inset-bottom)); }
    .lobby-shell { padding: 8px; }
    .game-selector { padding: 0 14px; }
    .game-selector-tabs { width: 100%; }
    .game-selector-tab { min-height: 46px; padding: 7px 5px; }
    .game-selector-tab strong { font-size: .78rem; }
    .game-portal { min-height: calc(100dvh - 62px); border-radius: 16px; }
    .game-portal .account-bar { position: absolute; top: 10px; right: 10px; width: auto; padding: 0; }
    .lobby-content { gap: 26px; padding: 70px 14px 32px; }
    .lobby-intro h1 { margin: 12px 0 14px; font-size: clamp(2.65rem, 13vw, 3.25rem); line-height: .95; }
    .lobby-game-intro[data-game-intro="briscola_venceslao"] h1 { font-size: clamp(2.45rem, 11vw, 3.25rem); }
    .suit-row { gap: 8px; margin-top: 22px; }
    .suit-row span { width: 39px; height: 49px; font-size: 1.1rem; }
    .lobby-panel { min-height: 0; padding: 10px 16px 18px; border-radius: 16px; }
    .public-tables { margin-top: 24px; padding-top: 20px; }
    .public-table-card { align-items: stretch; flex-direction: column; }
    .public-table-card .btn { align-self: flex-start; }
    .visibility-choice, .variant-choice { grid-template-columns: 1fr; }
    .lobby-tabs { margin: 0 -4px 20px; }
    .lobby-tab { min-height: 44px; padding: 9px; }
    .lobby-form { min-height: 0; gap: 9px; }
    .lobby-form label { margin-top: 2px; }
    input[type="text"], input[type="number"] { min-height: 50px; font-size: 16px; }
    .rules-grid { grid-template-columns: 1fr; gap: 18px; }
    .messages { top: max(10px, env(safe-area-inset-top)); right: 10px; left: 10px; width: auto; }
    .message { font-size: .86rem; }

    .game-toolbar { gap: 5px; height: 44px; padding-inline: 1px; }
    .game-toolbar .btn { min-height: 40px; padding-inline: 10px; font-size: .72rem; }
    .code-chip { min-height: 40px; padding-inline: 9px; font-size: .66rem; }
    .invite-link { width: auto; margin-left: auto; }
    .invite-link input { display: none; }
    .game-status-bar { grid-template-columns: 1fr; height: 60px; gap: 8px; padding: 8px 10px; border-radius: 12px; }
    .status-metrics { grid-row: auto; grid-column: auto; width: 100%; border: 0; }
    .status-metrics > span { min-width: 50px; }
    .table-stage { margin-top: 10px; }
    .table-rim { height: min(570px, calc(100dvh - 175px)); min-height: 500px; padding: 6px; border-radius: 18% / 7%; }
    .table-felt { border-radius: 17% / 6%; }
    .player-badge { width: 104px; height: 92px; padding: 6px; border-radius: 10px; }
    .seat-header { gap: 5px; }
    .turn-marker, .next-marker { position: absolute; top: -7px; right: -5px; margin-left: 0; }
    .player-avatar { flex-basis: 23px; width: 23px; height: 23px; }
    .player-name { font-size: .7rem; }
    .seat-subtitle { height: 14px; padding-left: 28px; font-size: .5rem; }
    .seat-body { grid-template-columns: 42px 1fr; height: 48px; gap: 3px; padding-top: 4px; }
    .seat-stats strong { font-size: .8rem; }
    .seat-stats small { font-size: .45rem; }
    .table-card-slot { height: 43px; }
    .table-playing-card { width: 43px; height: 41px; gap: 2px; }
    .table-card-rank { font-size: 1.12rem; }
    .table-card-suit { font-size: 1.2rem; }
    .table-caption { justify-content: space-between; gap: 6px; height: 38px; padding-inline: 4px; font-size: .61rem; }
    .history-bubble { min-height: 32px; padding-inline: 9px; font-size: .64rem; }
    .host-controls { flex-wrap: wrap; gap: 10px; padding: 14px; }
    .host-controls > div { width: 100%; }
    .setup-control { flex: 1; justify-content: space-between; }
    .setup-control input { width: 72px; min-height: 44px; }
    .host-controls .btn { width: 100%; min-height: 48px; }
    .game-actions { top: -58px; width: 100%; min-height: 52px; padding-inline: 4px; }
    .betting-form { flex-wrap: wrap; gap: 6px; width: min(100%, 350px); min-height: 52px; padding: 6px 8px; }
    .your-turn-label, .bet-label { width: 100%; text-align: center; }
    .premove-controls { width: min(100%, 350px); justify-content: space-between; min-height: 50px; }
    .hand-dock { bottom: 0; width: calc(100% - 8px); height: 144px; }
    .hand-heading { right: 7px; left: 7px; }
    .card { flex-basis: 76px; width: 76px; height: 112px; opacity: 1; visibility: visible; touch-action: manipulation; -webkit-tap-highlight-color: transparent; transform: translateZ(0); }
    .card + .card { margin-left: -16px; }
    .card .rank strong { font-size: 1.5rem; }
    .card .suit-icon.large { font-size: 2.45rem; }
    .cards-row { top: 16px; height: 128px; justify-content: flex-start; padding: 6px 12px 3px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
    .cards-row.is-short-hand { justify-content: center; overflow-x: hidden; }
    .cards-row .round-continue-action { margin-inline: auto; }
    .cards-row .card { scroll-snap-align: center; }
    .card.clickable { box-shadow: 0 0 0 3px rgba(228,184,90,.86), 0 8px 16px rgba(0,0,0,.38); }
    .card.clickable:active { transform: translateY(-7px) scale(.98); }
    /* The card remains recognizable while a player selects an ace strength. */
    .has-strength-choice .strength-choice:not(.is-open) { opacity: 0; pointer-events: none; }
    .has-strength-choice .strength-choice.is-open { top: auto; bottom: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; height: 52px; opacity: 1; pointer-events: auto; background: rgba(7,18,14,.96); }
    .has-strength-choice .strength-choice .strength-low,
    .has-strength-choice .strength-choice .strength-high { grid-row: auto; min-height: 52px; }
    .has-strength-choice .strength-choice .strength-low { border-top: 0; border-right: 1px solid rgba(255,255,255,.5); }
    .has-strength-choice .strength-choice b { font-size: 1.05rem; }
    .has-strength-choice .strength-choice span { font-size: .48rem; }
    .host-controls.mobile-chat-ready { min-height: auto; padding: 8px; }
    .host-controls.mobile-chat-ready > div,
    .host-controls.mobile-chat-ready > .setup-control,
    .host-controls.mobile-chat-ready > #start-game-btn { display: none !important; }
    .mobile-chat-form { grid-template-columns: 1fr 46px; gap: 7px; width: 100%; }
    .host-controls.mobile-chat-ready .mobile-chat-form { display: grid; }
    .mobile-chat-form input { min-height: 46px; }
    .mobile-chat-form button { min-height: 46px; color: #20190c; background: var(--gold); border: 0; border-radius: 9px; font-size: 1.15rem; font-weight: 900; }
    .chat-widget { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); }
    .chat-toggle { width: 58px; height: 58px; }
    .chat-panel { position: fixed; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); left: 8px; width: auto; height: min(560px, calc(100dvh - 16px - env(safe-area-inset-bottom))); border-radius: 18px; }
    .turn-history-panel { right: 8px; bottom: calc(78px + env(safe-area-inset-bottom)); left: 8px; width: auto; }
    .turn-summary-modal { align-items: end; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); }
    .turn-summary-card { width: 100%; padding: 24px 20px 20px; border-radius: 18px; }
    .standing-row { grid-template-columns: 24px minmax(0, 1fr) auto auto; gap: 5px; padding: 9px 8px; font-size: .8rem; }
    .standing-elo { min-width: 0; font-size: .7rem; }
}

@media (max-width: 390px) {
    .game-toolbar .btn-quiet { width: 40px; padding-inline: 0; font-size: 0; }
    .game-toolbar .btn-quiet::after { content: "↩"; font-size: 1.05rem; }
    .table-caption { justify-content: flex-end; }
    .status-metrics > span { min-width: 46px; }
}

@media (max-width: 680px) {
    .players-list.few-players .player-badge { width: 138px; height: 108px; padding: 7px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}


/* ===== Fluid table layout ===== */
/* Player identity belongs at the rail; played cards belong on the felt. */
.player-badge,
.players-list.few-players .player-badge {
    width: min(190px, 26vw);
    height: auto;
    min-height: 58px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    text-align: center;
}
.player-badge.is-you,
.player-badge.is-active,
.player-badge.is-next {
    background: transparent;
    border: 0;
    box-shadow: none;
}
.seat-header {
    position: relative;
    justify-content: center;
    min-height: 30px;
    gap: 7px;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,.65));
}
.player-avatar {
    flex-basis: 27px;
    width: 27px;
    height: 27px;
    color: #eaf3ee;
    background: rgba(4,24,18,.74);
    border: 1px solid rgba(255,255,255,.24);
    box-shadow: 0 3px 10px rgba(0,0,0,.28);
}
.is-active .player-avatar {
    color: #271d0a;
    background: var(--gold-bright);
    border-color: #ffe7ae;
    box-shadow: 0 0 0 5px rgba(255,215,123,.16), 0 0 22px rgba(255,215,123,.35);
    animation: active-seat-pulse 1.8s ease-in-out infinite;
}
.is-next .player-avatar { background: #54c992; border-color: #9ce2be; }
.player-name { max-width: 120px; color: #fff; font-size: .87rem; text-shadow: 0 2px 4px rgba(0,0,0,.9); }
.seat-meta { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 4px; }
.seat-meta > span {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    min-height: 21px;
    padding: 3px 7px;
    color: #e5eee9;
    background: rgba(3,24,17,.58);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 99px;
    box-shadow: 0 3px 10px rgba(0,0,0,.18);
    backdrop-filter: blur(4px);
    font-size: .65rem;
}
.seat-meta small { color: #9fb5aa; font-size: .46rem; font-weight: 800; letter-spacing: .09em; }
.seat-meta strong { color: #fff; font-size: .72rem; font-variant-numeric: tabular-nums; }
.seat-meta .lives-count { align-items: center; justify-content: center; padding-block: 3px; color: #f3b6b6; line-height: 1; }
.seat-subtitle { height: 16px; padding: 2px 0 0; color: #d2dfd9; text-align: center; text-shadow: 0 1px 3px #00170f; }
.seat-subtitle.is-disconnected { color: #ffd58f; font-size: .58rem; }
.seat-header { position: relative; padding-right: 20px; }
.seat-kick-button { position: absolute; top: 1px; right: 0; z-index: 4; display: grid; width: 19px; min-width: 19px; min-height: 19px !important; height: 19px; place-items: center; padding: 0; color: #ffe4e4; background: rgba(133,35,35,.82); border: 1px solid rgba(255,180,180,.45); border-radius: 50%; font-size: .9rem; font-weight: 800; line-height: 1; cursor: pointer; }
.seat-kick-button:hover:not(:disabled), .seat-kick-button:focus-visible { color: #fff; background: #a93232; outline: 2px solid rgba(255,180,180,.75); outline-offset: 1px; }
.seat-kick-button:disabled { opacity: .55; cursor: wait; }
.turn-marker, .next-marker { position: absolute; top: -18px; left: 50%; margin: 0; transform: translateX(-50%); }

.table-cards { position: absolute; z-index: 5; inset: 0; pointer-events: none; }
.table-card-position {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transform: translate(-50%, -50%);
    transition: left .28s ease, top .28s ease;
    pointer-events: auto;
    cursor: pointer;
}
.table-card-position.winning-card { z-index: 20 !important; }
.table-card-position.is-front { z-index: 100 !important; }
.table-card-position:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 4px; border-radius: 8px; }
.table-card-position.just-played { animation: card-arrive .32s cubic-bezier(.2,.8,.25,1.12); }
.played-by {
    max-width: 100px;
    overflow: hidden;
    color: rgba(230,242,236,.72);
    text-overflow: ellipsis;
    text-shadow: 0 1px 3px rgba(0,0,0,.8);
    white-space: nowrap;
    font-size: .55rem;
    font-weight: 700;
}
.table-playing-card {
    width: 70px;
    height: 100px;
    border-radius: 7px;
    box-shadow: 0 8px 17px rgba(0,0,0,.4);
}
.table-playing-card.image-card {
    width: 78px;
    height: 125px;
    overflow: visible;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
.table-playing-card.image-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 8px 8px rgba(0,0,0,.38));
}
.table-rim.is-crowded .table-playing-card { width: calc(62px * var(--card-size-scale)); height: calc(92px * var(--card-size-scale)); }
.table-rim.is-crowded .table-playing-card.image-card { width: calc(68px * var(--card-size-scale)); height: calc(108px * var(--card-size-scale)); }
.winning-card-cornice {
    position: absolute;
    z-index: 3;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: fill !important;
    filter: drop-shadow(0 0 5px rgba(255,215,123,.72)) !important;
    pointer-events: none;
}
.table-playing-card:not(.image-card) .winning-card-cornice {
    border: 0;
    border-radius: 0;
}
/* Printed artwork supplies its own silhouette. Only emoji cards need a card UI. */
.card.image-card {
    overflow: visible;
    background: transparent !important;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
.card.image-card .card-art {
    border-radius: 0;
    filter: drop-shadow(0 7px 7px rgba(0,0,0,.38));
}
.card.image-card.clickable { box-shadow: none; }
.card.image-card.clickable .card-art {
    filter: drop-shadow(0 7px 7px rgba(0,0,0,.38)) drop-shadow(0 0 5px rgba(255,215,123,.55));
}
.card.image-card.clickable:hover { box-shadow: none; }
.card.playing { z-index: 20; transform: translateY(-58px) scale(.88) rotate(2deg); opacity: 0; }
.cards-row.is-submitting .card:not(.playing) { opacity: .42; pointer-events: none; }

@keyframes card-arrive {
    from { opacity: 0; transform: translate(-50%, -25%) scale(.72) rotate(-4deg); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); }
}
@keyframes active-seat-pulse {
    50% { box-shadow: 0 0 0 7px rgba(255,215,123,.09), 0 0 25px rgba(255,215,123,.42); }
}

@media (max-width: 900px) {
    .player-badge,
    .players-list.few-players .player-badge { width: min(164px, 29vw); height: auto; min-height: 56px; padding: 0; }
}

@media (max-width: 680px) {
    .player-badge,
    .players-list.few-players .player-badge { width: min(118px, 32vw); height: auto; min-height: 48px; padding: 0; }
    .seat-header { min-height: 25px; gap: 4px; }
    .player-avatar { flex-basis: 22px; width: 22px; height: 22px; font-size: .62rem; }
    .player-name { max-width: 72px; font-size: .67rem; }
    .seat-meta { gap: 2px; margin-top: 2px; }
    .seat-meta > span { min-height: 18px; padding: 2px 4px; font-size: .52rem; }
    .seat-meta small { display: none; }
    .seat-meta strong { font-size: .6rem; }
    .seat-subtitle { height: 12px; padding-top: 1px; font-size: .45rem; }
    .turn-marker, .next-marker { top: -14px; right: auto; left: 50%; font-size: .44rem; }
    .table-playing-card { width: 52px; height: 74px; }
    .table-playing-card.image-card { width: 56px; height: 88px; }
    .played-by { display: none; }
}


/* ===== Minimal play surface ===== */
.game-status-bar { display: none; }
.table-metrics {
    position: absolute;
    z-index: 4;
    top: 18px;
    left: 28px;
    display: flex;
    gap: 4px;
    pointer-events: none;
}
.table-metrics > span {
    display: flex;
    align-items: baseline;
    gap: 4px;
    min-height: 25px;
    padding: 4px 7px;
    color: rgba(240,246,242,.84);
    background: rgba(3,25,18,.4);
    border-radius: 6px;
    backdrop-filter: blur(4px);
}
.table-metrics small { color: rgba(213,229,220,.58); font-size: .48rem; font-weight: 800; }
.table-metrics strong { font-size: .68rem; font-variant-numeric: tabular-nums; }
.table-prompt {
    position: absolute;
    z-index: 6;
    top: 43%;
    left: 50%;
    padding: 7px 11px;
    color: rgba(237,245,240,.72);
    background: rgba(3,28,19,.5);
    border-radius: 99px;
    transform: translate(-50%, -50%);
    backdrop-filter: blur(4px);
    font-size: .68rem;
    pointer-events: none;
}
.player-avatar,
.turn-marker,
.next-marker { display: none !important; }
.seat-header { min-height: 20px; }
.player-name { max-width: 150px; }
.is-active .player-name { color: var(--gold-bright); text-shadow: 0 0 12px rgba(255,215,123,.48), 0 2px 4px rgba(0,0,0,.9); }
.is-next .player-name { color: #8fdbb5; }
.player-badge.awaiting-bet { opacity: .48; filter: grayscale(.72) saturate(.42); }
.player-badge.awaiting-bet.is-active { opacity: .72; filter: grayscale(.35) saturate(.7); }
.game-actions {
    top: 43%;
    width: auto;
    max-width: calc(100% - 32px);
    min-height: 0;
}
.bet-options {
    gap: 5px;
    padding: 5px;
    background: rgba(4,29,20,.68);
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,.22);
    max-width: 100%;
    overflow-x: auto;
    backdrop-filter: blur(5px);
    scrollbar-width: none;
}
.bet-options::-webkit-scrollbar { display: none; }
.bet-choice { min-width: 35px; min-height: 34px; padding: 5px 9px; }
.hand-dock { height: 138px; }
.cards-row {
    inset: 0;
    height: 138px;
    padding: 12px 34px 12px;
    background: transparent;
    border-radius: 0;
}
.host-controls.hidden { display: none !important; }

/* Before dealing, the composer is still part of the table flow. Give the
   setup panel a real block below it instead of letting the viewport-fitted
   table grid pull the two panels on top of each other. */
#game-section.is-pre-game .table-stage {
    height: auto;
    min-height: 0;
    margin-bottom: 18px;
}
#game-section.is-pre-game .host-controls {
    position: relative;
    z-index: 2;
    margin-top: 0;
}

@media (max-width: 680px) {
    #game-section.is-pre-game .table-stage {
        display: block;
        height: auto;
        margin-bottom: 18px;
    }
    #game-section.is-pre-game .table-rim {
        height: clamp(300px, calc(100dvh - 360px), 430px);
        min-height: 300px;
    }
    .table-stage { margin-top: 2px; }
    .table-rim { height: min(570px, calc(100dvh - 108px)); }
    .table-metrics { top: 10px; left: 13px; gap: 2px; }
    .table-metrics > span { min-height: 21px; padding: 3px 5px; }
    .table-metrics small { font-size: .42rem; }
    .table-metrics strong { font-size: .59rem; }
    .table-prompt { top: 42%; padding: 6px 9px; font-size: .61rem; }
    .game-actions { top: 42%; width: auto; min-height: 0; padding: 0; }
    .bet-options { flex-wrap: nowrap; gap: 3px; padding: 4px; }
    .bet-choice { min-width: 32px; min-height: 34px; padding: 4px 7px; }
    .seat-header { min-height: 18px; }
    .player-name { max-width: 100px; font-size: .68rem; }
    .seat-subtitle { padding-left: 0; }
    .hand-dock { height: 138px; }
    .cards-row { top: 0; height: 138px; padding: 14px 30px 12px; }
}


/* ===== Foreground metrics and consolidated table menu ===== */
.game-toolbar { position: relative; z-index: 200; }
.game-menu-toggle {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    margin-left: auto;
    padding: 0;
    color: var(--text);
    background: rgba(255,255,255,.045);
    border: 1px solid var(--line);
    border-radius: 9px;
}
.fullscreen-toggle {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    margin-left: auto;
    padding: 0;
    color: var(--text);
    background: rgba(255,255,255,.045);
    border: 1px solid var(--line);
    border-radius: 9px;
}
.fullscreen-toggle:hover { color: var(--gold-bright); border-color: rgba(228,184,90,.55); }
.fullscreen-toggle svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fullscreen-toggle .fullscreen-exit-icon { display: none; }
.fullscreen-toggle.is-fullscreen .fullscreen-enter-icon { display: none; }
.fullscreen-toggle.is-fullscreen .fullscreen-exit-icon { display: block; }
.game-menu-toggle:hover { color: var(--gold-bright); border-color: rgba(228,184,90,.55); }
.game-menu-toggle svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.game-menu {
    position: absolute;
    z-index: 300;
    top: 43px;
    right: 0;
    width: min(310px, calc(100vw - 20px));
    padding: 10px;
    color: var(--text);
    background: rgba(13,27,23,.98);
    border: 1px solid rgba(228,184,90,.28);
    border-radius: 14px;
    box-shadow: 0 22px 60px rgba(0,0,0,.52);
    backdrop-filter: blur(16px);
}
.game-menu-heading { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 9px; border-bottom: 1px solid var(--line); }
.game-menu-heading strong { font-size: .82rem; }
.game-menu-heading button { width: 28px; height: 28px; padding: 0; color: var(--muted); background: transparent; border: 0; font-size: 1.35rem; }
.menu-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    min-height: 42px;
    padding: 8px 10px;
    color: var(--text);
    background: transparent;
    border: 0;
    border-radius: 8px;
    font-size: .76rem;
    text-align: left;
}
.menu-control:hover { background: rgba(255,255,255,.055); }
.menu-control > span:first-child { color: #c8d4ce; }
.menu-control strong { color: var(--gold-bright); font-size: .7rem; }
.menu-control select {
    max-width: 165px;
    padding: 6px 8px;
    color: var(--text);
    background: #0a1713;
    border: 1px solid var(--line);
    border-radius: 7px;
    outline: none;
    font-size: .7rem;
}
.menu-control select:focus { border-color: var(--gold); }
.menu-button { cursor: pointer; }
.menu-button.is-off strong { color: var(--muted); }
.menu-danger { margin-top: 5px; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; }
.menu-danger > span:first-child, .menu-danger strong { color: #e49b9b; }
.menu-invite-url { position: absolute; width: 1px !important; height: 1px; min-height: 0 !important; overflow: hidden; opacity: 0; pointer-events: none; }

.table-rim { position: relative; }
.table-metrics {
    z-index: 30;
    top: 17px;
    left: 7%;
    padding: 4px;
    background: rgba(7,18,15,.92);
    border: 1px solid rgba(255,215,123,.38);
    border-radius: 9px;
    box-shadow: 0 7px 20px rgba(0,0,0,.48), inset 0 1px rgba(255,255,255,.07);
    backdrop-filter: blur(8px);
}
.table-metrics > span { background: rgba(255,255,255,.04); }

[data-theme-mode="light"] .game-menu { color: var(--text); background: rgba(251,250,245,.98); box-shadow: 0 22px 60px rgba(39,48,43,.24); }
[data-theme-mode="light"] .menu-control > span:first-child { color: #45584f; }
[data-theme-mode="light"] .menu-control select { color: var(--text); background: #fff; }
[data-theme-mode="light"] .game-menu-toggle { background: rgba(23,36,31,.05); }

@media (max-width: 680px) {
    .game-toolbar { height: 42px; }
    .game-menu-toggle { width: 40px; height: 40px; }
    .game-menu { position: fixed; top: max(54px, calc(env(safe-area-inset-top) + 48px)); right: 8px; left: 8px; width: auto; }
    .table-metrics { top: 10px; left: 6%; padding: 3px; }
    .seat-meta small { display: inline; margin-right: 1px; font-size: .39rem; letter-spacing: .04em; }
    .seat-meta > span { gap: 2px; padding-inline: 4px; }
}


/* ===== Floating invite control and unboxed player data ===== */
.game-toolbar { height: 0; margin: 0; }
.copy-link-float,
.fullscreen-toggle,
.game-menu-toggle {
    position: absolute;
    z-index: 2;
    top: 12px;
}
.copy-link-float {
    left: 18px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 0 11px;
    color: #edf5f1;
    background: rgba(8,24,19,.9);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 9px;
    box-shadow: 0 7px 20px rgba(0,0,0,.34);
    font-size: .68rem;
    font-weight: 700;
    backdrop-filter: blur(8px);
}
.copy-link-float:hover,
.copy-link-float.is-copied { color: var(--gold-bright); border-color: rgba(255,215,123,.62); }
.copy-link-float svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.game-menu-toggle { right: 18px; margin: 0; color: #edf5f1; background: rgba(8,24,19,.9); box-shadow: 0 7px 20px rgba(0,0,0,.34); }
.game-menu { top: 55px; right: 18px; }

.seat-meta { gap: 11px; margin-top: 5px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.9)); }
.seat-meta > span {
    min-height: 0;
    padding: 0;
    color: #f4faf7;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    font-size: .72rem;
}
.seat-meta small { color: #c4d7ce; font-size: .52rem; }
.seat-meta strong { color: #fff; font-size: .82rem; }
.seat-meta .lives-count { padding: 0; font-size: .72rem; }

.table-metrics small { font-size: .55rem; letter-spacing: .04em; text-transform: uppercase; }
.table-metrics > span { gap: 5px; padding-inline: 8px; }

[data-theme-mode="light"] .copy-link-float,
[data-theme-mode="light"] .game-menu-toggle { color: #20312a; background: rgba(251,250,245,.94); box-shadow: 0 7px 20px rgba(39,48,43,.18); }

@media (max-width: 680px) {
    .game-toolbar { height: 0; }
    .copy-link-float, .game-menu-toggle { top: 8px; }
    .copy-link-float { left: 10px; min-height: 40px; padding-inline: 10px; }
    .game-menu-toggle { right: 10px; }
    .seat-meta { gap: 5px; margin-top: 3px; }
    .seat-meta > span { min-height: 0; padding: 0; font-size: .52rem; }
    .seat-meta small { display: inline; margin-right: 1px; color: #d0e0d8; font-size: .39rem; }
    .seat-meta strong { font-size: .60rem; }
    .seat-meta .lives-count { font-size: .56rem; }
    .player-name { font-size: .78rem; }
    .table-metrics small { font-size: .47rem; }
    .table-metrics strong { font-size: .64rem; }
}


/* Keep the compact metrics below the floating invite control, clear of both buttons. */
.table-metrics { top: 58px; left: 18px; }
@media (max-width: 680px) {
    .table-metrics { top: 56px; left: 10px; }
}


/* ===== Compact post-table flow ===== */
.table-caption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 46px;
    height: auto;
    padding: 5px 10px;
}
.table-caption .table-metrics {
    position: static;
    z-index: auto;
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    transform: none;
    backdrop-filter: none;
}
.table-caption .table-metrics > span {
    gap: 4px;
    min-height: 0;
    padding: 0;
    color: var(--text);
    background: transparent;
}
.table-caption .table-metrics small { color: var(--muted); }
.table-caption .round-actions { min-height: 0; }

@media (max-width: 680px) {
    .container { padding: max(6px, env(safe-area-inset-top)) 8px max(12px, env(safe-area-inset-bottom)); }
    .table-stage { margin: 0; }
    .hand-dock {
        left: 50%;
        width: 100vw;
    }
    .table-rim {
        height: clamp(430px, calc(100dvh - 145px), 560px);
        min-height: 0;
    }
    .table-caption { min-height: 42px; height: auto; padding: 4px 6px; }
    .table-caption .table-metrics { gap: 9px; }
    .table-caption .table-metrics > span { gap: 3px; }
    .table-caption .table-metrics small { font-size: .43rem; }
    .table-caption .table-metrics strong { font-size: .66rem; }
    .table-caption .round-actions .btn { min-height: 34px; padding: 5px 10px; font-size: .68rem; }
    .table-stage > .mobile-chat-form:not(.hidden) {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 44px;
        gap: 7px;
        width: 100%;
        padding: 4px 72px 4px 4px;
    }
    .table-stage > .mobile-chat-form input { min-height: 44px; }
    .table-stage > .mobile-chat-form button {
        min-height: 44px;
        color: #20190c;
        background: var(--gold);
        border: 0;
        border-radius: 9px;
        font-size: 1.08rem;
        font-weight: 900;
    }
    .chat-widget {
        position: fixed !important;
        z-index: 55;
        right: 12px;
        bottom: calc(10px + env(safe-area-inset-bottom));
    }
    .chat-toggle { width: 54px; height: 54px; }
}


/* ===== In-flow controls and viewport-fitted mobile table ===== */
.game-toolbar {
    position: relative;
    z-index: 200;
    display: flex;
    align-items: center;
    height: 46px;
    margin: 0 0 6px;
    padding: 5px 4px;
}
.copy-link-float,
.game-menu-toggle {
    position: static;
    top: auto;
    right: auto;
    left: auto;
}
.copy-link-float { min-height: 36px; box-shadow: none; }
.fullscreen-toggle { margin-left: auto; box-shadow: none; }
.fullscreen-toggle { position: relative; top: auto; right: auto; left: auto; z-index: 3; flex: 0 0 36px; }
.game-menu-toggle { margin-left: 0; box-shadow: none; }
.game-menu { top: 48px; right: 4px; }

.table-caption {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    justify-content: normal;
}
.table-caption .table-metrics {
    grid-column: 2;
    justify-self: center;
}
.table-caption .round-actions {
    grid-column: 3;
    justify-self: end;
    margin-left: 0;
}

/* In fullscreen, keep the menu controls anchored to the viewport. */
html:fullscreen #game-menu-toggle,
html:-webkit-full-screen #game-menu-toggle {
    position: fixed !important;
    z-index: 2200 !important;
    top: max(12px, env(safe-area-inset-top)) !important;
    right: max(18px, env(safe-area-inset-right)) !important;
    bottom: auto !important;
    left: auto !important;
    margin: 0 !important;
}
html:fullscreen #game-menu,
html:-webkit-full-screen #game-menu {
    position: fixed !important;
    z-index: 2200 !important;
    top: 55px !important;
    right: max(18px, env(safe-area-inset-right)) !important;
    left: auto !important;
}

@media (max-width: 680px) {
    .game-toolbar {
        height: 44px;
        margin-bottom: 6px;
        padding: 2px 3px;
    }
    .copy-link-float,
    .fullscreen-toggle,
    .game-menu-toggle {
        position: static;
        top: auto;
        right: auto;
        left: auto;
    }
    .copy-link-float { min-height: 40px; }
    .fullscreen-toggle { width: 40px; height: 40px; margin-left: auto; }
    .fullscreen-toggle { flex-basis: 40px; }
    .fullscreen-toggle { margin-right: 50px; }
    .game-menu-toggle { margin-left: 0; }
    .game-menu { top: max(52px, calc(env(safe-area-inset-top) + 46px)); }

    .table-stage {
        display: grid;
        grid-template-rows: minmax(0, 1fr) auto auto;
        height: calc(100dvh - 68px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        min-height: 0;
        margin: 0;
    }
    .table-rim {
        width: 100%;
        height: auto;
        min-height: 0;
    }
    .table-caption {
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        min-height: 40px;
        padding: 3px 4px;
    }
    .table-caption .table-metrics { justify-self: center; }
    .table-caption .round-actions { justify-self: end; }
    .table-stage > .mobile-chat-form:not(.hidden) {
        width: 100%;
        padding: 4px 0;
    }
    .chat-widget {
        right: 12px;
        bottom: calc(66px + env(safe-area-inset-bottom));
    }
}

/* Desktops use the available height; their width provides the extra room for
   crowded tables without forcing controls below the viewport. */
@media (min-width: 681px) {
    body:has(#game-section:not(.hidden)) .container { padding-bottom: 12px; }
    .table-stage { margin-bottom: -12px; }
    .table-rim,
    .table-rim.is-crowded,
    .table-rim.is-very-crowded {
        height: min(960px, max(420px, calc(100dvh - 174px)));
    }
}

@media (max-width: 680px) {
    .game-shell { position: relative; }
    .game-toolbar {
        position: absolute;
        z-index: 200;
        top: 8px;
        right: 14px;
        left: 14px;
        height: 40px;
        margin: 0;
        padding: 0;
        pointer-events: none;
    }
    .game-toolbar > button { pointer-events: auto; }
    .copy-link-float { min-height: 40px; }
    .fullscreen-toggle,
    .game-menu-toggle { background: rgba(8,24,19,.9); }
    .game-menu { top: calc(48px + env(safe-area-inset-top)); pointer-events: auto; }
    .table-stage {
        height: calc(100dvh - max(12px, env(safe-area-inset-top)) - max(12px, env(safe-area-inset-bottom)) - 12px);
    }
    .table-rim.is-crowded,
    .table-rim.is-very-crowded {
        height: max(calc(100dvh - 62px), var(--crowded-mobile-height));
    }
    .table-stage:has(.table-rim.is-crowded) {
        display: grid;
        grid-template-rows: auto auto auto;
        height: auto;
    }
    .table-rim.is-very-crowded .player-badge,
    .table-rim.is-very-crowded .players-list.few-players .player-badge {
        width: min(108px, 29vw);
    }
    .table-rim.is-very-crowded .player-name { max-width: 88px; font-size: .7rem; }
    .table-rim.is-very-crowded .seat-meta { gap: 1px 4px; }
    .table-rim.is-very-crowded .seat-header { flex-wrap: nowrap; }
    .table-rim.is-very-crowded .seat-header .player-name { max-width: 64px; }
    .table-rim.is-very-crowded .seat-turn-badge { min-height: 15px; padding: 1px 3px; font-size: .34rem; }
    .table-rim.is-very-crowded .table-playing-card { width: calc(44px * var(--card-size-scale)); height: calc(64px * var(--card-size-scale)); }
    .table-rim.is-very-crowded .table-playing-card.image-card { width: calc(48px * var(--card-size-scale)); height: calc(72px * var(--card-size-scale)); }
    .table-rim.is-very-crowded .table-playing-card:not(.image-card) {
        flex-direction: column;
        gap: 1px;
    }
    .table-rim.is-very-crowded .table-playing-card:not(.image-card) .table-card-rank { font-size: calc(1rem * var(--card-size-scale)); }
    .table-rim.is-very-crowded .table-playing-card:not(.image-card) .table-card-suit { font-size: calc(1.22rem * var(--card-size-scale)); }
    .table-rim.is-very-crowded .hand-dock .card {
        flex-basis: calc(64px * var(--card-size-scale));
        width: calc(64px * var(--card-size-scale));
        height: calc(94px * var(--card-size-scale));
    }
    .table-rim.is-very-crowded .hand-dock .card .rank strong { font-size: calc(1.28rem * var(--card-size-scale)); }
    .table-rim.is-very-crowded .hand-dock .card .rank small { font-size: calc(.5rem * var(--card-size-scale)); }
    .table-rim.is-very-crowded .hand-dock .card .suit-icon.large { font-size: calc(2.1rem * var(--card-size-scale)); }
}

/* Taller phones do not need to stretch crowded tables to fill the viewport.
   Short phones keep the taller version so the diagonal seat badges remain
   separate. */
@media (max-width: 680px) and (min-height: 760px) {
    .table-rim.is-crowded,
    .table-rim.is-very-crowded {
        height: max(calc(100dvh - 160px), 720px);
    }
}

[data-theme-mode="light"] .fullscreen-toggle { color: #20312a; background: rgba(251,250,245,.94); }


/* ===== Explicit active-turn labels ===== */
.seat-turn-badge {
    display: inline-flex;
    align-items: center;
    min-height: 19px;
    padding: 2px 6px;
    border-radius: 99px;
    font-size: .47rem;
    font-weight: 900;
    letter-spacing: .06em;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
}
.seat-turn-badge.is-current { color: #271d0a; background: var(--gold-bright); box-shadow: 0 0 14px rgba(255,215,123,.38); }
.seat-turn-badge.is-up-next { color: #082218; background: #82ddb1; }
.left-badge { margin-left: 5px; color: var(--muted); font-size: .62rem; font-weight: 700; text-transform: uppercase; }
@media (max-width: 680px) {
    .seat-header { flex-wrap: wrap; gap: 3px 5px; }
    .seat-turn-badge { min-height: 17px; padding: 2px 5px; font-size: .4rem; }
}

/* Keep time-sensitive controls clear of seats, cards, and table overlays. */
.game-actions {
    z-index: 60;
    pointer-events: none;
}
.game-actions > * { pointer-events: auto; }
.bet-options { position: relative; z-index: 1; }

/* The compact composer is a permanent part of the table on every viewport. */
.table-stage > .mobile-chat-form:not(.hidden) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 46px;
    gap: 7px;
    width: min(760px, 100%);
    margin: 4px auto 0;
    padding: 4px 0;
}
.table-stage > .mobile-chat-form input { min-height: 46px; }
.table-stage > .mobile-chat-form button {
    min-height: 46px;
    color: #20190c;
    background: var(--gold);
    border: 0;
    border-radius: 9px;
    font-size: 1.08rem;
    font-weight: 900;
}

@media (max-width: 680px) {
    .table-stage > .mobile-chat-form:not(.hidden) {
        grid-template-columns: minmax(0, 1fr) 44px;
        width: 100%;
        padding: 4px 0;
    }
    .table-stage > .mobile-chat-form input,
    .table-stage > .mobile-chat-form button { min-height: 44px; }
}

/* Emoji picker for both chat composers. */
.chat-form,
.mobile-chat-form { position: relative; }
.mobile-chat-form { z-index: 55; }
.chat-form { grid-template-columns: minmax(0, 1fr) 38px 38px 38px; }
.mobile-chat-form,
.table-stage > .mobile-chat-form:not(.hidden) { grid-template-columns: minmax(0, 1fr) 44px 44px 44px; }
.emoji-toggle,
.quick-message-toggle {
    color: var(--muted) !important;
    background: rgba(255,255,255,.08) !important;
    border: 1px solid rgba(255,255,255,.12) !important;
    font-size: 1.15rem !important;
}
.quick-message-toggle { font-size: 1rem !important; }
.emoji-picker {
    position: absolute;
    z-index: 2100;
    right: 9px;
    bottom: calc(100% + 7px);
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    width: 244px;
    padding: 8px;
    background: #152821;
    border: 1px solid rgba(228,184,90,.42);
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0,0,0,.42);
}
.emoji-picker.hidden { display: none; }
.emoji-picker .emoji-choice {
    display: grid;
    place-items: center;
    min-height: 32px;
    padding: 0;
    color: inherit;
    background: rgba(255,255,255,.06);
    border: 0;
    border-radius: 6px;
    font-size: 1.15rem;
    line-height: 1;
}
.emoji-picker .emoji-choice:hover,
.emoji-picker .emoji-choice:focus-visible { background: rgba(228,184,90,.25); }
[data-theme-mode="light"] .emoji-picker { background: #fbfaf5; }
@media (max-width: 680px) {
    .table-stage > .mobile-chat-form:not(.hidden) { grid-template-columns: minmax(0, 1fr) 44px 44px 44px; }
    .emoji-picker { right: 0; width: min(276px, calc(100vw - 24px)); }
}

.quick-message-picker {
    position: absolute;
    z-index: 2100;
    right: 0;
    bottom: calc(100% + 7px);
    display: flex;
    flex-direction: column;
    gap: 9px;
    width: min(316px, calc(100vw - 24px));
    max-height: min(350px, calc(100dvh - 150px));
    padding: 12px;
    color: var(--text);
    background: var(--panel);
    border: 1px solid rgba(228,184,90,.5);
    border-radius: 12px;
    box-shadow: 0 14px 36px rgba(0,0,0,.42);
}
.quick-message-picker.hidden { display: none; }
.quick-message-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: .83rem; }
.quick-message-heading small { color: var(--muted); font-size: .68rem; }
.quick-message-list { display: grid; gap: 5px; min-height: 0; overflow-y: auto; }
.quick-message-row { display: grid; grid-template-columns: minmax(0, 1fr) 32px; gap: 5px; }
.quick-message-picker .quick-message-row button,
.quick-message-picker .quick-message-add-toggle,
.quick-message-picker .quick-message-add-row button,
.table-stage > .mobile-chat-form .quick-message-picker button {
    min-height: 36px;
    padding: 6px 9px;
    border-radius: 7px;
    font-size: .76rem;
    font-weight: 700;
}
.quick-message-picker .quick-message-send {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    color: var(--text);
    background: rgba(228,184,90,.12);
    border: 1px solid rgba(228,184,90,.22);
    text-align: left;
}
.quick-message-number { display: grid; min-height: 22px; place-items: center; color: var(--gold-bright); background: rgba(228,184,90,.13); border-radius: 5px; font-size: .67rem; font-variant-numeric: tabular-nums; }
.quick-message-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-message-picker .quick-message-send:hover { background: rgba(228,184,90,.28); }
.quick-message-picker .quick-message-send:focus-visible { background: rgba(228,184,90,.28); outline: 2px solid var(--gold-bright); outline-offset: 1px; }
.quick-message-picker .quick-message-remove {
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--line);
    font-size: 1.2rem !important;
}
.quick-message-picker .quick-message-remove:hover { color: var(--text); background: rgba(228,184,90,.16); }
.quick-message-picker .quick-message-add-toggle,
.quick-message-picker .quick-message-add-row button {
    color: #20190c;
    background: var(--gold);
    border: 0;
}
.quick-message-picker .quick-message-add-toggle:disabled { opacity: .5; cursor: default; }
.quick-message-add-row { display: grid; grid-template-columns: minmax(0, 1fr) 52px; gap: 6px; }
.quick-message-add-row.hidden,
.quick-message-add-toggle.hidden { display: none; }
.quick-message-picker .quick-message-add-row input,
.table-stage > .mobile-chat-form .quick-message-add-row input { min-width: 0; min-height: 36px; font-size: .76rem; }
.quick-message-empty { margin: 4px 0; color: var(--muted); font-size: .72rem; }
.emoji-picker .emoji-choice:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 1px; }


/* Keep betting actions available at the bottom of the mobile viewport. */
@media (max-width: 680px) {
    .game-actions.is-mobile-betting {
        position: fixed;
        z-index: 1700;
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        width: auto;
        max-width: none;
        box-sizing: border-box;
        min-height: 0;
        padding: 8px max(8px, env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom));
        background: transparent;
        border: 0;
        box-shadow: none;
        backdrop-filter: none;
        transform: none;
    }
    .game-actions.is-mobile-betting > * { width: auto; max-width: 100%; }
    .game-actions.is-mobile-betting .bet-options { box-sizing: border-box; width: auto; min-width: 0; max-width: 100%; justify-content: center; padding: 6px 8px; background: rgba(5,27,20,.94); border: 1px solid rgba(228,184,90,.38); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.36); -webkit-overflow-scrolling: touch; touch-action: pan-x; }
    .game-actions.is-mobile-betting .bet-choice { flex: 0 0 auto; min-width: 44px; min-height: 48px; padding: 6px 10px; font-size: 1rem; font-weight: 800; }
    .game-actions.is-mobile-betting .betting-form { width: auto; justify-content: center; }
    .game-shell:has(.game-actions.is-mobile-betting) { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
}


/* Betting buttons stay dark-on-light in the light theme, including when they are rendered outside the normal table flow on mobile. */
html[data-theme-mode="light"] .game-actions .bet-choice {
    color: #17241f;
    background: #e4e9e4;
    border-color: rgba(29,52,43,.24);
}
html[data-theme-mode="light"] .game-actions .bet-choice:hover:not(:disabled),
html[data-theme-mode="light"] .game-actions .bet-choice:focus-visible {
    color: #20190c;
    background: var(--gold);
}
.game-actions .bet-choice.is-confirming { position: relative; color: #20190c; background: var(--gold-bright); border-color: var(--gold); box-shadow: 0 0 0 2px rgba(228,184,90,.25), 0 0 18px rgba(228,184,90,.24); font-weight: 900; }
.game-actions .bet-choice.is-confirming::after { position: absolute; top: 1px; right: 2px; display: grid; width: 12px; height: 12px; place-items: center; content: "✓"; color: #20190c; background: #fff6d8; border: 1px solid var(--gold); border-radius: 50%; font-size: .55rem; line-height: 1; }
.game-actions .bet-choice.is-confirming:hover { color: #20190c; background: var(--gold); }
html[data-theme-mode="light"] .game-actions .bet-options.bet-change-countdown,
html[data-theme-mode="light"] .game-actions .bet-options.bet-change-notice {
    color: #ffe4a0;
    background: rgba(55,43,17,.96);
}


/* Emoji-card winner indicator: a visible frame, never an explanatory label. */
.winning-card-frame {
    position: absolute;
    z-index: 3;
    inset: -4px;
    border: 3px solid var(--gold-bright);
    border-radius: 10px;
    box-shadow: 0 0 0 2px rgba(38,28,9,.72), 0 0 14px rgba(255,215,123,.9);
    pointer-events: none;
}


/* Game-like round summary presentation. */
.turn-summary-card { width: min(520px, 100%); padding: 0; overflow: hidden; background: #10241d; border-color: rgba(228,184,90,.68); }
.turn-summary-card > .status-label,
.turn-summary-card > h2 { display: none; }
.summary-hero { display: flex; align-items: center; gap: 14px; padding: 22px 24px; background: linear-gradient(135deg, rgba(228,184,90,.2), rgba(228,184,90,.04)); border-bottom: 1px solid rgba(228,184,90,.2); }
.summary-trophy { display: grid; place-items: center; width: 54px; height: 54px; flex: 0 0 54px; color: #281d09; background: linear-gradient(145deg, var(--gold-bright), var(--gold)); border-radius: 16px; box-shadow: 0 8px 22px rgba(228,184,90,.2); font-size: 1.65rem; }
.summary-hero > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.summary-kicker { color: var(--gold-bright); font-size: .62rem; font-weight: 900; letter-spacing: .14em; }
.summary-hero strong { color: var(--text); font-size: 1.2rem; }
.summary-hero small { color: var(--muted); font-size: .72rem; }
.summary-section { padding: 16px 24px 0; }
.summary-section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: var(--text); font-size: .78rem; font-weight: 800; }
.summary-section-heading small { color: var(--muted); font-size: .55rem; letter-spacing: .1em; }
.summary-scoreboard { display: grid; gap: 5px; }
.summary-score-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 9px 11px; color: var(--text); background: rgba(255,255,255,.055); border: 1px solid transparent; border-radius: 9px; }
.summary-score-row.is-you { border-color: rgba(228,184,90,.45); background: rgba(228,184,90,.1); }
.summary-player { display: flex; flex-direction: column; min-width: 0; }
.summary-player-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.summary-player strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; }
.summary-player small { color: var(--muted); font-size: .62rem; }
.summary-babbeo-tag { flex: none; padding: 2px 5px; color: var(--gold-bright); background: rgba(228,184,90,.14); border-radius: 4px; font-size: .55rem; font-weight: 800; }
.summary-result { color: #8fe0b4; font-size: .62rem; font-weight: 800; white-space: nowrap; }
.summary-score-row.loss .summary-result { color: #f2a6a6; }
.summary-lives { min-width: 48px; color: var(--muted); font-size: .62rem; text-align: right; white-space: nowrap; }
.summary-hands { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 20px; }
.summary-hand-chip { display: flex; flex-direction: column; gap: 2px; padding: 7px 9px; color: var(--text); background: rgba(255,255,255,.055); border-radius: 7px; }
.summary-hand-chip small { color: var(--muted); font-size: .56rem; }
.summary-hand-chip strong { font-size: .66rem; }
.summary-empty { margin: 0; padding: 12px; color: var(--muted); background: rgba(255,255,255,.04); border-radius: 8px; font-size: .72rem; }
.turn-summary-card > .btn { width: calc(100% - 48px); margin: 0 24px 22px; }
html[data-theme-mode="light"] .turn-summary-card { background: #fbfaf5; }
html[data-theme-mode="light"] .summary-score-row { background: rgba(23,36,31,.06); }
html[data-theme-mode="light"] .summary-score-row.is-you { background: rgba(183,122,24,.12); }
@media (max-width: 680px) {
    .summary-hero { padding: 19px 18px; }
    .summary-section { padding-inline: 18px; }
    .turn-summary-card > .btn { width: calc(100% - 36px); margin-inline: 18px; }
}


/* Let the chat panel grow upward without changing its width. */
.chat-panel {
    resize: vertical;
    min-height: 240px;
    max-height: calc(100vh - 44px);
}

/* The Wikimedia scans have square source corners. Keep the other artwork
   themes unchanged and give only these themes a softer card silhouette. */
html[data-card-theme="bergamasche-cards"] .card.image-card,
html[data-card-theme="bresciane-cards"] .card.image-card,
html[data-card-theme="napoletane-cards"] .card.image-card {
    border-radius: 9px;
}
html[data-card-theme="bergamasche-cards"] .card.image-card .card-art,
html[data-card-theme="bresciane-cards"] .card.image-card .card-art,
html[data-card-theme="napoletane-cards"] .card.image-card .card-art {
    border-radius: 9px;
}
html[data-card-theme="bergamasche-cards"] .table-playing-card.image-card,
html[data-card-theme="bergamasche-cards"] .table-playing-card.image-card img,
html[data-card-theme="bresciane-cards"] .table-playing-card.image-card,
html[data-card-theme="bresciane-cards"] .table-playing-card.image-card img,
html[data-card-theme="napoletane-cards"] .table-playing-card.image-card,
html[data-card-theme="napoletane-cards"] .table-playing-card.image-card img {
    border-radius: 7px;
}
@media (max-width: 680px) {
    .chat-panel {
        min-height: 280px;
        bottom: calc(8px + env(safe-area-inset-bottom) + var(--keyboard-inset, 0px));
        max-height: calc(100dvh - 16px - env(safe-area-inset-bottom) - var(--keyboard-inset, 0px));
    }
}


/* Five user-selectable card scales. Normal (1) matches the existing layout. */
html { --card-size-scale: 1; }
html[data-card-size="smallest"] { --card-size-scale: .8; }
html[data-card-size="smaller"] { --card-size-scale: .9; }
html[data-card-size="larger"] { --card-size-scale: 1.1; }
html[data-card-size="largest"] { --card-size-scale: 1.2; }

/* Five user-selectable text scales for visual inspection and accessibility. */
html { --text-size-scale: 1; }
html[data-text-size="smallest"] { --text-size-scale: .8; }
html[data-text-size="smaller"] { --text-size-scale: .9; }
html[data-text-size="larger"] { --text-size-scale: 1.1; }
html[data-text-size="largest"] { --text-size-scale: 1.2; }
.player-name { font-size: calc(.87rem * var(--text-size-scale)); }
.seat-meta > span { font-size: calc(.72rem * var(--text-size-scale)); }
.seat-meta small { font-size: calc(.52rem * var(--text-size-scale)); }
.seat-meta strong { font-size: calc(.82rem * var(--text-size-scale)); }
.seat-meta .lives-count { font-size: calc(.72rem * var(--text-size-scale)); }
.seat-subtitle { font-size: calc(.64rem * var(--text-size-scale)); }
.table-caption { font-size: calc(.68rem * var(--text-size-scale)); }
@media (max-width: 680px) {
    .player-name { font-size: calc(.78rem * var(--text-size-scale)); }
    .seat-meta > span { font-size: calc(.52rem * var(--text-size-scale)); }
    .seat-meta small { font-size: calc(.39rem * var(--text-size-scale)); }
    .seat-meta strong { font-size: calc(.60rem * var(--text-size-scale)); }
    .seat-meta .lives-count { font-size: calc(.56rem * var(--text-size-scale)); }
    .seat-subtitle { font-size: calc(.45rem * var(--text-size-scale)); }
}
.card {
    flex-basis: calc(80px * var(--card-size-scale));
    width: calc(80px * var(--card-size-scale));
    height: calc(112px * var(--card-size-scale));
}
.card .rank strong { font-size: calc(1.65rem * var(--card-size-scale)); }
.card .rank small { font-size: calc(.58rem * var(--card-size-scale)); }
.card .suit-icon.large { font-size: calc(2.7rem * var(--card-size-scale)); }
.hand-dock { height: calc(138px * var(--card-size-scale)); }
.cards-row { height: calc(138px * var(--card-size-scale)); }
.table-playing-card { width: calc(70px * var(--card-size-scale)); height: calc(100px * var(--card-size-scale)); }
.table-playing-card.image-card { width: calc(78px * var(--card-size-scale)); height: calc(125px * var(--card-size-scale)); }
.table-card-rank { font-size: calc(1.42rem * var(--card-size-scale)); }
.table-card-suit { font-size: calc(1.55rem * var(--card-size-scale)); }
@media (max-width: 680px) {
    .card { flex-basis: calc(76px * var(--card-size-scale)); width: calc(76px * var(--card-size-scale)); height: calc(112px * var(--card-size-scale)); }
    .card .rank strong { font-size: calc(1.5rem * var(--card-size-scale)); }
    .card .suit-icon.large { font-size: calc(2.45rem * var(--card-size-scale)); }
    .table-playing-card { width: calc(54px * var(--card-size-scale)); height: calc(78px * var(--card-size-scale)); }
    .table-playing-card.image-card { width: calc(58px * var(--card-size-scale)); height: calc(93px * var(--card-size-scale)); }
    .cards-row, .hand-dock { height: calc(138px * var(--card-size-scale)); }
}

/* Keep mobile player details readable as three compact rows. */
@media (max-width: 680px) {
    .seat-meta {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2px;
        width: 100%;
    }
    .seat-meta .lives-count {
        grid-column: 1 / -1;
        justify-self: center;
    }
    .seat-meta > span:not(.lives-count) {
        justify-content: center;
        min-width: 0;
    }
}

/* Refined account navigation, notification popup, and inline invitations. */
.notification-button { display: grid; place-items: center; width: 40px; min-width: 40px; padding: 0; }
.notification-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.notification-copy { display: grid; gap: 3px; min-width: 0; padding: 0; color: inherit; background: transparent; border: 0; text-align: left; }
.notification-copy[data-notification-target] { cursor: pointer; }
.notification-copy[data-notification-target]:hover strong { color: var(--gold-bright); }
.notification-copy small { color: var(--muted); }
.guest-auth-actions { justify-content: flex-start; }
.host-controls { flex-wrap: wrap; }
.host-controls > .setup-heading { flex: 1 1 240px; }
.table-friend-invites { flex: 1 0 100%; display: grid; gap: 9px; padding-top: 12px; border-top: 1px solid var(--line); }
.table-invite-heading { display: flex; flex-direction: row !important; align-items: center; justify-content: space-between; width: 100%; margin: 0 !important; }
.table-invite-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 7px; max-height: 150px; overflow-y: auto; }
.table-invite-friend { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 2px 8px; min-height: 46px; padding: 8px 10px; background: rgba(255,255,255,.045); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.table-invite-friend input { grid-row: 1 / 3; width: 18px; height: 18px; accent-color: var(--gold); }
.table-invite-friend span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .76rem; font-weight: 800; }
.table-invite-friend small { color: var(--muted); font-size: .58rem; }
.table-friend-invites > .btn { justify-self: end; }
@media (max-width: 680px) {
    .table-invite-list { grid-template-columns: repeat(2, minmax(0,1fr)); max-height: 132px; }
    .table-friend-invites > .btn { justify-self: stretch; }
    .guest-auth-actions .btn { width: 100%; }
}

/* The hand intentionally straddles the felt edge and the round-status row. */
.hand-dock { bottom: -18px; }
.table-card-position.is-you .played-by { display: none; }
@media (max-width: 680px) {
    .hand-dock { bottom: -18px; }
}

/* Coordinated user-selected palettes. */
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) {
    background: var(--bg);
}
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) body {
    background: radial-gradient(circle at 50% -20%, color-mix(in srgb, var(--panel) 88%, var(--bg)), var(--bg) 52%);
}
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) .ambient-glow {
    background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 8%, transparent) 1px, transparent 1px),
                linear-gradient(color-mix(in srgb, var(--gold) 7%, transparent) 1px, transparent 1px);
}
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) .lobby-intro > p,
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) .lobby-form label,
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) .menu-control > span:first-child {
    color: var(--muted);
}
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) .lobby-panel,
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) .game-status-bar,
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) .account-button,
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) .game-menu,
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) .chat-panel,
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) .turn-summary-card,
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) .social-card,
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) .turn-history-panel,
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) .host-controls,
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) .standings-panel {
    color: var(--text);
    background: var(--panel);
    border-color: var(--line);
}
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) input[type="text"],
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) input[type="number"],
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) .stack-form input,
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) .social-search input,
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) .menu-control select {
    color: var(--text);
    background: var(--panel-2);
    border-color: var(--line);
}
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) .lobby-tabs,
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) .code-chip,
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) .message,
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) .chat-message-body,
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) .summary-score-row,
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) .social-row,
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) .history-turn {
    color: var(--text);
    background: var(--panel-2);
}
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) .btn-primary,
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) .chat-toggle,
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) .chat-form > button:not(.emoji-toggle):not(.quick-message-toggle),
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) .account-primary,
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) .code-chip {
    color: var(--bg);
    background: var(--gold);
    border-color: var(--gold);
}
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) .btn-secondary:not(.bet-choice),
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) .mini-btn,
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) .lobby-tab.active {
    color: var(--text);
    background: var(--panel-2);
    border-color: var(--line);
}
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) .btn-quiet,
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) .chat-header small,
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) .chat-message-head,
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) .menu-control,
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) .form-note {
    color: var(--muted);
}
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]) .history-card:hover {
    color: var(--text);
    border-color: var(--gold);
    background: color-mix(in srgb, var(--gold) 14%, var(--panel));
}

/* Keep game controls anchored to the game in every layout mode. */
#game-section.game-shell { position: relative; }
#game-section .game-toolbar {
    position: absolute;
    z-index: 200;
    top: 12px;
    right: 18px;
    left: 18px;
    display: flex;
    align-items: flex-start;
    height: 0;
    margin: 0;
    padding: 0;
    pointer-events: none;
}
#game-section .game-toolbar > button { position: static; pointer-events: auto; }
#game-section .fullscreen-toggle { margin: 0 8px 0 auto; }
#game-section .game-menu-toggle { margin: 0; }
#game-section .game-menu { top: 48px; right: 0; left: auto; pointer-events: auto; }
.profile-tabs .lobby-tab { border: 1px solid transparent; transition: color .15s, background .15s, border-color .15s, box-shadow .15s; }
.profile-tabs .lobby-tab.active {
    color: var(--bg);
    background: var(--gold);
    border-color: var(--gold);
    box-shadow: 0 3px 12px color-mix(in srgb, var(--gold) 28%, transparent);
    font-weight: 800;
}
[data-theme-mode="light"] .profile-tabs .lobby-tab.active { color: var(--text); }
@media (max-width: 680px) {
    #game-section .game-toolbar { top: 8px; right: 10px; left: 10px; }
    #game-section .fullscreen-toggle { margin-right: 8px; }
    #game-section .game-menu { top: calc(48px + env(safe-area-inset-top)); right: 0; left: 0; }
}

/* A decorative edge pulse that leaves the table layout and input untouched. */
.turn-edge-pulse::after {
    content: "";
    position: fixed;
    z-index: 1800;
    inset: 0;
    pointer-events: none;
    border: 2px solid var(--felt-bright, #126148);
    box-shadow: inset 0 0 72px 12px var(--felt-bright, #126148), inset 0 0 5px 2px var(--felt-bright, #126148);
    opacity: .42;
    animation: turn-edge-pulse 2s ease-in-out infinite;
    will-change: opacity;
}
@keyframes turn-edge-pulse {
    0%, 100% { opacity: .42; }
    50% { opacity: .9; }
}
@media (prefers-reduced-motion: reduce) {
    .turn-edge-pulse::after { animation: none; opacity: .62; }
}

/* Screen-wide, pointer-free emoji rain for notable game moments. */
.celebration-rain {
    position: fixed;
    z-index: 1900;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}
.celebration-particle {
    position: absolute;
    display: block;
    line-height: 1;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,.3));
    animation: celebration-fall var(--rain-duration) ease-in var(--rain-delay) both;
    will-change: transform;
}
.celebration-emoji {
    display: block;
    animation: celebration-wiggle var(--wiggle-duration) ease-in-out infinite alternate;
}
.celebration-title {
    position: fixed;
    z-index: 1901;
    top: 44%;
    left: 50%;
    width: max-content;
    max-width: min(900px, calc(100vw - 28px));
    padding: 16px 30px;
    color: #fff4c5;
    background: linear-gradient(120deg, rgba(40,23,28,.92), rgba(65,34,29,.9) 50%, rgba(35,22,35,.92));
    border: 2px solid rgba(255,214,125,.86);
    border-radius: 18px;
    box-shadow: 0 0 0 5px rgba(255,186,77,.13), 0 15px 50px rgba(0,0,0,.45), inset 0 1px rgba(255,255,255,.28);
    font-size: clamp(1.5rem, 4vw, 3.25rem);
    font-weight: 900;
    letter-spacing: -.035em;
    line-height: 1.1;
    text-align: center;
    text-shadow: 0 2px 1px #7b3f27, 0 0 15px rgba(255,208,100,.78);
    pointer-events: none;
    transform: translate(-50%, -50%);
}
.celebration-title.is-visible { animation: celebration-title-appear .5s cubic-bezier(.2,.8,.2,1) both; }
@keyframes celebration-title-appear {
    from { opacity: 0; transform: translate(-50%, -45%) scale(.88); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes celebration-fall {
    from { opacity: 0; transform: translate3d(0, -4vh, 0); }
    12% { opacity: 1; }
    78% { opacity: 1; }
    to { opacity: 0; transform: translate3d(var(--rain-drift), var(--rain-travel), 0); }
}
@keyframes celebration-wiggle {
    from { transform: translateX(-13px) rotate(-16deg); }
    to { transform: translateX(13px) rotate(16deg); }
}
@media (prefers-reduced-motion: reduce) {
    .celebration-particle { animation: none; display: none; }
}
@media (max-width: 680px) {
    .celebration-title { top: 42%; padding: 12px 16px; border-radius: 13px; }
}
.venceslao-card {
    outline: 3px solid #f3c969;
    box-shadow: 0 0 18px #f3c96988;
}

.game-shell.is-venceslao #table-cards {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    pointer-events: none;
}
.game-shell.is-venceslao .players-list { z-index: 12; }
.game-shell.is-venceslao .venceslao-seat {
    position: absolute;
    max-width: 32%;
    min-width: 150px;
    padding: .25rem .4rem;
    color: #fff;
    text-align: center;
    pointer-events: auto;
}
.game-shell.is-venceslao .venceslao-seat.is-opponent-left { left: 5%; top: 40%; }
.game-shell.is-venceslao .venceslao-seat.is-opponent-right { right: 5%; top: 40%; }
.game-shell.is-venceslao .venceslao-seat.is-spectator-top { left: 50%; top: 7%; transform: translateX(-50%); }
.game-shell.is-venceslao .venceslao-seat.is-you { top: auto; right: auto; bottom: 16%; left: 50%; transform: translateX(-50%); }
.game-shell.is-venceslao .venceslao-seat.is-active .seat-header { color: var(--gold-bright); }
.game-shell.is-venceslao .venceslao-seat .seat-header { display: flex; align-items: center; justify-content: center; gap: .35rem; font-weight: 800; text-shadow: 0 2px 5px #00170f; }
.game-shell.is-venceslao .venceslao-table-content {
    display: flex;
    max-height: 100%;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
    height: 100%;
    gap: .4rem;
    overflow: visible;
    padding: 0;
    color: #fff;
    text-shadow: 0 1px 3px #00170f;
}
.game-shell.is-venceslao .venceslao-table-content .table-card-rank,
.game-shell.is-venceslao .venceslao-table-content .table-card-suit { text-shadow: none; }
.game-shell.is-venceslao .venceslao-waiting {
    display: grid;
    gap: .3rem;
    text-align: center;
}
.game-shell.is-venceslao .venceslao-trick {
    position: absolute;
    inset: 0;
    min-height: 0;
    pointer-events: none;
}
.game-shell.is-venceslao .venceslao-trick .venceslao-played-card { position: absolute; width: 86px; transform: translate(-50%, -50%); }
.game-shell.is-venceslao .venceslao-trick .owner-left { left: 24%; top: 58%; }
.game-shell.is-venceslao .venceslao-trick .owner-right { left: 76%; top: 58%; }
.game-shell.is-venceslao .venceslao-trick .winning-card .table-playing-card { outline: 3px solid #f3c969; box-shadow: 0 0 18px #f3c969aa; }
.game-shell.is-venceslao .venceslao-seat.is-trick-winner { border: 1px solid rgba(243,201,105,.8); border-radius: 10px; background: rgba(4,30,22,.66); box-shadow: 0 0 20px rgba(243,201,105,.22); }
.game-shell.is-venceslao .venceslao-taker-badge { padding: 2px 6px; color: #241b0c; background: #f3c969; border-radius: 99px; font-size: .58rem; text-shadow: none; }
.game-shell.is-venceslao .venceslao-trick .owner-you { left: 50%; top: 48%; }
.game-shell.is-venceslao .venceslao-trick .owner-top { left: 50%; top: 42%; }
.game-shell.is-venceslao .venceslao-trick .owner-double[data-owner-card="0"] { transform: translate(calc(-50% - 45px), -50%); }
.game-shell.is-venceslao .venceslao-trick .owner-double[data-owner-card="1"] { transform: translate(calc(-50% + 45px), -50%); }
.game-shell.is-venceslao.venceslao-result-revealing .venceslao-sodegerio { top: 5%; right: 4%; bottom: auto; }
.game-shell.is-venceslao .venceslao-played-card,
.game-shell.is-venceslao .venceslao-sodegerio {
    display: grid;
    justify-items: center;
    gap: .25rem;
    color: #fff;
    font-size: .75rem;
    text-align: center;
}
.game-shell.is-venceslao .venceslao-card-owner { width: 86px; max-width: 86px; min-height: 1em; color: #fff; font-size: .68rem; font-weight: 800; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 3px #00170f; }
.game-shell.is-venceslao .venceslao-claim-wrap { position: absolute; inset: 0; z-index: 13; pointer-events: none; }
.game-shell.is-venceslao .venceslao-claim-card { position: absolute; top: 50%; left: 50%; z-index: 13; display: grid; place-items: center; padding: 0; border: 0; background: transparent; pointer-events: auto; cursor: pointer; transform: translate(-50%, -50%); }
.game-shell.is-venceslao .venceslao-claim-card:disabled { opacity: .78; cursor: default; }
.game-shell.is-venceslao .venceslao-claim-owner { position: absolute; top: calc(50% + 66px); left: 50%; width: max-content; max-width: min(220px, 70vw); padding: 4px 8px; color: #ffe08e; background: rgba(3,24,18,.8); border: 1px solid rgba(243,201,105,.35); border-radius: 99px; font-size: .66rem; font-weight: 800; text-align: center; text-shadow: 0 1px 3px #00170f; transform: translateX(-50%); }
.game-shell.is-venceslao .venceslao-claim-status { position: absolute; top: 15%; left: 50%; z-index: 14; max-width: min(320px, 82vw); padding: 7px 12px; color: #fff0bd; background: rgba(5,35,25,.95); border: 1px solid rgba(243,201,105,.65); border-radius: 99px; box-shadow: 0 8px 24px #00150f88; font-size: .74rem; font-weight: 800; text-align: center; transform: translateX(-50%); }
.game-shell.is-venceslao .venceslao-result-countdown { color: var(--gold-bright); font-weight: 900; font-variant-numeric: tabular-nums; }
.game-shell.is-venceslao .venceslao-sodegerio { position: absolute; right: 4%; bottom: 5%; z-index: 4; }
.game-shell.is-venceslao .venceslao-sodegerio::before { content: "Sodegerio"; position: absolute; bottom: calc(100% + 2px); left: 50%; transform: translateX(-50%); color: #ffe08e; font-size: .62rem; font-weight: 800; white-space: nowrap; }
.game-shell.is-venceslao .venceslao-suit-picker { position: fixed; top: 35%; left: 50%; z-index: 1000; display: flex; justify-content: center; gap: .65rem; padding: .45rem .75rem; border: 1px solid rgba(243,201,105,.55); border-radius: .8rem; background: rgba(8,50,36,.97); box-shadow: 0 12px 35px #00150fcc; pointer-events: auto; transform: translate(-50%, -50%); }
.game-shell.is-venceslao .venceslao-suit-choice { display: grid; width: 2.65rem; height: 2.65rem; place-items: center; padding: 0; border: 1px solid #f3c969; border-radius: .6rem; color: #fff; background: #173627; font-size: 1.35rem; cursor: pointer; }
.venceslao-summary { z-index: 2000; }
.turn-summary-modal.venceslao-summary { place-content: initial; background: rgba(1,13,9,.64); backdrop-filter: blur(5px); }
.venceslao-summary-card { display: grid; gap: 12px; max-height: min(88dvh, 760px); overflow-y: auto; }
.venceslao-summary-card h2 { margin: 0; }
.venceslao-summary-card .summary-hero { margin: 0; }
.venceslao-summary-card .summary-scoreboard { display: grid; gap: 7px; }
.venceslao-summary-card .summary-score-row { grid-template-columns: minmax(0, 1fr) auto; }
.venceslao-summary-card .summary-player { display: grid; gap: 3px; }
.venceslao-summary-card .summary-player small { color: var(--muted); font-size: .7rem; }
.venceslao-summary-card .summary-result { font-size: 1.1rem; font-weight: 900; }
.venceslao-primiera-result { margin: 0; padding: 10px 12px; background: rgba(255,255,255,.045); border-radius: 8px; color: var(--muted); font-size: .84rem; line-height: 1.45; }
.venceslao-summary-card .venceslao-reveal-dismiss { width: 100%; margin: 0; }
.game-shell.is-venceslao .venceslao-caption { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; min-height: 48px; height: auto; color: #d6e7df; }
.game-shell.is-venceslao .venceslao-caption .venceslao-match-status { flex: 0 0 auto; text-align: left; }
.game-shell.is-venceslao .venceslao-caption .venceslao-match-status small { display: block; margin-top: 3px; color: var(--muted); font-size: .66rem; }
.game-shell.is-venceslao .standing-score { display: flex; align-items: baseline; gap: .35rem; }
.game-shell.is-venceslao .standing-score small { color: var(--muted); font-size: .55rem; font-weight: 800; }
.game-shell.is-venceslao .standing-score strong { color: var(--gold-bright); }
.game-shell.is-venceslao .standing-subgames { color: var(--muted); font-size: .65rem; }
.game-shell.is-venceslao .standing-row { grid-template-columns: 30px minmax(0, 1fr) auto auto auto; }
.game-shell.is-venceslao .standing-elo-result.positive { color: #76d69a; }
.game-shell.is-venceslao .standing-elo-result.negative { color: #ed8f8f; }
.game-shell.is-venceslao #your-hand { justify-content: center; width: 100%; }
.game-shell.is-venceslao #your-hand .card + .card { margin-left: 0; }
.game-shell.is-venceslao #your-hand .card:not(:disabled) { cursor: pointer; }
.game-shell.is-venceslao #your-hand .card:focus-visible { outline: 3px solid #f3c969; }
.venceslao-reveal {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: .5rem;
    color: #fff;
    background: rgba(0,18,12,.88);
    text-align: center;
}
.venceslao-reveal[hidden] { display: none; }
.venceslao-reveal strong { font-size: clamp(1.3rem, 4vw, 2rem); }
.venceslao-reveal-card.card { flex: none; width: 110px; height: 172px; }
.venceslao-reveal-dismiss { min-width: 120px; margin-top: .5rem; padding: .7rem 1rem; border: 1px solid #ffe7ae; border-radius: .6rem; color: #241a08; background: #f3c969; font-weight: 800; cursor: pointer; }
.game-shell.is-venceslao #table-caption,
.game-shell.is-venceslao .table-caption .table-metrics,
.game-shell.is-venceslao .table-caption #round-actions,
.game-shell.is-venceslao #turn-history-toggle,
.game-shell.is-venceslao #starting-cards-control,
.game-shell.is-venceslao #starting-lives-control {
    display: none !important;
}
.game-shell.is-venceslao .venceslao-race button,
.game-shell.is-venceslao .venceslao-race select {
    position: relative;
    z-index: 1;
    pointer-events: auto;
}

.game-shell.is-venceslao #your-hand .card:disabled {
    cursor: not-allowed;
    opacity: .76;
}
.game-shell.is-venceslao.is-pre-game #start-game-btn { margin-right: 64px; }
.game-shell.is-venceslao #game-menu { max-height: calc(100dvh - 72px); overflow-y: auto; }
#your-hand .card-button {
    min-height: 3.25rem;
    margin: .25rem;
    padding: .65rem .85rem;
    border: 1px solid var(--border-color, #786b55);
    border-radius: .65rem;
    color: var(--text-color, #fff);
    background: var(--panel-background, #21352c);
    cursor: pointer;
}
@media (max-width: 680px) {
    .game-shell.is-venceslao #table-cards { padding: 0; }
    .game-shell.is-venceslao .venceslao-seat { min-width: 0; max-width: 34%; padding: .2rem .3rem; font-size: .78rem; }
    .game-shell.is-venceslao .venceslao-seat.is-opponent-left { left: 1%; top: 12%; }
    .game-shell.is-venceslao .venceslao-seat.is-opponent-right { right: 1%; top: 12%; }
    .game-shell.is-venceslao.venceslao-result-revealing .venceslao-seat.is-opponent-left,
    .game-shell.is-venceslao.venceslao-result-revealing .venceslao-seat.is-opponent-right { top: 26%; }
    .game-shell.is-venceslao.venceslao-result-revealing .venceslao-sodegerio { top: 78%; right: 0; bottom: auto; left: auto; transform: none; }
    .game-shell.is-venceslao.venceslao-result-revealing .venceslao-sodegerio::before { right: auto; bottom: calc(100% + 2px); left: 50%; transform: translateX(-50%); }
    .game-shell.is-venceslao .venceslao-trick .venceslao-played-card { width: 78px; }
    .game-shell.is-venceslao .venceslao-trick .owner-left,
    .game-shell.is-venceslao .venceslao-trick .owner-right { top: 37%; }
    .game-shell.is-venceslao .venceslao-trick .owner-you { top: 60%; }
    .game-shell.is-venceslao .venceslao-trick .owner-top { top: 37%; }
    .game-shell.is-venceslao .venceslao-trick .owner-double.owner-left[data-owner-card="0"],
    .game-shell.is-venceslao .venceslao-trick .owner-double.owner-right[data-owner-card="0"] { top: 31%; transform: translate(-50%, -50%); }
    .game-shell.is-venceslao .venceslao-trick .owner-double.owner-left[data-owner-card="1"],
    .game-shell.is-venceslao .venceslao-trick .owner-double.owner-right[data-owner-card="1"] { top: 49%; transform: translate(-50%, -50%); }
    .game-shell.is-venceslao .venceslao-trick .owner-double.owner-you[data-owner-card="0"] { transform: translate(calc(-50% - 40px), -50%); }
    .game-shell.is-venceslao .venceslao-trick .owner-double.owner-you[data-owner-card="1"] { transform: translate(calc(-50% + 40px), -50%); }
    .game-shell.is-venceslao .venceslao-table-content { gap: .3rem; padding: 0; font-size: .82rem; }
    .game-shell.is-venceslao .venceslao-played-card { font-size: .62rem; }
    .game-shell.is-venceslao .venceslao-card-owner { width: 78px; max-width: 78px; font-size: .58rem; }
    .game-shell.is-venceslao .venceslao-sodegerio { top: 58%; right: 3%; bottom: auto; }
    .game-shell.is-venceslao .venceslao-sodegerio::before { left: 50%; transform: translateX(8px); font-size: .52rem; }
    .game-shell.is-venceslao .venceslao-suit-picker { gap: .4rem; padding: .3rem .45rem; }
    .game-shell.is-venceslao .venceslao-suit-picker { top: 8%; left: 45%; }
    .game-shell.is-venceslao .venceslao-suit-choice { width: 2.35rem; height: 2.35rem; }
    .game-shell.is-venceslao .venceslao-caption { min-height: 40px; padding: 3px 4px; font-size: .6rem; }
    .game-shell.is-venceslao .standing-subgames { font-size: .55rem; }
    .game-shell.is-venceslao .standing-row { grid-template-columns: 24px minmax(0, 1fr) auto; }
    .game-shell.is-venceslao .standing-subgames { grid-column: 2; grid-row: 2; }
    .game-shell.is-venceslao .standing-elo-result { grid-column: 3; grid-row: 2; }
}
