:root{color-scheme:light;--ink:#273556;--muted:#758096;--blue:#365bb7;--navy:#233e79;--gold:#e8b95b;--paper:#fffaf0;--line:#e7dfce;font-family:ui-rounded,'Apple SD Gothic Neo','Malgun Gothic',system-ui,sans-serif;background:#e9edf4;color:var(--ink)}*{box-sizing:border-box}body{margin:0}button,a,input,select{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer;color:inherit}button:disabled{cursor:default;opacity:.45}button:focus-visible,a:focus-visible,select:focus-visible{outline:3px solid #e39b29;outline-offset:3px}a{color:inherit;text-decoration:none}button{border:0}h1,h2,h3,p{margin:0}button,input,select{min-height:44px}.app{max-width:1440px;height:100dvh;min-height:640px;margin:auto;background:var(--paper);display:grid;grid-template-rows:52px 78px minmax(0,1fr) 70px;box-shadow:0 0 100px #293d661c}.masthead{display:flex;align-items:center;gap:15px;padding:0 30px;background:#243d75;color:#fff}.brand{display:flex;align-items:center;gap:8px;font-size:14px;font-weight:800}.preview-label{margin-left:auto;font-size:11px;color:#dbe5ff;padding:5px 9px;border:1px solid #ffffff40;border-radius:30px}.icon-button{background:none;color:inherit;width:44px;font-size:23px}.expedition-bar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:10px 30px;border-bottom:1px solid var(--line)}.expedition-bar small{font-size:9px;letter-spacing:3px;color:#9a865d;font-weight:800}h1{font-size:25px;letter-spacing:-1px}h1 span{font-size:18px;color:var(--gold);margin-left:8px}.wallet{display:flex;gap:18px;font-size:14px;font-weight:800}.wallet span{display:flex;align-items:center;gap:6px}.wallet small{color:#7f8797;font-size:11px;font-weight:500;letter-spacing:0}.coin{color:#dba53d}.star{color:#8c78d1}#game{min-height:0;overflow:auto;position:relative}.adventure{height:100%;min-height:0;display:grid;grid-template-columns:245px minmax(0,1fr)}.journey{padding:24px 18px;border-right:1px solid var(--line);overflow:auto;background:#faf5e9}.eyebrow{font-size:10px;letter-spacing:2px;color:#9c8357;font-weight:800}.journey h2{font-size:23px;margin:7px 0}.journey>p{color:var(--muted);font-size:12px;line-height:1.7}.route-list{display:grid;gap:9px;margin-top:20px}.route{display:flex;gap:10px;align-items:center;text-align:left;padding:10px;border:1px solid #e6ddc9;border-radius:12px;background:#fffaf0;min-height:62px}.route.active{background:#304f96;border-color:#304f96;color:white;box-shadow:0 5px 13px #304f9625}.route .number{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;background:#ede5d5;font-size:12px;font-weight:900;flex-shrink:0;color:#7c725e}.route.active .number{background:#e9c06e;color:#283e6b}.route b{display:block;font-size:12px}.route small{font-size:10px;opacity:.65;display:block;margin-top:3px}.journey .footnote{font-size:10px;margin-top:20px;color:#8d8a84;line-height:1.6}.play-area{display:flex;flex-direction:column;min-width:0;min-height:0}.scene{position:relative;flex:1;min-height:220px;isolation:isolate;background:#98c49f url('/dice/assets/garden.webp') center 45%/cover;overflow:hidden}.scene:after{content:'';position:absolute;inset:0;background:linear-gradient(#173c7810,transparent 60%,#1d393b40);pointer-events:none;z-index:-1}.scene-head{position:absolute;top:16px;left:20px;right:20px;display:flex;justify-content:space-between;align-items:start;gap:10px}.scene-label{padding:10px 15px;border-radius:10px;background:#233c71eb;color:white;box-shadow:0 4px 15px #182b5433;font-size:12px}.scene-label small{display:block;color:#d8c48e;font-size:9px;margin-bottom:4px;letter-spacing:1px}.scene-label strong{font-size:14px}.turn-label{padding:8px 12px;background:#fffaf0e8;border:1px solid #e1d2b6;border-radius:30px;font-size:11px;white-space:nowrap}.scene .unit{position:absolute;width:20%;height:62%;bottom:5%;padding:0;background:none;border:0;overflow:visible;display:flex;align-items:end;justify-content:center;flex-direction:column}.unit img{width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 9px 4px #153b3238);pointer-events:none}.unit[data-party-slot="0"]{left:21%;z-index:3}.unit[data-party-slot="1"]{left:3%;bottom:14%;z-index:1}.unit[data-party-slot="2"]{left:12%;bottom:0%;z-index:4;width:17%;height:50%}.unit.enemy{width:27%;right:15%;bottom:8%;height:64%}.unit.enemy.secondary{right:0;bottom:0;width:20%;height:46%}.unit:hover img,.unit.selected img{filter:drop-shadow(0 0 6px #ffeb97)}.unit.dead{filter:grayscale(.9);opacity:.35}.unit .unit-name{font-size:10px;white-space:nowrap;background:#fdf8e5ed;padding:3px 7px;border-radius:15px;margin:auto;position:absolute;bottom:0;left:50%;transform:translateX(-50%)}.intent{position:absolute;bottom:88%;left:50%;transform:translateX(-50%);white-space:nowrap;max-width:220px;padding:7px 10px;background:#fffaf0f5;border:1px solid #d7b784;border-radius:10px;font-size:10px;box-shadow:0 3px 10px #29485a22}.intent:after{content:'';position:absolute;top:100%;left:50%;border:5px solid transparent;border-top-color:#fffaf0}.hp-strip{position:absolute;bottom:8%;left:18%;right:18%;height:5px;border-radius:10px;background:#503b3840;overflow:hidden}.hp-strip i{display:block;height:100%;background:#88c65c;border-radius:10px}.enemy .hp-strip i{background:#e99b69}.camp-intro{position:absolute;top:26%;left:8%;text-shadow:0 2px 15px #fff;color:#244979}.camp-intro small{letter-spacing:2px;font-size:10px;font-weight:800}.camp-intro h2{font-size:clamp(24px,3.3vw,44px);margin:6px 0;letter-spacing:-1px;line-height:1.25}.camp-intro p{font-size:12px;line-height:1.8}.camp .unit{left:auto;right:5%;bottom:3%;width:27%;height:66%}.camp .unit[data-party-slot="1"]{right:28%;bottom:12%;width:23%}.camp .unit[data-party-slot="2"]{right:24%;bottom:1%;width:19%;height:50%}.launch-bar{background:var(--paper);border-top:2px solid #dcc592;padding:18px 24px;display:flex;align-items:center;gap:20px;justify-content:space-between}.launch-bar h3{font-size:16px;margin-bottom:6px}.launch-bar p{font-size:12px;color:var(--muted);line-height:1.6}.primary{background:linear-gradient(#4770c6,#3456a4);color:white;padding:13px 24px;border-radius:12px;box-shadow:inset 0 1px #ffffff35,0 4px 0 #263d73;font-weight:800;min-width:140px}.primary.gold{background:linear-gradient(#f7d685,#e6b755);color:#534224;box-shadow:inset 0 1px #fff8,0 4px 0 #bd9342}.secondary-button{padding:10px 15px;border:1px solid #dcd3c0;background:#fffcf5;border-radius:10px;font-size:12px}.dock{display:flex;justify-content:center;gap:25px;background:#fffaf0;border-top:1px solid var(--line);padding:7px 20px calc(7px + env(safe-area-inset-bottom))}.dock button{display:flex;align-items:center;justify-content:center;gap:8px;min-width:120px;background:none;border-radius:12px;font-size:12px;font-weight:800;color:#8a8d96}.dock button span{font-size:23px}.dock button[aria-current=page]{background:#e8edf9;color:#335cae}.combat-controls{padding:12px 18px;background:var(--paper);border-top:2px solid #d6bc83}.command-guide{display:flex;justify-content:space-between;align-items:center;font-size:11px;gap:8px;margin-bottom:9px}.command-guide b{color:#3f5e9b}.auto-controls{display:flex;align-items:center;gap:5px}.auto-controls button,.auto-controls select{background:#efe9da;border-radius:7px;padding:3px 8px;font-size:11px;min-height:32px}.dice-row{display:flex;align-items:center;justify-content:center;gap:12px;margin:6px 0 12px}.die{position:relative;width:50px;height:50px;min-height:50px;border-radius:12px;background:#fffdfa;border:2px solid #d9c79c;box-shadow:0 4px 0 #d7c7a6;font-size:35px;line-height:1;color:#355ba0;transition:transform .15s}.die.chosen{outline:3px solid #6293e1;transform:translateY(-4px)}.die.assigned{background:#e9e4d9;color:#a29c8d;box-shadow:none;opacity:.7}.dice-row .secondary-button{font-size:10px;min-height:40px;max-width:76px;padding:5px}.party-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.party-card{padding:10px;background:#fffdf8;border:1px solid #e1d7bf;border-radius:12px;position:relative}.card-top{display:flex;align-items:center;gap:6px;margin-bottom:8px}.card-portrait{height:36px;width:36px;border-radius:50%;background:#e7edf5;object-fit:contain}.card-title{font-size:12px;font-weight:900}.card-title small{font-size:9px;font-weight:500;color:var(--muted)}.card-hp{margin-left:auto;text-align:right;font-size:10px;color:#5c9860}.card-hp small{display:block;font-size:9px}.skill-buttons{display:grid;grid-template-columns:1fr 1fr;gap:5px}.skill{background:#eef1f8;border:1px solid #d8dfed;border-radius:7px;font-size:10px;min-height:43px;padding:5px;line-height:1.5}.skill small{display:block;font-size:9px;color:#8d96aa}.skill.filled{background:#dce9ff;border-color:#6c91d6;color:#31549a}.skill.pending{outline:2px solid #e5ae52}.turn-actions{display:flex;align-items:center;gap:12px;margin-top:10px}.action-list{flex:1;display:flex;flex-wrap:wrap;gap:4px;min-width:0}.action-chip{background:#e9edf5;border-radius:20px;padding:5px 8px;min-height:28px;font-size:10px}.action-list .hint{font-size:11px;color:#8a8f9a}.turn-actions .primary{min-width:145px;padding:10px 15px;font-size:12px}.turn-actions .undo{background:none;font-size:11px;color:#8b8e99;min-height:35px}.progress-nodes{display:flex;gap:6px;margin-top:7px}.progress-nodes i{width:16px;height:4px;border-radius:5px;background:#ffffff40}.progress-nodes i.done{background:#ebc46e}.event-card{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:min(560px,90%);padding:25px 30px;background:#fffaf0f7;border:1px solid #dac79b;border-radius:20px;box-shadow:0 10px 50px #23355735}.event-card h2{font-size:23px;margin:8px 0 14px}.event-card p{font-size:14px;line-height:1.85}.event-card .choices{display:grid;gap:9px;margin-top:20px}.event-card button{text-align:left;display:block;background:#eef1f8;border:1px solid #d3dcec;border-radius:10px;padding:12px 15px;font-size:13px}.event-card button small{display:block;color:#7c87a1;font-size:11px;margin-top:4px}.event-card button:hover{border-color:#496db8;background:#e2eaf8}.result-banner{position:absolute;inset:0;background:#172e6350;display:grid;place-items:center}.result-box{background:#fffaf0;border:3px solid #e4bf72;border-radius:22px;padding:26px;text-align:center;box-shadow:0 15px 60px #172e6360}.result-box h2{font-size:30px;margin:8px 0}.result-box p{font-size:13px;color:var(--muted);margin:12px 0 18px}.panel{padding:26px 30px;max-width:1100px;margin:auto}.panel-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:18px}.panel h2{font-size:24px}.panel p{font-size:13px;line-height:1.8;color:var(--muted)}.companion-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:13px;margin-top:20px}.companion-card{background:#fffdf8;border:1px solid #e5dcc8;border-radius:15px;padding:12px;text-align:center}.companion-card.in-party{border:2px solid #557bc2}.companion-card.locked{background:#eeeae1;opacity:.7}.companion-card img{width:100%;height:105px;object-fit:contain}.companion-card .portrait-placeholder{height:105px;display:grid;place-items:center;font-size:38px;color:#aaa08e}.companion-card h3{font-size:14px;margin:5px 0}.companion-card small{font-size:10px;color:var(--muted);display:block}.companion-card button{width:100%;margin-top:10px;background:#e9edf5;border-radius:8px;font-size:10px;padding:5px}.recruit-hero{background:linear-gradient(120deg,#dbe6ff,#f3e6fa);padding:28px;border-radius:18px;border:1px solid #d7d8ef;display:flex;gap:25px;align-items:center}.recruit-hero img{width:145px;height:170px;object-fit:contain}.recruit-hero .buttons{display:flex;gap:10px;margin-top:15px}.list-row{padding:15px;border:1px solid #e2dacb;border-radius:12px;display:flex;gap:15px;align-items:center;justify-content:space-between;margin:12px 0;background:#fffdf8}.list-row h3{font-size:14px}.list-row p{font-size:12px}.notice{padding:12px 15px;background:#e9edf6;border:1px solid #d5def0;border-radius:10px;margin-top:15px;font-size:12px;color:#577099;line-height:1.7}#toast{position:fixed;left:50%;bottom:90px;transform:translateX(-50%) translateY(10px);background:#263c70;color:white;padding:12px 20px;border-radius:12px;font-size:13px;max-width:90vw;box-shadow:0 8px 25px #22365840;z-index:50;pointer-events:none;opacity:0;transition:.2s}#toast.visible{opacity:1;transform:translateX(-50%)}dialog{width:min(540px,94vw);border:1px solid #d6c59e;border-radius:20px;padding:30px;background:var(--paper);color:var(--ink)}dialog::backdrop{background:#16285090;backdrop-filter:blur(3px)}dialog h2{font-size:23px;margin-bottom:15px}dialog p{font-size:13px;line-height:1.8;margin:10px 0}dialog .close-dialog{position:absolute;right:10px;top:8px;background:none;font-size:27px;width:40px}dialog .setting-row{display:flex;justify-content:space-between;align-items:center;margin:15px 0;font-size:13px}dialog select{border:1px solid var(--line);border-radius:8px;background:white;padding:8px}.battle-log{font-size:10px;color:#778296;max-height:32px;overflow:auto;margin-top:7px;line-height:1.6}.hit-flash{animation:hit .4s}.acting{animation:attack .4s}.unit img{animation:breathe 3s ease-in-out infinite}.unit.dead img{animation:none}.reduced *{animation:none!important;transition:none!important}@keyframes breathe{50%{transform:translateY(-3px)}}@keyframes attack{50%{translate:12px -5px}}@keyframes hit{40%{filter:brightness(2);translate:-5px 0}}
@media(min-width:1200px){.scene .unit{max-height:330px}.camp .unit{max-height:380px}}
@media(max-height:820px) and (min-width:761px){.app{grid-template-rows:44px 62px minmax(0,1fr) 58px}.combat-controls{padding:8px 14px}.party-card{padding:7px}.card-top{margin-bottom:5px}.dice-row{margin:3px 0 8px}.die{width:44px;height:44px;min-height:44px;font-size:31px}.skill{min-height:40px}.turn-actions{margin-top:7px}.scene{min-height:170px}.journey{padding:18px 14px}.route-list{gap:7px;margin-top:13px}.route{min-height:53px;padding:8px}}
@media(max-width:760px){.app{min-height:600px;grid-template-rows:40px 62px minmax(0,1fr) 58px}.masthead{padding:0 14px;gap:6px}.brand{font-size:11px;gap:5px}.brand img{width:25px;height:25px}.preview-label{font-size:9px}.expedition-bar{padding:7px 15px;gap:8px}h1{font-size:20px}.expedition-bar small{font-size:7px;letter-spacing:2px}.wallet{font-size:11px;gap:10px}.wallet small{display:none}.adventure{grid-template-columns:1fr}.journey{display:none}.scene{min-height:155px}.scene-head{top:10px;left:10px;right:10px}.scene-label{padding:7px 10px;font-size:10px}.scene-label strong{font-size:11px}.scene-label small{font-size:8px;margin-bottom:3px}.turn-label{font-size:9px;padding:7px 9px}.scene .unit{height:60%;bottom:4%;width:24%}.unit[data-party-slot="0"]{left:20%;bottom:0}.unit[data-party-slot="1"]{left:0;bottom:9%}.unit[data-party-slot="2"]{left:8%;height:48%;width:20%;bottom:-2%}.unit.enemy{width:37%;right:9%;height:55%;bottom:3%}.unit.enemy.secondary{width:25%;right:-3%;height:42%;bottom:0}.intent{font-size:8px;max-width:150px;padding:5px 7px;bottom:86%}.unit .unit-name{font-size:8px;padding:2px 5px}.camp .unit{right:4%;bottom:0;width:41%;height:55%;left:auto}.camp .unit[data-party-slot="1"]{right:36%;bottom:4%;width:34%;height:60%;left:auto}.camp .unit[data-party-slot="2"]{right:31%;width:27%;height:38%;bottom:-1%;left:auto}.camp-intro{top:22%;left:8%}.camp-intro h2{font-size:27px}.camp-intro p{font-size:11px;max-width:200px}.camp-intro small{font-size:8px}.launch-bar{padding:14px 16px;gap:10px;flex-wrap:wrap}.launch-bar h3{font-size:13px}.launch-bar p{font-size:10px;max-width:180px}.launch-bar .primary{min-width:120px;padding:12px 15px;font-size:12px}.dock{gap:0;padding:5px 8px}.dock button{min-width:0;flex:1;font-size:9px;flex-direction:column;gap:0}.dock button span{font-size:20px}.combat-controls{padding:9px 8px}.command-guide{font-size:9px;margin-bottom:5px}.auto-controls{gap:3px}.auto-controls button,.auto-controls select{font-size:9px;min-height:32px;padding:4px}.dice-row{margin:5px 0 9px;gap:12px}.die{width:44px;height:44px;min-height:44px;font-size:32px}.dice-row .secondary-button{font-size:9px;max-width:62px}.party-cards{gap:5px}.party-card{padding:6px 5px;border-radius:9px}.card-top{gap:2px;margin-bottom:5px;flex-wrap:wrap}.card-portrait{width:26px;height:26px}.card-title{font-size:10px}.card-title small{font-size:8px;display:block}.card-hp{font-size:8px}.card-hp small{font-size:8px}.skill-buttons{grid-template-columns:1fr;gap:4px}.skill{font-size:10px;min-height:44px;padding:3px;display:flex;align-items:center;justify-content:center;gap:3px;flex-wrap:wrap}.skill small{font-size:8px}.turn-actions{gap:5px;margin-top:8px}.turn-actions .primary{min-width:115px;padding:10px;font-size:11px}.action-chip{font-size:8px;padding:4px 6px;min-height:25px}.action-list .hint{font-size:9px}.turn-actions .undo{font-size:9px;padding:0 3px}.battle-log{max-height:16px;font-size:9px;margin-top:5px}.event-card{padding:20px;width:90%}.event-card h2{font-size:19px;margin:5px 0 10px}.event-card p{font-size:12px;line-height:1.7}.event-card .choices{margin-top:13px;gap:7px}.event-card button{font-size:11px;padding:10px}.event-card button small{font-size:10px}.panel{padding:20px 15px}.panel h2{font-size:21px}.panel-heading{margin-bottom:12px}.companion-grid{grid-template-columns:repeat(3,1fr);gap:8px}.companion-card{padding:8px}.companion-card img,.companion-card .portrait-placeholder{height:82px}.companion-card h3{font-size:12px}.recruit-hero{padding:18px;gap:5px}.recruit-hero img{width:80px;height:130px}.recruit-hero .buttons{flex-wrap:wrap}.recruit-hero .primary{font-size:11px;padding:10px;min-width:105px}.result-box{padding:18px}.result-box h2{font-size:24px}.notice{font-size:11px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}
/* Readable controls retain 44px hit areas on small screens. */
.mobile-route{display:none}.camp-intro{background:linear-gradient(90deg,#fff7deb8,#fff7de00);padding:12px;border-radius:12px}.event-card p{font-size:14px}.scene .unit[data-party-slot="2"]{bottom:2%}.command-guide{font-size:12px}.skill{font-size:12px}.card-title{font-size:13px}.turn-actions .primary{font-size:13px}.intent{font-size:11px}.card-hp{font-size:11px}.battle-log{font-size:11px}
@media(max-width:760px){.mobile-route{display:block;font-size:11px;color:#7e8798}.mobile-route select{display:block;max-width:205px;min-height:44px;border:0;background:transparent;color:var(--ink);font:inherit;font-size:13px;font-weight:800;margin-left:-4px}.camp-title{display:none}.command-guide{font-size:11px}.card-title{font-size:12px}.skill{font-size:12px;min-height:44px}.skill small{font-size:9px}.card-hp{font-size:9px}.intent{font-size:10px}.unit .unit-name{font-size:9px}.turn-actions .primary{font-size:12px}.event-card p{font-size:14px}.event-card button{font-size:13px}.event-card button small{font-size:11px}.camp-intro{top:20%;padding:10px;background:#fff8e9c9;backdrop-filter:blur(3px)}.camp-intro p{font-size:12px}.camp .unit[data-party-slot="2"]{bottom:1%}}
.floating-number{position:absolute;top:30%;left:45%;font-size:28px;font-weight:900;color:white;text-shadow:0 2px 3px #243553,1px 0 #243553;pointer-events:none;animation:float-number .7s both}.floating-number.heal{color:#b8ffc3}.floating-number.guard{color:#bbdfff}.heal-flash{animation:heal-flash .5s}@keyframes float-number{to{transform:translateY(-45px);opacity:0}}@keyframes heal-flash{50%{filter:drop-shadow(0 0 10px #95fbb5)}}

/* The game is a single viewport. Menus scroll inside their own foreground panel. */
html,body{height:100%;overflow:hidden}.app{position:relative;isolation:isolate;height:100dvh;min-height:0;max-width:1600px;grid-template-rows:44px 62px minmax(0,1fr) 64px;overflow:hidden;background:#f7f1e4}.masthead{z-index:80}.expedition-bar{z-index:70;background:#fffaf0}.dock{position:relative;z-index:90;gap:12px}.dock button{min-width:90px}.dock button:focus-visible{outline-offset:-4px}#game{overflow:hidden;isolation:isolate}.adventure{display:block;height:100%}.play-area{height:100%;position:relative}.scene{min-height:0;flex:1;isolation:isolate;background-position:center 45%}.scene-head{z-index:60;top:14px;left:16px;right:16px;pointer-events:none}.scene-label{max-width:55%;background:#173568ed;border:1px solid #ffffff40;box-shadow:0 5px 16px #152a4c40}.scene-tools{display:flex;align-items:flex-end;gap:7px;flex-direction:column;pointer-events:auto}.auto-controls{gap:5px}.auto-controls button{min-height:40px;padding:8px 12px;background:#fff9ebf5;border:1px solid #d8bd85;color:#243b64;font-weight:800;font-size:12px;box-shadow:0 3px 0 #aa8a5666}.auto-controls button[aria-pressed=true]{background:#2f5eae;color:white;border-color:#a9c5ff}.turn-label{background:#fffaf0f5;color:#314768}.scene .unit{z-index:5!important;bottom:12%!important;height:63%;max-height:400px}.scene .unit[data-party-slot="2"]{height:47%;bottom:10%!important}.scene .unit[data-party-slot="1"]{bottom:23%!important}.scene .unit.enemy{bottom:16%!important;right:12%;height:63%}.scene .unit.enemy.secondary{right:0;bottom:10%!important;height:46%}.unit img{will-change:transform}.unit.dead{opacity:.28}.battle-hud{position:absolute;inset:0;z-index:45;pointer-events:none}.enemy-hud{position:absolute;right:18px;top:100px;display:flex;gap:8px;max-width:47%;width:430px;align-items:flex-start}.ally-hud{position:absolute;bottom:12px;left:16px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;width:calc(55% - 16px);max-width:600px}.unit-status{min-width:0;flex:1;background:#193663ee;border:1px solid #bed5f67a;border-radius:10px;padding:7px 9px;box-shadow:0 3px 0 #122e53aa,0 5px 15px #14335725;color:#fff}.status-title{display:flex;justify-content:space-between;align-items:center;gap:4px;margin-bottom:5px;font-size:11px}.status-title b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.status-title span{font-size:10px;color:#8ee5ff;white-space:nowrap}.health-track{height:17px;border-radius:5px;position:relative;background:#0f233b;overflow:hidden;border:1px solid #ffffff30}.health-track i{display:block;height:100%;background:linear-gradient(#8de3a5,#34aa78);transition:width .22s ease-out;box-shadow:inset 0 2px #ffffff55}.health-track strong{position:absolute;inset:0;text-align:center;font-size:11px;line-height:15px;text-shadow:0 1px 2px #102b36,0 0 3px #102b36;font-variant-numeric:tabular-nums}.enemy-status{background:#522c3be8;border-color:#f8beaa99}.enemy-status .health-track i{background:linear-gradient(#ffaa7a,#e86e70)}.unit-status.low .health-track i{background:linear-gradient(#ffc768,#e85653)}.unit-status.low{border-color:#ffb17c}.status-tags{display:flex;flex-wrap:wrap;gap:3px;font-size:9px;margin-top:4px;min-height:3px}.status-tags span{background:#ffffff19;border-radius:4px;padding:1px 3px}.status-tags .intent-tag{background:transparent;padding:0;color:#ffe1bd;font-weight:700;line-height:1.4}.fx-layer{position:absolute;inset:0;pointer-events:none;z-index:55;overflow:hidden}.combat-number{position:absolute;display:block;transform:translateX(-50%);font-size:36px;line-height:1;font-weight:1000;font-variant-numeric:tabular-nums;color:#ffe6ac;text-shadow:2px 2px 0 #4b1e29,-2px -2px 0 #4b1e29,2px -2px 0 #4b1e29,-2px 2px 0 #4b1e29,0 4px 8px #21172baa;animation:combat-number var(--fx-time,.8s) both}.combat-number small{display:block;margin-top:8px;text-align:center;font-size:14px;color:#a9e9ff;white-space:nowrap}.number-heal{color:#aaffc1;text-shadow:1px 2px 0 #14563a,-1px -1px 0 #14563a,0 3px 8px #102f2c}.number-guard{color:#a8e7ff;font-size:26px;text-shadow:1px 2px 0 #18497b,-1px -1px 0 #18497b,0 3px 8px #10274b}.battle-fx{position:absolute;display:block;transform:translate(-50%,-50%);width:90px;height:90px;animation:fx-pop var(--fx-time,.8s) both}.fx-hit i{position:absolute;inset:30% -15%;background:linear-gradient(90deg,transparent,#fff8bf 30%,#fff 50%,#ffc16e 70%,transparent);border-radius:50%;transform:rotate(-38deg);box-shadow:0 0 14px #ffb64c}.fx-hit i:nth-child(2){transform:rotate(35deg);inset:42% -10%}.fx-hit i:nth-child(3){inset:5%;border:3px solid #fff3ab;background:none;box-shadow:0 0 22px #ffcb6280}.fx-heal{border-radius:50%;background:radial-gradient(#baffccaa,transparent 65%);border:2px solid #acffba99;box-shadow:0 0 30px #95ffc777}.fx-heal i{position:absolute;left:15%;top:25%;font-style:normal;font-size:28px;color:#d6ffe2;text-shadow:0 0 8px #52e993}.fx-heal i:nth-child(2){left:40%;top:0;font-size:40px}.fx-heal i:nth-child(3){left:70%;top:40%}.fx-guard{width:95px;height:120px;background:linear-gradient(135deg,#defaff88,#4596ff22);border:3px solid #b9f0ff;border-radius:48% 48% 48% 48% / 23% 23% 75% 75%;box-shadow:inset 0 0 20px #83bfff,0 0 20px #93e0ff}.fx-guard i{display:grid;place-items:center;height:100%;font-style:normal;color:#e1faff;font-size:65px}.spell-orb{position:absolute;width:24px;height:24px;border-radius:50%;background:#fff4d8;box-shadow:0 0 10px #ffc969,0 0 24px #ae77ff,0 0 45px #9286ff}.combat-controls{position:relative;z-index:65;flex-shrink:0;padding:10px 16px;background:#fffaf0f7;box-shadow:0 -5px 25px #25395720}.command-guide{min-height:34px;margin:0;gap:10px}.command-guide b{font-size:12px;line-height:1.4}.command-guide .secondary-button{flex-shrink:0;font-size:11px;min-height:36px;padding:6px 12px}.combat-controls.autoplay .manual-controls{display:none}.combat-controls.autoplay .battle-log{font-size:11px;line-height:1.6;min-height:18px;max-height:36px;overflow:hidden}.manual-controls .party-cards{gap:8px}.manual-controls .skill-buttons{grid-template-columns:1fr 1fr}.manual-controls .card-top{margin-bottom:5px}.manual-controls .card-title small{margin-left:5px}.manual-controls .die{height:42px;min-height:42px;width:42px;font-size:30px}.manual-controls .dice-row{margin:8px 0}.manual-controls .skill{min-height:40px;font-size:11px}.manual-controls .party-card{padding:7px}.manual-controls .turn-actions{margin-top:7px}.battle-log{margin-top:5px}.event-card{z-index:65;width:min(620px,90%);max-height:calc(100% - 110px);overflow:auto;top:calc(50% + 35px);padding:24px;border-width:2px;background:#fffaf0f7}.event-card .eyebrow{font-size:9px}.event-card p{font-size:15px;line-height:1.8}.event-card .choices{margin-top:16px}.event-card button{font-size:13px;min-height:48px}.result-banner{z-index:68}.launch-bar{position:relative;z-index:65;flex-shrink:0;padding:12px 20px;background:#fffaf0f7}.launch-bar p{max-width:none}.launch-bar h3{font-size:14px}.camp-intro{z-index:30;top:24%;left:8%;max-width:45%}.game-overlay{position:absolute;inset:10px 14px;z-index:100;background:#fffaf0f5;border:2px solid #dcc693;border-radius:18px;box-shadow:0 12px 45px #12254688;display:flex;flex-direction:column;backdrop-filter:blur(16px);overflow:hidden}.overlay-head{display:flex;align-items:center;justify-content:space-between;padding:10px 20px;background:#243e77;color:white;flex-shrink:0;font-size:17px}.overlay-head button{background:#ffffff19;color:white;min-width:44px;font-size:28px;border-radius:9px}.overlay-body{min-height:0;overflow:auto;overscroll-behavior:contain;padding-bottom:10px}.overlay-body .panel{padding:20px;max-width:1000px}.overlay-body .journey{display:block;width:min(750px,100%);margin:auto;border:0;background:none}.overlay-body .route-list{grid-template-columns:repeat(3,1fr)}.overlay-body .route{min-width:0}.overlay-body .journey>h2,.overlay-body .journey>.eyebrow,.overlay-body .journey>p:not(.footnote){display:none}.companion-grid{grid-template-columns:repeat(5,minmax(0,1fr))}.companion-card{min-width:0}.companion-card button{min-height:40px}.panel .buttons{display:flex;flex-wrap:wrap;gap:8px}.panel-heading{margin-bottom:10px}dialog{z-index:200;max-height:calc(100dvh - 130px);overflow:auto;overscroll-behavior:contain;padding:26px;box-shadow:0 20px 80px #14234088}#toast{z-index:300;bottom:80px;font-size:12px;max-width:min(90vw,640px)}
@keyframes combat-number{0%{opacity:0;translate:0 5px;scale:.6}18%{opacity:1;scale:1.2}40%{scale:1}75%{opacity:1}100%{opacity:0;translate:0 -65px}}@keyframes fx-pop{0%{opacity:0;scale:.3}18%{opacity:1;scale:1.15}55%{opacity:.8;scale:1}100%{opacity:0;scale:1.5}}
@media(max-width:760px){.app{min-height:0;grid-template-rows:38px 54px minmax(0,1fr) 58px}.expedition-bar{padding:5px 12px}.expedition-bar h1{font-size:19px}.dock{gap:0}.dock button{min-width:0}.scene-head{top:9px;left:9px;right:9px}.scene-label{max-width:55%;padding:7px 9px}.scene-tools{gap:4px}.scene-tools .turn-label{padding:3px 7px;font-size:9px}.auto-controls button{min-height:36px;padding:5px 8px;font-size:10px}.scene .unit{height:60%;width:28%;bottom:19%!important}.scene .unit[data-party-slot="1"]{bottom:30%!important}.scene .unit[data-party-slot="2"]{height:42%;bottom:16%!important}.scene .unit.enemy{height:55%;right:7%;bottom:23%!important}.scene .unit.enemy.secondary{height:42%;right:-3%;bottom:18%!important}.enemy-hud{top:93px;right:9px;width:calc(57% - 9px);max-width:none;gap:5px}.ally-hud{bottom:10px;left:9px;width:calc(100% - 18px);max-width:none;gap:5px}.unit-status{padding:5px 6px;border-radius:8px}.status-title{font-size:10px;margin-bottom:4px;gap:2px}.status-title span{font-size:9px}.health-track{height:16px}.health-track strong{font-size:10px;line-height:14px}.status-tags{font-size:8px;gap:2px}.enemy-status .status-title{font-size:9px}.combat-controls{padding:8px 9px}.command-guide b{font-size:10px}.command-guide .secondary-button{font-size:10px;min-height:36px;padding:5px 8px}.combat-controls.autoplay .battle-log{font-size:10px;max-height:32px}.manual-controls .party-cards{gap:4px}.manual-controls .card-portrait{width:23px;height:23px}.manual-controls .card-title{font-size:10px}.manual-controls .card-title small{font-size:8px;margin:0;display:block}.manual-controls .skill-buttons{grid-template-columns:1fr}.manual-controls .skill{min-height:35px;padding:3px;font-size:10px}.manual-controls .skill small{font-size:8px}.manual-controls .party-card{padding:5px 4px}.manual-controls .card-top{flex-wrap:nowrap;gap:2px}.manual-controls .turn-actions .primary{min-width:115px;padding:8px;font-size:11px}.manual-controls .action-chip{font-size:8px;padding:3px 4px}.manual-controls .dice-row{margin:4px 0 6px;gap:10px}.manual-controls .die{width:38px;height:38px;min-height:38px;font-size:28px}.manual-controls .turn-actions{margin-top:5px}.manual-controls .dice-row .secondary-button{font-size:9px;min-height:36px;padding:4px}.battle-log{font-size:9px;max-height:16px}.event-card{padding:18px;max-height:calc(100% - 98px);top:calc(50% + 32px);border-radius:14px}.event-card h2{font-size:19px}.event-card p{font-size:13px;line-height:1.8}.event-card .choices{margin-top:12px;gap:7px}.event-card button{font-size:12px;padding:9px}.event-card button small{font-size:10px}.launch-bar{padding:10px 12px;flex-wrap:nowrap}.launch-bar .primary{min-width:112px;font-size:11px;padding:11px}.launch-bar p{font-size:10px}.launch-bar .secondary-button{font-size:10px;flex-shrink:0;padding:8px}.mobile-route select{max-width:185px;font-size:12px}.camp-intro{top:24%;max-width:80%}.camp-intro h2{font-size:28px}.camp .unit{bottom:3%!important}.camp .unit[data-party-slot="1"]{bottom:12%!important}.camp .unit[data-party-slot="2"]{bottom:0!important}.game-overlay{inset:7px;border-radius:14px}.overlay-head{padding:7px 13px;font-size:15px}.overlay-body .panel{padding:15px}.overlay-body .route-list{grid-template-columns:1fr 1fr;gap:8px}.overlay-body .route b{font-size:11px}.companion-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.companion-card{padding:7px}.companion-card img,.companion-card .portrait-placeholder{height:80px}.companion-card button{font-size:10px;margin-top:7px}.recruit-hero{padding:16px 10px;gap:10px}.recruit-hero img{width:70px;height:120px}.recruit-hero p{font-size:11px}.list-row{padding:11px;gap:8px}.list-row .primary{min-width:95px;padding:10px;font-size:11px}.combat-number{font-size:30px}.number-guard{font-size:23px}.fx-hit{width:70px;height:70px}.fx-guard{width:65px;height:85px}dialog{padding:24px 20px;max-height:calc(100dvh - 100px)}}
@media(max-height:660px){.app{grid-template-rows:34px 44px minmax(0,1fr) 50px}.expedition-bar small{display:none}.expedition-bar h1{font-size:17px}.masthead{padding:0 12px}.scene-head{top:6px}.scene-label{padding:5px 8px}.scene-label small{font-size:7px}.scene-label strong{font-size:10px}.progress-nodes{margin-top:4px}.enemy-hud{top:76px}.scene-tools{flex-direction:row;align-items:center}.scene-tools .turn-label{display:none}.unit-status{padding:4px 5px}.status-title{font-size:9px}.health-track{height:14px}.health-track strong{font-size:9px;line-height:12px}.status-tags{font-size:7px;margin-top:2px}.manual-controls .card-top{display:none}.manual-controls .skill{min-height:30px;font-size:9px}.manual-controls .skill small{display:none}.manual-controls .dice-row{margin:3px 0}.manual-controls .die{min-height:32px;height:32px;width:32px;font-size:25px}.command-guide{min-height:30px}.command-guide .secondary-button{min-height:30px}.combat-controls{padding:5px 8px}.battle-log{display:none}.manual-controls .action-list{display:none}.manual-controls .turn-actions{justify-content:flex-end;margin-top:4px}.manual-controls .turn-actions .primary{min-height:34px;padding:6px}.event-card{padding:12px;max-height:calc(100% - 80px);top:calc(50% + 28px)}.event-card p{font-size:12px}.event-card h2{font-size:17px}.event-card .choices{margin-top:8px}.launch-bar{padding:7px 12px}.launch-bar p{display:none}.scene .unit{bottom:18%!important}.scene .unit[data-party-slot="1"]{bottom:27%!important}.scene .unit[data-party-slot="2"]{bottom:16%!important}.ally-hud{bottom:5px}}
.scene .unit:disabled{opacity:1}.scene .unit.dead:disabled{opacity:.28}.scene .unit:focus-visible{outline:2px solid #fff3bd;outline-offset:-10px;border-radius:40%}
.scene-head{z-index:75}

/* Compact HUD: leave the battlefield visible; only the meter has a backing. */
.battle-hud .ally-hud{width:min(360px,calc(100% - 32px));gap:14px}
.battle-hud .enemy-hud{width:min(280px,47%);gap:14px}
.battle-hud .unit-status{
 position:relative;padding:0;border:0;border-radius:0;background:none;box-shadow:none;
 color:#fff;text-shadow:0 1px 2px #14283f,1px 0 2px #14283f,-1px 0 2px #14283f;
}
.battle-hud .status-title{height:14px;margin-bottom:3px;padding-right:48px;gap:0;font-size:11px}
.battle-hud .status-title b{font-weight:700}
.battle-hud .status-title span{position:absolute;right:0;top:28px;font-size:9px;line-height:12px;color:#b5edff}
.battle-hud .health-track{
 height:8px;overflow:visible;border:1px solid #ffffff8c;border-radius:4px;
 background:#17283cd9;box-shadow:0 1px 3px #12263b70;
}
.battle-hud .health-track i{border-radius:3px;box-shadow:inset 0 1px #ffffff65}
.battle-hud .health-track strong{
 top:-18px;bottom:auto;left:auto;right:-1px;font-size:10px;line-height:14px;
 font-weight:700;text-align:right;text-shadow:0 1px 2px #14283f,1px 0 2px #14283f,-1px 0 2px #14283f;
}
.battle-hud .status-tags{margin-top:3px;min-height:0;font-size:9px;line-height:12px;gap:3px}
.battle-hud .status-tags:empty{display:none}
.battle-hud .status-tags span{padding:0;background:none;border-radius:0}
.battle-hud .status-tags .intent-tag{font-weight:500;font-size:9px;color:#ffedce;line-height:12px}
.battle-hud .unit-status:has([data-shield-text]:not(:empty)) .status-tags{padding-right:39px}
.battle-hud .unit-status:has([data-shield-text]:not(:empty)){min-height:40px}
@media(max-width:760px){
 .battle-hud .ally-hud{left:50%;transform:translateX(-50%);width:min(330px,calc(100% - 22px));gap:12px;bottom:13px}
 .battle-hud .enemy-hud{width:min(240px,57%);gap:10px}
 .battle-hud .status-title{font-size:10px;padding-right:42px}
 .battle-hud .health-track strong{font-size:9px}
 .battle-hud .status-tags,.battle-hud .status-tags .intent-tag{font-size:8px;line-height:11px}
}
.scene{background-image:var(--region-bg,url('/dice/assets/garden.webp'))}.scene.region-volcano:after,.scene.region-lava:after{background:linear-gradient(0deg,#3e201333,transparent 40%)}.chapter-ending{display:block;max-width:620px;font-size:11px;line-height:1.5;margin-top:4px}
/* Keep the close control visible while long detail panels scroll. */
dialog{padding:0;overflow:hidden}dialog[open]{display:flex;flex-direction:column}#dialog-body{min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:40px 26px 26px}dialog .close-dialog{z-index:2;top:4px;right:6px;background:var(--paper);border-radius:50%;min-width:44px;box-shadow:0 2px 6px #493e2110}@media(max-width:600px){#dialog-body{padding:40px 18px 22px}}
