/* Three persistent character cards select a horizontally paged scene. */
.home-screen { touch-action:pan-y; }
.home-screen .home-tools { display:flex; align-items:center; gap:5px; flex:none; }
.home-screen .home-tools .icon-button { width:40px; height:40px; min-width:40px; min-height:40px; }
.home-screen .home-tools .audio-quick .ui-icon { width:19px; height:19px; }
.home-screen .brand { font-size:8px; letter-spacing:1.6px; }
.home-screen .hero-select {
 position:relative; display:grid; grid-template-columns:repeat(3,minmax(0,1fr));
 gap:8px; overflow:visible; padding:2px 0; margin:0 0 18px;
}
.home-screen .hero-choice {
 --card-accent:#cad3a2; width:auto; height:auto; min-height:126px;
 display:flex; flex-direction:column; align-items:stretch; text-align:center;
 padding:8px 6px 10px; background:#151e23e0; border-color:#465459; border-radius:10px;
}
.home-screen .hero-choice[data-id='jill'] { --card-accent:#91ccd8; }
.home-screen .hero-choice[data-id='claire'] { --card-accent:#e3aaa2; }
.home-screen .hero-choice.active { border-color:var(--card-accent); background:linear-gradient(#31403beb,#1b2528ea); box-shadow:inset 0 0 0 1px var(--card-accent); }
.hero-card-heading { display:grid; grid-template-columns:36px minmax(0,1fr); align-items:center; gap:5px; min-height:36px; text-align:left; }
.hero-portrait { display:block; width:36px; height:36px; flex:none; background-image:url('./assets/sprites.webp'); background-repeat:no-repeat; background-color:#25302b; border-radius:7px; }
.home-screen .hero-choice strong { text-align:left; font-size:14px; line-height:18px; }
.home-screen .hero-choice small { text-align:left; font-size:10px; line-height:13px; color:#aebbb4; margin:2px 0 0; white-space:nowrap; }
.home-screen .hero-choice>i { top:4px; right:4px; width:4px; height:4px; background:var(--card-accent); }
.home-screen .hero-choice .hero-trait { display:block; font-size:11px; line-height:1.5; margin:8px 0 0; padding-top:7px; border-top:1px solid #65726855; text-align:left; }
.home-screen .hero-trait b { display:block; color:var(--card-accent); font-size:11px; margin:0 0 4px; }
.home-screen .hero-trait>span { display:block; color:#aab8ad; min-height:44px; }
.home-screen .choose-caption { font-size:14px; }
.home-screen .home-bottom { padding-top:20px; margin-top:60px; }

/* A single compact bottom navigation row; safe-area padding belongs here. */
.action-nav {
 display:grid; grid-template-columns:repeat(4,minmax(0,1fr)) 38px;
 grid-template-rows:44px; align-items:center; gap:0 2px;
 flex:none; padding:0 8px calc(1px + env(safe-area-inset-bottom));
 border-top:1px solid #35413e; background:#1b2325; position:relative; z-index:10;
}
.action-nav>button { position:relative; display:flex; align-items:center; justify-content:center; gap:4px; min-width:0; min-height:44px; color:#9aa9a3; font-size:12px; border-radius:6px; }
.action-nav>button.active { color:#d0dfa8; background:#8ba66f15; }
.action-nav .ui-icon { width:18px; height:18px; }
.action-nav>button>b { position:absolute; top:4px; right:4px; display:grid; place-items:center; height:15px; min-width:15px; padding:0 3px; font-size:10px; color:#182419; background:var(--green); border-radius:5px; }
.save-indicator { position:static; top:auto; right:auto; z-index:auto; font-size:10px; line-height:14px; letter-spacing:0; color:#87988b; white-space:nowrap; }
.save-indicator.error { color:#eca388; }
.save-indicator.saving { color:#d5c18f; }
.resolving .action-nav { opacity:.75; }
.hud.player-status {
 display:grid; grid-template-columns:minmax(0,1fr) 60px auto; align-items:center; gap:4px 12px;
 flex:none; height:auto; min-height:84px; padding:calc(8px + env(safe-area-inset-top)) 14px 4px;
 border-bottom:1px solid #465348; background:#1c2523; z-index:10;
}
.player-status .hero-badge { display:flex; flex-direction:column; align-items:stretch; justify-content:center; gap:8px; min-width:0; align-self:stretch; text-align:left; }
.player-heading { display:flex; align-items:center; gap:8px; white-space:nowrap; }
.player-name { color:#eeeede; font-size:20px; font-weight:750; line-height:1.2; }
.player-level>b { color:#d0dfa8; font:600 13px ui-monospace,monospace; white-space:nowrap; }
.player-xp { display:flex; align-items:center; gap:4px; width:100%; max-width:160px; min-width:0; }
.player-status .xp-track { position:static; width:auto; flex:1; min-width:16px; height:5px; background:#40514a; border-radius:3px; overflow:hidden; }
.player-status .xp-track>span { display:block; height:100%; background:#bdd195; border-radius:3px; }
.player-xp>small { color:#9dad9c; font-size:11px; line-height:1.1; white-space:nowrap; }
.player-status .hud-counters { display:flex; flex-direction:column; align-items:flex-start; justify-content:center; gap:7px; font:13px ui-monospace,monospace; }
.player-status .hud-counters>span { display:flex; align-items:center; gap:4px; white-space:nowrap; }
.player-status .hud-counters .ui-icon { width:15px; height:15px; margin:0; }
.player-status .hud-counters small { font-size:11px; color:#7f9190; }
.hud-sync { grid-column:1/-1; justify-self:end; line-height:12px; }
.health-ring { width:60px; height:60px; position:relative; flex:none; color:#e5e9dd; border-radius:50%; }
.health-ring>svg { display:block; width:100%; height:100%; overflow:visible; }
.health-ring circle { fill:none; stroke-width:3.5; }
.health-track { stroke:#41504a; }
.health-arc { stroke:#df928b; stroke-linecap:round; transform:rotate(-90deg); transform-origin:32px 32px; transition:stroke-dasharray .18s ease-out; }
.health-ring.critical .health-arc { stroke:#fa6f68; }
.health-value { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; flex-wrap:wrap; align-content:center; gap:0; padding:10px 3px; font-family:ui-monospace,monospace; }
.health-value>.hp-current { font-size:14px; color:#f0dfd5; line-height:18px; }
.health-value>span { font-size:10px; color:#a9b7a8; }
.health-value .hp-max { font-weight:500; }
.health-value>small { width:100%; font:11px/13px -apple-system,BlinkMacSystemFont,"PingFang SC",sans-serif; color:#baaaa2; }

/* The scrolling play area and fixed action dock occupy separate layout rows. */
.screen-battle .screen-content { display:flex; overflow:hidden; }
.screen-content>.battle-screen { display:flex; flex-direction:column; width:100%; height:100%; min-height:0; padding:0; }
.battle-scroll { display:flex; flex-direction:column; flex:1; min-height:0; overflow-y:auto; overflow-x:hidden; overscroll-behavior-y:contain; scrollbar-width:thin; scrollbar-color:#485e4b transparent; }
.battle-screen .battle-caption { flex:none; padding:calc(7px + env(safe-area-inset-top)) 10px 6px; min-height:53px; gap:7px; }
.battle-caption>div:first-child { flex:1; min-width:0; }
.battle-screen .chapter-mini { display:block; font-size:11px; color:#8fa19a; line-height:15px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.battle-screen .battle-caption h1 { font-size:17px; line-height:21px; margin-top:2px; }
.battle-screen .battle-caption-tools { flex:none; gap:4px; }
.battle-screen .audio-quick.icon-button { width:36px; height:40px; min-width:36px; min-height:40px; }
.battle-screen .round-badge { min-height:40px; font-size:11px; gap:4px; padding:5px 7px; }
.battle-summary { display:flex; align-items:center; justify-content:space-between; gap:7px; flex:none; min-height:34px; padding:0 10px; border-top:1px solid #35403e; border-bottom:1px solid #35403e; background:#1f2328; font-size:11px; line-height:1.4; color:#b5aaa0; }
.enemy-intents { display:flex; align-items:center; justify-content:flex-start; gap:4px; flex:0 1 auto; min-width:0; max-width:65%; margin-left:auto; overflow-x:auto; scrollbar-width:none; }
.enemy-intents::-webkit-scrollbar { display:none; }
.battle-summary .intent { position:static; display:flex; align-items:center; justify-content:center; gap:3px; flex:none; width:auto; min-height:32px; margin:0; padding:2px 4px; font-size:11px; line-height:1.4; white-space:nowrap; border:0; background:transparent; }
.battle-summary .intent>small { font-size:10px; color:#97a6a0; }
.battle-summary .ui-icon { width:13px; height:13px; flex:none; }
.battle-summary b { font:600 13px ui-monospace,monospace; }
.threat-forecast { display:flex; align-items:center; gap:3px; flex:none; white-space:nowrap; text-align:left; }
.threat-forecast>small { font-size:10px; }
.threat-forecast b { color:#f0c7b5; }
.infection-damage { display:flex; align-items:center; gap:2px; color:#b5a7c5; }
.enemy-number { display:inline-grid; place-items:center; width:14px; height:14px; flex:none; border:1px solid #68736d; border-radius:50%; color:#c0c9bb; font:10px/1 ui-monospace,monospace; }
.battle-screen .arena {
 --enemy-art-height:116px;
 position:relative; display:grid; grid-template-columns:80px minmax(0,1fr); gap:8px;
 flex:1 0 auto; min-height:215px; max-height:none; margin:0; padding:8px 12px 10px;
 align-items:start; border-bottom:1px solid #35413e; overflow:hidden;
}
.battle-screen .arena-code { left:14px; top:auto; bottom:20px; z-index:0; opacity:.04; font-size:25px; letter-spacing:2px; }
.battle-screen .arena .enemy-row { position:relative; top:auto; right:auto; left:auto; grid-column:2; grid-row:1; width:auto; max-width:none; display:grid; grid-template-columns:repeat(var(--enemy-count,1),minmax(0,1fr)); align-items:start; gap:6px; z-index:1; }
.battle-screen .arena .enemy { display:flex; flex-direction:column; align-items:center; width:100%; min-width:0; max-width:none; min-height:0; padding:4px 2px; border-radius:8px; }
.battle-screen .arena .enemy-art { height:var(--enemy-art-height); width:100%; display:flex; align-items:flex-end; justify-content:center; flex:none; }
.battle-screen .arena .enemy-row .enemy .sprite { width:min(100%,calc(var(--enemy-art-height)*var(--art-ratio))); height:auto; aspect-ratio:var(--art-ratio); max-height:var(--enemy-art-height); }
.battle-screen .arena .enemy-name { max-width:100%; font-size:12px; line-height:16px; min-height:16px; margin:5px 0; display:flex; align-items:center; flex-wrap:wrap; justify-content:center; gap:3px; }
.battle-screen .enemy-name i { font-size:10px; margin:0; }
.battle-screen .arena .enemy-hp { flex:none; width:100%; max-width:122px; min-width:0; height:18px; }
.battle-screen .enemy-hp b { font-size:11px; line-height:16px; }
.battle-screen .enemy-status { display:flex; flex-wrap:wrap; justify-content:center; gap:3px; min-height:18px; padding-top:4px; }
.battle-screen .enemy-status:empty { min-height:0; padding-top:0; }
.battle-screen .enemy-status .status { font-size:11px; line-height:14px; white-space:normal; }
.enemy-target-slot { display:flex; align-items:center; justify-content:center; min-height:25px; padding-top:4px; }
.battle-screen .arena .target-reticle { position:static; top:auto; right:auto; bottom:auto; left:auto; transform:none; display:flex; justify-content:center; gap:3px; width:auto; max-width:100%; font-size:11px; line-height:14px; white-space:normal; padding:3px 4px; box-shadow:none; }
.battle-screen .target-reticle .ui-icon { width:12px; height:12px; flex:none; }
.survivor-unit { grid-column:1; grid-row:1; position:relative; z-index:1; display:flex; flex-direction:column; align-items:center; gap:6px; min-width:0; padding-top:4px; }
.battle-screen .arena .survivor { position:relative; left:auto; top:auto; right:auto; bottom:auto; width:80px; height:var(--enemy-art-height); display:flex; align-items:flex-end; justify-content:center; }
.battle-screen .survivor .sprite.actor-sprite { width:98px; height:98px; max-width:none; }
.survivor-readout { display:flex; flex-direction:column; align-items:center; gap:5px; width:100%; }
.battle-screen .survivor-shield { position:static; left:auto; bottom:auto; display:flex; align-items:center; gap:4px; padding:4px 5px; font-size:12px; line-height:17px; box-shadow:none; white-space:nowrap; }
.battle-screen .survivor-shield .ui-icon { width:14px; height:14px; }
.battle-screen .survivor .focus-badge, .battle-screen .survivor .retain-badge, .survivor-readout .focus-badge, .survivor-readout .retain-badge { position:static; top:auto; left:auto; font-size:12px; line-height:16px; padding:3px 5px; }
.battle-screen .arena-floor { z-index:0; pointer-events:none; }
.battle-screen.boss-fight .arena { --enemy-art-height:136px; min-height:235px; }
.battle-screen .hand-heading { min-height:45px; padding:3px 12px; }
.battle-screen .hand-title { min-height:40px; }
.battle-screen .hand-title b { font-size:14px; }
.battle-screen .hand-title small { font-size:12px; margin-top:2px; }
.battle-screen .quick-item { min-height:40px; width:42px; }
.battle-screen .quick-item small { font-size:11px; }
.battle-screen .hand { container-type:inline-size; height:224px; min-height:224px; padding:8px 10px 12px; gap:9px; scroll-padding:10px; }
.battle-screen .hand .game-card { display:grid; grid-template-rows:24px 20px 38px minmax(0,1fr) 24px; flex:0 0 clamp(128px,calc((100cqw - 28px)/2.45),154px); min-height:204px; height:204px; padding:7px 9px 0; }
.battle-screen .hand .card-cost { top:6px; left:7px; width:25px; height:25px; font-size:20px; }
.battle-screen .hand .card-rarity { top:11px; right:8px; font-size:10px; }
.battle-screen .hand .card-name { grid-row:2; font-size:14px; line-height:20px; margin:0; }
.battle-screen .hand .card-art { grid-row:3; height:auto; margin:0; }
.battle-screen .hand .card-art .item-art { height:34px; width:calc(34px*var(--art-ratio)); }
.battle-screen .hand .card-text { grid-row:4; font-size:13.5px; line-height:19px; min-height:0; padding:3px 0; align-self:center; }
.battle-screen .hand .card-footer { grid-row:5; align-items:center; font-size:10.5px; padding:4px 0; margin:0; line-height:15px; letter-spacing:0; }
.battle-screen .battle-dock { position:relative; bottom:auto; flex:none; z-index:6; box-shadow:none; background:#20291f; backdrop-filter:none; }
.battle-screen .combat-command { min-height:48px; padding:4px 12px 0; }
.battle-screen .combat-command:not(.selected-command) { display:none; }
.battle-screen .combat-hint { min-height:44px; gap:7px; }
.battle-screen .combat-hint strong { font-size:14px; }
.battle-screen .combat-hint small { margin-top:3px; font-size:12px; }
.battle-screen .battle-controls { display:grid; grid-template-columns:104px minmax(0,1fr) 68px; align-items:center; height:70px; padding:6px 8px; gap:6px; }
.combat-resources { position:relative; display:grid; grid-template-columns:44px minmax(0,1fr); align-items:center; gap:4px; min-width:0; }
.battle-screen .combat-resources::after { content:''; position:absolute; top:8px; bottom:8px; right:-3px; width:1px; background:#6d7d6266; pointer-events:none; }
.battle-screen .combat-resources .energy { min-width:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; min-height:54px; }
.battle-screen .energy>span { display:flex; align-items:center; gap:3px; margin:0; font-size:11px; line-height:16px; white-space:nowrap; }
.battle-screen .energy strong { display:inline-flex; align-items:baseline; font:700 20px/22px ui-monospace,monospace; }
.battle-screen .energy strong small { font-size:11px; }
.battle-screen .energy .ui-icon { width:14px; height:14px; }
.battle-screen .ammo-control { display:grid; grid-template-rows:18px 22px; align-content:center; align-items:center; gap:4px; min-height:54px; height:54px; min-width:0; padding:2px; }
.battle-screen .combat-resources .ammo-control { border:0; border-radius:0; background:transparent; box-shadow:none; }
.battle-screen .ammo-control.can-refill { grid-template-rows:18px 18px 10px; gap:1px; }
.battle-screen .ammo-control:disabled { opacity:1; cursor:default; }
.battle-screen .ammo-control:disabled .resource-count { color:#b9c5a6; }
.battle-screen .ammo-control:disabled .reload-label { opacity:.5; }
.battle-screen .ammo-control:not(:disabled) .reload-label>span:first-child { color:var(--green); text-decoration:underline; text-underline-offset:2px; }
.battle-screen .ammo-control>span { justify-content:center; gap:2px; margin:0; }
.battle-screen .ammo-control .resource-label { font:11px/15px -apple-system,BlinkMacSystemFont,"PingFang SC",sans-serif; color:#bfc4ad; }
.battle-screen .ammo-control .magazine-symbol { height:18px; width:calc(18px*var(--art-ratio)); flex:none; }
.battle-screen .ammo-control .resource-count { font:700 16px/18px ui-monospace,monospace; }
.battle-screen .ammo-control .resource-count>small { font-size:11px; }
.battle-screen .ammo-control .ui-icon { width:12px; height:12px; }
.battle-screen .ammo-control>small { display:flex; justify-content:center; align-items:center; gap:3px; font-size:9px; line-height:10px; white-space:nowrap; }
.reload-cost { display:inline-flex; align-items:center; gap:1px; color:#b8cb99; }
.battle-screen .reload-cost .ui-icon { width:10px; height:10px; }
.battle-controls .hud.player-status { grid-template-columns:max-content 48px max-content; justify-content:space-evenly; gap:4px; min-width:0; min-height:0; height:100%; padding:0; border:0; background:transparent; z-index:1; }
.battle-controls .player-status .hero-badge { gap:7px; width:max-content; max-width:100%; justify-self:start; }
.battle-controls .player-heading { gap:4px; }
.battle-controls .player-name { font-size:14px; }
.battle-controls .player-level>b { font-size:11px; }
.battle-controls .player-xp { max-width:none; gap:3px; }
.battle-controls .player-xp>small { font-size:9px; }
.battle-controls .player-xp .xp-count { display:none; }
.battle-controls .player-status .xp-track { height:4px; }
.battle-controls .health-ring { width:48px; height:48px; }
.battle-controls .health-value { padding:7px 2px; }
.battle-controls .health-value>.hp-current { font-size:12px; line-height:14px; }
.battle-controls .health-value>span { font-size:9px; }
.battle-controls .health-value>small { font-size:9px; line-height:11px; }
.battle-controls .player-status .hud-counters { font-size:14px; gap:6px; }
.battle-controls .player-status .hud-counters>span { gap:3px; }
.battle-controls .player-status .hud-counters .ui-icon { width:16px; height:16px; }
.battle-controls .player-status .hud-counters small { font-size:11px; }
.card-footer>span:last-child { display:flex; align-items:center; justify-content:flex-end; gap:3px; }
.card-footer .magazine-symbol { display:inline-block; height:14px; width:calc(14px*var(--art-ratio)); flex:none; }
.command-info .magazine-symbol { display:inline-block; height:16px; width:calc(16px*var(--art-ratio)); flex:none; }
.battle-screen .battle-controls .end-turn { min-width:0; width:100%; max-width:none; min-height:54px; font-size:13px; margin:0; padding:3px 2px; }
.battle-screen .command-row { min-height:66px; gap:6px; }
.battle-screen .command-info strong { font-size:14px; }
.battle-screen .command-info small { font-size:12px; gap:6px; }
.battle-screen .command-info>span { font-size:12px; }
.battle-screen .attack-confirm { width:76px; min-height:52px; font-size:14px; }
.battle-screen .cancel-selection { width:40px; height:44px; }
.battle-screen .target-tabs { margin:5px 0 3px; }
.battle-screen .target-tabs span { font-size:12px; padding-left:0; white-space:normal; }
.battle-screen .target-tabs .ui-icon { display:none; }
.battle-screen .combat-fx .fx-banner { top:38%; font-size:12px; max-width:92%; white-space:normal; text-align:center; }
.battle-screen .combat-fx .victory-banner { font-size:20px; }

@media (min-width:375px) and (max-width:399px) {
 .battle-screen .battle-controls { grid-template-columns:100px minmax(0,1fr) 64px; }
}
@media (max-width:374px) {
 .action-nav { padding-left:6px; padding-right:6px; gap:0; }
 .action-nav>button { font-size:12px; gap:3px; }
 .action-nav .ui-icon { width:17px; height:17px; }
 .hud.player-status { gap:4px 8px; padding-left:12px; padding-right:12px; }
 .player-name { font-size:18px; }
 .player-status .hud-counters { font-size:13px; gap:7px; }
 .player-heading { gap:5px; }
 .home-screen .hero-select { gap:6px; }
 .home-screen .hero-choice { padding-left:5px; padding-right:5px; }
 .hero-card-heading { grid-template-columns:32px minmax(0,1fr); gap:4px; min-height:32px; }
 .hero-portrait { width:32px; height:32px; }
 .home-screen .hero-choice strong { font-size:13px; }
 .battle-screen .battle-caption { padding-left:8px; padding-right:8px; gap:4px; }
 .battle-screen .battle-caption-tools { gap:3px; }
 .battle-screen .battle-caption h1 { font-size:16px; }
 .battle-screen .battle-summary { padding-left:8px; padding-right:8px; gap:4px; }
 .battle-summary .intent { padding-left:2px; padding-right:2px; }
 .battle-summary .intent b { font-size:12px; }
 .battle-screen .battle-controls { grid-template-columns:96px minmax(0,1fr) 58px; padding-left:7px; padding-right:7px; gap:5px; }
 .combat-resources { grid-template-columns:40px minmax(0,1fr); }
 .battle-screen .combat-resources::after { right:-2px; }
 .battle-controls .hud.player-status { grid-template-columns:max-content 44px max-content; gap:4px; padding:0; }
 .battle-controls .player-heading { gap:3px; }
 .battle-controls .player-name { font-size:13px; }
 .battle-controls .player-level>b { font-size:10px; }
 .battle-controls .health-ring { width:44px; height:44px; }
 .battle-controls .health-value>.hp-current { font-size:11px; }
 .battle-screen .battle-controls .end-turn { font-size:12px; }
 .battle-screen .arena { grid-template-columns:72px minmax(0,1fr); gap:5px; padding-left:8px; padding-right:8px; }
 .battle-screen .arena .enemy-row { gap:4px; }
 .battle-screen .arena .survivor { width:72px; }
 .battle-screen .survivor .sprite.actor-sprite { width:88px; height:88px; }
 .battle-screen .quick-item-cost { display:none; }
 .battle-screen .hand-title small { display:none; }
 .battle-screen .enemy-detail-button { font-size:12px; }
}
@media (max-width:349px) {
 .battle-screen .battle-controls { grid-template-columns:90px minmax(0,1fr) 54px; padding-left:6px; padding-right:6px; gap:4px; }
 .combat-resources { grid-template-columns:38px minmax(0,1fr); }
 .battle-screen .energy>span { font-size:10px; gap:2px; }
 .battle-screen .energy .ui-icon { width:13px; height:13px; }
 .battle-controls .hud.player-status { grid-template-columns:max-content 40px max-content; gap:3px; }
 .battle-controls .player-heading { gap:2px; }
 .battle-controls .player-name { font-size:12px; }
 .battle-controls .health-ring { width:40px; height:40px; }
 .battle-controls .health-value { padding:7px 1px; }
 .battle-controls .health-value>.hp-current { font-size:10px; }
 .battle-controls .health-value>span { font-size:8px; }
 .battle-controls .health-value>small { font-size:8px; line-height:10px; }
 .battle-controls .player-status .hud-counters { font-size:13px; }
 .battle-controls .player-status .hud-counters>span { gap:2px; }
 .battle-controls .player-status .hud-counters .ui-icon { width:14px; height:14px; }
 .battle-controls .player-status .hud-counters small { font-size:10px; }
 .battle-screen .battle-controls .end-turn { font-size:11px; }
 .reload-verb { display:none; }
}
@media (max-height:750px) {
 .hud.player-status { min-height:80px; padding-top:calc(6px + env(safe-area-inset-top)); padding-bottom:4px; }
 .battle-controls .hud.player-status { min-height:0; padding:0; }
 .player-status .hero-badge { gap:6px; }
 .player-name { font-size:18px; }
 .health-ring { width:60px; height:60px; }
 .home-screen .home-bottom { margin-top:27px; }
 .home-screen .hero-choice { height:auto; min-height:126px; }
 .battle-screen .arena { --enemy-art-height:95px; min-height:194px; }
 .battle-screen.boss-fight .arena { --enemy-art-height:114px; min-height:213px; }
 .battle-screen .battle-caption { min-height:48px; padding-top:calc(4px + env(safe-area-inset-top)); padding-bottom:4px; }
 .battle-screen .hand-heading { min-height:38px; padding-top:0; padding-bottom:0; }
 .battle-screen .hand-title { min-height:38px; }
 .battle-screen .survivor .sprite.actor-sprite { width:84px; height:84px; }
 .battle-screen .hand { height:210px; min-height:210px; }
 .battle-screen .hand .game-card { height:190px; min-height:190px; grid-template-rows:22px 20px 30px minmax(0,1fr) 24px; }
 .battle-screen .hand .card-cost { top:5px; width:23px; height:23px; font-size:18px; }
 .battle-screen .hand .card-art { height:auto; }
 .battle-screen .hand .card-art .item-art { height:27px; width:calc(27px*var(--art-ratio)); }
 .battle-screen .hand .card-text { font-size:13px; line-height:18px; min-height:0; }
}
@media (prefers-reduced-motion:reduce) {
 .health-arc { transition:none; }
}

/* The soundtrack catalog stays inside sound settings. */
.audio-sheet .music-library { margin:16px 0; border-top:1px solid #435043; }
.audio-sheet .music-library>summary { padding:13px 0; color:#d6dec4; font-size:14px; font-weight:650; cursor:pointer; }
.audio-sheet .music-library>p { margin:0 0 8px; font-size:12px; line-height:1.6; }
.audio-sheet .music-track-list { max-height:min(350px,45dvh); overflow-y:auto; overscroll-behavior:contain; }
.audio-sheet .music-track { width:100%; min-height:50px; display:flex; align-items:center; justify-content:space-between; gap:10px; padding:8px 10px; border-bottom:1px solid #354337; border-radius:0; text-align:left; }
.audio-sheet .music-track strong { display:block; font-size:14px; color:#d5dbc9; }
.audio-sheet .music-track small { display:block; margin-top:4px; font-size:12px; color:#94a38f; }
.audio-sheet .music-track .music-timbre { color:#96b0a3; font-size:12px; line-height:1.5; }
.audio-sheet .music-track .ui-icon { flex:none; width:18px; height:18px; color:#81917a; }
.audio-sheet .music-track.is-playing { background:#8aa36920; }
.audio-sheet .music-track.is-playing strong,.audio-sheet .music-track.is-playing .ui-icon { color:#d4e7ac; }
.audio-sheet .music-preview-stop { width:100%; min-height:44px; margin:10px 0 0; font-size:14px; }
.audio-sheet .music-preview-stop[hidden] { display:none; }
.audio-sheet .music-variations { margin-top:12px; }
.audio-sheet .music-variations[hidden] { display:none; }
.audio-sheet .music-variations>small { color:#8f9d89; font-size:11px; }
.audio-sheet .music-variations>div { display:flex; gap:6px; margin-top:7px; }
.audio-sheet .music-variations button { flex:1; min-height:38px; font-size:12px; border:1px solid #43533f; }
.audio-sheet .music-variations button[aria-pressed="true"] { color:#d4e7ac; background:#8aa36928; border-color:#adc585; }
.audio-sheet .music-variations button[hidden] { display:none; }

/* Local save tools use the same compact game sheet. */
.save-help{margin:14px 0;line-height:1.8}
.save-sheet .option-list{margin:16px 0}
.save-sheet .choice-row{min-height:54px;justify-content:flex-start;font-size:15px;gap:12px}
.save-sheet .save-detail{justify-content:space-between;gap:10px}
.save-indicator.conflict{color:#e9b66c}
.save-detail.error .green-dot,.save-detail.conflict .green-dot{background:#d87570}
@media(max-width:360px){.home-tools{gap:5px}.home-tools .icon-button{width:32px;height:34px}}
