/* Shared app chrome. Component owners consume semantic palettes; card faces,
   authored artwork and foil shaders are deliberately outside these selectors. */
html[data-theme="light"]{color-scheme:light}
html[data-theme="dark"]{color-scheme:dark}
body,#app,.shell{background-color:var(--pm-ui-ink);color:var(--pm-ui-text)}
.profile-dock{background:var(--pm-ui-surface);color:var(--pm-ui-muted);border-color:var(--pm-ui-line)}
.profile-dock button{color:var(--pm-ui-text)}
.exp-modal,.exp-modal.exp-illustrated,.utility-modal,.game-message{background:var(--pm-ui-surface);color:var(--pm-ui-text);border-color:var(--pm-ui-line);box-shadow:0 20px 60px var(--pm-ui-shadow)}
.exp-modal:not(.modal-reward):not(.modal-shopPack){background-color:var(--pm-ui-surface)}
.exp-modal.exp-illustrated .exp-dialog-body{background:var(--pm-ui-surface);color:var(--pm-ui-text)}
.exp-modal.exp-illustrated>.exp-icon-button:first-child{background:var(--pm-ui-surface-raised);color:var(--pm-ui-text);width:44px;height:44px;min-height:44px;border-color:var(--pm-ui-line);box-shadow:0 3px 10px var(--pm-ui-shadow)}
.exp-overlay,.utility-overlay{background:var(--pm-ui-scrim)}
.exp-modal>:is(h1,h2,h3),.exp-dialog-body>:is(h1,h2,h3),.game-message h2{color:var(--pm-ui-text)}
.exp-modal>p,.exp-dialog-body>p,.game-message p{color:var(--pm-ui-muted)}
.exp-dialog-wallet{background:var(--pm-ui-surface);color:var(--pm-ui-text);border-color:var(--pm-ui-line)}
.exp-dialog-wallet :is(small,.exp-money-label){color:var(--pm-ui-muted)}
.exp-icon-button,.profile-toggle,.topbar button{background:var(--pm-ui-surface-raised);border-color:var(--pm-ui-line);color:var(--pm-ui-text)}
.exp-button{color:var(--pm-ui-text);border-color:var(--pm-ui-line);background:var(--pm-ui-surface-raised)}
.exp-button.primary,.pause-primary>.exp-button{background:var(--pm-ui-accent);color:var(--pm-ui-on-accent)}
.exp-button.danger{background:var(--pm-ui-danger-surface);color:var(--pm-ui-danger)}
.exp-screen-heading :is(h2,small),.ship-heading-bank small{color:var(--pm-ui-text)}
.toast,.exp-receipt{background:var(--pm-ui-surface-raised);color:var(--pm-ui-text);border-color:var(--pm-ui-line);box-shadow:0 8px 28px var(--pm-ui-shadow)}
.pause-system{color:var(--pm-ui-text)}
.pause-system .pause-links{border-color:var(--pm-ui-line)}
.pause-system :is(.pause-links>.exp-button,.pause-ship){color:var(--pm-ui-text)}
.pause-system .game-preferences{color:var(--pm-ui-text)}
.pause-system .game-preferences :is(button,label){background:var(--pm-ui-surface-soft);color:var(--pm-ui-text);border-color:var(--pm-ui-line)}
.pause-system .game-preferences :is(p,.preference-note,.preference-section,.preference-audio-state>strong){color:var(--pm-ui-muted)}
.pause-system .game-preferences input{accent-color:var(--pm-ui-accent)}
html[data-theme="light"] :is(.exp-money,.exp-dialog-wallet .exp-money,.exp-map-heading .exp-money){color:var(--pm-ui-brass)}
html[data-theme="light"] :is(.exp-money.gem,.exp-dialog-wallet .exp-money.gem,.exp-map-heading .exp-money.gem){color:#63528d}
html[data-theme="light"] .pause-system .game-preferences button b{color:var(--pm-ui-text)}
.exploration-system .exp-map-heading,.exploration-system .exp-map-dock{background:color-mix(in srgb,var(--pm-ui-surface) 94%,transparent);color:var(--pm-ui-text);box-shadow:0 8px 24px var(--pm-ui-shadow)}
.exploration-system :is(.exp-map-title h2,.exp-party-copy strong,.exp-path-hint){color:var(--pm-ui-text)}
.exploration-system :is(.exp-map-title>small,.exp-party-copy small,.exp-path-choice small){color:var(--pm-ui-muted)}
.exploration-system :is(.exp-path-choice,.exploration-tools>summary){background:var(--pm-ui-surface-soft);color:var(--pm-ui-text);border-color:var(--pm-ui-line)}
.battle-system .arena-content{color:var(--pm-ui-text)}
.battle-system :is(.hero-heading strong,.hero-heading .hp,.stamina-caption,.selection-help,.hand-heading){color:var(--pm-ui-text)}
.battle-system .end-turn{background:var(--pm-ui-accent);color:var(--pm-ui-on-accent);border-color:var(--pm-ui-line)}
.battle-system .battle-divider{color:var(--pm-ui-text)}
.battle-system .hand-section{background:var(--pm-ui-ink);border-color:var(--pm-ui-line)}
html[data-theme="light"] .battle-system .arena-content{background:color-mix(in srgb,var(--pm-ui-surface) 84%,transparent)}
html[data-theme="light"] .battle-system :is(.unit-slot.empty,.support-slot.empty){background:color-mix(in srgb,var(--pm-ui-surface-raised) 65%,transparent);border-color:var(--pm-ui-line);color:var(--pm-ui-muted)}
html[data-theme="light"] .battle-system .hero-conditions>span{background:var(--pm-ui-surface-raised);color:var(--pm-ui-text)}
html[data-theme="light"].strong-contrast :is(.shell,.exp-modal,.utility-modal,.modal,.panel,.exp-map-heading,.exp-map-dock,.exp-hub,.exp-dialog-body,.exp-modal-body,.collection-modal,.deck-modal,.booster-modal,.toast){background:#fff!important;background-image:none!important;border-color:#000!important;color:#000!important}

.profile-sync{background:var(--pm-ui-surface);color:var(--pm-ui-muted);border-color:var(--pm-ui-line)}
.profile-sync button{background:var(--pm-ui-surface-raised);color:var(--pm-ui-text);border-color:var(--pm-ui-line)}

html[data-theme="light"] :is(.exp-screen-heading,.exp-pager,.exp-hub-top,.exp-resources) .exp-icon-button{background:var(--pm-ui-surface-raised);color:var(--pm-ui-text);border-color:var(--pm-ui-line)}
html[data-theme="light"] .profile-app::before{background:var(--pm-ui-ink)}

/* Quiet, shared chrome: navigation and actions sit on one continuous canvas. */
.shell .exp-button,.shell .exp-button.secondary,.shell .exp-icon-button,.shell .ghost,.shell .icon-button{
 background:var(--pm-ui-surface);color:var(--pm-ui-text);border:1px solid transparent;
 box-shadow:0 3px 9px var(--pm-ui-shadow);border-radius:999px;font-weight:500;
}
.shell .exp-button.primary,.shell .pause-primary>.exp-button,.shell .end-turn{
 background:var(--pm-ui-accent);color:var(--pm-ui-on-accent);border:2px solid var(--pm-ui-surface);
 box-shadow:0 3px 12px var(--pm-ui-shadow);border-radius:999px;
}
.shell .exp-button.danger{color:var(--pm-ui-danger);background:var(--pm-ui-danger-surface)}
.shell .exp-icon-button{width:44px;min-height:44px;border-radius:50%;padding:10px}
.shell .exp-modal>.exp-icon-button:first-child{width:44px;height:44px;min-height:44px;background:var(--pm-ui-surface-raised);color:var(--pm-ui-text);border:0;box-shadow:0 3px 10px var(--pm-ui-shadow)}
.shell .exp-screen-heading{gap:10px;min-height:48px}
.shell .exp-screen-heading h2{font-size:var(--pm-ui-title-size);font-weight:650;letter-spacing:-.025em}
.shell .exp-screen-heading small{font-size:12px;color:var(--pm-ui-muted);letter-spacing:0}
.shell .exp-pager{gap:12px}
.shell .exp-pager>span,.shell .exp-pager em{color:var(--pm-ui-muted)}
.shell .exp-pager .exp-icon-button{width:44px;min-height:44px;flex-basis:44px}
.shell .exp-dialog-wallet{border:0;border-radius:999px;padding:6px 12px;box-shadow:0 3px 10px var(--pm-ui-shadow)}
.shell .exp-dialog-wallet .exp-wallet-label{letter-spacing:.04em;font-size:10px;color:var(--pm-ui-muted)}
.shell .exp-overlay{backdrop-filter:blur(9px);-webkit-backdrop-filter:blur(9px)}
.shell .exp-modal:not(.encounter){border:0;border-radius:28px;box-shadow:0 12px 40px var(--pm-ui-shadow)}
.shell .exp-modal .exp-dialog-body{border:0}
.shell .exp-modal h2{font-size:var(--pm-ui-title-size);letter-spacing:-.025em}
.shell .exp-modal .exp-eyebrow{color:var(--pm-ui-muted);letter-spacing:.06em}
.shell .exp-app>.profile-sync{min-height:24px;padding:0 16px;background:var(--pm-ui-ink);font-size:10px;box-shadow:none}
.shell .exp-app>.profile-sync button{background:none;box-shadow:none;color:var(--pm-ui-muted)}
.shell .exp-app:has(.home-system)>.profile-sync{display:none}
.shell :is(.modal-settings,.modal-pause)>.exp-location-art{display:none}
.shell .exp-overlay:has(.modal-settings)>.exp-dialog-wallet{display:none}
.shell .exp-overlay:has(.modal-inspect)>.exp-dialog-wallet{display:none}
.shell :is(.modal-settings,.modal-pause).exp-illustrated{padding:52px 24px 22px;max-width:480px}
.shell :is(.modal-settings,.modal-pause) .exp-dialog-body{padding:0;overflow-y:auto}
.shell :is(.modal-settings,.modal-pause)>.exp-icon-button:first-child{top:12px;right:14px;box-shadow:none}
.shell .exp-modal.exp-illustrated:is(.modal-settings,.modal-pause){display:flex;flex-direction:column;gap:0;grid-template-rows:none}
.shell .exp-modal.exp-illustrated:is(.modal-settings,.modal-pause) .exp-dialog-body{padding:0;flex:1;min-height:0}
.shell .pause-system{gap:20px}
.shell .pause-system header{text-align:center;padding:0 30px 14px;border-bottom:1px solid var(--pm-ui-line)}
.shell .pause-system header>.exp-eyebrow{display:none}
.shell .pause-system header h2{margin:0;font-size:22px;font-weight:650}
.shell .pause-system .pause-disclosure{border:0;background:none;box-shadow:none;border-radius:0}
.shell .pause-system .pause-disclosure>summary{padding:8px 0;min-height:48px;list-style:none;font-weight:500}
.shell .pause-system .pause-disclosure>summary::after{content:'＋';float:right;color:var(--pm-ui-muted)}
.shell .pause-system .pause-disclosure[open]>summary::after{content:'−'}
.shell .pause-system .pause-links{gap:12px;border:0;padding:0}
.shell .pause-system .pause-links .exp-button{box-shadow:none;background:none;min-height:44px;font-size:14px}
.shell .modal-settings .pause-system>.pause-primary{order:5;margin-top:4px}
.shell .modal-settings .pause-system>.pause-links{order:4}
.shell .modal-settings .pause-system>.pause-disclosure[data-pause-section=preferences]{order:1}
.shell .modal-settings .pause-system>.pause-disclosure[data-pause-section=tools]{order:3}
.shell .modal-settings .pause-system>.pause-ship{order:6}
.shell .game-preferences{display:grid;grid-template-columns:1fr 1fr;gap:12px;border:0;background:none;padding:0;box-shadow:none;color:var(--pm-ui-text)}
.shell .game-preferences .preference-toggle{background:var(--pm-ui-surface);color:var(--pm-ui-text);border:0;border-radius:20px;box-shadow:none;padding:12px;min-height:48px;font-size:14px;font-weight:400;gap:8px}
.shell .game-preferences .preference-toggle b{font-size:13px;color:var(--pm-ui-muted);font-weight:500}
.shell .game-preferences .preference-theme{grid-column:1/-1;background:var(--pm-ui-surface-raised);border-radius:999px;padding:12px 18px}
.shell .game-preferences .preference-toggle[aria-pressed]{box-shadow:none}
.shell .game-preferences .preference-toggle[aria-pressed] b{display:block;position:relative;flex:0 0 34px;width:34px;height:20px;font-size:0;border-radius:999px;background:var(--pm-ui-line)}
.shell .game-preferences .preference-toggle[aria-pressed] b:after{content:'';position:absolute;left:3px;top:3px;width:14px;height:14px;border-radius:50%;background:var(--pm-ui-surface);transition:transform 120ms ease}
.shell .game-preferences .preference-toggle[aria-pressed=true] b{background:var(--pm-ui-accent)}
.shell .game-preferences .preference-toggle[aria-pressed=true] b:after{transform:translateX(14px)}
@media(prefers-reduced-motion:reduce){.shell .game-preferences .preference-toggle[aria-pressed] b:after{transition:none}}
.calm-motion .game-preferences .preference-toggle[aria-pressed] b:after{transition:none}
.shell .game-preferences .preference-slider{grid-column:1/-1;border:0;background:var(--pm-ui-surface-soft);border-radius:18px;box-shadow:inset 0 1px 3px var(--pm-ui-shadow);padding:16px;gap:16px;color:var(--pm-ui-text);font-size:14px}
.shell .game-preferences .preference-slider>span{display:flex;justify-content:space-between;gap:12px}
.shell .game-preferences .preference-slider output{font-size:12px;color:var(--pm-ui-muted)}
.shell .game-preferences .preference-slider input{width:100%;min-height:28px;accent-color:var(--pm-ui-accent)}
.shell .game-preferences .preference-slider input[type=range]{appearance:none;-webkit-appearance:none;background:transparent;border:0;padding:0;box-shadow:none}
.shell .game-preferences .preference-slider input::-webkit-slider-runnable-track{height:4px;background:var(--pm-ui-accent);border-radius:99px}
.shell .game-preferences .preference-slider input::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:22px;height:22px;margin-top:-9px;border:0;border-radius:50%;background:var(--pm-ui-surface);box-shadow:0 2px 7px var(--pm-ui-shadow)}
.shell .game-preferences .preference-slider input::-moz-range-track{height:4px;background:var(--pm-ui-accent);border-radius:99px}
.shell .game-preferences .preference-slider input::-moz-range-thumb{width:22px;height:22px;border:0;border-radius:50%;background:var(--pm-ui-surface);box-shadow:0 2px 7px var(--pm-ui-shadow)}
.shell .game-preferences .preference-section{grid-column:1/-1;margin:16px 0 0;font-size:17px;letter-spacing:0;text-transform:none;color:var(--pm-ui-text);font-weight:500}
.shell .game-preferences .preference-audio-state{grid-column:1/-1;border:0;background:none;padding:0;box-shadow:none;color:var(--pm-ui-muted)}
.shell .game-preferences .preference-audio-state[data-audio-state=on]{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.shell .game-preferences .preference-note{grid-column:1/-1;color:var(--pm-ui-muted);font-size:12px;line-height:1.5}
@media(max-width:600px){
 .shell .exp-overlay:has(.modal-settings){padding:12px 0 0;align-items:flex-end}
 .shell .exp-overlay .modal-settings.exp-illustrated{width:100%;max-width:none;max-height:90dvh;border-radius:28px 28px 0 0;padding:52px 24px max(22px,env(safe-area-inset-bottom))}
}
