.site-theme-toolbar{box-sizing:border-box;max-width:1190px;min-height:39px;margin:0 auto;padding:5px 30px 0;display:flex;justify-content:flex-end;position:relative;z-index:9}
button.site-theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:32px;padding:5px 12px;border:1px solid #d9c9e0;border-radius:18px;background:#fbf7fd;color:#695174;font:600 11px/1.5 'Apple SD Gothic Neo','Malgun Gothic',sans-serif;cursor:pointer;white-space:nowrap;box-shadow:none;letter-spacing:0;touch-action:manipulation}
button.site-theme-toggle:hover{background:#eee2f6}button.site-theme-toggle:focus-visible{outline:3px solid #ac80c5;outline-offset:3px}
:root[data-theme="dark"]{--paper:#191421;--cream:#191421;--ink:#f5edf9;--muted:#c8b8d5;--purple:#d0acdF;--plum:#9f76b6;--line:#53425f;--gold:#e5ca91;--page-dark:#191421;--surface-dark:#272030;--raised-dark:#33283e;--text-dark:#f5edf9;--secondary-dark:#c8b8d5;--border-dark:#584666;color-scheme:dark;background:#191421}
:root[data-theme="dark"] body{background:radial-gradient(ellipse at 12% 12%,#38254466,transparent 48%),radial-gradient(ellipse at 95% 85%,#26384944,transparent 42%),var(--page-dark)!important;color:var(--text-dark)!important}
:root[data-theme="dark"] body::before,:root[data-theme="dark"] body::after{background:none!important}
:root[data-theme="dark"] :is(.castle-header,.site-header,.game-header,.shop-header,.fortune-header,.dungeon-header,.topbar){background:#1e1827f5!important;border-color:var(--border-dark)!important;color:var(--text-dark)!important;box-shadow:0 1px 0 #6c537529}
/* Card cosmetics retain their chosen inks and paper: item previews stay true to the saved design. */
:root[data-theme="dark"] body :is(h1,h2,h3,h4,b,strong,a,button,label,summary,dt,dd,input,select,textarea):not(.resident-card,.resident-card *,.cosmetic-card,.cosmetic-card *){color:var(--text-dark)!important}
:root[data-theme="dark"] body :is(p,small,span,li,time,legend):not(.resident-card,.resident-card *,.cosmetic-card,.cosmetic-card *){color:var(--secondary-dark)!important}
:root[data-theme="dark"] body :is(.eyebrow,.field-note,.save-note,.stage-caption,.inline-status,.preview-note,.shop-status,.draw-status,.mission-status,.action-feedback,.game-result,.feedback,.daily-note,.fortune-message,.intro-copy,.section-copy,.board-caption,.keyboard-guide,.empty-note,#dialog-copy,.lucky-number,.category-row dd):not(.resident-card *,.cosmetic-card *){color:var(--secondary-dark)!important}
:root[data-theme="dark"] body :is(.button,.primary,.primary-button,.purchase-button,.draw-button,.drop-button,.chat-compose button,.mission-card-bottom button,.upgrade-card button){background:#80549b!important;border-color:#b38ac8!important;color:#fff8ff!important;box-shadow:0 3px 0 #130e1c55!important}
:root[data-theme="dark"] body :is(.button,.primary,.primary-button,.purchase-button,.draw-button,.drop-button) span{color:#fff8ff!important}
:root[data-theme="dark"] body :is(.button.outline,.secondary,.secondary-button,.outline-button,.small-button,.icon-button,.help-button,.text-button,.quiet-button,.control-button,.tool-button,.stage-button,.direction-controls button,.controls button,.dpad button,.action-buttons button,.hud-tools>button,.zoom-controls button,.header-tools button){background:var(--raised-dark)!important;border-color:#695375!important;color:var(--text-dark)!important;box-shadow:none!important}
:root[data-theme="dark"] body :is(.facility,.game-card,.welcome-strip,.notice-preview,.resident-invite,.under-construction,.account-entry,.memory-shell,.training-shell,.record,.board-list details,.lumi-letter-head,.mission-invite,.wallet,.welcome-note,.preview-stage,.preview-bottom,.selection-detail,.item-card,.play-rewards,.lottery,.lottery-card,.lottery-card.premium,.attendance-card,.attendance-bonus,.mission-wallet,.mission-letter,.mission-card,.mission-card.ready,.mission-card.claimed,.mission-summary,.sealed-card,.reading-card,.lucky-band,.suggested-play,.entry-card,.invite-card,.people-card,.rules-card,.opponent,.chat-panel,.keyboard-card,.intro-sticker,.hold-card,.next-card,.familiar-card,.overlay-card,.host-card,.stage-bar,.workbench,.success-card,.score-panel,.little-note,.next-fruit,.goal-card,.modal,.upgrade-card,.panel,.familiar-detail,.bank-pill,.dungeon-feed,.bag-detail,.codex-detail,.quickslots,.room-note){background:var(--surface-dark)!important;border-color:var(--border-dark)!important;box-shadow:0 7px 22px #08040d30!important}
:root[data-theme="dark"] body :is(.coin,.preview-tag,.outfit-summary span,.unowned-preview,.view-switch,.category-tabs button,.collection-strip button,.item-price,.item-status,.selected-ownership,.gift-line,.pool-item,.stamp-row li,.stamp-row li:last-child,.mission-filters button,.mission-reward,.mission-title-prize,.date-tag,.mood-tag,.suggest-icon,.entry-badge,.attack-rule,.pieces>section,.pieces>button,.person-dot,.chat-message,.host-note,.best-stat,.mobile-next,.feature-chips span,.familiar-option,.selection-stats span,.hud-energy,.turn-badge,.bag-grid>button,.bag-grid>.empty-slot,kbd){background:var(--raised-dark)!important;border-color:#644e72!important;color:var(--text-dark)!important;box-shadow:none!important}
:root[data-theme="dark"] body :is(.view-switch button.active,.category-tabs button.active,.item-card.selected,.pool-item.collected,.stamp-row .stamped,.mission-filters button[aria-pressed=true],.familiar-option[aria-pressed=true],.avatar-picker button.selected,.theme-picker button.selected,.faction-picker button.selected,.level-button.current,.level-button[aria-current=true],.mode-options>button,.mode-options>a){background:#493256!important;border-color:#bf99d5!important;color:#fff7ff!important;box-shadow:inset 0 0 0 1px #b78dce50!important}
:root[data-theme="dark"] body :is(.faction-picker button,.avatar-picker button,.theme-picker button,.level-button,.hero-theme-note,.resident-chip,.hero-chip,.royal-chip,.resident-shop-link,.multiplayer-link,.chat-message.mine){background:#352840!important;border-color:#705681!important;color:#f2e4fc!important}
:root[data-theme="dark"] .resident-chip span{color:#f2e4fc!important}
:root[data-theme="dark"] body :is(input,textarea,select){background:#21192c!important;border-color:#79628a!important;color:#fff7ff!important;caret-color:#e2baf7}
:root[data-theme="dark"] body input:read-only{background:#31243b!important;color:#d8c5e3!important}
:root[data-theme="dark"] body ::placeholder{color:#b6a3c3!important;opacity:1}
:root[data-theme="dark"] body :is(dialog,.game-dialog,.leave-dialog,.inventory-dialog,#match-overlay){background:#2b2135!important;border:1px solid #745b84!important;color:#f6edfc!important;box-shadow:0 16px 60px #0009!important}
:root[data-theme="dark"] body dialog::backdrop{background:#100b19c9!important}
:root[data-theme="dark"] body :is(.board-frame,.board-shell,.board-rim,.board-heading,.board-bottom,.floor-bar,.board-wrap){background:#251c31!important;border-color:#6b527b!important;box-shadow:none!important}
:root[data-theme="dark"] body :is(.meter,.goal-progress,.mission-card progress,.mission-card progress::-webkit-progress-bar){background:#493953!important}
:root[data-theme="dark"] body :is(.stamp-row .stamped b,.selected-ownership,.item-price.owned,.mission-status,.feedback.success){color:#d3eccd!important}
:root[data-theme="dark"] body :is(.feedback.error,.feedback.invalid,.leave-link){color:#ffc0d0!important}
:root[data-theme="dark"] body :is(.hero-kicker,.hero-copy p,.hero-copy h1,.hero-link){color:#fff7ff!important}
:root[data-theme="dark"] body :is(.topbar,.shop-header,.castle-footer,.shop-footer,.welfare-footer,footer,.section-heading,.game-card-bottom,.resident-account-actions,.shelf-footer,.preview-bottom,.draw-rules,.category-row,.reading-bottom,.record-heading){border-color:var(--border-dark)!important}
:root[data-theme="dark"] button.site-theme-toggle{background:#352742!important;border-color:#a581bb!important;color:#f6e7ff!important}
:root[data-theme="dark"] button.site-theme-toggle:hover{background:#493355!important}
:root[data-theme="dark"] a:focus-visible,:root[data-theme="dark"] button:focus-visible,:root[data-theme="dark"] input:focus-visible{outline:3px solid #e3b5ff!important;outline-offset:3px}
@media(max-width:760px){.site-theme-toolbar{padding:5px 18px 0;min-height:38px}button.site-theme-toggle{min-height:30px;font-size:10px;padding:4px 11px}}
@media(prefers-reduced-motion:reduce){.site-theme-toggle{transition:none}}

:root[data-theme="dark"] .royal-security{background:var(--surface-dark);border-color:var(--border-dark)}
:root[data-theme="dark"] .hero{background:#2c203c}
:root[data-theme="dark"] .hero-shade{background:linear-gradient(90deg,#20162fe8 0%,#2b1d40b8 40%,#261b3750 75%),linear-gradient(0deg,#21162f85,transparent 45%)}
:root[data-theme="dark"] body :is(.attendance-home,.castle-pin,.game-badge,.notice-label,.filter-row button,.mobile-preview-bar,.mobile-preview-bar button){background:var(--raised-dark)!important;border-color:#715582!important;color:var(--text-dark)!important}
:root[data-theme="dark"] body .filter-row button.selected{background:#654878!important;border-color:#bf99d5!important}
:root[data-theme="dark"] .hero-bottom{color:#f1e0f8!important;text-shadow:0 1px 3px #160c27}
:root[data-theme="dark"] body :is(.fortune-banner,.shop-banner,.story-book){background:var(--surface-dark)!important;border-color:var(--border-dark)!important}
:root[data-theme="dark"] .fortune-banner-action{background:var(--raised-dark)!important;border-color:var(--border-dark)!important}
:root[data-theme="dark"] body :is(.mission-login,.attendance-wallet,.attendance-shop,.attendance-notice,.art-caption){background:var(--surface-dark)!important;border-color:var(--border-dark)!important;color:var(--text-dark)!important}
:root[data-theme="dark"] body :is(.divider span,.mode-options strong){background:var(--raised-dark)!important;color:var(--text-dark)!important}
:root[data-theme="dark"] body :is(#reward-help,.item-check,#help span,.bench-trim span){background:var(--raised-dark)!important;border-color:var(--border-dark)!important;color:var(--text-dark)!important}
:root[data-theme="dark"] .mode-art em{color:#e9c3e5!important}
@media(max-width:760px){:root[data-theme="dark"] .hero-shade{background:linear-gradient(0deg,#2c203c 0%,#2c203c00 40%)}:root[data-theme="dark"] .hero-image{filter:brightness(.77)}}

:root[data-theme="dark"] .hero-image-day{display:none}:root[data-theme="dark"] .hero-image-night{display:block;filter:none}:root[data-theme="dark"] .hero-shade{background:linear-gradient(90deg,#19142166,transparent 60%)}:root[data-theme="dark"] .hero{background:#19182f}:root[data-theme="dark"] .level-page-tabs button{background:#33283e;border-color:#705681;color:#f5edf9}:root[data-theme="dark"] .level-page-tabs button[aria-pressed=true]{background:#654878;border-color:#bf99d5}
@media(max-width:760px){:root[data-theme="dark"] .hero-shade{background:linear-gradient(0deg,#19182f 0%,#19182f00 32%)}}
