/* Shared palettes. Dark preserves the default night-driving design. */
:root { --theme-on-accent:#03131f; --theme-field:#071b2e; --theme-shadow:#02091466; --theme-success-bg:#12392d; --theme-success-ink:#a5f0cc; --theme-error-bg:#351627; --theme-error-ink:#ffc1d2; --theme-warning-bg:#332a19; --theme-warning-ink:#efd49e; }
:root[data-theme="noir"] { --paper:#090a0c; --surface:#141519; --raised:#222429; --ink:#f2f2f4; --accent:#d8dbe2; --lavender:#b9bec8; --muted:#adb0ba; --line:#35383f; --neon:#a6afc0; --theme-field:#0e0f12; --theme-on-accent:#101115; color-scheme:dark; }
:root[data-theme="light"] { --paper:#eef3f9; --surface:#ffffff; --raised:#e1eaf4; --ink:#12253c; --accent:#006699; --lavender:#684cbd; --muted:#50657e; --line:#c4d2e1; --neon:#087fb8; --positive:#087c48; --danger:#b8204e; --theme-field:#f5f8fc; --theme-on-accent:#ffffff; --theme-shadow:#253e5b1a; --theme-success-bg:#e0f4e8; --theme-success-ink:#12643b; --theme-error-bg:#fbe7ef; --theme-error-ink:#982749; --theme-warning-bg:#fff3d8; --theme-warning-ink:#795411; color-scheme:light; }
:root[data-theme="green"] { --paper:#061410; --surface:#0e241b; --raised:#17392a; --ink:#edf9f1; --accent:#6cf1aa; --lavender:#b4df9c; --muted:#a0c1af; --line:#2b5540; --neon:#21b97d; --theme-field:#081b13; --theme-on-accent:#052016; color-scheme:dark; }
:root[data-theme="neon"] { --paper:#13081f; --surface:#231033; --raised:#39194f; --ink:#fff0ff; --accent:#ff7de9; --lavender:#9be7ff; --muted:#c4a3d0; --line:#633279; --neon:#cc33ff; --theme-field:#180b25; --theme-on-accent:#250a2e; color-scheme:dark; }
:root[data-theme="legacy"] { --paper:#14121c; --surface:#211d2b; --raised:#2c2638; --ink:#f7f3eb; --accent:#b8f5a2; --lavender:#d0b3ff; --muted:#a59daf; --line:#332c40; --neon:#b998ea; --theme-field:#17131f; --theme-on-accent:#18301b; color-scheme:dark; }

.theme-control { position:relative; flex:none; min-width:0; }
.theme-button { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:44px; padding:10px 12px; border:1px solid var(--line); border-radius:12px; background:var(--surface); color:var(--ink); font:600 12px/1.3 var(--body); white-space:nowrap; }
.theme-button:hover,.theme-button[aria-expanded="true"] { border-color:var(--accent); background:var(--raised); }
.theme-button>svg { flex:none; width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; }
.theme-button>svg circle { fill:currentColor; stroke:none; }
.theme-button:focus-visible,.theme-option:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.theme-picker { position:fixed; z-index:1100; width:min(272px,calc(100vw - 24px)); max-height:calc(100dvh - 32px); padding:8px; overflow-y:auto; overscroll-behavior:contain; border:1px solid var(--line); border-radius:15px; background:var(--surface); color:var(--ink); box-shadow:0 16px 48px var(--theme-shadow); text-align:start; }
.theme-option { display:flex; align-items:center; gap:12px; width:100%; min-height:44px; padding:8px 10px; border:0; border-radius:9px; background:transparent; color:var(--ink); font:600 13px/1.4 var(--body); text-align:start; }
.theme-option:hover,.theme-option:focus-visible { background:var(--raised); }
.theme-option[aria-checked="true"] { background:var(--raised); color:var(--accent); }
.theme-option-label { flex:1; min-width:0; }
.theme-option-check { visibility:hidden; flex:none; font-size:16px; }
.theme-option[aria-checked="true"] .theme-option-check { visibility:visible; }
.theme-swatch { display:block; flex:none; width:42px; height:26px; border:1px solid #80808055; border-radius:7px; background:linear-gradient(120deg,#050b16 0 42%,#13253b 43% 75%,#59c9ff 76%); }
.theme-swatch-noir { background:linear-gradient(120deg,#090a0c 0 42%,#222429 43% 75%,#d8dbe2 76%); }
.theme-swatch-light { background:linear-gradient(120deg,#eef3f9 0 42%,#ffffff 43% 75%,#006699 76%); }
.theme-swatch-green { background:linear-gradient(120deg,#061410 0 42%,#17392a 43% 75%,#6cf1aa 76%); }
.theme-swatch-neon { background:linear-gradient(120deg,#13081f 0 42%,#39194f 43% 75%,#ff7de9 76%); }
.theme-swatch-legacy { background:linear-gradient(120deg,#14121c 0 42%,#2c2638 43% 75%,#b8f5a2 76%); }
.theme-swatch-dynamic { background:linear-gradient(120deg,#050b16 0 47%,#eef3f9 48% 78%,#59c9ff 79%); }
.topup-header:has(.theme-control) { grid-template-columns:minmax(0,1fr) auto auto auto; }
@media(max-width:1050px) { .game-header .theme-button { width:44px; padding:10px; } .game-header .theme-button>span { display:none; } }
@media(max-width:650px) { .theme-button { width:44px; padding:10px; } .theme-button>span { display:none; } .topup-header:has(.theme-control) { grid-template-columns:minmax(0,1fr) minmax(0,1fr); } .topup-header .theme-control { grid-column:2; grid-row:2; justify-self:end; } }
@media(max-width:600px) { .game-header .theme-control { grid-column:2; grid-row:2; justify-self:end; } .game-header .language-control { width:calc(100% - 54px); justify-self:start; } .profile-header .theme-control { grid-column:1; grid-row:3; justify-self:start; } .auth-page-header .theme-control { justify-self:end; } .contact-header:has(.theme-control),.fair-header:has(.theme-control),.wallet-admin-header:has(.theme-control) { grid-template-columns:minmax(0,1fr) auto; } .contact-header>.button,.fair-header>.button,.wallet-admin-header>.button { grid-column:1; grid-row:2; justify-self:start; } }
@media(prefers-reduced-motion:reduce) { .theme-button,.theme-option { transition:none; } }

/* Apply alternate palettes to existing page surfaces without touching game art,
   banknote denominations, QR contrast or crypto/network brand colors. */
html[data-theme]:not([data-theme="dark"]) body { background:radial-gradient(ellipse at 8% 12%,color-mix(in srgb,var(--neon) 10%,transparent),transparent 50%),var(--paper); color:var(--ink); }
html[data-theme]:not([data-theme="dark"]) :is(.game-panel,.game-tabs,.activity-feed,.site-dialog,.player-menu-panel,.profile-access,.profile-identity,.profile-level-card,.profile-stat,.profile-referrals,.topup-card,.topup-create,.topup-signin,.contact-card,.fair-card,.fair-signin,.admin-metric,.wallet-admin-directory,.wallet-admin-detail,.wallet-admin-confirm,.wallet-admin-access,.wallet-admin-wallet) { background:var(--surface); border-color:var(--line); color:var(--ink); box-shadow:0 12px 36px var(--theme-shadow); }
html[data-theme]:not([data-theme="dark"]) :is(#upgrader-panel,#roulette-panel) { background:var(--surface); border-color:var(--line); }
html[data-theme]:not([data-theme="dark"]) :is(.header-usd-balance,.topup-header-balance,.header-profile,.header-bonus,.upgrader-choice,.upgrader-adjustments,.profile-level-chip,.profile-referral-claim,.topup-payment-amount,.topup-address-box,.topup-watch,.topup-access,.topup-deposit,.blackjack-table,.plinko-stage,.rocket-stage,.roulette-stage,.roulette-summary,.upgrader-stage,.welcome-bonus-result,.welcome-signup-reward,.welcome-account-reward,.wallet-admin-account,.wallet-admin-transfer-status) { background:var(--raised); border-color:var(--line); color:var(--ink); box-shadow:none; }
html[data-theme]:not([data-theme="dark"]) :is(.button-dark,.header-deposit,.topup-page .button-dark,.auth-page .form-submit,.welcome-bonus-primary,.wallet-admin-page .button-dark,.roulette-spin,#upgrader-panel .upgrader-spin) { background:var(--accent); border-color:var(--accent); color:var(--theme-on-accent); box-shadow:none; }
html[data-theme]:not([data-theme="dark"]) :is(.button-dark,.header-deposit,.topup-page .button-dark,.auth-page .form-submit,.welcome-bonus-primary,.wallet-admin-page .button-dark,.roulette-spin,#upgrader-panel .upgrader-spin):hover:not(:disabled) { background:color-mix(in srgb,var(--accent) 84%,var(--ink)); }
html[data-theme]:not([data-theme="dark"]) :is(.button-outline,.player-menu-button,.sound-toggle,.topup-icon-button,.topup-copy,.topup-quick-amount,.topup-crypto-option,.topup-network-option,.wallet-admin-copy,.wallet-admin-page .button-outline,.blackjack-stake-shortcuts button,.blackjack-play-actions button,.plinko-risk-options button,.roulette-stake-shortcuts button,.roulette-bet-option,.rocket-input-shell,.game-info-panel,.cookie-section,.auth-input-shell,.auth-google,.stake-slider-control) { background:var(--theme-field); border-color:var(--line); color:var(--ink); box-shadow:none; }
html[data-theme]:not([data-theme="dark"]) :is(.player-menu-item:hover,.button-outline:hover,.header-bonus:hover,.topup-crypto-option:hover,.topup-network-option:hover,.topup-copy:hover) { background:var(--raised); border-color:var(--accent); }
html[data-theme]:not([data-theme="dark"]) :is(.topup-crypto-option[aria-pressed="true"],.topup-network-option[aria-pressed="true"],.topup-quick-amount[aria-pressed="true"],.wallet-admin-account[aria-pressed="true"],.game-tab[aria-selected="true"]) { background:var(--raised); border-color:var(--accent); color:var(--accent); box-shadow:inset 0 0 0 1px var(--accent); }
html[data-theme]:not([data-theme="dark"]) :is(.form-field>input,.topup-form input,.topup-form select,.language-control select,.game-wager-row input,.blackjack-wager-label input,.fair-card input,.fair-card textarea,.fair-card select,.wallet-admin-page input,.wallet-admin-page select,.wallet-admin-page textarea) { background:var(--theme-field); border-color:var(--line); color:var(--ink); }
html[data-theme]:not([data-theme="dark"]) input::placeholder,html[data-theme]:not([data-theme="dark"]) textarea::placeholder { color:var(--muted); }
html[data-theme]:not([data-theme="dark"]) :is(.header-usd-label,.header-profile-level,.profile-eyebrow,.profile-member,.profile-next-level,.profile-progress-summary span,.profile-progress-remaining,.profile-level-details summary,.profile-stat h2,.profile-stat-unavailable,.profile-stat-unit,.profile-referral-code>span,.profile-referral-stats span,.profile-referral-claim span,.profile-referral-details summary,.profile-updated,.topup-section-heading>span,.topup-balance-label,.topup-choice-meta,.topup-amount-minimum,.topup-amount-wrap>span,.topup-small-note,.topup-form label>span,.topup-address-heading p,.topup-qr-caption>p,.topup-watch p,.topup-order-reference,.topup-footer,.activity-feed-status,.activity-feed-empty,.activity-feed-time,.activity-feed-game,.activity-feed-heading,.activity-feed-pause,.visitor-stats,.player-menu-name,.rocket-status,.rocket-orbit-label,.blackjack-hand-heading h3,.fair-intro,.fair-action-status,.fair-proof-summary,.fair-details summary,.wallet-admin-intro,.wallet-admin-count,.wallet-admin-account-email,.wallet-admin-account-meta,.wallet-admin-wallet-state,.wallet-admin-network-label,.wallet-admin-assets-unlisted,.wallet-admin-asset-note,.wallet-admin-wallet-message,.wallet-admin-copy-status,.wallet-admin-manage-status,.wallet-admin-form-status,.wallet-admin-review-note,.wallet-admin-confirm>p) { color:var(--muted); }
html[data-theme]:not([data-theme="dark"]) :is(.topup-choice-name,.topup-network-choice h3,.topup-payment-context h3,.topup-address-heading h3,.topup-form label,.topup-form-status,.topup-order-reference code,.topup-address-box code,.profile-referral-code>code,.profile-referral-stats strong,.profile-referral-url,.profile-referral-copy-status,.profile-referral-claim-status,.fair-card label,.fair-card .fair-hash,.wallet-admin-search label,.wallet-admin-controls label,.wallet-admin-profile>p,.wallet-admin-address,.wallet-admin-controls legend,#upgrader-panel .upgrader-card-top h3) { color:var(--ink); }
html[data-theme]:not([data-theme="dark"]) :is(.topup-usd-total,.topup-payment-amount strong,.topup-eyebrow,.topup-signin-symbol,.profile-referral-rate,.profile-referral-claim strong,.header-profile-avatar,.profile-icon,.wallet-admin-eyebrow) { color:var(--accent); }
html[data-theme]:not([data-theme="dark"]) :is(.profile-avatar,.profile-avatar-spark) { background:var(--accent); border-color:var(--line); color:var(--theme-on-accent); box-shadow:none; }
html[data-theme]:not([data-theme="dark"]) :is(.profile-icon,.header-profile-avatar,.profile-referral-rate,.profile-referral-url,.topup-network-note,.fair-chip,.blackjack-total) { background:var(--raised); border-color:var(--line); color:var(--accent); }
html[data-theme]:not([data-theme="dark"]) .profile-progress::-webkit-progress-bar { background:var(--raised); }
html[data-theme]:not([data-theme="dark"]) .profile-progress::-webkit-progress-value { background:var(--accent); }
html[data-theme]:not([data-theme="dark"]) .profile-progress::-moz-progress-bar { background:var(--accent); }
html[data-theme]:not([data-theme="dark"]) :is(.upgrader-rim,.upgrader-hub,.roulette-rim,.roulette-hub,.welcome-bonus-rim,.welcome-bonus-hub) { fill:var(--surface); stroke:var(--line); }
html[data-theme]:not([data-theme="dark"]) #upgrader-panel :is(.upgrader-rim,.upgrader-hub) { fill:var(--surface); stroke:var(--line); }
html[data-theme]:not([data-theme="dark"]) :is(.upgrader-pointer,.welcome-bonus-pointer) { fill:var(--ink); }
html[data-theme]:not([data-theme="dark"]) :is(.upgrader-pointer-line,.rocket-chart-axis,.rocket-chart-guide,.plinko-rails) { stroke:var(--line); }
html[data-theme]:not([data-theme="dark"]) #upgrader-panel .upgrader-pointer { fill:var(--ink); }
html[data-theme]:not([data-theme="dark"]) #upgrader-panel .upgrader-pointer-line { stroke:var(--ink); }
html[data-theme]:not([data-theme="dark"]) :is(.rocket-axis-label,.plinko-peg) { fill:var(--muted); }
html[data-theme]:not([data-theme="dark"]) .plinko-pocket:not(.is-active) rect { fill:var(--raised); stroke:var(--line); }
html[data-theme]:not([data-theme="dark"]) .plinko-pocket:not(.is-active) text { fill:var(--ink); }
html[data-theme]:not([data-theme="dark"]) .plinko-pocket.is-active text { fill:var(--theme-on-accent); }
html[data-theme]:not([data-theme="dark"]) :is(.topup-notification,.topup-order-status[data-status="credited"],.topup-deposit-state[data-status="credited"]) { background:var(--theme-success-bg); border-color:var(--positive); color:var(--theme-success-ink); }
html[data-theme]:not([data-theme="dark"]) :is(.topup-order-status,.topup-deposit-state,.topup-watch.is-unavailable) { background:var(--theme-warning-bg); border-color:var(--theme-warning-ink); color:var(--theme-warning-ink); }
html[data-theme]:not([data-theme="dark"]) :is(.topup-order-status[data-status="confirmed"],.topup-deposit-state[data-status="confirmed"]) { background:var(--raised); border-color:var(--accent); color:var(--accent); }
html[data-theme]:not([data-theme="dark"]) :is(.topup-order-status[data-status="credited"],.topup-deposit-state[data-status="credited"]) { background:var(--theme-success-bg); border-color:var(--positive); color:var(--theme-success-ink); }
html[data-theme]:not([data-theme="dark"]) :is(.topup-order-status[data-status="rejected"],.topup-deposit-state[data-status="rejected"],.topup-deposit-state[data-status="failed"],.wallet-admin-badge.is-rejected) { background:var(--theme-error-bg); border-color:var(--danger); color:var(--theme-error-ink); }
html[data-theme]:not([data-theme="dark"]) .backdrop-shade { background:linear-gradient(180deg,color-mix(in srgb,var(--paper) 88%,transparent),color-mix(in srgb,var(--paper) 74%,transparent) 45%,var(--paper)); }
html[data-theme]:not([data-theme="dark"]) .backdrop-sweep { background:linear-gradient(110deg,transparent 40%,color-mix(in srgb,var(--accent) 12%,transparent) 50%,transparent 60%); }
html[data-theme]:not([data-theme="dark"]) .site-header::after,html[data-theme]:not([data-theme="dark"]) .site-backdrop::after { background:linear-gradient(90deg,transparent,var(--line),transparent); border-color:var(--line); }
html[data-theme="noir"] .backdrop-scene { filter:grayscale(1); opacity:.16; }
html[data-theme="light"] .backdrop-scene { filter:grayscale(.5); opacity:.14; }
html[data-theme="green"] .backdrop-scene { filter:grayscale(1) sepia(.7) hue-rotate(85deg) saturate(1.8); }
html[data-theme="neon"] .backdrop-scene { filter:grayscale(1) sepia(.7) hue-rotate(230deg) saturate(2.3); }
html[data-theme="legacy"] .backdrop-scene { filter:none; opacity:.2; }
html[data-theme="light"] :is(.form-message.is-error,.auth-field-error,.admin-status.is-error,.topup-form-status.is-error,.topup-access p.is-error,.header-usd-total.is-unavailable,.topup-usd-total.is-unavailable,.fair-action-status[data-state="error"],.fair-verification[data-state="failed"],.upgrader-result.is-error,.wallet-admin-access p.is-error) { color:var(--danger); }
html[data-theme="light"] :is(.auth-input-shell.is-invalid,.form-field>input[aria-invalid="true"]) { border-color:var(--danger); }
html[data-theme="light"] :is(.upgrader-result.is-win,.game-result.is-win,.rocket-history-item.is-cashed,.blackjack-result.is-win) { color:var(--positive); }
html[data-theme="light"] #upgrader-panel .upgrader-result { color:var(--muted); }
html[data-theme="light"] #upgrader-panel .upgrader-result.is-win { color:var(--positive); }
html[data-theme="light"] #upgrader-panel .upgrader-result.is-error { color:var(--danger); }
html[data-theme="light"] .roulette-pocket-number { fill:#edf5ff; }
html[data-theme="light"] :is(.game-coin .auth-coin-front,.game-side[data-game-side="heads"]) { --coin-ink:#ffffff; }
html[data-theme="light"] :is(.game-coin .auth-coin-back,.game-side[data-game-side="tails"]) { --coin-ink:#ffffff; }
html[data-theme="light"] :is(.topup-watch.is-unavailable p,.topup-qr-caption>.topup-small-note,.fair-verification[data-state="pending"]) { color:var(--theme-warning-ink); }
html[data-theme="light"] .contact-button { color:var(--theme-on-accent); }
