/* Soft Ice is also the no-JavaScript fallback. */
:root {
    --scheme:light;
    --bg:#e5e9e7;
    --bg-card:#f0f2f0;
    --bg-input:#dfe5e1;
    --text:#203432;
    --text-muted:#4f625b;
    --primary:#a12e3d;
    --primary-hover:#852535;
    --accent:#256c52;
    --accent-hover:#19533e;
    --border:#b9c7bf;
    --danger:#a72b3c;
    --warning:#795209;
    --success:var(--accent);
    --info:#235e78;
    --tint-primary:#e9d9dd;
    --tint-success:#d4e4da;
    --tint-warning:#ece0c1;
    --tint-info:#d8e3e9;
    --on-primary:#fff;
    --on-accent:#fff;
    --on-danger:#fff;
    --overlay:rgba(16,29,26,.6);
    --shadow:0 12px 40px rgba(20,35,30,.2);
    --hero-filter:brightness(.9);
    --hero-wash:rgba(229,233,231,.75);
}
:root[data-scheme=dark] {
    --scheme:dark;
    --bg:#191c20;
    --bg-card:#24282d;
    --bg-input:#2d3238;
    --text:#e3e6e7;
    --text-muted:#b0b8bc;
    --primary:#e6a0a9;
    --primary-hover:#efbac1;
    --accent:#9ccbb7;
    --accent-hover:#b6decc;
    --border:#485058;
    --danger:#f2a0ad;
    --warning:#dbbf81;
    --info:#a0c8dd;
    --tint-primary:#423038;
    --tint-success:#293e36;
    --tint-warning:#40392b;
    --tint-info:#2d3c48;
    --on-primary:#261b20;
    --on-accent:#162a22;
    --on-danger:#291b20;
    --overlay:rgba(0,0,0,.72);
    --shadow:0 12px 40px rgba(0,0,0,.4);
    --hero-filter:brightness(.22);
    --hero-wash:rgba(25,28,32,.45);
}
:root[data-theme=forest] {
    --bg:#19231f;
    --bg-card:#25312b;
    --bg-input:#303e35;
    --text:#e1e7dd;
    --text-muted:#b2c0b4;
    --primary:#d8bc85;
    --primary-hover:#e7cfa5;
    --accent:#9bc9ac;
    --accent-hover:#b5dbc3;
    --border:#4b5d50;
    --tint-primary:#433b2b;
    --tint-success:#304539;
    --tint-info:#2a4045;
}
:root[data-theme=mist] {
    --bg:#e0e6eb;
    --bg-card:#ecf0f3;
    --bg-input:#d7e1e8;
    --text:#273541;
    --text-muted:#536371;
    --primary:#365f83;
    --primary-hover:#284b6b;
    --accent:#795243;
    --accent-hover:#603e32;
    --border:#b4c3cf;
    --tint-primary:#d0deea;
    --tint-success:#e7dcd5;
    --tint-info:#d0e1e7;
}
:root[data-theme=rose] {
    --bg:#e9e0e3;
    --bg-card:#f2ebed;
    --bg-input:#e4d8dd;
    --text:#3c3038;
    --text-muted:#6c5662;
    --primary:#8c395b;
    --primary-hover:#702b49;
    --accent:#376a64;
    --accent-hover:#2a534e;
    --border:#cdb9c2;
    --tint-primary:#e5ced8;
    --tint-success:#d4e1dc;
}
:root[data-theme=contrast] {
    --bg:#080808;
    --bg-card:#141414;
    --bg-input:#222;
    --text:#fff;
    --text-muted:#d0d0d0;
    --primary:#f2d572;
    --primary-hover:#ffe9a0;
    --accent:#80dfd6;
    --accent-hover:#b0f2ec;
    --border:#818181;
    --danger:#ffb0b0;
    --warning:#f2d572;
    --info:#aad7ff;
    --tint-primary:#38321b;
    --tint-success:#183b36;
    --tint-warning:#38321b;
    --tint-info:#223746;
    --hero-filter:brightness(.12);
}
html, .app-ui { color-scheme:var(--scheme); }
.app-ui .display-settings { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-left:auto; }
.app-ui .theme-control { display:flex; align-items:center; gap:6px; margin:0; font-size:12px; }
.app-ui .theme-control[hidden] { display:none; }
.app-ui .theme-control select { width:auto; max-width:140px; padding:6px 8px; font-size:12px; }
.app-ui .language-form { margin:0; }
.app-ui input::placeholder, .app-ui textarea::placeholder { color:var(--text-muted); }
.app-ui .btn-outline, .app-ui .pool-card { border-color:var(--border); }
/* Switch button foregrounds and backgrounds together when changing theme. */
.app-ui .btn { transition:none; }
.app-ui .pool-card:hover { background:var(--bg-input); }
.app-ui .btn-primary, .app-ui .filter-btn.active, .app-ui .roster-tab.active,
.app-ui .chat-input-row button, .app-ui .roster-round-tabs button.active,
.app-ui .round-tab-btn.active, .app-ui .pos-tab-btn.active,
.app-ui .stat-toggle-group a.active, .app-ui .player-summary-nav button.active,
.app-ui .player-summary-toggle button.active, .app-ui .game-filter-buttons button.active { color:var(--on-primary); }
.app-ui .draft-btn { color:var(--on-accent); }
.app-ui .draft-btn:hover { background:var(--accent-hover); }
.app-ui .btn-danger { color:var(--on-danger); }
.app-ui .btn-danger:hover { background:var(--danger); filter:brightness(.9); }
.app-ui .draft-toast.success, .app-ui #global-toast { background:var(--accent) !important; color:var(--on-accent) !important; }
.app-ui .draft-toast.error { background:var(--danger); color:var(--on-danger); }
.app-ui .rookie-icon, .app-ui .game-status-pill.processing { color:var(--info); }
.app-ui .research-badge { border-color:var(--border); }
.app-ui .home-ice { filter:var(--hero-filter); }
.app-ui.showcase-site .home-primary { color:var(--on-primary); }
@media(max-width:768px) {
    .app-ui > nav .display-settings { order:1; }
    .app-ui .theme-control span { display:none; }
    .app-ui .theme-control select { max-width:125px; }
}
@media(max-width:420px) {
    .app-ui > nav .display-settings { flex-basis:100%; justify-content:flex-end; }
}
