/* Full-site components. Loaded after legacy geometry/responsive styles:
   replace presentation without changing visibility, state, layout or hit targets. */
body[data-theme] {background:linear-gradient(#edfaff,#fff8ee);color:var(--theme-ink);font-family:var(--theme-font);}
body[data-theme] :is(button,input,select,textarea) {font-family:var(--theme-font);}
body[data-theme] button {border-radius:var(--theme-control-radius);background:var(--theme-blue);color:white;box-shadow:0 3px 10px #647cbc15;}
body[data-theme] button.secondary {background:#fffdfa;color:var(--theme-ink);border:1px solid #d5dfed;box-shadow:none;}
body[data-theme] button:disabled {opacity:.55;box-shadow:none;}
body[data-theme] :is(input,select,textarea) {border:1px solid #d5dfed;border-radius:12px;color:var(--theme-ink);background:#f8f9fd;}
body[data-theme] input::placeholder,body[data-theme] textarea::placeholder {color:var(--theme-muted);}
body[data-theme] :is(a,button,input,select,textarea,summary):focus-visible {outline:3px solid #4165bd;outline-offset:3px;}
body[data-theme] :is(h1,h2,h3,strong){color:inherit;}
body[data-theme] :is(.eyebrow,.stage-path,.auth-hint,.empty-state) {color:var(--theme-muted);}
body[data-theme] :is(.lobby-card,.room-browser,.waiting-room,.seat,.player,.context-panel,.player-rail,.board-panel,.activity-panel,.action-dock,.runtime-bar,.topbar,.game-sheet,.toast,dialog){color:var(--theme-ink);background:var(--theme-surface);border-color:var(--theme-line);box-shadow:var(--theme-shadow);border-radius:var(--theme-radius);}
body[data-theme] dialog::backdrop {background:#29386655;backdrop-filter:blur(4px);}
body[data-theme] :is(.panel,.side-panel,.result-panel,.development-card,.dice-card,.mode-card,.trade-card,.production-result,.phase7-purchase-summary,.game-sheet .development-section) {background:var(--theme-surface);color:var(--theme-ink);border-color:var(--theme-line);border-radius:var(--theme-radius);box-shadow:var(--theme-shadow);}
body[data-theme] :is(.mark,.game-mark) {background:#dff4ef;color:#397b72;border-radius:18px;}
body[data-theme] :is(.board-toolbar button,.phase7-purchase-cost span) {background:#f2f6fc;color:var(--theme-ink);border-color:#d6e1ed;}
body[data-theme].playing-view .dock-actions button[aria-expanded='true'] {background:#dceff2;color:#286979;border-color:#a2cdd4;}
body[data-theme].playing-view :is(.turn-progress,.player-turn-state) {color:var(--theme-muted);}
body[data-theme].playing-view .player.is-current .player-turn-state {color:#99601c;}
body[data-theme].playing-view .player[data-self='true'] .player-turn-state {color:#99601c;}
body[data-theme].playing-view .board-toolbar #view3d[aria-pressed='true'] {color:var(--theme-blue);border-color:#8eacd6;}
body[data-theme].playing-view .dock-actions #guidePrimary:not([hidden]) {background:var(--theme-blue);color:white;border-color:#365cae;}
body[data-theme] #bigTwoSelectionStatus {color:#79501c;background:#fff5ddcc;border-radius:8px;}
body[data-theme] .big-two-table.is-own-turn #bigTwoTurn {color:var(--theme-aqua);text-shadow:0 0 12px #70b4bf55;}
body[data-theme] .big-two-volume {color:var(--theme-ink);}
body[data-theme] .big-two-volume input {accent-color:var(--theme-blue);}
body[data-theme] .big-two-callout,body[data-theme] .big-two-callout[data-kind] {background:#fff0dcf2;color:#79501c;border-color:#d9ba87;box-shadow:0 0 30px #e9c48555;}
body[data-theme] .big-two-callout[data-kind='win'] {background:#fff0e8f2;color:var(--theme-pink);border-color:#edb3bd;}
body[data-theme] :is(.big-two-pass-flash,.big-two-opponent.is-passed .big-two-player-state,#bigTwoSelfPassed) {background:#e5f7f0;color:#26705d;border-color:#92bfb0;}
body[data-theme] #tradeHubDialog :is(.sheet-heading,.trade-card,.sheet-heading h2,.trade-rate-reason) {background:var(--theme-surface);color:var(--theme-ink);border-color:var(--theme-line);}
body[data-theme] #tradeHubDialog .trade-choice small {color:var(--theme-muted);}
body[data-theme] dialog.result-panel.victory-panel[open] {background:#fffdfa;color:var(--theme-ink);border-color:#d8cbe8;}
body[data-theme] dialog.result-panel.victory-panel::backdrop {background:#29386666;}
body[data-theme] .game-view .waiting-heading {background:#fffdfa;color:var(--theme-ink);}
body[data-theme] .game-view:not(.playing-view) .waiting-actions :is(select,input) {background:#f8f9fd;color:var(--theme-ink);border-color:#d5dfed;}
body[data-theme] :is(.sheet-heading,.mobile-sheet-heading,.trade-choice,.trade-choice-control,.trade-resource-row,.development-actions,.auth-divider){border-color:var(--theme-line);color:var(--theme-ink);}
body[data-theme] .auth-text-button {color:var(--theme-blue);background:transparent;box-shadow:none;}
body[data-theme] .google-login {background:#fff;color:var(--theme-ink);border:1px solid #d1ddec;border-radius:14px;box-shadow:0 4px 12px #6282af12;}
body[data-theme] .google-login:hover:not(:disabled) {background:#f0f8ff;color:var(--theme-ink);}
body[data-theme] .google-login:active:not(:disabled) {background:#d4eafa;transform:translateY(0);}
body[data-theme] #loginView {width:min(1160px,100%);margin:auto;display:grid;grid-template-columns:minmax(0,1.2fr) minmax(300px,.8fr);gap:22px;align-content:center;align-items:start;padding:20px;}
body[data-theme] .auth-brand {grid-column:1/-1;padding:0;background:none;box-shadow:none;border:0;}
body[data-theme] .auth-brand .mark {border-radius:18px;background:#ffe9d8;color:var(--theme-pink);border:0;}
body[data-theme] .auth-brand h1 {font-size:28px;color:var(--theme-ink);}
body[data-theme] .auth-welcome {grid-column:1;grid-row:2;min-height:480px;padding:32px;border-radius:28px;background:#fff0d9 url('/images/social-hero.png') 65% center/cover;box-shadow:var(--theme-shadow);}
body[data-theme] .auth-welcome-copy {background:#fff8ead9;border-radius:22px;padding:22px;max-width:440px;}
body[data-theme] .auth-welcome h2 {font-size:clamp(30px,3.6vw,46px);line-height:1.25;margin:0 0 14px;color:var(--theme-ink);}
body[data-theme] .auth-welcome h2 span {color:var(--theme-pink);}
body[data-theme] .auth-welcome p {color:var(--theme-ink);line-height:1.7;margin:0;}
body[data-theme] #loginView .auth-card {grid-column:2;grid-row:2;width:100%;margin:0;padding:26px;min-width:0;background:#fffdfa;border:1px solid #eadfda;border-radius:24px;}
body[data-theme] .auth-card h2 {color:var(--theme-ink);}
body[data-theme] .auth-card label {color:var(--theme-ink);}
body[data-theme] #guestLogin {background:var(--theme-pink);}
body[data-theme] .email-login-details {border-color:var(--theme-line);}
body[data-theme] .email-login-details summary {color:var(--theme-blue);}
body[data-theme] #authStatus,body[data-theme] #registerStatus {color:var(--theme-muted);}
/* Shared game entry/waiting/chat/menu surfaces, including future native modules. */
body[data-theme] :is(.catan-stage,.test-dice-stage,.test-dice-game-stage){color:var(--theme-ink);}
body[data-theme] :is(.catan-stage,.test-dice-stage) .brand .mark {background:#dff4ef;color:#397b72;border-radius:18px;}
body[data-theme] :is(.room-row,.seat,.player,.waiting-meta,.room-meta,.public-room,.test-dice-result){background:#f4f8ff;color:var(--theme-ink);border-color:#dae3ee;border-radius:14px;}
body[data-theme] .seat[data-ready="true"] {background:var(--theme-mint);border-color:#82b8aa;}
body[data-theme] :is(.room-row small,.waiting-meta,.seat small,.player-head span,.player-summary,.runtime-summary,.topbar .eyebrow){color:var(--theme-muted);}
body[data-theme] :is(.waiting-actions,.platform-options,.room-settings){color:var(--theme-ink);}
body[data-theme] :is(.connection-banner,.connection-status,.big-two-connection,.runtime-status,.reconnect-banner){background:#fff0dc;color:#775629;border-color:#e3c399;border-radius:12px;}
body[data-theme] :is(.chat,.chat-panel,.chat-messages,.activity-view,.log-item,.trade-dialog-fields){background:var(--theme-surface);color:var(--theme-ink);border-color:var(--theme-line);}
body[data-theme] :is(.log-item .time,.chat-message .time,.chat-system,.system-message,.trade-choice small){color:var(--theme-muted);}
body[data-theme] :is(.feedback-card,.board-feedback,.hint-banner){background:#eff8ff;color:var(--theme-ink);border-color:#c7dcea;}
/* Big Two retains the four-seat composition and all existing responsive geometry. */
body[data-theme] :is(.big-two-lobby,.big-two-game){--gold:#b97b29;--ivory:#293866;--muted:#657393;--line:#c2dad6;--panel:#fffdfa;color:var(--theme-ink);font-family:var(--theme-font);background:#e8f5ed url('/images/cozy-game-room.png') center/cover;}
body[data-theme] :is(.big-two-lobby,.big-two-game) :is(h1,h2,strong){color:var(--theme-ink);text-shadow:none;}
body[data-theme] .big-two-hero h1 span {color:var(--theme-aqua);}
body[data-theme] :is(.big-two-lobby,.big-two-game) button.secondary {background:#fffdfaee;color:var(--theme-ink);border-color:#c7d8df;}
body[data-theme] .big-two-lobby button:not(.secondary),body[data-theme] :is(#bigTwoStart,#bigTwoPlay,#bigTwoRematch,#bigTwoReady){background:linear-gradient(135deg,#5375cd,#4669c5);color:white;border:1px solid #3e5caf;box-shadow:0 4px 16px #5878a522;}
body[data-theme] #bigTwoQuick {background:linear-gradient(135deg,#df5f84,#d94673);border-color:#c83660;color:white;border-radius:24px;box-shadow:0 8px 22px #df5f8425;}
body[data-theme] :is(.big-two-entry,.big-two-public.room-browser,.big-two-public .room-row,.big-two-seat,.big-two-opponent){background:#fffdfaf0;color:var(--theme-ink);border-color:#c5deda;border-radius:18px;box-shadow:0 5px 16px #71989418;}
body[data-theme] .big-two-public h2 {color:var(--theme-ink);}
body[data-theme] .big-two-entry summary svg {color:var(--theme-aqua);}
body[data-theme] .big-two-public .room-row>span:last-child {background:#e0f2f2;color:#286c77;border-radius:12px;}
body[data-theme] .big-two-avatar {background:radial-gradient(circle at 35% 30%,#fff6df,#fbd9c5);border-color:#d0b895;color:#68548e;box-shadow:0 0 0 3px #fff,0 4px 12px #98866920;}
body[data-theme] .big-two-seat.is-ready small {color:#267661;}
body[data-theme] .big-two-seat.is-empty {color:var(--theme-muted);background:#edf4f6e8;}
body[data-theme] .big-two-fan i {background:repeating-linear-gradient(45deg,#b7dedf 0 3px,#d2ebeb 3px 5px);color:#43788b;border-color:#6da4a7;box-shadow:0 2px 4px #62848a25;}
body[data-theme] .big-two-felt-emblem {color:#518e8140;}
body[data-theme] :is(#bigTwoWaitingStatus,#bigTwoStartHint,#bigTwoRematchStatus,.big-two-player-state){color:var(--theme-muted);}
body[data-theme] .big-two-center {background:#f7fffbec;color:var(--theme-ink);border-color:#a9cbc5;border-radius:26px;}
body[data-theme] .big-two-card {color:#253349;background:linear-gradient(135deg,#fffdfa,#fff1df);}
body[data-theme] .big-two-card.is-red {color:#b33450;}
body[data-theme] .big-two-card:disabled {opacity:1;}
body[data-theme] :is(.big-two-card-count,.big-two-card-count small) {color:var(--theme-ink);}
body[data-theme] .big-two-opponent.is-low-cards .big-two-card-count {color:#986016;}
body[data-theme] :is(.big-two-popover,.big-two-recent-history) {background:#fffdfaef;color:var(--theme-ink);border-color:#c5deda;box-shadow:var(--theme-shadow);}
body[data-theme] :is(#bigTwoQuickStatus,#bigTwoAudioStatus,.big-two-history li small,.big-two-recent-history li small) {color:var(--theme-muted);}
body[data-theme] .big-two-turn-progress {background:#e5eef6;border-color:#9db7d3;box-shadow:0 0 12px #678ac522;}
body[data-theme] .big-two-turn-progress[data-state='normal'] #bigTwoProgressFill {background:#548db4;}
body[data-theme] :is(.big-two-one-card,.big-two-own.is-last-card .big-two-near-win) {color:#79501c;background:#fff2ce;text-shadow:none;}
body[data-theme] .big-two-status strong {color:var(--theme-aqua);text-shadow:none;}
body[data-theme] #bigTwoTimer {background:#fffdfa;color:#8d5f22;border-color:#d6b378;box-shadow:0 0 18px #e0bc7928;}
body[data-theme] .big-two-opponent.is-acting {border-color:#558dc5;box-shadow:0 0 0 3px #b9dffd,0 0 22px #689bcf55;}
body[data-theme] .big-two-own {color:var(--theme-ink);}
body[data-theme] :is(.big-two-selection-note,.big-two-near-win,.big-two-hint-note){color:#896021;background:#fff6dd;border-color:#dcc78a;}
body[data-theme] :is(.big-two-chat,.big-two-chat-drawer,.big-two-history,.big-two-history-panel,.big-two-feedback-settings,.big-two-audio-settings){background:var(--theme-surface);color:var(--theme-ink);border-color:var(--theme-line);border-radius:18px;}
body[data-theme] .big-two-card.is-selected {border-color:var(--theme-blue);}
body[data-theme] .big-two-result {background:#fffdfaee;border-color:#ecd5b9;border-radius:28px;box-shadow:0 10px 36px #956f3924;color:var(--theme-ink);}
body[data-theme] .big-two-result h2 {color:var(--theme-pink);text-shadow:none;}
body[data-theme] :is(.big-two-result-subtitle,.big-two-result-columns,#bigTwoResultLeave){color:var(--theme-muted);}
body[data-theme] .big-two-result-players li {background:#f2f8fd;border-color:#d5e2ed;color:var(--theme-ink);}
body[data-theme] .big-two-result-players li.is-winner {background:#fff1d7;border-color:#d8b26b;box-shadow:inset 0 0 12px #e5c48524;}
body[data-theme] .big-two-winner-badge {color:#99641d;}
/* Catan: toy island, warm panels, soft aqua sea; ownership/resource identity stays. */
body[data-theme].playing-view :is(.topbar,.runtime-bar,.context-panel,.player-rail,.board-panel,.activity-panel,.action-dock,.hand-bar,.dock-actions){background:var(--theme-surface);color:var(--theme-ink);border-color:var(--theme-line);box-shadow:var(--theme-shadow);}
body[data-theme].playing-view :is(.identity-strip .player,.player-head,.player-details,.runtime-summary){background:#f4f8fd;color:var(--theme-ink);border-color:var(--theme-line);}
body[data-theme].playing-view :is(.top-actions.mobile-open,.activity-panel .activity-view,.activity-panel #chatMessages,.context-panel .turn-guide,.turn-guide){background:#fffdfa;color:var(--theme-ink);border-color:var(--theme-line);}
body[data-theme].playing-view :is(.top-actions.mobile-open .icon-button,.activity-panel .activity-tab,.dock-actions button:not(.mobile-primary-action)){background:#f2f6fc;color:var(--theme-ink);border-color:#d6e1ed;}
body[data-theme].playing-view .activity-panel .activity-tab.active {background:#dceff2;color:#286979;}
body[data-theme].playing-view :is(.context-panel .turn-guide p,.context-panel .turn-guide li,.context-panel .turn-guide strong,.player-head strong,.identity-strip .player-head>span,.runtime-bar span){color:var(--theme-ink);}
body[data-theme].playing-view :is(.action-dock #handTotal,.action-dock .hand-resource dt,.activity-panel .log-item .time,.activity-panel .time){color:var(--theme-muted);}
body[data-theme].playing-view .action-dock .hand-resource dd {color:var(--theme-ink);}
body[data-theme].playing-view :is(#guidePrimary,.mobile-primary-action,#endTurn){background:var(--theme-blue);color:white;border-color:#365cae;}
body[data-theme].playing-view .context-panel :is(#guideOwner,#guideMessage,#guideOptions) {color:var(--theme-ink);}
body[data-theme].playing-view .identity-strip :is(.resources,.resource,.player-score,.player-status,.player-meta,.player-summary) {color:var(--theme-muted);}
body[data-theme].playing-view .activity-panel :is(.activity-tabs,.log-item,.mobile-sheet-heading) {background:#f2f6fc;color:var(--theme-ink);border-color:var(--theme-line);}
body[data-theme].playing-view .activity-panel .chat input {background:#f8f9fd;color:var(--theme-ink);border-color:#d5dfed;}
body[data-theme].playing-view .activity-panel :is(.chat input::placeholder,.empty-state) {color:var(--theme-muted);}
body[data-theme].playing-view :is(.board-feedback,.dice-title,.dice-total,.dice-plus) {background:#fffdfaf2;color:var(--theme-ink);border-color:var(--theme-line);}
body[data-theme].playing-view :is(.mobile-sheet-heading,.mobile-overflow-trigger) {background:#f2f6fc;color:var(--theme-ink);border-color:var(--theme-line);}
body[data-theme] :is(.result-panel.victory-panel,.result-panel.victory-panel .victory-rank-card) {background:#fffdfa;color:var(--theme-ink);box-shadow:var(--theme-shadow);border-color:#d8cbe8;}
body[data-theme] .result-panel.victory-panel .victory-rank-card.rank-first {background:#fff1d7;border-color:#d8b26b;}
body[data-theme] .result-panel.victory-panel :is(.victory-title,.victory-subtitle,.victory-rank-player strong,.victory-rank-score,.victory-kicker) {color:var(--theme-ink);}
body[data-theme] .result-panel.victory-panel :is(.victory-match-summary,.victory-rank-number) {color:var(--theme-muted);}
body[data-theme] .result-panel.victory-panel #rematchChoice {background:var(--theme-blue);color:white;border-color:#365cae;}
body[data-theme] .result-panel.victory-panel #returnLobbyChoice {background:#f2f6fc;color:var(--theme-ink);}
body[data-theme] :is(.game-view:not(.playing-view) .topbar,.game-view:not(.playing-view) .waiting-room,.game-view:not(.playing-view) .top-actions.mobile-open,.game-view:not(.playing-view) .seat){background:#fffdfa;color:var(--theme-ink);border-color:var(--theme-line);}
body[data-theme] :is(.game-view:not(.playing-view) .mobile-overflow-trigger,.game-view:not(.playing-view) .top-actions.mobile-open .icon-button){background:#f2f6fc;color:var(--theme-ink);border-color:#d6e1ed;}
@media(max-width:760px){body[data-theme] #loginView{grid-template-columns:minmax(0,1fr);padding:12px;gap:14px;}body[data-theme] .auth-welcome{grid-column:1;grid-row:2;min-height:230px;padding:16px;background-position:70% 55%;}body[data-theme] .auth-welcome-copy{padding:14px;max-width:80%;}body[data-theme] .auth-welcome h2{font-size:27px;}body[data-theme] .auth-welcome p{font-size:13px;}body[data-theme] #loginView .auth-card{grid-column:1;grid-row:3;padding:20px;}body[data-theme] .auth-brand h1{font-size:23px;}}
@media(prefers-reduced-motion:reduce){body[data-theme] :is(button,.wake-spinner){transition:none;}}

/* Explicit countdown states survive the platform theme at every viewport. */
body[data-theme] .big-two-turn-progress[data-state='warning'] {background:#fff0bd;border-color:#d39d2d;}
body[data-theme] .big-two-turn-progress[data-state='warning'] #bigTwoProgressFill {background:#ffce55;}
body[data-theme] .big-two-turn-progress[data-state='urgent'] {background:#ffe2df;border-color:#d55b55;}
body[data-theme] .big-two-turn-progress[data-state='urgent'] #bigTwoProgressFill {background:#ff685a;}
body[data-theme] .big-two-status:has([data-state='warning']) #bigTwoTimer {color:#79501c;background:#fff0bd;}
body[data-theme] .big-two-status:has([data-state='urgent']) #bigTwoTimer {color:#a62e37;background:#ffe2df;}
body[data-theme] .big-two-game[data-view='result'] .big-two-callout {display:none;}
body[data-theme] .big-two-result {max-height:calc(100dvh - 68px);display:flex;flex-direction:column;}
body[data-theme] .big-two-result[hidden] {display:none;}
body[data-theme] #bigTwoResultContent {min-height:0;overflow-y:auto;}
body[data-theme] #bigTwoResultReadySeats {max-height:84px;overflow-y:auto;flex-shrink:0;}
body[data-theme] .big-two-result-actions,body[data-theme] #bigTwoRematchStatus {flex-shrink:0;}
body[data-theme] .big-two-result :is(p,li>span,#bigTwoRematchStatus) {min-width:0;overflow-wrap:anywhere;white-space:normal;}
body[data-theme] .big-two-result-players li>span:nth-child(2) small {display:block;}
body[data-theme] #bigTwoResultReadySeats>span {background:#fff0dc;border-radius:10px;padding:5px 8px;color:#79501c;overflow-wrap:anywhere;max-width:100%;}
body[data-theme] #bigTwoResultReadySeats>span[data-ready='true'] {background:#e5f7f0;color:#286b60;}
/* Public state cues share the cozy palette; never change readiness or turn rules. */
body[data-theme] :is(.big-two-seat,#bigTwoReady).needs-ready {border:2px solid #d49a3c;background:#fff2d7;animation:cozy-ready-attention 1.6s ease-in-out infinite;}
body[data-theme] .big-two-seat.needs-ready small {color:#80551d;font-weight:800;}
body[data-theme] .big-two-row-ready {display:inline-block!important;width:fit-content;max-width:100%;border:1px solid #d5a454;border-radius:8px;padding:3px 6px;background:#fff0d5;color:#79501c;font-weight:800;font-size:12px;line-height:1.3;}
body[data-theme] .big-two-row-ready[data-ready='true'] {background:#d7f3e6;border-color:#418675;color:#205d4f;}
body[data-theme] .big-two-result-players li:has(.big-two-row-ready[data-ready='true']) {border-color:#418675;box-shadow:inset 3px 0 #418675;}
body[data-theme] .big-two-opponent.is-acting {border:2px solid #448bc7;box-shadow:0 0 0 4px #b9dffd,0 0 28px 7px #689bcf77;animation:cozy-actor-halo 1.6s ease-in-out infinite;}
body[data-theme] .big-two-table.is-own-turn .big-two-own {filter:drop-shadow(0 0 12px #548dcf88);}
body[data-theme] .big-two-card-face {display:contents;}
body[data-theme] .big-two-play-group {display:flex;gap:inherit;align-items:center;justify-content:center;flex-wrap:inherit;max-width:100%;pointer-events:none;}
body[data-theme] .big-two-own.is-last-card .big-two-hand .big-two-card {position:relative;width:106px;height:144px;background:transparent;box-shadow:none;border-color:transparent;}
body[data-theme] .big-two-own.is-last-card .big-two-card-face {position:absolute;inset:0;display:grid;grid-template-rows:auto 1fr auto;padding:6px;border:2px solid #edc878;border-radius:7px;background:linear-gradient(135deg,#fffdf3,#e2d6c4);box-shadow:0 0 22px #eac15d66,0 6px 18px #0003;animation:cozy-final-card 1.6s ease-in-out infinite;transform-origin:50% 90%;pointer-events:none;}
@keyframes cozy-ready-attention {50%{box-shadow:0 0 0 4px #f2ca7866,0 0 18px #e2b56255;}}
@keyframes cozy-actor-halo {50%{box-shadow:0 0 0 6px #b9dffd,0 0 34px 10px #689bcf88;}}
@keyframes cozy-final-card {0%,100%{rotate:-2deg;}50%{rotate:2deg;}}
@media(max-width:700px){body[data-theme] .big-two-own.is-last-card .big-two-hand .big-two-card {width:72px;height:96px;}}
@media(max-width:950px) and (max-height:500px) and (orientation:landscape){body[data-theme] .big-two-own.is-last-card .big-two-hand .big-two-card {width:55px;height:65px;}}
@media(prefers-reduced-motion:reduce){body[data-theme] :is(.big-two-seat.needs-ready,#bigTwoReady.needs-ready,.big-two-opponent.is-acting,.big-two-own.is-last-card .big-two-card-face){animation:none;rotate:0deg;}}
@media(max-width:700px) and (orientation:portrait){
  body[data-theme] .big-two-result {padding:12px;}
  body[data-theme] .big-two-top {grid-template-columns:90px minmax(0,1fr);gap:6px;}
  body[data-theme] .big-two-top>button {grid-column:1;grid-row:1;}
  body[data-theme] .big-two-top>.big-two-tools {grid-column:2;grid-row:1;justify-self:end;}
  body[data-theme] .big-two-top>div:not(.big-two-tools) {grid-column:1/-1;grid-row:2;min-width:0;}
  body[data-theme] .big-two-top h1 {font-size:18px;line-height:1.3;overflow-wrap:anywhere;margin:0;}
  body[data-theme] .big-two-table {height:calc(100dvh - 104px);}
  body[data-theme] .big-two-center {top:auto;bottom:10px;transform:translateX(-50%);min-height:95px;}
  body[data-theme] .big-two-result-players li {grid-template-columns:34px minmax(0,1fr) 78px;align-items:center;gap:4px 7px;}
  body[data-theme] .big-two-result-players li>.big-two-avatar {grid-column:1;grid-row:1/3;}
  body[data-theme] .big-two-result-players li>span:nth-child(2) {grid-column:2;grid-row:1;font-size:15px;line-height:1.4;text-align:left;}
  body[data-theme] .big-two-result-players li>.big-two-winner-badge {grid-column:2;grid-row:2;line-height:1.4;text-align:left;}
  body[data-theme] .big-two-result-players li>strong {grid-column:3;grid-row:1/3;white-space:nowrap;font-size:17px;}
}

/* Catan's cat-pirate islands: soft ocean, cream translucent cabin panels. */
body[data-theme].playing-view {background:radial-gradient(ellipse at 18% 15%,#fff1d7aa,transparent 55%),repeating-radial-gradient(ellipse at 80% 95%,#def4f0 0 22px,#e9f8f5 23px 45px);}
body[data-theme] :is(#lobby,#game) .game-mark,body[data-theme] #lobby .mark {background:#fff1d7 url('/images/cat-pirate.svg') center/contain no-repeat;color:transparent;font-size:0;min-width:44px;min-height:44px;}
/* Structural panels contain viewport-fixed sheets; preserve their containing block. */
body[data-theme].playing-view :is(.context-panel,.player-rail,.activity-panel,.action-dock,.runtime-bar,.topbar,.game-sheet,dialog) {background:rgba(255,253,246,.88);border-color:#b5d7cf;}
body[data-theme].playing-view .board-panel {background:radial-gradient(ellipse at 50% 40%,#f7fff48c,#cdeae57a);border-color:#afd5cf;}
body[data-theme].playing-view :is(.identity-strip .player,.player-head,.player-details,.runtime-summary,.activity-panel .activity-view,.activity-panel #chatMessages,.activity-panel .log-item,.context-panel .turn-guide,.hand-bar,.dock-actions) {background:rgba(255,253,246,.64);border-color:#c3ded5;}
body[data-theme].playing-view :is(.activity-panel .activity-tabs,.mobile-sheet-heading,.top-actions.mobile-open) {background:rgba(255,253,246,.94);}
body[data-theme].playing-view :is(.trade-card,.development-card,.dice-card,.board-feedback) {background:rgba(255,249,235,.94);border-color:#dacdad;}
body[data-theme].playing-view :is(.turn-progress,.player-head strong,#guideOwner,#guideMessage) {overflow-wrap:anywhere;white-space:normal;}
body[data-theme] .robber-marker {pointer-events:none;}
/* The transparent canvas must not reveal the inactive 2D board underneath. */
body[data-theme] :is(#board,#board3d)[hidden] {display:none!important;}

/* Issue 119 section 56: one-screen settlement; decorative DEV character pool. */
body[data-theme] .big-two-result{padding:12px 18px;max-width:760px;max-height:none;gap:6px;}
body[data-theme] #bigTwoResultContent{overflow:visible;flex:none;}
body[data-theme] .big-two-result-columns,body[data-theme] .big-two-result-duration{display:none;}
body[data-theme] .big-two-result h2{font-size:32px;line-height:1.15;margin:0 0 4px;}
body[data-theme] .big-two-result p{font-size:16px;line-height:1.35;margin:4px 0 8px;}
body[data-theme] .big-two-result-players{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0;padding:0;}
body[data-theme] .big-two-result .big-two-result-players li{display:grid;grid-template-columns:32px minmax(0,1fr);grid-template-rows:auto auto;gap:4px 8px;min-height:0;margin:0;padding:10px;text-align:left;align-items:start;}
body[data-theme] .big-two-result .big-two-result-players .big-two-avatar{grid-column:1;grid-row:1;width:30px;height:30px;font-size:20px;}
body[data-theme] .big-two-result .big-two-result-players li .big-two-result-identity{grid-column:2;grid-row:1;font-size:15px;line-height:1.35;white-space:normal;overflow-wrap:anywhere;min-width:0;}
body[data-theme] .big-two-result .big-two-result-players li small{display:block;font-size:11px;line-height:1.3;}
body[data-theme] .big-two-result .big-two-result-players li .big-two-row-ready{display:block!important;padding:2px 0;}
body[data-theme] .big-two-result .big-two-result-players li .big-two-winner-badge{grid-column:1 / 3;grid-row:2;font-size:12px;align-self:center;justify-self:start;}
body[data-theme] .big-two-result .big-two-result-players li strong{grid-column:2;grid-row:2;justify-self:end;font-size:18px;line-height:1.4;white-space:nowrap;}
body[data-theme] #bigTwoRematchStatus{font-size:13px;line-height:1.3;margin:4px 0;}
body[data-theme] #bigTwoResultReadySeats:empty{display:none;}
body[data-theme] .big-two-result-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;width:100%;}
body[data-theme] #bigTwoRematch,body[data-theme] #bigTwoResultLeave{width:100%;min-height:44px;padding:8px;font-size:17px;margin:0;}
body[data-theme] .big-two-character{position:relative;isolation:isolate;overflow:visible;background:#ffe1b2;border:2px solid #ffd4a2;--fur:#edab6d;}
body[data-theme] .big-two-character[data-character='bobo']{--fur:#ffd0df;background:#fff0f6!important;}
body[data-theme] .big-two-character[data-character='mogi']{--fur:#aaa2d0;background:#ebe6ff!important;}
body[data-theme] .big-two-character[data-character='pochi']{--fur:#cba987;background:#dff5ff!important;}
.big-two-character .character-face{position:absolute;inset:20% 8% 14%;border-radius:45%;background:var(--fur);display:flex;justify-content:space-around;align-items:center;}
.character-face i{width:9%;height:13%;border-radius:50%;background:#463c60;}
.character-face b{position:absolute;bottom:2%;font-size:12px;color:#463c60;font-weight:normal;}
.character-ears{position:absolute;inset:5% 13% 55%;background:var(--fur);clip-path:polygon(0 0,35% 45%,65% 45%,100% 0,90% 100%,10% 100%);}
body[data-theme] .big-two-character[data-character='bobo'] .character-ears{inset:-12% 22% 50%;clip-path:polygon(0 0,30% 0,40% 100%,60% 100%,70% 0,100% 0,95% 100%,5% 100%);}
body[data-theme] .big-two-character[data-character='pochi'] .character-ears{border-radius:50%;clip-path:none;}
.big-two-character .character-placeholder{position:absolute;bottom:-2px;left:0;right:0;text-align:center;font-size:8px!important;line-height:10px!important;color:#493f69;background:#fff8e7;border-radius:5px;white-space:nowrap;}
.big-two-character[data-expression='thinking']{box-shadow:0 0 0 3px #ffd776;}
.big-two-character[data-expression='pass'] .character-face i{height:4%;border-radius:0;}
.big-two-character[data-expression='few-cards'] .character-face{background:color-mix(in srgb,var(--fur),#ff91ac 25%);}
@media(max-width:700px){
 body[data-theme] .big-two-result{padding:10px;margin:4px auto;gap:4px;}
 body[data-theme] .big-two-result h2{font-size:26px;}
 body[data-theme] .big-two-result p{font-size:13px;margin:3px 0 6px;}
 body[data-theme] .big-two-result-players{gap:6px;}
 body[data-theme] .big-two-result .big-two-result-players li{padding:7px;grid-template-columns:24px minmax(0,1fr);gap:3px 5px;}
 body[data-theme] .big-two-result .big-two-result-players .big-two-avatar{width:24px;height:24px;font-size:16px;}
 body[data-theme] .big-two-result .big-two-result-players li .big-two-result-identity{font-size:13px;}
 body[data-theme] .big-two-result .big-two-result-players li strong{font-size:16px;}
 body[data-theme] .big-two-result .big-two-result-players li .big-two-winner-badge{font-size:10px;}
}
@media(max-height:500px) and (orientation:landscape){
 body[data-theme] .big-two-result{padding:6px 12px;max-width:690px;margin:0 auto;gap:3px;}
 body[data-theme] .big-two-result h2{font-size:24px;}
 body[data-theme] .big-two-result p{font-size:12px;margin:2px 0 4px;}
 body[data-theme] .big-two-result-players{gap:4px 8px;}
 body[data-theme] .big-two-result .big-two-result-players li{padding:4px 8px;}
 body[data-theme] .big-two-result .big-two-result-players li .big-two-result-identity{font-size:12px;line-height:1.2;}
 body[data-theme] .big-two-result .big-two-result-players li small{font-size:10px;}
 body[data-theme] #bigTwoRematchStatus{font-size:11px;margin:2px 0;}
}@media(max-width:700px) and (max-height:650px) and (orientation:portrait){
 body[data-theme] .big-two-game[data-view='playing']{padding:6px 8px;}
 body[data-theme] .big-two-game[data-view='playing'] .big-two-top{gap:2px;}
 body[data-theme] .big-two-game[data-view='playing'] .big-two-top h1{font-size:12px;line-height:16px;}
 body[data-theme] .big-two-game[data-view='playing'] .big-two-table{height:calc(100dvh - 66px);min-height:0;grid-template-rows:minmax(237px,1fr) 35px 35px 140px 44px;gap:1px;}
 body[data-theme] .big-two-game[data-view='playing'] .big-two-hand{min-height:108px;padding-top:6px;}
}@media(max-width:700px) and (max-height:650px) and (orientation:portrait){
 body[data-theme] .big-two-game[data-view='playing'] .big-two-status{grid-template-columns:minmax(0,1fr) 40px;grid-template-rows:18px 10px;gap:2px 6px;align-items:center;width:100%;}
 body[data-theme] .big-two-game[data-view='playing'] #bigTwoTurn{grid-column:1;grid-row:1;font-size:12px;line-height:16px;}
 body[data-theme] .big-two-game[data-view='playing'] #bigTwoTurnProgress{grid-column:1;grid-row:2;width:100%;}
 body[data-theme] .big-two-game[data-view='playing'] #bigTwoTimer{grid-column:2;grid-row:1 / 3;font-size:12px;}
 body[data-theme] .big-two-game[data-view='playing'] .big-two-recent-history{height:35px;min-height:0;padding:2px 6px;}
 body[data-theme] .big-two-game[data-view='playing'] .big-two-recent-history h2{display:none;}
 body[data-theme] .big-two-game[data-view='playing'] .big-two-recent-history ol{max-height:29px;}
 body[data-theme] .big-two-game[data-view='playing'] .big-two-hand .big-two-card:not(:only-child){height:50px;}
 body[data-theme] .big-two-game[data-view='playing'] #bigTwoSelectionStatus{min-height:18px;line-height:18px;font-size:10px;}
 body[data-theme] .big-two-game[data-view='playing'] .big-two-near-win{font-size:11px;line-height:14px;margin-bottom:0;}
 body[data-theme] .big-two-game[data-view='playing'] .big-two-actions button{min-height:44px;font-size:17px;padding:4px;}
 body[data-theme] .big-two-game[data-view='playing'] .big-two-opponent[data-position='left'],body[data-theme] .big-two-game[data-view='playing'] .big-two-opponent[data-position='right']{top:40px;}
}@media(max-width:700px) and (max-height:650px) and (orientation:portrait){
 body[data-theme] .big-two-game[data-view='playing'] .big-two-own.is-last-card .big-two-card.is-selected{transform:translateY(-8px);}
 body[data-theme] .big-two-game[data-view='playing'] #bigTwoPlay{min-height:44px;font-size:17px;padding:4px;}
}.big-two-character[data-expression='play'] .character-face b{font-weight:900;color:#945372;}body[data-theme] .big-two-chat form{display:grid;grid-template-columns:minmax(0,1fr) 44px;gap:6px;width:100%;}
body[data-theme] .big-two-chat form input{width:100%;min-width:0;}
body[data-theme] .big-two-chat form button{width:44px;min-width:0;padding:8px;}
@media(max-width:700px){body[data-theme] .big-two-opponent .big-two-fan{transform:translateX(-50%) scale(.85);}}@media(max-width:700px) and (max-height:650px) and (orientation:portrait){body[data-theme] .big-two-game[data-view='playing'] .big-two-opponent{width:96px;}}@media(max-width:950px) and (max-height:500px) and (orientation:landscape){
 body[data-theme] .big-two-opponent.is-passed .big-two-player-state{font-size:11px;line-height:14px;padding:2px 4px;white-space:nowrap;}
}@media(max-width:700px) and (max-height:650px) and (orientation:portrait){
 body[data-theme] .big-two-game[data-view='playing'] .big-two-table{height:calc(100dvh - 68px);}
 body[data-theme] .big-two-game[data-view='playing'] .big-two-hand{padding:20px 0 0;min-height:122px;}
 body[data-theme] .big-two-game[data-view='playing'] .big-two-own.is-near-win .big-two-hand{min-height:104px;}
 body[data-theme] .big-two-game[data-view='playing'] .big-two-own.is-last-card .big-two-hand{padding:6px 0 0;min-height:108px;}
}/* Compact tablet arena keeps its seat labels, lead and cards inside the arena,
   including the taller final-card hand and persistent public PASS states. */
@media(min-width:701px) and (max-width:1099px) and (min-height:501px){
 body[data-theme] .big-two-opponent{width:185px;min-height:82px;grid-template-columns:44px minmax(0,1fr);padding:6px;gap:2px 8px;line-height:1.2;}
 body[data-theme] .big-two-opponent .big-two-avatar{width:44px;height:44px;}
 body[data-theme] .big-two-opponent strong{font-size:16px;line-height:20px;}
 body[data-theme] .big-two-opponent .big-two-card-count b{font-size:24px;line-height:28px;}
 body[data-theme] .big-two-opponent .big-two-player-state{font-size:11px;line-height:14px;}
 body[data-theme] .big-two-opponent.is-passed .big-two-player-state{font-size:11px;line-height:14px;padding:2px 4px;white-space:nowrap;}
 body[data-theme] .big-two-center{top:auto;bottom:4px;transform:translateX(-50%);min-height:90px;padding:4px;gap:2px;font-size:11px;line-height:14px;}
 body[data-theme] .big-two-center>small{font-size:11px;line-height:14px;}
 body[data-theme] .big-two-current-play{min-height:46px;}
 body[data-theme] .big-two-current-play .big-two-card{width:34px;height:46px;font-size:14px;padding:3px;}
 body[data-theme] .big-two-current-play .big-two-card .suit{font-size:22px;}
 body[data-theme] .big-two-current-play .big-two-table-mark{font-size:24px;line-height:1;}
}/* Short screens preserve public PASS text above the central lead. */
@media(max-width:700px) and (max-height:650px) and (orientation:portrait){
 body[data-theme] .big-two-game[data-view='playing'] .big-two-opponent strong{font-size:12px;line-height:14px;}
 body[data-theme] .big-two-game[data-view='playing'] .big-two-opponent .big-two-player-state{font-size:10px;line-height:12px;}
 body[data-theme] .big-two-game[data-view='playing'] .big-two-opponent.is-passed .big-two-player-state{font-size:10px;line-height:12px;padding:2px 3px;white-space:normal;}
}
@media(max-width:950px) and (max-height:500px) and (orientation:landscape){
 body[data-theme] .big-two-game[data-view='playing'] .big-two-opponent[data-position='top']{top:0;}
 body[data-theme] .big-two-game[data-view='playing'] .big-two-opponent{min-height:58px;padding:3px 6px;gap:0 6px;}
 body[data-theme] .big-two-opponent strong{font-size:13px;line-height:16px;}
 body[data-theme] .big-two-opponent .big-two-card-count b{font-size:20px;line-height:22px;}
 body[data-theme] .big-two-opponent .big-two-player-state{font-size:11px;line-height:14px;}
 body[data-theme] .big-two-opponent.is-passed .big-two-player-state{padding:0 4px;white-space:nowrap;}
 body[data-theme] .big-two-center{top:auto;bottom:2px;transform:translateX(-50%);width:46%;min-height:82px;padding:3px;gap:2px;font-size:11px;line-height:14px;}
 body[data-theme] .big-two-center>small{font-size:11px;line-height:12px;}
 body[data-theme] .big-two-current-play{min-height:44px;}
 body[data-theme] .big-two-current-play .big-two-card{width:32px;height:44px;font-size:13px;padding:3px;}
 body[data-theme] .big-two-current-play .big-two-table-mark{font-size:24px;line-height:1;}
}/* Section 60: persistent celebration leads, while all four records stay visible. */
body[data-theme] .big-two-result-hero{display:flex;align-items:center;justify-content:center;gap:16px;padding:16px 18px;margin:0 0 12px;border:1px solid #e6ddf7;border-radius:24px;background:#f3efff;min-width:0;}
body[data-theme] .big-two-result-heading{min-width:0;}
body[data-theme] .big-two-result-hero h2{font-size:36px;color:#55436f;}
body[data-theme] .big-two-result-hero p{margin:4px 0 0;overflow-wrap:anywhere;}
body[data-theme] .big-two-result .big-two-result-emblem{display:flex;align-items:center;justify-content:center;flex:0 0 88px;width:88px;height:88px;line-height:1;font-size:64px;color:#8b76b2;filter:none;}
body[data-theme] .big-two-result.is-self-win .big-two-result-hero{border-color:#f1c577;background:radial-gradient(ellipse at 22% 45%,#fff3b0,transparent 58%),linear-gradient(110deg,#fff9e7,#ffe8d7 65%,#ffe6ef);box-shadow:inset 0 0 24px #fff8c8,0 4px 16px #edb96625;}
body[data-theme] .big-two-result.is-self-win .big-two-result-hero h2{color:#956124;text-shadow:0 2px #fff8d9;}
body[data-theme] .big-two-result.is-self-win .big-two-result-emblem{font-size:72px;filter:drop-shadow(0 4px 6px #e5ac4d70);background:radial-gradient(circle,#fff9c5,transparent 70%);}
body[data-theme] .big-two-result.is-self-win .big-two-result-hero::after{content:"✦";font-size:30px;color:#e9b64e;pointer-events:none;}
@media(max-width:700px){
 body[data-theme] .big-two-result-hero{gap:8px;padding:10px 8px;margin-bottom:8px;border-radius:18px;}
 body[data-theme] .big-two-result-hero h2{font-size:28px;}
 body[data-theme] .big-two-result .big-two-result-emblem{flex-basis:56px;width:56px;height:64px;font-size:44px;}
 body[data-theme] .big-two-result.is-self-win .big-two-result-emblem{font-size:52px;}
 body[data-theme] .big-two-result.is-self-win .big-two-result-hero::after{font-size:18px;}
}
@media(max-height:500px) and (orientation:landscape){
 body[data-theme] .big-two-result-hero{gap:10px;padding:4px 12px;margin-bottom:4px;border-radius:16px;}
 body[data-theme] .big-two-result-hero h2{font-size:26px;margin:0;}
 body[data-theme] .big-two-result .big-two-result-emblem{flex-basis:52px;width:52px;height:52px;font-size:40px;}
 body[data-theme] .big-two-result.is-self-win .big-two-result-emblem{font-size:46px;}
}

/* Finishing-hand notes keep their own space above the PASS/Play hit targets. */
@media(max-width:700px) and (min-height:651px) and (orientation:portrait){
 body[data-theme] .big-two-own.is-near-win .big-two-near-win{margin-bottom:0;}
 body[data-theme] .big-two-own.is-near-win .big-two-hand{min-height:118px;}
}
@media(max-width:950px) and (max-height:500px) and (orientation:landscape){
 body[data-theme] .big-two-table:has(.big-two-own.is-near-win:not(.is-last-card)){grid-template-rows:145px 42px 84px 40px;}
 body[data-theme] .big-two-own.is-near-win:not(.is-last-card){position:relative;}
 body[data-theme] .big-two-own.is-near-win:not(.is-last-card) .big-two-hand{padding-top:20px;min-height:84px;}
 body[data-theme] .big-two-own.is-near-win:not(.is-last-card) :is(.big-two-near-win,#bigTwoSelectionStatus){position:absolute;left:8px;width:clamp(44px,calc((100% - 418px)/2),110px);margin:0;text-align:center;line-height:13px;}
 body[data-theme] .big-two-own.is-near-win:not(.is-last-card) .big-two-near-win{top:5px;}
 body[data-theme] .big-two-own.is-near-win:not(.is-last-card) #bigTwoSelectionStatus{top:27px;}
}
/* Normal landscape hands reserve their preview note above all3 controls. */
@media(max-width:950px) and (max-height:500px) and (orientation:landscape){
 body[data-theme] .big-two-game[data-view='playing'] .big-two-table:not(:has(.big-two-own.is-near-win)){grid-template-rows:145px 42px 84px 44px;}
 body[data-theme] .big-two-game[data-view='playing'] .big-two-own:not(.is-near-win) #bigTwoSelectionStatus{line-height:14px;margin:2px 0;}
}
/* Multi-row phone hands leave a clear gap between the preview note and controls. */
@media(max-width:700px) and (orientation:portrait){
 body[data-theme] .big-two-game[data-view='playing'] .big-two-own:not(.is-near-win) #bigTwoSelectionStatus{min-height:16px;line-height:16px;}
}
