:root[data-button-theme="night"]{color-scheme:dark;--button-main:#b9b0ed;--button-main-hover:#cbc4f5;--button-main-border:#9589d4;--button-main-ink:#17243a;--button-main-shadow:rgba(4,10,24,.42);--accent-secondary:#91dbe4;--secondary-border:#66bdca;--secondary-ink:#102f3b;--secondary-soft:#243d5b;--theme-page:#101d33;--theme-surface:#1b2d49;--theme-soft:#263b5a;--theme-pale:#15243a;--theme-deep:#d0c9f4;--theme-glow:rgba(161,151,224,.22);--secondary-glow:rgba(98,196,210,.16);--ink:#eef2ff;--muted:#aebbd0;--line:rgba(188,202,229,.18);--surface:rgba(24,40,64,.92);--paper:#182942;--navy:#eef2ff;--navy-soft:#b9c8dc;--slate:#aebbd0;--aqua:#91dbe4}

/* Noche lleva la selección a fondos, superficies, campos y navegación de todas las vistas. */
[data-button-theme="night"] body{color:var(--ink);background:radial-gradient(circle at 12% 12%,rgba(145,219,228,.12),transparent 31%),radial-gradient(circle at 88% 78%,rgba(185,176,237,.14),transparent 38%),var(--theme-page)}
html[data-button-theme="night"]{background:#101d33}
[data-button-theme="night"] body:has(.profile-app){min-height:100dvh;background:radial-gradient(circle at 50% 22%,rgba(91,116,157,.16),transparent 56%),linear-gradient(180deg,#101d33 0,#09162a 100%)}
[data-button-theme="night"] body:has(.profile-app) .profile-app{background:transparent}
[data-button-theme="night"] :is(.profile-app,.game-app,.creator,.library-page,.study-app,.package-screen,.game-screen){color:var(--ink)}
[data-button-theme="night"] :is(.deck-card,.deck-details,.cards-section,.card-editor,.card-list-panel,.card-list-item,.card-live-preview,.game-question-card,.game-card-front,.scoreboard,.score-row,.selected-package,.friends-card,.voice-card,.podium-voice,.room-audio,.creator-actions,.friend-invite,.game-invite,.login-modal-card,.theme-dialog-content,.avatar-dialog form,.audio-dialog form,.add-friend-dialog form){border-color:var(--line);background-color:var(--theme-pale);color:var(--ink);box-shadow:0 .75rem 1.8rem rgba(3,9,20,.25)}
[data-button-theme="night"] :is(h1,h2,h3,strong,.cards-heading,.card-list-heading,.field-label,.room-status,.score-heading){color:var(--ink)}
[data-button-theme="night"] :is(p,small,.theme-dialog-intro,.avatar-intro,.gesture-help,.editor-status,.save-state){color:var(--muted)}
[data-button-theme="night"] :is(input:not([type="radio"]):not([type="checkbox"]),textarea,select){border-color:var(--line);background:#1d304c;color:var(--ink);box-shadow:none}
[data-button-theme="night"] :is(input,textarea)::placeholder{color:#8595ad}
[data-button-theme="night"] :is(.secondary-action,.back-button,.round-button,.quick-action,.edit-button,.delete-card,.skip-question-button,.leave-match-button,.scroll-cue){border-color:var(--secondary-border);background:var(--secondary-soft);color:#d9f7fb;box-shadow:0 .35rem .8rem rgba(2,8,20,.28)}
[data-button-theme="night"] .button-theme-options label{border-color:var(--line);background:#1b2d49}
[data-button-theme="night"] .button-theme-options strong{color:var(--ink)}
[data-button-theme="night"] .button-theme-options small{color:var(--muted)}
[data-button-theme="night"] .theme-dialog{color:var(--ink);box-shadow:0 2rem 5rem rgba(0,5,16,.58)}
[data-button-theme="night"] .theme-dialog::backdrop{background:rgba(2,7,18,.68)}
[data-button-theme="night"] .site-menu-action span{color:#d9f7fb;background:var(--secondary-soft)}
[data-button-theme="night"] .avatar-button,[data-button-theme="night"] .party-avatar.has-lottie-avatar::after,[data-button-theme="night"] .party-avatar.is-you.has-lottie-avatar::after{box-shadow:0 1.2rem 2.7rem rgba(2,8,20,.38),inset 0 0 2rem rgba(185,176,237,.08)}
[data-button-theme="night"] .avatar-halo{background:none;filter:none}
[data-button-theme="night"] .avatar-category,[data-button-theme="night"] .avatar-category:nth-child(2){border-color:rgba(174,190,219,.2);background:#1d304c;color:var(--muted);box-shadow:0 .4rem 1rem rgba(2,8,20,.2)}
[data-button-theme="night"] .avatar-category:hover{border-color:rgba(145,219,228,.45);background:#223956}
[data-button-theme="night"] .avatar-category.is-active{border-color:var(--button-main-border);background:#293c5b;color:var(--ink);box-shadow:0 0 0 .16rem var(--theme-glow),0 .55rem 1.2rem rgba(2,8,20,.3)}
[data-button-theme="night"] .category-copy strong{color:var(--ink)}
[data-button-theme="night"] .category-copy small{color:var(--muted)}
[data-button-theme="night"] .category-check{background:var(--accent-secondary);color:var(--secondary-ink)}
[data-button-theme="night"] .avatar-dialog-actions{border-color:var(--line)}
[data-button-theme="night"] .avatar-save:disabled{border-color:rgba(174,190,219,.16);background:#263750;color:#71839d;box-shadow:none}
[data-button-theme="night"] .audio-setting{border-color:rgba(174,190,219,.2);background:#1d304c;color:var(--ink);box-shadow:0 .35rem .85rem rgba(2,8,20,.18)}
[data-button-theme="night"] .audio-setting:hover{border-color:rgba(145,219,228,.4);background:#223956}
[data-button-theme="night"] .audio-setting strong{color:var(--ink)}
[data-button-theme="night"] .audio-setting small{color:var(--muted)}
[data-button-theme="night"] .audio-setting input{accent-color:var(--accent-secondary)}
[data-button-theme="night"] .audio-device-field>span{color:var(--ink)}

/* Estudio, mazos y partidas. */
[data-button-theme="night"] :is(.lobby-screen,.question-screen,.scoreboard-screen,.podium-screen,.study-app){background:radial-gradient(circle at 50% 0,rgba(50,76,109,.42),transparent 48%),var(--theme-page)}
[data-button-theme="night"] :is(.round-button,.profile-dot,.package-action-bubbles a,.game-page-trigger,.game-page-actions a,.profile-fab,.quick-action){border-color:var(--secondary-border);background:var(--secondary-soft);color:#d9f7fb;box-shadow:0 .5rem 1.2rem rgba(2,8,20,.3)}
[data-button-theme="night"] :is(.friend,.voice-player,.timer,.voice-status,.player-count,.score-timeline,.game-up-arrow,.tap-hint span,.cards-heading strong,.step){border-color:var(--line);background:var(--theme-surface);color:var(--ink)}
[data-button-theme="night"] :is(.mini-avatar,.voice-avatar,.dice-avatar,.podium-dice-avatar){border-color:var(--theme-soft);background:var(--theme-surface)}
[data-button-theme="night"] .voice-toggle [data-voice-toggle-icon]::after,[data-button-theme="night"] .podium-mic-icon.is-muted::after{box-shadow:0 0 0 2px var(--theme-surface)}
[data-button-theme="night"] :is(.game-card-face,.game-card-back,.card-back){border-color:var(--line);background:var(--theme-pale);color:var(--ink)}
[data-button-theme="night"] :is(.game-card-front,.card-front){border-color:rgba(145,219,228,.3);background:radial-gradient(circle at 18% 12%,rgba(145,219,228,.2),transparent 36%),linear-gradient(145deg,#243d5b,#182b47 55%,#202f50);color:var(--ink)}
[data-button-theme="night"] :is(.subject-badge,.subject-pill){border-color:rgba(145,219,228,.35);background:rgba(27,45,73,.82);color:#bdebf1;box-shadow:none}
[data-button-theme="night"] :is(.question-kicker,.tap-hint){color:var(--muted)}
[data-button-theme="night"] :is(.game-back-question>span,.back-question span){color:#91dbe4}
[data-button-theme="night"] .back-question{background:linear-gradient(135deg,#263f60,#1c304d);color:var(--ink)}
[data-button-theme="night"] :is(.answer-option,.answer-option:nth-child(1),.answer-option:nth-child(2),.answer-option:nth-child(3),.answer-option:nth-child(4)){border-color:rgba(149,137,212,.42);background:var(--theme-surface);color:var(--ink);box-shadow:none}
[data-button-theme="night"] :is(.answer-option:nth-child(2),.answer-option:nth-child(4)){border-color:rgba(102,189,202,.4);background:var(--secondary-soft)}
[data-button-theme="night"] .answer-option::before{background:rgba(185,176,237,.16);color:#d0c9f4}
[data-button-theme="night"] :is(.score-row,.score-row.is-moving){border-color:var(--line);background:var(--theme-pale);color:var(--ink);box-shadow:0 .65rem 1.6rem rgba(2,8,20,.26)}
[data-button-theme="night"] .score-row.is-moving{border-color:var(--button-main-border);background:#293c5b}
[data-button-theme="night"] .score-timeline span{background:linear-gradient(90deg,var(--accent-secondary),var(--button-main))}
[data-button-theme="night"] .podium-voice{border-color:var(--line);background:var(--theme-pale);box-shadow:0 .8rem 2rem rgba(2,8,20,.3)}
[data-button-theme="night"] .podium-audio-action{color:var(--ink)}
[data-button-theme="night"] .podium-audio-action>small{color:var(--muted)}
[data-button-theme="night"] :is(.room-audio,.podium-voice,.voice-card) :is(.room-audio-toggle,.room-audio-options,.podium-audio-toggle,.podium-audio-options,.voice-toggle){color:var(--accent-secondary);box-shadow:0 .35rem .8rem rgba(2,8,20,.28)}
[data-button-theme="night"] :is(.room-audio,.podium-voice,.voice-card) :is(.room-audio-toggle,.room-audio-options,.podium-audio-toggle,.podium-audio-options,.voice-toggle):hover{background:var(--theme-soft)}
[data-button-theme="night"] .room-audio-toggle .room-mic-icon::after,[data-button-theme="night"] .podium-audio-toggle .podium-mic-icon.is-muted::after{background:#efaaa4;box-shadow:0 0 0 2px var(--secondary-soft)}
[data-button-theme="night"] .room-audio-toggle:hover .room-mic-icon::after,[data-button-theme="night"] .podium-audio-toggle:hover .podium-mic-icon.is-muted::after{box-shadow:0 0 0 2px var(--theme-soft)}
[data-button-theme="night"] :is(.podium-push-talk,.room-push-talk){border-color:var(--button-main-border)}
[data-button-theme="night"] .fourth-place{color:var(--muted)}
[data-button-theme="night"] :is(.card-rail,.question-field,.answers-field,.image-column,.image-drop,.single-card-editor,.cards-dialog>form,.edit-dialog form){border-color:var(--line);background:var(--theme-pale);color:var(--ink);box-shadow:none}
[data-button-theme="night"] :is(.card-editor,.card-list-panel){border-color:var(--line);background:#1b2d49;color:var(--ink)}
[data-button-theme="night"] :is(.rail-card,.card-list-item){border-color:transparent;background:transparent;color:var(--muted)}
[data-button-theme="night"] :is(.rail-card.is-current,.card-list-item.is-current){border-color:var(--secondary-border);background:var(--secondary-soft);color:#d9f7fb}
[data-button-theme="night"] :is(.rail-card>span,.card-list-item>span,.preview-options span){border-color:var(--line);background:var(--theme-surface);color:var(--ink)}
[data-button-theme="night"] .card-live-preview{border-color:rgba(145,219,228,.28);background:linear-gradient(145deg,#243d5b,#1b2d49);box-shadow:none}
[data-button-theme="night"] :is(.image-icon,.add-card,.card-list-heading button){border-color:var(--secondary-border);background:var(--secondary-soft);color:#d9f7fb}
[data-button-theme="night"] :is(.deck-fields label,.deck-fields legend,.field-label,.question-field,.answers-field legend,.single-card-editor label,.edit-dialog label){color:var(--muted)}
[data-button-theme="night"] :is(.correct-radio span,.color-options span){border-color:var(--theme-soft);background:var(--theme-surface)}
[data-button-theme="night"] :is(.edit-dialog,.cards-dialog){color:var(--ink);background:var(--theme-pale);box-shadow:0 2rem 5rem rgba(0,5,16,.58)}
[data-button-theme="night"] :is(.close-button,.edit-button,.dialog-actions .secondary){border-color:var(--secondary-border);background:var(--secondary-soft);color:#d9f7fb}
[data-button-theme="night"] :is(.read-only-badge,.streak-badge){border-color:rgba(185,176,237,.25);background:rgba(185,176,237,.14);color:#d0c9f4}
[data-button-theme="night"] :is(.friend-invite.is-cooldown,.friend-invite.is-pending){border-color:rgba(185,176,237,.3);background:#293c5b;color:var(--ink)}
[data-button-theme="night"] :is(.start-room-game.is-disabled,.social-room.is-guest .start-room-game.is-disabled,.add-friend-submit:disabled){border-color:var(--line);background:#263750;color:#71839d;box-shadow:none}
[data-button-theme="night"] .deck-card{border:0;background:transparent;box-shadow:none}
[data-button-theme="night"] :is(.deck-card,.package-screen .package)[data-color="green"]{--pack-a:#28564f;--pack-b:#183c38}
[data-button-theme="night"] .solo-deck[data-color="green"]{--pack-a:#28564f;--pack-b:#183c38}
[data-button-theme="night"] :is(.deck-card,.package-screen .package)[data-color="blue"]{--pack-a:#28516c;--pack-b:#19384f}
[data-button-theme="night"] .solo-deck[data-color="blue"]{--pack-a:#28516c;--pack-b:#19384f}
[data-button-theme="night"] :is(.deck-card,.package-screen .package)[data-color="lilac"]{--pack-a:#4a4169;--pack-b:#302b50}
[data-button-theme="night"] .solo-deck[data-color="lilac"]{--pack-a:#4a4169;--pack-b:#302b50}
[data-button-theme="night"] :is(.deck-card,.package-screen .package)[data-color="yellow"],[data-button-theme="night"] :is(.deck-card,.package-screen .package)[data-color="gold"]{--pack-a:#5b4d30;--pack-b:#3d3427}
[data-button-theme="night"] .solo-deck[data-color="yellow"]{--pack-a:#5b4d30;--pack-b:#3d3427}
[data-button-theme="night"] :is(.deck-card,.package-screen .package) :is(.package-sheet,.package-cover){border-color:rgba(211,222,242,.22);box-shadow:0 1rem 2rem rgba(1,7,17,.34)}
[data-button-theme="night"] .solo-deck :is(.solo-deck-sheet,.solo-deck-cover){border-color:rgba(211,222,242,.22);color:var(--ink);box-shadow:0 1rem 2rem rgba(1,7,17,.34)}
[data-button-theme="night"] :is(.deck-card,.package-screen .package) .package-cover::after{background:rgba(210,222,245,.08)}
[data-button-theme="night"] .deck-card .deck-description{color:#bdc9dc}
[data-button-theme="night"] :is(.deck-card,.package-screen .package) .package-icon{border-color:rgba(221,230,247,.32);background:rgba(18,31,51,.38);color:var(--ink);box-shadow:none}
[data-button-theme="night"] :is(.deck-card,.package-screen .package) .package-meta{color:#e8edfb}
[data-button-theme="night"] [data-game-app][data-package-color="green"]{--question-night-a:#28564f;--question-night-b:#183c38}
[data-button-theme="night"] [data-game-app][data-package-color="blue"]{--question-night-a:#28516c;--question-night-b:#19384f}
[data-button-theme="night"] [data-game-app][data-package-color="lilac"]{--question-night-a:#4a4169;--question-night-b:#302b50}
[data-button-theme="night"] [data-game-app][data-package-color="gold"]{--question-night-a:#5b4d30;--question-night-b:#3d3427}
[data-button-theme="night"] [data-game-app][data-package-color] .game-card-front{border-color:rgba(211,222,242,.24);background:linear-gradient(145deg,var(--question-night-a),var(--question-night-b));color:var(--ink)}
[data-button-theme="night"] [data-game-app][data-package-color] .game-card-back{border-color:rgba(211,222,242,.2);background:linear-gradient(145deg,color-mix(in srgb,var(--question-night-a) 58%,#142238),color-mix(in srgb,var(--question-night-b) 52%,#101d33));color:var(--ink)}
[data-button-theme="night"] .friend-invite{background:var(--theme-pale)}
[data-button-theme="night"] .friend-invite.is-offline{opacity:1;border-color:rgba(174,190,219,.16);background:#17273e;box-shadow:none}
[data-button-theme="night"] .friend-invite.is-offline .friend-list-avatar{opacity:.72;filter:saturate(.58) brightness(.82)}
[data-button-theme="night"] .friend-invite.is-offline strong{color:#c7d1e3}
[data-button-theme="night"] .friend-invite.is-offline small{color:#8fa0b8}
[data-button-theme="night"] .friend-invite.is-offline .presence{border-color:#17273e;background:#65758c;box-shadow:0 0 0 .18rem rgba(101,117,140,.16)}
[data-button-theme="night"] .friend-invite.is-offline button:disabled{border-color:rgba(174,190,219,.18);background:#22364f;color:#a5b4c8;box-shadow:none}
[data-button-theme="night"] .game-answer{border-color:rgba(185,176,237,.5);background:#233753;color:#eef2ff;text-shadow:none;box-shadow:0 .35rem .9rem rgba(2,8,20,.2)}
[data-button-theme="night"] .game-answer:nth-child(2){border-color:rgba(145,219,228,.48);background:#29435b;color:#eef2ff}
[data-button-theme="night"] .game-answer:nth-child(3){border-color:rgba(137,205,174,.46);background:#25433f;color:#eef2ff}
[data-button-theme="night"] .game-answer:nth-child(4){border-color:rgba(220,187,119,.48);background:#49402f;color:#eef2ff}
[data-button-theme="night"] .game-answer::before{border-color:rgba(222,230,245,.34);background:#d9e2f0;color:#182942;box-shadow:none}
[data-button-theme="night"] .game-answer.is-correct,
[data-button-theme="night"] .game-answer:nth-child(even).is-correct{border-color:#62c69a;background:#235c47;color:#f2fff8}
[data-button-theme="night"] .game-answer.is-wrong,
[data-button-theme="night"] .game-answer:nth-child(even).is-wrong{border-color:#dd8079;background:#673a3c;color:#fff4f3}
[data-button-theme="night"] .game-answer.is-correct::before{background:#bcebd5;color:#174b36}
[data-button-theme="night"] .game-answer.is-wrong::before{background:#f0c3c0;color:#612e31}
[data-button-theme="night"] .mini-avatar.is-thinking{border-color:#d8b45f;outline:1px solid rgba(216,180,95,.38);outline-offset:1px;box-shadow:0 0 .55rem rgba(216,180,95,.22)}
[data-button-theme="night"] .mini-avatar.is-correct{border-color:#58c994;outline:1px solid rgba(88,201,148,.44);outline-offset:1px;box-shadow:0 0 .62rem rgba(88,201,148,.28)}
[data-button-theme="night"] .mini-avatar.is-wrong{border-color:#df7671;outline:1px solid rgba(223,118,113,.46);outline-offset:1px;box-shadow:0 0 .62rem rgba(223,118,113,.3)}
[data-button-theme="night"] .winning-streak strong{color:var(--theme-deep)}

[data-button-theme="night"] .theme-dialog .theme-dialog-content {
  background: radial-gradient(circle at 8% 8%, var(--theme-glow), transparent 40%), var(--theme-pale);
}
[data-button-theme="night"] .theme-dialog :is(.eyebrow, legend, .theme-logout button) { color: var(--muted); }
[data-button-theme="night"] .theme-dialog .theme-logout button { background: transparent; }
[data-button-theme="night"] :is(.theme-dialog, .avatar-dialog, .audio-dialog, .add-friend-dialog) header > button,
[data-button-theme="night"] .open-theme-settings {
  border-color: var(--line);
  background: var(--theme-soft);
  color: var(--ink);
  box-shadow: none;
}
[data-button-theme="night"] .button-theme-options label:has(input:checked) {
  border-color: var(--button-main-border);
  background: var(--theme-soft);
}
[data-button-theme="night"] :is(.avatar-dialog, .audio-dialog, .add-friend-dialog) form {
  background: var(--theme-pale);
}
[data-button-theme="night"] .site-menu.is-open .site-menu-trigger {
  background: var(--theme-soft);
  color: var(--ink);
  box-shadow: 0 0 0 .42rem var(--theme-glow);
}
[data-button-theme="night"] :is(.guest-waiting, .game-countdown, .room-push-talk, .podium-push-talk) {
  border-color: var(--line);
  background: var(--theme-surface);
  color: var(--ink);
}
