*{box-sizing:border-box} :root{color-scheme:dark;font-family:"Apple SD Gothic Neo","Malgun Gothic",sans-serif;color:#f3eee0;background:#050b12}body{margin:0;min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:20px;background:radial-gradient(ellipse at center,#142432,#05090f 75%)}button{font:inherit;color:inherit;cursor:pointer}button:focus-visible{outline:3px solid #6ff3df;outline-offset:3px}.screen{width:min(1600px,100%);aspect-ratio:16/9;container-type:inline-size;overflow:hidden;border:1px solid #887045;box-shadow:0 25px 100px #000b;background:#0a1420;position:relative}.scene{height:77.78%;position:relative;overflow:hidden}.background{width:100%;height:128.57%;object-fit:cover;object-position:top;position:absolute;inset:0;filter:brightness(.83)}.scene:after{content:"";position:absolute;inset:0;pointer-events:none;box-shadow:inset 0 -30px 50px #07111c80}#arena{position:absolute;inset:0;width:100%;height:100%;image-rendering:pixelated}.location{position:absolute;top:2.4cqw;left:2.3cqw;text-shadow:0 2px 6px #000}.location h1{font:small-caps 2.8cqw Georgia,serif;margin:0;color:#f7ebc7;letter-spacing:.08em;border-bottom:1px solid #af9152;padding-bottom:.5cqw}.location p{font-size:1.2cqw;margin:.7cqw 0}.location span{color:#b59a68}.turns{position:absolute;left:39%;top:1.1cqw;text-align:center}.turns p{font-size:.95cqw;color:#d6c7a9;letter-spacing:.12em;margin:.6cqw}#turn-order{display:flex;gap:.4cqw}.turn-icon{width:3.9cqw;height:3.9cqw;background:#07111ee6;border:1px solid #a78a54;image-rendering:pixelated}.turn-icon.active{border-color:#fbd88e;box-shadow:0 0 10px #ffd36840}.panel{background:linear-gradient(120deg,#07121ef5,#030a12f5);border:1px solid #a28a5e;box-shadow:inset 0 0 0 3px #07101c,inset 0 0 0 4px #79613c66}.boss{position:absolute;right:1.5cqw;top:1.2cqw;width:22cqw;padding:1cqw}.boss>div:first-child{display:flex;justify-content:space-between;align-items:center;font-size:1.2cqw}.boss strong{font-weight:600}.boss span{color:#ee5b53;font-size:.95cqw}.boss b{font-size:2cqw}.bar{height:.7cqw;background:#030a13;border:1px solid #5b6a79;border-radius:3px;overflow:hidden}.bar i{display:block;height:100%;background:linear-gradient(#64f6d4,#1ebf9e)}.boss-bar{height:1cqw;margin-top:.6cqw}.boss-bar i{width:70.42%;background:linear-gradient(#ff777a,#d73342)}.boss p{font-size:1cqw;text-align:right;margin:.4cqw 0 0}.boss p span{color:#b8bec7;font-size:inherit}.intent{position:absolute;right:22%;top:8cqw;padding:.5cqw 1cqw;border:1px solid #c97045;background:#100d11e8;border-radius:3px;font-size:1.05cqw;box-shadow:0 0 18px #f34e1420}.intent span,.intent b{color:#f48758}.intent small{padding:0 .3cqw}.hud{height:22.22%;display:flex;gap:.8cqw;padding:1.1cqw 1cqw;background:linear-gradient(#0b1723,#040c15);border-top:2px solid #b89b61;position:relative;z-index:2}.party{display:grid;grid-template-columns:repeat(4,1fr);gap:.6cqw;width:73%}.member{background:linear-gradient(135deg,#0d1b29,#050c15);border:1px solid #947f58;padding:.65cqw;display:flex;gap:.65cqw;text-align:left;border-radius:3px;min-width:0}.member.selected{border-color:#f2d18a;box-shadow:0 0 10px #efbd5240,inset 0 0 8px #dfba4520}.portrait{width:4.7cqw;height:7.2cqw;align-self:center;background:#07121b;border:1px solid #897148;image-rendering:pixelated}.stats{flex:1;min-width:0;align-self:center}.stats strong{font-size:1.15cqw;font-weight:600;display:block;margin-bottom:1cqw}.stat-line{display:flex;justify-content:space-between;font-size:.88cqw;margin:.4cqw 0 .25cqw;white-space:nowrap}.stat-line em{font-style:normal;color:#64efd0}.stat-line.mp em{color:#7fc9ff}.mp-bar i{background:linear-gradient(#75caff,#268cdd)}.commands{flex:1;padding:.5cqw 1cqw}.commands h2{font-size:1.2cqw;text-align:center;margin:0 0 .4cqw;font-weight:600}.command-grid{display:grid;grid-template-columns:1fr 1fr;gap:.45cqw}.command-grid button{padding:.38cqw;background:#07101c;border:1px solid #85909e;border-radius:3px;font-size:1.15cqw;display:flex;align-items:center;gap:1cqw;justify-content:center}.command-grid button span{font-size:1.45cqw;line-height:1}.command-grid button:hover,.command-grid button.chosen{background:linear-gradient(120deg,#635126,#2b2517);border-color:#f3d58b;box-shadow:0 0 8px #ffd67540}.commands p{font-size:.75cqw;color:#b5bdc9;text-align:center;margin:.4cqw 0 0}.unit-target{position:absolute;background:transparent;border:0;border-radius:50%;z-index:1}.unit-target:hover{background:#50e9d00c}.unit-target:focus-visible{outline:2px solid #60e8d4}.preview-controls{display:flex;gap:12px;align-items:center;color:#8398ac;font-size:12px;margin:18px 0 0;width:min(1600px,100%)}.preview-controls button{background:#101d29;border:1px solid #324355;border-radius:5px;padding:7px 12px;font-size:12px}.preview-controls button:first-of-type{margin-left:auto}.preview-controls button:hover{border-color:#b79a65;color:#f0d9a5}.live-dot{width:6px;height:6px;background:#58dec1;border-radius:50%;box-shadow:0 0 10px #58dec170}.separator{color:#34485a}#loading{position:absolute;inset:45% 0 auto;text-align:center;color:#f1d59e;font-size:1.3cqw;text-shadow:0 2px 5px #000}.screen:fullscreen{width:100vw;height:100vh;border:0;aspect-ratio:auto}.screen:fullscreen .scene{height:77.78%}@media(max-width:700px){body{padding:8px}.preview-controls{flex-wrap:wrap;gap:8px;font-size:10px}.preview-controls .separator,.preview-controls .separator+span{display:none}.preview-controls button{font-size:10px;padding:6px 8px}}@media(prefers-reduced-motion:reduce){.live-dot{box-shadow:none}}
/* Revised loadout HUD and one-character action preview. */
.location h1{font:600 2.3cqw "Apple SD Gothic Neo",sans-serif;letter-spacing:.04em;min-width:12cqw;padding-bottom:.6cqw}.location p{font-size:1.2cqw}.boss{left:36%;right:auto;top:1.2cqw;width:29cqw;padding:.6cqw 1.3cqw}.boss h2{font:1.5cqw Georgia,serif;text-align:center;margin:0 0 .7cqw;color:#eed9a5}.enemy-name{display:flex;align-items:center;justify-content:center;gap:1cqw;font-size:1.2cqw}.boss .enemy-name span{border:1px solid #c44c47;padding:.15cqw .4cqw;border-radius:2px}.boss-bar{margin-top:.65cqw}.intent{top:8.5cqw;right:20%}.party{width:66%}.member{position:relative;padding:.6cqw;gap:.55cqw}.portrait{object-fit:contain;width:4.8cqw;height:7.4cqw;background:#06111d;border:1px solid #7c6847}.stats strong{margin-bottom:.8cqw;font-size:1.1cqw}.role-badge{position:absolute;top:-.6cqw;left:50%;transform:translateX(-50%);font-size:.65cqw;padding:.1cqw .6cqw;border:1px solid #8f7951;background:#0a1520;white-space:nowrap;border-radius:3px;color:#bbc6d1}.selected .role-badge{border-color:#dcb66c;color:#f1d79a}.stat-line{font-size:.78cqw}.commands{padding:.5cqw .8cqw}.commands h2{font-size:1.05cqw;margin-bottom:.5cqw}.command-grid{gap:.4cqw}.command-grid button{position:relative;padding:.4cqw .3cqw;gap:.5cqw;min-height:3.45cqw;text-align:left;justify-content:flex-start;padding-left:1.5cqw;font-size:1cqw}.command-grid button span{font-size:inherit;line-height:1.2}.command-grid button .ability-icon{font-size:1.8cqw;width:2cqw;text-align:center;color:#ead49d}.command-grid button small{display:block;color:#7ad8ef;font-size:.8cqw;margin-top:.15cqw}.command-grid kbd{font:inherit;font-size:.7cqw;position:absolute;top:.3cqw;left:.3cqw;color:#e4c57e}.command-grid button:disabled{cursor:default;opacity:.55}.command-grid button.chosen{opacity:1}.commands p{font-size:.7cqw;margin:.35cqw 0 0}.action-banner{position:absolute;left:50%;top:24%;transform:translateX(-50%);padding:.55cqw 2cqw;background:linear-gradient(90deg,transparent,#09121ce8 15%,#09121ce8 85%,transparent);color:#f5dfaf;border-top:1px solid #b79b5266;border-bottom:1px solid #b79b5266;font-size:1.35cqw;pointer-events:none;white-space:nowrap}.preview-controls #demo{margin-left:auto}.preview-controls button:first-of-type{margin-left:0}.speed-label{display:flex;gap:5px;align-items:center}.speed-label select{background:#101d29;border:1px solid #324355;color:#eee4ce;padding:6px;border-radius:4px;font:inherit}#phase-label{color:#d6bd8c;min-width:100px}.screen:fullscreen{height:auto;max-height:100vh;width:min(100vw,177.7778vh);margin:auto;aspect-ratio:16/9}@media(max-width:700px){.preview-controls{justify-content:flex-start}.preview-controls #demo{margin-left:auto}#phase-label{min-width:0}.speed-label{font-size:10px}}
/* Keep the full stage and playback controls visible in short browser windows. */
.screen{width:min(1600px,100%,calc((100dvh - 110px)*1.7777778));flex-shrink:0}.preview-controls{width:min(1600px,100%,calc((100dvh - 110px)*1.7777778))}.screen:fullscreen{width:min(100vw,177.7778vh)}
/* Match the approved party cards and equipped-action tiles. */
.hud{gap:.7cqw;padding:1.2cqw .9cqw 1cqw;background:linear-gradient(#08131e,#030b13)}.party{width:66.5%;gap:.7cqw;grid-template-columns:1.12fr 1fr 1fr 1fr}.member{padding:.7cqw .55cqw;gap:.65cqw;border-color:#a78b56;background:linear-gradient(130deg,#0a1724,#030b14);box-shadow:inset 0 0 0 2px #030b14}.member.selected{border:2px solid #e1c27f;box-shadow:0 0 10px #e7bd5466,inset 0 0 9px #c49e3220}.portrait{width:4.9cqw;height:7.3cqw;flex-shrink:0;background:#050e17;border-color:#9f804b}.stats strong{font-size:1.1cqw;margin-bottom:.85cqw}.stat-line{font-size:.86cqw;margin:.4cqw 0 .25cqw;letter-spacing:-.025em}.bar{height:.7cqw}.role-badge{font-size:.8cqw;top:-.8cqw;padding:.12cqw .9cqw;border-radius:5px}.commands{border:0;box-shadow:none;background:transparent;padding:0 .15cqw;position:relative;display:flex;flex-direction:column;min-width:0}.commands h2{font-size:1.05cqw;margin:-.75cqw 0 .35cqw}.command-grid{flex:1;gap:.45cqw;min-height:0}.command-grid button{padding:.3cqw .45cqw .3cqw 1.55cqw;gap:.65cqw;min-height:0;font-size:1.1cqw;border-color:#a39071;box-shadow:inset 0 0 0 2px #050c15}.command-grid button .ability-icon{width:3.5cqw;height:3.5cqw;flex:0 0 3.5cqw;image-rendering:pixelated}.command-grid button span{font-size:1.05cqw;white-space:nowrap}.command-grid button small{font-size:.98cqw;margin-top:.3cqw}.command-grid kbd{font-size:.8cqw;left:.3cqw;top:.3cqw;border:1px solid #b49352;border-radius:4px;padding:0 .16cqw}.command-grid button:disabled{opacity:1}.command-grid button:disabled:not(.chosen){color:#eee7da}.command-grid button.chosen{border-color:#f3d58b;box-shadow:0 0 8px #ffd67550,inset 0 0 0 2px #705b2a;background:linear-gradient(120deg,#3e351c,#15130d)}.command-grid button:hover:not(:disabled){border-color:#f3d58b}.commands p{position:absolute;bottom:-.86cqw;left:0;right:0;font-size:.75cqw;margin:0;color:#d1c4ad;white-space:nowrap}
/* Finishing blow: only the battlefield zooms; the HUD remains readable. */
.combat-world{position:absolute;inset:0;transform-origin:64.6% 50%;will-change:transform}.boss #boss-hp{font-weight:400}.scene.cinematic:after{box-shadow:inset 0 0 100px #01060b99,inset 0 15px 0 #01060be6,inset 0 -15px 0 #01060be6}.scene.cinematic .intent{opacity:0}.clear-overlay{position:absolute;inset:0;z-index:10;display:grid;place-items:center;background:#02081066;backdrop-filter:brightness(.75);animation:clear-reveal .5s ease both}.clear-overlay[hidden]{display:none}.clear-panel{text-align:center;min-width:50cqw;padding:2.4cqw 3cqw;background:linear-gradient(115deg,#091a29f5,#030b13fa);border:1px solid #d3b77a;box-shadow:0 0 0 4px #07131c,0 0 0 5px #8b7143,0 20px 80px #000c,inset 0 0 70px #b99a3610;position:relative}.clear-panel:before,.clear-panel:after{content:'◆';position:absolute;top:-.6cqw;font-size:1cqw;color:#e4c987;background:#0a1722;padding:0 .4cqw}.clear-panel:before{left:1cqw}.clear-panel:after{right:1cqw}.clear-location{font-size:1.1cqw;letter-spacing:.13em;color:#aeb9c4;margin:0 0 1.3cqw}.clear-ornament{font-size:.8cqw;color:#a88d55;letter-spacing:.3em}.clear-panel h2{font:3.8cqw Georgia,serif;font-weight:500;color:#f9e4ac;letter-spacing:.03em;margin:1.2cqw 0;text-shadow:0 2px 20px #cfa53b44}.clear-description{font-size:1.25cqw;color:#dfd9ca;margin:.4cqw 0 1.3cqw}.clear-buttons{display:flex;justify-content:center;gap:1cqw;margin-top:1.9cqw}.clear-buttons button{font-size:1cqw;padding:.7cqw 1.4cqw;background:#111c28;border:1px solid #79818c;border-radius:3px}.clear-buttons button:first-child{border-color:#dab877;color:#f4dfa7;background:linear-gradient(#51442a,#242014)}.clear-buttons button:hover{filter:brightness(1.25)}#test-clear{border-color:#b19862;color:#ecd6a3;margin-left:auto}.preview-controls #demo{margin-left:0}.preview-controls{gap:9px;flex-wrap:wrap}.preview-controls button:disabled{opacity:.5;cursor:default}@keyframes clear-reveal{from{opacity:0;transform:scale(1.025)}to{opacity:1;transform:scale(1)}}@media(prefers-reduced-motion:reduce){.clear-overlay{animation:none}}
/* Three rewards, followed by an explicit one-of-four replacement. */
.loot-overlay{position:absolute;inset:0;z-index:11;display:grid;place-items:center;background:#020810b8;backdrop-filter:brightness(.7)}.loot-overlay[hidden]{display:none}.loot-panel{width:78cqw;padding:1.8cqw 2cqw 1.5cqw;background:linear-gradient(125deg,#102332f7,#040c16fc);border:1px solid #d3b77a;box-shadow:0 0 0 4px #07131c,0 0 0 5px #8b7143,0 20px 80px #000c;text-align:center}.loot-kicker{font-size:.85cqw;letter-spacing:.2em;color:#cfb87c;margin:0 0 .5cqw}.loot-panel h2{font-size:2.2cqw;margin:0;color:#f4e4bb;font-weight:500}.loot-subtitle{font-size:1cqw;color:#b8c6d1;margin:.6cqw 0 1.3cqw;min-height:1.2em}.loot-options{display:grid;grid-template-columns:repeat(3,1fr);gap:1.1cqw}.loot-card{border:1px solid #7f7964;background:linear-gradient(155deg,#142a3c,#070f1b);padding:1.3cqw 1cqw 1.1cqw;display:flex;flex-direction:column;align-items:center;text-align:center;min-height:16cqw;box-shadow:inset 0 0 0 3px #050c1580;position:relative;border-radius:3px}.loot-card:hover,.loot-card:focus-visible{border-color:#e9c875;background:linear-gradient(155deg,#2d3b3b,#111b26);box-shadow:0 0 16px #d7ae3d22}.loot-type{font-size:.8cqw;letter-spacing:.08em;color:#9ed5e5;padding:.25cqw .65cqw;border:1px solid #567d8a;border-radius:3px}.loot-type.scroll{color:#d7bdff;border-color:#8969ad}.loot-type.heal{color:#8ce7c3;border-color:#4d9d84}.loot-card .ability-icon{width:5cqw;height:5cqw;margin:.9cqw 0;image-rendering:pixelated}.loot-card strong{font-size:1.35cqw;color:#f1e5cb;font-weight:500}.loot-card .loot-cost{font-size:1cqw;color:#7dd9ed;margin:.5cqw 0}.loot-card .loot-description{font-size:.9cqw;line-height:1.6;color:#abbcc9;margin:.25cqw 0 .7cqw}.loot-choose{font-size:.9cqw;color:#edce88;margin-top:auto}.loot-footer{display:flex;gap:1cqw;align-items:center;justify-content:center;margin-top:1.5cqw}.loot-footer button{font-size:1cqw;padding:.65cqw 1.6cqw;border:1px solid #6c7b88;background:#101c28;border-radius:3px;color:#c5cdd3}.loot-footer button:hover{border-color:#e1c184;color:#f2dfb0}#loot-skip{background:transparent;color:#aebbc7}.replacement-options{display:grid;grid-template-columns:repeat(4,1fr);gap:.8cqw}.replacement-options .loot-card{padding:1cqw .65cqw;min-height:13cqw}.replacement-options .loot-card strong{font-size:1.15cqw}.replacement-options .ability-icon{width:3.8cqw;height:3.8cqw;margin:.6cqw 0}.replace-incoming{display:flex;align-items:center;justify-content:center;gap:.8cqw;color:#f5dfa6;font-size:1.3cqw;border:1px solid #a58c52;background:#26302980;padding:.5cqw;margin-bottom:1cqw}.replace-incoming .ability-icon{width:2.5cqw;height:2.5cqw}.completed-slots{display:flex;justify-content:center;gap:.6cqw;flex-wrap:wrap}.completed-slots span{font-size:1.1cqw;border:1px solid #8b7c5b;padding:1cqw;color:#e7d6b2}.clear-buttons button[hidden],.loot-footer button[hidden]{display:none}.preview-controls{font-size:11px;gap:7px}.preview-controls button{font-size:11px;padding:7px 9px}.preview-controls #test-clear{margin-left:auto}#round-select{min-width:42px}#boss-max{color:#b8bec7}.scene[data-round="1"] .boss .enemy-name span,.scene[data-round="2"] .boss .enemy-name span{color:#a7d9dd;border-color:#587f87}.scene[data-round="1"] .boss-bar i,.scene[data-round="2"] .boss-bar i{background:linear-gradient(#ffb16e,#ca6549)}
.mechanic-loadout{width:min(1500px,94vw);margin:12px auto;padding:12px;box-sizing:border-box;background:#101b25;border:1px solid #86754a;color:#eee1be;font-size:14px}.mechanic-loadout #loadout-slots{display:flex;gap:12px;flex-wrap:wrap;margin:10px 0}.mechanic-loadout select,.mechanic-loadout button{background:#172632;color:#eee1be;border:1px solid #86754a;padding:8px}.mechanic-loadout label{display:flex;align-items:center;gap:6px}.mechanic-loadout p{margin:8px 0;color:#81ded0}

.resurrection-controls{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:8px;color:#f5dca4;font-size:12px}.resurrection-controls button,.resurrection-controls select{padding:6px 9px;background:#17202c;color:#ffe8b0;border:1px solid #7a633c;border-radius:5px}.resurrection-controls button:disabled{opacity:.45}.resurrection-controls [role=status]{font-size:11px}

/* Dwarf skill loadout and turn controls. */
.dwarf-controls {margin-top:10px;font-size:12px;color:#e9d5a8;}
.dwarf-loadout {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;}
.dwarf-controls label {display:flex;align-items:center;gap:5px;min-width:0;}
.dwarf-controls select {min-width:0;max-width:100%;background:#17202a;color:#ffe5a6;border:1px solid #665634;border-radius:4px;padding:4px;}
.dwarf-loadout select {flex:1;width:100%;}
.dwarf-targets {display:flex;flex-wrap:wrap;gap:8px;margin-top:8px;align-items:center;}
.dwarf-controls details {margin-top:6px;}.dwarf-controls summary {cursor:pointer;}
.dwarf-controls details button {background:#252b36;border:1px solid #786844;color:#ffe8b1;padding:5px;margin:4px;border-radius:4px;}
.dwarf-controls button:disabled {opacity:.4;}.dwarf-controls details p {font-size:11px;color:#a9afb8;}
/* Skill selection lives below the fixed-ratio combat canvas, leaving four actions readable. */
.dwarf-controls{width:min(1600px,100%,calc((100dvh - 110px)*1.7777778));margin-top:12px;padding:12px 16px;background:#0b1723;border:1px solid #79613c;border-radius:5px;font-size:13px}.dwarf-controls .dwarf-loadout{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.dwarf-controls .dwarf-loadout label{display:flex;align-items:center;gap:8px}.dwarf-controls select{max-width:100%;min-width:0;padding:6px}.dwarf-controls .dwarf-targets{margin:12px 0}.dwarf-controls details{padding:6px 0}.dwarf-controls details button{margin:6px}.dwarf-controls p{position:static;white-space:normal}.dwarf-controls .resurrection-controls{border-top:1px solid #41515f;padding-top:10px}@media(max-width:700px){.dwarf-controls .dwarf-loadout{grid-template-columns:1fr 1fr}}

.archer-controls{padding:16px;border:1px solid #527352;background:#15251f;color:#dce9cf;margin:12px 0;border-radius:8px}.archer-skill-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:8px;margin:10px 0}.archer-skill-grid button{display:flex;align-items:center;justify-content:center;gap:6px;min-height:62px;background:#243b2a;color:#e7f3d7;border:1px solid #70965c;cursor:pointer}.archer-skill-grid img{width:46px;height:46px;object-fit:contain;image-rendering:pixelated}.archer-controls button:disabled{opacity:.4;cursor:default}.archer-turn{margin-left:16px}.archer-controls details{margin-top:10px}.archer-controls select{padding:6px}@media(max-width:700px){.archer-skill-grid{grid-template-columns:repeat(2,1fr)}}
.boss-response{margin:12px 0;padding:12px;border:1px solid #e4b355;background:#382319;border-radius:6px;display:flex;flex-wrap:wrap;gap:10px;align-items:center}.boss-response[hidden]{display:none}.boss-response strong,.boss-response p{width:100%;margin:0}.boss-response button{background:#594128;border:1px solid #e0b567;border-radius:4px;padding:8px 12px}.boss-response button:disabled{opacity:.45}

/* Companion wizard actions share the same battle rather than opening a separate demo. */
.wizard-controls{background:linear-gradient(120deg,#20172d,#101522);border-color:#796090}
.wizard-controls .archer-skill-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
.wizard-controls .archer-skill-grid button{min-height:42px;background:#221b30;border-color:#655577;color:#f1e6ff}
.wizard-controls .archer-skill-grid button:disabled{opacity:.4}
