:root { --polish-art: './assets/ui/polish/'; }
#home .mode-card { border: 0; border-image: none; background-color: transparent; }
#home .mode-card::after { content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none; border: 15px solid transparent; border-image: url('./assets/ui/polish/mode-card-edge.webp') 44 fill / 15px; }
#home .mode-card :is(strong,small) { position: relative; z-index: 3; color: #f1e3c4; text-shadow: 0 2px 3px #111,0 0 5px #111; }
#chapter-list .chapter-symbol { background-size: contain; background-repeat: no-repeat; background-position: center; }
#chapter-list [data-status="locked"] .chapter-symbol { background-image: url('./assets/ui/polish/map-status-locked.webp'); }
/* 27-B: the story map marks cleared chapters as "cleared" (was "done" — cleared chapters showed a padlock) */
#chapter-list [data-status="cleared"] .chapter-symbol { background-image: url('./assets/ui/polish/map-status-clear.webp'); }
#chapter-list [data-status="current"] .chapter-symbol { background-image: url('./assets/ui/polish/map-status-current.webp'); }
#story-map-paths image.travelled { opacity: 1; filter: drop-shadow(0 0 2px #f1e3c4) sepia(1) saturate(4) hue-rotate(320deg); }
#story-map-paths image.locked { opacity: .5; filter: sepia(1) saturate(3) hue-rotate(320deg); }
#chapter-panel .chapter-profile { padding: 5px; background: url('./assets/ui/polish/inset-parchment.webp') center / 172px 172px repeat; }
#dialogue, #deck-editor, #card-detail, #menu, #records, #battle, #game-over { background: url('./assets/ui/polish/inset-parchment.webp') center / 170px 170px repeat; color: #211b18; }
#dialogue-stage { background: url('./assets/ui/polish/inset-parchment.webp') center / 170px 170px repeat; border: 0; }
#dialogue-portraits.phase2-portraits figure { background: url('./assets/ui/polish/portrait-mat.webp') center / cover no-repeat; }
#dialogue-portraits.phase2-portraits img { background: transparent; border: 0; }
#dialogue-portraits figcaption { background: url('./assets/ui/polish/inset-parchment.webp') center / 170px 170px repeat; color: #211b18; }
#dialogue-next { border: 14px solid transparent; border-image: url('./assets/ui/polish/dialogue-text-panel.webp') 40 fill / 14px; background: transparent; color: #211b18; }
#dialogue-next:active { filter: brightness(.92); }
#dialogue-position { color: #51412e; }
#selection .nation-choice, #selection .nation-choice[aria-pressed="true"] { position: relative; border: 0; border-image: none; background: none; }
#selection .nation-choice::before, #selection .nation-choice::after { display: none; }
#selection .nation-choice { height: 205px; padding: 0; overflow: visible; }
#selection .nation-portrait { width: min(142px,100%); height: 178px; object-fit: contain; filter: none; }
#selection .nation-copy { position: relative; z-index: 1; width: 100%; margin-top: -39px; padding: 0 3px; line-height: 1.2; text-align: center; }
#selection .nation-choice[data-nation="merodin"] .nation-portrait { content: url('./assets/ui/polish/practice-flag-merodin.webp'); }
#selection .nation-choice[data-nation="merodin"][aria-pressed="true"] .nation-portrait { content: url('./assets/ui/polish/practice-flag-merodin-selected.webp'); }
#selection .nation-choice[data-nation="sabelu"] .nation-portrait { content: url('./assets/ui/polish/practice-flag-sabelu.webp'); }
#selection .nation-choice[data-nation="sabelu"][aria-pressed="true"] .nation-portrait { content: url('./assets/ui/polish/practice-flag-sabelu-selected.webp'); }
#selection .nation-choice .nation-copy strong, #selection .nation-choice[aria-pressed="true"] .nation-copy strong { font-size: 15px; color: #f1e3c4; text-shadow: -1px -1px 2px #211b18,1px 1px 3px #211b18,0 0 5px #211b18; }
#selection #nation-title, #selection .practice-sheet h3 { display: flex; align-items: center; justify-content: center; width: min(176px,100%); height: 36px; max-height: 40px; margin: 0 auto 8px; padding: 0 14px; background: url('./assets/ui/polish/practice-section-rail.webp') center / 100% 100% no-repeat; color: #f1e3c4; font-size: 16px; line-height: 1; text-shadow: 0 1px 2px #211b18; }
#selection .practice-sheet :is(.practice-deck,#difficulty-choices) { background: none; padding: 0; }
#selection .practice-sheet .practice-deck :is(p,#deck-open), #selection .practice-sheet #difficulty-choices button { color: #211b18; text-shadow: none; }
#selection .practice-sheet .practice-deck h3 { margin-top: 0 !important; }
#deck-editor { overflow-y: auto; }
#deck-editor .deck-summary, #deck-editor #deck-actions { background: url('./assets/ui/polish/inset-parchment.webp') center / 170px 170px repeat; color: #211b18; }
#deck-editor .deck-row { background: url('./assets/ui/polish/deck-row.webp') center / 100% 100% no-repeat; border: 0; }
#deck-editor .deck-cost-column > div { background: url('./assets/ui/polish/deck-cost-track.webp') center / 100% 100% no-repeat; padding: 6px 7px; }
#deck-editor .deck-cost-column i { background: url('./assets/ui/polish/deck-cost-fill.webp') center bottom / 100% 100% no-repeat; }
#deck-editor .deck-quantity button { border: 0; border-image: none; background: url('./assets/ui/polish/btn-quantity.webp') center / contain no-repeat; color: #f1e3c4; font-size: 26px; line-height: 1; text-shadow: -1px -1px 2px #211b18,1px 1px 2px #211b18; }
#deck-editor .deck-quantity button:active { background-image: url('./assets/ui/polish/btn-quantity-pressed.webp'); }
#deck-editor .deck-quantity span { color: #f1e3c4; font-size: 17px; font-weight: 700; text-shadow: 0 1px 2px #211b18; }
#deck-editor #deck-reason, #deck-editor #deck-save-status { color: #672619; min-height: 1.5em; }
#deck-editor #deck-actions { gap: 9px; padding: 11px 8px max(12px,env(safe-area-inset-bottom)); }
#deck-list .deck-card.war-card { --frame: url('./assets/ui/polish/card-front-compact.webp'); background: transparent; }
.card-back-face { border: 0; border-image: none; background: url('./assets/ui/polish/card-back-field.webp') center / 100% 100% no-repeat; color: #211b18; }
.card-back-face .back-name, .card-back-face .card-back-effect, .card-back-face .card-movement, .card-back-face .card-matchup { color: #211b18; text-shadow: 0 1px #f1e3c4; }
.card-back-face .card-back-effect { margin-top: 17%; }
.detail-card.war-card, .trap-face.war-card { --frame: url('./assets/ui/polish/card-front-compact.webp'); }
.detail-card.war-card .art, .trap-face.war-card .art, #deck-list .deck-card.war-card .art { left: 10.3%; top: 7.2%; width: 79.3%; height: 69.4%; }
.detail-card.war-card .card-name, .trap-face.war-card .card-name, #deck-list .deck-card.war-card .card-name { left: 10.3%; top: 84.8%; width: 79.3%; height: 8%; color: #211b18; text-shadow: 0 1px #f1e3c4; }
#deck-list .deck-card.war-card .card-name { display: flex; align-items: center; justify-content: center; font-size: 12px; line-height: 1.15; letter-spacing: -.04em; color: #f1e3c4; text-shadow: -1px -1px 2px #211b18,1px 1px 2px #211b18,0 0 3px #211b18; }
.detail-card .card-front, .trap-face .card-front { background: url('./assets/ui/polish/inset-parchment.webp') center / 170px 170px repeat; }
#card-detail-effect { color: #211b18; }
.card-front { background-color: transparent; }
#card-detail-name, #dialogue-title, #battle-content h2, #game-over h2, #records h2, #menu h2 { color: #211b18; }
.battle-hud { position: relative; flex: 0 0 46px; padding: 2px 6px; gap: 4px; border: 0; background: url('./assets/ui/polish/topbar.webp') center / 100% 100% no-repeat; background-color: transparent; }
.battle-hud #supply { flex: 0 0 111px; width: 111px; grid-template-columns: 29px 1fr; padding-left: 10px; }
.battle-hud #supply .supply-gem { width: 25px; height: 25px; }
.battle-hud #supply .supply-value { font-size: 19px; }
.battle-hud #war-log { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; opacity: 0; overflow: hidden; pointer-events: none; }
.battle-hud #menu-open { flex: 0 0 44px; width: 44px; min-width: 44px; min-height: 44px; padding: 0; background: url('./assets/ui/polish/menu-glyph.webp') center / 25px 25px no-repeat; border: 0; border-image: none; -webkit-tap-highlight-color: transparent; }
.battle-hud #menu-open:active { background-image: url('./assets/ui/polish/menu-glyph-pressed.webp'); }
.battle-hud .enemy-hud { margin-left: auto; flex-wrap: nowrap; white-space: nowrap; }
.battle-hud .enemy-hud > * { min-width: 0; }
.battle-hud #notice:not([hidden]) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#turn-banner, #turn-banner.opponent, #tactic-cast.nation-trump { left: 50%; right: auto; width: min(100vw,390px); min-height: 72px; padding: 19px 38px; transform: translateX(-50%); border: 0; border-image: none; background: url('./assets/ui/polish/turn-ribbon.webp') center / 100% 100% no-repeat; background-color: transparent; color: #f1e3c4; font-size: 20px; text-shadow: 0 2px 3px #211b18; }
#turn-banner { animation: polish-banner .9s ease-out both; }
#turn-banner.opponent { background-image: url('./assets/ui/polish/turn-ribbon-opponent.webp'); }
#tactic-cast.nation-trump { top: 38%; animation: polish-banner .9s ease-out both; }
#tactic-cast.nation-trump strong { font-size: 20px; }
@keyframes polish-banner { 0% { opacity: 0; translate: 0 12px; } 18%,80% { opacity: 1; translate: 0 0; } 100% { opacity: 0; translate: 0 -8px; } }
#war-subtitles { position: absolute; z-index: 9; left: 4%; right: 4%; bottom: 185px; display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: none; }
#war-subtitles > span { display: block; width: min(100%,360px); min-height: 35px; padding: 6px 26px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: center; color: #f1e3c4; text-shadow: 0 1px 3px #111; background: url('./assets/ui/polish/war-record-ribbon.webp') center / 100% 100% no-repeat; filter: drop-shadow(0 2px 2px #211b18); animation: record-rise 1.6s ease-out both; }
@keyframes record-rise { 0% { opacity: 0; transform: translateY(18px); } 15%,68% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-14px); } }
#hand { background: url('./assets/ui/polish/hand-tray.webp') center / 100% 100% no-repeat; border: 0; }
#tutorial { border: 0; border-image: none; background: url('./assets/ui/polish/tutorial-ribbon.webp') center / 100% 100% no-repeat; color: #211b18; }
#tutorial p { color: #211b18; }
#tutorial button { flex-basis: 96px; white-space: normal; }
#battle-content { color: #211b18; }
#battle-content .battle-army { border: 13px solid transparent; border-image: url('./assets/ui/polish/force-panel-player.webp') 48 fill / 13px; background: transparent; color: #211b18; }
#battle-content .battle-army.opponent { border-image-source: url('./assets/ui/polish/force-panel-opponent.webp'); }
#battle-content .battle-power :is(strong,span) { color: #211b18; text-shadow: 0 1px #f1e3c4; }
#battle-content .loss { color: #70291f; }
#game-over #result-summary { border: 0; background: url('./assets/ui/polish/inset-parchment.webp') center / 170px 170px repeat; color: #211b18; }
#settings input[type="checkbox"] { appearance: none; -webkit-appearance: none; flex: 0 0 24px; width: 24px; height: 24px; margin: 1px 8px 1px 0; border: 0; background: url('./assets/ui/polish/settings-off.webp') center / contain no-repeat; }
#settings input[type="checkbox"]:checked { background-image: url('./assets/ui/polish/settings-on.webp'); }
#settings label { color: #211b18; }
#records-list { color: #211b18; }
#loading-fill { background: linear-gradient(90deg,#81642e,#d0ad64 45%,#f1e3c4) left / 100% 100% no-repeat, url('./assets/ui/hud3/loading-bar-fill.webp') left center / auto 100% repeat-x; }
.ability-ribbon { position: absolute; z-index: 8; width: 150px; min-height: 40px; padding: 6px 18px; pointer-events: none; background: url('./assets/ui/polish/turn-ribbon.webp') center / 100% 100% no-repeat; color: #f1e3c4; font-size: 12px; line-height: 1.15; text-align: center; text-shadow: 0 1px 3px #211b18; animation: ability-rise .8s ease-out both; }
.ability-ribbon.opponent { background-image: url('./assets/ui/polish/turn-ribbon-opponent.webp'); }
.ability-ribbon strong, .ability-ribbon small { display: block; }
@keyframes ability-rise { 0% { opacity: 0; translate: 0 8px; } 20%,65% { opacity: 1; translate: 0 0; } 100% { opacity: 0; translate: 0 -8px; } }
.war-card[data-ability="true"] .ability-mark { position: absolute; z-index: 6; top: 18%; right: 2%; width: 14%; aspect-ratio: 1; background: url('./assets/ui/polish/map-status-current.webp') center / contain no-repeat; filter: drop-shadow(0 1px 2px #211b18); pointer-events: none; }
@media (max-width:400px) { .battle-hud #supply { flex-basis: 111px; width: 111px; } .battle-hud #menu-open { flex-basis: 44px; width: 44px; min-width: 44px; } .battle-hud .enemy-hud { gap: 1px; } .battle-hud #turn-count { flex-basis: 30px; } }
@media (prefers-reduced-motion:reduce) { #turn-banner, #tactic-cast.nation-trump, #war-subtitles > span, .ability-ribbon { animation: none; } }
body.reduce-motion #turn-banner, body.reduce-motion #tactic-cast.nation-trump, body.reduce-motion #war-subtitles > span, body.reduce-motion .ability-ribbon { animation: none; }
#base-command-panel, #summon-choice { position: absolute; z-index: 12; left: 4px; right: 4px; bottom: 135px; display: flex; justify-content: center; align-items: center; gap: 5px; padding: 5px 6px; min-height: 58px; background: url('./assets/front/select/tab-flag.webp') center / 100% 100% no-repeat; filter: drop-shadow(0 3px 4px #211b18); }
#base-command-panel[hidden], #summon-choice[hidden] { display: none; }
#base-command-panel button, #summon-choice button { flex: 1 1 0; min-width: 0; min-height: 44px; border: 0; border-image: none; background: url('./assets/ui/btn-brass.webp') center / 100% 100% no-repeat; color: #211b18; text-shadow: 0 1px 1px #f1e3c4; font-size: 12px; font-weight: 800; -webkit-tap-highlight-color: transparent; }
#base-command-panel button:active, #summon-choice button:active { background-image: url('./assets/ui/btn-brass-pressed.webp'); }
#base-command-panel button:focus-visible, #summon-choice button:focus-visible { outline: 3px solid #d0ad64; outline-offset: 2px; }
#base-command-panel button:disabled { opacity: .55; }
#base-command-panel button strong { display: block; white-space: nowrap; }
#base-command-panel button small { display: block; font-size: 10px; }
#base-command-panel .command-cost { display: inline-flex; align-items: center; gap: 2px; font-variant-numeric: tabular-nums; }
#base-command-panel .command-gem { width: 13px; height: 13px; background: url('./assets/ui/gem-cost.webp') center / contain no-repeat; }
#base-command-panel .base-command-use { flex: 0 0 55px; }
#summon-choice { overflow-x: auto; justify-content: center; }
#summon-choice button { flex: 0 0 auto; min-width: 82px; padding-inline: 8px; white-space: nowrap; }
#battlefield .summon-target::after { content: ''; position: absolute; left: 50%; top: -12px; width: 40px; height: 50px; transform: translate(-50%, -50%); background: url('./assets/front/select/pin-current.webp') center / contain no-repeat; pointer-events: none; animation: summon-pin-pulse .9s ease-in-out infinite alternate; filter: drop-shadow(0 0 5px #f1e3c4) drop-shadow(0 2px 2px #211b18); }
#war:has(#base-command-panel:not([hidden])) #war-subtitles, #war:has(#summon-choice:not([hidden])) #war-subtitles { bottom: 225px; }
@keyframes summon-pin-pulse { from { opacity: .62; } to { opacity: 1; } }
.battle-hud #supply { position: relative; }
.battle-hud #supply .supply-saved { position: absolute; right: 2px; bottom: -1px; color: #f1e3c4; text-shadow: 0 1px 2px #211b18; font-size: 9px; white-space: nowrap; }
body.reduce-motion #battlefield .summon-target::after { animation: none; }
/* 27-A operator feedback 8 (iPhone) */
/* mode cards: picture fills the whole card; only a soft shade behind the words, words kept inside the brass edge */
#home .mode-card img { top: 0; left: 0; right: 0; bottom: 0; width: 100%; height: 100%; min-height: 100%; object-fit: cover; }
#home .mode-card::after { background: none; }
#home .mode-card::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 62%; z-index: 1; pointer-events: none; background: linear-gradient(transparent, rgb(17 12 10 / 62%)); }
#home .mode-card :is(strong,small) { padding-inline: 24px; }
#home .mode-card small { padding-bottom: 22px; }
/* narration line: no speaker label, quieter type */
#dialogue-next.narration #dialogue-text { font-style: italic; color: #4a3b2c; }
/* top bar: ends keep their shape (9-slice) so the gem and menu sit in the sockets on every phone width */
.battle-hud { background: none; isolation: isolate; }
.battle-hud::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-style: solid; border-width: 0 72px; border-image: url('./assets/ui/polish/topbar.webp') 0 150 fill / 0 72px stretch; }
.battle-hud #supply, .battle-hud #supply:is(*) { flex: 0 0 116px; width: 116px; padding-left: 18px; grid-template-columns: 28px auto; grid-template-rows: 22px 8px; column-gap: 18px; row-gap: 2px; align-content: center; }
.battle-hud #supply .supply-gem { grid-row: 1 / 3; width: 28px; height: 28px; }
.battle-hud #supply .supply-value { grid-column: 2; grid-row: 1; line-height: 22px; }
.battle-hud #supply .gem-track { grid-column: 2; grid-row: 2; width: 46px; }
.battle-hud #menu-open, .battle-hud #menu-open:is(*) { flex: 0 0 44px; width: 44px; min-width: 44px; margin-right: 11px; background-size: 28px 28px; }
/* card back: the front never shows through (Safari ignores backface-visibility on positioned children) and text stays inside the frame */
.flip-card .card-flip-inner > .card-back-face { visibility: hidden; transition: visibility 0s .15s; }
.flip-card.is-back .card-flip-inner > .card-back-face { visibility: visible; }
.flip-card.is-back .card-flip-inner > .card-front { visibility: hidden; transition: visibility 0s .15s; }
.card-back-face, #card-detail-effect.card-back-face { padding: 10% 11% 9%; gap: 6px; overflow: hidden; }
.card-back-face .back-name { max-width: 74%; }
.card-back-face .troop-badge { top: 5%; right: 7%; width: 16%; }
.card-back-face .card-back-effect { margin-top: 4px; }
.card-back-face :is(.card-back-effect,.card-movement) + .card-matchup { margin-top: auto; }
/* 27-B operator feedback 9 (iPhone) */
/* mode card picture stays inside the brass edge */
#home .mode-card img { top: 6px; left: 6px; right: 6px; bottom: 6px; width: calc(100% - 12px); height: calc(100% - 12px); min-height: 0; }
/* tutorial ribbon: words clear of the rolled ends, skip button on one line */
#war #tutorial:not([hidden]) { padding: 8px 14px 8px 26px; gap: 8px; overflow: hidden; max-height: none; }
#tutorial p { margin: 0; font-size: 13px; line-height: 1.4; }
#tutorial button { flex: 0 0 auto; white-space: nowrap; font-size: 13px; padding: 8px 10px; }
/* dialogue controls: chapter list · previous · skip */
#dialogue-controls { display: flex; gap: 8px; margin-top: 8px; }
#dialogue-controls #dialogue-skip { margin: 0 0 0 auto; }
#dialogue-controls button[hidden] { display: none; }
/* no focus box on programmatic focus (title / chosen chapter); keyboard focus still shows */
#dialogue-title:focus, #chapter-list button:focus:not(:focus-visible) { outline: none; }
/* 27-C: story card was darkened over its top half — the old brass-button ::before (inset: 8px) mixed into the shade */
#home .mode-card::before { inset: auto 0 0 0; top: auto; height: 55%; z-index: 1; background: linear-gradient(transparent, rgb(17 12 10 / 58%)); }
/* 27-E: replay the story opening from the chapter map */
#chapters { position: relative; }
#story-prologue:not([hidden]) { position: absolute; z-index: 6; left: 12px; bottom: max(14px, env(safe-area-inset-bottom)); min-height: 40px; padding: 0 22px 0 18px; border: 0; background: url('./assets/front/select/tab-flag-active.webp') center / 100% 100% no-repeat; color: #211b18; font-size: 14px; text-shadow: 0 1px #f1e3c4; box-shadow: none; }
#dialogue.prologue #dialogue-map { opacity: 1; filter: none; }
/* 28-B operator: base command / summon buttons — words centred on the brass plate with a dark outline */
#base-command-panel, #summon-choice { min-height: 64px; padding: 6px 10px; gap: 8px; }
#base-command-panel button, #summon-choice button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 52px; padding: 6px 14px; line-height: 1.15; color: #f1e3c4; text-shadow: -1px -1px 0 #211b18, 1px -1px 0 #211b18, -1px 1px 0 #211b18, 1px 1px 0 #211b18, 0 0 4px #211b18; }
#base-command-panel button strong { font-size: 15px; }
#base-command-panel .command-cost { font-size: 14px; font-weight: 800; }
#base-command-panel .command-gem { width: 15px; height: 15px; }
#base-command-panel button small { font-size: 11px; }
#summon-choice button { font-size: 14px; }
/* story map: chapter numbers, chosen chapter name and the phase-2 seal read over any part of the map */
#story-map-layer .chapter-number { font-size: 19px; text-shadow: -1.5px -1.5px 0 #211b18, 1.5px -1.5px 0 #211b18, -1.5px 1.5px 0 #211b18, 1.5px 1.5px 0 #211b18, 0 0 6px #211b18; }
#story-map-layer .chapter-caption:not([hidden]) { font-size: 14px; font-weight: 700; color: #f1e3c4; text-shadow: -1.5px -1.5px 0 #211b18, 1.5px -1.5px 0 #211b18, -1.5px 1.5px 0 #211b18, 1.5px 1.5px 0 #211b18, 0 0 6px #211b18; }
#phase2-seal:not([hidden]) { color: #f1e3c4; font-weight: 700; text-shadow: -1.5px -1.5px 0 #211b18, 1.5px -1.5px 0 #211b18, -1.5px 1.5px 0 #211b18, 1.5px 1.5px 0 #211b18, 0 0 6px #211b18; }
#chapter-list [data-status] .chapter-symbol { filter: drop-shadow(0 0 3px #211b18) drop-shadow(0 2px 3px #211b18); }
#chapter-list [data-status=locked]::before { opacity: .35; }
#story-map-paths path { stroke-width: 7px; filter: drop-shadow(0 0 2px #f1e3c4); }
#chapter-list button:focus { outline: none; }
#chapter-list button:focus-visible .chapter-symbol { filter: drop-shadow(0 0 4px #f1e3c4) drop-shadow(0 0 2px #f1e3c4); }
/* 28-C: base unit info sits above the base command buttons instead of under them */
#war:has(#base-command-panel:not([hidden])) #unit-panel, #war:has(#summon-choice:not([hidden])) #unit-panel { bottom: 84px; }
/* 28-D operator: several units on one cell — selection shown with a check seal, not a coloured box */
#unit-panel .unit-option, #unit-panel .unit-option:disabled, #unit-panel .unit-option[aria-pressed] { position: relative; display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px 2px 2px; background: none; box-shadow: none; color: #211b18; font-weight: 700; }
#unit-panel .unit-option::before { content: ''; flex: 0 0 22px; width: 22px; height: 22px; background: url('./assets/ui/polish/settings-off.webp') center / contain no-repeat; }
#unit-panel .unit-option[aria-pressed="true"]::before { background: url('./assets/front/select/pin-done.webp') center 0 / 26px auto no-repeat; filter: drop-shadow(0 1px 1px #211b18); }
#unit-panel .unit-option[aria-pressed="false"] { color: #5a4a38; }
/* 30-B batch (operator + tester feedback) */
/* B1: practice flag names sit below the flags, clear of the gold knob */
#selection .nation-choice { height: 222px; }
#selection .nation-copy { margin-top: 2px; }
/* B2: the old hint caption hides while summon places are offered */
#war:has(#summon-choice:not([hidden])) #war-subtitles { display: none; }
/* B3/B14: story map paths stronger; the chosen chapter's name on a scroll ribbon */
#story-map-paths path { stroke: #8a2a1e; stroke-width: 6; stroke-dasharray: 12 8; filter: drop-shadow(0 0 2px #f1e3c4) drop-shadow(0 1px 1px #211b18); }
#story-map-paths path.locked { stroke: #6b5a48; opacity: .55; }
#story-map-layer .chapter-caption:not([hidden]) { width: auto; max-width: 190px; min-width: 120px; padding: 7px 18px 9px; white-space: nowrap; color: #211b18; text-shadow: 0 1px #f1e3c4; background: url('./assets/front/select/tab-flag-active.webp') center / 100% 100% no-repeat; filter: drop-shadow(0 2px 3px #211b18); }
/* B7: unit info never grows over the map; long lists scroll. End-turn a little smaller */
#unit-panel .tooltip-options { max-height: 132px; overflow-y: auto; pointer-events: auto; -webkit-overflow-scrolling: touch; }
#end-turn, #end-turn:disabled { width: 124px; min-width: 124px; height: 50px; min-height: 50px; }
/* B9: chapter sheet — the opening line reads as narration, apart from the enemy name */
#chapter-intro { margin-top: 6px; font-style: italic; color: #4a3b2c; }
/* 32: story opening map follows the narration (tester: "the map never changes — show the territories and the two sides") */
#prologue-map { position: absolute; inset: 0; width: 100%; height: 100%; --px: 1; }
#prologue-map .prologue-art { transition: filter 1s ease; }
#prologue-map.drought .prologue-art { filter: sepia(.55) saturate(.55) brightness(.88); }
#prologue-map g { opacity: 0; transition: opacity .7s ease; }
#prologue-map.show-nations .prologue-nations, #prologue-map[data-deal=promise] .prologue-deal, #prologue-map[data-deal=broken] .prologue-deal, #prologue-map.show-gate .prologue-gate { opacity: 1; }
#prologue-map .territory { stroke: none; }
#prologue-map .territory.merodin { fill: rgb(60 120 210 / 34%); }
#prologue-map .territory.sabelu { fill: rgb(214 112 46 / 34%); }
#prologue-map .border { fill: none; stroke-width: 2.5px; stroke-dasharray: 7 5; vector-effect: non-scaling-stroke; }
#prologue-map .border.merodin { stroke: #2f5fa8; }
#prologue-map .border.sabelu { stroke: #a8431f; }
#prologue-map .prologue-label { font-family: 'Kerbaon Serif', Georgia, serif; font-weight: 700; font-size: calc(var(--px) * 15px); fill: #f1e3c4; stroke: #211b18; stroke-width: calc(var(--px) * 4px); paint-order: stroke; stroke-linejoin: round; }
#prologue-map .prologue-label.merodin { fill: #cfe0ff; }
#prologue-map .prologue-label.sabelu { fill: #ffd9b8; }
#prologue-map .route { fill: none; stroke-width: 4px; stroke-linecap: round; vector-effect: non-scaling-stroke; stroke-dasharray: 100; stroke-dashoffset: 100; }
#prologue-map[data-deal] .route { transition: stroke-dashoffset 1.2s ease .3s, opacity .6s ease; }
#prologue-map[data-deal=promise] .route, #prologue-map[data-deal=broken] .route.horse { stroke-dashoffset: 0; }
#prologue-map .route.horse { stroke: #a8431f; }
#prologue-map .route.grain { stroke: #d9a93f; }
#prologue-map .head-horse { fill: #a8431f; }
#prologue-map .head-grain { fill: #d9a93f; }
#prologue-map[data-deal=promise] .route.grain { stroke-dasharray: 3 3; stroke-dashoffset: 0; }
#prologue-map[data-deal=broken] .route.grain { stroke-dashoffset: 55; opacity: .55; }
#prologue-map .broken-mark { fill: none; stroke: #c0281c; stroke-width: 5px; stroke-linecap: round; vector-effect: non-scaling-stroke; opacity: 0; transition: opacity .4s ease 1s; }
#prologue-map[data-deal=broken] .broken-mark { opacity: 1; }
#prologue-map .gate-ring { fill: none; stroke: #f1c75a; stroke-width: 3px; vector-effect: non-scaling-stroke; transform-box: fill-box; transform-origin: center; animation: prologue-gate 1.6s ease-in-out infinite; }
@keyframes prologue-gate { 50% { transform: scale(1.35); opacity: .45; } }
@media (prefers-reduced-motion: reduce) { #prologue-map .gate-ring { animation: none; } #prologue-map * { transition: none !important; } }
#prologue-map[data-deal=broken] .route.grain { marker-end: none; }
/* 32-C operator: the two warring nations on the chapter map — soft tint and an engraved name, under the paths and pins */
#story-map-nations { position: absolute; pointer-events: none; }
#story-map-nations .nation-tint.merodin { fill: rgb(60 120 210 / 22%); }
#story-map-nations .nation-tint.sabelu { fill: rgb(214 112 46 / 22%); }
#story-map-layer .nation-name { position: absolute; transform: translate(-50%,-50%); pointer-events: none; white-space: nowrap; text-align: center; line-height: 1.15; font-family: 'Kerbaon Serif', Georgia, serif; font-size: 15px; font-weight: 700; letter-spacing: .12em; text-shadow: -1.5px -1.5px 0 #211b18, 1.5px -1.5px 0 #211b18, -1.5px 1.5px 0 #211b18, 1.5px 1.5px 0 #211b18, 0 0 6px #211b18; opacity: .92; }
#story-map-layer .nation-name.merodin { color: #cfe0ff; }
#story-map-layer .nation-name.sabelu { color: #ffd9b8; }
/* 32-D operator: the other three nations too — fainter, so the two at war still lead */
#story-map-nations .nation-tint.derkant { fill: rgb(130 100 190 / 16%); }
#story-map-nations .nation-tint.kaldrehn { fill: rgb(170 40 60 / 16%); }
#story-map-nations .nation-tint.nuarem { fill: rgb(40 150 130 / 16%); }
#story-map-layer .nation-name.derkant, #story-map-layer .nation-name.kaldrehn, #story-map-layer .nation-name.nuarem { font-size: 13px; opacity: .78; }
#story-map-layer .nation-name.derkant { color: #e2d6ff; }
#story-map-layer .nation-name.kaldrehn { color: #ffc9cf; }
#story-map-layer .nation-name.nuarem { color: #c4f0e4; }
/* 32-E: opening scenes (GPT A8) fade over the map; a slow push-in keeps them alive */
#prologue-scenes { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
#prologue-scenes img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 35%; opacity: 0; transition: opacity .9s ease; }
#prologue-scenes img.shown { opacity: 1; animation: prologue-push 9s ease-out both; }
@keyframes prologue-push { from { transform: scale(1); } to { transform: scale(1.07); } }
@media (prefers-reduced-motion: reduce) { #prologue-scenes img { transition: none; } #prologue-scenes img.shown { animation: none; } }
