/* Shared frontend palette, measured from the reference theme sheet. */
body[data-home-theme="blue"] { color-scheme: light; --app-page-bg: var(--app-bg); --app-bg: #f5f5f5; --app-surface: #ffffff; --app-surface-2: #f8fafc; --app-surface-muted: #f1f5f9; --app-text: #333333; --app-text-secondary: #64748b; --app-text-muted: #94a3b8; --app-border: #eef2f7; --app-accent: #2563eb; --app-header-bg: #ffffff; --app-header-text: #333333; --app-header-subtitle: #334155; --app-footer-bg: rgba(255, 255, 255, .98); --app-footer-border: #f7f8fa; --app-footer-text: #535a73; --app-footer-active: #1968dd; --app-profile-bg: linear-gradient(180deg, #e8f4ff 0%, #f4f9ff 42%, #ffffff 100%); --app-card-border: #e8edf3; --app-card-bg: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%); --app-shadow: rgba(15, 23, 42, .04); --app-btn-outline-bg: #ffffff; --app-btn-outline-border: #cbd5e1; --app-btn-outline-text: #334155; --app-press-bg: #f8fafc; }
body[data-home-theme="night"] { color-scheme: dark; --app-page-bg: var(--app-bg); --app-bg: #0f172a; --app-surface: #1e293b; --app-surface-2: #334155; --app-surface-muted: #475569; --app-text: #e2e8f0; --app-text-secondary: #94a3b8; --app-text-muted: #64748b; --app-border: #334155; --app-accent: #60a5fa; --app-header-bg: #1e293b; --app-header-text: #e2e8f0; --app-header-subtitle: #94a3b8; --app-footer-bg: rgba(30, 41, 59, .98); --app-footer-border: #334155; --app-footer-text: #94a3b8; --app-footer-active: #60a5fa; --app-profile-bg: linear-gradient(180deg, #1e293b 0%, #172554 42%, #0f172a 100%); --app-card-border: #334155; --app-card-bg: linear-gradient(135deg, #1e293b 0%, #334155 100%); --app-shadow: rgba(0, 0, 0, .25); --app-btn-outline-bg: #334155; --app-btn-outline-border: #475569; --app-btn-outline-text: #e2e8f0; --app-press-bg: #334155; }
body[data-home-theme="orange"] { color-scheme: light; --app-page-bg: var(--app-bg); --app-bg: #fff7ed; --app-surface: #ffffff; --app-surface-2: #ffedd5; --app-surface-muted: #fed7aa; --app-text: #431407; --app-text-secondary: #9a3412; --app-text-muted: #c2410c; --app-border: #fed7aa; --app-accent: #ea580c; --app-header-bg: #fff7ed; --app-header-text: #431407; --app-header-subtitle: #9a3412; --app-footer-bg: rgba(255, 247, 237, .98); --app-footer-border: #fed7aa; --app-footer-text: #9a3412; --app-footer-active: #ea580c; --app-profile-bg: linear-gradient(180deg, #ffedd5 0%, #fff7ed 42%, #ffffff 100%); --app-card-border: #fed7aa; --app-card-bg: linear-gradient(135deg, #fff7ed 0%, #ffffff 100%); --app-shadow: rgba(234, 88, 12, .08); --app-btn-outline-bg: #ffffff; --app-btn-outline-border: #fdba74; --app-btn-outline-text: #9a3412; --app-press-bg: #ffedd5; }
body[data-home-theme="gold"] { color-scheme: dark; --app-page-bg: var(--app-bg); --app-bg: #0a0a0a; --app-surface: #141414; --app-surface-2: #1f1f1f; --app-surface-muted: #2a2a2a; --app-text: #f5f0e6; --app-text-secondary: #c4b896; --app-text-muted: #8a7d62; --app-border: #3d3528; --app-accent: #d4af37; --app-header-bg: #121212; --app-header-text: #f5e6c8; --app-header-subtitle: #c4b896; --app-footer-bg: rgba(10, 10, 10, .98); --app-footer-border: #3d3528; --app-footer-text: #c4b896; --app-footer-active: #e8c547; --app-profile-bg: linear-gradient(180deg, #1a1510 0%, #0f0d0a 42%, #0a0a0a 100%); --app-card-border: #4a3f2a; --app-card-bg: linear-gradient(135deg, #1a1814 0%, #141210 100%); --app-shadow: rgba(0, 0, 0, .45); --app-btn-outline-bg: #1f1f1f; --app-btn-outline-border: #5c4f32; --app-btn-outline-text: #f5e6c8; --app-press-bg: #252018; }
body[data-home-theme="purple"] { color-scheme: dark; --app-page-bg: var(--app-bg); --app-bg: #0c0618; --app-surface: #1a0f2e; --app-surface-2: #2a1a45; --app-surface-muted: #3d2660; --app-text: #f3e8ff; --app-text-secondary: #c4b5fd; --app-text-muted: #8b7cb8; --app-border: #4c2d6e; --app-accent: #a855f7; --app-header-bg: #150a28; --app-header-text: #f3e8ff; --app-header-subtitle: #c4b5fd; --app-footer-bg: rgba(12, 6, 24, .98); --app-footer-border: #4c2d6e; --app-footer-text: #c4b5fd; --app-footer-active: #e879f9; --app-profile-bg: linear-gradient(180deg, #2d1b4e 0%, #1a0f2e 42%, #0c0618 100%); --app-card-border: #5b3d8a; --app-card-bg: linear-gradient(135deg, #1f1238 0%, #2a1a45 100%); --app-shadow: rgba(88, 28, 135, .35); --app-btn-outline-bg: #2a1a45; --app-btn-outline-border: #6d4a9e; --app-btn-outline-text: #f3e8ff; --app-press-bg: #352052; }
body[data-home-theme="temple"] { color-scheme: dark; --app-bg: #05081f; --app-page-bg: #05081f url(/assets/theme-temple.png) no-repeat center top / cover; --app-surface: rgba(5, 8, 31, .65); --app-surface-2: rgba(5, 8, 31, .85); --app-surface-muted: rgba(5, 8, 31, .5); --app-text: #ffffff; --app-text-secondary: rgba(255, 255, 255, .75); --app-text-muted: rgba(255, 255, 255, .55); --app-border: rgba(255, 255, 255, .12); --app-accent: #1989fa; --app-header-bg: rgba(5, 8, 31, .92); --app-header-text: #ffffff; --app-header-subtitle: rgba(255, 255, 255, .72); --app-footer-bg: rgba(5, 8, 31, .95); --app-footer-border: rgba(255, 255, 255, .12); --app-footer-text: rgba(255, 255, 255, .65); --app-footer-active: #4facfe; --app-profile-bg: linear-gradient( 180deg, rgba(88, 28, 135, .35) 0%, rgba(5, 8, 31, .9) 48%, #05081f 100% ); --app-card-border: rgba(255, 255, 255, .14); --app-card-bg: rgba(5, 8, 31, .72); --app-shadow: rgba(0, 0, 0, .35); --app-btn-outline-bg: rgba(5, 8, 31, .55); --app-btn-outline-border: rgba(255, 255, 255, .22); --app-btn-outline-text: #ffffff; --app-press-bg: rgba(5, 8, 31, .92); --app-filter-active-bg: linear-gradient(135deg, #1989fa, #4facfe); }

/* Shared surfaces across the signed-in frontend. No admin or PG iframe rules. */
body.is-home[data-home-theme],
body[data-home-theme] :is(#homeView,.home-content,#localLayer,.local-scroll,.service-layout,.support-chat-layout,.local-game-page,.room-layout .room-chat) {
 background:var(--app-page-bg);color:var(--app-text);
}
body[data-home-theme] :is(.home-header,.announcement,.account-panel,.provider-card,.game-hall,.room-grid button,.bottom-nav,.result-row,.next-round,
 .local-header,.local-nav,.local-quick,.local-two,.mine-user,.mine-balance,.mine-records,.mine-list,.mine-list button,.amount-card,.binding,
 .binding-options,.binding-fields,.pg-wallet,.pg-amount,.bet-record-card,.promotion-card,.sound-settings,.service-header,.service-card,.service-faq,
 .support-compose,.group-compose,.room-controls,.room-result,.room-history,.notice-card,.notice-game,.notice-detail,.points-card,
 .points-sheet,.wallet-picker,.group-game-sheet,.home-theme-sheet,.stats-dialog,.bet-sheet,.bet-confirmation,.room-finance-sheet,
 .support-extra-dialog,.system-notice-card,.room-switch-dialog,.room-switch-item,.reward-exchange-mask .pm-exchange-sheet) {
 background:var(--app-surface);color:var(--app-text);border-color:var(--app-border);
}
body[data-home-theme] #localLayer :is(#rechargeChannel,#receiptField,.promotion-qr-sheet) {background:var(--app-surface);color:var(--app-text)}
body[data-home-theme] :is(.hall-head,.activity-heading,.local-balance,.bet-tabs,.binding-options button,.pg-amount,.bet-review-context,.bet-review-note,.sound-row,.home-theme-sheet>button) {background:var(--app-surface-2);color:var(--app-text);border-color:var(--app-border)}
body[data-home-theme] :is(.room-event-bubble,.support-chat-bubble,.group-message-bubble) {background:var(--app-surface);color:var(--app-text)}
body[data-home-theme] .room-event[data-sender-role="support"] .room-event-bubble,
body[data-home-theme] .support-chat-message[data-sender-role="support"] .support-chat-bubble {background:var(--app-surface);color:var(--app-text)}
body[data-home-theme] :is(.room-event.own .room-event-bubble,.support-chat-message.own .support-chat-bubble) {background:color-mix(in srgb,var(--app-accent) 18%,var(--app-surface));color:var(--app-text)}
body[data-home-theme] :is(.room-event-name,.room-event-time,.support-chat-message small,.home-brand-copy span,.provider-card small,.hall-title small,
 .mine-user small,.mine-brand small,.mine-list span,.sound-row small,.sound-hint,.promotion-card p,.service-card small,.service-faq details p,
 .bet-record-time,.notice-card time,.notice-detail time,.notice-card p,.local-pg small,.stats-period,.room-finance-description,.room-finance-review,
 .draw-period,.draw-label,.draw-operator,.home-theme-sheet button small) {color:var(--app-text-secondary)}
body[data-home-theme] :is(.room-event-time,.bet-tabs button,.bet-options button,.home-theme-sheet>button) {background:var(--app-surface-2);color:var(--app-text)}
body[data-home-theme] :is(.home-brand-copy strong,.account-copy strong,.quick-actions b,.hall-title strong,.room-grid strong,.result-row>strong,
 .mine-header .mine-brand,.mine-list button,.service-header strong,.service-header span b,.service-card b,.service-faq h2,.service-faq summary,
 .bet-review-list strong,.bet-content p,.bet-content>small,.binding-fields label,.binding-fields small) {color:var(--app-text)}
body[data-home-theme] #localLayer :is(input:not([type=checkbox]):not([type=radio]):not([type=range]),textarea,select),
body[data-home-theme] :is(.room-finance-sheet input,.bet-bottom input,.support-extra-dialog input) {
 background:var(--app-surface-2);color:var(--app-text);-webkit-text-fill-color:var(--app-text);caret-color:var(--app-accent);border-color:var(--app-border);color-scheme:inherit;
}
body[data-home-theme] #localLayer :is(input,textarea)::placeholder {color:var(--app-text-muted);-webkit-text-fill-color:var(--app-text-muted);opacity:1}
body[data-home-theme] #localLayer input:-webkit-autofill { -webkit-text-fill-color:var(--app-text);box-shadow:0 0 0 1000px var(--app-surface-2) inset }
body[data-home-theme] :is(.room-follow,.local-header button,.mine-balance b,.account-copy>span,.local-nav button.active,.bottom-nav button.active,
 .provider-card small b,.room-grid small,.sound-switch[aria-checked=true],.home-theme-sheet>button.selected,.binding-options button.selected,.bet-options button.selected,.bet-tabs button.selected) {
 color:var(--app-accent);border-color:var(--app-accent);
}
body[data-home-theme] :is(.home-theme-sheet>button.selected,.binding-options button.selected,.bet-options button.selected) {background:color-mix(in srgb,var(--app-accent) 8%,var(--app-surface))}
body[data-home-theme] .room-follow {background:var(--app-surface)}
body[data-home-theme] :is(.local-nav button,.bottom-nav button) {color:var(--app-text-secondary)}
body[data-home-theme] :is(.local-submit,.room-controls>button,.room-finance-actions [data-room-finance-confirm],.bet-confirmation footer [data-bet-review-confirm],.sound-switch[aria-checked=true]) {background:var(--app-accent);color:#fff}
body[data-home-theme] .sound-switch:not([aria-checked=true]) {background:var(--app-surface-muted)}
body[data-home-theme] .home-theme-mask {z-index:1600}
body[data-home-theme] .home-theme-sheet {max-height:92dvh;overflow-y:auto;padding-bottom:calc(16px + env(safe-area-inset-bottom,0px))}
body[data-home-theme] .home-theme-sheet .theme-cancel {background:var(--app-surface-2);color:var(--app-text-secondary)}
body[data-home-theme] .room-bottom-tools {display:flex;justify-content:center;align-items:center;gap:clamp(6px,1.43vw,16px);padding:5px 8px 8px;background:var(--app-bg);flex-wrap:nowrap}
body[data-home-theme] .room-bottom-tools button {display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;min-width:0;padding:clamp(5px,.9vw,10px) clamp(12px,2.32vw,26px);border:1px solid color-mix(in srgb,var(--app-accent) 32%,transparent);border-radius:36px;background:color-mix(in srgb,var(--app-surface) 85%,transparent);color:var(--app-accent);font-size:clamp(12px,1.96vw,22px);font-weight:600;line-height:1.2;box-shadow:0 1px 3px #0000000f,0 4px 10px #1989fa1a;backdrop-filter:blur(12px);cursor:pointer;transition:transform .15s,background .15s}
body[data-home-theme] .room-bottom-tools button:active{transform:scale(.96)}
body[data-home-theme] .room-bottom-tools [aria-pressed=true]{color:var(--app-text-secondary);background:color-mix(in srgb,var(--app-text-muted) 14%,transparent);border-color:color-mix(in srgb,var(--app-text-muted) 35%,transparent);box-shadow:none}
.room-preference-toast{position:fixed;z-index:2000;left:50%;top:48%;transform:translate(-50%,-50%);max-width:88vw;padding:14px 20px;border-radius:10px;background:#000c;color:white;font-size:14px;text-align:center;pointer-events:none}

body[data-home-theme] :is(.local-quick button,.local-two button:first-child,.mine-records button,.local-pg,.logout,.amount-input,.amount-grid button,
 .room-result-wrap,.bet-confirmation footer button,.transfer-wallets button,.wallet-picker>div,.points-sheet>div button,.group-game-sheet>div button) {background:var(--app-surface-2);color:var(--app-text);border-color:var(--app-border)}
body[data-home-theme] :is(.service-faq h2,.service-faq details,.mine-list button,.sound-row,.points-card>div,.room-history-row,.bet-review-list) {border-color:var(--app-border)}
body[data-home-theme] .logout {color:#f87171}
body[data-home-theme] :is(.finance-layout .amount-grid button.selected,.points-sheet>div button.selected) {background:color-mix(in srgb,var(--app-accent) 12%,var(--app-surface));color:var(--app-accent);border-color:var(--app-accent)}
body[data-home-theme] #localLayer .local-pg {color:var(--app-text)}
body[data-home-theme] #localLayer .local-pg button {background:var(--app-surface-2);color:var(--app-accent)}

body[data-home-theme] .bet-confirmation footer [data-bet-review-confirm] {background:var(--app-accent);color:white}
body.is-home[data-home-theme] .modal-card {background:var(--app-surface);color:var(--app-text);border-color:var(--app-border)}
body.is-home[data-home-theme] .modal-card :is(h2,p) {color:var(--app-text)}
body[data-home-theme] #rewardFeature {--app-bg:inherit;--app-surface:inherit;--app-surface-2:inherit;--app-text:inherit;--app-text-secondary:inherit;--app-border:inherit;--app-shadow:inherit;--app-accent:inherit;color:var(--app-text)}
body[data-home-theme] :is(.ge-body,.ge-card,.ge-disabled-tip,.reward-exchange-mask .pm-exchange-sheet) {background:var(--app-surface);color:var(--app-text)}
body[data-home-theme] :is(.ge-card__title,.ge-table) {color:var(--app-text)}
body[data-home-theme] :is(.ge-card__intro,.ge-rules,.ge-table th) {color:var(--app-text-secondary)}
body[data-home-theme] .ge-table th {background:var(--app-surface-2)}
body[data-home-theme] :is(.ge-table th,.ge-table td,.ge-card) {border-color:var(--app-border)}

body[data-home-theme]:not([data-home-theme="blue"]) .room-status {background:linear-gradient(120deg,color-mix(in srgb,var(--app-accent) 38%,var(--app-surface)),var(--app-surface-2));color:var(--app-text);border-color:var(--app-border)}
body[data-home-theme]:not([data-home-theme="blue"]) .room-status small {color:var(--app-text-secondary)}
body[data-home-theme]:not([data-home-theme="blue"]) :is(.ge-header,.pm-header,.pr-header) {background:var(--app-accent)}

body[data-home-theme] :is(.transfer-filter,.record-filter,.stats-filter) {background:var(--app-surface);color:var(--app-text);border-color:var(--app-border)}
body[data-home-theme] :is(.transfer-filter button,.record-filter button,.promotion-card>button,.stats-filter button) {background:var(--app-surface-2);color:var(--app-text-secondary);border-color:var(--app-border)}
body[data-home-theme] :is(.transfer-filter button.selected,.record-filter button.selected,.stats-filter button.selected) {background:var(--app-accent);color:white}
body[data-home-theme] .promotion-card>button:disabled {opacity:.5}
