/* Device-local accessibility preferences. These classes are applied to <html>
   so battle, expedition, and custom dialogs share one presentation contract. */
:root{--pale-maw-text-scale:1;--pale-maw-contrast-surface:#071018;--pale-maw-contrast-text:#f8fffb;--pale-maw-contrast-accent:#b9ffe0}
:root.text-scale-100{--pale-maw-text-scale:1}
:root.text-scale-125{--pale-maw-text-scale:1.25}
:root.text-scale-150{--pale-maw-text-scale:1.5}

/* `zoom` preserves each component's authored type hierarchy instead of
   flattening card and map labels to one inherited font size. CSS zoom already
   accounts for a percentage-sized child in its containing block; adding an
   inverse width here would shrink the playable surface at larger sizes. A
   fixed-height game shell does need the inverse height so short landscapes
   retain their full, scrollable custom dialog surface. */
@supports (zoom:1){
 :root:not(.text-scale-100) #app{zoom:var(--pale-maw-text-scale);height:calc(100dvh / var(--pale-maw-text-scale))}
 :root:not(.text-scale-100) body>.overlay{zoom:var(--pale-maw-text-scale);height:calc(100% / var(--pale-maw-text-scale))}
 :root:not(.text-scale-100) body>:is(.toast,.phase-banner,.float-text,.support-reveal){zoom:var(--pale-maw-text-scale)}
}
@supports not (zoom:1){
 :root.text-scale-125{-webkit-text-size-adjust:125%;text-size-adjust:125%}
 :root.text-scale-150{-webkit-text-size-adjust:150%;text-size-adjust:150%}
}

/* High contrast deliberately changes both luminance and the visible selected
   outline. Settings continue to say On/Off, so no state is color-only. */
:root.strong-contrast{color-scheme:dark;--mint:var(--pale-maw-contrast-accent);--gold:#fff0a8;--pale-maw-contrast-surface:#020508;--pale-maw-contrast-text:#ffffff}
:root.strong-contrast body{background:#000!important;color:var(--pale-maw-contrast-text)!important}
:root.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:#020508!important;background-image:none!important;border-color:#fff!important;box-shadow:none!important;color:var(--pale-maw-contrast-text)!important}
:root.strong-contrast :is(.exp-button,.end-turn,.ghost,.icon-button,.exp-icon-button,.exp-menu-item,.preference-toggle,.controller-binding,.controller-glyph-select select,.preference-slider input,select,input,textarea){background:#07111a!important;border:2px solid #fff!important;color:#fff!important;box-shadow:none!important;text-shadow:none!important}
:root.strong-contrast :is(.exp-button.primary,.end-turn,.pack-primary,.workshop-primary,.preference-toggle[aria-pressed=true],.controller-binding[aria-pressed=true],.exp-menu-item[aria-pressed=true]){background:#fff!important;border-color:#fff!important;color:#000!important;outline:3px solid var(--pale-maw-contrast-accent)!important;outline-offset:2px!important;box-shadow:none!important;text-shadow:none!important}
:root.strong-contrast :is(p,small,span,em,li,dt,dd,.help,.utility-note,.preference-note,.preference-audio-state>strong,.controller-status>strong,.localization-status>strong){color:#fff!important;opacity:1!important;text-shadow:none!important}
:root.strong-contrast :is(.exp-button.primary,.end-turn,.pack-primary,.workshop-primary,.preference-toggle[aria-pressed=true],.controller-binding[aria-pressed=true],.exp-menu-item[aria-pressed=true]) :is(span,b,strong,small,em){color:#000!important}
:root.strong-contrast :is([aria-current=step],.selected,.active,.legal-target){border-color:#fff!important;outline:3px solid var(--pale-maw-contrast-accent)!important;outline-offset:2px!important;box-shadow:0 0 0 5px #000!important}
:root.strong-contrast :is(.health,.mini-health,.exp-party-health,.exp-result-health){border:1px solid #fff!important;background:#000!important}
:root.strong-contrast :is(.health i,.mini-health i,.exp-party-health i,.exp-result-health i){background:var(--pale-maw-contrast-accent)!important}
:root.strong-contrast :is(button,a,input,select,textarea):focus-visible{outline:4px solid #fff300!important;outline-offset:3px!important;box-shadow:0 0 0 7px #000!important}

/* Flash and shake are independent of motion, sound, and vibration. Textual
   combat receipts remain available even when transient visual accents stop. */
:root.flash-effects-off :is(.juice-layer,.attack-feedback-layer,.impact-ring,.impact-particle,.strike-line,.exp-result-sparks,.exp-result-rays){display:none!important}
:root.flash-effects-off .pack-pull.just-revealed,:root.flash-effects-off .pack-pull.just-revealed .pack-card-surface:after{animation:none!important}
:root.flash-effects-off .pack-pull.just-revealed .pack-card-surface:after{content:none!important}
:root.flash-effects-off :is(.number-up,.number-down,.clash-tally.heated b){text-shadow:none!important}
:root.shake-effects-off .attack-impact{animation:none!important}

@media(max-width:380px){
 :root:not(.text-scale-100) .game-preferences{grid-template-columns:1fr}
 :root:not(.text-scale-100) .preference-toggle{min-height:48px}
}
