/* Adventure UI: copper fittings, parchment type and dark enamel surfaces. */
:root{
 color-scheme:dark;--ink:#0b191c;--frame:#213136;--bronze:#a37a52;--bright:#f3d3a2;
 --paper:#f8ead3;--soft:#c7d3c7;--aqua:#a4d4cd;--line:#627777;
 font-family:"Yu Gothic UI","Meiryo",system-ui,sans-serif;
}
*{box-sizing:border-box}[hidden]{display:none!important}
body{margin:0;min-height:100vh;color:var(--paper);background:radial-gradient(ellipse at 50% 0,#38433b 0,#15262a 45%,#0b1519 100%);font-size:14px}
header,main{width:min(1180px,calc(100% - 32px));margin:auto}
header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 2px 10px}
.brand{display:flex;align-items:center;gap:12px}
.brand-mark{display:grid;place-items:center;width:35px;height:35px;border:1px solid var(--bronze);color:var(--bright);background:#303638;transform:rotate(45deg);border-radius:4px}
.brand-mark span{transform:rotate(-45deg);font-size:19px}
header small,.panel-kicker{letter-spacing:.22em;color:var(--bright);font-size:9px;font-weight:700}
h1,h2,h3,p{margin:0 0 .65em}
h1{font:700 clamp(17px,3vw,24px)/1.2 "Yu Mincho",Georgia,serif;letter-spacing:.12em;margin:3px 0}
h2{font:700 clamp(21px,4vw,32px)/1.25 "Yu Mincho",Georgia,serif;letter-spacing:.035em}
p{line-height:1.6}
nav,.actions,.row{display:flex;gap:7px;align-items:center;flex-wrap:wrap}
button,input,select{font:inherit;color:var(--paper);border:1px solid #5b7775;border-radius:4px;background:#263d3d;padding:8px 12px}
button{cursor:pointer;min-height:39px;font-weight:600}
button:hover:not(:disabled){background:#3a5753;border-color:#a5c8ae}
button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--bright);outline-offset:2px}
button:disabled{opacity:.44;cursor:default}
button.primary{background:linear-gradient(#edce9d,#cfa875);border-color:#f5d9ae;color:#242b28}
button.primary:hover:not(:disabled){background:#f7d8a9}
nav button{min-height:34px;font-size:12px}
#stage{position:relative;overflow:hidden;border:1px solid var(--bronze);border-radius:7px;background:#132629;box-shadow:0 0 0 4px #152123,0 16px 42px #050e14bb}
canvas{display:block;width:100%;height:auto;image-rendering:pixelated}
#map{touch-action:none}
footer{font-size:12px;color:#c8d6ca;padding:12px 3px;line-height:1.5}
footer:before{content:"◇";color:var(--bright);margin-right:9px}
#screen:empty{display:none}
#screen.overlay{position:absolute;inset:0;display:grid;place-items:center;background:#0a181acd;padding:10px;overflow:auto}
.panel{width:min(620px,100%);max-height:100%;margin:auto;padding:clamp(12px,2.5vw,24px);overflow:auto;scrollbar-color:#7f8d7f #1c3335;background:linear-gradient(150deg,#2d4241,#1b2d31 72%);border:1px solid #a18766;border-radius:6px;box-shadow:0 14px 35px #040b10a8}
.panel.wide{width:min(1000px,100%)}
.panel > h2{border-bottom:1px solid #a78c667c;padding-bottom:8px;margin-bottom:11px}
.panel-kicker{margin-bottom:4px}
.panel p{color:#e4e4d4}
#panel-actions{margin-top:12px}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(115px,1fr));gap:8px}
.grid label{display:grid;gap:4px}
.card{padding:10px 12px;border:1px solid #576e6a;background:#172d308e;border-radius:4px;margin:6px 0}
.card button{margin:5px 4px 0 0}
.portrait{width:78px;height:78px;object-fit:contain;image-rendering:pixelated}
.stage-title #screen{min-height:clamp(370px,52vw,650px);display:grid;align-items:center;isolation:isolate;position:relative;background:#102225}
.stage-title #screen:before,.stage-title #screen:after{content:"";position:absolute;inset:0;pointer-events:none}
.stage-title #screen:before{z-index:-2;background:url('assets/rebuild/arena-shore.webp') 100% 48%/auto 100% no-repeat}
.stage-title #screen:after{z-index:-1;background:linear-gradient(90deg,#0b191ceb 8%,#0b191cdb 34%,#0b191c27 76%),linear-gradient(0deg,#0b191c95,transparent 38%)}
.stage-title .panel{width:min(450px,83%);margin-left:clamp(18px,6.4vw,82px);border:0;box-shadow:none;background:none;padding:0}
.stage-title h2{font-size:clamp(39px,7vw,73px);text-shadow:0 3px 24px #04191d;border:0;margin:8px 0 12px}
.stage-title .title-copy{font-size:14px;padding-left:12px;border-left:2px solid #d9af80}
.stage-title #panel-actions{display:grid;max-width:270px}
.stage-title button{text-align:left}
.stage-title button:disabled{display:none}
.stage-creation #screen{padding:22px 10px;background:linear-gradient(120deg,#253d37,#0d2227)}
.stage-creation .panel{width:min(790px,100%);max-height:none}
.creation-layout{display:grid;grid-template-columns:1fr 2fr;gap:13px;align-items:center}
.character-plinth{text-align:center;background:radial-gradient(ellipse at 50% 63%,#667d645f,#1b3137 72%);border:1px solid #617671;padding:9px;border-radius:5px}
.character-plinth canvas{width:112px;height:112px;margin:auto}
.character-plinth .actions{justify-content:center}
.character-plinth button{min-height:31px;padding:4px 7px;font-size:11px}
.creation-layout label{min-width:0;font-size:12px;color:#c7d9cc}
.creation-layout input,.creation-layout select{width:100%;min-width:0}
.creation-layout input[type=color]{padding:4px;min-height:33px}
.creation-note{margin:12px 0 0;font-size:12px}
#hud,#tracking{position:absolute;top:9px;background:#0b2124ec;border:1px solid #ad8962;border-radius:5px;box-shadow:0 5px 14px #07131395;padding:7px 9px;pointer-events:none}
#hud{left:9px;width:min(216px,53%)}
#tracking{right:9px;max-width:38%;font-size:11px}
#tracking small{display:block;color:var(--bright);font-size:9px}
#tracking .meter{display:block;width:100%;margin:5px 0 0}
.hud-place{display:flex;justify-content:space-between;align-items:center;gap:4px;font-size:11px;color:#f0e9d4;padding-bottom:4px}
.hud-place time{color:var(--bright);white-space:nowrap;font-variant-numeric:tabular-nums}
.hud-member{border-top:1px solid #57736f;padding:4px 0 2px}
.hud-member strong{display:block;font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hud-meters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
.hud-stat{display:flex;justify-content:space-between;flex-wrap:wrap;font-size:9px;gap:0;color:#e0e4d7;font-variant-numeric:tabular-nums}
.meter{display:inline-block;width:55px;height:5px;background:#536260;border-radius:2px;overflow:hidden;vertical-align:middle;margin:0 4px}
.meter i{display:block;height:100%;background:var(--bar,#d9bb89);box-shadow:inset 0 1px #ffffff3d}
.hud-stat .meter{width:100%;margin:2px 0 0;height:4px}
#field-action{display:none}
.tour-progress{color:var(--bright)!important;font-weight:700;font-size:12px}
.quest-notices,.puzzle-grid{display:grid;gap:6px}
.quest-notice{border-left:3px solid #bf9968;background:#333e36}
.quest-notice strong{color:#f5d6a3}
.menu-profile{display:grid;grid-template-columns:58px 1fr auto;align-items:center;gap:10px;border:1px solid #7c8267;padding:8px;background:#1a2f30;border-radius:5px}
.menu-profile canvas{width:54px;height:54px}
.menu-profile strong{font-size:18px;color:var(--bright)}
#menu-tabs{display:grid;grid-template-columns:repeat(auto-fit,minmax(82px,1fr));gap:6px;margin:12px 0}
.world-map{padding:7px;border:1px solid #576e69;border-radius:4px;background:#152b32}
.map-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;margin:3px}
.map-region{text-align:center;padding:5px;border:1px dashed #6c8478;color:#cad6c9;font-size:11px}
.map-region.visited{border-style:solid;background:#35524e}
.map-region.here{border-color:#e3bc7e;color:#f5d49e}
.ending{text-align:center;padding:12px}
.ending span{font-size:72px;color:#ffdb8c;text-shadow:0 0 18px #ecc778}
.stage-battle #screen.overlay{background:#08161aee}
.stage-battle .panel{width:min(980px,100%);padding:clamp(7px,1.8vw,19px);border-color:#9f8767}
.stage-battle .panel h2{font-size:clamp(16px,3vw,25px);padding-bottom:5px;margin-bottom:7px}
.arena{--arena:url('assets/rebuild/arena-woods.webp');position:relative;isolation:isolate;overflow:hidden;display:flex;align-items:flex-end;justify-content:space-between;gap:7px;min-height:clamp(142px,25vw,302px);padding:8px clamp(7px,2vw,24px);background:linear-gradient(0deg,#091719e5,#17323732 64%),var(--arena) center 58%/cover;border:1px solid #aa8c69;border-radius:4px}
.arena.biome-ruin{--arena:url('assets/rebuild/arena-dungeon.webp')}
.arena.biome-river,.arena.biome-lake,.arena.biome-marsh,.arena.biome-island{--arena:url('assets/rebuild/arena-shore.webp')}
.arena.biome-core,.arena.biome-abyss{--arena:url('assets/rebuild/arena-machine.webp')}
.arena.biome-rock,.arena.biome-snow{--arena:url('assets/rebuild/arena-dungeon.webp')}
.arena-night{box-shadow:inset 0 0 130px 40px #111a43a3}
.team{display:flex;align-items:flex-end;gap:clamp(2px,1vw,13px);min-width:0}
.foes{justify-content:flex-end}
.unit{position:relative;min-width:0;text-align:center;padding:3px;border:1px solid transparent;border-radius:4px;font-size:clamp(9px,1.3vw,13px);color:#fff4d8;text-shadow:0 2px 2px #051215;line-height:1.25}
.unit img,.unit canvas{display:block;margin:0 auto 3px;width:clamp(39px,8vw,105px);height:clamp(39px,8vw,105px);object-fit:contain;image-rendering:pixelated;filter:drop-shadow(2px 4px 2px #0a181ab0)}
.unit .meter{width:clamp(16px,4vw,57px)}
.unit.aimable{border-color:#ecc991;background:#234343ba;cursor:pointer}
.battle-resources{font-size:9px}
.battle-resources .meter{width:24px}
.boss-bar{display:flex;align-items:center;gap:8px;color:#f5d4ab;font-size:12px;margin-bottom:5px}
.boss-bar .meter{flex:1;height:7px}
.battle-message,.msg{font-size:13px;color:#f1d8a9!important}
.battle-message{padding:6px 8px;margin:5px 0;border-left:2px solid #cda376;background:#14282b}
.battle-command{font-weight:700;color:#cce3d9!important;margin:3px 0}
#commands,#choices{display:flex;flex-wrap:wrap;gap:5px}
#commands button,#choices button{min-height:34px;padding:4px 8px}
.charge-mark{color:#ffe2a4}
.arena button.condition{font-size:9px;min-height:20px;padding:1px 4px;border-color:#ba9cbc;background:#50475f}
.status-poison img,.status-poison canvas{filter:drop-shadow(0 0 5px #ce8ee4)}
.status-slow img,.status-slow canvas{filter:drop-shadow(0 2px 5px #88b5e4)}
.status-blind img,.status-blind canvas{filter:drop-shadow(0 -3px 5px #d1c6ce)}
.strike-fx{position:absolute;z-index:6;left:50%;top:50%;pointer-events:none;font:900 24px system-ui;color:#fff1cd;text-shadow:1px 2px 1px #3b201d;transform:translate(-50%,-50%);animation:strike-rise .34s ease-out .04s both}
.strike-fx:before{content:"";position:absolute;left:50%;top:54%;width:68px;height:5px;border-radius:50%;z-index:-1;background:#fff1c6;box-shadow:0 0 14px #eab071;transform:translate(-50%,-50%) rotate(-28deg);animation:strike-cut .32s ease-out both}
.strike-heavy:before{height:14px;width:91px;box-shadow:0 0 24px #ff9f62}
.strike-magic:before,.strike-heal:before,.strike-guard:before,.strike-charge:before,.strike-poison:before{width:44px;height:44px;border-radius:20%;border:2px solid #a4e9ee;background:#5594b488;transform:translate(-50%,-50%) rotate(45deg)}
.strike-heal:before{background:#679b6c99;border-color:#b2e5a2}
.strike-guard:before,.strike-charge:before{background:#ae956255;border-color:#e5c390}
.strike-poison:before{background:#9462ac99;border-color:#d7aae5}
.strike-miss:before{display:none}
.strike-shot:before{height:2px;transform:translate(-50%,-50%)}
.ally-lunge{animation:ally-step .31s ease both}.enemy-lunge{animation:enemy-step .31s ease both}
.unit-impact{animation:hit-recoil .28s ease .07s both}.unit-heal{animation:heal-glow .32s ease both}
.arena-shake{animation:impact-shake .26s ease}
@keyframes ally-step{38%{transform:translateX(16px)}}@keyframes enemy-step{38%{transform:translateX(-16px)}}
@keyframes hit-recoil{30%{transform:translate(5px,-4px);filter:brightness(1.9)}60%{transform:translate(-2px,1px)}}
@keyframes heal-glow{45%{filter:brightness(1.5) drop-shadow(0 0 7px #a9dba1)}}
@keyframes impact-shake{20%,60%{transform:translateX(-4px)}40%,80%{transform:translateX(4px)}}
@keyframes strike-rise{0%{opacity:0}25%,75%{opacity:1}100%{opacity:0;transform:translate(-50%,-105%)}}
@keyframes strike-cut{0%{scale:.3;opacity:.3}40%{scale:1;opacity:1}100%{scale:1.2;opacity:0}}
@media(max-width:620px){
 header,main{width:calc(100% - 14px)}header{padding:8px 1px}.brand{gap:7px}.brand-mark{width:25px;height:25px}.brand-mark span{font-size:14px}
 header small{font-size:7px}nav{gap:4px}nav button{font-size:11px;padding:4px 6px}
 #hud,#tracking{top:5px;padding:4px 5px}#hud{left:5px;width:min(150px,54%)}#tracking{right:5px}
 .hud-stat,.hud-place{font-size:8px}.hud-member strong{font-size:9px}
 .stage-map #field-action{display:block;position:absolute;bottom:8px;left:50%;transform:translateX(-50%);min-height:44px;max-width:94%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-color:#bfa078;background:#163439f2}
 .stage-title #screen:before{background-size:cover;background-position:60% 50%}.stage-title #screen:after{background:linear-gradient(90deg,#071a1cec,#0d2527a0 65%,#07181c63)}
 .creation-layout{grid-template-columns:1fr}.character-plinth canvas{width:70px;height:70px}.stage-creation #screen{padding:9px}
 #screen.overlay{padding:4px}.panel{padding:10px}
 .arena{padding:4px;min-height:125px}.unit{padding:1px}.battle-resources{font-size:8px}.battle-resources .meter{width:12px}
 .battle-message{font-size:11px}.strike-fx{font-size:19px}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important}}

#tracking.guide-tracking{pointer-events:auto}
.guide-tracking button{margin-top:4px;padding:3px 6px;font-size:10px;min-height:26px}
@media(max-width:620px){.guide-tracking button{min-height:33px}}

.unit.major-foe img{width:clamp(72px,13vw,174px);height:clamp(72px,13vw,174px)}

.arena.biome-snow{--arena:url('assets/rebuild/arena-snow.webp')}
.arena.biome-rock{--arena:url('assets/rebuild/arena-canyon.webp')}
.arena.biome-marsh,.arena.biome-lake{--arena:url('assets/rebuild/arena-marsh.webp')}
.arena.biome-abyss{--arena:url('assets/rebuild/arena-abyss.webp')}
.foes .unit{padding-bottom:22px}
#commands button{min-width:68px;min-height:39px}
#commands button[data-glyph]:before{content:attr(data-glyph);color:#f0c892;margin-right:5px}
@media(max-width:620px){.foes .unit{padding-bottom:18px}#commands button{min-width:47px;min-height:38px}}
