/* Readable combat HUD: let short screens scroll instead of shrinking portraits. */
#game-view.combat-scene{container-type:inline-size;overflow-y:auto;overflow-x:hidden}
#game-view.combat-scene>.page-pad{height:auto;min-height:100%;display:block;padding:10px 12px 24px}
.combat-stage{--enemy-size:clamp(76px,24cqw,94px);--hero-size:clamp(112px,32cqw,138px);gap:10px;flex:none;min-height:0}
.combat-context{font-size:12px;margin-bottom:6px}.combat-top h3{font-size:16px}.combat-top>span{font-size:12px}.combat-clock{font-size:13px;padding:5px 0}.combat-clock progress{height:5px}
.combat-enemies{width:min(100%,354px);gap:14px 9px;margin:8px auto 0}
.combat-bosses{margin:10px 0 4px}.combat-bosses>.boss-unit{width:116px;max-width:44%}
.combat-stage .unit-heading,.combat-stage .ally-mini .unit-heading{height:32px;margin-bottom:5px}
.combat-stage .unit-heading strong,.combat-stage .ally-mini .unit-heading strong{font-size:12px;line-height:16px;min-height:16px}
.combat-stage .unit-heading small,.combat-stage .ally-mini .unit-heading small{font-size:10px;line-height:13px}
.combat-stage .unit-hp,.combat-stage .ally-mini .unit-hp{font-size:10px;line-height:16px}.combat-stage .unit-hp-track{height:7px;margin-top:5px}
.combat-enemies .unit-heading{width:100%;max-width:none}.combat-stage .combat-statuses,.combat-stage .ally-mini .combat-statuses{top:38px;right:-3px;gap:4px;max-height:none;max-width:calc(100% + 6px);flex-wrap:wrap;min-height:0}
.combat-stage .status-icon,.combat-stage .ally-mini .status-icon{min-width:24px;height:24px;font-size:17px;line-height:22px;border-radius:5px;background:#111723ee;box-shadow:0 1px 4px #000b}
.combat-stage .status-icon b,.combat-stage .ally-mini .status-icon b{font-size:11px;bottom:-4px;right:-4px;min-width:13px;line-height:14px;background:#111723;border-radius:3px}
.combat-stage .own-character .status-icon{height:27px;min-width:27px;font-size:19px}.combat-stage .own-character .status-icon b{font-size:12px}
.combat-announcement{min-height:38px;max-height:none;font-size:13px;line-height:1.45;margin-top:12px;padding:4px 0;overflow:visible}.combat-announcement small{font-size:12px;line-height:1.45}
.combat-announcement .primary-button,.combat-announcement .text-button{font-size:12px;min-height:32px}
.combat-player-line{position:relative;flex:none;min-height:195px;max-height:none;grid-template-columns:100px var(--hero-size) 44px;gap:10px;align-items:center;align-content:center;margin:20px 0 30px;padding:0}
.combat-stage .own-character .unit-heading strong{font-size:14px}.combat-stage .own-character .unit-hp{font-size:12px}.combat-stage .own-character .unit-hp-track{height:8px}
.combat-command-orbit{width:100px;height:154px;grid-template-columns:repeat(2,48px);grid-template-rows:repeat(3,48px);gap:5px 4px}
.combat-command-orbit .diamond-command{width:48px;height:48px;min-height:48px;padding:2px;border-radius:9px}
.diamond-command>span{display:flex;align-items:center;justify-content:center;flex-direction:column;font-size:14px;gap:0}.diamond-command small{font-size:8px;line-height:10px}.log-command{grid-area:2/1}
.command-art{display:block;width:30px;height:30px;object-fit:contain;pointer-events:none}.potion-command .command-art{height:25px}
.combat-command-orbit .combat-turn-order{width:48px}.combat-command-orbit .combat-turn-order>button{width:48px;height:48px;min-height:48px}
.combat-command-orbit .combat-turn-order ol{width:min(240px,calc(100cqw - 30px));max-height:min(310px,55dvh);font-size:12px}
.combat-chat-button{width:44px;height:48px;margin-bottom:22px;padding:2px}.combat-chat-button .command-art{margin:auto}.combat-chat-button small{font-size:10px}
.combat-allies{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:18px 12px;width:min(100%,350px);margin:0 auto 18px}
.combat-allies>.ally-mini{grid-column:span 2;width:100%;max-width:90px}.combat-allies.count-1>.ally-mini{grid-column:3/span 2}.combat-allies.count-2>.ally-mini:first-child{grid-column:2/span 2}.combat-allies.count-2>.ally-mini:last-child{grid-column:4/span 2}
.combat-allies.count-4>.ally-mini:nth-child(4){grid-column:3/span 2}.combat-allies.count-5>.ally-mini:nth-child(4){grid-column:2/span 2}.combat-allies.count-5>.ally-mini:nth-child(5){grid-column:4/span 2}
.combat-skill-picker{inset:auto 0 0;transform:none;max-height:min(68dvh,500px);width:auto;max-width:100%;border:1px solid #a599ba;border-radius:12px}.combat-skill-picker>div{z-index:2}.combat-skill-option strong{font-size:14px}.combat-skill-option small{font-size:12px;line-height:1.4}
.combat-stage .combat-float{min-width:0;max-width:none;padding:0;font-size:26px;font-weight:900;line-height:1;white-space:nowrap;text-align:center;overflow-wrap:normal;pointer-events:none;transform:translate(-50%,-50%);background:none;border:0;border-radius:0;box-shadow:none;color:#fff;-webkit-text-stroke:3px #000;paint-order:stroke fill;text-shadow:0 2px 3px #0008}
.combat-stage .combat-float.crit{font-size:28px;color:#ff3f46;border:0;box-shadow:none}.combat-stage .combat-dice{width:36px}.combat-stage .d8-shape{width:32px;height:37px}.combat-stage .combat-dice small{font-size:9px}
.combat-log-panel{position:absolute;z-index:30;left:10px;right:10px;bottom:82px;display:flex;flex-direction:column;height:min(360px,55dvh);max-height:none;min-height:0;padding:14px;margin:0;background:#101725fa;border:1px solid #9a87b3;border-radius:13px;box-shadow:0 12px 50px #000b}
.combat-log-panel[hidden]{display:none}.combat-log-panel.expanded{top:70px;bottom:82px;height:auto}.combat-log-panel header{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:10px}.combat-log-panel h3{font-size:15px;flex:1;margin:0}.combat-log-panel header button{padding:8px;font-size:12px;min-height:36px}.combat-log-panel .battle-log{flex:1;min-height:0;max-height:none;height:auto;overflow:auto;overscroll-behavior:contain;font-size:14px;line-height:1.6;padding:10px}.combat-log-panel .battle-log p{margin:0 0 10px}
.spectator-commands{grid-column:1;grid-row:1;display:flex;flex-direction:column;gap:10px;align-items:center}.spectator-commands .combat-turn-order{position:relative;inset:auto}.spectator-commands .combat-turn-order>button{width:48px;min-height:48px;padding:6px;justify-content:center}.spectator-commands .combat-turn-order strong,.spectator-commands .combat-turn-order b{display:none}.spectator-commands .combat-turn-order ol{position:absolute;left:0;bottom:100%;width:225px;max-height:260px;overflow:auto;background:#101725f7;border:1px solid #a698bb;border-radius:8px}.combat-player-line:has(.spectator-commands)>.own-character{grid-column:2;grid-row:1}.combat-player-line:has(.spectator-commands)>.combat-chat-button{grid-column:3;grid-row:1}
.inventory-accordion{border:1px solid #74778a66;border-radius:13px;overflow:hidden;margin:16px 0;padding:0;background:#121927}
.inventory-accordion>summary{display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:94px;padding:18px;cursor:pointer;list-style:none;color:#fff;text-shadow:0 2px 5px #000;background-position:center;background-size:cover}
.inventory-accordion>summary::-webkit-details-marker{display:none}.inventory-accordion>summary strong{display:block;font-size:17px}.inventory-accordion>summary small{display:block;margin-top:5px;font-size:12px;color:#e0d7c9}.inventory-accordion>summary>b{font-size:25px;transition:transform .2s}.inventory-accordion[open]>summary>b{transform:rotate(180deg)}.inventory-accordion-body{padding:16px}
.potion-pouch>summary{background-image:linear-gradient(90deg,#101320dc,#17172577),url('assets/locations/potion-table.webp')}.mount-pouch>summary{background-image:linear-gradient(90deg,#101820dd,#17172577),url('assets/locations/wolves-forest.webp')}
.potion-art.potion-image{display:block;width:64px;height:64px;object-fit:contain;border:0;border-radius:0;background:none;box-shadow:none;margin:4px auto;transform:none}.potion-use-list .potion-art.potion-image{flex-shrink:0;width:52px;height:52px;margin:0}.reset-shop-art{width:80px;height:80px;object-fit:cover;border-radius:10px;border:1px solid #a891c7}
#music-close{display:block;min-height:34px;margin:10px 0 0 auto;padding:6px 12px;color:#fff;border:1px solid #8390a6;border-radius:6px;background:#29344b}
.game-nav button .nav-art{width:30px;height:30px;object-fit:contain;display:block;margin:0 auto 3px;filter:drop-shadow(0 2px 3px #0008)}.game-nav button{padding-top:6px;padding-bottom:6px}.game-nav button.active .nav-art{filter:drop-shadow(0 0 5px #debe7390)}
.battle-result.defeat:not(.pvp-result){background:linear-gradient(180deg,#13111e22 10%,#090e20a8 60%,#070c19f5 100%),url('assets/locations/pve-defeat.webp') center 30%/cover no-repeat}.pve-defeat-window{height:clamp(170px,31dvh,340px);width:100%;flex-shrink:0}.battle-result.defeat:not(.pvp-result) h2,.battle-result.defeat:not(.pvp-result) p{text-shadow:0 2px 6px #000}
@media(max-width:350px){.combat-player-line{grid-template-columns:92px 108px 38px;gap:6px}.combat-command-orbit{width:92px;grid-template-columns:repeat(2,44px);gap:5px 4px}.combat-command-orbit .diamond-command,.combat-command-orbit .combat-turn-order>button{width:44px}.combat-stage{--hero-size:108px}.combat-chat-button{width:38px}.combat-allies{gap:18px 8px}.combat-stage .unit-heading strong,.combat-stage .ally-mini .unit-heading strong{font-size:11px}}
@media(prefers-reduced-motion:reduce){.inventory-accordion>summary>b{transition:none}}
/* Dungeon presentation is a viewport-sized sibling, never clipped by the battle scroller. */
#dungeon-transition-panel{position:absolute;z-index:28;inset:64px 0 80px;overflow-y:auto;overflow-x:hidden;background:#090e1bef;overscroll-behavior:contain}
#dungeon-transition-panel[hidden]{display:none}
#dungeon-transition-panel .dungeon-transition{position:static;inset:auto;display:flex;align-items:center;justify-content:center;width:100%;min-height:100%;height:auto;margin:0;padding:18px 12px;box-sizing:border-box;overflow:visible}
#dungeon-transition-panel .dungeon-transition-card{width:min(100%,420px);max-width:100%;margin:auto;box-sizing:border-box;padding:22px 18px}
#dungeon-transition-panel .dungeon-transition-card h2{font-size:clamp(20px,5vw,28px);overflow-wrap:anywhere}
#dungeon-transition-panel .dungeon-roster{display:flex;flex-wrap:wrap;justify-content:center;gap:6px}
#dungeon-transition-panel .dungeon-roster span{overflow-wrap:anywhere;max-width:100%}
#game-view.dungeon-loading-scene{background:#101522!important}.dungeon-entry-page{min-height:100%}
