:root{color-scheme:light;--theme-panel:#fff;--theme-text:#2c3e50;--theme-muted:#64748b;--theme-line:#dde1e7}
html[data-app-theme="dark"]{color-scheme:dark;--bg:#090b0e;--white:#16191f;--primary:#e7eaf0;--text:#e7eaf0;--text-muted:#a0a8b5;--border:#3b424d;--accent:#829bb5;--primary-bg:#ffffff0a;--header-bg:#11151b;--theme-panel:#16191f;--theme-text:#e7eaf0;--theme-muted:#a0a8b5;--theme-line:#3b424d}
html[data-app-theme="dark"] :is(.btn-sm-primary,.btn-search,.btn-send-mulligan,.deck-badge),html[data-app-theme="dark"] #mobileToggle{background:#344353;color:#e7eaf0}
html[data-app-theme="dark"] .effect-box{background:#232830}
html[data-app-theme="dark"] .result-limit-note{color:var(--accent)}
html[data-app-theme="dark"] .inkable-cost{box-shadow:0 0 5px #829bb566}
html[data-app-theme="dark"] :is(.card.selected,.card.moving){box-shadow:0 0 0 3px #829bb566!important}
html[data-app-theme="dark"] .theme-settings-trigger:focus-visible{outline-color:var(--accent)}
html[data-app-theme="dark"] .theme-mode-option:has(input:checked){border-color:var(--accent);background:#829bb512}
html[data-app-theme="dark"] .theme-mode-option input{accent-color:var(--accent)}
html[data-app-theme="dark"] .deck-bulk-delete-bar{background:#16191ff5}
html[data-app-theme="dark"] .view-tabs{background:#151b24}
html[data-app-theme="dark"] :is(.field-mode-btn.on,.pill.on,.radio-btn.on,.deck-view-btn.active,.chart-mode-btn.active,.btn-draw,.scroll-top-btn,.cost-jump-btn:hover,.deck-ctrl-btn:hover){background:#344353;color:#fff;border-color:#46505e}
html[data-app-theme="dark"] .deck-color-filter-btn.active{background:#344353;color:#fff}
html[data-app-theme="dark"] :is(input,select,textarea){background:#101318;color:#e7eaf0;border-color:#343a44}
.deck-card-item-title .deck-name-marquee{max-width:100%}
.deck-card-item-title > .btn-sm-outline{position:relative}
html[data-app-theme="dark"] .deck-thumbnails{background:#232830}
html[data-app-theme="dark"] .deck-name-inner{color:#e7eaf0}
html[data-app-theme="dark"] .list-panel-header{background:#16191f}
html[data-app-theme="dark"] #btn-scroll-top{background:#344353;color:#fff}
#btn-scroll-top{bottom:calc(68px + env(safe-area-inset-bottom))}
.theme-settings-trigger{position:fixed;right:14px;bottom:calc(14px + env(safe-area-inset-bottom));z-index:90;width:44px;height:44px;display:grid;place-items:center;border:1px solid var(--theme-line);border-radius:50%;background:var(--theme-panel);color:var(--theme-text);box-shadow:0 3px 12px #0002;cursor:pointer;touch-action:manipulation;transition:opacity .2s ease,visibility .2s ease}
.theme-settings-trigger svg{width:22px;height:22px}
.theme-settings-trigger.near-list-bottom{opacity:0;visibility:hidden;pointer-events:none}
@media(prefers-reduced-motion:reduce){.theme-settings-trigger{transition:none}}
.theme-settings-trigger:focus-visible{outline:3px solid #f39c12;outline-offset:3px}
#theme-settings{width:min(360px,calc(100vw - 28px));max-height:calc(100dvh - 40px);overflow:auto;margin:auto;padding:22px;border:1px solid var(--theme-line);border-radius:18px;background:var(--theme-panel);color:var(--theme-text);box-shadow:0 18px 70px #0005}
#theme-settings::backdrop{background:#0006}
.theme-settings-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:20px}
.theme-settings-head h2{font-size:19px;margin:0}
.theme-settings-close{width:36px;height:36px;border:0;border-radius:50%;background:transparent;color:inherit;font-size:25px;cursor:pointer}
#theme-settings fieldset{border:0;padding:0;margin:0}
#theme-settings legend{font-size:13px;font-weight:700;margin-bottom:10px}
.theme-mode-option{display:flex;gap:12px;align-items:center;padding:13px 12px;border:1px solid var(--theme-line);border-radius:10px;cursor:pointer;margin-bottom:8px;font-size:14px}
.theme-mode-option:has(input:checked){border-color:#f39c12;background:#f39c1212}
.theme-mode-option input{width:18px;height:18px;accent-color:#f39c12;flex-shrink:0}
.theme-mode-option span{display:flex;flex-direction:column;gap:3px}
.theme-mode-option small{font-size:11px;color:var(--theme-muted);font-weight:400}
.theme-settings-note{font-size:12px;color:var(--theme-muted);line-height:1.7;margin-top:14px}
@media(max-width:520px){.theme-settings-trigger{right:10px;bottom:calc(10px + env(safe-area-inset-bottom))}}
/* Neutral actions remain distinct from primary and destructive actions. */
:root{--neutral-button-bg:#e8edf2;--neutral-button-border:#cbd5df;--neutral-button-text:#344353;--neutral-button-pressed:#d8e1ea}
html[data-app-theme="dark"]{--neutral-button-bg:#252d37;--neutral-button-border:#465362;--neutral-button-text:#e7eaf0;--neutral-button-pressed:#303c4a}
:root :is(.btn-sm-outline,.filter-reset-btn,.btn-clear,.btn-game-back,.btn-align-toggle,.sort-dir,.btn-deselect-all,.deck-ctrl-btn,.cost-jump-btn,.deck-view-btn:not(.active),.chart-mode-btn:not(.active),.theme-settings-close):not(.deck-invalid-btn){background:var(--neutral-button-bg);border-color:var(--neutral-button-border);color:var(--neutral-button-text)}
@media(hover:hover) and (pointer:fine){:root :is(.btn-sm-outline,.filter-reset-btn,.btn-clear,.btn-game-back,.btn-align-toggle,.sort-dir,.btn-deselect-all,.deck-ctrl-btn,.cost-jump-btn,.deck-view-btn:not(.active),.chart-mode-btn:not(.active),.theme-settings-close):not(.deck-invalid-btn):hover:not(:disabled){background:var(--neutral-button-pressed)}}
:root :is(.btn-sm-outline,.filter-reset-btn,.btn-clear,.btn-game-back,.btn-align-toggle,.sort-dir,.btn-deselect-all,.deck-ctrl-btn,.cost-jump-btn,.deck-view-btn:not(.active),.chart-mode-btn:not(.active),.theme-settings-close):not(.deck-invalid-btn):active:not(:disabled){background:var(--neutral-button-pressed)}
html[data-app-theme="dark"] .deck-card-item-actions > .btn-sm-primary{background:#397f82;color:#fff}
@media(hover:hover) and (pointer:fine){html[data-app-theme="dark"] .deck-card-item-actions > .btn-sm-primary:hover:not(:disabled){background:#306b6e}}
html[data-app-theme="dark"] .deck-card-item-actions > .btn-sm-primary:active:not(:disabled){background:#306b6e}

/* Theme-aware return action and compact right-aligned table controls. */
.solo-view-host .solo-select-decks{box-sizing:border-box;min-height:48px;padding:12px 20px;border:1px solid #cbd5df;border-radius:12px;background:#e8edf2;color:#344353;font-weight:700;box-shadow:0 3px 10px #1824331a;cursor:pointer;transition:background .16s,border-color .16s,box-shadow .16s,transform .16s}
@media(hover:hover) and (pointer:fine){.solo-view-host .solo-select-decks:hover{background:#d8e1ea;border-color:#aebdcb;box-shadow:0 5px 14px #18243326;transform:translateY(-1px)}}
.solo-view-host .solo-select-decks:active{background:#d8e1ea;transform:translateY(0)}
.solo-view-host .solo-select-decks:focus-visible{outline:3px solid #829bb5;outline-offset:3px}
.solo-view-host .solo-select-decks::after{content:"→";display:inline-block;margin-left:12px;font-size:1.1em}
html[data-app-theme="dark"] .solo-view-host .solo-select-decks{border-color:#465362;background:#344353;color:#e7eaf0;box-shadow:0 4px 14px #0005}
@media(hover:hover) and (pointer:fine){html[data-app-theme="dark"] .solo-view-host .solo-select-decks:hover{background:#397f82;border-color:#5b999b;box-shadow:0 6px 18px #0006}}
html[data-app-theme="dark"] .solo-view-host .solo-select-decks:active{background:#306b6e}
html[data-app-theme="dark"] .solo-view-host .solo-select-decks:focus-visible{outline-color:#829bb5}
.solo-view-host .solo-select-decks[hidden]{display:none}
.btn-sm-danger.deck-delete-button{display:inline-flex;align-items:center;justify-content:center;min-width:40px;min-height:36px;padding:7px 10px;background:#ce4040;border:1px solid #ce4040;color:#fff;opacity:1}
.deck-delete-button svg{display:block;width:20px;height:20px;flex-shrink:0;pointer-events:none}
@media(hover:hover) and (pointer:fine){.btn-sm-danger.deck-delete-button:hover{background:#b73535;border-color:#b73535;color:#fff}}
.btn-sm-danger.deck-delete-button:active{background:#a82f2f;border-color:#a82f2f;color:#fff}
#view-game.mulligan-unselected > :not(#mulligan-empty){display:none!important}
#mulligan-empty{width:100%;flex:1;overflow:auto}
.solo-empty .deck-guidance-line{display:block;word-break:normal;overflow-wrap:anywhere;text-wrap:pretty}
