/* Shared Lunar palette: every menu uses the same surfaces and contrast pairs. */
:root{--lunar-night:#151d38;--lunar-panel:#212d4c;--lunar-raised:#293b58;--lunar-selected:#3b547c;--lunar-ink:#e9eef9;--lunar-muted:#b8c8df;--lunar-edge:#7185a4;--lunar-light:#aac9f2;--lunar-gold:#f0c875;color-scheme:dark}
#modal,#modal:has(.lunar-dex71){background:var(--lunar-night);color:var(--lunar-ink);border:1px solid #aebed6;box-shadow:0 20px 70px #080e2280}
#modal .modal-head,#modal:has(.lunar-dex71) .modal-head{background:#263653;border-color:var(--lunar-edge)}
#modal .modal-head span{color:#f3f5fd}#modal .modal-head>div>small{color:var(--lunar-muted)}
#modal .modal-head button{background:var(--lunar-panel);border-color:#90a8cc;color:#eff4ff}
#modal #modalBody{background:var(--lunar-night);color:var(--lunar-ink);font-family:system-ui;line-height:1.5;color-scheme:dark}
#modal #modalBody :where(span,div,li,section,article,dl,ul,form){color:inherit}
#modal #modalBody a{color:#c0daff;text-decoration:underline}
#modal #modalBody :where(h1,h2,h3,h4,h5,strong,b,summary,label,dt,dd,output){color:inherit}
#modal #modalBody :where(p,small,em,.section-label,.box-sort,.dex-results,.rest-label,.dex-form-label,.map-place-label,.atlas-help,.journal-footer,.dex-adaptation,.dex-number,.evolution-terminal,.evolution-rules-note,.options-note55,.menu-footnote,.move-status71){color:var(--lunar-muted)}
#modal #modalBody .menu-footnote,#modal #modalBody .evolution-rules-note,#modal #modalBody .evolution-card-note,#modal #modalBody .move-status71{color:var(--lunar-muted)!important}
#modal #modalBody :where(button,.menu-btn,.menu-action55,select,input,textarea){background:var(--lunar-raised);color:var(--lunar-ink);border:1px solid var(--lunar-edge);border-radius:10px;box-shadow:none;text-shadow:none;min-height:44px;line-height:1.45}
#modal #modalBody :where(button,.menu-btn,.menu-action55){transition:background .12s,border-color .12s}
#modal #modalBody :where(select,input,textarea){max-width:100%;min-width:0;font-size:16px;padding:10px 12px;accent-color:#aac9f2}
#modal #modalBody :where(input[type=range],input[type=checkbox]){padding:0;min-height:24px}
#modal #modalBody input::placeholder{color:#b8c8df;opacity:1}
#modal #modalBody input[type=file]::file-selector-button{background:#3b547c;color:#fff;border:1px solid #aac9f2;border-radius:7px;padding:9px;margin-right:10px}
#modal #modalBody :where(button,.menu-action55):hover:not(:disabled){background:#344b70;border-color:#b1caeb}
#modal #modalBody :where(button.selected,button[aria-pressed=true],button[aria-selected=true],.selected>button){background:var(--lunar-selected);color:#fff;border-color:#b5cdef;box-shadow:inset 3px 0 #aac9f2}
#modal #modalBody button.primary{background:#aac9f2;border-color:#cbdfff;color:#142342;font-weight:700}
#modal #modalBody button.primary:hover:not(:disabled){background:#c4dbfc;color:#142342}
#modal #modalBody :where(button:disabled,input:disabled,select:disabled){background:#242c42;color:#b5bfd3;border-color:#5d6b84;opacity:1;cursor:not-allowed;box-shadow:none}
#modal #modalBody :where(.danger-button,#confirmRestart){background:#492f44;color:#ffcfce;border-color:#d5959b}
#modal #modalBody :where(.lunar-hero71,.research-hero60,.research-card60,.pokemon-profile,.box-selected,.box-top,.bag-wallet,.bag-description,.dex-entry-hero,.dex-entry-panel,.ability-card,.matchup-panel,.preview60,.trainer-preview>div,.learn-heading,.clock-face,.clock-periods>div,.atlas-details,.atlas-objective,.journal-card,.journal-empty,.journal-condition,.rumor-card55,.mission-card,.quest-current,.legend-entry,.gym-intro47,.resident49,.side-card49,.options-status55,.save-status47,.timeline71 article,.release71,.comparison71>section,.evolution-card,.evolution-card header,.dex-bio dl>div,.dex-move-list article,.habitat-list li,.move-list>div,.trial-progress47 span,.rune-progress span,.gba-pause .pause-roster,.gba-pause .pause-avatar,.team-card,.bag-card,.dex-detail,.chapter-map,.regional-map,.dex-habitat,.journal-heading>span,.journal-symbol,.preferences47 .check47){background:var(--lunar-panel);color:var(--lunar-ink);border-color:var(--lunar-edge);border-radius:12px;box-shadow:none}
#modal #modalBody .lunar-hero71{background:radial-gradient(circle at 95% 0%,#35476b,transparent 60%),var(--lunar-panel)}
#modal #modalBody .lunar-hero71 :where(h3,small){color:var(--lunar-ink)}
#modal #modalBody .lunar-hero71 small{color:var(--lunar-muted)}
#modal #modalBody .party-slot{background:var(--lunar-panel);color:var(--lunar-ink);border-color:var(--lunar-edge)}
#modal #modalBody .party-slot.lead{background:#2a405c;border-left:4px solid #a7c8f5;padding-left:7px}
#modal #modalBody .party-slot.fainted{background:#352f43;opacity:1;border-style:dashed}
#modal #modalBody :where(.party-copy strong,.party-chevron,.action-icon55,.menu-action55>b,.party-copy .hp-numbers,.bag-item-list span,.clock-face strong,.clock-periods b,.dex-clean-grid strong,.journal-card summary strong,.atlas-toolbar>span){color:var(--lunar-ink)}
#modal #modalBody :where(.party-hp,.profile-xp,.journal-tabs,.storage-grid){background:#17233c;border-color:var(--lunar-edge)}
#modal #modalBody :where(.party-hp,.profile-xp){overflow:hidden}
#modal #modalBody .empty-box-slot{background:#1b2742;border:1px dashed #7185a4}
#modal #modalBody .storage-grid small{background:#17233ce8;color:var(--lunar-ink)}
#modal #modalBody :where(.gba-tabs button.selected,.journal-tabs button.selected,.bag-pockets button.selected,.dex-entry-tabs button.selected,.clock-periods .selected,.trial-progress47 .done,.rune-progress .done){background:var(--lunar-selected);color:#fff;border-color:#b5cdef}
#modal #modalBody .bag-item-list button.selected{background:var(--lunar-selected);border-color:#b5cdef;box-shadow:inset 3px 0 #aac9f2}
#modal #modalBody .bag-description{border-left:3px solid #aac9f2}
#modal #modalBody :where(.lunar-dex71 .dex-clean-grid .dex-item,.lunar-dex71 .dex-clean-grid .dex-item.caught){background:linear-gradient(145deg,#293b58,#1b2843);color:var(--lunar-ink);border-color:#7a92b5}
#modal #modalBody .lunar-dex71 .dex-clean-grid .dex-item.caught{box-shadow:inset 0 3px #aac9f2}
#modal #modalBody .lunar-dex71 .dex-item .dex-number{color:#c4d5ee}
#modal #modalBody .lunar-dex71 :is(.dex-item,.dex-entry-art) img.silhouette{filter:brightness(0) invert(.7);opacity:.8}
#modal #modalBody .lunar-dex71 progress{appearance:none;-webkit-appearance:none;background:#3d4b65;border-radius:8px;overflow:hidden;color:#aac9f2;accent-color:#aac9f2}
#modal #modalBody .lunar-dex71 progress::-webkit-progress-bar{background:#3d4b65;border-radius:8px}
#modal #modalBody .lunar-dex71 progress::-webkit-progress-value{background:#aac9f2;border-radius:8px}
#modal #modalBody .lunar-dex71 progress::-moz-progress-bar{background:#aac9f2;border-radius:8px}
#modal #modalBody .journal-goal{background:linear-gradient(120deg,#293b58,#354e75);color:#f3f5fd;border-color:#849bbd}
#modal #modalBody .journal-goal .journal-map-btn{background:#263653;color:#f0d494;border-color:#8d9eb8}
#modal #modalBody :where(.journal-card.ready .journal-symbol,.new71){background:#f0c875;color:#202d46}
#modal #modalBody :where(.journal-card.complete .journal-symbol,.league-list .done){background:#263f46;color:#b4eed5}
#modal #modalBody .landscape-note52{background:transparent;color:var(--lunar-ink);border-left-color:#aac9f2}
#modal #modalBody :where(.timeline71 article:before){background:#aac9f2;border-color:#151d38}
#modal #modalBody :where(.restart-section55,.dex-filters71,.comparison71>section){border-color:var(--lunar-edge)}
#modal #modalBody .restart-section55 summary{color:#ffcfce}
#modal #modalBody .trainer-error54{color:#ffbdc0}
#modal #modalBody :where(.matchup-chip,.form-tag71,.profile-type){background:#293b58;color:#e9eef9;border:1px solid #8096b6}
#modal #modalBody :where(.matchup-chip.weak,.preview60 .immune60,.attack-matchup.ineffective){background:#472e3b;color:#ffd0bc;border-color:#d6998b}
#modal #modalBody :where(.matchup-chip.immune){background:#342f55;color:#dfd5ff;border-color:#ac9dd2}
#modal #modalBody :where(.preview60 .strong60,.attack-matchup.effective){color:#b3f0d3}
#modal #modalBody .preview-mini60{color:#c2d5ee}
/* Type names remain readable regardless of the original type colour. */
:is(#modal,#battle) .type-badge{background:#293b58!important;color:#f3f5fd!important;border:1px solid #8ba0bf;border-left:4px solid var(--type,#aac9f2);text-shadow:none}
#dialogue{background:var(--lunar-night);color:var(--lunar-ink);border-color:#9aafcf}
#dialogue strong{color:#d2e3ff}#dialogue p{color:var(--lunar-ink)}
#dialogue #dialogueNext{background:var(--lunar-raised);color:var(--lunar-ink);border-color:var(--lunar-edge)}
#battle .battle-shell,#battle .battle-actions{background:var(--lunar-night);color:var(--lunar-ink)}
#battle .battle-top,#battle #battleLog{background:#263653;color:#f3f5fd}
#battle .battle-actions button,#battle .battle-actions button.attack{background:var(--lunar-raised);color:var(--lunar-ink);border:1px solid #8ca2c4;box-shadow:none}
#battle .battle-actions button:disabled{background:#242c42;color:#b5bfd3;opacity:1}
#battle .battle-actions :where(small,.attack-matchup){color:#c4d5ee}
#battle .attack-matchup.effective{color:#b3f0d3}#battle .attack-matchup.ineffective{color:#ffd0bc}
#battle :where(.enemy-status,.my-status){background:#212d4cf5;color:#f3f5fd;border-color:#9aafcf}
#battle :where(.battle-exp-text,.battle-exp b){color:#d3e2f7}
#evolution>div{background:var(--lunar-night);color:var(--lunar-ink);border-color:#9aafcf}
.title54{background:#151d38}.title-art54{background-image:linear-gradient(90deg,#151d38b8,#151d38a8),url('assets/auralia-atlas-final.png')}.title54::before{background:linear-gradient(0deg,#151d38f5,transparent 85%)}
.title-panel54{background:#212d4ce8;border:1px solid #7185a4;border-radius:16px;padding:22px}.title-panel54>small,.title-panel54 footer{color:#d2dff2}.title-panel54 footer small{color:#b8c8df}
.title-panel54 .title-secondary54,.title-tools71 button{background:#293b58;color:#e9eef9;border:1px solid #7185a4;border-radius:9px}
.version-bar71 button{background:#aac9f2;color:#142342;border:1px solid #cbdfff}
:is(#modal,#battle,#dialogue,.title54) :where(button,input,select,summary):focus-visible{outline:3px solid #f0c875;outline-offset:3px}
@media(prefers-reduced-motion:reduce){#modal #modalBody :where(button,.menu-action55){transition:none}}
@media(max-width:600px){.title-panel54{padding:18px}#modal #modalBody .region-grid60 button{min-width:0}#modal #modalBody .lunar-dex71 .dex-number{font-size:10px}}

#modal #modalBody :where(.pause-note,.map-legend){color:var(--lunar-muted)!important}
#modal #modalBody :where(.type){background:#293b58;color:#f3f5fd;border:1px solid #8ba0bf}
#modal #modalBody :where(.pause-resources,.team-subtitle,.dex-summary,.dex-count){color:#d2e3ff}
#modal #modalBody :where(.type-badge,.matchup-chip,.new71,.form-tag71){min-height:0}
#modal #modalBody button.primary :where(small,p,span,strong){color:#142342}
#battle .battle-actions :where(button.attack small,button small){color:#c4d5ee}

#modal #modalBody button.primary:disabled{background:#242c42;color:#b5bfd3;border-color:#5d6b84}
#modal #modalBody button.primary:disabled :where(small,p,span,strong){color:#b5bfd3}
.title-panel54 .title-secondary54{margin-top:8px;padding:12px}
