/* Layout: full-screen canvas world; floating brass-edged panels pinned to the corners. Single dark look by choice. */
:root{
  --night:#0e1218; --panel:rgba(22,28,38,.93); --panel-solid:#161c26; --edge:#b8924f; --edge-dim:#6b5733;
  --ink:#efe6d2; --muted:#9aa3b2; --hp:#d9483f; --sp:#4a8fd9; --exp:#e0b84a; --jexp:#62bf86; --good:#7fd38a; --warn:#e8a33d;
  --display:"Grenze Gotisch","Palatino Linotype",Georgia,serif; --ui:"Alegreya Sans","Trebuchet MS",system-ui,sans-serif;
  color-scheme:dark;
}
html,body{height:100%;margin:0;overflow:hidden;background:var(--night);color:var(--ink);font-family:var(--ui);font-size:14px;-webkit-user-select:none;user-select:none;touch-action:none}
#cv{position:fixed;inset:0;width:100%;height:100%;display:block;cursor:pointer}
[hidden]{display:none!important}
button{font:inherit;color:inherit}
.frame{background:var(--panel);border:1px solid var(--edge-dim);box-shadow:0 0 0 1px rgba(0,0,0,.6),0 6px 20px rgba(0,0,0,.45);border-radius:6px}
.btn{background:linear-gradient(#3a2f1e,#261f14);border:1px solid var(--edge);border-radius:4px;padding:4px 10px;cursor:pointer;color:var(--ink);font-weight:700;font-size:13px}
.btn:hover{background:linear-gradient(#4d3e27,#30271a)}
.btn:focus-visible,.slot:focus-visible{outline:2px solid var(--exp);outline-offset:1px}
.btn[disabled]{opacity:.4;cursor:default}
.btn.small{padding:1px 7px;font-size:12px}
/* HUD */
#hud{position:fixed;top:max(10px,env(safe-area-inset-top));left:max(10px,env(safe-area-inset-left));width:230px;padding:8px 10px;pointer-events:none}
#hud .name{font-family:var(--display);font-size:20px;line-height:1;color:var(--exp)}
#hud .cls{color:var(--muted);font-size:12px;margin:2px 0 6px}
.bar{position:relative;height:13px;background:#0b0e13;border:1px solid #000;border-radius:3px;margin:3px 0;overflow:hidden}
.bar i{position:absolute;inset:0 auto 0 0;display:block;transition:width .15s}
.bar span{position:absolute;inset:0;font-size:10.5px;line-height:13px;text-align:center;font-weight:700;text-shadow:0 1px 1px #000;font-variant-numeric:tabular-nums}
.bar.thin{height:7px}.bar.thin span{display:none}
.hpb i{background:linear-gradient(#ef6a5f,var(--hp))}.spb i{background:linear-gradient(#72aaf0,var(--sp))}
.exb i{background:var(--exp)}.jxb i{background:var(--jexp)}
.lbl{display:flex;justify-content:space-between;font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums}
#gold{margin-top:5px;font-size:12.5px;color:var(--exp);font-variant-numeric:tabular-nums}
#party{color:var(--jexp);margin-top:2px}#quest{color:#e8d7a6;margin-top:2px}
#partyBox{position:fixed;left:max(10px,env(safe-area-inset-left));top:calc(max(10px,env(safe-area-inset-top)) + 200px);width:230px;padding:6px 8px;font-size:12px;z-index:2;box-sizing:border-box}
.phd{display:flex;align-items:center;gap:4px;margin-bottom:4px}.phd .pt{flex:1;color:var(--jexp);font-weight:800}
.pmr{display:grid;grid-template-columns:1fr 54px auto auto auto;gap:6px;align-items:center;padding:2px 0}
.pn{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pz{color:var(--muted);font-size:11px}
.ph{display:block;height:6px;border:1px solid #000;border-radius:3px;background:linear-gradient(90deg,#62bf86 var(--hp,100%),#0b0e13 var(--hp,100%))}
#invite{position:fixed;top:calc(max(10px,env(safe-area-inset-top)) + 44px);left:50%;transform:translateX(-50%);z-index:6;padding:8px 12px;display:flex;gap:8px;align-items:center;flex-wrap:wrap;justify-content:center;width:max-content;max-width:calc(100vw - 24px)}
#invite b,#tradeAsk b{color:var(--exp)}
#tradeAsk{position:fixed;top:calc(max(10px,env(safe-area-inset-top)) + 92px);left:50%;transform:translateX(-50%);z-index:6;padding:8px 12px;display:flex;gap:8px;align-items:center;flex-wrap:wrap;justify-content:center;width:max-content;max-width:calc(100vw - 24px)}
.tgrid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.tcol{min-width:0}.tcol h3{margin-top:6px}
.tgold{margin-top:4px;color:var(--exp);font-weight:700}
.trow{display:flex;align-items:center;gap:8px;margin:8px 0}.trow input,.tq,.tp{width:72px;padding:4px 6px;background:#0b0e13;border:1px solid var(--edge-dim);border-radius:4px;color:var(--ink);font:inherit;font-size:13px}
.trow #vTitle{width:200px}.tq{width:52px}
.tbtns{display:flex;gap:8px;justify-content:flex-end;align-items:center;margin-top:10px;flex-wrap:wrap}
@media (max-width:420px){.tgrid{grid-template-columns:1fr}}
#logTabs{position:sticky;top:-6px;display:flex;gap:4px;padding:2px 0 4px;background:rgba(10,13,18,.95);z-index:1}
#logTabs .btn{padding:0 8px;font-size:11px}#logTabs .btn.on{border-color:var(--exp);color:var(--exp)}
#log.f-party>div:not(#logTabs):not(.l-party){display:none}#log.f-whisper>div:not(#logTabs):not(.l-whisper){display:none}
.l-party{color:#8fe0a8}.l-whisper{color:#f2a6d8}.l-party b,.l-whisper b{color:inherit}
.who .wb{display:flex;gap:4px;margin-top:4px;flex-wrap:wrap}.who.party b{color:#8fe0a8}
@media (max-width:760px){#partyBox{top:calc(max(10px,env(safe-area-inset-top)) + 150px);width:175px}}
.emgrid{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.emb{display:flex;flex-direction:column;align-items:center;gap:2px;padding:8px 2px;background:#10141b;border:1px solid var(--edge-dim);border-radius:6px;cursor:pointer;color:var(--ink);font-size:11.5px}
.emb:hover,.emb:focus-visible{border-color:var(--exp)}.emb img{width:32px;height:32px}
/* minimap */
#minibox{position:fixed;top:max(10px,env(safe-area-inset-top));right:max(10px,env(safe-area-inset-right));padding:6px;text-align:center}
#minibox .zn{font-family:var(--display);font-size:16px;color:var(--exp);margin-bottom:4px}
#minibox .zl{font-size:11px;color:var(--muted);margin-top:3px}
#mini{display:block;width:150px;height:auto;border:1px solid #000;image-rendering:pixelated}
#menu{display:flex;gap:4px;justify-content:center;margin-top:6px}
#menu .btn{padding:2px 7px;font-size:12px}
/* target */
#onlineBadge{position:fixed;top:max(10px,env(safe-area-inset-top));left:50%;transform:translateX(-50%);z-index:4;padding:5px 14px;border-radius:999px;border:1px solid var(--jexp);background:var(--panel);color:var(--jexp);font-weight:800;font-size:13px;cursor:pointer;box-shadow:0 3px 12px rgba(0,0,0,.5);white-space:nowrap}
#onlineBadge.off{border-color:var(--edge-dim);color:var(--muted)}
#whoList{position:fixed;top:calc(max(10px,env(safe-area-inset-top)) + 38px);left:50%;transform:translateX(-50%);z-index:4;width:min(280px,calc(100vw - 24px));max-height:50vh;overflow-y:auto;padding:6px 10px}
.who{display:flex;flex-direction:column;padding:5px 0;border-bottom:1px solid rgba(184,146,79,.14)}.who:last-child{border-bottom:0}
.who b{color:#9fd3ff}.who.me b{color:var(--exp)}.who span{font-size:11.5px;color:var(--muted)}
#target{position:fixed;top:calc(max(10px,env(safe-area-inset-top)) + 40px);left:50%;transform:translateX(-50%);width:220px;padding:6px 10px;text-align:center;pointer-events:none}
#tInfo{pointer-events:auto;margin-top:4px}
#ailT{color:#ff9a8a;font-weight:700}#ailT:empty{display:none}
.ttier{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px}
.tarrow{text-align:center;color:var(--edge-dim);font-size:12px;margin:4px 0}
.snode{display:flex;flex-direction:column;gap:4px;padding:8px;border:1px solid var(--edge-dim);border-radius:6px;background:#10141b}
.snode.has{border-color:var(--edge)}.snode.locked{opacity:.55}.snode .snh{display:flex;gap:6px;align-items:center}
.snode .nm{font-weight:800}.slv{font-size:11px;color:var(--muted)}.snode .ds{font-size:11.5px;color:var(--muted);line-height:1.3}
.sreq{font-size:11px;color:var(--warn)}.snode .btn{align-self:flex-start}
#weight{margin-top:2px}#weight.heavy{color:var(--warn);font-weight:700}
#zoneBanner{position:fixed;left:50%;top:20%;transform:translateX(-50%);text-align:center;pointer-events:none;z-index:3;opacity:0;white-space:nowrap}
#zoneBanner.show{animation:zoneb 3.2s ease forwards}
#zoneBanner b{display:block;font-family:var(--display);font-weight:700;font-size:clamp(30px,7vw,48px);color:var(--exp);text-shadow:0 2px 0 #3a2a10,0 0 26px rgba(0,0,0,.7)}
#zoneBanner span{font-size:14px;letter-spacing:.12em;color:var(--ink);text-shadow:0 1px 3px #000}
@keyframes zoneb{0%{opacity:0;transform:translate(-50%,10px)}12%{opacity:1;transform:translate(-50%,0)}75%{opacity:1}100%{opacity:0}}
@media (prefers-reduced-motion:reduce){#zoneBanner.show{animation:none;opacity:1}}
#target .td{font-size:11px;color:#e8d7a6;margin-top:3px;line-height:1.3}
#target .tn{font-weight:800}#target .tl{color:var(--muted);font-size:11px}
/* log */
#log{position:fixed;left:max(10px,env(safe-area-inset-left));bottom:max(10px,env(safe-area-inset-bottom));width:min(340px,calc(100vw - 20px));max-height:120px;overflow-y:auto;padding:6px 8px;font-size:12.5px;line-height:1.35;background:rgba(10,13,18,.72);border-radius:5px;border:1px solid rgba(184,146,79,.25)}
#log div{text-shadow:0 1px 1px #000}
.l-sys{color:var(--muted)}.l-loot{color:#e8d7a6}.l-rare{color:#ffcf5a;font-weight:800}.l-lvl{color:var(--exp);font-weight:800}.l-bad{color:#ef7a6f}.l-good{color:var(--good)}
/* hotbar */
#hotbar{position:fixed;left:50%;transform:translateX(-50%);bottom:max(10px,env(safe-area-inset-bottom));display:flex;gap:4px;padding:5px}
.slot{position:relative;width:46px;height:46px;border:1px solid var(--edge-dim);border-radius:5px;background:#10141b;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;overflow:hidden}
.slot .ic{width:30px;height:30px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:13px;color:#10141b}
.slot .k{position:absolute;left:3px;top:1px;font-size:10px;color:var(--muted)}
.slot .n{position:absolute;right:3px;bottom:1px;font-size:10.5px;font-weight:800;text-shadow:0 1px 1px #000;font-variant-numeric:tabular-nums}
.slot .cd{position:absolute;inset:auto 0 0 0;background:rgba(0,0,0,.65)}
.slot.off{opacity:.35}
@media (max-width:760px){
  #log{bottom:calc(max(10px,env(safe-area-inset-bottom)) + 62px);max-height:74px;font-size:11.5px}
  #hud{width:175px;padding:6px 8px}#hud .name{font-size:17px}
  #mini{width:110px;height:auto}
  #target{top:calc(max(10px,env(safe-area-inset-top)) + 192px);width:190px}
  #onlineBadge{top:calc(max(10px,env(safe-area-inset-top)) + 150px);font-size:12px;padding:4px 12px}
  #whoList{top:calc(max(10px,env(safe-area-inset-top)) + 182px)}
  .slot{width:38px;height:40px}.slot .ic{width:24px;height:24px;font-size:11px}
}
/* panel */
#panel{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);width:min(400px,calc(100vw - 24px));max-height:min(78vh,620px);overflow-y:auto;padding:14px 16px 16px;z-index:5}
#panel h2{font-family:var(--display);font-weight:700;font-size:26px;margin:0 0 2px;color:var(--exp);text-wrap:balance}
#panel h3{font-family:var(--display);font-weight:500;font-size:18px;margin:14px 0 6px;color:var(--edge);letter-spacing:.02em}
#panel .sub{color:var(--muted);margin-bottom:8px}
#panel .x{position:absolute;right:10px;top:10px}
.row{display:flex;align-items:center;gap:8px;padding:5px 0;border-bottom:1px solid rgba(184,146,79,.14)}
.row .grow{flex:1;min-width:0}
.row .nm{font-weight:700}.row .ds{color:var(--muted);font-size:12px}
.st{display:grid;grid-template-columns:44px 1fr 46px 44px;align-items:center;gap:6px;padding:3px 0;font-variant-numeric:tabular-nums}
.st b{color:var(--exp);letter-spacing:.05em}
.dv{display:grid;grid-template-columns:1fr 1fr;gap:2px 16px;font-variant-numeric:tabular-nums}
.dv div{display:flex;justify-content:space-between}
.dv span:first-child{color:var(--muted)}
.ico{width:26px;height:26px;border-radius:50%;flex:none;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:12px;color:#10141b}
.tabs{display:flex;gap:6px;margin:6px 0 8px}
.tabs .btn.on{border-color:var(--exp);color:var(--exp)}
.eqgrid{display:grid;grid-template-columns:1fr 120px 1fr;gap:8px;align-items:center;margin:8px 0 10px}
#eqCv{width:120px;height:150px;border-radius:8px;background:radial-gradient(circle at 50% 60%,#3c4a5e,#1a2230);border:1px solid var(--edge-dim)}
.eqcol{display:flex;flex-direction:column;gap:8px;min-width:0}
.eqslot{display:flex;flex-direction:column;align-items:flex-start;gap:4px;padding:6px;border:1px solid var(--edge-dim);border-radius:6px;background:#10141b;min-width:0}
.eqslot .grow{min-width:0;width:100%}.eqslot .nm{font-weight:700;font-size:12.5px;overflow-wrap:anywhere}.eqslot .ds{font-size:11px;color:var(--muted)}
.eqk{font-size:10.5px;text-transform:uppercase;letter-spacing:.08em;color:var(--edge)}
@media (max-width:420px){.eqgrid{grid-template-columns:1fr 1fr}#eqCv{grid-column:1/-1;grid-row:1;justify-self:center}}
.choice{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}
.choice button{text-align:left;padding:10px;border-radius:5px;border:1px solid var(--edge-dim);background:#10141b;cursor:pointer}
.choice button:hover{border-color:var(--edge)}
.choice b{display:block;font-family:var(--display);font-size:19px;font-weight:500}
.choice small{color:var(--muted);font-size:12px;line-height:1.3;display:block;margin-top:2px}
.say{font-style:italic;color:#ddd2b8;line-height:1.45;margin:6px 0 10px}
.muted{color:var(--muted)}
.gold{color:var(--exp)}
/* overlays */
.overlay{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:radial-gradient(ellipse at center,rgba(14,18,24,.55),rgba(5,7,10,.92));z-index:10;padding:16px}
#acIn{display:flex;flex-wrap:wrap;gap:6px}
#acOut{display:flex;align-items:center;gap:6px;flex-wrap:wrap}#acOut b{color:var(--exp)}
.acNote{color:var(--muted);margin-top:6px;line-height:1.35}.acMsg{margin-top:4px;min-height:1em;color:var(--warn)}.acMsg.ok{color:var(--good)}
#acImport{margin-top:6px}
.lk{flex:1;min-width:0;display:flex;flex-direction:column;gap:6px}
.lkrow{display:flex;align-items:center;gap:6px;font-size:12px}.lkrow>span{width:38px;color:var(--muted);flex:none}
.lkrow b{min-width:66px;text-align:center;font-size:13px}
.sw{display:flex;flex-wrap:wrap;gap:4px}.sw button{width:18px;height:18px;border-radius:50%;border:1px solid #000;padding:0;cursor:pointer}
.sw button.on{outline:2px solid var(--exp);outline-offset:1px}
#lkRand{align-self:flex-start}
#death .card{padding:22px 26px;text-align:center}
#death h2{font-family:var(--display);font-size:38px;margin:0 0 6px;color:var(--hp)}
#confirm .card{padding:18px 22px;text-align:center;max-width:320px}
/* phone-friendly action buttons + chat */
#actions{position:fixed;right:max(10px,env(safe-area-inset-right));bottom:calc(max(10px,env(safe-area-inset-bottom)) + 70px);display:flex;flex-direction:column;gap:8px;align-items:center}
.act{width:48px;height:48px;border-radius:50%;border:1px solid var(--edge);background:radial-gradient(circle at 35% 30%,#4a3b24,#1a150e);color:var(--ink);font-weight:800;font-size:12px;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 3px 10px rgba(0,0,0,.5);padding:0}
.act.big{width:66px;height:66px;font-size:13px;border:2px solid var(--hp);background:radial-gradient(circle at 35% 30%,#6a2a22,#22100c)}
.act.small{width:38px;height:38px;font-size:15px}
.act.on{border-color:var(--exp);color:var(--exp)}
.act:focus-visible{outline:2px solid var(--exp);outline-offset:2px}
#chatbar{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(max(10px,env(safe-area-inset-bottom)) + 66px);width:min(460px,calc(100vw - 24px));display:flex;gap:6px;padding:6px;z-index:6;box-sizing:border-box}
#chatbar input{flex:1;min-width:0;padding:8px 10px;background:#0b0e13;border:1px solid var(--edge-dim);border-radius:4px;color:var(--ink);font:inherit;font-size:16px}
#online{font-size:11px;color:var(--jexp);margin-top:3px}
.l-chat{color:#f3ead6}.l-chat b{color:#9fd3ff}.l-chat.me b{color:var(--exp)}.l-chat i{color:var(--muted);font-style:normal;font-size:11px}
@media (max-width:760px){
  #log{width:calc(100vw - 96px)}
  #actions{bottom:calc(max(10px,env(safe-area-inset-bottom)) + 60px);gap:6px}
  .act{width:44px;height:44px}.act.big{width:60px;height:60px}
}
@media (prefers-reduced-motion:reduce){.bar i{transition:none}}
.srow{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.snode .srow .btn{align-self:auto}
.hotpick{display:flex;gap:3px;margin-left:auto}.hotpick .hk{min-width:24px;height:24px;padding:0;border:1px solid var(--edge-dim);border-radius:4px;background:#1a2029;color:var(--muted);font:700 11px inherit;cursor:pointer}
.hotpick .hk.on{border-color:var(--edge);background:#3a3020;color:#ffcf5a}
.castlv{display:flex;align-items:center;gap:6px;margin-top:5px;font-size:11.5px;color:var(--muted)}.castlv .hk{min-width:24px;height:22px;padding:0;border:1px solid var(--edge-dim);border-radius:4px;background:#1a2029;color:var(--muted);font:700 12px inherit;cursor:pointer}.castlv .hk:disabled{opacity:.35;cursor:default}.castlv .low{color:#ffcf5a}
#qtrack{color:#ffe7a0;margin-top:3px;white-space:pre-line;line-height:1.3;border-top:1px solid var(--edge-dim);padding-top:3px}
.say.talk{font-size:15px;min-height:3.2em}
.tlist{display:flex;flex-direction:column;align-items:stretch;gap:4px;margin:8px 0;width:100%}
.tq{display:flex;width:100%;box-sizing:border-box;gap:8px;align-items:center;justify-content:flex-start;text-align:left;padding:7px 10px;border:1px solid var(--edge-dim);border-radius:6px;background:#10141b;color:inherit;font:inherit;cursor:pointer}
.tq:hover,.tq:focus-visible{border-color:var(--edge)}
.tq b{display:inline-grid;place-items:center;width:20px;height:20px;border-radius:50%;background:#ffcf5a;color:#2a2018;font-weight:800;flex:none}
.tq.busy b{background:#9aa3b2}
.tbtns{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
.qbox{padding:8px 10px;border:1px solid var(--edge-dim);border-radius:6px;background:#10141b;margin-top:6px;display:flex;flex-direction:column;gap:6px}
.qrew{color:#e8d7a6}
.qrow{align-items:flex-start}.qbtns{display:flex;flex-direction:column;gap:4px}
.thead{display:flex;align-items:center;gap:10px}.thead h2{margin:0}#talkCv{width:56px;height:56px;border:1px solid var(--edge);border-radius:50%;background:radial-gradient(#2a3140,#10141b);flex:none}
#wbT{color:#ff9a7a;margin-top:3px;font-weight:700}
#log.f-guild>div:not(#logTabs):not(.l-guild){display:none}.l-guild{color:#e8c25a}.l-guild b{color:inherit}
#ginvite{position:fixed;left:50%;top:calc(max(10px,env(safe-area-inset-top)) + 110px);transform:translateX(-50%);display:flex;align-items:center;gap:8px;padding:8px 10px;z-index:5;max-width:calc(100vw - 32px);box-sizing:border-box}
#ginvite canvas{width:28px;height:28px;flex:none}
.gform{display:flex;gap:12px;align-items:flex-start;margin:8px 0}.gform input,.grow2 input{width:100%;box-sizing:border-box;padding:6px 8px;border-radius:6px;border:1px solid var(--edge-dim);background:#10141b;color:inherit;font:inherit}
#embCv{width:64px;height:64px;flex:none}.thead #embCv{width:56px;height:56px;border:0;border-radius:0;background:none}
.epick{display:flex;flex-direction:column;gap:4px;margin:8px 0}.erow{display:flex;flex-wrap:wrap;gap:4px}
.esw{width:24px;height:24px;border-radius:5px;border:2px solid #1a120a;cursor:pointer;padding:0}.esw.on{outline:2px solid #ffcf5a;outline-offset:1px}
.gnote{min-height:auto}.grow2{display:flex;gap:6px;margin:6px 0}.grow2 input{flex:1}
.gm .gdot{width:9px;height:9px;border-radius:50%;background:#4a4f5a;flex:none}.gm.on .gdot{background:#62bf86}
#hudToggle{position:absolute;top:4px;right:4px;width:24px;height:24px;padding:0;border-radius:5px;border:1px solid var(--edge-dim);background:#1a2029;color:var(--exp);font:800 15px/1 inherit;cursor:pointer;pointer-events:auto}
#hudToggle:hover,#hudToggle:focus-visible{border-color:var(--edge)}
#hud .name{padding-right:26px}
#hud.mini>:not(.name):not(.hpb):not(.spb):not(#ailT):not(#buffs):not(#hudToggle){display:none}
#hud.mini .name{font-size:16px;margin-bottom:4px}
@media (max-width:760px){#minibox{max-width:176px;box-sizing:border-box}#menu{flex-wrap:wrap}#menu .btn{padding:2px 6px}}
@media (max-width:760px){#onlineBadge{top:calc(max(10px,env(safe-area-inset-top)) + 222px);left:auto;right:max(10px,env(safe-area-inset-right));transform:none}#whoList{top:calc(max(10px,env(safe-area-inset-top)) + 256px);left:auto;right:max(10px,env(safe-area-inset-right));transform:none}}
#tToggle{position:absolute;top:4px;right:4px;width:20px;height:20px;padding:0;border-radius:4px;border:1px solid var(--edge-dim);background:#1a2029;color:var(--exp);font:800 13px/1 inherit;cursor:pointer;pointer-events:auto}
#tToggle:hover,#tToggle:focus-visible{border-color:var(--edge)}
#target .tn{padding:0 18px}
#target.mini .tl,#target.mini .td,#target.mini #tInfo{display:none}
#target.mini{padding:4px 10px 6px}
#duelAsk{position:fixed;left:50%;top:calc(max(10px,env(safe-area-inset-top)) + 110px);transform:translateX(-50%);display:flex;align-items:center;gap:8px;padding:8px 10px;z-index:5;max-width:calc(100vw - 32px);box-sizing:border-box;border-color:#ff7a5a}

.ico.img{width:30px;height:30px;border-radius:6px;background:radial-gradient(#26303d,#141920);border:1px solid var(--edge-dim);padding:0;box-sizing:border-box}
.slot .ic.img{width:30px;height:30px;border-radius:5px;background:none;border:0}
.itabs{display:flex;gap:4px;margin:0 0 8px}
#pFold{width:20px;height:20px;padding:0;border-radius:4px;border:1px solid var(--edge-dim);background:#1a2029;color:var(--exp);font:800 13px/1 inherit;cursor:pointer;flex:none}
#partyBox .phd{display:flex;align-items:center;gap:6px}#partyBox .phd .pt{flex:1}
#partyBox.fold .pm,#partyBox.fold #pMode,#partyBox.fold #pLeave{display:none}
#partyBox.fold{width:auto;padding:4px 8px}
.pmr{font-size:11.5px}.pmr .btn.small{padding:1px 6px;font-size:11px}
.ico.img.sk{border:0;background:none;border-radius:50%;width:32px;height:32px}
/* #37 bigger minimap and world map */
#mini{cursor:zoom-in}#minibox.big #mini{width:260px;height:auto;cursor:zoom-out}
@media (max-width:700px){#minibox.big #mini{width:200px;height:auto}}
.wroad{display:flex;flex-direction:column;gap:0}
.wnode{display:flex;align-items:flex-start;gap:8px;padding:7px 8px;border:1px solid var(--edge-dim);border-radius:6px;background:#10141b}
.wnode.here{border-color:var(--exp);box-shadow:0 0 0 1px var(--exp) inset}
.wnode.unseen{opacity:.55}.wnode.unseen .wsw{filter:grayscale(1)}
.wnode .wsw{flex:none;width:14px;height:14px;border-radius:3px;margin-top:3px;border:1px solid #000}
.wnode .where{font-size:11px;color:var(--exp);font-weight:700;margin-left:4px}
.wnode .wmobs{font-size:11.5px}
.wnode .wppl{flex:none;font-size:12px;color:#9fd3ff;font-variant-numeric:tabular-nums}
.wlink{text-align:center;color:var(--muted);line-height:14px;font-size:12px}
.wbranch{margin:4px 0 0 22px;padding-left:10px;border-left:2px dashed var(--edge-dim);display:flex;flex-direction:column;gap:4px}
.wbranch .wbl{font-size:11.5px}
/* buff row: picture + countdown */
#buffs{display:flex;flex-wrap:wrap;gap:6px 5px;margin:5px 0 6px}#buffs[hidden]{display:none}
#buffs .buff{position:relative;width:30px;height:30px;border:1px solid var(--edge-dim);border-radius:5px;background:#10141b;display:flex;align-items:center;justify-content:center}
#buffs .buff.given{border-color:#8fe0a8}
#buffs .buff img{width:24px;height:24px;border-radius:4px}
#buffs .buff .bg{font-size:15px;color:#ffe7a0}
#buffs .buff b{position:absolute;right:-2px;bottom:-4px;font-size:9.5px;line-height:1;padding:1px 2px;border-radius:3px;background:rgba(0,0,0,.8);color:#fff;font-variant-numeric:tabular-nums}
#buffs .buff.ending{animation:buffBlink .5s steps(2) infinite}
@keyframes buffBlink{50%{opacity:.35}}
@media (prefers-reduced-motion:reduce){#buffs .buff.ending{animation:none;opacity:.6}}
/* #61 draggable windows (desktop) */
@media (min-width:701px) and (pointer:fine){#panel h2{cursor:move;user-select:none}}
#panel.dragging{opacity:.92;box-shadow:0 12px 32px rgba(0,0,0,.6)}

/* ===== start screen: clean modern dark ===== */
#title{--t-bg:#0c0f15;--t-panel:rgba(22,27,36,.86);--t-line:rgba(255,255,255,.08);--t-ink:#e9ecf2;--t-mute:#8b93a3;--t-acc:#f0b54a;--t-acc2:#ff7a45;
  background:radial-gradient(1200px 600px at 20% 30%,rgba(240,140,60,.10),transparent 60%),radial-gradient(900px 600px at 85% 80%,rgba(90,110,220,.10),transparent 60%),var(--t-bg);
  font-family:Inter,var(--ui);color:var(--t-ink);align-items:stretch;justify-content:center;overflow-y:auto;padding:0}
#title .t-shell{width:min(1040px,100%);margin:auto;padding:28px 28px 32px;box-sizing:border-box;display:flex;flex-direction:column;gap:22px}
#title .t-top{display:flex;align-items:center;justify-content:space-between}
#title .t-brand{display:flex;align-items:center;gap:12px}
#title .t-mark{width:30px;height:30px;border-radius:9px;background:conic-gradient(from 200deg,var(--t-acc),var(--t-acc2),#c2410c,var(--t-acc));box-shadow:0 0 24px rgba(255,140,60,.45)}
#title h1{margin:0;font-family:Inter,var(--ui);font-weight:800;font-size:22px;letter-spacing:.32em;text-transform:uppercase;color:var(--t-ink)}
#title .ver{font-size:12px;color:var(--t-mute);font-variant-numeric:tabular-nums}
#title .t-main{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.05fr);gap:22px;align-items:stretch}
#title .t-stage,#title .t-panel{background:var(--t-panel);border:1px solid var(--t-line);border-radius:18px;box-shadow:0 20px 60px rgba(0,0,0,.45);backdrop-filter:blur(8px)}
#title .t-stage{position:relative;overflow:hidden;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:28px 24px 22px;gap:16px;min-height:440px}
#title .t-glow{position:absolute;inset:auto 15% 30% 15%;height:55%;border-radius:50%;background:radial-gradient(closest-side,rgba(255,170,80,.22),transparent);filter:blur(6px)}
#lookCv{position:relative;width:min(260px,70%);height:auto;aspect-ratio:1;border-radius:50%;background:radial-gradient(circle at 50% 62%,#3d5a33 0%,#22311f 58%,transparent 72%);image-rendering:auto}
#title .t-name{position:relative;display:flex;flex-direction:column;gap:6px;width:min(300px,100%)}
#title .t-name span,#title .t-sec h2,#title .lkrow>span{font-size:11px;font-weight:600;letter-spacing:.14em;text-transform:uppercase;color:var(--t-mute)}
#title input{width:100%;box-sizing:border-box;padding:11px 14px;font:500 15px Inter,var(--ui);background:rgba(8,10,14,.7);border:1px solid var(--t-line);color:var(--t-ink);border-radius:10px;outline:none;transition:border-color .15s,box-shadow .15s}
#title input:focus{border-color:rgba(240,181,74,.7);box-shadow:0 0 0 3px rgba(240,181,74,.18)}
#title #nameIn{text-align:center;font-size:17px;font-weight:600}
#title .tag{position:relative;margin:0;max-width:340px;text-align:center;font-size:13px;line-height:1.55;color:var(--t-mute)}
#title .t-panel{padding:22px;display:flex;flex-direction:column;gap:18px}
#title .t-sec{display:flex;flex-direction:column;gap:10px;padding-bottom:18px;border-bottom:1px solid var(--t-line)}
#title .t-sec h2{margin:0}
#acct{font-size:13px;color:var(--t-mute)}
#title #acIn{display:grid;grid-template-columns:1fr 1fr;gap:8px}
#title #acIn .t-row{grid-column:1/-1;display:flex;gap:8px}
#title #acIn .t-row .btn{flex:1}
#acOut{display:flex;align-items:center;gap:10px;color:var(--t-ink)}
#title .acNote{font-size:12px;line-height:1.5;color:var(--t-mute)}
#title .lk{display:flex;flex-direction:column;gap:10px}
#title .lkrow{display:grid;grid-template-columns:64px 1fr;align-items:center;gap:10px}
#title .t-step{display:flex;align-items:center;gap:8px}#title .t-step b{min-width:80px;text-align:center;font-weight:600;font-size:14px}
#title .sw{gap:7px}#title .sw button{width:22px;height:22px;border:2px solid rgba(255,255,255,.12);transition:transform .12s}
#title .sw button:hover{transform:scale(1.12)}#title .sw button.on{outline:2px solid var(--t-acc);outline-offset:2px}
#title #lkRand{align-self:flex-start}
#title .btn{font-family:Inter,var(--ui);font-weight:600;font-size:14px;border-radius:10px;padding:9px 16px;background:rgba(255,255,255,.06);border:1px solid var(--t-line);color:var(--t-ink);box-shadow:none;text-shadow:none;transition:background .15s,border-color .15s,transform .1s}
#title .btn:hover:not(:disabled){background:rgba(255,255,255,.11);border-color:rgba(255,255,255,.18)}
#title .btn:active:not(:disabled){transform:translateY(1px)}
#title .btn.ghost{background:transparent}
#title .btn.primary{background:linear-gradient(135deg,var(--t-acc),var(--t-acc2));border:0;color:#1a1007;font-weight:800;font-size:16px;padding:13px 18px;box-shadow:0 8px 24px rgba(255,122,69,.28)}
#title .btn.primary:hover:not(:disabled){filter:brightness(1.07);background:linear-gradient(135deg,var(--t-acc),var(--t-acc2))}
#title .btns{display:flex;flex-direction:column;gap:10px}
#title .btns .btn{width:100%}
#title .keys{font-size:12.5px;color:var(--t-mute);line-height:1.7}
#title .keys summary{cursor:pointer;font-weight:600;color:var(--t-ink);list-style:none}
#title .keys summary::before{content:'▸ ';color:var(--t-mute)}#title .keys[open] summary::before{content:'▾ '}
#title .keys div{margin-top:8px}#title .keys b{color:var(--t-ink);font-weight:600}
#title .acMsg:empty{display:none}
#title .slots{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
#title .slotc{display:flex;flex-direction:column;align-items:flex-start;gap:3px;min-width:0;padding:10px 12px;border-radius:12px;cursor:pointer;text-align:left;font:inherit;
  background:rgba(255,255,255,.04);border:1px solid var(--t-line);color:var(--t-ink);transition:border-color .12s,background .12s}
#title .slotc:hover{background:rgba(255,255,255,.08)}
#title .slotc b{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:700;font-size:14px}
#title .slotc span{font-size:11.5px;color:var(--t-mute);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
#title .slotc.empty{border-style:dashed}#title .slotc.empty b{color:var(--t-mute);font-weight:600}
#title .slotc.on{border-color:var(--t-acc);background:rgba(240,181,74,.1);box-shadow:0 0 0 2px rgba(240,181,74,.18)}
#title [hidden]{display:none!important}
@media (max-width:760px){
  #title .t-shell{padding:16px 16px 24px;gap:14px}
  #title .t-main{grid-template-columns:1fr}
  #title .t-stage{min-height:0;padding:20px 16px 18px;gap:12px}
  #lookCv{width:min(180px,55%)}
  #title .t-panel{padding:16px}
  #title h1{font-size:18px}
  /* keep the play button in reach on a phone */
  #title .btns{position:sticky;bottom:0;z-index:2;margin:0 -16px -16px;padding:12px 16px 16px;background:linear-gradient(rgba(22,27,36,0),rgba(22,27,36,.96) 30%);border-radius:0 0 18px 18px}
}
#title [hidden]{display:none!important}

/* ===== game screen: clean modern dark (matches the start screen) ===== */
:root{--panel:rgba(14,18,26,.84);--panel-solid:#121722;--edge:rgba(255,255,255,.16);--edge-dim:rgba(255,255,255,.09);
  --display:Inter,"Alegreya Sans",system-ui,sans-serif;--accent:#f0b54a;--accent2:#ff7a45}
.frame{border:1px solid var(--edge-dim);border-radius:12px;box-shadow:0 10px 28px rgba(0,0,0,.42)}
.btn{background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.12);border-radius:8px;font-family:Inter,var(--ui);font-weight:600;letter-spacing:.01em;transition:background .12s,border-color .12s}
.btn:hover{background:rgba(255,255,255,.12);border-color:rgba(255,255,255,.2)}
.btn.small{padding:2px 8px}
.btn.on,#logTabs .btn.on{border-color:rgba(240,181,74,.75);color:var(--accent);background:rgba(240,181,74,.1)}
/* status box */
#hud{padding:10px 12px;border-radius:14px}
#hud .name{font-weight:800;font-size:17px;letter-spacing:.01em;color:var(--ink)}
#hud .cls{font-size:11.5px;letter-spacing:.06em;text-transform:uppercase}
.bar{height:12px;background:rgba(255,255,255,.06);border:0;border-radius:6px}
.bar span{line-height:12px;font-family:Inter,var(--ui);font-weight:600;font-size:10px}
.bar.thin{height:5px;border-radius:3px}
.hpb i{background:linear-gradient(90deg,#c9433b,#ef6a5f)}.spb i{background:linear-gradient(90deg,#3d7ccc,#72aaf0)}
.exb i{background:linear-gradient(90deg,#d9a336,#f0c95e)}.jxb i{background:linear-gradient(90deg,#4aa26f,#7fd6a0)}
#hudToggle,#tToggle,#pFold{border-radius:8px!important;border:1px solid rgba(255,255,255,.12)!important;background:rgba(255,255,255,.05)!important}
/* minimap: just the map, the region and who is online */
#minibox{padding:10px;border-radius:14px}
#minibox .zn{font-weight:700;font-size:14px;color:var(--ink);letter-spacing:.02em}
#mini{border-radius:8px;border:1px solid rgba(255,255,255,.1)}
#onlineBadge{background:rgba(14,18,26,.84);font-family:Inter,var(--ui);font-weight:600;font-size:12.5px}
#zoneBanner b{font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:#fff;text-shadow:0 2px 18px rgba(0,0,0,.75)}
#zoneBanner span{letter-spacing:.12em;text-transform:uppercase}
/* chat log */
#log{background:rgba(12,15,22,.62);border:1px solid rgba(255,255,255,.07);border-radius:12px;padding:8px 10px}
#logTabs{background:transparent}
/* hotbar */
#hotbar{border-radius:14px;padding:6px;gap:5px}
.slot{border-radius:10px;background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.09)}
.slot:hover{border-color:rgba(240,181,74,.6)}
/* the dock: every window one click away, bottom right */
#dock{position:fixed;right:max(10px,env(safe-area-inset-right));bottom:max(10px,env(safe-area-inset-bottom));z-index:3;padding:6px;border-radius:14px;display:flex;gap:6px;align-items:stretch}
#menu{display:grid;grid-template-columns:repeat(5,40px);gap:5px}
.dk{position:relative;width:40px;height:40px;border-radius:10px;border:1px solid rgba(255,255,255,.08);background:rgba(255,255,255,.04);color:var(--ink);cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0;transition:background .12s,border-color .12s}
.dk:hover{background:rgba(240,181,74,.12);border-color:rgba(240,181,74,.55)}
.dk i{font-style:normal;font-size:16px;line-height:1}
.dk span{display:none}
.dk:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
#dockExtra{display:flex;flex-direction:column;gap:5px;padding-left:6px;border-left:1px solid rgba(255,255,255,.08)}
#dockExtra:empty{display:none}
#dockExtra .act{width:40px;height:40px;border-radius:10px;font-size:11px;border:1px solid rgba(255,255,255,.1);background:rgba(255,255,255,.04)}
#dockExtra .act.small{font-size:15px}
#dockExtra .act.on{border-color:rgba(240,181,74,.7);color:var(--accent);background:rgba(240,181,74,.1)}
.only-touch{display:none!important}
/* round touch buttons: phones only */
body:not(.touchui) #actions{display:none}
#menuBtn{display:none}
.act{background:rgba(14,18,26,.82);border:1px solid rgba(255,255,255,.16);font-family:Inter,var(--ui);font-weight:700;box-shadow:0 6px 18px rgba(0,0,0,.4)}
.act.big{background:radial-gradient(circle at 35% 30%,#d4564a,#8e2620);border:0;color:#fff;box-shadow:0 8px 22px rgba(201,67,59,.45)}
.act.on{border-color:rgba(240,181,74,.75);color:var(--accent)}
/* phone layout */
body.touchui #menuBtn{display:flex;align-items:center;justify-content:center}
body.touchui #emoteBtn,body.touchui #muteBtn{display:none}
body.touchui .only-touch{display:flex!important}
body.touchui #dock{display:none;right:max(10px,env(safe-area-inset-right));left:max(10px,env(safe-area-inset-left));bottom:calc(max(10px,env(safe-area-inset-bottom)) + 62px);z-index:7;padding:12px;justify-content:center}
body.touchui #dock.open{display:flex;animation:dockIn .14s ease-out}
body.touchui #menu{grid-template-columns:repeat(5,1fr);gap:8px;width:100%}
body.touchui .dk{width:auto;height:58px;gap:4px}
body.touchui .dk span{display:block;font-size:10.5px;color:var(--muted);font-family:Inter,var(--ui);font-weight:500}
body.touchui .dk i{font-size:18px}
@keyframes dockIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){body.touchui #dock.open{animation:none}}
@media (max-width:760px){
  #minibox{padding:7px;max-width:none}
  #minibox .zn{font-size:12.5px}
  #onlineBadge{top:calc(max(10px,env(safe-area-inset-top)) + 128px)}
  #whoList{top:calc(max(10px,env(safe-area-inset-top)) + 160px)}
  #target{top:calc(max(10px,env(safe-area-inset-top)) + 166px)}
  #hud{padding:8px 10px}
}
/* dock labels when there is room; an upright dock on narrower desktop windows so it never meets the hotbar */
@media (min-width:1180px){body:not(.touchui) #menu{grid-template-columns:repeat(5,52px)}body:not(.touchui) .dk{width:52px;height:46px;gap:3px}
  body:not(.touchui) .dk span{display:block;font-size:9.5px;color:var(--muted);font-family:Inter,var(--ui);font-weight:500}body:not(.touchui) .dk i{font-size:14px}
  body:not(.touchui) #dockExtra .act{height:46px}}
@media (max-width:1040px){body:not(.touchui) #menu{grid-template-columns:repeat(2,40px)}body:not(.touchui) #dock{flex-direction:column}
  body:not(.touchui) #dockExtra{flex-direction:row;padding:6px 0 0;border-left:0;border-top:1px solid rgba(255,255,255,.08)}}
#title .ver{max-width:55%;text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media (max-width:760px){#minibox #online{display:none}#onlineBadge{top:calc(max(10px,env(safe-area-inset-top)) + 148px)}#whoList{top:calc(max(10px,env(safe-area-inset-top)) + 180px)}#target{top:calc(max(10px,env(safe-area-inset-top)) + 184px)}}
body.touchui #dock{background:rgba(14,18,26,.97)}
@media (max-width:1040px){body:not(.touchui) #log{width:min(270px,calc(50vw - 245px))}}
#panel{background:rgba(14,18,26,.96)}
#evT{color:var(--accent,#f0b54a);font-weight:600;font-size:11px;margin-top:3px;max-width:200px;margin-inline:auto}
/* ===== Stage 7: settings window ===== */
.setlist{display:flex;flex-direction:column;gap:2px}
.setrow{display:flex;align-items:center;gap:10px;padding:8px 0;border-bottom:1px solid rgba(255,255,255,.06)}
.setrow .ds{font-size:11.5px;color:var(--muted)}
.setrow input[type=range]{width:110px;accent-color:var(--accent,#f0b54a)}
.setrow input[type=range]:disabled{opacity:.35}
.setrow .val{width:36px;text-align:right;font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
.tgl{position:relative;width:40px;height:22px;flex:none;border-radius:11px;border:1px solid rgba(255,255,255,.16);background:rgba(255,255,255,.08);cursor:pointer;padding:0;transition:background .15s}
.tgl i{position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:#cfd5e0;transition:transform .15s}
.tgl.on{background:linear-gradient(135deg,#f0b54a,#ff7a45);border-color:transparent}.tgl.on i{transform:translateX(18px);background:#fff}
.tgl:focus-visible,.seg button:focus-visible{outline:2px solid var(--accent,#f0b54a);outline-offset:2px}
.seg{display:flex;border:1px solid rgba(255,255,255,.14);border-radius:9px;overflow:hidden;flex:none}
.seg button{border:0;background:transparent;color:var(--muted);padding:5px 10px;font:600 12px Inter,var(--ui);cursor:pointer}
.seg button+button{border-left:1px solid rgba(255,255,255,.1)}
.seg button.on{background:rgba(240,181,74,.16);color:var(--accent,#f0b54a)}
.keylist{grid-template-columns:1fr}
@media (prefers-reduced-motion:reduce){.tgl,.tgl i{transition:none}}
/* interface size */
body.ui-s :is(#hud,#minibox,#hotbar,#dock,#log,#actions,#partyBox,#target,#onlineBadge){zoom:.88}
body.ui-l :is(#hud,#minibox,#hotbar,#dock,#log,#actions,#partyBox,#target,#onlineBadge){zoom:1.15}
body.ui-l #panel{zoom:1.1}
.setrow .grow{flex:1;min-width:0}.keylist span:first-child{color:var(--ink);font-weight:600}.keylist span:last-child{color:var(--muted)}

/* ===== Stage 7: reports and admin ===== */
.rptreasons{display:flex;flex-wrap:wrap;gap:6px}
.rptreasons .btn.on{background:rgba(240,181,74,.16);color:var(--accent,#f0b54a);border-color:rgba(240,181,74,.5)}
.modcard{border:1px solid rgba(255,255,255,.08);border-radius:10px;padding:10px 12px;margin:8px 0;background:rgba(255,255,255,.02)}
.modcard .mhead{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}.modcard .mt{margin-left:auto;font-size:11.5px}
.modcard .mnote{margin:6px 0;font-style:italic}
.modcard .mchat{margin:6px 0;padding:6px 8px;border-radius:6px;background:#0c1016;font-size:12px;max-height:150px;overflow:auto}
.modcard .mchat .muted{display:inline-block;width:52px;font-size:11px}
.pill{display:inline-block;padding:1px 7px;border-radius:9px;font-size:11px;font-weight:600;background:rgba(240,181,74,.16);color:var(--accent,#f0b54a)}
.pill.bad{background:rgba(255,99,99,.16);color:#ff8a8a}
.btn.bad{background:#a8322d;border-color:#d0463f;color:#fff}
#adminBtn{position:relative}#adminBtn .badge{position:absolute;top:2px;right:6px;min-width:16px;height:16px;border-radius:8px;background:#e5484d;color:#fff;font:700 10px/16px Inter,var(--ui);font-style:normal;text-align:center;padding:0 3px}
#modNotice{position:fixed;inset:0;z-index:200;display:grid;place-items:center;background:rgba(5,7,10,.78)}
#modNotice[hidden]{display:none}
#modNotice .card{padding:22px 26px;text-align:center;max-width:340px}

/* ===== Stage 6: arena ===== */
.arstats{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:10px 0}
.arstats div{background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.08);border-radius:10px;padding:8px;text-align:center}
.arstats b{display:block;font-size:20px;font-variant-numeric:tabular-nums}.arstats span{font-size:11px;color:var(--muted)}
.arbox{margin:8px 0;padding:8px 10px;border-radius:8px;background:rgba(240,181,74,.1);border:1px solid rgba(240,181,74,.3);display:flex;gap:8px;align-items:center;justify-content:space-between;flex-wrap:wrap}
.artop{width:100%;border-collapse:collapse;font-size:12.5px;font-variant-numeric:tabular-nums}
.artop th{text-align:left;color:var(--muted);font-weight:600;padding:4px 6px;border-bottom:1px solid rgba(255,255,255,.1)}
.artop td{padding:4px 6px;border-bottom:1px solid rgba(255,255,255,.05)}.artop tr.me td{color:var(--accent,#f0b54a);font-weight:600}

/* ===== phone joystick (appears under the thumb while dragging) ===== */
#joy{position:fixed;z-index:6;width:112px;height:112px;margin:-56px 0 0 -56px;border-radius:50%;pointer-events:none;
  background:radial-gradient(circle,rgba(255,255,255,.08) 0 55%,rgba(255,255,255,.14) 56% 100%);border:2px solid rgba(255,255,255,.28);box-shadow:0 4px 18px rgba(0,0,0,.3)}
#joy[hidden]{display:none}
#joy i{position:absolute;left:50%;top:50%;width:48px;height:48px;margin:-24px 0 0 -24px;border-radius:50%;
  background:radial-gradient(circle at 35% 30%,#fff7e0,#f0b54a 60%,#c77a2a);box-shadow:0 2px 10px rgba(0,0,0,.35)}

/* ===== Stage 6: guild war bar ===== */
#gwBar{position:fixed;top:calc(max(10px,env(safe-area-inset-top)) + 40px);left:50%;transform:translateX(-50%);z-index:5;display:flex;gap:12px;align-items:center;flex-wrap:wrap;justify-content:center;
  max-width:min(620px,calc(100vw - 24px));padding:7px 14px;border-radius:12px;background:rgba(40,14,10,.88);border:1px solid rgba(255,140,60,.45);font:600 12.5px Inter,var(--ui);cursor:pointer;box-shadow:0 6px 20px rgba(0,0,0,.35)}
#gwBar[hidden]{display:none}#gwBar .t{color:#ffb070}#gwBar b.me{color:var(--accent,#f0b54a)}#gwBar .hot{color:#ff6a5a}#gwBar .top{color:var(--muted);font-weight:500}
#gwBar i{display:inline-block;vertical-align:middle;width:60px;height:6px;border-radius:3px;background:linear-gradient(90deg,#ffb070 var(--p),rgba(255,255,255,.15) var(--p));margin-left:4px}
body.touchui #gwBar{top:calc(max(10px,env(safe-area-inset-top)) + 182px);font-size:11.5px}

/* ===== free hotbar: editor, empty slots, edit button ===== */
#hotbar .slot.empty{opacity:.55;border-style:dashed;cursor:pointer}
#hotbar .slot.edit{font-size:16px;color:var(--muted);background:rgba(255,255,255,.04)}
#hotbar .slot[draggable=true]{cursor:grab}
.hbslots{display:grid;grid-template-columns:repeat(8,1fr);gap:6px;margin:8px 0}
.hbs{position:relative;aspect-ratio:1;border-radius:10px;border:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.04);display:grid;place-items:center;cursor:pointer;padding:0;color:var(--ink)}
.hbs img{width:70%;height:70%;object-fit:contain}.hbs em{position:absolute;left:4px;top:2px;font:600 10px Inter,var(--ui);color:var(--muted);font-style:normal}
.hbs.on{border-color:var(--accent,#f0b54a);box-shadow:0 0 0 2px rgba(240,181,74,.35)}
.hbpick{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:6px}
.hbp{display:flex;align-items:center;gap:8px;padding:6px 8px;border-radius:8px;border:1px solid rgba(255,255,255,.1);background:rgba(255,255,255,.03);color:var(--ink);cursor:pointer;text-align:left;font:500 12.5px Inter,var(--ui)}
.hbp img{width:26px;height:26px;object-fit:contain;flex:none}.hbp.used{border-color:rgba(240,181,74,.45)}.hbp i{color:var(--muted);font-style:normal}
.hbp:hover,.hbs:hover{background:rgba(255,255,255,.08)}
/* ===== phone: the slots sit in two arcs around the Attack button ===== */
body.touchui #actions{gap:6px}
body.touchui #atkBtn{margin-top:190px}
body.touchui #hotbar{position:absolute;left:auto;right:30px;bottom:30px;width:0;height:0;padding:0;margin:0;transform:none;background:none;border:0;box-shadow:none;backdrop-filter:none;display:block;z-index:1}
body.touchui #hotbar .slot{position:absolute;left:-22px;top:-22px;width:44px;height:44px;margin:0;border-radius:50%;background:rgba(14,18,26,.82);border:1px solid rgba(255,255,255,.18);box-shadow:0 4px 14px rgba(0,0,0,.35)}
body.touchui #hotbar .slot .k{display:none}
body.touchui #hotbar .slot.edit{width:32px;height:32px;left:-16px;top:-16px;font-size:13px}
body.touchui #hotbar .slot:nth-child(1){transform:translate(-90px,0px)}
body.touchui #hotbar .slot:nth-child(2){transform:translate(-78px,-45px)}
body.touchui #hotbar .slot:nth-child(3){transform:translate(-45px,-78px)}
body.touchui #hotbar .slot:nth-child(4){transform:translate(0px,-90px)}
body.touchui #hotbar .slot:nth-child(5){transform:translate(-150px,-10px)}
body.touchui #hotbar .slot:nth-child(6){transform:translate(-127px,-79px)}
body.touchui #hotbar .slot:nth-child(7){transform:translate(-75px,-130px)}
body.touchui #hotbar .slot:nth-child(8){transform:translate(-5px,-150px)}
body.touchui #hotbar .slot.edit{transform:translate(0px,-200px)}
/* the chat log keeps to the left of the arcs */
body.touchui #log{width:max(140px,calc(100vw - 262px));max-width:none}

.modcard pre{white-space:pre-wrap;word-break:break-word;margin:4px 0 0;font:11px/1.4 ui-monospace,Consolas,monospace;color:var(--muted)}

.aboutLink{display:block;text-align:center;margin-top:6px;font:500 12px Inter,var(--ui);color:var(--muted);text-decoration:none}.aboutLink:hover{color:var(--accent,#f0b54a);text-decoration:underline}

/* ===== pets ===== */
.petbar{height:10px;border-radius:5px;background:rgba(255,255,255,.08);overflow:hidden;margin:4px 0 8px}.petbar i{display:block;height:100%;border-radius:5px;background:linear-gradient(90deg,#ff7aa8,#ffb0d8)}

/* ===== achievements ===== */
.achlist{display:flex;flex-direction:column;gap:4px}
.ach{display:flex;align-items:center;gap:10px;padding:7px 4px;border-bottom:1px solid rgba(255,255,255,.06)}
.ach .ai{width:28px;height:28px;flex:none;border-radius:8px;display:grid;place-items:center;background:rgba(255,255,255,.05);color:var(--muted);font-size:15px}
.ach.got .ai{background:rgba(240,181,74,.18);color:var(--accent,#f0b54a)}
.ach .grow{flex:1;min-width:0}.ach .nm{font-size:13px}.ach .nm .muted{font-weight:400;font-size:12px}
.abar{height:6px;border-radius:3px;background:rgba(255,255,255,.08);overflow:hidden;margin:4px 0 2px}.abar i{display:block;height:100%;background:linear-gradient(90deg,#f0b54a,#ff7a45)}
#achToast{position:fixed;left:50%;top:max(70px,calc(env(safe-area-inset-top) + 70px));transform:translate(-50%,-20px);opacity:0;pointer-events:none;z-index:9;display:flex;gap:12px;align-items:center;
  padding:10px 16px;border-radius:14px;background:rgba(30,22,10,.94);border:1px solid rgba(240,181,74,.6);box-shadow:0 10px 30px rgba(0,0,0,.45);transition:opacity .25s,transform .25s;cursor:pointer;font-family:Inter,var(--ui)}
#achToast.show{opacity:1;transform:translate(-50%,0);pointer-events:auto}
#achToast i{font-style:normal;font-size:24px;color:var(--accent,#f0b54a)}#achToast b{display:block;font-size:14px}#achToast span{font-size:12px;color:var(--muted)}
@media (prefers-reduced-motion:reduce){#achToast{transition:none}}

/* ===== crafting ===== */
.craftrow{align-items:flex-start}
.cms{display:flex;flex-wrap:wrap;gap:4px;margin-top:4px}
.cm{font-size:11.5px;padding:1px 7px;border-radius:999px;border:1px solid rgba(255,120,100,.35);color:#ffb0a0;background:rgba(255,120,100,.08);cursor:help}
.cm.ok{border-color:rgba(127,211,106,.4);color:#a8e89a;background:rgba(127,211,106,.1)}

/* ===== the stylist ===== */
.styl{display:flex;gap:14px;align-items:center;margin:8px 0}
.styl canvas{width:150px;height:150px;flex:none;border-radius:14px;background:radial-gradient(circle at 50% 70%,rgba(255,154,208,.18),rgba(255,255,255,.03) 70%);border:1px solid rgba(255,255,255,.1)}
.styl .lkrow{margin:6px 0}.styl .lkrow>span{width:76px}
.swatches{display:flex;flex-wrap:wrap;gap:4px}
.swatches button{width:20px;height:20px;border-radius:50%;border:2px solid rgba(255,255,255,.18);cursor:pointer;padding:0}
.swatches button.on{border-color:#fff;box-shadow:0 0 0 2px var(--accent,#f0b54a)}
.swatches button:focus-visible{outline:2px solid var(--accent,#f0b54a);outline-offset:2px}
@media (max-width:520px){.styl{flex-direction:column}}

/* ===== emote bar ===== */
#emoteBar{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(max(10px,env(safe-area-inset-bottom)) + 74px);z-index:8;display:flex;gap:4px;padding:6px;border-radius:14px;background:rgba(14,18,26,.94);animation:dockIn .14s ease-out}
#emoteBar[hidden]{display:none}
#emoteBar button{width:42px;height:42px;border-radius:10px;border:1px solid rgba(255,255,255,.1);background:rgba(255,255,255,.04);cursor:pointer;display:grid;place-items:center;padding:0}
#emoteBar button:hover{background:rgba(255,255,255,.1)}#emoteBar img{width:30px;height:30px}
#emoteBar .more{width:auto;padding:0 10px;font:600 12px Inter,var(--ui);color:var(--muted)}
body.touchui #emoteBar{left:max(10px,env(safe-area-inset-left));transform:none;bottom:calc(max(10px,env(safe-area-inset-bottom)) + 120px);flex-wrap:wrap;max-width:calc(100vw - 250px)}
.emb{position:relative}.emb .fav{position:absolute;top:2px;right:4px;font-size:14px;color:var(--muted);cursor:pointer;line-height:1}.emb .fav.on{color:var(--accent,#f0b54a)}
@media (prefers-reduced-motion:reduce){#emoteBar{animation:none}}

/* ===== screenshot flash ===== */
.shotflash{position:fixed;inset:0;z-index:50;background:#fff;pointer-events:none;animation:shotflash .45s ease-out forwards}
@keyframes shotflash{from{opacity:.75}to{opacity:0}}
@media (prefers-reduced-motion:reduce){.shotflash{animation:none;opacity:0}}
/* ===== #62 extra hotbar rows above the main bar ===== */
#hotrows{position:fixed;left:50%;transform:translateX(-50%);bottom:70px;display:flex;flex-direction:column;gap:4px;z-index:5;pointer-events:none}
#hotrows .hrow{display:flex;gap:5px;padding:5px;border-radius:14px;background:rgba(14,18,26,.72);border:1px solid rgba(255,255,255,.08);backdrop-filter:blur(8px);pointer-events:auto}
#hotrows .slot.empty{opacity:.45;border-style:dashed}
#hotrows .slot .k{font-size:9px}
#hotrows .slot[draggable=true]{cursor:grab}
#hotbar #hbRows{font-size:15px;color:var(--muted);background:rgba(255,255,255,.04)}
.hbrowtabs{margin:6px 0 2px}.hbrowtabs small{color:var(--muted);font-size:10px;margin-left:3px}
body.touchui #hotrows,body.touchui #hotbar #hbRows{display:none!important}
body.ui-s #hotrows{zoom:.88}body.ui-l #hotrows{zoom:1.15}
/* low HP: red glow around the screen edge, stronger as HP drops */
#danger{position:fixed;inset:0;pointer-events:none;z-index:4;opacity:0;will-change:opacity;background:radial-gradient(ellipse at center,rgba(200,20,20,0) 58%,rgba(200,20,20,.55) 100%)}
/* #48 chat rooms */
#log.f-room>div:not(#logTabs):not(.l-room){display:none}.l-room{color:#9fd8e0}.l-room b{color:inherit}
/* pictures in quests: monster, item (and who drops it), the person to talk to */
.qobjs{display:flex;flex-direction:column;gap:3px}
.qo{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.qo .qm{width:10px;text-align:center}
.qpic{width:24px;height:24px;object-fit:contain;flex:none;border-radius:6px;background:rgba(255,255,255,.05);vertical-align:middle}
.qfrom{color:var(--muted);font-size:.92em}.qfrom .qpic{width:18px;height:18px;margin:0 2px 0 4px;background:none}
.qwait{color:var(--muted)}
#qtrack{white-space:normal}#qtrack .qo{gap:4px}#qtrack .qpic{width:20px;height:20px}#qtrack .qfrom .qpic{width:15px;height:15px}
/* ===== a cleaner game screen ===== */
/* region banner: smaller, higher, quicker, so it never sits on top of you */
#zoneBanner{top:max(140px,17%)}
#zoneBanner b{font-size:clamp(20px,4.2vw,30px)!important;letter-spacing:.1em}
#zoneBanner span{font-size:11px}
#zoneBanner.show{animation-duration:2.4s}
/* the log fades when quiet; new chat, hover or a tap brings it back */
#log{transition:opacity .5s,background-color .5s,border-color .5s}
#log.idle{opacity:.38;background:rgba(12,15,22,.18);border-color:transparent}
#log.idle:hover{opacity:1}
#log.f-chat>div:not(#logTabs):not(.l-chat):not(.l-party):not(.l-whisper):not(.l-guild):not(.l-room){display:none}
#logTabs .btn{padding:2px 7px}
/* the dock: icons only, with a quick tooltip */
@media (min-width:1180px){body:not(.touchui) #menu{grid-template-columns:repeat(5,40px)}body:not(.touchui) .dk{width:40px;height:40px;gap:0}
  body:not(.touchui) .dk span{display:none}body:not(.touchui) .dk i{font-size:16px}body:not(.touchui) #dockExtra .act{height:40px}}
#dock [data-tip]{position:relative}
body:not(.touchui) #dock [data-tip]:hover::after,body:not(.touchui) #dock [data-tip]:focus-visible::after{content:attr(data-tip);position:absolute;bottom:calc(100% + 6px);right:0;white-space:nowrap;
  background:rgba(14,18,26,.96);color:var(--ink);font:500 11.5px Inter,var(--ui);padding:4px 8px;border-radius:7px;border:1px solid rgba(255,255,255,.12);pointer-events:none;z-index:20}
body:not(.touchui) #dockExtra{display:grid;grid-template-rows:repeat(2,40px);grid-auto-flow:column;gap:5px}
#logTabs{background:rgb(14,17,24);margin:-8px -10px 4px;padding:6px 10px 4px;top:-8px;border-radius:12px 12px 0 0}
#log.idle #logTabs{background:transparent}
/* phones: the log tabs scroll sideways; the Loot switch lives in the ☰ menu */
body.touchui #logTabs{overflow-x:auto;scrollbar-width:none;flex-wrap:nowrap}body.touchui #logTabs::-webkit-scrollbar{display:none}
body.touchui #logTabs .btn{flex:none}
body.touchui #dockExtra{display:flex;align-items:center;padding:0 0 0 8px}
body.touchui #dockExtra .act{width:52px;height:52px;border-radius:12px}
/* ===== a smaller status box; folded it still shows HP, SP, base and job level, and weight ===== */
#hud{width:200px;padding:8px 10px}
#hud .name{font-size:15px}
#hud .cls{font-size:10px;margin:1px 0 5px}
#hud .bar.thin{height:4px;margin-bottom:0}
#hud .lbl{font-size:10.5px}
#hud .lvrow{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:2px 0 3px}
#hud .lvc .lbl{display:flex;justify-content:space-between;gap:4px;white-space:nowrap}
#hud #gold,#hud #weight{font-size:10.5px}
#hud.mini>:not(.name):not(.hpb):not(.spb):not(#ailT):not(#buffs):not(#hudToggle):not(.lvrow):not(#weight){display:none}
#hud.mini .lvrow{display:grid!important}#hud.mini #weight{display:block!important}
#hud.mini .name{font-size:14px;margin-bottom:3px}
@media (max-width:760px){#hud{width:170px;padding:6px 8px}#hud .lvrow{gap:6px}#hud .lbl,#hud .bar span{font-size:10px}}
/* the chat box: a fold/open button on top; opened, it grows upward */
#log.big{max-height:min(46vh,380px)!important}
#logToggle{margin-left:auto;flex:none;padding:0 7px!important;font-size:10px}
#logTabs .btn.unread{position:relative}#logTabs .btn.unread::after{content:'';position:absolute;top:2px;right:2px;width:6px;height:6px;border-radius:50%;background:var(--accent,#f0b54a)}
#logJump{position:fixed;transform:translateX(-50%);z-index:6;font-size:11px;padding:3px 10px;background:rgba(14,18,26,.95)}
#log .l-chat:not(.me) b,#log .l-whisper b,#log .l-party b,#log .l-guild b,#log .l-room b{cursor:pointer}
#log .l-chat:not(.me) b:hover,#log .l-whisper b:hover,#log .l-party b:hover,#log .l-guild b:hover,#log .l-room b:hover{text-decoration:underline}
body.touchui #log.big{max-height:min(40vh,300px)!important}
/* the tab row sits at the bottom of the chat box; opening it grows the messages upward, above the tabs */
#log{display:flex;flex-direction:column}
#log>div{flex:none}
#logTabs{order:99;position:sticky;top:auto!important;bottom:-8px;margin:4px -10px -8px!important;padding:5px 10px 6px!important;border-radius:0 0 12px 12px!important;border-top:1px solid rgba(255,255,255,.06)}
#logToggle{margin-left:0!important;margin-right:2px}
@media (min-width:1041px){body:not(.touchui) #log{width:min(340px,calc(50vw - 272px))}}
/* ===== controls and HUD (v0.75.0) ===== */
/* buffs: a column on the right under the minimap */
#buffs.side{position:fixed;margin:0;display:flex;flex-direction:column;gap:6px;z-index:3;pointer-events:auto}
#buffs.side[hidden]{display:none}
#buffs.side .buff{width:32px;height:32px;border-radius:8px;background:rgba(14,18,26,.85);border:1px solid rgba(255,255,255,.14);box-shadow:0 3px 10px rgba(0,0,0,.35)}
/* minimap: rounded frame, soft background, a size button in the corner */
#minibox{position:fixed}
#mini{image-rendering:auto;border-radius:10px;background:radial-gradient(ellipse at center,#18202c,#0b0e13 75%);border:1px solid rgba(240,181,74,.25);box-shadow:inset 0 0 18px rgba(0,0,0,.6);cursor:crosshair!important}
#miniSize{position:absolute;top:7px;right:7px;width:22px;height:22px;padding:0;font-size:12px;line-height:20px;border-radius:6px}
/* the icons on the round buttons: shown on phones, the words on a computer */
.act .aic{display:none;width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
body.touchui .act .aic{display:block}body.touchui .act .atx{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
/* phone controls: dark discs with gold rings, like a game's action pad */
body.touchui #actions{z-index:2}
body.touchui #actions>.act{width:46px;height:46px;border-radius:50%;display:flex;align-items:center;justify-content:center;padding:0;color:#f4e7c4;
  background:radial-gradient(circle at 35% 28%,#2c3546,#0e121a 70%);border:2px solid #9c7a3e;box-shadow:0 0 0 1px #000,inset 0 2px 5px rgba(255,255,255,.1),0 6px 14px rgba(0,0,0,.55)}
body.touchui #actions>.act:active{transform:scale(.94)}
body.touchui #actions>.act.on{border-color:#ffcf5a;color:#ffcf5a;box-shadow:0 0 0 1px #000,0 0 14px rgba(255,207,90,.45),0 6px 14px rgba(0,0,0,.55)}
body.touchui #menuBtn{width:42px!important;height:42px!important}
body.touchui #atkBtn{width:76px!important;height:76px!important;color:#fff;background:radial-gradient(circle at 35% 28%,#e0675a,#8e2620 72%)!important;border:3px solid #d9b25a!important;box-shadow:0 0 0 1px #000,0 0 18px rgba(217,72,63,.45),0 8px 18px rgba(0,0,0,.55)!important}
body.touchui #atkBtn .aic{width:36px;height:36px;stroke-width:2.2}
body.touchui #hotbar .slot{border:2px solid #9c7a3e!important;background:radial-gradient(circle at 35% 28%,#2c3546,#0e121a 70%)!important;box-shadow:0 0 0 1px #000,0 5px 12px rgba(0,0,0,.5)!important}
body.touchui #hotbar .slot .k{display:none}
/* the tap pad behind the cluster (invisible) */
#actPads .actPad{position:fixed;z-index:1;border-radius:50%;background:transparent;touch-action:none}
body:not(.touchui) #actPads{display:none}
body.touchui #actions>#emoteBtn,body.touchui #actions>#muteBtn{display:none!important}
#miniSize{top:40px;right:14px;background:rgba(14,18,26,.75)}
/* full-width EXP bar on the bottom edge */
#expEdge{position:fixed;left:0;right:0;bottom:0;height:4px;z-index:6;background:rgba(0,0,0,.45);pointer-events:auto}
#expEdge[hidden]{display:none}
#expEdge .b{position:absolute;left:0;bottom:0;height:3px;background:linear-gradient(90deg,#c8962a,#ffcf5a);box-shadow:0 0 6px rgba(255,207,90,.5);transition:width .4s}
#expEdge .j{position:absolute;left:0;top:0;height:1px;background:#62bf86;opacity:.8;transition:width .4s}
#expEdge span{position:absolute;left:50%;bottom:6px;transform:translateX(-50%);font:600 10.5px Inter,var(--ui);color:#ffe7a0;background:rgba(14,18,26,.9);padding:2px 8px;border-radius:6px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .2s}
#expEdge:hover{height:6px}#expEdge:hover span{opacity:1}
/* Thai: Noto Sans Thai fills in the Thai letters behind the usual fonts */
:root{--ui:"Alegreya Sans","Noto Sans Thai","Trebuchet MS",system-ui,sans-serif}
html[lang="th"] body,html[lang="th"] button,html[lang="th"] input{font-family:Inter,"Noto Sans Thai",system-ui,sans-serif}
#langBtn{flex:none;margin-left:8px;padding:3px 10px;font-size:12px;white-space:nowrap}
@media (max-width:760px){#langBtn{margin-left:6px;padding:2px 8px;font-size:11px}}
body:not(.touchui) #rideBtn{display:none}
body.touchui #actions>#rideBtn[hidden]{display:none!important}
/* the auto-hunt pick-up card */
#autoLootBtn{display:none!important}
#autoPick{position:fixed;z-index:30;width:min(300px,calc(100vw - 16px));padding:12px;border-radius:16px;background:rgba(14,18,26,.97);border:1px solid rgba(240,181,74,.35);
  box-shadow:0 18px 40px rgba(0,0,0,.55);opacity:0;transform:translateY(8px) scale(.94);transform-origin:50% 100%;transition:opacity .18s,transform .18s cubic-bezier(.2,1.4,.4,1)}
#autoPick.show{opacity:1;transform:none}
#autoPick .apT{font:700 13px Inter,var(--ui);color:var(--ink);margin:0 2px 8px}
#autoPick .apOpt{display:flex;gap:10px;align-items:center;width:100%;text-align:left;padding:10px;margin-top:6px;border-radius:12px;border:1px solid rgba(255,255,255,.1);background:rgba(255,255,255,.04);color:var(--ink);cursor:pointer}
#autoPick .apOpt:hover{background:rgba(240,181,74,.1)}#autoPick .apOpt.on{border-color:rgba(240,181,74,.75);background:rgba(240,181,74,.12)}
#autoPick .apI{flex:none;width:34px;height:34px;border-radius:50%;display:grid;place-items:center;font-size:17px;color:#ffcf5a;background:radial-gradient(circle at 35% 30%,#3a3220,#16120a);border:1px solid rgba(240,181,74,.5)}
#autoPick .apOpt span{display:flex;flex-direction:column;gap:2px}#autoPick .apOpt span b{font:700 13.5px Inter,var(--ui)}#autoPick .apOpt span i{font:500 11.5px Inter,var(--ui);font-style:normal;color:var(--muted)}
@media (prefers-reduced-motion:reduce){#autoPick{transition:none}}
/* crafting: ingredients as pictures with have/need counts (name and source in the tooltip) */
.cms{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-top:4px}
.cmi{position:relative;width:40px;height:40px;border-radius:9px;border:1px solid rgba(239,122,111,.55);background:rgba(239,122,111,.08);display:grid;place-items:center;cursor:help}
.cmi.ok{border-color:rgba(127,211,138,.6);background:rgba(127,211,138,.08)}
.cmi img{width:30px;height:30px;object-fit:contain}
.cmi b{position:absolute;right:-4px;bottom:-5px;font:700 10px Inter,var(--ui);padding:1px 4px;border-radius:6px;background:rgba(10,12,16,.92);color:#ef7a6f;font-variant-numeric:tabular-nums}
.cmi.ok b{color:#7fd38a}
.cmi:focus-visible{outline:2px solid var(--accent)}
/* phones: the chat box sits down at the bottom edge (just above the thin EXP bar) */
body.touchui #log{bottom:calc(max(4px,env(safe-area-inset-bottom)) + 6px)}
/* phones: the action buttons sit down near the bottom edge too */
body.touchui #actions{bottom:calc(max(4px,env(safe-area-inset-bottom)) + 10px)}
/* the chat box's own write button; on phones it replaces the round Chat button */
#logSay{flex:none;padding:0 7px!important;font-size:12px}
body:not(.touchui) #logSay{display:none}
body.touchui #actions>#chatBtn{display:none!important}
body.touchui #actions>#rideBtn.none{opacity:.5}
#fullOffer{position:fixed;top:max(10px,env(safe-area-inset-top));left:50%;transform:translateX(-50%);z-index:25;padding:6px 14px;border-radius:999px;background:rgba(14,18,26,.95);border:1px solid rgba(240,181,74,.6);color:#ffe7a0;font:700 13px Inter,var(--ui);box-shadow:0 8px 20px rgba(0,0,0,.5)}
#fullOffer[hidden]{display:none}
/* ===== phones held sideways: more room for the game ===== */
@media (orientation:landscape) and (max-height:520px){
  /* status box: small and see-through; name, HP, SP and levels only (unfold for the rest) */
  body.touchui #hud{width:168px;padding:5px 8px;background:rgba(14,18,26,.42);border-color:rgba(255,255,255,.06);box-shadow:none;backdrop-filter:none}
  body.touchui #hud .name{font-size:13px}body.touchui #hud .cls,body.touchui #hud #gold,body.touchui #hud #party,body.touchui #hud #quest{display:none!important}
  body.touchui #hud .bar{height:10px}body.touchui #hud .bar span{font-size:9.5px;line-height:10px}
  /* minimap: small and see-through; tap the region name to fold it to just the name */
  body.touchui #minibox{padding:4px 6px;background:rgba(14,18,26,.42);border-color:rgba(255,255,255,.06);box-shadow:none;backdrop-filter:none}
  body.touchui #minibox .zn{font-size:11px;margin-bottom:2px;cursor:pointer}body.touchui #minibox .zl,body.touchui #minibox #online{display:none}
  body.touchui #mini{width:118px!important;height:auto!important;opacity:.9}
  body.touchui #minibox.slim #mini,body.touchui #minibox.slim #miniSize{display:none}
  body.touchui #miniSize{top:22px;right:8px;width:18px;height:18px;font-size:10px;line-height:16px}
  /* region banner: smaller */
  #zoneBanner{top:22%}#zoneBanner b{font-size:20px!important}#zoneBanner span{font-size:9.5px}
  /* chat box: only as wide as its tabs, small tabs, a few lines */
  body.touchui #log{max-height:84px}
  body.touchui #log.big{max-height:min(56vh,220px)!important}
  body.touchui #logTabs .btn{padding:0 6px!important;font-size:10.5px;min-height:22px}
  body.touchui #log>div:not(#logTabs){font-size:11px;white-space:normal}
  /* the round buttons sit in a small row at the top centre (free space between the status box and the map) */
  body.touchui #actions>.act:not(#atkBtn){position:fixed;top:max(8px,env(safe-area-inset-top));width:38px!important;height:38px!important;transform:translateX(-50%)}
  body.touchui #actions>.act:not(#atkBtn) .aic{width:19px;height:19px}
  body.touchui #actions>#menuBtn{left:calc(42% - 69px)}body.touchui #actions>#autoBtn{left:calc(42% - 23px)}
  body.touchui #actions>#rideBtn{left:calc(42% + 23px)}body.touchui #actions>#sitBtn{left:calc(42% + 69px)}
  body.touchui #actions>.act:not(#atkBtn):active{transform:translateX(-50%) scale(.94)}
  body.touchui #autoPick{top:56px!important}
}
/* phones: quick window buttons on the right, under the minimap */
#quick{display:none}
body.touchui #quick{display:flex;flex-direction:row;gap:7px;position:fixed;z-index:3}
body.touchui #quick .qk{width:40px;height:40px;border-radius:50%;padding:0;display:grid;place-items:center;color:#f4e7c4;cursor:pointer;
  background:radial-gradient(circle at 35% 28%,#2c3546,#0e121a 70%);border:2px solid #9c7a3e;box-shadow:0 0 0 1px #000,0 4px 10px rgba(0,0,0,.5)}
body.touchui #quick .qk:active{transform:scale(.94)}
body.touchui #quick .qk svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
/* the buff column moves left of the quick buttons */
body.touchui #buffs.side{margin-top:50px}
@media (orientation:landscape) and (max-height:520px){
  body.touchui #quick{flex-direction:row;gap:6px}
  body.touchui #quick .qk{width:34px;height:34px}body.touchui #quick .qk svg{width:16px;height:16px}
  body.touchui #buffs.side{margin-top:0}
}
@media (orientation:landscape) and (max-height:520px){
  /* Auto sits on the right, just above the skill and potion shortcuts */
  body.touchui #actions>#autoBtn{left:auto!important;right:calc(max(10px,env(safe-area-inset-right)) + 86px)!important;top:118px!important;transform:none!important}
  body.touchui #actions>#autoBtn:active{transform:scale(.94)}
  body.touchui #actions>#menuBtn{left:calc(42% - 46px)}body.touchui #actions>#rideBtn{left:42%}body.touchui #actions>#sitBtn{left:calc(42% + 46px)}
}
/* ===== phones: a bigger attack cluster (Attack 88px; skill and potion slots and their arc scaled up ~20%) ===== */
body.touchui #atkBtn{width:84px!important;height:84px!important}
body.touchui #atkBtn .aic{width:38px;height:38px}
body.touchui #hotbar{right:34px!important;bottom:34px!important}
@media (orientation:landscape) and (max-height:520px){body.touchui #hotbar{right:36px!important;bottom:36px!important;transform:scale(1.1)!important;transform-origin:0 0}}
/* ===== phones: clear screen in battle (body.fightui) ===== */
body.touchui :is(#minibox,#quick,#onlineBadge,#log,#buffs){transition:opacity .45s ease,transform .45s ease}
body.touchui.fightui :is(#minibox,#quick,#onlineBadge){opacity:0;pointer-events:none;transform:translateY(-8px)}
body.touchui.fightui #log{opacity:.18;pointer-events:none}
/* ===== item card (tap an item picture) ===== */
#itemCard{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);width:min(360px,calc(100vw - 28px));max-height:min(80vh,600px);overflow-y:auto;padding:14px 16px 16px;z-index:8;background:rgba(14,18,26,.97);box-shadow:0 18px 50px rgba(0,0,0,.6)}
#itemCard[hidden]{display:none}
#itemCard .icx{position:absolute;top:10px;right:10px}
#itemCard .ichead{display:flex;gap:12px;align-items:flex-start;padding-right:34px}
#itemCard .icpic{width:52px;height:52px;flex:none;border-radius:10px;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.12);image-rendering:auto}
#itemCard .icnm{font-weight:800;font-size:17px;margin:2px 0 4px}
#itemCard h3{margin:14px 0 6px;font-size:13px;letter-spacing:.04em;text-transform:uppercase;color:var(--muted,#9aa3b2)}
#itemCard .icmobs{display:flex;flex-direction:column;gap:6px}
#itemCard .icmob{display:flex;align-items:center;gap:10px;padding:6px 8px;border-radius:10px;background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.07)}
#itemCard .icmob img{width:40px;height:40px;flex:none}
#itemCard .icmob .grow{flex:1;min-width:0}
#itemCard .icpct{font-weight:800;color:#ffcf5a;font-size:15px;white-space:nowrap}
#itemCard .icrec{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:4px 0}
#itemCard .icing{position:relative;display:inline-flex;cursor:pointer}
#itemCard .icing .icpic{width:36px;height:36px}
#itemCard .icing b{position:absolute;right:-2px;bottom:-4px;font-size:11px;background:#1a2030;border-radius:6px;padding:0 4px}
[data-item]{cursor:pointer}
/* ===== sigil picker: choose which gear gets the sigil, then OK ===== */
.sockhead{display:flex;gap:10px;align-items:center;padding:8px 10px;margin:6px 0 8px;border-radius:12px;background:rgba(255,207,90,.07);border:1px solid rgba(255,207,90,.25)}
.sockhead .grow{min-width:0}
.socklist{display:flex;flex-direction:column;gap:6px;margin:6px 0 10px}
.sockopt{display:flex;align-items:center;gap:10px;width:100%;text-align:left;padding:9px 10px;border-radius:12px;border:1px solid rgba(255,255,255,.12);background:rgba(255,255,255,.04);color:var(--ink);cursor:pointer;font:inherit}
.sockopt:hover:not([disabled]){background:rgba(240,181,74,.08)}
.sockopt.on{border-color:rgba(240,181,74,.85);background:rgba(240,181,74,.14);box-shadow:0 0 0 1px rgba(240,181,74,.5) inset}
.sockopt[disabled]{opacity:.45;cursor:default}
.sockopt:focus-visible{outline:2px solid var(--accent,#f0b54a);outline-offset:2px}
.sockopt .grow{display:flex;flex-direction:column;gap:2px;min-width:0}
.sockopt .grow b{font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sockopt .grow i{font-style:normal;font-size:12px;color:var(--muted)}
.sockopt .pips{display:flex;gap:4px;flex:none}
.sockopt .pip{width:11px;height:11px;border-radius:50%;border:1.5px solid rgba(255,207,90,.7);background:transparent}
.sockopt .pip.full{background:#ffcf5a;box-shadow:0 0 6px rgba(255,207,90,.6)}
/* ===== phones: townsfolk windows fill the screen (js/npcfull.js) ===== */
body.touchui #panel.npcfull{inset:0!important;left:0!important;top:0!important;transform:none!important;width:100%!important;max-width:none!important;height:100%!important;max-height:none!important;
  margin:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;zoom:1!important;z-index:45;box-sizing:border-box;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;
  background:radial-gradient(ellipse at 50% -10%,rgba(240,181,74,.08),transparent 55%),#0f141c!important;
  padding:calc(max(12px,env(safe-area-inset-top)) + 6px) max(18px,env(safe-area-inset-right)) calc(max(16px,env(safe-area-inset-bottom)) + 12px) max(18px,env(safe-area-inset-left));
  animation:npcFullIn .2s ease-out}
/* keep long lines readable on wide (sideways) phones: content in a centred column */
body.touchui #panel.npcfull>*:not(.x){max-width:760px;margin-left:auto;margin-right:auto}
body.touchui #panel.npcfull h2{padding-right:56px}
body.touchui #panel.npcfull .x{position:fixed;top:max(10px,env(safe-area-inset-top));right:max(12px,env(safe-area-inset-right));width:44px;height:44px;min-height:44px;padding:0!important;font-size:18px;border-radius:50%;z-index:2}
body.touchui #panel.npcfull .row{padding:9px 0}
body.touchui #panel.npcfull .btn.small{min-height:36px;padding:6px 12px}
/* the item card opens over a full-screen shop */
body.npcopen #itemCard{z-index:50}
@keyframes npcFullIn{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){body.touchui #panel.npcfull{animation:none}}
/* ===== Sigil Codex at the Grand Library (js/codex.js) ===== */
.cxtabs{margin:6px 0 8px}
.cxrow{display:flex;gap:8px;align-items:flex-start;margin:6px 0}
.cxlbl{flex:none;width:74px;padding-top:6px;font-size:11.5px;letter-spacing:.04em;text-transform:uppercase;color:var(--muted)}
.cxchips{display:flex;flex-wrap:wrap;gap:5px;min-width:0}
.cxchip{padding:5px 10px;min-height:30px;border-radius:999px;border:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.04);color:var(--ink);font:600 12.5px Inter,var(--ui);cursor:pointer;white-space:nowrap}
.cxchip span{color:var(--muted);font-weight:500;margin-left:2px}
.cxchip:hover{background:rgba(240,181,74,.08)}
.cxchip.on{border-color:rgba(240,181,74,.85);background:rgba(240,181,74,.16);color:#ffe7a0}
.cxchip:focus-visible{outline:2px solid var(--accent,#f0b54a);outline-offset:2px}
.cxlist{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:8px;margin-top:10px}
.cxcard{display:flex;gap:10px;align-items:flex-start;padding:10px;border-radius:12px;background:rgba(255,255,255,.035);border:1px solid rgba(255,255,255,.08);min-width:0}
.cxcard.have{border-color:rgba(127,211,138,.35)}
.cxcard .grow{min-width:0;flex:1}
.cxtop{display:flex;gap:8px;align-items:baseline;justify-content:space-between}
.cxtop .nm{font-weight:700;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cxslot{flex:none;font-size:11px;padding:1px 7px;border-radius:999px;background:rgba(255,255,255,.07);color:var(--muted)}
.cxb{margin:3px 0 2px;color:#ffe7a0;font-weight:600;font-size:13px}
.cxb .cxon{color:#ffcf5a;text-decoration:underline;text-underline-offset:3px}
.cxown{display:inline-block;margin-top:4px;font-size:11.5px;color:#7fd38a}
@media (max-width:420px){.cxlbl{width:auto;padding-top:0}.cxrow{flex-direction:column;gap:4px}.cxlist{grid-template-columns:1fr}}
/* codex cards: the monster that drops the sigil */
.cxcard{align-items:center}
.cxmob{flex:none;margin:0;width:62px;display:flex;flex-direction:column;align-items:center;gap:1px}
.cxmob img{width:56px;height:56px;object-fit:contain;border-radius:10px;background:radial-gradient(circle at 50% 60%,rgba(255,255,255,.08),transparent 70%)}
.cxmob figcaption{font-size:10.5px;color:var(--muted);font-variant-numeric:tabular-nums}
#itemCard{background:#141a24!important;backdrop-filter:none}
/* Grand Library: Equipment tab (js/gearcodex.js) */
.gxcard{flex-direction:column;align-items:stretch;gap:8px}
.gxhead{display:flex;gap:10px;align-items:flex-start;min-width:0}
.gxhead .grow{min-width:0;flex:1}
.gxsrcs{display:flex;flex-direction:column;gap:5px}
.gxsrc{display:flex;align-items:center;gap:10px;padding:5px 8px;border-radius:10px;background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.07)}
.gxsrc img{width:44px;height:44px;flex:none;object-fit:contain}
.gxsrc .grow{min-width:0;flex:1}
.gxpct{flex:none;font-weight:800;color:#ffcf5a;font-size:15px;font-variant-numeric:tabular-nums}
.gxtags{display:flex;flex-wrap:wrap;gap:5px}
.gxtag{font-size:11.5px;padding:2px 8px;border-radius:999px;background:rgba(127,211,138,.1);border:1px solid rgba(127,211,138,.3);color:#bfe8c6}
.gxslots{display:flex;align-items:center;gap:8px;margin-top:4px;font-size:12.5px;color:#ffe7a0}
.gxslots .pips{display:flex;gap:4px}
.gxslots .pip{width:11px;height:11px;border-radius:50%;border:1.5px solid rgba(255,207,90,.35)}
.gxslots .pip.on{border-color:rgba(255,207,90,.9);background:rgba(255,207,90,.18)}
.gxroll{margin-top:1px}
/* phones held sideways: the online badge is a small see-through pill under the status box (js/controls.js places it);
   tap it for the who's-online list, which opens under it */
@media (orientation:landscape) and (max-height:520px){
  body.touchui #onlineBadge{transform:none;font-size:11px;padding:3px 10px;background:rgba(14,18,26,.6);border-width:1px;white-space:nowrap}
  body.touchui #whoList{transform:none;max-height:min(58vh,230px);width:min(260px,calc(100vw - 24px));background:#141a24!important;z-index:7;backdrop-filter:none}
}
/* phones sideways: Stats, Skills, Items, Equip and Ride in a row on the left (js/quickleft.js) */
#quickL{position:fixed;z-index:3;display:flex;gap:6px;transition:opacity .45s ease,transform .45s ease}
#quickL[hidden]{display:none}
#quickL>button{position:static!important;transform:none!important;left:auto!important;top:auto!important;width:34px!important;height:34px!important;border-radius:50%;padding:0;display:grid;place-items:center;
  color:#f4e7c4;cursor:pointer;background:radial-gradient(circle at 35% 28%,#2c3546,#0e121a 70%);border:2px solid #9c7a3e;box-shadow:0 0 0 1px #000,0 4px 10px rgba(0,0,0,.5)}
#quickL>button:active{transform:scale(.94)!important}
#quickL>button svg{width:16px!important;height:16px!important;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
#quickL>button.none{opacity:.5}
#quickL>button.on{border-color:#ffcf5a;color:#ffcf5a}
#quickL>button:focus-visible{outline:2px solid var(--accent,#f0b54a);outline-offset:2px}
body.touchui.fightui #quickL{opacity:0;pointer-events:none;transform:translateY(-8px)}
/* with Ride moved to the left row, Menu and Sit close the gap in the top row */
@media (orientation:landscape) and (max-height:520px){
  body.touchui #actions>#menuBtn{left:calc(42% - 23px)}body.touchui #actions>#sitBtn{left:calc(42% + 23px)}
}
/* ===== Auto: the pick-up choices spring out of the button, joined to it by glowing lines ===== */
#autoPick.ring{position:fixed;inset:0!important;left:0!important;top:0!important;width:auto!important;padding:0!important;border:0!important;border-radius:0!important;background:none!important;box-shadow:none!important;
  opacity:1!important;transform:none!important;transition:none!important;pointer-events:none;z-index:30}
#autoPick.ring .apLinks{position:absolute;left:0;top:0;overflow:visible;pointer-events:none}
#autoPick.ring .apLine{fill:none;stroke:url(#apGrad);stroke-width:3;stroke-linecap:round;filter:drop-shadow(0 0 4px rgba(255,207,90,.7));
  stroke-dasharray:var(--len);stroke-dashoffset:var(--len);transition:stroke-dashoffset .26s cubic-bezier(.3,.7,.3,1) .05s}
#autoPick.ring.show .apLine{stroke-dashoffset:0}
#autoPick.ring .apFlow{fill:none;stroke:#fff6d8;stroke-width:3;stroke-linecap:round;stroke-dasharray:1 13;opacity:0;transition:opacity .2s .3s}
#autoPick.ring.show .apFlow{opacity:.9;animation:apFlow .9s linear infinite}
@keyframes apFlow{to{stroke-dashoffset:-14}}
#autoPick.ring .apT{position:absolute;transform:translate(-50%,-50%) scale(.6);opacity:0;font:700 10.5px Inter,var(--ui);letter-spacing:.08em;text-transform:uppercase;color:#ffe7a0;
  padding:2px 7px;border-radius:999px;background:rgba(14,18,26,.82);border:1px solid rgba(240,181,74,.45);transition:opacity .2s .12s,transform .25s .12s;white-space:nowrap;margin:0}
#autoPick.ring.show .apT{opacity:1;transform:translate(-50%,-50%)}
#autoPick.ring .apOpt{position:absolute;pointer-events:auto;width:46px;height:46px;margin:0;padding:0;border:0;background:none;display:block;cursor:pointer;
  transform:translate(-50%,-50%) translate(var(--fx),var(--fy)) scale(.2);opacity:0;transition:transform .34s cubic-bezier(.2,1.5,.35,1),opacity .18s}
#autoPick.ring.show .apOpt{transform:translate(-50%,-50%);opacity:1}
#autoPick.ring .apOpt .apI{position:absolute;inset:0;width:46px;height:46px;border-radius:50%;display:grid;place-items:center;font-size:20px;color:#ffcf5a;
  background:radial-gradient(circle at 35% 28%,#3a3220,#120e07 72%);border:2px solid #c9a050;box-shadow:0 0 0 1px #000,0 6px 14px rgba(0,0,0,.55),0 0 14px rgba(255,207,90,.35)}
#autoPick.ring .apOpt.on .apI{border-color:#ffe08a;box-shadow:0 0 0 1px #000,0 0 0 4px rgba(255,207,90,.25),0 0 18px rgba(255,207,90,.65)}
#autoPick.ring .apOpt.picked .apI{animation:apPick .3s ease-out}
@keyframes apPick{50%{transform:scale(1.18)}}
#autoPick.ring .apOpt>span{position:absolute;top:50%;transform:translateY(-50%);left:54px;display:flex;flex-direction:column;gap:1px;padding:4px 9px;border-radius:10px;white-space:nowrap;text-align:left;
  background:rgba(14,18,26,.9);border:1px solid rgba(255,255,255,.12);color:var(--ink)}
#autoPick.ring.left .apOpt>span{left:auto;right:54px;text-align:right}
#autoPick.ring .apOpt>span b{font:700 12.5px Inter,var(--ui)}#autoPick.ring .apOpt>span i{font:500 10.5px Inter,var(--ui);font-style:normal;color:var(--muted)}
#autoPick.ring .apOpt.on>span{border-color:rgba(240,181,74,.6)}
#autoPick.ring .apOpt:focus-visible .apI{outline:2px solid var(--accent,#f0b54a);outline-offset:2px}
@media (prefers-reduced-motion:reduce){#autoPick.ring .apOpt,#autoPick.ring .apLine,#autoPick.ring .apT{transition:none}#autoPick.ring.show .apFlow{animation:none}}
body.touchui #autoPick.ring{top:0!important;left:0!important}
#autoPick.ring .apT{transform:translate(0,-50%) scale(.6);transform-origin:0 50%}#autoPick.ring.show .apT{transform:translate(0,-50%)}
#autoPick.ring.left .apT{transform:translate(-100%,-50%) scale(.6);transform-origin:100% 50%}#autoPick.ring.left.show .apT{transform:translate(-100%,-50%)}
/* phones: a roomier party box; the leader's buttons go on their own line as small chips, names get space */
body.touchui #partyBox:not(.fold){width:min(250px,calc(100vw - 150px))}
body.touchui #partyBox:not(.fold) .phd{flex-wrap:wrap;row-gap:5px}
body.touchui #partyBox:not(.fold) .phd .pt{flex:1 1 calc(100% - 34px);font-size:11.5px;line-height:1.25}
body.touchui #partyBox:not(.fold) .phd .btn.small{white-space:nowrap;font-size:10.5px;padding:2px 8px!important;min-height:24px;line-height:1.2}
body.touchui #partyBox .pmr{grid-template-columns:minmax(52px,1fr) 46px auto auto auto;gap:5px}
@media (orientation:portrait){body.touchui #partyBox:not(.fold){width:min(232px,calc(100vw - 150px))}}
/* phones sideways: one compact header line (title, chips) so the members show in the short space above the chat */
@media (orientation:landscape) and (max-height:520px){
  body.touchui #partyBox:not(.fold){width:min(330px,calc(100vw - 260px));padding:4px 8px}
  body.touchui #partyBox:not(.fold) .phd{flex-wrap:nowrap;gap:4px}
  body.touchui #partyBox:not(.fold) .phd .pt{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px}
  body.touchui #partyBox:not(.fold) .phd .btn.small{font-size:10px;padding:1px 6px!important;min-height:22px}
  body.touchui #partyBox .pmr{padding:1px 0}
}
/* phones: the shortcut page button (js/hotpage.js) */
#hotPage{position:fixed;z-index:3;width:40px;height:40px;border-radius:50%;padding:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;cursor:pointer;
  color:#ffe7a0;background:radial-gradient(circle at 35% 28%,#3a3220,#120e07 72%);border:2px solid #c9a050;box-shadow:0 0 0 1px #000,0 4px 10px rgba(0,0,0,.5);transition:opacity .45s ease,transform .45s ease}
#hotPage[hidden]{display:none}
#hotPage b{font:800 15px/1 Inter,var(--ui)}
#hotPage .dots{display:flex;gap:3px}#hotPage .dots i{width:4px;height:4px;border-radius:50%;background:rgba(255,231,160,.3)}#hotPage .dots i.on{background:#ffcf5a;box-shadow:0 0 4px #ffcf5a}
#hotPage:active{transform:scale(.92)}
#hotPage.flip b{animation:hpFlip .28s ease-out}
@keyframes hpFlip{0%{transform:rotateX(90deg);opacity:.2}100%{transform:none;opacity:1}}
#hotPage:focus-visible{outline:2px solid var(--accent,#f0b54a);outline-offset:2px}
@media (prefers-reduced-motion:reduce){#hotPage.flip b{animation:none}}
/* phones sideways: keep the weight line (small), it turns orange with a warning when too heavy */
@media (orientation:landscape) and (max-height:520px){body.touchui #hud #weight{display:block!important;font-size:10px;line-height:1.2;margin-top:2px}}
/* forge: gear-type tabs and sections */
.ftabs{display:flex;flex-wrap:wrap;gap:5px;margin:8px 0 4px}
.ftabs .cxchip{position:relative}
.ftabs .fdot{position:absolute;top:-2px;right:-2px;width:9px;height:9px;border-radius:50%;background:#7fd38a;box-shadow:0 0 0 2px rgba(14,18,26,.95),0 0 6px rgba(127,211,138,.8)}
.fsec{display:flex;align-items:baseline;gap:6px;margin:14px 0 4px!important}
.fsec{color:#e8c870!important}.fsec .muted{font-size:13px}
/* "new version" pill (js/update.js) */
#updPill{position:fixed;top:calc(max(8px,env(safe-area-inset-top)) + 52px);left:50%;transform:translate(-50%,-12px);opacity:0;z-index:40;display:flex;align-items:center;gap:8px;
  padding:7px 14px;border-radius:999px;cursor:pointer;color:#1a1306;font:600 13px Inter,var(--ui);background:linear-gradient(#ffe08a,#e8b43a);border:1px solid #fff2c0;
  box-shadow:0 0 0 1px #6b4a12,0 8px 22px rgba(0,0,0,.5),0 0 18px rgba(255,207,90,.5);transition:opacity .3s,transform .3s cubic-bezier(.2,1.4,.4,1);white-space:nowrap}
#updPill.show{opacity:1;transform:translate(-50%,0)}
#updPill .ud{font-size:16px;animation:updSpin 2.4s linear infinite}
#updPill b{font-weight:800}
@keyframes updSpin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){#updPill .ud{animation:none}#updPill{transition:none}}
/* ===== phones sideways: the Equipment window fits on one screen =====
   small character on the left, the six slots as a 3x2 grid of compact cards, stats in one strip below */
@media (orientation:landscape) and (max-height:520px){
  body.touchui #panel:has(.eqgrid){width:min(980px,calc(100vw - 20px))!important;max-height:calc(100vh - 12px)!important;top:50%!important;left:50%!important;transform:translate(-50%,-50%)!important;padding:8px 12px 10px!important}
  body.touchui #panel:has(.eqgrid) h2{font-size:20px;margin:0}
  body.touchui #panel:has(.eqgrid) .sub{font-size:11px;margin:0 0 4px}
  body.touchui #panel .eqgrid{grid-template-columns:92px repeat(3,minmax(0,1fr));grid-auto-rows:auto;gap:6px;align-items:stretch;margin:4px 0 6px}
  body.touchui #panel .eqcol{display:contents}
  body.touchui #panel #eqCv{grid-column:1;grid-row:1/3;width:92px;height:auto;aspect-ratio:4/5;align-self:center}
  body.touchui #panel .eqslot{display:grid;grid-template-columns:30px minmax(0,1fr) auto;grid-template-rows:auto;align-items:center;column-gap:6px;padding:5px 6px}
  body.touchui #panel .eqslot .ico{width:30px;height:30px}
  body.touchui #panel .eqslot .eqk{font-size:9px;line-height:1}
  body.touchui #panel .eqslot .nm{font-size:12px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  body.touchui #panel .eqslot .ds{font-size:10px;line-height:1.25;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  body.touchui #panel .eqslot>.btn{padding:2px 8px!important;font-size:11px;min-height:26px;align-self:center}
  body.touchui #panel:has(.eqgrid) .dv{display:flex;flex-wrap:wrap;gap:2px 14px;font-size:11.5px}
  body.touchui #panel:has(.eqgrid) .dv>div{gap:5px}
}
@media (orientation:landscape) and (max-height:520px) and (max-width:760px){
  body.touchui #panel .eqgrid{grid-template-columns:84px repeat(2,minmax(0,1fr));gap:5px}
  body.touchui #panel #eqCv{grid-row:1/4;width:84px}
  body.touchui #panel .eqslot{padding:4px 6px}
  body.touchui #panel .eqslot .ds{-webkit-line-clamp:1}
  body.touchui #panel:has(.eqgrid) .sub{display:none}
}
/* General Store: gold and live weight in the header */
.shopstat{display:flex;flex-direction:column;align-items:flex-end;gap:3px;font-variant-numeric:tabular-nums}
.shopwt{display:flex;flex-direction:column;align-items:flex-end;gap:2px;font-size:11.5px;color:var(--muted)}
.shopwt i{display:block;width:96px;height:4px;border-radius:2px;background:linear-gradient(90deg,#7fd38a var(--f),rgba(255,255,255,.12) var(--f))}
.shopwt.warn{color:#e8a33d}.shopwt.warn i{background:linear-gradient(90deg,#e8a33d var(--f),rgba(255,255,255,.12) var(--f))}
.shopwt.bad{color:#ef7a6f}.shopwt.bad i{background:linear-gradient(90deg,#ef7a6f var(--f),rgba(255,255,255,.12) var(--f))}
/* ===== phones: the Equipment window fills the screen (it gets .npcfull from js/npcfull.js) ===== */
body.touchui #panel.npcfull:has(.eqgrid){display:flex;flex-direction:column}
body.touchui #panel.npcfull:has(.eqgrid)>*:not(.x){max-width:none;width:100%}
@media (orientation:landscape) and (max-height:520px){
  body.touchui #panel.npcfull:has(.eqgrid){width:100%!important;max-width:none!important;height:100%!important;max-height:none!important;top:0!important;left:0!important;transform:none!important;
    padding:calc(max(8px,env(safe-area-inset-top)) + 4px) max(16px,env(safe-area-inset-right)) calc(max(8px,env(safe-area-inset-bottom)) + 6px) max(16px,env(safe-area-inset-left))!important}
  body.touchui #panel.npcfull:has(.eqgrid) h2{font-size:24px}
  body.touchui #panel.npcfull:has(.eqgrid) .sub{display:block;font-size:12px;margin:0 0 6px}
  body.touchui #panel.npcfull .eqgrid{flex:1;min-height:0;grid-template-columns:clamp(110px,16vw,170px) repeat(3,minmax(0,1fr));grid-template-rows:1fr 1fr;gap:8px;margin:2px 0 8px}
  body.touchui #panel.npcfull #eqCv{grid-row:1/3;width:100%;height:100%;aspect-ratio:auto;object-fit:contain;align-self:stretch}
  body.touchui #panel.npcfull .eqslot{grid-template-columns:40px minmax(0,1fr) auto;padding:8px 10px;align-content:center}
  body.touchui #panel.npcfull .eqslot .ico{width:40px;height:40px}
  body.touchui #panel.npcfull .eqslot .eqk{font-size:10px}
  body.touchui #panel.npcfull .eqslot .nm{font-size:14px;white-space:normal}
  body.touchui #panel.npcfull .eqslot .ds{font-size:11.5px;-webkit-line-clamp:4}
  body.touchui #panel.npcfull .eqslot>.btn{min-height:32px;padding:4px 12px!important;font-size:12px}
  body.touchui #panel.npcfull:has(.eqgrid) .dv{font-size:13px;gap:4px 20px;padding:6px 2px 0;border-top:1px solid rgba(255,255,255,.08)}
}
@media (orientation:landscape) and (max-height:520px) and (max-width:760px){
  body.touchui #panel.npcfull .eqgrid{grid-template-columns:clamp(96px,16vw,130px) repeat(2,minmax(0,1fr));grid-template-rows:repeat(3,1fr);gap:6px}
  body.touchui #panel.npcfull #eqCv{grid-row:1/4}
  body.touchui #panel.npcfull .eqslot{padding:5px 8px;grid-template-columns:32px minmax(0,1fr) auto}
  body.touchui #panel.npcfull .eqslot .ico{width:32px;height:32px}
  body.touchui #panel.npcfull .eqslot .nm{font-size:12.5px}
  body.touchui #panel.npcfull .eqslot .ds{-webkit-line-clamp:2;font-size:10.5px}
  body.touchui #panel.npcfull:has(.eqgrid) .sub{display:none}
}
@media (orientation:portrait){body.touchui #panel.npcfull .eqgrid{align-items:start}body.touchui #panel.npcfull #eqCv{justify-self:center}}
/* sideways: Sit moved next to Auto, so Menu sits alone at the top */
@media (orientation:landscape) and (max-height:520px){body.touchui #actions>#menuBtn{left:42%}body.touchui #actions>#sitBtn.sitR:active{transform:scale(.94)!important}}
/* sideways: the guild war banner sits compact in the top row (js/quickleft.js places it) */
body.touchui #gwBar.gwTop{transform:none!important;font-size:10.5px;padding:4px 10px;gap:6px 8px;line-height:1.25;justify-content:flex-start}
body.touchui #gwBar.gwTop i{width:40px}

/* Gemcutter Sela: awakening and sigil fusion (js/awaken.js) */
.awbox{border:1px solid rgba(255,215,106,.35);border-radius:12px;padding:12px;margin:8px 0;background:rgba(255,215,106,.06)}
.awrow{display:flex;gap:10px;align-items:baseline;margin-top:6px}.awrow span{min-width:42px}
.fusetray{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:10px 0}
.fuseslot{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:64px;border:1px dashed rgba(255,255,255,.2);border-radius:10px;padding:6px;font:inherit;color:inherit;background:rgba(255,255,255,.03)}
.fuseslot.full{border-style:solid;border-color:rgba(200,176,255,.5);cursor:pointer}.fuseslot span{font-size:11px;text-align:center;overflow:hidden;text-overflow:ellipsis;max-width:100%;white-space:nowrap}

/* Build guide (js/buildguide.js) */
.bgcard{border:1px solid rgba(255,255,255,.12);border-radius:12px;padding:12px;margin:10px 0;background:rgba(255,255,255,.03)}
.bgcard.on{border-color:rgba(240,181,74,.6);background:rgba(240,181,74,.07)}
.bghead{display:flex;gap:10px;align-items:flex-start}
.bgroute{display:flex;flex-wrap:wrap;gap:4px;align-items:center;margin:8px 0;font-size:12px}.bgroute span{padding:2px 8px;border-radius:999px;background:rgba(255,255,255,.07)}
.bgroute span.here{background:rgba(240,181,74,.25);color:#ffe0a0}.bgroute i{font-style:normal;color:var(--muted)}
.bgnext{margin:6px 0;padding:6px 10px;border-radius:8px;background:rgba(143,224,168,.1);color:#bff0cc;font-size:13px}
.bgstats{display:grid;gap:4px}.bgstats div{display:grid;grid-template-columns:38px 1fr 28px;gap:6px;align-items:center;font-size:12px}
.bgstats i{display:block;height:6px;border-radius:3px;background:linear-gradient(90deg,#f0b54a,#ff7a45)}.bgstats b{text-align:right}
.bgskills{display:flex;flex-wrap:wrap;gap:5px}.bgtier{width:100%;font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin-top:4px}
.bgsk{display:inline-flex;align-items:center;gap:4px;padding:3px 7px 3px 3px;border-radius:999px;background:rgba(255,255,255,.06);font-size:12px}
.bgsk img{width:18px;height:18px;border-radius:50%}.bgsk b{color:var(--muted);font-weight:600}.bgsk.done{opacity:.55}.bgsk.done b{color:#8fe0a8}
.bgsk.next{outline:2px solid #8fe0a8;background:rgba(143,224,168,.15)}
.bggear{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:6px}.bgit{display:inline-flex;align-items:center;gap:5px;font-size:12px;padding:2px 8px 2px 2px;border-radius:8px;background:rgba(255,255,255,.05)}
.bgit .ico{width:22px;height:22px}
.bgbar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:8px 0;font-size:13px}
.snode.bgnextnode{outline:2px solid #8fe0a8;box-shadow:0 0 12px rgba(143,224,168,.35)}
.bgnextstat{outline:2px solid #8fe0a8}.bghint{font-size:11px;color:#8fe0a8;margin-left:6px}

/* phones sideways: full-screen windows use the width (two-column lists, the skill tree spreads out) */
@media (orientation:landscape) and (max-height:520px){
  body.touchui #panel.npcfull>*:not(.x){max-width:1180px}
  body.touchui #panel.npcfull .ttier{grid-template-columns:repeat(auto-fill,minmax(230px,1fr))}
  body.touchui #panel.npcfull:has(.ttier) .ttier{display:grid;gap:8px}
}
