/* Theme tokens: identical game geometry and controls, distinct surfaces and light. */
html[data-theme=cyber]{color-scheme:dark;--theme-bg:#080e20;--theme-panel:#101b30;--theme-raised:#18243a;--theme-line:#2d4e66;--theme-ink:#dbeeff;--theme-muted:#9fb3c7;--theme-accent:#62e9ee;--theme-secondary:#d27bff;--theme-button:#10364b;--theme-glow:#31dfee35;--theme-paper:linear-gradient(140deg,#11273c,#111a30);--theme-back:radial-gradient(ellipse at 80% 10%,#ad21ce29,transparent 48%),radial-gradient(ellipse at 10% 70%,#00ccff24,transparent 55%),repeating-linear-gradient(0deg,transparent 0 43px,#33e5ee0c 44px 45px),repeating-linear-gradient(90deg,transparent 0 43px,#33e5ee0c 44px 45px),#080e20}
html[data-theme=noir]{color-scheme:dark;--theme-bg:#110e12;--theme-panel:#20191f;--theme-raised:#2d2029;--theme-line:#63414e;--theme-ink:#f3e8e8;--theme-muted:#c3aab2;--theme-accent:#dfa0ad;--theme-secondary:#b68b67;--theme-button:#612738;--theme-glow:#9d34402c;--theme-paper:linear-gradient(140deg,#2b2026,#18151a);--theme-back:radial-gradient(ellipse at 50% 0%,#7d1e334a,transparent 65%),repeating-linear-gradient(35deg,#ffffff02 0 1px,transparent 1px 4px),linear-gradient(130deg,#0c0a0e,#24131b 55%,#100c10)}
html[data-theme]:not([data-theme=dream]){--ink:var(--theme-ink);--txt:var(--theme-ink);--muted:var(--theme-muted);--dim:var(--theme-muted);--purple:var(--theme-accent);--pink:var(--theme-secondary);--line:var(--theme-line);--surface:var(--theme-panel);--bg:var(--theme-bg);--card:var(--theme-panel);--card2:var(--theme-raised);--acc:var(--theme-accent);--accent:var(--theme-accent);--shadow:#0005;background:var(--theme-bg)}
html[data-theme]:not([data-theme=dream]) body{color:var(--theme-ink);background:var(--theme-back);background-attachment:fixed}
html[data-theme]:not([data-theme=dream]) body:before{background:var(--theme-back)}
html[data-theme]:not([data-theme=dream]) body:after{background:linear-gradient(180deg,transparent,#0002)}
html[data-theme]:not([data-theme=dream]) :is(.join-card,.card,.surface,.panel,.login-card,.modal-card,dialog,.float-panel,.room-rule-group,.compact-default-section,.room-builder-footer,.submit-bar){background:var(--theme-panel)!important;border-color:var(--theme-line)!important;color:var(--theme-ink)!important;box-shadow:0 10px 30px #0003}
html[data-theme]:not([data-theme=dream]) :is(input:not([type=checkbox]),textarea,select,.inp){background:var(--theme-bg)!important;border-color:var(--theme-line)!important;color:var(--theme-ink)!important}
html[data-theme]:not([data-theme=dream]) :is(button,.btn,.icon-btn,.role-btn,.pool-chip,.my-score-chip,.timer-pill,.turn-dice,.mode-status,.badge,.pill,.room-base-row,.generator,.template-inspector,.tile,.quick-values button){background:var(--theme-raised);border-color:var(--theme-line);color:var(--theme-ink);box-shadow:none}
html[data-theme]:not([data-theme=dream]) :is(.btn.primary,.btn.p,button.primary,.modes [aria-pressed=true],.room-mode-options [aria-pressed=true]){background:var(--theme-button)!important;border:1px solid var(--theme-accent)!important;color:var(--theme-ink)!important;box-shadow:0 0 16px var(--theme-glow)!important}
html[data-theme]:not([data-theme=dream]) :is(.btn.ghost,.btn.g,.btn.secondary,.text-button,.link-button){background:transparent;color:var(--theme-accent)}
html[data-theme]:not([data-theme=dream]) :is(h1,h2,h3,h4,label,.seq,.turn-name,.task-copy,.task-quantity,.stage-label,.lbl,.room-section-title,.setting-title label,.person-name,.score,.nick,.role-name,.room-rule-field,.room-mode-options strong){color:var(--theme-ink)!important}
html[data-theme]:not([data-theme=dream]) :is(.muted,small,.sub,.note,.tnote,.pdesc,.r-desc,.stage-note,.room-builder-head p,.room-base-row>span,.room-board-meta,.room-mode-options small,.stage-foot,.task-meta,.task-payout){color:var(--theme-muted)!important}
html[data-theme]:not([data-theme=dream]) :is(.board-wrap,.stage-center){background:var(--theme-paper)!important;border-color:var(--theme-line)!important;box-shadow:inset 0 1px 0 #ffffff12,0 0 25px var(--theme-glow)!important}
html[data-theme]:not([data-theme=dream]) .cell{background:var(--theme-paper)!important;border-color:var(--theme-line)!important;box-shadow:inset 0 1px 0 #ffffff15,0 3px 8px #0004}
html[data-theme]:not([data-theme=dream]) .cell.landed{border-color:var(--theme-accent)!important;box-shadow:0 0 18px var(--theme-glow)}
html[data-theme]:not([data-theme=dream]) .board-route polyline{stroke:var(--theme-accent);filter:drop-shadow(0 0 3px var(--theme-accent))}
html[data-theme]:not([data-theme=dream]) .brand h1{color:var(--theme-ink);text-shadow:0 0 14px var(--theme-glow)}
html[data-theme]:not([data-theme=dream]) .dream-aura{background:radial-gradient(ellipse,var(--theme-glow),transparent 65%)}
html[data-theme]:not([data-theme=dream]) .dream-lights i{background:var(--theme-accent);box-shadow:0 0 8px var(--theme-accent)}
html[data-theme]:not([data-theme=dream]) :is(.join-heading h1,.join-heading p,.brand-moon,.join-moon){color:var(--theme-accent);text-shadow:0 0 16px var(--theme-glow)}
html[data-theme]:not([data-theme=dream]) .join-character{filter:saturate(.6) drop-shadow(0 0 14px var(--theme-glow))}
html[data-theme]:not([data-theme=dream]) .role-portrait{filter:saturate(.55) contrast(1.1)}
html[data-theme]:not([data-theme=dream]) .sidebar{background:var(--theme-bg);border-right:1px solid var(--theme-line)}
html[data-theme]:not([data-theme=dream]) .login-shell{background:var(--theme-back)}
html[data-theme]:not([data-theme=dream]) :is(.lib-table td,.lib-table th,.question-row,.table-footer,.toolbar,.bulk-selection,.pack-toolbar){background:var(--theme-panel);border-color:var(--theme-line);color:var(--theme-ink)}
html[data-theme]:not([data-theme=dream]) :is(.board-choice.game-cell,.board-choice.function-cell){background:var(--theme-panel)!important;border-color:var(--theme-line)!important}
html[data-theme]:not([data-theme=dream]) .board-choice.function-cell{background:var(--theme-raised)!important}
html[data-theme]:not([data-theme=dream]) :is(#sheet-scoring,.room-builder-head,.room-section-title,.room-setup-section,.room-advanced,.room-builder-body,.room-builder-footer){border-color:var(--theme-line)!important}
html[data-theme]:not([data-theme=dream]) #sheet-scoring{background:var(--theme-raised)}
html[data-theme]:not([data-theme=dream]) #room-create-dialog :is(input,select,.room-rule-group,.room-base-row){background:var(--theme-raised)!important;color:var(--theme-ink)!important;border-color:var(--theme-line)!important}
html[data-theme]:not([data-theme=dream]) #room-create-dialog .room-mode-options button{background:var(--theme-raised);color:var(--theme-ink);border-color:var(--theme-line)}
html[data-theme]:not([data-theme=dream]) #room-create-dialog :is(h2,h3,label,.room-rule-group h4){color:var(--theme-ink)}
html[data-theme=cyber] .cell{border-radius:7px}.theme-option[data-pick-theme=cyber]{border-radius:8px}
html[data-theme=cyber] .brand h1{font-family:ui-monospace,'PingFang SC',sans-serif;letter-spacing:1px}
html[data-theme=cyber] .board-wrap{border-radius:12px;border-left:2px solid #62e9ee!important;border-right:2px solid #bb66ea!important}
html[data-theme=cyber] .dream-meteors i{background:linear-gradient(90deg,transparent,#5bf1ff)}
html[data-theme=noir] .board-wrap{border-radius:15px;border-style:double;border-width:3px}
html[data-theme=noir] .cell{border-radius:9px;border-top-color:#9f7881!important}
html[data-theme=noir] .dream-lights{opacity:.4}html[data-theme=noir] .dream-meteors{display:none}
html[data-theme=noir] .brand h1{font-family:Georgia,'Songti SC',serif;letter-spacing:2px}
#game-room-title{white-space:normal;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;line-height:1.2;font-size:clamp(17px,5vw,25px)}
.tb-right{flex-shrink:0}.theme-trigger{white-space:nowrap}.join-theme-trigger{position:absolute;right:4px;top:4px;font-size:12px}.join-heading{position:relative}
.theme-dialog{width:min(540px,calc(100vw - 24px));max-height:90svh;padding:18px;border:1px solid #e3d6f0;border-radius:16px;background:#faf6ff;color:#47315f}.theme-dialog::backdrop{background:#130f2277;backdrop-filter:blur(5px)}.theme-dialog header{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}.theme-dialog h2{font-size:17px;margin:0}.theme-dialog p{font-size:12px;margin:3px 0 0}.theme-dialog header button{width:32px;height:32px;border:0;border-radius:8px;font-size:22px;background:#eadef8;color:#765592}.theme-options,.account-theme-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.theme-option{display:flex;flex-direction:column;gap:6px;text-align:left;min-width:0;border:1px solid #d9c9e8;border-radius:10px;background:#fff;padding:9px;color:#503a68;cursor:pointer}.theme-option strong{font-size:14px}.theme-option small{font-size:11px;color:#907ba1}.theme-option[aria-pressed=true]{outline:2px solid #ae87d1;outline-offset:1px}.theme-preview{height:65px;width:100%;display:grid;grid-template-columns:repeat(4,1fr);gap:6px;padding:14px 9px;border-radius:6px}.theme-preview i{border:1px solid #fff9;border-radius:5px;background:#ffffff33;box-shadow:0 0 10px #fff2}.theme-preview[data-swatch=dream]{background:linear-gradient(125deg,#b4a9ee,#eeb5d8)}.theme-preview[data-swatch=cyber]{background:repeating-linear-gradient(90deg,transparent 0 19px,#42deff15 19px 20px),linear-gradient(130deg,#072d40,#27183d)}.theme-preview[data-swatch=cyber] i{border-color:#53eff5;background:#42e4ff15;border-radius:2px;box-shadow:0 0 8px #13cdff66}.theme-preview[data-swatch=noir]{background:linear-gradient(125deg,#121014,#4d2330)}.theme-preview[data-swatch=noir] i{border-color:#b18489;background:#201519;box-shadow:inset 0 1px #ddbbc755}.account-appearance{max-width:850px;margin-bottom:16px}.account-appearance>p{margin:5px 0 14px}.account-theme-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.creator-entry{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-top:16px;padding-top:12px;border-top:1px solid var(--line)}.creator-entry a{color:var(--acc,#936cc0);font-size:13px}#theme-status{margin:10px 0 0;font-size:12px}#theme-status:empty{display:none}@media(max-width:420px){.account-theme-grid{grid-template-columns:1fr}.tb-right{gap:4px}.tb-right .theme-trigger{padding:5px 7px}}
html[data-theme]:not([data-theme=dream]) :is(.turn-name,.stage-label,.stage-note,.timer-pill,.dice-result,.mode-status){text-shadow:none;color:var(--theme-ink)}
html[data-theme]:not([data-theme=dream]) .board-wrap:before{border-color:var(--theme-accent);box-shadow:0 0 14px var(--theme-glow),inset 0 0 9px var(--theme-glow)}
html[data-theme]:not([data-theme=dream]) .board-wrap:after{background:var(--theme-accent);box-shadow:0 0 9px 3px var(--theme-glow)}
html[data-theme]:not([data-theme=dream]) .lobby-requirements{background:var(--theme-raised);color:var(--theme-muted);border:1px solid var(--theme-line)}
html[data-theme]:not([data-theme=dream]) .lobby-requirements b{color:var(--theme-accent)}
html[data-theme]:not([data-theme=dream]) .tabs button{background:transparent;color:var(--theme-muted)}
html[data-theme]:not([data-theme=dream]) .tabs button.on{background:var(--theme-raised);color:var(--theme-accent);box-shadow:inset 3px 0 var(--theme-accent)}
html[data-theme]:not([data-theme=dream]) :is(#lib-body,.question-sheet-head,.question-card,.question-card:hover,.question-card:focus-within,.pack-toolbar,.quick-score-panel,.import-panel,.defaults-save-bar,.layout-controls,.room-default-preview){background:var(--theme-panel)!important;color:var(--theme-ink);border-color:var(--theme-line)!important}
html[data-theme]:not([data-theme=dream]) .question-card:has(.question-select:checked){background:var(--theme-raised)!important}
html[data-theme]:not([data-theme=dream]) :is(.question-sheet-head,.table-footer,.quick-score-panel summary,.room-create-panel){color:var(--theme-muted)}
html[data-theme]:not([data-theme=dream]) .question-card :is(input:not([type=checkbox]),textarea){background:transparent!important}
html[data-theme]:not([data-theme=dream]) .tier-badge{background:var(--theme-raised)!important;border:1px solid var(--theme-line)}
html[data-theme]:not([data-theme=dream]) :is(.tier-easy,select[data-difficulty=easy]){color:#82d9b6!important}
html[data-theme]:not([data-theme=dream]) :is(.tier-normal,select[data-difficulty=normal]){color:#e8c879!important}
html[data-theme]:not([data-theme=dream]) :is(.tier-hard,select[data-difficulty=hard]){color:#f2a4be!important}
html[data-theme]:not([data-theme=dream]) select[data-kind=truth]{color:#f2a4cf!important}
html[data-theme]:not([data-theme=dream]) select[data-kind=dare]{color:#c9b2fa!important}
