/* Lantern, brass and ivory across the existing adventure. This layer owns no
   screen visibility, reward state, gameplay controls, or combat coordinates. */
html[data-polish="ready"] {
  --polish-ivory: #f8eed7;
  --polish-brass: #e4bd78;
  --polish-teal: #82bfb3;
  --polish-edge: #e9d4a347;
  --polish-shadow: #030e1766;
  --polish-ink: #15332f;
}
html[data-polish="ready"][data-polish-act="1"] { --polish-teal: #91c4d5; }
html[data-polish="ready"][data-polish-act="2"] { --polish-teal: #b3afd4; }

/* The same bevel and lower edge make earned objects feel tangible. */
html[data-polish="ready"] :is(.pg-reward-choice, .pg-relic-card, .st-detail, .cg-gear article, .af-earned-item) {
  box-shadow: inset 0 1px #fff6dc24, inset 0 -2px #06181970, 0 7px 18px var(--polish-shadow);
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}
html[data-polish="ready"] :is(.cp-branch, .cp-next-step, .cp-compare-member, .cp-swap-action) {
  box-shadow: inset 0 1px #fffdf0d9, inset 0 -2px #66734922, 0 5px 15px #18352816;
}
html[data-polish="ready"] .pg-rewards {
  border-color: #d9b97d80;
  background: radial-gradient(ellipse at 50% 0, #dfb96721, transparent 63%), linear-gradient(145deg, #233b35, #102725);
  box-shadow: inset 0 1px #f5e4ba33, inset 0 -3px #03141666, 0 12px 26px #020e142e;
}
html[data-polish="ready"] .pg-reward-choice {
  background: radial-gradient(ellipse at 50% 18%, #c7c3921a, transparent 61%), linear-gradient(150deg, #244038, #112825 78%);
  border-color: #bdaa776b;
  animation: polish-object-arrive 360ms ease-out both;
  animation-delay: var(--pg-arrive, 0s);
}
html[data-polish="ready"] .pg-reward-choice::before {
  content: "";
  position: absolute;
  top: 112px;
  left: 50%;
  width: 100px;
  height: 19px;
  margin-left: -50px;
  border: 1px solid #e5cb8b25;
  border-radius: 50%;
  background: radial-gradient(ellipse, #051613bf, #071c1a42 63%, transparent 72%);
  box-shadow: 0 4px 0 #0413104d, inset 0 1px #fff0bd1c;
  pointer-events: none;
}
html[data-polish="ready"] .pg-reward-choice > .pg-relic-art {
  position: relative;
  filter: drop-shadow(3px 8px 3px #0314169c) drop-shadow(0 -1px 1px #ffe9ac24);
  transform: perspective(600px) rotateX(7deg) rotateY(-7deg);
  transition: transform 200ms ease, filter 200ms ease;
}
html[data-polish="ready"] :is(.pg-reward-choice, .pg-relic-card).is-inspected {
  border-color: var(--pg-relic, var(--polish-brass));
  box-shadow: inset 0 1px #fff1c54d, inset 0 -3px var(--pg-relic, var(--polish-brass)), 0 8px 22px #03141273;
}
html[data-polish="ready"] .pg-relic-card.is-equipped {
  box-shadow: inset 0 1px #fff1c54d, inset 0 -3px var(--polish-brass), 0 6px 18px #02120f70;
}
html[data-polish="ready"] .pg-relic-card.is-locked { box-shadow: inset 0 1px #e7e1c50d; }
html[data-polish="ready"] .pg-growth-receipt.has-level-up {
  border-color: #e1c08180;
  background: linear-gradient(110deg, #a2823529, #223d2b);
  box-shadow: inset 3px 0 #e1c081, inset 0 1px #ffeec629;
}
html[data-polish="ready"] .pg-growth-receipt.is-new .pg-growth-mark {
  animation: polish-earned-mark 540ms ease-out both;
}
html[data-polish="ready"] .pg-reward-action {
  position: relative;
  background: linear-gradient(100deg, #d4c08b16, #6ba49412);
  border-top-color: #cfb77a66;
}

/* Framed story scenes lead into a solid reading surface. Only decorative
   portrait furniture moves; battle actors and their hit targets do not. */
html[data-polish="ready"] :is(.cp-dialog, .cg-dialog, .pg-dialog, .st-dialog, .af-dialog, .story-dialog, .journal-dialog) {
  border-color: #cfb7828c;
  box-shadow: 0 24px 88px #000a, inset 0 1px #fff1c84d;
}
html[data-polish="ready"] :is(.cp-dialog, .cg-dialog, .pg-dialog, .st-dialog, .af-dialog, .story-dialog, .journal-dialog)[open] {
  animation: polish-panel-arrive 180ms ease-out both;
}
html[data-polish="ready"] :is(.cp-heading, .cg-heading, .pg-dialog-heading, .st-heading, .af-header) {
  box-shadow: inset 0 1px #fff5d524, 0 6px 18px #06141629;
  border-bottom-color: #ddc18b40;
}
html[data-polish="ready"] .story-illustration::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid #fff0c32b;
  border-radius: 7px;
  box-shadow: 0 0 0 9px #0613190d;
  pointer-events: none;
}
html[data-polish="ready"] .story-dialog .story-dialogue {
  background: linear-gradient(105deg, #f9f0db, #ede2c8);
  box-shadow: inset 0 1px #fffcef, inset 0 -2px #ac986638;
}
html[data-polish="ready"] .story-words > p { text-shadow: 0 1px #fff8e38c; }
html[data-polish="ready"] .story-controls { flex-wrap: wrap; }
html[data-polish="ready"] .story-controls > div { min-width: 0; }
html[data-polish="ready"] .cp-dialogue {
  background: linear-gradient(110deg, #254337, #16352f);
  box-shadow: inset 0 1px #f9d89326;
}
html[data-polish="ready"] :is(.cp-person-hero, .cp-conversation, .cg-portrait, .st-character-hero) {
  box-shadow: inset 0 1px #fce7b52e, inset 0 -2px #04141766;
}
html[data-polish="ready"] .cg-hero-art::before {
  content: "";
  position: absolute;
  inset: auto 19% 13px;
  height: 25px;
  border-radius: 50%;
  border: 1px solid #e5d7a333;
  background: radial-gradient(ellipse, #020c16a1, #132a2645 68%, transparent 73%);
  box-shadow: 0 5px 0 #05141455, inset 0 1px #ffedb71c;
  pointer-events: none;
}
html[data-polish="ready"] .cp-scene-lantern::after {
  content: "";
  position: absolute;
  inset: 29% -18% 2%;
  border-radius: 50%;
  background: radial-gradient(ellipse, #f3c77714, transparent 68%);
  pointer-events: none;
  animation: polish-lantern-breath 6s ease-in-out infinite;
}
html[data-polish="ready"] .cp-progress-card.has-arrival {
  border-color: #dcc088;
  box-shadow: inset 0 1px #f5e5b242, inset 3px 0 #dcc088, 0 6px 20px #07161352;
}
html[data-polish="ready"] .cp-dialog[data-page="arrival"] .cp-scene-heading {
  border-left: 2px solid var(--polish-brass);
  padding-left: 12px;
}

/* Camp illumination and embossed map/skill markers share the same materials. */
html[data-polish="ready"] .camp-illustrated-ground::before {
  background: radial-gradient(ellipse at 50% 75%, #f8d79e30, #89b3a20a 42%, transparent 66%);
  animation: polish-lantern-breath 7s ease-in-out infinite;
}
html[data-polish="ready"] :is(.camp-next-encounter, .pg-camp-card, .camp-conversation) {
  box-shadow: inset 0 1px #eddfb52b, inset 0 -2px #0214164d, 0 4px 14px #06151220;
}
html[data-polish="ready"] .camp-supplies {
  box-shadow: inset 0 1px #f8d89916;
  border-top-color: #bcca9c47;
}
html[data-polish="ready"] .campaign-route-vista {
  border-color: #c2baa85c;
  box-shadow: inset 0 1px #fff0cd30, inset 0 -3px #061d238c, 0 8px 18px #03131c38;
}
html[data-polish="ready"] body[data-campaign="true"] .route-map > .map-stop > button > .route-node-symbol {
  box-shadow: inset 0 1px #fff4d34d, inset 0 -3px #04121780, 0 5px 0 #04111666, 0 9px 12px #020e1759;
}
html[data-polish="ready"] body[data-campaign="true"] .route-map > .route-here > button > .route-node-symbol {
  border-color: #f3d497;
  background: radial-gradient(ellipse at 35% 20%, #f7e5b457, transparent 64%), linear-gradient(#75694b, #2d463e);
  box-shadow: inset 0 1px #fff2c5b3, inset 0 -3px #0d2524a6, 0 5px 0 #05191999, 0 0 0 5px #e9d9a00f, 0 9px 17px #020e1880;
}
html[data-polish="ready"] .st-node-symbol {
  box-shadow: inset 0 1px #e1efcf29, inset 0 -2px #031a1880, 0 4px 0 #0318184d, 0 7px 10px #06131638;
}
html[data-polish="ready"] .st-node.is-equipped .st-node-symbol {
  box-shadow: inset 0 1px #f9e7b56b, inset 0 -2px #102a238c, 0 4px 0 #081c1a66, 0 0 14px #e0c27b1a;
}
html[data-polish="ready"] .st-node.is-new .st-node-mark { animation: polish-earned-mark 540ms ease-out both; }
html[data-polish="ready"] .st-node.is-selected { box-shadow: inset 0 -2px #e4bd78a6, inset 0 1px #f6e9c414; }

/* Focus stays visible on both parchment and dark scenes. */
html[data-polish="ready"] :is(.pg-dialog, .cp-dialog, .cg-dialog, .st-dialog, .af-dialog, .story-dialog, .journal-dialog, .pg-rewards, #camp-stage, .campaign-route-vista, .cp-progress-card, .hand-panel, .commands-panel, .camp-panel, .review-panel, .action-dock, .topbar, .adventure-nav) :is(button, a, summary, [tabindex]):focus-visible {
  outline: 3px solid #f3cf83;
  outline-offset: 3px;
  box-shadow: 0 0 0 2px #163832;
  scroll-margin-block: 14px;
}
html[data-polish="ready"] :is(.pg-reward-choice, .pg-relic-card):focus-within {
  border-color: #f3cf83;
}
@media (hover: hover) and (pointer: fine) {
  html[data-polish="ready"] .pg-reward-choice:hover > .pg-relic-art {
    transform: perspective(600px) rotateX(3deg) rotateY(3deg) translateY(-3px);
  }
  html[data-polish="ready"] :is(.pg-reward-choice, .pg-relic-card:not(.is-locked), .cp-branch:not(:disabled)):hover {
    box-shadow: inset 0 1px #fff4d53d, inset 0 -2px #091e1d66, 0 9px 22px #05181545;
  }
}
@keyframes polish-panel-arrive { from { opacity: .72; } to { opacity: 1; } }
@keyframes polish-object-arrive { from { opacity: .72; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes polish-earned-mark { 0% { opacity: .5; transform: scale(.9); } 65% { opacity: 1; transform: scale(1.05); } 100% { opacity: 1; transform: none; } }
@keyframes polish-lantern-breath { 0%, 100% { opacity: .65; } 50% { opacity: 1; } }

/* Ambient preference stops only atmosphere; real combat cues remain governed
   by the existing playback and reduced-motion controls. */
html[data-polish="ready"][data-ambient="off"] :is(.firefly, .arena-mist, .camp-flame, .camp-flame-inner, .camp-lanterns, .camp-fire-halo, .camp-embers, .world-spark, .world-particle, .world-halo, .world-cloud, .world-water, .world-ripple, .world-lantern, .world-beacon, .world-lightning, .world-threads, .cg-sparks),
html[data-polish="ready"][data-ambient="off"] :is(.camp-traveler-art, .cp-person-art, .cp-scene-actor) :is(.avatar-figure, .avatar-cloak, .avatar-magic),
html[data-polish="ready"][data-ambient="off"] .cg-dialog:not([data-demo="windup"]):not([data-demo="impact"]) .cg-hero-art :is(.avatar-figure, .avatar-cloak, .avatar-magic),
html[data-polish="ready"][data-ambient="off"] #party-stage :is(.avatar-cloak, .avatar-magic),
html[data-polish="ready"][data-ambient="off"] #enemy-art::before,
html[data-polish="ready"][data-ambient="off"] .camp-illustrated-ground::before,
html[data-polish="ready"][data-ambient="off"] .cp-scene-lantern::after {
  animation: none !important;
}
/* Only idle bodies stop. A real hit, cast, guard, heal, victory, or defeat
   remains available to the playback controller and its existing classes. */
html[data-polish="ready"][data-ambient="off"] .arena:not([data-cinema-event="victory"]):not([data-cinema-event="defeat"]) .stage-member:not(.is-acting):not(.is-hit):not(.is-healing):not(.is-guarding) .avatar-figure,
html[data-polish="ready"][data-ambient="off"] #enemy-art:not(.is-acting):not(.is-hit):not(.is-defeated):not(.is-ward-hit):not(.hit):not(.attack) > img {
  animation: none !important;
}
html[data-polish="ready"] .arena[data-cinema-paused="true"] .camp-illustrated-ground::before,
html[data-polish="ready"] body:has(dialog[open]) .camp-illustrated-ground::before {
  animation-play-state: paused !important;
}

/* Low detail retains the artwork, labels and earned states. */
html[data-polish="ready"][data-graphics="low"] :is(.pg-reward-choice, .pg-relic-card, .st-detail, .cg-gear article, .af-earned-item, .cp-branch, .cp-next-step, .cp-compare-member, .cp-swap-action, .campaign-route-vista) {
  box-shadow: inset 0 1px #f6edcf24;
  transition: none;
}
html[data-polish="ready"][data-graphics="low"] :is(.pg-relic-art, .cg-hero-art > .character-avatar, .camp-shelter, .camp-traveler-art > svg) { filter: none; }
html[data-polish="ready"][data-graphics="low"] .pg-reward-choice > .pg-relic-art { transform: none; }
html[data-polish="ready"][data-graphics="low"] :is(.cp-dialog, .cg-dialog, .pg-dialog, .st-dialog, .af-dialog, .story-dialog, .journal-dialog)::backdrop { backdrop-filter: none; -webkit-backdrop-filter: none; }
html[data-polish="ready"][data-graphics="low"] .camp-illustrated-ground::before,
html[data-polish="ready"][data-graphics="low"] .cp-scene-lantern::after { animation: none; }

/* Increased contrast preserves the two intentional reading materials. */
html[data-polish="ready"][data-contrast="high"] {
  --bg: #081b20;
  --panel: #10282d;
  --panel-soft: #17333a;
  --border: #9aac9e;
  --muted: #d9e7df;
  --text: #fff7e1;
  --green: #e6f6c8;
  --green-strong: #cce4a0;
  --gold: #ffe1a4;
  --red: #ffd0ba;
  --blue: #c6eaf4;
  --ui-ink: #071b1e;
  --ui-panel: #10282d;
  --ui-panel-raised: #1d3b3c;
  --ui-text: #fff7e1;
  --ui-muted: #d9e7df;
  --ui-gold: #ffe1a4;
  --ui-line: #c5d0b67a;
}
html[data-polish="ready"][data-contrast="high"] :is(.arena, .hand-panel, .commands-panel, .review-panel, .camp-panel, .guide-panel, .log-panel, .journey-panel, .action-dock, .phase-track, .turn-summary) {
  --battle-paper: #fff7e1;
  --battle-muted: #dce9e2;
  --battle-line: #a7bbb1;
  --battle-soft-line: #879c91;
  --battle-brass: #ffe1a4;
  --battle-guard: #c9edf5;
  --battle-heal: #d6f2d6;
  --battle-danger: #ffd4c1;
  border-color: #a5b6a3;
}
html[data-polish="ready"][data-contrast="high"] :is(.hand-panel, .commands-panel, .review-panel, .camp-panel, .guide-panel, .log-panel, .journey-panel, .action-dock) { background: #10282d; }
html[data-polish="ready"][data-contrast="high"] :is(.brand-sub, .edition, .location-tag, .turn-tag, .next-intent, .stage-action, .party-note, .camp-vista-foot, .hand-footnote, .selection-hint, .roll-tools, .quick-start, .command-intro, .command-types-note, .command-base-note, .command-passive, .command-inspect, .forecast-note, .review-message, .review-footnote, .face-text small, .combo-note p, .log-item, .dock-context > strong, .dock-context > span, .cinema-event-caption, .battle-utility, .coach-steps > span) { color: #e2ede5; }
html[data-polish="ready"][data-contrast="high"] :is(.arena .fighter-meta, .arena .fighter-meta > span:last-child, .hand-panel .die-owner, .hand-panel .die-name, .hand-panel .buff-grid span, .commands-panel .combat-forecast span, #action-callout .detail) { color: #f4f4df; }
html[data-polish="ready"][data-contrast="high"] :is(.hand-panel .buff-grid strong, .commands-panel .combat-forecast strong, .fate-meter > strong, .review-totals strong) { color: #fff1b9; }
html[data-polish="ready"][data-contrast="high"] :is(.hand-panel .die-skill, .hand-panel .die-inspect, .hand-panel .hand-tools .text-button, .hand-panel .roll-tools .text-button) { color: #f3f5de; border-color: #a7b99f; }
html[data-polish="ready"][data-contrast="high"] .hand-panel .die-skill small { color: #ffe5ad; }
html[data-polish="ready"][data-contrast="high"] #commands-panel .command-choice { border-color: #a1b9af; background: #17333a; }
html[data-polish="ready"][data-contrast="high"] #commands-panel .command-choice.chosen { border-color: #ffe1a4; background: #37472f; box-shadow: inset 0 0 0 1px #ffe1a4; }
html[data-polish="ready"][data-contrast="high"] #commands-panel .command-choice :is(.command-values, .command-outlook, .command-type) { color: #e7ede0; }
html[data-polish="ready"][data-contrast="high"] #commands-panel .command-choice:disabled { opacity: 1; border-style: dashed; }
html[data-polish="ready"][data-contrast="high"] #commands-panel .command-choice:disabled > strong { color: #e1e7d8; }
html[data-polish="ready"][data-contrast="high"] .health-track { border-color: #d4e3ca; background: #030f13; }
html[data-polish="ready"][data-contrast="high"] .arena .player-fill { background: #d2edaa; }
html[data-polish="ready"][data-contrast="high"] .arena .enemy-fill { background: #f3b58f; }
html[data-polish="ready"][data-contrast="high"] :is(#turn-order .is-done, #turn-order .complete, .review-panel .event-row.seen) { opacity: 1; }
html[data-polish="ready"][data-contrast="high"] :is(.camp-vista-copy p, .camp-next-encounter p, .camp-scouting p, #journey-coach p, #recovery-coach p) { color: #e7edda; }
html[data-polish="ready"][data-contrast="high"] .arena :is(.ei-title > span, .ei-title > small, .ei-metric > span, .ei-metric > small, .ei-counter small, .ei-condition-state, .ei-note, .battle-build > span) { color: #e2ede5; }
html[data-polish="ready"][data-contrast="high"] .arena :is(.enemy-plan, .ei-metric, .ei-counter, .battle-build button, #battle-playback button) { border-color: #a1b9af; }
html[data-polish="ready"][data-contrast="high"] :is(.pg-rewards, .pg-reward-choice, .pg-relic-card, .pg-build-inspector, .st-detail, .st-map, .cg-gear article, .af-earned-item) {
  background: #0b2325;
  color: #fff5dc;
  border-color: #dccc9d;
}
html[data-polish="ready"][data-contrast="high"] :is(.pg-rewards, .pg-dialog, .st-dialog, .cg-dialog, .af-dialog) :is(p, small, .pg-reward-effect, .pg-card-impact, .pg-reward-note, .pg-relic-state, .pg-impact-method, .st-node > strong, .st-node > small) { color: #e3ecdf; }
html[data-polish="ready"][data-contrast="high"] .cp-scroll { background: #fff7e5; }
html[data-polish="ready"][data-contrast="high"] .cp-content :is(p, small, .cp-eyebrow, .cp-branch-copy > span, .cp-branch-copy > small, .cp-unlock-label) { color: #2d4635; }
html[data-polish="ready"][data-contrast="high"] :is(.cp-person-hero, .cp-conversation, .cp-dialogue) :is(p, small, .cp-eyebrow, .cp-unlock-label) { color: #f8f0da; }
html[data-polish="ready"][data-contrast="high"] .story-dialog .story-dialogue { background: #fff7e5; }
html[data-polish="ready"][data-contrast="high"] .story-dialog .story-words > :is(p, strong) { color: #163c31; text-shadow: none; }
html[data-polish="ready"][data-contrast="high"] :is(.cp-dialog, .cg-dialog, .pg-dialog, .st-dialog, .af-dialog, .story-dialog, .journal-dialog, .pg-rewards) button:disabled { opacity: 1; border-style: dashed; }

/* Large text reflows genuine controls and prose instead of scaling a clipped
   screenshot. The skill branches become readable cards; their decorative SVG
   connectors are omitted because they assume the original fixed row height. */
html[data-polish="ready"][data-text-size="large"] :is(.cp-content p, .cp-heading p, .pg-dialog-content p, .pg-reward-effect, .pg-rewards > header p, .cg-biography, .cg-panel p, .st-content p, .af-content p, .journal-entry p, .camp-vista-copy p, .camp-next-encounter p, .camp-scouting p) {
  font-size: 1rem;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
html[data-polish="ready"][data-text-size="large"] .story-dialog .story-words > p,
html[data-polish="ready"][data-text-size="large"] .cp-dialogue p { font-size: 1.25rem; line-height: 1.8; }
html[data-polish="ready"][data-text-size="large"] :is(.cp-dialog, .pg-dialog, .cg-dialog, .st-dialog, .af-dialog, .story-dialog, .journal-dialog, .pg-rewards) :is(button, summary) {
  min-height: 48px;
  white-space: normal;
  overflow-wrap: anywhere;
}
html[data-polish="ready"][data-text-size="large"] :is(.cp-button, .pg-button, .pg-reward-action, .pg-compare-button, .st-primary, .st-secondary, .af-button, .story-controls button, .cg-action) { font-size: 1rem; line-height: 1.5; }
html[data-polish="ready"][data-text-size="large"] :is(.cp-content, .pg-dialog-content, .cg-panel, .st-content, .af-content, .story-words, .pg-rewards) :is(small, .micro, .cp-eyebrow, .pg-eyebrow, .cg-eyebrow, .st-eyebrow, .af-eyebrow, .pg-card-impact) { font-size: .875rem; line-height: 1.65; }
html[data-polish="ready"][data-text-size="large"] :is(.pg-reward-grid, .pg-relic-grid) { grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
html[data-polish="ready"][data-text-size="large"] :is(.pg-reward-choice, .pg-relic-card, .cp-branch, .cp-compare-member, .st-detail) { min-width: 0; height: auto; }
html[data-polish="ready"][data-text-size="large"] :is(.pg-reward-effect, .pg-relic-card p) { min-height: 0; }
html[data-polish="ready"][data-text-size="large"] .pg-mini-party { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html[data-polish="ready"][data-text-size="large"] :is(.cp-tabs, .cg-tabs, .pg-tabs, .st-build-row, .story-controls, .cp-scene-controls, .cp-main-action, .cp-swap-action) { flex-wrap: wrap; }
html[data-polish="ready"][data-text-size="large"] :is(.cp-heading, .cg-heading, .st-heading, .pg-dialog-heading, .af-header) > div { min-width: 0; }
html[data-polish="ready"][data-text-size="large"] .st-training-layout { grid-template-columns: minmax(0, 1fr); }
html[data-polish="ready"][data-text-size="large"] .st-connectors { display: none; }
html[data-polish="ready"][data-text-size="large"] .st-node-column { grid-template-rows: repeat(3, minmax(148px, auto)); gap: 14px; }
html[data-polish="ready"][data-text-size="large"] .st-node { width: calc(100% - 10px); min-height: 148px; height: auto; padding: 8px; }
html[data-polish="ready"][data-text-size="large"] .st-node > strong { font-size: .9375rem; line-height: 1.5; }
html[data-polish="ready"][data-text-size="large"] .st-node > small { font-size: .8125rem; line-height: 1.5; }
html[data-polish="ready"][data-text-size="large"] .st-branch h5 { height: auto; min-height: 48px; font-size: .9375rem; padding: 6px; }
html[data-polish="ready"][data-text-size="large"] .st-node-mark { margin-bottom: 6px; }
html[data-polish="ready"][data-text-size="large"] :is(.cp-content, .pg-dialog-content, .st-content, .cg-panel, .af-content) { scroll-padding-block: 18px; }
/* The readable mode also reaches real battle decisions. It does not scale
   the 3D canvas or apply transforms to a combatant or its effect coordinates. */
html[data-polish="ready"][data-text-size="large"] :is(.topbar, .top-actions, .campaign-toolbar, .adventure-tools, .arena-top, .hand-heading, .hand-tools, .roll-tools, .selection-strip) { flex-wrap: wrap; }
html[data-polish="ready"][data-text-size="large"] :is(.topbar, .top-actions, .adventure-nav, .adventure-tools, .hand-heading, .hand-tools, .roll-tools, .fate-meter, .selection-strip, .command-row, .command-options, .dock-context) { min-width: 0; }
html[data-polish="ready"][data-text-size="large"] :is(.top-actions > button, .comfort-menu > summary, .adventure-tools > button, .explore-menu > summary) { font-size: .9375rem; line-height: 1.5; min-height: 48px; white-space: normal; overflow-wrap: anywhere; }
html[data-polish="ready"][data-text-size="large"] .brand-sub { font-size: .8125rem; line-height: 1.6; letter-spacing: .06em; white-space: normal; }
html[data-polish="ready"][data-text-size="large"] .adventure-nav-item { font-size: .9375rem; line-height: 1.5; min-height: 68px; min-width: 0; }
html[data-polish="ready"][data-text-size="large"] .adventure-nav-item > span { min-width: 0; overflow-wrap: anywhere; }
html[data-polish="ready"][data-text-size="large"] :is(.opening-vista .arrival-copy p, .opening-vista .arrival-checkpoint, .quick-start, .party-note, .selection-hint, .command-intro, .command-types-note, .command-base-note, .review-message, .review-footnote, .forecast-note, .hp-after, .face-text small, .combo-note p, .camp-heading > p, .camp-recovery, #journey-coach p, #recovery-coach p, .turn-summary p) { font-size: 1rem; line-height: 1.75; overflow-wrap: anywhere; }
html[data-polish="ready"][data-text-size="large"] :is(.hand-heading h2, .camp-heading h2, .review-panel h2, #journey-coach h3) { font-size: 1.5rem; line-height: 1.4; overflow-wrap: anywhere; }
html[data-polish="ready"][data-text-size="large"] :is(.location-tag, .turn-tag, .next-intent, .hand-footnote, .roll-tools, .hand-panel .micro, .selection-strip > span, .camp-vista-foot, .camp-supplies, .coach-steps > span, .page-footer, .log-item, .battle-utility) { font-size: .875rem; line-height: 1.65; letter-spacing: .015em; overflow-wrap: anywhere; }
html[data-polish="ready"][data-text-size="large"] .arena-top { gap: 8px 12px; align-items: flex-start; }
html[data-polish="ready"][data-text-size="large"] .arena .fighter-meta { flex-direction: column; align-items: flex-start; gap: 4px; min-height: 68px; font-size: .9375rem; line-height: 1.5; }
html[data-polish="ready"][data-text-size="large"] .arena .fighter-meta > span { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
html[data-polish="ready"][data-text-size="large"] .arena .fighter-meta > span:last-child { font-size: 1.0625rem; line-height: 1.5; font-variant-numeric: tabular-nums; }
html[data-polish="ready"][data-text-size="large"] .arena .health-track { height: 12px; }
html[data-polish="ready"][data-text-size="large"] :is(.arena .enemy-ward, .arena .party-poison, .arena .intent-badge) { font-size: .875rem; line-height: 1.65; white-space: normal; overflow-wrap: anywhere; }
html[data-polish="ready"][data-text-size="large"] .arena .enemy-ward > small { font-size: .8125rem; line-height: 1.6; }
html[data-polish="ready"][data-text-size="large"] .stage-name { font-size: .9375rem; line-height: 1.5; }
html[data-polish="ready"][data-text-size="large"] .stage-action { font-size: .8125rem; line-height: 1.5; min-height: 24px; }
html[data-polish="ready"][data-text-size="large"] .fate-meter { flex-shrink: 0; max-width: 100%; }
html[data-polish="ready"][data-text-size="large"] .fate-meter > strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
html[data-polish="ready"][data-text-size="large"] .fate-meter .fate-copy { font-size: .875rem; white-space: normal; }
html[data-polish="ready"][data-text-size="large"] .hand-panel .die-owner[data-character-guide] { min-height: 68px; font-size: 1rem; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
html[data-polish="ready"][data-text-size="large"] .hand-panel .die-name { font-size: 1rem; line-height: 1.5; min-height: 25px; }
html[data-polish="ready"][data-text-size="large"] .die-skill { min-height: 76px; height: auto; padding: 9px 6px; }
html[data-polish="ready"][data-text-size="large"] .die-skill strong { font-size: 1rem; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
html[data-polish="ready"][data-text-size="large"] .die-skill small { font-size: .875rem; line-height: 1.5; white-space: normal; }
html[data-polish="ready"][data-text-size="large"] :is(.die-inspect, .hand-tools .text-button, .roll-tools .text-button, .guide-panel .text-button, .camp-supplies button, .camp-first-steps .text-button) { min-height: 48px; font-size: .9375rem; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
html[data-polish="ready"][data-text-size="large"] .selection-strip > div { flex-wrap: wrap; }
html[data-polish="ready"][data-text-size="large"] .selection-chip { min-width: 44px; min-height: 44px; }
html[data-polish="ready"][data-text-size="large"] #commands-panel .command-legend { font-size: 1.125rem; line-height: 1.5; max-width: 100%; overflow-wrap: anywhere; }
html[data-polish="ready"][data-text-size="large"] #commands-panel .command-legend small { display: inline; font-size: .875rem; white-space: normal; }
html[data-polish="ready"][data-text-size="large"] #commands-panel .command-choice { min-height: 168px; height: auto; padding: 14px; gap: 9px; }
html[data-polish="ready"][data-text-size="large"] #commands-panel .command-choice > strong { font-size: 1.125rem; line-height: 1.5; }
html[data-polish="ready"][data-text-size="large"] #commands-panel .command-choice :is(.command-values, .command-outlook) { font-size: 1rem; line-height: 1.65; }
html[data-polish="ready"][data-text-size="large"] #commands-panel .command-choice .command-type { font-size: .8125rem; line-height: 1.5; letter-spacing: .03em; }
html[data-polish="ready"][data-text-size="large"] :is(.hand-panel .buff-grid, .commands-panel .combat-forecast, .review-totals) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
html[data-polish="ready"][data-text-size="large"] :is(.hand-panel .buff-grid > div, .commands-panel .combat-forecast > div, .review-totals > div) { min-width: 0; min-height: 93px; padding: 12px 7px; }
html[data-polish="ready"][data-text-size="large"] :is(.hand-panel .buff-grid span, .commands-panel .combat-forecast span, .review-totals span) { font-size: .9375rem; line-height: 1.5; overflow-wrap: anywhere; }
html[data-polish="ready"][data-text-size="large"] :is(.hand-panel .buff-grid strong, .commands-panel .combat-forecast strong, .review-totals strong) { font-size: 1.625rem; line-height: 1.4; font-variant-numeric: tabular-nums; }
html[data-polish="ready"][data-text-size="large"] #action-callout { grid-template-columns: minmax(0, 1fr); min-height: 110px; }
html[data-polish="ready"][data-text-size="large"] #action-callout .actor { font-size: 1rem; }
html[data-polish="ready"][data-text-size="large"] #action-callout .action { font-size: 1.625rem; }
html[data-polish="ready"][data-text-size="large"] #action-callout .detail { font-size: 1rem; line-height: 1.7; }
html[data-polish="ready"][data-text-size="large"] .cinema-event-caption { font-size: .875rem; }
html[data-polish="ready"][data-text-size="large"] .cinema-event-caption > b { font-size: .75rem; white-space: normal; }
html[data-polish="ready"][data-text-size="large"] .arena :is(.ei-title > span, .ei-title > small, .ei-condition-state, .ei-counter small, .ei-note, .battle-build > span) { font-size: .875rem; line-height: 1.65; overflow-wrap: anywhere; }
html[data-polish="ready"][data-text-size="large"] .arena :is(.ei-metric > span, .ei-metric > small, .ei-counter strong, .ei-target) { font-size: 1rem; line-height: 1.65; overflow-wrap: anywhere; }
html[data-polish="ready"][data-text-size="large"] .arena .ei-title h3 { font-size: 1.625rem; line-height: 1.4; overflow-wrap: anywhere; }
html[data-polish="ready"][data-text-size="large"] .arena .ei-metric > strong { font-size: 1.875rem; line-height: 1.4; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
html[data-polish="ready"][data-text-size="large"] .arena :is(.ei-next > summary, .ei-next > summary > b, .battle-build button, #battle-playback button, .battle-utility .text-button) { font-size: .9375rem; min-height: 48px; line-height: 1.6; white-space: normal; overflow-wrap: anywhere; }
html[data-polish="ready"][data-text-size="large"] .arena :is(.ei-heading, .ei-next > summary, .battle-build, #battle-playback) { flex-wrap: wrap; gap: 10px; }
html[data-polish="ready"][data-text-size="large"] #turn-order :is(.turn-chip, .order-chip) { font-size: .875rem; line-height: 1.5; min-height: 38px; padding: 6px 9px; }
html[data-polish="ready"][data-text-size="large"] :is(.phase-track .phase-step, .coach-steps > span) { font-size: .875rem; line-height: 1.5; }
html[data-polish="ready"][data-text-size="large"] .phase-track .phase-step { min-height: 66px; padding: 9px 6px; flex-wrap: wrap; }
html[data-polish="ready"][data-text-size="large"] :is(.phase-step > b, .coach-steps b) { min-width: 25px; min-height: 25px; font-size: .8125rem; }
html[data-polish="ready"][data-text-size="large"] .face-text strong { font-size: 1.0625rem; line-height: 1.5; }
html[data-polish="ready"][data-text-size="large"] .action-history .event-row :is(p, strong) { font-size: 1rem; line-height: 1.65; }
html[data-polish="ready"][data-text-size="large"] :is(.action-history .event-row small, .command-passive, .command-inspect) { font-size: .875rem; line-height: 1.6; }
html[data-polish="ready"][data-text-size="large"] .dock-context > span { font-size: .9375rem; line-height: 1.5; white-space: normal; }
html[data-polish="ready"][data-text-size="large"] .dock-context > strong { font-size: 1rem; line-height: 1.6; }
html[data-polish="ready"][data-text-size="large"] .action-dock :is(.primary-button, .secondary-button) { font-size: 1rem; line-height: 1.5; min-height: 58px; white-space: normal; overflow-wrap: anywhere; }
html[data-polish="ready"][data-text-size="large"] :is(.camp-first-steps b, .camp-conversation strong, .camp-traveler b) { font-size: 1rem; line-height: 1.5; }
html[data-polish="ready"][data-text-size="large"] :is(.camp-first-steps li p, .camp-conversation p, .checkpoint-note p) { font-size: 1rem; line-height: 1.7; }
html[data-polish="ready"][data-text-size="large"] :is(.camp-traveler small, .camp-attack-cycle span, .camp-attack-cycle small) { font-size: .8125rem; line-height: 1.6; }
html[data-polish="ready"][data-text-size="large"] .camp-illustrated-ground { min-height: 300px; }
html[data-polish="ready"][data-text-size="large"] .camp-traveler :is(b, small) { max-width: 100%; overflow-wrap: anywhere; }
@media (max-width: 800px) {
  html[data-polish="ready"][data-text-size="large"] .cg-content { grid-template-columns: minmax(0, 1fr); }
  html[data-polish="ready"][data-text-size="large"] .cg-portrait { position: relative; min-height: 0; }
  html[data-polish="ready"][data-text-size="large"] .cp-person-hero { display: block; }
  html[data-polish="ready"][data-text-size="large"] .cp-person-copy { max-width: none; }
  html[data-polish="ready"][data-text-size="large"] .cp-person-art { position: relative; right: auto; bottom: auto; width: min(65%, 215px); margin: 14px auto -12px; }
  html[data-polish="ready"][data-text-size="large"] :is(.cp-compare-grid, .cp-branch-grid) { grid-template-columns: minmax(0, 1fr); }
  html[data-polish="ready"][data-text-size="large"] .cp-compare-arrow { transform: rotate(90deg); }
  html[data-polish="ready"][data-text-size="large"] .top-actions { width: 100%; justify-content: flex-start; }
  html[data-polish="ready"][data-text-size="large"] #dice-tray { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  html[data-polish="ready"][data-text-size="large"] #commands-panel :is(.command-options, .command-options.has-technique) { grid-template-columns: minmax(0, 1fr); }
  html[data-polish="ready"][data-text-size="large"] #commands-panel .has-technique .command-choice[data-command="basic"] { display: flex; flex-direction: column; grid-column: auto; min-height: 150px; padding: 14px; }
  html[data-polish="ready"][data-text-size="large"] #commands-panel .has-technique .command-choice[data-command="basic"] .command-outlook { max-width: none; text-align: left; align-self: stretch; }
  html[data-polish="ready"][data-text-size="large"] .right-column { grid-template-columns: minmax(0, 1fr); }
  /* game-layout owns dock positioning. Its measured clearance also grows with
     large text; sending the dock to document end separates it from the dice. */
}
@media (max-width: 600px) {
  html[data-polish="ready"][data-text-size="large"] .story-dialog .story-dialogue { grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 18px; }
  html[data-polish="ready"][data-text-size="large"] .story-portrait { width: 64px; height: 90px; align-self: start; }
  html[data-polish="ready"][data-text-size="large"] .story-portrait > :is(svg, img) { max-width: 64px; max-height: 90px; }
  html[data-polish="ready"][data-text-size="large"] .story-controls > div { flex-basis: 100%; }
  html[data-polish="ready"][data-text-size="large"] .story-controls > button { flex: 1 1 100px; }
  html[data-polish="ready"][data-text-size="large"] .route-path-art { display: none; }
  html[data-polish="ready"][data-text-size="large"] body[data-campaign="true"] .campaign-map.route-map { grid-template-columns: minmax(0, 1fr); padding: 16px; gap: 8px; }
  html[data-polish="ready"][data-text-size="large"] body[data-campaign="true"] .route-map > .map-stop[data-route-slot] { padding: 0; }
  html[data-polish="ready"][data-text-size="large"] body[data-campaign="true"] .route-map > .map-stop > button { flex-direction: row; min-height: 70px; gap: 12px; padding: 9px; text-align: left; }
  html[data-polish="ready"][data-text-size="large"] body[data-campaign="true"] .route-map > .map-stop > button > strong { flex: 1; font-size: 1rem; overflow-wrap: anywhere; }
  html[data-polish="ready"][data-text-size="large"] body[data-campaign="true"] .route-map > .map-stop > button > .route-node-state { flex: 0 1 5.5rem; font-size: .8125rem; }
  html[data-polish="ready"][data-text-size="large"] body[data-campaign="true"] .route-map > .map-stop > button > .route-finale { top: 0; left: 47px; }
  html[data-polish="ready"][data-text-size="large"] .cp-scene-controls { justify-content: center; }
  html[data-polish="ready"][data-text-size="large"] .cp-scene-pagination { flex: 1 1 100%; order: -1; }
  html[data-polish="ready"][data-text-size="large"] .next-intent { order: 3; flex-basis: 100%; text-align: left; }
  html[data-polish="ready"][data-text-size="large"] .hand-heading > div:first-child { flex: 1 1 100%; }
  html[data-polish="ready"][data-text-size="large"] .fate-meter { margin-left: auto; }
  html[data-polish="ready"][data-text-size="large"] .action-dock { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  html[data-polish="ready"][data-text-size="large"] .action-dock :is(.primary-button, .secondary-button) { width: 100%; max-width: none; min-width: 0; }
  html[data-polish="ready"][data-text-size="large"] .dock-context { flex-direction: column; align-items: flex-start; gap: 5px; }
  html[data-polish="ready"][data-text-size="large"] .dock-context > strong { text-align: left; }
  html[data-polish="ready"][data-text-size="large"] .camp-scouting > summary { font-size: .9375rem; line-height: 1.6; flex-wrap: wrap; }
  html[data-polish="ready"][data-text-size="large"] .camp-scouting > summary > span { margin-left: 0; font-size: 1rem; }
  html[data-polish="ready"][data-text-size="large"] .camp-attack-cycle { grid-template-columns: minmax(0, 1fr); }
}

/* When the viewport is short, fixed headers and rosters can consume the whole
   dialog. Scroll the complete folio so its content and close control remain
   reachable, including when browser zoom makes the viewport smaller. */
@media (max-height: 520px) {
  html[data-polish="ready"] :is(.cp-dialog, .pg-dialog, .cg-dialog, .st-dialog, .af-dialog)[open] {
    display: block;
    box-sizing: border-box;
    height: auto;
    max-height: calc(100dvh - 16px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-padding-block: 16px;
  }
  html[data-polish="ready"] :is(.cp-scroll, .pg-dialog-content, .cg-content, .st-content, .af-content) {
    flex: none;
    min-height: auto;
    max-height: none;
    overflow: visible;
  }
}

/* System high-contrast palettes remove gradients and shadows. Give selected
   tabs and choices a physical edge while retaining a separate focus outline. */
@media (forced-colors: active) {
  html[data-polish="ready"] :is(.cp-dialog, .pg-dialog, .cg-dialog, .st-dialog, .af-dialog) {
    border-color: CanvasText;
  }
  html[data-polish="ready"] :is(.cp-dialog, .pg-dialog, .cg-dialog, .st-dialog, .af-dialog) :is(button[aria-selected="true"], button[aria-pressed="true"]),
  html[data-polish="ready"] .st-node.is-selected,
  html[data-polish="ready"] .pg-relic-card.is-inspected {
    border-color: Highlight;
    border-block-end: 3px double Highlight;
    outline: 2px solid Highlight;
    outline-offset: -4px;
  }
  html[data-polish="ready"] :is(.cp-dialog, .pg-dialog, .cg-dialog, .st-dialog, .af-dialog) :is(button, a, summary, [tabindex]):focus-visible {
    outline: 3px solid Highlight;
    outline-offset: 3px;
    box-shadow: none;
  }
}

/* These rules are scoped to the presentation owned here; gameplay focus,
   visibility, and progress-bar values are never reset. */
html[data-polish="ready"][data-motion="reduced"] :is(.pg-reward-choice, .pg-growth-mark, .st-node-mark, .cp-dialog, .cg-dialog, .pg-dialog, .st-dialog, .af-dialog, .story-dialog, .journal-dialog),
html[data-polish="ready"][data-motion="reduced"] .camp-illustrated-ground::before,
html[data-polish="ready"][data-motion="reduced"] .cp-scene-lantern::after {
  animation: none !important;
}
html[data-polish="ready"][data-motion="reduced"] .pg-reward-choice > .pg-relic-art { transform: none; transition: none; }
html[data-polish="ready"][data-motion="reduced"] :is(.pg-reward-choice, .pg-relic-card, .st-detail, .cg-gear article, .af-earned-item) { transition: none; }
@media (prefers-reduced-motion: reduce) {
  html[data-polish="ready"] :is(.pg-reward-choice, .pg-growth-mark, .st-node-mark, .cp-dialog, .cg-dialog, .pg-dialog, .st-dialog, .af-dialog, .story-dialog, .journal-dialog),
  html[data-polish="ready"] .camp-illustrated-ground::before,
  html[data-polish="ready"] .cp-scene-lantern::after { animation: none !important; }
  html[data-polish="ready"] .pg-reward-choice > .pg-relic-art { transform: none; transition: none; }
  html[data-polish="ready"] :is(.pg-reward-choice, .pg-relic-card, .st-detail, .cg-gear article, .af-earned-item) { transition: none; }
}
