:root{--gold:#e7c27c;--gold2:#8a6631;--gold3:#4f3a1b;--ink:#0d0c0a;--paper:#f0e6d2;--jade:#74e7ca;
--panel:linear-gradient(180deg,#27211b 0,#17130f 22%,#100d0a 100%)}
*{box-sizing:border-box}
html,body{margin:0;height:100%;overflow:hidden;background:#000;color:var(--paper);font:13px/1.4 "Palatino Linotype","Book Antiqua",Georgia,serif;user-select:none}
button{font:inherit;color:inherit}
#view{touch-action:none;position:fixed;inset:0;width:100%;height:100%;display:block;cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30'%3E%3Cpath d='M3 2l8 23 3-9 10-3z' fill='%23e7c27c' stroke='%23241808' stroke-width='1.6'/%3E%3C/svg%3E") 3 2,default}
.hidden{display:none!important}
#hud{position:fixed;inset:0;pointer-events:none;z-index:5}
#hud>*{pointer-events:auto}
#hud>#hint,#hud>#log,#hud>#buffs,#hud>#announce{pointer-events:none}
.frame,.win,#hudbar{position:fixed;background:var(--panel);border:1px solid #000;box-shadow:0 0 0 1px #6c4f24,0 0 0 2px #1a130a,0 0 0 3px #a58246,0 8px 22px #000b;border-radius:2px}
.frame::before,.win::before,#hudbar::before{content:"";position:absolute;inset:3px;border:1px solid #5a432233;pointer-events:none}
#self{left:14px;top:14px;display:flex;gap:10px;padding:8px 14px 8px 8px;width:344px;background:none;box-shadow:none;border:0}
#self::before{content:'';position:absolute;inset:0;border:0;background:var(--panel);box-shadow:0 0 0 1px #6c4f24,0 0 0 3px #a58246;z-index:-1;-webkit-mask:radial-gradient(circle 49px at 58px 58px,transparent 98%,#000 100%);mask:radial-gradient(circle 49px at 58px 58px,transparent 98%,#000 100%)}
#portrait{position:relative;width:100px;height:100px;flex:none;border:2px solid var(--gold);border-radius:50%;box-shadow:0 0 0 2px #2a1e0e,0 0 14px #e7c27c55}
#portrait b{position:absolute;left:50%;bottom:-8px;transform:translateX(-50%);width:30px;height:20px;line-height:18px;text-align:center;font-size:13px;color:#fff5d9;background:linear-gradient(180deg,#8a2a1e,#3e0f0a);border:1px solid var(--gold);border-radius:3px;text-shadow:0 1px 2px #000}
.who{flex:1;min-width:0}
.who h2{margin:2px 0 6px;font-size:16px;font-weight:600;color:var(--gold);letter-spacing:.04em;text-shadow:0 1px 2px #000}
.who small{color:#b8ab93}.who em{color:var(--jade);font-style:normal}
.bar{position:relative;height:17px;background:#050403;box-shadow:inset 0 2px 4px #000,0 0 0 1px #000,0 0 0 2px #6c4f24;margin-bottom:6px;overflow:hidden}
.bar i{position:absolute;inset:0;width:100%;transition:width .25s ease}
.bar i::after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,#fff5 0,#fff0 45%,#0005 100%)}
.bar.hp i{background:linear-gradient(90deg,#7e140e,#d8382a)}
.bar.mp i{background:linear-gradient(90deg,#10388a,#3a8ae8)}
.bar span{position:absolute;inset:0;text-align:center;font-size:11px;line-height:16px;color:#fff;text-shadow:0 1px 2px #000}
#buffs{position:fixed;left:372px;top:20px;display:flex;gap:4px}
#buffs .buff{width:30px;height:30px;border:1px solid var(--gold);background:#120f0a;position:relative;font-size:10px;text-align:center;line-height:42px;color:#fff;text-shadow:0 1px 2px #000}
#buffs svg{position:absolute;inset:2px;width:24px;height:24px}
#target{left:50%;top:14px;width:330px;transform:translateX(-50%);padding:7px 12px 3px;text-align:center}
#target h3{margin:0 0 5px;font-size:14px;color:#ffc4b1;font-weight:600;text-shadow:0 1px 2px #000}
#target .tl{color:#d9c79e;font-size:11px;margin-left:8px}
#map{right:16px;top:14px;width:224px;height:252px;padding:0;background:none;box-shadow:none;border:0}
#map::before{display:none}
.mapring{position:relative;width:216px;height:216px;margin:4px;border-radius:50%;padding:6px;background:conic-gradient(from 0deg,#f2d59a,#8a6631,#3f2d14,#8a6631,#f2d59a,#8a6631,#3f2d14,#8a6631,#f2d59a);box-shadow:0 4px 14px #000b}
#minimap{display:block;width:204px;height:204px;border-radius:50%;cursor:crosshair;background:#111}
.compass{position:absolute;font:700 12px Georgia,serif;color:#ffe9b8;text-shadow:0 1px 2px #000,0 0 3px #000;pointer-events:none}
.c-n{left:50%;top:-1px;transform:translateX(-50%)}.c-e{right:0;top:50%;transform:translateY(-50%)}.c-s{left:50%;bottom:-1px;transform:translateX(-50%)}.c-w{left:0;top:50%;transform:translateY(-50%)}
.mapinfo{position:absolute;left:50%;top:216px;transform:translateX(-50%);display:flex;flex-direction:column;align-items:center;width:210px;padding:2px 10px 3px;background:var(--panel);box-shadow:0 0 0 1px #6c4f24,0 0 0 2px #1a130a,0 0 0 3px #a58246;font-size:12px;color:var(--gold)}
.mapinfo small{color:#b8ab93;font-size:11px}
.zoom{position:absolute;right:0;top:170px;display:flex;flex-direction:column;gap:3px}
.zoom button{width:22px;height:22px;padding:0;background:var(--panel);border:1px solid var(--gold2);color:var(--gold);cursor:pointer;line-height:18px}
#log{position:fixed;left:14px;bottom:112px;width:380px;max-height:170px;overflow:hidden;display:flex;flex-direction:column;justify-content:flex-end;text-shadow:0 1px 2px #000,0 0 4px #000;font-size:13px}
#log p{margin:1px 0;padding:0 4px;animation:fade 18s forwards}
#log .sys{color:#ffe29a}#log .gain{color:#9df0bf}#log .dmg{color:#ffb4a3}#log .loot{color:#a9d0ff}
@keyframes fade{0%,82%{opacity:1}100%{opacity:0}}
#hudbar{left:50%;bottom:10px;transform:translateX(-50%);padding:9px 12px 7px;display:flex;flex-direction:column;align-items:center;gap:6px}
.rowbar{display:flex;gap:10px;align-items:flex-end}
#skills,#pots,#menu{display:flex;gap:5px}
.skill,.pot,.mbtn{position:relative;width:48px;height:48px;border:1px solid var(--gold2);background:radial-gradient(circle at 50% 35%,#2b241c,#0c0a08);box-shadow:inset 0 0 8px #000,0 0 0 1px #000;cursor:pointer;overflow:hidden;padding:0}
.skill svg,.pot svg,.mbtn svg{position:absolute;inset:2px;width:42px;height:42px}
.skill:hover,.pot:hover,.mbtn:hover{border-color:var(--gold);filter:brightness(1.25)}
.skill kbd,.pot kbd{position:absolute;left:3px;top:0;font:700 11px/15px Georgia,serif;color:#fff;text-shadow:0 0 2px #000,0 0 2px #000}
.pot em{position:absolute;right:3px;bottom:0;font:700 12px/15px Georgia,serif;color:#fff;font-style:normal;text-shadow:0 0 2px #000}
.skill .cool{position:absolute;left:0;right:0;bottom:0;background:#000c;height:0}
.skill.on{box-shadow:0 0 10px var(--jade),inset 0 0 8px var(--jade);border-color:var(--jade)}
.skill.nomana svg{filter:grayscale(.8) brightness(.6)}
.mbtn{width:42px;height:48px}
.mbtn svg{inset:3px 7px 12px;width:28px;height:30px;fill:var(--gold)}
.mbtn.mount{width:66px;background:linear-gradient(180deg,#7c261a,#3b0f0a);border-color:var(--gold)}
.mbtn.mount svg{left:18px}
.mbtn span{position:absolute;left:0;right:0;bottom:1px;text-align:center;font-size:10px;color:#e9dcc0;text-shadow:0 1px 1px #000}
.xp{position:relative;width:100%;height:11px;background:#050403;box-shadow:inset 0 1px 3px #000,0 0 0 1px #000,0 0 0 2px #6c4f24}
.xp i{position:absolute;inset:0;width:0;background:linear-gradient(180deg,#ffe9a8,#b98a2c 60%,#7a5a18);transition:width .3s}
.xp::after{content:"";position:absolute;inset:0;background:repeating-linear-gradient(90deg,#0000 0,#0000 9.8%,#0007 9.8%,#0007 10%)}
.xp span{position:absolute;inset:-3px 0 0;text-align:center;font-size:10px;line-height:17px;text-shadow:0 1px 2px #000;z-index:1}
#hint{position:fixed;left:50%;bottom:118px;transform:translateX(-50%);font-size:13px;color:#fff;text-shadow:0 1px 3px #000,0 0 6px #000;transition:opacity 1s;white-space:nowrap}
#announce{position:fixed;left:50%;top:18%;transform:translateX(-50%);text-align:center;font-size:30px;color:#ffe6ac;text-shadow:0 2px 3px #000,0 0 18px #c98a2a;letter-spacing:.05em;opacity:0;transition:opacity .4s}
#announce small{display:block;font-size:15px;color:#f0e6d2;letter-spacing:0}
#labels{position:fixed;inset:0;pointer-events:none;overflow:hidden;z-index:3}
.tag{position:absolute;transform:translate(-50%,-100%);font-size:12px;color:#ffd9c9;text-shadow:0 1px 2px #000,0 0 3px #000;white-space:nowrap;text-align:center}
.tag.me{color:#a8f5d5;font-weight:600}
.tag.npc{color:#ffe49a;font-weight:600}
.tag.q::before{content:"!";display:block;font-size:20px;line-height:18px;color:#ffc94a;text-shadow:0 0 6px #ff9a1e}
.tag b{display:block;height:4px;width:64px;margin:2px auto 0;background:#000a;border:1px solid #000}
.tag b i{display:block;height:100%;background:#d6423a}
.tag.lootTag{font-size:12px;font-weight:600;padding:0 5px;background:#0007;border-radius:2px}
.float{position:absolute;transform:translate(-50%,0);font-weight:700;font-size:20px;color:#ffd47a;text-shadow:0 2px 3px #000,0 0 4px #000;animation:rise 1s ease-out forwards}
.float.crit{font-size:27px;color:#fff09c}.float.hurt{color:#ff7b6b}.float.heal{color:#8dffba}.float.gold{color:#ffe08a;font-size:15px}
@keyframes rise{from{opacity:1;margin-top:0}to{opacity:0;margin-top:-68px}}
.win{right:auto;left:calc(50% - 200px);top:110px;width:400px;z-index:30;pointer-events:auto}
.wh{display:flex;align-items:center;gap:8px;height:30px;padding:0 6px 0 10px;background:linear-gradient(180deg,#6e2318,#34100b);border-bottom:1px solid var(--gold2);cursor:move}
.wh h3{margin:0;font-size:14px;font-weight:600;color:#ffe9c0;letter-spacing:.08em;text-shadow:0 1px 2px #000}
.wh i{flex:1;height:1px;background:linear-gradient(90deg,#0000,var(--gold))}
.wh h3+i{background:linear-gradient(90deg,var(--gold),#0000)}
.wh button{width:22px;height:22px;padding:0;border:1px solid var(--gold2);background:#1a130c;color:var(--gold);cursor:pointer;line-height:18px;font-size:16px}
.wb{padding:12px}
#wChar{left:60px;width:430px;background:none}#wChar::before{display:none}#wChar .wb{padding:0}#wChar .doll{gap:0}#wChar .dcol{background:#15110d;padding:12px 9px}#wChar .stats{margin:0;padding:10px 12px;background:#15110d}#wBag{left:auto;right:260px;width:370px}
#wQuest{left:calc(50% + 40px);width:360px}#wMap{left:calc(50% - 280px);width:560px;top:60px}#wOpt{width:360px}#wShop{left:60px;top:150px;width:330px}
.doll{display:flex;justify-content:space-between;gap:8px}
.dcol{display:flex;flex-direction:column;gap:6px}
.slot{position:relative;width:62px;height:62px;padding:0;border:1px solid #4c3a1e;background:radial-gradient(circle at 50% 30%,#2a241c,#0c0a08);box-shadow:inset 0 0 8px #000;cursor:pointer}
.slot svg{position:absolute;inset:6px 8px 12px;width:46px;height:44px}
.slot span{position:absolute;left:0;right:0;bottom:1px;font-size:9px;color:#b8ab93}
.slot:hover{filter:brightness(1.3)}
.stage{flex:1;min-height:338px;position:relative;text-align:center;border:1px solid #3b2c17;overflow:hidden}
.stname{position:absolute;left:0;right:0;top:6px;color:var(--gold);font-size:15px;z-index:2;text-shadow:0 1px 2px #000}
.stline{position:absolute;left:0;right:0;bottom:6px;color:#b8ab93;font-size:11px;z-index:2}
#dollView{position:absolute;inset:0}
.outfits{display:flex;gap:3px;padding:7px 9px 0;background:#15110d}
.obtn{flex:1;height:24px;padding:0 4px;font-size:11px;background:linear-gradient(180deg,#3a2c1c,#1a130c);border:1px solid var(--gold2);color:#efe0c4;cursor:pointer;white-space:nowrap}
.obtn.all{flex:1.7;background:linear-gradient(180deg,#7c261a,#3b0f0a)}.obtn.save{flex:none;width:22px;color:var(--gold)}
.obtn:hover:not(:disabled){filter:brightness(1.3)}.obtn:disabled{opacity:.38;cursor:default}
.stats{display:grid;grid-template-columns:1fr 1fr;gap:3px 16px;margin-top:10px}
.stats div{display:flex;justify-content:space-between;border-bottom:1px solid #33271544;padding:1px 2px}
.stats span{color:#b8ab93}.stats b{color:#ffe9c0}
.grid{display:grid;grid-template-columns:repeat(8,1fr);gap:3px}
.cell{position:relative;aspect-ratio:1;padding:0;border:1px solid #3b2c17;background:radial-gradient(circle at 50% 30%,#221d16,#0b0908);box-shadow:inset 0 0 6px #000;cursor:pointer}
.cell svg{position:absolute;inset:3px;width:calc(100% - 6px);height:calc(100% - 6px)}
.cell:hover{filter:brightness(1.35)}
.goldline{display:flex;align-items:center;gap:7px;margin-top:9px;color:#ffe9c0}
.goldline em{margin-left:auto;font-style:normal;color:#8f8370;font-size:11px}
.coin{width:14px;height:14px;border-radius:50%;background:radial-gradient(circle at 35% 30%,#fff3bd,#d39b2e 60%,#6e4a10);border:1px solid #3f2d14}
.skrow{display:flex;gap:10px;padding:7px 2px;border-bottom:1px solid #33271544}
.sico{position:relative;width:46px;height:46px;flex:none;border:1px solid var(--gold2);background:#0c0a08}
.sico svg{position:absolute;inset:2px;width:40px;height:40px}
.skrow h4{margin:0;color:var(--gold);font-size:14px;font-weight:600}.skrow p{margin:1px 0;font-size:12px;color:#d9cfbb}.skrow small{color:#8f8370;font-size:11px}
.qcard small{color:#b8ab93}.qcard h4,.qdone h4{margin:1px 0 4px;color:var(--gold);font-size:16px;font-weight:600}.qcard p{margin:4px 0;color:#e2d8c4}
.qbar{position:relative;height:16px;background:#050403;box-shadow:0 0 0 1px #6c4f24;margin:8px 0}
.qbar i{position:absolute;left:0;top:0;bottom:0;background:linear-gradient(180deg,#8fe3b2,#2f8a5a)}
.qbar span{position:absolute;inset:0;text-align:center;font-size:11px;line-height:15px;text-shadow:0 1px 2px #000}
.rw{color:#b8ab93;font-size:12px}
.btn{display:block;width:100%;margin:6px 0;padding:8px;background:linear-gradient(180deg,#7c261a,#3b0f0a);border:1px solid var(--gold);color:#fff0d0;cursor:pointer;letter-spacing:.06em}
.btn:hover{filter:brightness(1.25)}
.qlist{margin:10px 0 0;padding:0 0 0 18px;color:#8f8370;font-size:12px}.qlist .ok{color:#7bd29a;text-decoration:line-through}.qlist .on{color:#ffe9c0}
.shoptalk{margin:0 0 8px;color:#d9cfbb;font-style:italic}
.shoprow{display:flex;align-items:center;gap:8px;width:100%;margin-bottom:4px;padding:3px 8px 3px 3px;border:1px solid #3b2c17;background:#0f0c09;cursor:pointer;text-align:left}
.shoprow:hover{filter:brightness(1.3);border-color:var(--gold2)}.shoprow .sn{flex:1}.shoprow b{color:#ffe08a;font-weight:600}
#wOpt label{display:flex;align-items:center;justify-content:space-between;margin-bottom:9px;color:#e2d8c4}
#wOpt input,#wOpt select{width:190px;accent-color:#c6963f;background:#0f0c09;color:#f0e6d2;border:1px solid var(--gold2)}
.keys b{color:var(--gold)}.keys p{margin:3px 0;font-size:12px;color:#c8bda6;line-height:1.6}
#worldmap{display:block;width:100%;height:auto;border:1px solid #3b2c17;cursor:crosshair}
#tip{position:fixed;display:none;max-width:280px;padding:9px 11px;background:#0d0b08f4;border:1px solid var(--gold2);box-shadow:0 6px 18px #000c;z-index:100;pointer-events:none}
#tip h4{margin:0;font-size:15px;font-weight:600}#tip p{margin:2px 0;font-size:12px;color:#d9cfbb}#tip .kind{color:#b8ab93}#tip .req{color:#8f8370}#tip .bad{color:#ff8f7c}
#tip ul{margin:5px 0;padding:0;list-style:none;font-size:13px}#tip li{color:#9df0bf}#tip li b{color:#fff}#tip .flav{font-style:italic;color:#a99d86;margin-top:6px}#tip small{color:#8f8370;font-size:11px}
#title{position:fixed;inset:0;display:flex;align-items:flex-start;justify-content:center;padding-top:5vh;background:radial-gradient(ellipse at 50% 58%,#0000 25%,#000a 95%);transition:opacity 1.2s;z-index:50}
#title.out{opacity:0;pointer-events:none}
.plate{text-align:center;padding:24px 56px 28px;max-width:calc(100vw - 32px)}
.plate .cn{margin:0;color:var(--gold);letter-spacing:.6em;padding-left:.6em;font-size:17px}
.plate h1{margin:6px 0 2px;font-size:clamp(40px,7.6vw,76px);font-weight:500;letter-spacing:.05em;color:#f8ead0;text-shadow:0 2px 2px #3a2507,0 0 28px #e4bb7488}
.plate .sub{margin:0 0 22px;color:#e6d7bb;text-shadow:0 1px 3px #000;font-size:15px}
#load{height:5px;width:min(320px,80vw);margin:0 auto;background:#0009;border:1px solid var(--gold2)}
#load i{display:block;height:100%;width:0;background:linear-gradient(90deg,#a57b28,#f4d78c)}
#loadt{margin:7px 0 15px;color:#d9ccb3;min-height:18px;text-shadow:0 1px 3px #000}
#start{position:fixed;left:50%;bottom:7vh;transform:translateX(-50%);font:600 18px/1 Georgia,serif;letter-spacing:.2em;padding:13px 46px 12px;color:#fff3da;background:linear-gradient(180deg,#8f2a1e,#4f120c);border:1px solid var(--gold);box-shadow:0 0 0 1px #000,0 0 18px #e4bb7444;cursor:pointer}
#start:disabled{opacity:.4;cursor:wait}
#start:not(:disabled):hover{filter:brightness(1.2)}
@media (max-width:1100px){#hint,#buffs{display:none}.skill,.pot{width:40px;height:40px}.skill svg,.pot svg{width:34px;height:34px}.mbtn{width:34px;height:40px}.mbtn span{display:none}}

/* Hero screens */
#pick{position:fixed;left:50%;bottom:6vh;transform:translateX(-50%);display:flex;flex-direction:column;align-items:center;gap:10px;width:min(460px,92vw)}
.pcards{display:flex;gap:12px;width:100%}
.pcard{flex:1;position:relative;padding:0;border:1px solid var(--gold2);background:#0009;cursor:pointer;overflow:hidden;aspect-ratio:4/5;max-height:38vh}
.pcard img{width:100%;height:100%;object-fit:cover;display:block;opacity:.7}
.pcard span{position:absolute;left:0;right:0;bottom:0;padding:6px;background:linear-gradient(0deg,#000c,#0000);color:#f8ead0;font-size:15px}
.pcard.on{border-color:var(--gold);box-shadow:0 0 0 1px var(--gold),0 0 16px #e4bb7466}.pcard.on img{opacity:1}
.pname{display:flex;align-items:center;gap:8px;color:#e6d7bb;width:100%}
.pname input{flex:1;min-width:0;padding:7px 9px;background:#0f0c09;color:#f8ead0;border:1px solid var(--gold2);font:inherit;font-size:16px;user-select:text}
#pick .btn{margin:0}
#forge{position:fixed;right:0;top:0;bottom:0;width:min(360px,46vw);padding:12px 14px calc(12px + env(safe-area-inset-bottom));padding-right:calc(14px + env(safe-area-inset-right));background:linear-gradient(90deg,#100d0ad0,#100d0af4);border-left:1px solid var(--gold2);display:flex;flex-direction:column;gap:8px;z-index:60}
#forge header{display:flex;align-items:center;justify-content:space-between}
#forge h3{margin:0;color:var(--gold);font-size:18px;font-weight:600}
#forgeDice{padding:4px 10px;background:#1a130c;border:1px solid var(--gold2);color:var(--gold);cursor:pointer;font-size:12px}
.fb{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;min-height:0}
.fb section{margin-bottom:10px}.fb h4{margin:0 0 4px;font-size:12px;font-weight:600;letter-spacing:.06em;color:#b8ab93;text-transform:uppercase}
.fopts{display:flex;flex-wrap:wrap;gap:5px}
.fbtn{flex:1 1 44%;padding:6px 8px;background:#1a130c;border:1px solid #4c3a1e;color:#efe0c4;cursor:pointer;text-align:left;font-size:13px}
.fbtn small{display:block;color:#a99d86;font-size:11px;line-height:1.25}
.fbtn.on{border-color:var(--gold);background:#3a2413}
.fdot{width:34px;height:34px;border-radius:50%;border:2px solid #0008;cursor:pointer;padding:0}
.fdot.on{border-color:#fff;box-shadow:0 0 0 2px var(--gold)}
#forge .btn{margin:0;flex:none}
/* People */
.bubble{position:absolute;transform:translate(-50%,-100%);max-width:220px;padding:5px 9px;background:#f4ead6ee;color:#2a1d10;border-radius:7px;font-size:12px;text-align:center;box-shadow:0 2px 6px #0007}
.shopgold{display:flex;align-items:center;gap:6px;margin:0 0 8px;color:#ffe9c0}
.shoprow .sn small{display:block;color:#a99d86;font-size:11px}
/* Touch */
#stick,#mMenu,#mPick,#mapHit,#turn{display:none}
body.touch{-webkit-touch-callout:none}
body.touch #stick{display:block;position:fixed;width:128px;height:128px;margin:-64px 0 0 -64px;border-radius:50%;border:2px solid #fff5;background:#0003;pointer-events:none;opacity:0;transition:opacity .12s;z-index:4;left:96px;top:calc(100% - 110px)}
body.touch #stick.on{opacity:1}
body.touch #stick i{position:absolute;left:39px;top:39px;width:50px;height:50px;border-radius:50%;background:#e7c27ccc;box-shadow:0 2px 8px #0008}
body.touch #hint,body.touch #hudbar .xp span{display:none}
body.touch #self{left:calc(6px + env(safe-area-inset-left));top:calc(6px + env(safe-area-inset-top));width:176px;padding:0;gap:6px}
body.touch #self::before{display:none}
body.touch #portrait{width:40px;height:40px;border-width:1px;background:radial-gradient(circle at 50% 35%,#6d3a22,#20120a);box-shadow:none}
body.touch #portrait b{width:20px;height:14px;line-height:13px;font-size:10px;bottom:-5px}
body.touch .who h2,body.touch .who small{display:none}
body.touch .bar{height:10px;margin:3px 0 4px;box-shadow:0 0 0 1px #000}
body.touch .bar span{font-size:8px;line-height:10px}
body.touch #target{top:calc(6px + env(safe-area-inset-top));width:190px;padding:3px 8px 1px;left:50%}
body.touch #target h3{font-size:11px;margin:0 0 2px}
body.touch #map{right:calc(6px + env(safe-area-inset-right));top:calc(6px + env(safe-area-inset-top));width:88px;height:88px}
body.touch .mapring{width:88px;height:88px;margin:0;padding:3px}
body.touch #minimap{width:82px;height:82px}
body.touch .compass,body.touch .zoom,body.touch .mapinfo{display:none}
body.touch #mapHit{display:block;position:absolute;inset:0;background:none;border:0;border-radius:50%}
body.touch #log{left:calc(6px + env(safe-area-inset-left));top:54px;bottom:auto;width:200px;max-height:54px;font-size:10px;overflow:hidden;justify-content:flex-start}
body.touch #hudbar{left:auto;right:calc(6px + env(safe-area-inset-right));bottom:calc(6px + env(safe-area-inset-bottom));transform:none;width:252px;height:232px;padding:0;background:none;border:0;box-shadow:none;display:block}
body.touch #hudbar::before{display:none}
body.touch .rowbar{display:block;position:absolute;inset:0}
body.touch #skills{display:block;position:absolute;inset:0}
body.touch .skill{position:absolute;width:56px;height:56px;border-radius:50%;background:radial-gradient(circle at 50% 35%,#3a3126ee,#0c0a08ee)}
body.touch .skill svg{inset:9px;width:36px;height:36px}
body.touch .skill kbd,body.touch .pot kbd{display:none}
body.touch .skill:nth-child(1){right:0;bottom:0;width:84px;height:84px;border:2px solid var(--gold)}
body.touch .skill:nth-child(1) svg{inset:14px;width:54px;height:54px}
body.touch .skill:nth-child(2){right:90px;bottom:0}
body.touch .skill:nth-child(3){right:84px;bottom:60px}
body.touch .skill:nth-child(4){right:30px;bottom:92px}
body.touch .skill:nth-child(5){right:150px;bottom:6px;width:46px;height:46px}
body.touch .skill:nth-child(6){right:146px;bottom:62px;width:46px;height:46px}
body.touch .skill:nth-child(5) svg,body.touch .skill:nth-child(6) svg{inset:6px;width:32px;height:32px}
body.touch #pots{position:absolute;right:92px;bottom:122px;display:flex;gap:4px}
body.touch .pot{width:40px;height:40px;border-radius:50%}body.touch .pot svg{inset:4px;width:30px;height:30px}
body.touch #mMenu{display:flex;position:absolute;right:4px;bottom:176px;width:44px;height:44px;flex-direction:column;align-items:center;justify-content:center;gap:4px;border-radius:50%;background:#100d0acc;border:1px solid var(--gold2);padding:0}
body.touch #mMenu i{display:block;width:20px;height:2px;background:var(--gold)}
body.touch #mPick{display:block;position:absolute;right:150px;bottom:176px;padding:9px 12px;background:linear-gradient(180deg,#8a5c1e,#4a2f0e);border:1px solid var(--gold);color:#fff3da;border-radius:6px;font-size:13px}
body.touch #mPick.hidden{display:none!important}
body.touch #menu{display:none;position:fixed;right:calc(56px + env(safe-area-inset-right));bottom:calc(8px + env(safe-area-inset-bottom));max-width:calc(100vw - 80px);flex-wrap:wrap;gap:4px;justify-content:flex-end;padding:6px;background:#100d0af2;border:1px solid var(--gold2);z-index:8}
body.touch #menu.open{display:flex}
body.touch .mbtn{width:58px;height:50px}body.touch .mbtn span{display:block}
body.touch .mbtn.mount{width:66px}
/* The mount sits under the thumb even with the menu closed. */
body.touch #hudbar .xp{position:fixed;left:0;right:0;bottom:0;width:auto;height:3px;box-shadow:none}
body.touch .win{left:env(safe-area-inset-left)!important;right:env(safe-area-inset-right)!important;top:0!important;bottom:0;width:auto!important;max-width:none;overflow-y:auto;-webkit-overflow-scrolling:touch;z-index:40;background:#100d0af8}
body.touch .wh{position:sticky;top:0;z-index:2;height:40px}body.touch .wh button{width:36px;height:36px;font-size:22px}
body.touch #wChar .doll{min-height:230px}body.touch .stage{min-height:230px}
body.touch #announce{top:24%;font-size:20px}
body.touch .tag{font-size:10px}
@media (orientation:portrait){body.touch #turn{display:flex;position:fixed;inset:0;z-index:200;flex-direction:column;gap:14px;align-items:center;justify-content:center;background:#000d;color:#f8ead0;font-size:18px;text-align:center;padding:30px}
#turn button{padding:8px 16px;background:none;border:1px solid var(--gold2);color:var(--gold)}
#forge{top:auto;left:0;width:auto;height:58vh;border-left:0;border-top:1px solid var(--gold2)}}
@media (max-height:430px){#forge{width:min(320px,44vw)}.plate{padding:6px 16px}.plate h1{font-size:30px}.plate .sub{display:none}.plate .cn{display:none}#pick{bottom:6px;flex-direction:row;flex-wrap:wrap;width:min(560px,96vw);gap:6px}.pcards{width:220px;flex:none}.pcard{max-height:42vh;aspect-ratio:1}.pname{flex:1;min-width:200px}#start{bottom:10px;padding:9px 30px}}
/* A full-screen window owns the screen: controls come back when it closes. */
body.touch.paned #hudbar,body.touch.paned #log,body.touch.paned #self,body.touch.paned #map,body.touch.paned #target,body.touch.paned #labels{display:none}
