:root{--theme-bg:#f4f5ed;--theme-surface:#e8eddf;--theme-raised:#f5f6ec;--theme-ink:#183f39;--theme-muted:#53624d;--theme-border:#b9c8ae;--theme-header:#193e38;--theme-header-ink:#fff8df;--theme-felt:#3d7962;--theme-felt-ink:#fff8df;--theme-accent:#234f3d;--theme-accent-ink:#ffffff;--theme-highlight:#edc650;--theme-glow:#3d7962;color-scheme:light;}
html[data-theme="aurora"]{--theme-bg:#f8f0ec;--theme-surface:#f1e1da;--theme-raised:#fff8f1;--theme-ink:#412b3c;--theme-muted:#68495b;--theme-border:#B48EAD;--theme-header:#633847;--theme-header-ink:#fff8f1;--theme-felt:#A3BE8C;--theme-felt-ink:#25301f;--theme-accent:#783c4b;--theme-accent-ink:#ffffff;--theme-highlight:#783c4b;--theme-glow:#D08770;color-scheme:light;}
html[data-theme="snow"]{--theme-bg:#ECEFF4;--theme-surface:#E5E9F0;--theme-raised:#ffffff;--theme-ink:#2E3440;--theme-muted:#4C566A;--theme-border:#b0bdcf;--theme-header:#D8DEE9;--theme-header-ink:#2E3440;--theme-felt:#D8DEE9;--theme-felt-ink:#2E3440;--theme-accent:#434C5E;--theme-accent-ink:#ffffff;--theme-highlight:#434C5E;--theme-glow:#D8DEE9;color-scheme:light;}
html[data-theme="polar"]{--theme-bg:#2E3440;--theme-surface:#3B4252;--theme-raised:#434C5E;--theme-ink:#ECEFF4;--theme-muted:#D8DEE9;--theme-border:#69768d;--theme-header:#2E3440;--theme-header-ink:#ECEFF4;--theme-felt:#434C5E;--theme-felt-ink:#ECEFF4;--theme-accent:#D8DEE9;--theme-accent-ink:#2E3440;--theme-highlight:#ECEFF4;--theme-glow:#4C566A;color-scheme:dark;}
html[data-theme="meadow"]{--theme-bg:#efeeb4;--theme-surface:#e5e7a7;--theme-raised:#f6f4d5;--theme-ink:#353d52;--theme-muted:#454d66;--theme-border:#7a864f;--theme-header:#454d66;--theme-header-ink:#efeeb4;--theme-felt:#309975;--theme-felt-ink:#092219;--theme-accent:#454d66;--theme-accent-ink:#efeeb4;--theme-highlight:#454d66;--theme-glow:#58b368;color-scheme:light;}
html[data-theme="electric"]{--theme-bg:#17164a;--theme-surface:#252466;--theme-raised:#343090;--theme-ink:#f1f4ff;--theme-muted:#c1d6ff;--theme-border:#6592fd;--theme-header:#17164a;--theme-header-ink:#f1f4ff;--theme-felt:#343090;--theme-felt-ink:#ecf4ff;--theme-accent:#44c2fd;--theme-accent-ink:#11204d;--theme-highlight:#44c2fd;--theme-glow:#8c61ff;color-scheme:dark;}
html[data-theme="berry"]{--theme-bg:#141f49;--theme-surface:#1f306e;--theme-raised:#263b7f;--theme-ink:#ffeff7;--theme-muted:#eac5df;--theme-border:#af6699;--theme-header:#141f49;--theme-header-ink:#ffeff7;--theme-felt:#1f306e;--theme-felt-ink:#ffeff7;--theme-accent:#f5487f;--theme-accent-ink:#210b15;--theme-highlight:#f5487f;--theme-glow:#c7417b;color-scheme:dark;}
/* The selector is shared by setup and both game modes. */
.appearance-dialog{width:min(650px,calc(100vw - 28px));max-height:calc(100dvh - 28px);overflow:auto;background:var(--theme-raised);color:var(--theme-ink);border-color:var(--theme-border);padding:30px;}
.appearance-dialog p{color:var(--theme-muted);font-size:14px;margin:0 0 22px;}
.appearance-dialog .eyebrow,.appearance-dialog .modal-close{color:var(--theme-muted)}
.appearance-dialog::backdrop{background:#101426a6;backdrop-filter:blur(5px);animation:menu-backdrop .22s ease-out}
.theme-options{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:0;padding:0;border:0}
.theme-option{position:relative;display:block;cursor:pointer;min-width:0}
.theme-option input{position:absolute;opacity:0;width:1px;height:1px;margin:0}
.theme-option-content{display:block;border:2px solid var(--theme-border);border-radius:12px;background:var(--theme-surface);padding:14px;transition:background-color .25s,border-color .25s,box-shadow .25s}
.theme-option-title{display:block;font-size:14px;font-weight:700;padding-right:22px;line-height:1.35;min-height:38px;color:var(--theme-ink)}
.theme-swatches{height:33px;display:flex;overflow:hidden;border-radius:6px;border:1px solid #0002;margin-top:5px}
.theme-swatches>span{flex:1;min-width:0}
.theme-option input:checked+.theme-option-content{border-color:var(--theme-accent);box-shadow:0 0 0 1px var(--theme-accent)}
.theme-option input:checked+.theme-option-content:after{content:'✓';position:absolute;top:12px;right:12px;border-radius:50%;width:23px;height:23px;display:grid;place-items:center;font-size:14px;background:var(--theme-accent);color:var(--theme-accent-ink)}
.theme-option input:focus-visible+.theme-option-content{outline:3px solid var(--theme-accent);outline-offset:3px}
.appearance-dialog .primary{background:var(--theme-accent);color:var(--theme-accent-ink)}
.theme-sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
@media(max-width:450px){.appearance-dialog{padding:24px 18px}.theme-options{gap:10px}.theme-option-content{padding:10px}.theme-option-title{font-size:13px;min-height:36px}.theme-option input:checked+.theme-option-content:after{top:8px;right:8px;width:19px;height:19px}.header-actions{gap:6px}.header-actions .icon-button{width:32px;height:32px;flex-shrink:0}.topbar{padding-inline:14px;gap:12px}.header-actions .mode-link{max-width:82px}.edition,.header-divider{display:none}}
html[data-theme]:not([data-theme="classic"]){background:var(--theme-bg);color:var(--theme-ink)}
html[data-theme]:not([data-theme="classic"]) body{background:var(--theme-bg);color:var(--theme-ink)}
html[data-theme]:not([data-theme="classic"]) .topbar{background:var(--theme-header);color:var(--theme-header-ink)}
html[data-theme]:not([data-theme="classic"]) .topbar :is(.edition,.mode-link,.icon-button){color:var(--theme-header-ink)}
html[data-theme]:not([data-theme="classic"]) .topbar .language-switch{background:transparent;border-color:color-mix(in srgb,var(--theme-header-ink),transparent 65%)}
html[data-theme]:not([data-theme="classic"]) .topbar .language-switch button{color:var(--theme-header-ink)}
html[data-theme]:not([data-theme="classic"]) .topbar .language-switch button[aria-pressed="true"]{background:var(--theme-header-ink);color:var(--theme-header)}
html[data-theme]:not([data-theme="classic"]) :is(.game,.online-panel,.solo-setup){background:var(--theme-surface);background-image:radial-gradient(ellipse at 50% 40%,color-mix(in srgb,var(--theme-glow),transparent 87%),transparent 68%);border-color:var(--theme-border)}
html[data-theme]:not([data-theme="classic"]) :is(dialog,.game-menu-button){background:var(--theme-raised);color:var(--theme-ink);border-color:var(--theme-border)}
html[data-theme]:not([data-theme="classic"]) :is(.eyebrow,.round-label,.player-details>span,.your-info #hand-count,.you-tag,.uno-area>span,.dealer-tag,footer,.fan-note,footer b,.room-size-label,.online-panel p,.entry-form small,.entry-divider,#lobby-players small,#network-status,.room-rule small,#rules-owner-note,.rule-option small,dialog p,dialog li,.modal-close,.result-score small,.solo-setup p){color:var(--theme-muted)}
html[data-theme]:not([data-theme="classic"]) .round-label b{color:var(--theme-ink)}
html[data-theme]:not([data-theme="classic"]) :is(.secondary,.outline-button,.room-rules,.room-rule,#lobby-players li,.game-menu .room-toolbar){border-color:var(--theme-border)}
html[data-theme]:not([data-theme="classic"]) :is(.secondary,.outline-button):hover{background:var(--theme-raised)}
html[data-theme]:not([data-theme="classic"]) :is(.primary,.pass-button,.uno-reaction .primary){background:var(--theme-accent);color:var(--theme-accent-ink)}
html[data-theme]:not([data-theme="classic"]) .uno-button{background:var(--theme-accent);color:var(--theme-accent-ink);border-color:color-mix(in srgb,var(--theme-accent),var(--theme-ink) 25%)}
html[data-theme]:not([data-theme="classic"]) .online-panel input{background:var(--theme-raised);color:var(--theme-ink);border-color:var(--theme-border)}
html[data-theme]:not([data-theme="classic"]) input::placeholder{color:var(--theme-muted);opacity:.85}
html[data-theme]:not([data-theme="classic"]) :is(.room-rule input,.rule-option input,.batch-uno input){accent-color:var(--theme-accent)}
html[data-theme]:not([data-theme="classic"]) :is(button,a,input):focus-visible{outline-color:var(--theme-accent)}
html[data-theme]:not([data-theme="classic"]) .entry-divider:before{background:var(--theme-border)}
html[data-theme]:not([data-theme="classic"]) .entry-divider span{background:var(--theme-surface)}
html[data-theme]:not([data-theme="classic"]) .mode{background:var(--theme-raised);color:var(--theme-ink)}
html[data-theme]:not([data-theme="classic"]) :is(.mode i,.turn-notice i){background:var(--theme-accent)}
html[data-theme]:not([data-theme="classic"]) .felt{background:var(--theme-felt);border-color:var(--theme-raised);box-shadow:0 0 0 1px var(--theme-border),0 8px 0 color-mix(in srgb,var(--theme-surface),#000 18%),0 15px 24px #0002,inset 0 0 60px color-mix(in srgb,var(--theme-glow),transparent 85%)}
html[data-theme]:not([data-theme="classic"]) .felt :is(.current-color,.pile-caption){color:var(--theme-felt-ink)}
html[data-theme]:not([data-theme="classic"]) .table-brand{color:var(--theme-felt-ink);opacity:.1}
html[data-theme]:not([data-theme="classic"]) .route-track{stroke:var(--theme-felt-ink)}
html[data-theme]:not([data-theme="classic"]) :is(.route-flow,.route-arrow){stroke:var(--theme-felt-ink)}
html[data-theme]:not([data-theme="classic"]) .dealer-deck .pile-caption{color:var(--theme-ink)}
html[data-theme]:not([data-theme="classic"]) .table-bottom{background:var(--theme-bg);color:var(--theme-muted);border-color:var(--theme-border)}
html[data-theme]:not([data-theme="classic"]) .turn-ring{border-color:var(--theme-highlight);box-shadow:0 0 0 3px color-mix(in srgb,var(--theme-highlight),transparent 80%),0 0 18px color-mix(in srgb,var(--theme-highlight),transparent 65%)}
html[data-theme]:not([data-theme="classic"]) .draw-cue{background:var(--theme-highlight);color:var(--theme-surface);border-color:var(--theme-raised)}
html[data-theme]:not([data-theme="classic"]) .draw-card-slot::before{border-color:var(--theme-highlight);background:color-mix(in srgb,var(--theme-highlight),transparent 94%);box-shadow:0 0 18px 5px color-mix(in srgb,var(--theme-highlight),transparent 75%)}
html[data-theme]:not([data-theme="classic"]) :is(.color-announcement,.dealer-laugh){background:var(--theme-raised);color:var(--theme-ink);border-color:var(--theme-border)}
html[data-theme]:not([data-theme="classic"]) .color-picked{color:var(--theme-muted)}
html[data-theme]:not([data-theme="classic"]) .language-switch{background:var(--theme-surface);border-color:var(--theme-border)}
html[data-theme]:not([data-theme="classic"]) .language-switch button{color:var(--theme-ink)}
html[data-theme]:not([data-theme="classic"]) .language-switch button[aria-pressed="true"]{background:var(--theme-accent);color:var(--theme-accent-ink)}
html[data-theme]:not([data-theme="classic"]) :is(.connection-message,.uno-reaction){background:var(--theme-raised);color:var(--theme-ink);border-color:var(--theme-accent)}
html[data-theme]:not([data-theme="classic"]) .called-toast{color:var(--theme-ink)!important}
html[data-theme]:not([data-theme="classic"]) .uno-badge{color:var(--theme-ink)}
html[data-theme]:not([data-theme="classic"]) .uno-missed{background:var(--theme-accent);color:var(--theme-accent-ink)}
html[data-theme]:not([data-theme="classic"]) .form-error{color:var(--theme-error,#993447)!important}
html[data-theme]:not([data-theme="classic"]) #lobby-players .text-button{color:var(--theme-error,#993447)}
html[data-theme]:not([data-theme="classic"]) .ai-badge{color:var(--theme-muted)!important;border-color:var(--theme-border)}
html[data-theme]:not([data-theme="classic"]) .hand.large-hand{scrollbar-color:var(--theme-border) transparent}
/* Animate only interface colors; card flight and turn animations keep their own timing. */
@media(prefers-reduced-motion:no-preference){
 html,body,.topbar,.game,.felt,.online-panel,.solo-setup,dialog,.table-bottom,.game-menu-button{transition:background-color .35s ease,color .35s ease,border-color .35s ease}
}
html[data-theme="polar"],html[data-theme="electric"],html[data-theme="berry"]{--theme-error:#ffb3c8}
@media(prefers-reduced-motion:reduce){.theme-option-content{transition:none}.appearance-dialog::backdrop{animation:none}}
@media(max-width:450px){.topbar{height:auto;min-height:86px;flex-wrap:wrap;padding-block:12px}.header-actions{max-width:100%;flex-wrap:wrap;justify-content:flex-end}}
