:root{color-scheme:dark;background:#182a27;color:#efe3c5;font-family:Georgia,'Times New Roman',serif}body{background:radial-gradient(ellipse at top,#34463b,#152724 70%);min-height:100dvh}button,select,summary,.hud,.toolbar,#status,#effects-hud{font-family:system-ui,sans-serif}button,select{background:linear-gradient(#35473d,#26392f);border-color:#8a8162;color:#f4e8cc;box-shadow:0 2px 0 #0b1c18;border-radius:6px}.primary,button[aria-pressed=true]{background:linear-gradient(#eed398,#c8a463);color:#2b3023;border-color:#ffe5aa}button:hover{filter:brightness(1.12);background-color:#405444}.game-brand{padding:9px 20px;border-bottom:1px solid #92846544;background:#142621}.game-brand a{text-decoration:none;letter-spacing:3px;font:400 13px system-ui;color:#ecdbb5}.game-brand span{font-size:10px;letter-spacing:2px;margin-left:14px;color:#b9bfaa}main{max-width:1440px;padding:12px 18px}.main-menu{min-height:min(680px,85dvh);display:grid;grid-template-columns:1.3fr 1fr;align-items:stretch;border:1px solid #a28c614a;border-radius:14px;overflow:hidden;background:#1c3029;box-shadow:0 20px 90px #07150e77}.menu-art{background-image:linear-gradient(90deg,transparent 90%,#1c3029),url('assets/menu-cover-v26-29.webp');background-size:100% 100%,cover;background-position:center,center;background-repeat:no-repeat;min-height:520px}.menu-copy{padding:65px 45px 38px;display:flex;flex-direction:column;justify-content:center}.eyebrow{font:11px system-ui;letter-spacing:2px;color:#bcb98f}.menu-copy h1{font-size:clamp(34px,4vw,62px);line-height:1.03;margin:24px 0 15px;color:#f2ddb3;font-weight:400}.menu-copy h1 span{display:block;font-size:.63em;margin-top:12px;color:#d4ad6e}.menu-copy p{color:#ced0b6;font-size:18px}.menu-actions{display:grid;gap:12px;max-width:300px;margin:25px 0}.menu-actions button{min-height:52px;font-size:17px}.menu-note{font:12px system-ui;color:#a7b39c}.hud{border-bottom:1px solid #99896840;padding:0 0 8px}.hud #title{font-size:17px;color:#f4dfb9}.hud #wave{color:#bfcbb6}#arena.illustrated-arena{background:#24362c;border:1px solid #b59b6870;box-shadow:0 5px 28px #05180f77;border-radius:10px;max-height:64dvh}#board{image-rendering:auto}#status{color:#d5bf8d;font-size:12px}#stock{color:#d6c69e;font-size:13px}#effects-hud{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0}.perk{font-size:11px;border:1px solid #9d98616b;background:#293d31;border-radius:20px;padding:4px 10px}.perk-burn,.perk-groundBurn{border-color:#dc945b;color:#f5c190}.perk-slow,.perk-chain{border-color:#77bfc3;color:#c3eff1}dialog{background:linear-gradient(135deg,#34443a,#182e26);border:1px solid #c9ac70;color:#f1e2bf;box-shadow:0 20px 80px #06160ec0}dialog h2{font-size:28px;font-weight:400;color:#f3dba8}dialog::backdrop{background:#061510de;backdrop-filter:blur(5px)}.dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:14px}.weapon-options{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:24px 0}.weapon-options button{display:flex;flex-direction:column;align-items:center;text-align:center;padding:18px;gap:12px;background:linear-gradient(#4a5140,#25372d)}.weapon-options strong{font:24px Georgia;color:#f2d9a7}.weapon-options button>span:last-child{font-size:14px;line-height:1.5;color:#cfdbc4}.weapon-art{display:block;width:160px;height:125px;background:radial-gradient(ellipse,#efd6a333,transparent 70%)}.weapon-art canvas{margin:0;touch-action:auto}.pause-actions{display:grid;gap:12px;margin-bottom:22px}#pause-menu{max-width:400px}#characters{max-width:1050px}#character-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:20px}.character-card{background:#20372d;border:1px solid #aa976e55;border-radius:10px;padding:14px;text-align:center}.character-card h3{margin:12px 0 6px;font-size:21px}.character-card p{font:13px/1.5 system-ui;color:#c2ceb7;margin:0}.character-portrait{height:210px;overflow:hidden;border-radius:6px;background:#bca676}.character-portrait img{width:100%;height:100%;object-fit:contain}.hero-portrait{background-image:url('assets/hearth-portraits-161.webp');background-size:300% 200%;background-repeat:no-repeat}.chapter{background:#24392f;border-color:#887e59}.chapter h3{color:#eedab3}.chapter p{color:#bcc6ab}#chapter-select{max-width:1100px}#cards button{border:1px solid #cfac72;background:linear-gradient(#4a4c37,#2a3c2f);min-height:210px;position:relative;padding-top:28px}#cards strong{font:22px Georgia;color:#f5dfb6}#cards small{margin-top:auto}.trial-brief{background:#263e31;border-color:#a6956355}details{border-color:#a6956355;font-family:system-ui;font-size:13px}.lane{background:#2c4032;color:#d6dfc9}#campaign-story{box-shadow:0 15px 90px #000a;border-color:#d5b47e}#campaign-story .story-copy{background:linear-gradient(135deg,#eaddb9,#d2bd91);color:#352e23}#campaign-story #story-text{font-family:Georgia,serif;color:#332f24;line-height:1.55}#campaign-story #story-speaker{color:#664a2b}#campaign-story .story-bottom{border-top-color:#78663b44}#campaign-story #story-count{color:#705b36}#campaign-story .story-scroll-note{color:#795b32}#hazard{padding:7px 10px;background:#54345b66;border-left:3px solid #c997dd;color:#efd7f8}#lane-live{font:12px system-ui}
@media(max-width:700px){main{padding:8px}.game-brand{padding:9px 12px}.main-menu{display:block;min-height:auto}.menu-art{min-height:260px;background-image:linear-gradient(0deg,#1c3029,transparent 45%),url('assets/menu-cover-v26-29.webp')}.menu-copy{padding:10px 28px 28px}.menu-copy h1{font-size:42px;margin:10px 0}.menu-copy p{font-size:16px}.menu-actions{margin:16px 0;max-width:none}.menu-note{font-size:11px}.hud #title{font-size:13px}.hud #lives{white-space:nowrap;font-size:12px}.hud #game-menu{font-size:12px;padding:7px}.hud div{flex:1}.toolbar{gap:5px}.toolbar button{font-size:12px;min-height:38px}#arena.illustrated-arena{max-height:57dvh}#stock{width:auto;margin-left:auto;font-size:11px}.weapon-options{gap:8px}.weapon-options button{padding:10px 8px}.weapon-options strong{font-size:21px}.weapon-options button>span:last-child{font-size:12px}.weapon-art{width:130px;height:110px}.weapon-art canvas{width:130px;height:102px}#character-cards{grid-template-columns:1fr 1fr;gap:9px}.character-card{padding:8px}.character-portrait{height:150px}.character-card h3{font-size:18px}.character-card p{font-size:11px}dialog h2{font-size:24px}.dialog-heading{align-items:flex-start}#cards button{min-height:155px}#cards{gap:8px}}
@media(max-height:500px) and (min-width:700px){.game-brand{padding:5px 12px}main{padding:6px 10px}.menu-art{min-height:330px}.menu-copy{padding:24px}.menu-copy h1{font-size:40px;margin:12px 0}.menu-copy p{font-size:14px;margin:7px 0}.menu-actions{margin:10px 0;gap:8px}.menu-actions button{min-height:42px}.main-menu{min-height:330px}.hud{margin:0;padding-bottom:4px}.hud #title{font-size:13px}#arena.illustrated-arena{max-height:61dvh}.toolbar{margin:5px 0}.toolbar button{font-size:11px;min-height:33px;padding:6px 9px}}

#campaign-story .story-copy{padding:24px;border:1px solid #f7e6bd;border-radius:12px;box-shadow:0 8px 30px #061b1540}#campaign-story #story-title{color:#664d30;font-weight:400}#campaign-story .story-controls{background:transparent;border-top:1px solid #8d785740;padding-top:14px}#campaign-story #story-skip{color:#725d3e;border-color:#9a855c;box-shadow:none}#campaign-story #story-scroll-note{color:#705534}@media(max-width:700px){#campaign-story .story-copy{padding:18px}#campaign-story #story-title{font-size:24px}}@media(max-height:500px) and (min-width:701px){#campaign-story .story-copy{padding:15px}}

#arena.illustrated-arena{position:relative}#arena #hazard{position:absolute;bottom:8px;left:10px;max-width:calc(100% - 20px);margin:0;z-index:2;pointer-events:none;font:12px/1.4 system-ui;border-radius:4px;background:#342439e8;box-shadow:0 2px 12px #1118}.perk-ember,.perk-ground{border-color:#dc945b;color:#f5c190}.perk-frost{border-color:#77bfc3;color:#c3eff1}@media(max-width:700px){#arena #hazard{font-size:10px;padding:5px 7px;bottom:5px;left:5px;max-width:calc(100% - 10px)}}
/* Story panels preserve their authored landscape proportions, without stretching. */
#campaign-story .story-layout{grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);gap:24px}
#campaign-story #story-art{aspect-ratio:2.25;width:100%;max-height:none;border:3px solid #151b16;border-radius:6px;box-shadow:0 12px 40px #0006}
#campaign-story #story-model{display:block;width:100%;height:auto;object-fit:contain}
#campaign-story #story-model[hidden]{display:none}
@media(max-width:700px){#campaign-story .story-layout{grid-template-columns:1fr;gap:14px}#campaign-story #story-art{width:100%}}
@media(max-height:500px) and (min-width:701px){#campaign-story .story-layout{grid-template-columns:minmax(0,1.1fr) minmax(0,1fr)}}
#priority-icon{width:38px;height:38px;vertical-align:middle;flex-shrink:0;margin:0;touch-action:auto}

/* Battle owns the viewport; controls use spare side space, never field height. */
body.battle-screen{height:100dvh;min-height:0;overflow:hidden}
.battle-screen>.game-brand{display:none}
.battle-screen>main{width:100%;max-width:none;height:100%;padding:8px}
.battle-screen #game{height:100%;min-height:0;display:flex;flex-direction:column;gap:6px}
.battle-screen .hud{flex:none;margin:0;padding:0 4px 6px;min-height:38px}
.battle-screen .hud #title{font-size:15px}
.battle-screen .hud #wave{font-size:12px}
.battle-screen .hud button{min-height:34px;padding:5px 10px;font-size:13px}
.battle-workspace{display:grid;grid-template-columns:minmax(0,1fr) 208px;gap:10px;flex:1;min-height:0}
.battle-screen #arena.illustrated-arena{width:100%;height:100%;max-height:none;min-height:0;margin:0;align-self:stretch;border-radius:7px}
#battle-controls{display:flex;flex-direction:column;gap:6px;min-width:0;min-height:0;overflow:hidden;padding:0 3px 8px;font:13px/1.35 system-ui,sans-serif}
#control-scroll{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain}
#battle-controls>#hazard{flex:none;position:static;margin:0;padding:7px 8px;font:12px/1.4 system-ui;border-radius:4px;background:#342439;border-left:3px solid #c997dd;color:#efd7f8;overflow-wrap:anywhere}
#battle-controls .toolbar,#battle-controls .row{gap:5px;margin:0 0 10px}
#battle-controls button,#battle-controls select{font-size:13px;min-height:34px;padding:6px 8px;max-width:100%}
#battle-controls .toolbar>[data-tool]{flex:1 0 42%}
#battle-controls #stock{width:100%;margin:2px 0 0;font-size:12px}
#battle-controls #start,#battle-controls #pause{width:100%;font-weight:650;min-height:38px}
#battle-controls #status{font-size:12px;line-height:1.4;margin:6px 0;min-height:0}
#battle-controls #effects-hud:empty{display:none}
#battle-controls #effects-hud{margin:8px 0;gap:4px}
#battle-controls .perk{padding:3px 7px}
#battle-controls label{flex-wrap:wrap;max-width:100%}
#battle-controls #priority-wrap{width:100%}
#battle-controls #priority{width:100%;min-width:0}
#battle-controls #priority-icon{width:30px;height:30px}
#battle-controls #lane-live,#battle-controls #preview{grid-template-columns:1fr}
#battle-controls #seals button{flex:1 0 100%}
#battle-controls #seal-stock{width:100%}
#battle-controls details{font-size:12px;padding-top:7px}
#battle-controls summary{padding:5px 0}
#battle-controls .trial-brief{padding:6px;margin:6px 0}
#battle-controls .trial-brief p,#battle-controls .muted{font-size:12px}
@media(max-width:950px) and (orientation:landscape){
 .battle-workspace{grid-template-columns:minmax(0,1fr) 170px;gap:6px}
 .battle-screen>main{padding:5px}
 .battle-screen .hud{min-height:30px;padding-bottom:3px}
 .battle-screen .hud #title{font-size:13px}
 #battle-controls button,#battle-controls select{font-size:12px;min-height:32px;padding:5px 6px}
}
@media(max-width:700px) and (orientation:portrait){
 .battle-screen>main{padding:6px}
 .battle-workspace{grid-template-columns:minmax(0,1fr);grid-template-rows:min(calc((100vw - 14px) * var(--board-ratio,.7)),55dvh) minmax(0,1fr);gap:6px}
 #battle-controls{height:auto;max-height:none;padding:0 2px 3px}
 #battle-controls .toolbar,#battle-controls .row{margin-bottom:5px;gap:5px}
 #battle-controls .toolbar>[data-tool]{flex:0 0 auto}
 #battle-controls button,#battle-controls select{min-height:38px}
 #battle-controls #start,#battle-controls #pause{width:auto}
 #battle-controls #stock{width:auto;margin-left:auto}
 #battle-controls #status{margin:3px 0}
 #battle-controls #seals button{flex:1 0 auto}
 #battle-controls #priority-wrap{flex-wrap:nowrap}
}

/* Keep the full trio visible even when the menu column is taller than the cover. */
@media(min-width:701px){
 .menu-art{position:relative;isolation:isolate;background-image:none;overflow:hidden}
 .menu-art::before,.menu-art::after{content:"";position:absolute;inset:0;pointer-events:none;background-image:url('assets/menu-cover-v26-29.webp');background-repeat:no-repeat;background-position:center}
 .menu-art::before{background-size:cover;filter:blur(22px) brightness(.45);transform:scale(1.08);opacity:.65}
 .menu-art::after{background-size:contain}
}
