@charset "UTF-8";

:root{
  --ink:#082f36;
  --glass:rgba(5,48,58,.92);
  --glass-soft:rgba(10,65,70,.84);
  --glass-deep:rgba(3,30,39,.96);
  --cream:#fff2cf;
  --muted:#c0d4bf;
  --gold:#e1c27a;
  --gold-light:#fff0b5;
  --gold-dark:#8c6834;
  --line:rgba(226,196,124,.58);
  --green:#237147;
  --danger:#f1aa8d;
  --display:Georgia,"Times New Roman",serif;
  --body:"Trebuchet MS","Segoe UI",Arial,sans-serif;
  color-scheme:dark;
  font-family:var(--body);
  color:var(--cream);
  background:#062f38;
  font-synthesis:none;
}

*{box-sizing:border-box}
html,body{margin:0;width:100%;min-height:100%;overscroll-behavior:none}
body{overflow:hidden;-webkit-tap-highlight-color:transparent}
button,input,select{font:inherit}
button,a,input,select{touch-action:manipulation}
button{cursor:pointer;color:inherit}
button:disabled{cursor:not-allowed}
button,a,input,select{outline:none}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #fff2aa;outline-offset:5px;box-shadow:0 0 0 7px #062f38b3}
h1,h2,h3,p{margin:0}
button svg,button img{pointer-events:none}
img{max-width:100%}
[hidden]{display:none!important}

#game{position:relative;width:100%;height:100vh;height:100dvh;min-height:320px;isolation:isolate;overflow:hidden;background:radial-gradient(ellipse at 50% 38%,#235b57,#092f3b 80%)}
#scene{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none}
#ui,#overlay{position:absolute;inset:0;pointer-events:none}
#ui{z-index:2}
#overlay{z-index:10}
noscript{position:fixed;z-index:20;inset:35% 12%;display:grid;place-items:center;padding:25px;background:var(--glass);border:1px solid var(--gold);border-radius:20px;text-align:center;font-size:18px}

.screen{position:absolute;inset:0;display:grid;place-items:center;overflow-y:auto;overflow-x:hidden;padding:clamp(20px,4vh,50px) max(22px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(22px,env(safe-area-inset-left));pointer-events:auto;background:linear-gradient(180deg,#021e352b,#02232e66);scrollbar-color:#b6ac79 #0b3c42;scrollbar-width:thin;animation:screen-in .35s ease-out}
.screen--panel{background:linear-gradient(180deg,#0325315c,#01242b94)}
.panel{position:relative;width:min(660px,100%);padding:clamp(24px,3.7vw,46px);border:2px solid var(--line);border-radius:28px;background:linear-gradient(145deg,rgba(15,73,76,.95),var(--glass-deep));box-shadow:inset 0 0 0 3px #0b3a3f, inset 0 0 0 4px #d5ba6a2b,0 15px 60px #001a2b80,0 3px 0 #061e2d9c;backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);text-align:center}
.panel:before{content:"";position:absolute;top:-2px;left:14%;right:14%;height:2px;background:linear-gradient(90deg,transparent,#fff1b5,transparent);pointer-events:none}
.panel--wide{width:min(1100px,100%)}
.panel--compact{width:min(490px,100%)}
.eyebrow{display:block;font:700 11px/1.5 var(--body);letter-spacing:.12em;text-transform:uppercase;color:#decf9d;margin-bottom:9px}
.game-title{font:700 clamp(38px,5vw,64px)/1.05 var(--display);letter-spacing:-.04em;color:var(--cream);text-shadow:0 3px 3px #001d29a3;text-wrap:balance}
.panel h2:not(.game-title),.modal h2{font:700 clamp(29px,3.7vw,42px)/1.1 var(--display);letter-spacing:-.035em;text-shadow:0 2px 2px #022a2e8c}
.panel h3{font:700 24px/1.15 var(--display);letter-spacing:-.025em}
.lede{font-size:15px;line-height:1.6;max-width:570px;margin:15px auto 0;color:#d3dfc8;text-wrap:pretty}
.hint,.muted{color:var(--muted);font-size:12px;line-height:1.55}
.hint{margin-top:10px}
.danger{color:var(--danger)}
.actions{display:flex;justify-content:center;align-items:center;gap:13px;flex-wrap:wrap;margin-top:26px}
.actions--stack{flex-direction:column}
.actions--stack .button{width:min(340px,100%)}

.button{position:relative;display:inline-flex;justify-content:center;align-items:center;gap:10px;min-height:54px;max-width:100%;padding:13px 24px;border:2px solid #c7ae70;border-radius:16px;color:var(--cream);font:700 18px/1.2 var(--display);letter-spacing:-.01em;text-decoration:none;text-shadow:0 2px 2px #032930;box-shadow:inset 0 0 0 2px #042c38, inset 0 3px 0 #fff3b233,0 4px 0 #172d29,0 7px 13px #00202d55;background:linear-gradient(180deg,#206c64,#104f4e 55%,#0c3d43);transition:transform .12s,filter .12s,border-color .12s}
.button:hover:not(:disabled){filter:brightness(1.13);border-color:#f4df9c;transform:translateY(-2px)}
.button:active:not(:disabled){transform:translateY(2px);box-shadow:inset 0 0 0 2px #042c38,inset 0 3px 0 #fff3b221,0 1px 0 #172d29}
.button--primary{border-color:#e2c57b;background:linear-gradient(180deg,#438458,#246749 52%,#164737);color:#fff2cf;box-shadow:inset 0 0 0 2px #123f38,inset 0 3px 0 #fff3b247,0 4px 0 #6e5428,0 9px 23px #001c2d77}
.button--secondary{background:linear-gradient(180deg,#1c6170,#124451);border-color:#b6ae7b}
.button--ghost{font-family:var(--body);font-size:13px;font-weight:700;color:#dae2c9;border:1px solid #b9c69b80;background:#082e38a6;box-shadow:inset 0 0 0 1px #082d36,0 3px 0 #03273180;text-shadow:none}
.button--danger{background:linear-gradient(#86533e,#5e3c35);border-color:#c18e69}
.button--small{min-height:48px;padding:11px 16px;font-size:15px}
.button--square,.icon-button{display:grid;place-items:center;min-width:50px;width:50px;min-height:50px;padding:10px;border:2px solid #c4ae75;border-radius:15px;background:linear-gradient(#23666b,#104a51);box-shadow:inset 0 0 0 2px #05333b,0 4px 0 #082c31;color:var(--cream);font-size:21px}
.button:disabled,.icon-button:disabled{filter:saturate(.2);opacity:.52;transform:none}
.button svg,.icon-button svg{width:24px;height:24px;flex-shrink:0}

.screen--studio{background:radial-gradient(ellipse at 50% 44%,#124b4d,#042735 72%)}
.screen--studio .panel{border:0;background:none;box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none;padding:35px 20px}
.screen--studio .panel:before{display:none}
.studio-mark{display:grid;place-items:center;width:94px;height:106px;clip-path:polygon(50% 0,100% 23%,100% 76%,50% 100%,0 76%,0 23%);margin:0 auto 25px;background:linear-gradient(145deg,#326b62,#173e42);color:#e6d196;font:700 44px var(--display);letter-spacing:-.1em;box-shadow:inset 0 0 0 2px #d4bc7680}
.studio-name{font:700 24px/1.2 var(--body);letter-spacing:.08em;color:var(--cream)}
.studio-presents{font:12px/1.3 var(--body);letter-spacing:.1em;margin:13px 0 20px;color:#c3d4bb}
.screen--studio .game-title{font-size:clamp(38px,5vw,60px)}
.screen--title{background:linear-gradient(180deg,#00283a22,#00283a00 38%,#00283a22);padding-top:22px}
.screen--title .panel{background:none;border:0;box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none;min-height:calc(100dvh - 65px);width:min(900px,100%);display:flex;flex-direction:column;align-items:center;justify-content:space-between;padding:24px 15px 20px}
.screen--title .panel:before{display:none}
.screen--title .game-title{font-size:clamp(62px,8.5vw,116px);max-width:740px;line-height:.88;color:#f6d790;-webkit-text-stroke:1px #9f7c37;text-shadow:0 2px 0 #fff0ac,0 5px 0 #8a6428,0 8px 8px #001a2b,0 0 35px #052c3a;letter-spacing:-.045em;margin-top:3px}
.screen--title .game-title span{display:block}
.screen--title .actions{margin-top:auto;padding-top:36px;flex-direction:column;gap:12px}
.screen--title .button--primary{font-size:clamp(24px,3vw,35px);min-height:72px;padding:15px 40px;border-width:3px;border-radius:25px;box-shadow:inset 0 0 0 3px #103e37,inset 0 5px 0 #fff1b442,0 5px 0 #76572a,0 10px 30px #001d2e80}
.screen--title .lede{display:none}
.screen--story{background:linear-gradient(90deg,#012432a1,#032b381f 75%)}
.screen--story .panel{justify-self:start;align-self:end;text-align:left;width:min(600px,100%);margin:0 3% 3%;background:linear-gradient(135deg,#073f46ed,#032733ed)}
.screen--story .lede{margin-left:0}
.screen--story .actions{justify-content:flex-start}

.choice-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-top:25px;text-align:left}
.choice-card,.character-card{position:relative;min-width:0;display:flex;flex-direction:column;gap:12px;align-items:flex-start;padding:23px;border:2px solid #b6bb8b75;border-radius:22px;background:linear-gradient(145deg,#19575dcf,#0a3845e0);box-shadow:inset 0 0 0 2px #052e3690,0 6px 15px #00232f33;color:var(--cream);text-align:left;text-decoration:none;transition:border-color .15s,transform .15s,background .15s}
button.choice-card,button.character-card{cursor:pointer}
.choice-card:hover:not(:disabled),.character-card:hover:not(:disabled){transform:translateY(-3px);border-color:#e9d38c;background:linear-gradient(145deg,#236b69e0,#0e414cd9)}
.choice-card.selected,.character-card.selected,.choice-card[aria-pressed=true],.character-card[aria-pressed=true]{border-color:#f5d88a;background:linear-gradient(145deg,#26766b,#114e51);box-shadow:inset 0 0 0 2px #073b41,inset 0 0 24px #cfbd6130,0 0 0 3px #d6c27718,0 8px 22px #00222d55}
.choice-card h2,.choice-card h3,.character-card h2,.character-card h3{font:700 29px/1.1 var(--display);letter-spacing:-.02em;margin:0}
.choice-card p,.character-card p{font:14px/1.6 var(--body);color:#d3dfca;margin:0}
.choice-card .badge,.character-card .badge{margin-top:auto}
.choice-card.locked,.character-card.locked,.choice-card:disabled,.character-card:disabled{opacity:.53;filter:saturate(.4);cursor:not-allowed}
.character-card{align-items:center;text-align:center;padding:18px 22px 22px;gap:11px}
.character-card .character-art,.character-card canvas,.character-card img{display:block;width:100%;height:clamp(130px,22dvh,220px);object-fit:contain;border-radius:14px;background:radial-gradient(ellipse,#9ccac62b,transparent 72%)}
.character-art{position:relative;min-height:130px}
.character-card .stat-row{width:100%;justify-content:center;gap:18px;font-size:14px}
.character-card .badge{margin-top:3px}
.badge{display:inline-flex;align-items:center;gap:7px;max-width:100%;border:1px solid #d1be7a7d;border-radius:30px;padding:6px 11px;color:#eadcae;background:#062c38a6;font-size:11px;font-weight:700;line-height:1.3}
.badge--water{background:#0d5264;color:#d3f1ef}
.badge--nature{background:#315b36;color:#e4edbf}
.badge--danger{color:#f7bea5;border-color:#b68162;background:#5e3d36}
.stat-row{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:13px;line-height:1.4;color:#e3e7cb;flex-wrap:wrap}
.stat-row strong{font-weight:800;color:#fff4d8}
.cost{color:#f4d48a;font-weight:700}
.inventory-row{display:flex;align-items:center;justify-content:center;gap:14px;flex-wrap:wrap;margin-top:20px;padding:14px;border-top:1px solid #cdb57733;border-bottom:1px solid #cdb57733;font-size:14px;color:#d8e3c8}
.inventory-row strong{color:#f8df9d}
.world-caption{margin:14px auto 0;color:#c0d8c2;font-size:13px;line-height:1.6}
.screen--world .panel{width:min(920px,100%)}
.screen--world .choice-grid{grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:11px}
.screen--world .choice-card{padding:18px 14px;min-height:135px;text-align:center;align-items:center;justify-content:center}
.screen--world .choice-card h3{font-size:23px}

.meter{position:relative;width:100%;height:12px;border-radius:20px;border:1px solid #dbc17a;background:#052f37;box-shadow:inset 0 2px 4px #001c29a6;overflow:hidden}
.meter>span,.meter>i,.meter .fill{display:block;height:100%;border-radius:inherit;background:linear-gradient(180deg,#b0e858,#58aa2c 45%,#2d7b25);box-shadow:inset 0 2px 0 #e5ffa775;transition:width .3s ease}
.meter--segments{height:8px;border-color:#97beae80;background:#072c38}
.meter--segments>span,.meter--segments>i,.meter--segments .fill{background:linear-gradient(#98e4d5,#3b9f9c);box-shadow:inset 0 1px 0 #c7fff266}
.meter-label{display:flex;align-items:center;justify-content:space-between;font-size:12px;line-height:1.3;color:#fff4d9;margin:6px 0}
.hud{position:absolute;inset:0;pointer-events:none;padding:18px}
.hud-top{position:absolute;top:max(20px,env(safe-area-inset-top));left:max(22px,env(safe-area-inset-left));right:max(22px,env(safe-area-inset-right));display:flex;align-items:flex-start;justify-content:space-between;gap:18px;pointer-events:none}
.hud-bottom{position:absolute;left:max(22px,env(safe-area-inset-left));right:max(22px,env(safe-area-inset-right));bottom:max(20px,env(safe-area-inset-bottom));display:flex;align-items:flex-end;justify-content:space-between;gap:18px;pointer-events:none}
.hud button,.hud input,.hud select,.hud a,.hud .panel,.party-strip,.battle-panel,.inventory-row,.world-caption{pointer-events:auto}
.hud .panel{width:260px;padding:14px 18px;border-radius:22px;text-align:left;box-shadow:inset 0 0 0 2px #08373e,0 5px 22px #01232d5c}
.hud .panel h2,.hud .panel h3{font:700 24px/1.05 var(--display);letter-spacing:-.02em}
.hud .panel .stat-row{font-size:12px;margin:6px 0}
.hud .panel .hint{font-size:11px;margin-top:7px}
.hud .resource{display:flex;align-items:center;gap:7px;color:#f3df9c;font-size:13px;font-weight:700}
.hud .actions{margin:0;gap:10px}
.hud .quest,.quest-panel{pointer-events:none;width:250px;padding:13px 16px;border-radius:15px;background:#073b43db;border:1px solid #d1be786b;box-shadow:0 5px 20px #00232e40;font-size:13px;line-height:1.5;color:#dde6ca}
.quest-panel strong,.hud .quest strong{display:block;color:#f7e7bc;margin-bottom:4px}
.hud .progress{height:5px;margin-top:10px;background:#062e37;border-radius:5px;overflow:hidden}
.hud .progress>span{display:block;height:100%;background:#d4bf70;border-radius:inherit}
.party-strip{display:flex;gap:10px;align-items:center;flex-wrap:wrap;pointer-events:none}
.party-card{pointer-events:auto;min-width:126px;display:flex;align-items:center;gap:10px;background:linear-gradient(#164e53ed,#083540ed);border:2px solid #b4ad719e;box-shadow:inset 0 0 0 2px #073039,0 4px 0 #05232b7a;border-radius:16px;padding:10px 13px;min-height:58px;text-align:left;color:#fff1ce;font-size:13px}
.party-card.active{border-color:#f2d17b;background:linear-gradient(#2e715edb,#174d49f2)}
.party-card.ko{opacity:.55;filter:grayscale(.6)}
.party-card img,.party-card canvas{height:48px;width:48px;object-fit:contain;border-radius:50%}
.party-card strong{display:block;font:700 18px/1.1 var(--display)}
.party-card small{display:block;color:#c5dac4;font-size:11px;margin-top:4px}
.battle-panel{position:absolute;z-index:3;left:50%;bottom:max(17px,env(safe-area-inset-bottom));transform:translateX(-50%);width:min(1240px,calc(100% - 42px));padding:16px 18px 18px;border:2px solid #d5b975;border-radius:24px;background:linear-gradient(180deg,#104850ed,#032b38f5);box-shadow:inset 0 0 0 3px #08313e,0 8px 32px #001e2c80;backdrop-filter:blur(15px);-webkit-backdrop-filter:blur(15px);pointer-events:auto}
.battle-log{font-size:13px;line-height:1.5;color:#f0e5c2;text-align:center;min-height:20px;padding:0 8px;margin-bottom:11px}
.attack-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px}
.attack-card{position:relative;min-width:0;min-height:84px;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:5px;padding:13px 15px;border:2px solid #bba768;border-radius:17px;background:linear-gradient(145deg,#156383,#093f5c);box-shadow:inset 0 0 0 2px #082e43,inset 0 3px 0 #70c7d329,0 4px 0 #102a32;text-align:left;color:var(--cream);transition:background .15s,border-color .15s,transform .15s}
.attack-card:hover:not(:disabled){border-color:#f7dd93;transform:translateY(-2px);background:linear-gradient(145deg,#277c98,#135873)}
.attack-card.selected,.attack-card[aria-pressed=true]{border-color:#ffe9a6;background:linear-gradient(145deg,#277fa0,#15506b);box-shadow:inset 0 0 0 2px #153448,0 0 0 3px #f0d07524,0 4px 0 #102a32}
.attack-card:disabled{opacity:.48;filter:saturate(.3);cursor:not-allowed}
.attack-card strong,.attack-card .attack-name{font:700 23px/1.1 var(--display);letter-spacing:-.025em}
.attack-card small,.attack-card .attack-cost{font-size:12px;line-height:1.4;color:#dfecd9}
.attack-card .cost{color:#ffe29a}
.battle-panel>.actions{margin-top:14px;gap:10px;justify-content:space-between}
.battle-panel .button{min-height:48px;font-size:16px;padding:11px 18px}
.battle-panel .hint{margin-top:9px;font-size:12px;text-align:center}
.battle-panel .warning,.warning{color:#ffc4a0;font-size:12px;line-height:1.5}
.battle-panel .turn{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:#f1d88e}
.battle-panel .stat-row{margin:8px 0}
.battle-panel .action-preview{border-top:1px solid #d0bc7c40;margin-top:14px;padding-top:12px;display:flex;align-items:center;justify-content:space-between;gap:15px;text-align:left}
.battle-panel .action-preview p{font-size:13px;line-height:1.5;color:#d5e0c7}
.battle-panel .action-preview .button{flex-shrink:0;min-width:155px}

.joystick{position:relative;width:126px;height:126px;display:block;border-radius:50%;border:2px solid #e0d39a8c;background:radial-gradient(circle,#c8dfca33,#124f5275 70%);box-shadow:inset 0 2px 12px #00273288,0 3px 0 #0a333a66;touch-action:none;pointer-events:auto;user-select:none;-webkit-user-select:none}
.joystick-knob{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:57px;height:57px;border-radius:50%;border:2px solid #e6d08f99;background:linear-gradient(#3a8384cc,#1d5b69dd);box-shadow:inset 0 2px 0 #b2e0cd4d,0 5px 12px #022d3b66;pointer-events:none}
.joystick:before,.joystick:after{content:"";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);background:#dae6c329;pointer-events:none}
.joystick:before{width:2px;height:100px}.joystick:after{height:2px;width:100px}
.boost-button{pointer-events:auto;min-width:118px;min-height:60px;font:700 23px/1.1 var(--display);border:2px solid #e0c477;border-radius:20px;background:linear-gradient(#397d66,#145347);padding:12px 22px;box-shadow:inset 0 0 0 2px #0a3d3b,0 4px 0 #796132,0 9px 20px #001c2e55;color:var(--cream);text-shadow:0 2px 2px #153b36}
.boost-button small{display:block;margin-top:4px;font:11px var(--body);color:#d6e1c7}
.boost-button:disabled{opacity:.5;filter:saturate(.3);cursor:not-allowed}

.modal-backdrop{position:absolute;inset:0;display:grid;place-items:center;padding:22px;background:#001c2bd1;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);pointer-events:auto;overflow-y:auto}
.modal{width:min(510px,100%);padding:32px;border:2px solid #dbc17b;border-radius:26px;background:linear-gradient(145deg,#175357,#052e3c);box-shadow:inset 0 0 0 3px #07313c,0 22px 100px #001522a6;text-align:center;pointer-events:auto}
.modal h2{color:var(--cream)}
.modal p{font-size:14px;line-height:1.65;margin:16px auto 0;color:#d4dfc6}
.modal .actions{margin-top:24px}
.modal .actions .button{width:100%}
.modal .stat-row{margin-top:16px;justify-content:center}
.modal label{font-size:13px;color:#d9e1c7;line-height:1.5}
.modal input[type=checkbox]{width:22px;height:22px;accent-color:#93b778;vertical-align:middle;margin-right:7px}
.modal .setting-row{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:52px;border-top:1px solid #bdc39533;margin-top:14px;padding-top:13px;text-align:left}
.toast{position:absolute;z-index:30;bottom:max(28px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100% - 34px);padding:13px 20px;border:1px solid #d8c58a;border-radius:14px;background:#073844f5;box-shadow:0 6px 25px #001f2c99;text-align:center;font-size:13px;line-height:1.45;color:#fff0cc;pointer-events:none;animation:toast-in .2s ease-out}
.screen--result .inventory-row{margin-top:25px;margin-bottom:25px;gap:22px}
.screen--result .inventory-row>div{display:flex;flex-direction:column;gap:7px;min-width:110px}
.screen--result .inventory-row strong{font:700 30px var(--display)}
.screen--result .inventory-row small{font-size:12px;color:#c6d9bf}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

@keyframes screen-in{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:none}}
@keyframes toast-in{from{opacity:0;transform:translate(-50%,5px)}to{opacity:1;transform:translate(-50%,0)}}
.reduced-motion *,.reduced-motion *:before,.reduced-motion *:after,[data-reduced-motion=true] *,[data-reduced-motion=true] *:before,[data-reduced-motion=true] *:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}

@media(min-width:1600px){.panel--wide{width:min(1200px,100%)}.choice-card{padding:27px}.character-card .character-art,.character-card canvas,.character-card img{height:250px}.hud .panel{width:290px;padding:17px 21px}.hud .panel h2,.hud .panel h3{font-size:27px}.battle-panel{width:min(1370px,calc(100% - 58px));padding:20px 24px 22px}.attack-card{min-height:96px;padding:16px 20px}.attack-card strong,.attack-card .attack-name{font-size:27px}.attack-card small,.attack-card .attack-cost{font-size:14px}}
@media(max-width:1000px){.panel{padding:28px}.game-title{font-size:45px}.panel--wide{width:min(900px,100%)}.character-card .character-art,.character-card canvas,.character-card img{height:170px}.hud-top{top:16px;left:17px;right:17px;gap:12px}.hud-bottom{left:17px;right:17px;bottom:17px;gap:12px}.hud .panel{width:232px;padding:13px 15px}.hud .panel h2,.hud .panel h3{font-size:22px}.hud .quest,.quest-panel{width:220px;font-size:12px}.battle-panel{width:calc(100% - 30px);bottom:14px;padding:13px 14px 15px}.attack-card{min-height:78px;padding:12px}.attack-card strong,.attack-card .attack-name{font-size:21px}.battle-log{font-size:12px;margin-bottom:10px}.party-card{min-width:115px;padding:9px 10px}.party-card strong{font-size:17px}.party-card small{font-size:11px}.screen--title .game-title{font-size:90px}.screen--story .panel{margin:0;width:min(540px,100%)}.world-caption{font-size:12px}}
@media(max-width:700px){.screen{padding:18px 16px max(18px,env(safe-area-inset-bottom));align-items:start}.panel{border-radius:23px;padding:25px 21px;margin:auto 0;width:100%}.panel--wide{width:100%}.panel h2:not(.game-title),.modal h2{font-size:32px}.game-title{font-size:39px}.lede{font-size:13px;margin-top:12px;line-height:1.6}.hint,.muted{font-size:12px}.actions{gap:11px;margin-top:22px}.button{font-size:17px;min-height:52px;padding:12px 18px;border-radius:15px}.button--ghost{font-size:13px}.screen--title{align-items:stretch;padding:24px 15px max(23px,env(safe-area-inset-bottom))}.screen--title .panel{min-height:calc(100dvh - 48px);margin:0;padding:20px 0 14px}.screen--title .game-title{font-size:clamp(62px,13vw,85px);max-width:470px}.screen--title .button--primary{font-size:25px;padding:16px 27px;min-height:66px;border-radius:22px}.screen--title .actions{padding-top:20px}.screen--studio .panel{padding-top:30px;padding-bottom:30px}.studio-mark{width:80px;height:90px;font-size:37px;margin-bottom:22px}.studio-name{font-size:22px}.studio-presents{margin-bottom:17px}.screen--studio .game-title{font-size:39px}.screen--story .panel{padding:26px 22px;margin:0;align-self:end}.screen--story .game-title{font-size:37px}.screen--story .actions{justify-content:stretch}.screen--story .actions .button{flex:1}.choice-grid{gap:12px;margin-top:20px}.choice-card{padding:18px 16px;border-radius:17px}.choice-card h2,.choice-card h3,.character-card h2,.character-card h3{font-size:25px}.choice-card p,.character-card p{font-size:13px}.character-card{padding:15px 13px 18px}.character-card .character-art,.character-card canvas,.character-card img{height:145px}.character-card .stat-row{font-size:12px;gap:8px}.badge{font-size:11px;padding:5px 8px}.inventory-row{font-size:13px;gap:10px;padding:12px 5px}.screen--world .choice-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.screen--world .choice-card{min-height:112px;padding:14px 9px}.screen--world .choice-card h3{font-size:22px}.hud-top{top:max(14px,env(safe-area-inset-top));left:12px;right:12px;gap:10px}.hud-bottom{left:12px;right:12px;bottom:max(15px,env(safe-area-inset-bottom));gap:10px}.hud .panel{width:200px;padding:11px 13px;border-radius:18px}.hud .panel h2,.hud .panel h3{font-size:21px}.hud .panel .stat-row{font-size:12px;gap:5px}.hud .panel .hint{font-size:11px}.hud .quest,.quest-panel{width:195px;font-size:12px;padding:11px 13px}.hud .actions{gap:8px}.hud .button--ghost{font-size:12px}.party-card{min-width:98px;padding:9px;gap:7px;border-radius:13px}.party-card img,.party-card canvas{height:36px;width:36px}.party-card strong{font-size:16px}.party-card small{font-size:11px}.party-strip{gap:7px}.boost-button{min-width:100px;min-height:59px;font-size:21px;padding:10px 15px;border-radius:17px}.joystick{width:112px;height:112px}.joystick:before{height:88px}.joystick:after{width:88px}.joystick-knob{width:51px;height:51px}.battle-panel{left:12px;right:12px;bottom:max(13px,env(safe-area-inset-bottom));transform:none;width:auto;border-radius:20px;padding:12px}.attack-grid{gap:8px}.attack-card{min-height:85px;padding:11px 9px;border-radius:14px;gap:6px}.attack-card strong,.attack-card .attack-name{font-size:18px;line-height:1.12}.attack-card small,.attack-card .attack-cost{font-size:11px}.battle-log{font-size:12px;line-height:1.45;margin-bottom:10px;padding:0 3px}.battle-panel .button{font-size:14px;padding:11px 13px}.battle-panel>.actions{gap:8px;justify-content:center}.battle-panel .action-preview{gap:10px;flex-wrap:wrap}.battle-panel .action-preview p{font-size:12px;flex:1;min-width:160px}.battle-panel .action-preview .button{min-width:125px}.battle-panel .hint,.battle-panel .warning{font-size:11px}.modal-backdrop{padding:17px}.modal{padding:27px 22px;border-radius:23px;margin:auto 0}.modal p{font-size:13px;margin-top:14px}.modal .actions{margin-top:21px}.toast{font-size:12px;padding:11px 15px;bottom:max(20px,env(safe-area-inset-bottom))}.screen--result .inventory-row{gap:14px}.screen--result .inventory-row>div{min-width:80px}.screen--result .inventory-row strong{font-size:27px}}
@media(max-width:480px){.screen{padding:16px 13px max(18px,env(safe-area-inset-bottom))}.panel{padding:25px 18px}.game-title{font-size:36px}.screen--title .game-title{font-size:clamp(56px,15vw,72px);max-width:340px}.screen--title .panel{padding-top:22px}.screen--title .button--primary{font-size:24px;padding:15px 23px}.screen--title .button--ghost{font-size:12px}.screen--team .choice-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.character-card{padding:13px 8px 16px;gap:9px}.character-card .character-art,.character-card canvas,.character-card img{height:126px;min-height:0}.character-card h2,.character-card h3{font-size:22px}.character-card .stat-row{font-size:12px;justify-content:center;gap:4px 9px}.character-card .badge{font-size:11px}.choice-card p{font-size:12px;line-height:1.5}.actions .button{font-size:16px}.actions .button--ghost{font-size:12px}.hud-top{left:10px;right:10px;gap:8px}.hud .panel{width:calc(50vw - 16px);min-width:0;padding:10px 11px}.hud .panel h2,.hud .panel h3{font-size:20px}.hud .panel .stat-row{font-size:11px;gap:4px;margin:5px 0}.hud .panel .hint{font-size:11px}.meter{height:10px}.meter--segments{height:6px}.hud .quest,.quest-panel{width:190px;font-size:11px}.hud .button--square,.hud .icon-button{min-width:48px;width:48px;min-height:48px}.party-card{min-width:88px;padding:9px 8px;gap:5px;min-height:56px}.party-card img,.party-card canvas{display:none}.party-card strong{font-size:17px}.party-card small{font-size:11px}.party-strip{gap:6px;max-width:200px}.hud-bottom{left:10px;right:10px;gap:8px}.boost-button{min-width:92px;padding:10px 13px;font-size:21px}.joystick{width:104px;height:104px}.joystick:before{height:82px}.joystick:after{width:82px}.joystick-knob{width:48px;height:48px}.battle-panel{left:8px;right:8px;bottom:max(9px,env(safe-area-inset-bottom));padding:11px 9px;border-radius:18px}.attack-grid{gap:6px}.attack-card{padding:10px 7px;min-height:90px;gap:5px}.attack-card strong,.attack-card .attack-name{font-size:16px;overflow-wrap:anywhere}.attack-card small,.attack-card .attack-cost{font-size:11px;line-height:1.3}.battle-panel .button{font-size:13px;padding:10px 11px;min-height:48px}.battle-panel .actions{gap:7px}.battle-panel .action-preview p{font-size:12px;min-width:150px}.battle-panel .action-preview .button{min-width:115px}.battle-log{font-size:12px;min-height:18px}.screen--result .actions{flex-direction:column}.screen--result .actions .button{width:100%}.inventory-row{font-size:12px;gap:10px}.screen--result .inventory-row>div{min-width:70px}.screen--result .inventory-row strong{font-size:25px}.screen--result .inventory-row small{font-size:11px}}
@media(max-width:360px){.choice-grid{grid-template-columns:1fr}.screen--team .choice-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.character-card h2,.character-card h3{font-size:20px}.character-card .character-art,.character-card canvas,.character-card img{height:105px}.attack-grid{grid-template-columns:1fr}.attack-card{min-height:49px;flex-direction:row;justify-content:space-between;align-items:center;padding:10px 12px}.attack-card strong,.attack-card .attack-name{font-size:18px}.attack-card small,.attack-card .attack-cost{text-align:right;font-size:11px}.battle-panel .action-preview .button{width:100%}.battle-panel .action-preview p{min-width:100%}.screen--world .choice-grid{grid-template-columns:1fr 1fr}}
@media(max-height:600px) and (min-width:601px){.screen{padding:16px 24px}.panel{padding:22px 28px}.game-title{font-size:38px}.lede{font-size:13px;margin-top:10px}.actions{margin-top:17px}.choice-grid{margin-top:18px;gap:13px}.choice-card{padding:18px}.character-card .character-art,.character-card canvas,.character-card img{height:110px}.character-card{padding:11px 17px;gap:8px}.character-card h2,.character-card h3{font-size:24px}.screen--title .panel{min-height:calc(100dvh - 32px);padding:6px 0 9px}.screen--title .game-title{font-size:72px;max-width:590px}.screen--title .button--primary{font-size:26px;min-height:60px;padding:13px 33px}.screen--title .actions{padding-top:15px;gap:10px}.screen--studio .panel{padding:10px}.studio-mark{width:62px;height:70px;font-size:30px;margin-bottom:16px}.studio-name{font-size:19px}.studio-presents{margin:8px 0 12px}.screen--studio .game-title{font-size:35px}.hud-top{top:12px;left:15px;right:15px}.hud .panel{width:215px;padding:9px 13px}.hud .panel h2,.hud .panel h3{font-size:21px}.hud .panel .stat-row{font-size:11px;margin:4px 0}.hud .panel .hint{margin-top:4px}.hud-bottom{bottom:13px;left:15px;right:15px}.joystick{width:91px;height:91px}.joystick:before{height:70px}.joystick:after{width:70px}.joystick-knob{width:44px;height:44px}.party-card{padding:7px 10px;min-height:49px}.boost-button{min-height:52px;font-size:21px}.battle-panel{bottom:10px;width:calc(100% - 28px);padding:10px 13px 12px}.battle-log{font-size:12px;margin-bottom:7px;min-height:17px}.attack-card{min-height:64px;padding:9px 11px;gap:3px}.attack-card strong,.attack-card .attack-name{font-size:21px}.attack-card small,.attack-card .attack-cost{font-size:11px}.battle-panel>.actions{margin-top:10px}.battle-panel .action-preview{margin-top:10px;padding-top:9px}.battle-panel .button{min-height:45px;font-size:14px}.battle-panel .hint{margin-top:7px}.modal{padding:24px}.screen--story .panel{width:min(550px,90%);padding:23px 27px}.screen--story .game-title{font-size:36px}.screen--story .lede{font-size:13px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

/* Resource costs, remaining length and controls stay readable on small screens. */
.stat-row,.hud .panel .stat-row,.character-card .stat-row,.attack-card small,.attack-card .attack-cost,.meter-label,.battle-log,.battle-panel .hint,.battle-panel .warning,.battle-panel .action-preview p,.hud .panel .hint,.hud .quest,.quest-panel,.hint,.party-card small,.boost-button small,.world-caption,.inventory-row,.screen--result .inventory-row small{font-size:14px}
.attack-card small,.attack-card .attack-cost{line-height:1.4}
.hud .panel .stat-row{row-gap:4px}
.party-card small{line-height:1.35}
.battle-panel .action-preview p{line-height:1.5}

/* Layout for the playable v1.1 HUD. Keep the map clear and controls anchored. */
.screen--result .eyebrow{display:none}
.screen--world{display:block;background:#05283126}
.world-map-heading{position:absolute;top:24px;left:24px;padding:12px 20px;background:#073640ed;border:1px solid var(--gold);border-radius:16px}
.world-map-heading h1{font:700 28px/1.15 var(--display);color:var(--cream)}
.world-locks{position:absolute;top:24px;right:24px;display:flex;gap:7px;flex-wrap:wrap;max-width:60%;justify-content:flex-end}
.world-locks .badge{font-size:14px;background:#073640ed}
.screen--world .world-entry{position:absolute;bottom:24px;right:24px;width:min(460px,calc(100% - 48px));padding:22px 26px;text-align:left;background:#073640f5}
.world-entry h2{margin:9px 0;font:700 34px var(--display)}
.world-entry p{font-size:16px;line-height:1.5}
.world-entry .actions{justify-content:flex-start;margin-top:18px;gap:10px}
.world-entry .button{font-size:17px;min-height:48px;padding:10px 16px}
@media(max-width:600px){.world-map-heading{top:16px;left:16px;padding:10px 15px}.world-map-heading h1{font-size:25px}.world-locks{top:80px;left:16px;right:16px;max-width:none;justify-content:flex-start}.screen--world .world-entry{bottom:16px;right:16px;width:calc(100% - 32px);padding:18px 20px}.world-entry h2{font-size:30px}.world-entry .badge{font-size:14px}}
.hud:not(.hud--battle) .hud-top>.inventory-row{margin:0;padding:10px 14px;border:1px solid var(--line);border-radius:18px;background:#073640e8;box-shadow:0 6px 20px #001e2c55;display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-end;gap:13px}
.hud .resource{font-size:14px;white-space:nowrap}
.hud:not(.hud--battle) .quest-panel{width:300px;max-width:36vw}
.hud:not(.hud--battle) .hud-bottom{align-items:flex-end;gap:20px}
.hud:not(.hud--battle) .hud-bottom>.party-strip{flex-wrap:nowrap;max-width:none;flex-shrink:0}
.hud:not(.hud--battle) .hud-bottom>.actions{margin-left:auto;justify-content:flex-end;flex-wrap:nowrap}
.hud:not(.hud--battle) .hud-bottom>.hint{position:absolute;right:0;bottom:88px;max-width:400px;padding:8px 12px;border-radius:12px;background:#062f3be8;color:#f1ebce;font-size:14px;line-height:1.45;text-align:right}
.hud>.joystick{position:absolute;left:24px;bottom:124px}
@media(pointer:fine){.hud>.joystick{display:none}}
.battle-panel-header{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:12px}
.turn-label{color:#ffe3a0;font-size:14px;text-align:right;max-width:260px}
.battle-panel-header .party-strip{flex-wrap:nowrap}
.battle-panel-header .party-card{min-height:45px;padding:7px 10px}
.battle-panel-header .party-card canvas{height:36px;width:36px}
.battle-panel{padding:12px 16px}
.battle-panel-header{margin-bottom:8px}
.battle-panel-header .party-card{min-height:40px;padding:6px 10px}
.battle-panel-header .party-card strong{font-size:17px}
.battle-panel-header .party-card canvas{width:30px;height:30px}
.battle-panel .attack-icon{display:none}
.battle-panel .attack-card{min-height:96px;padding:10px 13px;gap:4px}
.battle-panel .attack-card strong{font-size:22px}
.battle-panel .attack-card small{font-size:14px;line-height:1.35}
.battle-panel>.actions{margin-top:10px}
.battle-panel .button{min-height:40px;padding:8px 14px}
.battle-panel .battle-log{margin:8px 0 0;line-height:1.4}
.battle-panel .attack-card .cost{font-size:14px;line-height:1.4}
.battle-panel .battle-log{margin:12px 0 0;min-height:0;font-size:14px}
.battle-round{margin-top:12px;background:#073743ed;border:1px solid var(--gold);font-size:14px}
.screen--title .game-title{font-size:clamp(64px,8vw,112px);max-width:700px}
@media(max-width:1000px){
  .hud:not(.hud--battle) .hud-top>.inventory-row{gap:9px;padding:8px 10px;max-width:440px}
  .hud:not(.hud--battle) .quest-panel{width:250px}
  .hud:not(.hud--battle) .hud-bottom>.party-strip{flex-direction:column;align-items:stretch}
  .hud:not(.hud--battle) .hud-bottom>.actions{flex-wrap:wrap;max-width:360px}
  .hud:not(.hud--battle) .hud-bottom>.hint{bottom:130px;max-width:310px}
  .hud>.joystick{left:17px;bottom:180px}
  .battle-panel-header .party-card canvas{display:none}
}
@media(max-width:600px){
  .hud:not(.hud--battle) .hud-top{display:grid;grid-template-columns:1fr auto;gap:8px}
  .hud:not(.hud--battle) .quest-panel{max-width:none;width:auto;padding:10px 12px;font-size:14px}
  .hud:not(.hud--battle) .hud-top>.inventory-row{max-width:140px;gap:7px;justify-content:center;padding:8px}
  .hud:not(.hud--battle) .hud-top .button{min-height:42px;font-size:14px;padding:8px 10px}
  .hud:not(.hud--battle) .hud-bottom>.party-strip{max-width:156px;flex-shrink:1}
  .hud:not(.hud--battle) .party-card{min-width:0;padding:8px;min-height:56px}
  .hud:not(.hud--battle) .party-card strong{font-size:17px}
  .hud:not(.hud--battle) .party-card small{font-size:14px}
  .hud:not(.hud--battle) .hud-bottom>.actions{display:flex;flex-direction:column;gap:8px;align-items:stretch;max-width:160px}
  .hud:not(.hud--battle) .hud-bottom>.actions .button{min-height:44px;font-size:15px;padding:10px 13px}
  .hud:not(.hud--battle) .hud-bottom>.hint{display:none}
  .hud>.joystick{left:13px;bottom:164px}
  .battle-panel{max-height:52dvh;overflow-y:auto}
  .battle-panel-header{gap:6px;align-items:flex-start}
  .battle-panel-header .party-strip{gap:5px}
  .battle-panel-header .party-card{min-width:0;padding:6px;font-size:14px}
  .battle-panel-header .party-card strong{font-size:16px}
  .battle-panel-header .party-card small{font-size:14px}
  .turn-label{font-size:14px;max-width:110px}
  .battle-panel .attack-card{min-height:100px;padding:9px 7px;gap:5px}
  .battle-panel .attack-card strong{font-size:17px}
  .battle-panel .attack-card small{font-size:14px;line-height:1.35}
  .battle-panel .attack-icon{display:none}
  .hud--battle .hud-top{gap:7px}
  .hud--battle .combatant-panel{width:calc(50% - 4px);margin:0;padding:10px}
  .hud--battle .battle-round{position:absolute;top:135px;left:50%;transform:translateX(-50%);margin:0}
}
@media(max-height:550px) and (min-width:601px){
  .hud:not(.hud--battle) .hud-bottom>.party-strip{flex-direction:row}
  .hud:not(.hud--battle) .hud-bottom>.hint{display:none}
  .hud:not(.hud--battle) .hud-bottom>.actions{max-width:none;flex-wrap:nowrap}
  .hud>.joystick{bottom:96px;width:80px;height:80px}
  .battle-panel{max-height:45dvh;overflow-y:auto}
}
@media(max-width:600px){
  .battle-panel-header{display:grid;grid-template-columns:1fr;gap:7px}
  .battle-panel-header .party-strip{display:grid;grid-template-columns:1fr 1fr;max-width:none;gap:7px}
  .battle-panel-header .party-card{min-height:49px;display:block}
  .battle-panel-header .party-card strong{font-size:17px;white-space:nowrap}
  .battle-panel-header .party-card small{white-space:nowrap}
  .turn-label{max-width:none;text-align:left}
  .battle-panel .attack-grid{grid-template-columns:1fr;gap:7px}
  .battle-panel .attack-card{display:grid;grid-template-columns:minmax(126px,.95fr) minmax(0,1.05fr);grid-template-rows:auto auto;align-items:center;column-gap:8px;row-gap:3px;min-height:65px;padding:9px 11px}
  .battle-panel .attack-card strong{grid-column:1;grid-row:1/3;overflow-wrap:normal;font-size:19px;line-height:1.2}
  .battle-panel .attack-card .cost{grid-column:2;grid-row:1;font-size:14px}
  .battle-panel .attack-card small{grid-column:2;grid-row:2;font-size:14px;line-height:1.35;text-align:left}
}
