*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#05040a;color:#fff;font-family:"PingFang SC",Inter,"Microsoft YaHei",system-ui,sans-serif}#app{position:relative;width:100vw;height:100vh;display:grid;place-items:center;background:radial-gradient(circle at center,#1a1430,#05040a 70%)}canvas{width:min(100vw,calc(100vh*16/9));height:min(100vh,calc(100vw*9/16));border:1px solid rgba(255,255,255,.12);box-shadow:0 24px 80px rgba(0,0,0,.45);background:#0b0a14}#ui{position:absolute;inset:0;pointer-events:none}.screen{position:absolute;inset:0;display:grid;place-items:center;background:linear-gradient(180deg,rgba(5,4,10,.86),rgba(5,4,10,.72));pointer-events:auto}.panel{width:min(980px,calc(100vw - 36px));padding:34px;border:1px solid rgba(250,204,21,.18);background:rgba(12,9,22,.86);box-shadow:0 28px 90px rgba(0,0,0,.5)}.panel h1{margin:0 0 8px;font-size:52px;color:#fff3be}.panel p{color:#cfc7df}.class-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-top:28px}.class-card{cursor:pointer;padding:20px;border:1px solid rgba(255,255,255,.1);background:rgba(255,255,255,.045);transition:.2s}.class-card:hover{transform:translateY(-4px);border-color:rgba(250,204,21,.45);box-shadow:0 18px 40px rgba(0,0,0,.32)}.class-card strong{display:block;font-size:24px;margin-bottom:8px}.class-card span{color:#facc15;font-size:13px}.hud{position:absolute;left:22px;top:22px;right:22px;display:flex;justify-content:space-between;gap:12px}.hud-card{padding:12px 14px;background:rgba(5,4,10,.66);border:1px solid rgba(255,255,255,.1);backdrop-filter:blur(8px);min-width:240px}.bar{height:10px;background:rgba(255,255,255,.12);margin-top:8px;overflow:hidden}.bar i{display:block;height:100%;background:linear-gradient(90deg,#ef4444,#facc15)}.bar.mp i{background:linear-gradient(90deg,#3b82f6,#a78bfa)}.help{position:absolute;left:22px;bottom:18px;padding:10px 14px;background:rgba(5,4,10,.6);border:1px solid rgba(255,255,255,.08);color:#cfc7df;font-size:13px}.toast{position:absolute;left:50%;top:90px;transform:translateX(-50%);padding:10px 16px;background:rgba(250,204,21,.92);color:#1a0d00;font-weight:900;opacity:0;transition:.25s}.toast.show{opacity:1}
@media(max-width:800px){.class-grid{grid-template-columns:1fr 1fr}.panel h1{font-size:38px}.hud{font-size:12px}.hud-card{min-width:0}}
.inventory{position:absolute;right:22px;top:92px;width:360px;max-height:calc(100vh - 130px);overflow:auto;padding:18px;background:rgba(7,5,14,.88);border:1px solid rgba(250,204,21,.22);box-shadow:0 24px 70px rgba(0,0,0,.45);pointer-events:auto}.inventory.hidden{display:none}.inventory h2{margin:0 0 12px;color:#fff3be}.equip-row{padding:12px;background:rgba(255,255,255,.045);border:1px solid rgba(255,255,255,.08);line-height:1.7;margin-bottom:12px}.inv-list{display:grid;gap:8px}.inv-list button{cursor:pointer;text-align:left;padding:10px 12px;background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.1);color:#fff}.inv-list button:hover{border-color:rgba(250,204,21,.45);background:rgba(250,204,21,.08)}.inv-list span{display:block;color:#facc15;font-size:12px}.inv-list b{display:inline-block;margin-right:10px}.inv-list em{color:#a78bfa;font-style:normal}.empty,.hint{color:#cfc7df;font-size:13px}.hint{margin-bottom:0}
@media(max-width:800px){.inventory{left:14px;right:14px;top:90px;width:auto}}
.skillbar{position:absolute;left:50%;bottom:22px;transform:translateX(-50%);display:flex;gap:12px;pointer-events:none}.slot{position:relative;width:68px;height:68px;border:1px solid rgba(250,204,21,.28);background:rgba(7,5,14,.76);display:grid;place-items:center;overflow:hidden;box-shadow:0 14px 34px rgba(0,0,0,.35)}.slot b{position:relative;z-index:2;color:#facc15;font-size:18px}.slot span{position:absolute;z-index:2;bottom:7px;font-size:11px;color:#ddd}.slot i{position:absolute;left:0;right:0;bottom:0;height:0;background:rgba(0,0,0,.62);z-index:3;transition:height .08s}.slot.ammo{border-color:rgba(96,165,250,.4)}.slot.hidden{display:none}
.load-card{width:220px;margin-top:16px;color:#fff}.screen .toast{position:static}.inventory h2{font-size:24px}.hud-card small{color:#cfc7df}
.result{position:absolute;inset:0;display:grid;place-items:center;background:rgba(0,0,0,.48);pointer-events:auto}.result.hidden{display:none}.result-panel{width:min(620px,calc(100vw - 32px));padding:28px;background:rgba(7,5,14,.94);border:1px solid rgba(250,204,21,.32);box-shadow:0 28px 90px rgba(0,0,0,.6);text-align:center}.result-panel h2{margin:0 0 8px;color:#fff3be;font-size:34px}.result-panel p{color:#cfc7df}.result-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:20px 0}.result-grid div{padding:16px;background:rgba(255,255,255,.045);border:1px solid rgba(255,255,255,.08)}.result-grid b{display:block;font-size:28px;color:#facc15}.result-grid span{font-size:12px;color:#cfc7df}.result-items{padding:14px;background:rgba(167,139,250,.08);border:1px solid rgba(167,139,250,.16);margin-bottom:18px}.result-panel button{cursor:pointer;padding:12px 28px;background:#facc15;border:0;color:#1a0d00;font-weight:900}
.storage-panel{width:520px}.storage-cols{display:grid;grid-template-columns:1fr 1fr;gap:12px}.storage-cols section{padding:12px;background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.08)}.storage-cols h3{margin:0 0 10px;color:#facc15;font-size:15px}.item-row{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:stretch;margin-bottom:8px}.item-row>span{display:block;padding:10px 12px;background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.08)}.item-row b{display:inline-block;margin-right:8px}.item-row em{color:#a78bfa;font-style:normal}.item-row .mini,.item-row button{cursor:pointer;padding:8px 10px;background:rgba(96,165,250,.16);border:1px solid rgba(96,165,250,.34);color:#dbeafe;font-weight:800}.item-row .mini:hover,.item-row button:hover{background:rgba(96,165,250,.26)}.quest-row{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:center;padding:10px;margin-bottom:8px;background:rgba(255,255,255,.045);border:1px solid rgba(255,255,255,.08)}.quest-row span{display:block;color:#facc15;font-size:12px}.quest-row b{font-size:16px}.quest-row p{margin:4px 0;color:#cfc7df}.quest-row em{font-style:normal;color:#a78bfa;font-size:12px}.quest-row button{cursor:pointer;padding:8px 12px;background:#facc15;border:0;color:#1a0d00;font-weight:900}.quest-row button:disabled{cursor:not-allowed;opacity:.35}.quest-row.claimed{opacity:.6}@media(max-width:800px){.storage-panel{width:auto}.storage-cols{grid-template-columns:1fr}}
.item-row small{display:block;margin-top:4px;color:#cfc7df;font-size:11px;line-height:1.35}.item-row.rarity-common{border-left:3px solid #cbd5e1}.item-row.rarity-rare{border-left:3px solid #60a5fa}.item-row.rarity-epic{border-left:3px solid #a78bfa}.item-row.rarity-legendary{border-left:3px solid #f59e0b;box-shadow:0 0 18px rgba(245,158,11,.16)}.item-row.rarity-rare b{color:#bfdbfe}.item-row.rarity-epic b{color:#ddd6fe}.item-row.rarity-legendary b{color:#fde68a}.item-row.rarity-legendary button:first-child,.item-row.rarity-epic button:first-child{background:linear-gradient(135deg,rgba(255,255,255,.06),rgba(250,204,21,.06))}
.item-actions{display:grid;gap:6px}.item-row .danger{background:rgba(239,68,68,.14);border-color:rgba(239,68,68,.35);color:#fecaca}.item-row .danger:hover{background:rgba(239,68,68,.24)}
.dialogue{position:absolute;left:50%;bottom:98px;transform:translateX(-50%);width:min(780px,calc(100vw - 32px));pointer-events:auto}.dialogue.hidden{display:none}.dialogue-panel{display:grid;grid-template-columns:92px 1fr;gap:16px;padding:18px;background:rgba(7,5,14,.94);border:1px solid rgba(167,139,250,.38);box-shadow:0 24px 80px rgba(0,0,0,.58)}.portrait{height:92px;display:grid;place-items:center;background:radial-gradient(circle,#a78bfa,#312e81);border:1px solid rgba(255,255,255,.16);font-size:42px;color:#fff3be}.dialogue-body h2{margin:0 0 6px;color:#ddd6fe}.dialogue-body p{margin:0;color:#d8d1e8;line-height:1.65}.dialogue-stats{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0}.dialogue-stats span{padding:5px 8px;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.08);color:#facc15;font-size:12px}.dialogue-actions{display:flex;gap:8px;flex-wrap:wrap}.dialogue-actions button{cursor:pointer;padding:9px 12px;background:rgba(167,139,250,.16);border:1px solid rgba(167,139,250,.36);color:#fff;font-weight:800}.dialogue-actions button:first-child{background:#facc15;color:#1a0d00;border-color:#facc15}.dialogue-actions button:disabled{opacity:.45;cursor:not-allowed}@media(max-width:800px){.dialogue{bottom:86px}.dialogue-panel{grid-template-columns:1fr}.portrait{height:54px}}
.objective{position:absolute;left:50%;top:22px;transform:translateX(-50%);min-width:260px;max-width:min(520px,calc(100vw - 44px));padding:10px 14px;background:rgba(7,5,14,.72);border:1px solid rgba(250,204,21,.28);box-shadow:0 16px 42px rgba(0,0,0,.38);text-align:center;pointer-events:none;backdrop-filter:blur(8px)}.objective.hidden{display:none}.objective b{display:block;color:#facc15;font-size:13px;letter-spacing:.08em}.objective span{display:block;margin-top:3px;color:#fff;font-weight:800}.objective em{display:inline-block;margin-top:5px;padding:3px 7px;background:rgba(250,204,21,.14);color:#fff3be;border:1px solid rgba(250,204,21,.22);font-style:normal;font-size:12px}@media(max-width:800px){.objective{top:78px;font-size:12px}.objective span{font-size:13px}}
.forge-panel{width:430px}.forge-card{padding:12px;margin-bottom:10px;background:rgba(255,255,255,.045);border:1px solid rgba(255,255,255,.08);border-left:3px solid #cbd5e1}.forge-card.rarity-rare{border-left-color:#60a5fa}.forge-card.rarity-epic{border-left-color:#a78bfa}.forge-card.rarity-legendary{border-left-color:#f59e0b;box-shadow:0 0 18px rgba(245,158,11,.14)}.forge-card span{display:block;color:#facc15;font-size:12px}.forge-card b{display:block;margin:4px 0;color:#fff}.forge-card em{display:block;color:#a78bfa;font-style:normal}.forge-card small{display:block;margin:5px 0 8px;color:#cfc7df;line-height:1.35}.forge-card button,.forge-tools button{cursor:pointer;width:100%;padding:9px 10px;background:rgba(249,115,22,.18);border:1px solid rgba(249,115,22,.38);color:#fed7aa;font-weight:900}.forge-card button:disabled{opacity:.42;cursor:not-allowed}.forge-tools{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:10px 0}.forge-tools button{background:rgba(250,204,21,.14);border-color:rgba(250,204,21,.3);color:#fff3be}@media(max-width:800px){.forge-panel{width:auto}}
.overlay-canvas{position:absolute;width:min(100vw,calc(100vh*16/9));height:min(100vh,calc(100vw*9/16));pointer-events:none;z-index:1}#ui{z-index:2}.hud,.objective,.help,.skillbar,.toast,.inventory,.dialogue,.result{z-index:3}
#game,#overlay{position:absolute;inset:auto;width:min(100vw,calc(100vh*16/9));height:min(100vh,calc(100vw*9/16));max-width:100vw;max-height:100vh}#overlay{pointer-events:none;z-index:1}.overlay-canvas{display:none}#rotateNotice{display:none;position:fixed;inset:0;z-index:20;place-items:center;text-align:center;padding:28px;background:radial-gradient(circle at center,#1a1430,#05040a 72%);color:#fff}#rotateNotice strong{display:block;font-size:28px;color:#facc15;margin-bottom:10px}#rotateNotice span{display:block;max-width:340px;line-height:1.7;color:#d8d1e8}@media (orientation:portrait) and (max-width:900px){#app{display:grid;place-items:center}#game,#overlay,#ui{visibility:hidden}#rotateNotice{display:grid}}@media (orientation:landscape) and (max-height:520px){.hud{left:10px;top:8px;right:10px}.hud-card{padding:8px 10px;font-size:12px;min-width:180px}.objective{top:8px;padding:7px 10px}.help{left:10px;bottom:8px;font-size:11px;padding:7px 9px}.skillbar{bottom:8px}.slot{width:54px;height:54px}.panel{padding:20px}.panel h1{font-size:34px}.class-grid{gap:10px}.class-card{padding:12px}.inventory{top:58px;right:10px;max-height:calc(100vh - 70px)}}


/* Authoritative mobile game-frame layout: webpage always renders as a landscape game canvas.
   We rotate the page content, not the browser/system orientation, and never hide the game behind a prompt. */
html,body{position:fixed;inset:0;width:100%;height:100%;overflow:hidden;touch-action:none;overscroll-behavior:none;background:#05040a;}
#app{position:fixed;left:0;top:0;width:100vw;height:100vh;display:block;overflow:hidden;background:#05040a;}
#game,#overlay{position:absolute;left:0;top:0;width:100vw;height:100vh;max-width:none;max-height:none;border:0;box-shadow:none;}
#overlay{pointer-events:none;z-index:1}.overlay-canvas{display:none}#ui{position:absolute;inset:0;z-index:2;pointer-events:none}.hud,.objective,.help,.skillbar,.toast,.inventory,.dialogue,.result{z-index:3}#rotateNotice{display:none!important}
@media (orientation:portrait) and (max-width:900px){
  #app{width:100vh;height:100vw;left:50%;top:50%;transform:translate(-50%,-50%) rotate(90deg);transform-origin:center center;}
  #game,#overlay{width:100%;height:100%;}
  #ui{width:100%;height:100%;}
  .hud{left:10px;top:8px;right:10px;font-size:12px}.hud-card{padding:8px 10px;min-width:180px}.objective{top:8px;padding:7px 10px}.help{left:10px;bottom:8px;font-size:11px;padding:7px 9px}.skillbar{bottom:8px}.slot{width:54px;height:54px}.panel{width:min(92vh,calc(100vh - 28px));padding:18px}.panel h1{font-size:34px}.class-grid{grid-template-columns:repeat(4,1fr);gap:10px}.class-card{padding:12px}.inventory{top:58px;right:10px;width:340px;max-height:calc(100vw - 70px)}.dialogue{bottom:72px}.dialogue-panel{grid-template-columns:70px 1fr;padding:12px}.portrait{height:70px}
}
@media (orientation:landscape) and (max-height:520px){.hud{left:10px;top:8px;right:10px}.hud-card{padding:8px 10px;font-size:12px;min-width:180px}.objective{top:8px;padding:7px 10px}.help{left:10px;bottom:8px;font-size:11px;padding:7px 9px}.skillbar{bottom:8px}.slot{width:54px;height:54px}.panel{padding:20px}.panel h1{font-size:34px}.class-grid{gap:10px}.class-card{padding:12px}.inventory{top:58px;right:10px;max-height:calc(100vh - 70px)}}
/* Final override: never hide the game in portrait; rotated game-frame is the source of truth. */
@media (orientation:portrait) and (max-width:900px){#game,#overlay,#ui{visibility:visible!important}#rotateNotice{display:none!important}}


/* === UI polish pass === */
html,body{background:
  radial-gradient(circle at 20% 20%, rgba(250,204,21,.08), transparent 20%),
  radial-gradient(circle at 80% 20%, rgba(96,165,250,.10), transparent 18%),
  radial-gradient(circle at 50% 80%, rgba(167,139,250,.10), transparent 24%),
  linear-gradient(180deg,#080611,#05040a 65%);
  color:#f8fafc;
  font-feature-settings:"cv02","cv03","cv04","cv11";
}
#app{background:
  radial-gradient(circle at center, rgba(28,22,52,.65), rgba(5,4,10,.96) 70%),
  linear-gradient(180deg,#0b0a14,#05040a 64%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04), inset 0 0 120px rgba(0,0,0,.38);
}
#game,#overlay{border-radius:22px; filter:saturate(1.08) contrast(1.05) drop-shadow(0 24px 70px rgba(0,0,0,.48));}
#overlay{mix-blend-mode:screen;}
#ui{backdrop-filter:blur(2px);}

.hud{
  gap:14px;
  align-items:flex-start;
}
.hud-card,
.objective,
.help,
.toast,
.inventory,
.dialogue-panel,
.result-panel,
.panel,
.forge-card,
.equip-row,
.quest-row,
.storage-cols section,
.slot{
  border-radius:18px;
}
.hud-card{
  min-width:260px;
  padding:14px 16px;
  background:linear-gradient(180deg, rgba(14,17,28,.78), rgba(7,9,16,.66));
  border:1px solid rgba(255,255,255,.10);
  box-shadow:0 10px 30px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.05);
}
.hud-card b{display:block;font-size:18px;letter-spacing:.02em;text-shadow:0 2px 10px rgba(0,0,0,.45)}
.hud-card span{color:#e5e7eb;font-size:13px}
.bar{
  height:12px;
  border-radius:999px;
  overflow:hidden;
  background:rgba(255,255,255,.08);
  box-shadow:inset 0 2px 6px rgba(0,0,0,.45);
}
.bar i{
  border-radius:999px;
  box-shadow:0 0 12px rgba(250,204,21,.18);
}
.bar.mp i{box-shadow:0 0 12px rgba(96,165,250,.18)}

.objective{
  top:18px;
  padding:12px 18px;
  background:linear-gradient(180deg, rgba(17,22,36,.88), rgba(9,12,20,.84));
  border:1px solid rgba(250,204,21,.22);
  box-shadow:0 12px 36px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.04);
}
.objective b{font-size:12px;opacity:.95;letter-spacing:.12em}
.objective span{font-size:16px;line-height:1.35;margin-top:4px}
.objective em{
  border-radius:999px;
  padding:4px 10px;
  margin-top:8px;
  background:linear-gradient(180deg, rgba(250,204,21,.16), rgba(250,204,21,.08));
}

.help{
  left:22px;
  bottom:18px;
  padding:12px 16px;
  font-size:12px;
  letter-spacing:.03em;
  color:#e5e7eb;
  background:linear-gradient(180deg, rgba(8,10,16,.80), rgba(8,10,16,.62));
  border:1px solid rgba(255,255,255,.08);
  box-shadow:0 10px 28px rgba(0,0,0,.28);
}

.skillbar{gap:14px}
.slot{
  width:72px;
  height:72px;
  background:linear-gradient(180deg, rgba(10,13,21,.92), rgba(5,7,12,.90));
  border:1px solid rgba(250,204,21,.24);
  box-shadow:0 10px 28px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.03);
}
.slot b{font-size:19px;text-shadow:0 2px 12px rgba(0,0,0,.5)}
.slot span{bottom:8px;color:#e5e7eb}
.slot i{background:rgba(0,0,0,.56)}

.toast{
  top:82px;
  padding:12px 18px;
  background:linear-gradient(180deg, rgba(250,204,21,.95), rgba(245,158,11,.92));
  color:#241100;
  box-shadow:0 16px 40px rgba(0,0,0,.35);
  text-shadow:none;
}

.inventory,
.dialogue,
.result{
  backdrop-filter:blur(10px) saturate(1.1);
}
.inventory{
  border:1px solid rgba(255,255,255,.10);
  background:linear-gradient(180deg, rgba(10,12,18,.92), rgba(6,7,12,.88));
  box-shadow:0 18px 64px rgba(0,0,0,.48), inset 0 1px 0 rgba(255,255,255,.04);
}
.inventory h2,
.result-panel h2,
.panel h1{
  letter-spacing:.02em;
}
.inventory h2{
  margin-bottom:14px;
  font-size:24px;
  color:#fff7d1;
  text-shadow:0 2px 18px rgba(250,204,21,.18);
}
.inv-list button,
.item-row .mini,
.item-row button,
.forge-card button,
.forge-tools button,
.dialogue-actions button,
.result-panel button,
.quest-row button,
.class-card,
.panel button{
  border-radius:14px;
  transition:transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease, opacity .16s ease;
}
.inv-list button:hover,
.item-row .mini:hover,
.item-row button:hover,
.forge-card button:hover,
.forge-tools button:hover,
.dialogue-actions button:hover,
.result-panel button:hover,
.quest-row button:hover,
.panel button:hover,
.class-card:hover{
  transform:translateY(-1px);
}
.inv-list button{
  padding:12px 14px;
  background:linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.035));
  border:1px solid rgba(255,255,255,.08);
  box-shadow:0 8px 22px rgba(0,0,0,.18);
}
.inv-list button:hover{border-color:rgba(250,204,21,.42);background:rgba(250,204,21,.08)}
.item-row>span,
.equip-row,
.storage-cols section,
.quest-row{
  background:linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.03));
  border:1px solid rgba(255,255,255,.08);
  box-shadow:0 8px 22px rgba(0,0,0,.16);
}
.item-row small{line-height:1.45; color:#cbd5e1}
.item-row.rarity-legendary b{color:#fff0a8}
.item-row.rarity-legendary{box-shadow:0 0 18px rgba(245,158,11,.12)}

.dialogue-panel{
  border:1px solid rgba(167,139,250,.34);
  background:linear-gradient(180deg, rgba(10,12,18,.94), rgba(6,7,12,.90));
}
.portrait{
  border-radius:16px;
  border:1px solid rgba(255,255,255,.12);
  box-shadow:0 8px 24px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.04);
}
.dialogue-body h2{font-size:22px;color:#fff1d0}
.dialogue-actions button:first-child,
.forge-tools button:first-child,
.result-panel button{background:linear-gradient(180deg, #facc15, #f59e0b); color:#1a0d00; border-color:rgba(250,204,21,.4)}
.dialogue-actions button:not(:first-child),
.forge-card button,
.forge-tools button:not(:first-child),
.quest-row button{
  background:linear-gradient(180deg, rgba(167,139,250,.16), rgba(167,139,250,.10));
  border:1px solid rgba(167,139,250,.30);
}
.dialogue-actions button:disabled,
.quest-row button:disabled,
.forge-card button:disabled{opacity:.45; filter:grayscale(.35)}

.result-panel{
  background:linear-gradient(180deg, rgba(10,12,18,.95), rgba(6,7,12,.94));
  border:1px solid rgba(250,204,21,.30);
  box-shadow:0 24px 80px rgba(0,0,0,.58), inset 0 1px 0 rgba(255,255,255,.04);
}
.result-panel p{color:#d1d5db}

.panel{
  background:linear-gradient(180deg, rgba(12,14,24,.94), rgba(7,8,14,.92));
  border:1px solid rgba(250,204,21,.16);
  box-shadow:0 28px 90px rgba(0,0,0,.52), inset 0 1px 0 rgba(255,255,255,.04);
}
.panel h1{color:#fff4c2;text-shadow:0 2px 20px rgba(250,204,21,.12)}
.class-card{
  background:linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.03));
  border:1px solid rgba(255,255,255,.08);
  box-shadow:0 10px 26px rgba(0,0,0,.24);
}
.class-card:hover{border-color:rgba(250,204,21,.46);box-shadow:0 18px 40px rgba(0,0,0,.34)}

#game,#overlay{border-radius:24px; background:linear-gradient(180deg, #090715, #05040a);}
#overlay{mix-blend-mode:screen}
#app::before{
  content:'';
  position:absolute;inset:0;
  pointer-events:none;
  background:
    radial-gradient(circle at center, transparent 54%, rgba(0,0,0,.16) 74%, rgba(0,0,0,.38) 100%),
    linear-gradient(180deg, rgba(255,255,255,.02), rgba(0,0,0,.08));
  z-index:2;
}

@media (max-width:800px){
  .hud{left:12px;top:12px;right:12px;gap:10px}
  .hud-card{min-width:0}
  .inventory{left:12px;right:12px;top:76px;width:auto}
  .dialogue{bottom:76px;width:min(92vw,780px)}
}

/* Minimap / area panel polish */
.mini-map{position:absolute;right:22px;top:22px;width:206px;padding:12px;background:linear-gradient(180deg,rgba(10,13,21,.84),rgba(5,7,12,.76));border:1px solid rgba(250,204,21,.18);border-radius:18px;box-shadow:0 14px 42px rgba(0,0,0,.34),inset 0 1px 0 rgba(255,255,255,.04);backdrop-filter:blur(10px);pointer-events:none}.mini-map b{display:flex;align-items:center;gap:6px;font-size:12px;letter-spacing:.12em;color:#facc15;text-transform:uppercase}.mini-map b:before{content:'';width:7px;height:7px;border-radius:999px;background:#22c55e;box-shadow:0 0 12px rgba(34,197,94,.85)}.mini-map canvas{display:block;width:180px;height:120px;margin-top:8px;border-radius:12px;border:1px solid rgba(255,255,255,.08);box-shadow:inset 0 0 20px rgba(0,0,0,.45)}.mini-map span{display:block;margin-top:7px;color:#cbd5e1;font-size:11px;text-align:right}.hud{right:250px}.hud-card:nth-child(2){min-width:300px}.help{max-width:min(760px,calc(100vw - 44px));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.objective{min-width:320px}.skillbar{filter:drop-shadow(0 12px 24px rgba(0,0,0,.36))}@media(max-width:900px){.mini-map{right:10px;top:8px;width:158px;padding:8px}.mini-map canvas{width:140px;height:88px}.hud{right:178px}.hud-card:nth-child(2){display:none}.objective{min-width:220px;max-width:310px}.help{max-width:60vw}}@media (orientation:portrait) and (max-width:900px){.mini-map{right:10px;top:8px}.hud{right:178px}.help{max-width:58vh}}

/* Mobile action-game controls */
.touch-controls{position:absolute;inset:0;z-index:4;pointer-events:none;display:none}.joy{position:absolute;left:34px;bottom:34px;width:124px;height:124px;border-radius:50%;background:radial-gradient(circle,rgba(255,255,255,.08),rgba(255,255,255,.025));border:1px solid rgba(255,255,255,.16);box-shadow:0 16px 42px rgba(0,0,0,.34),inset 0 1px 0 rgba(255,255,255,.06);pointer-events:auto;touch-action:none}.joy:before{content:'';position:absolute;inset:22px;border-radius:50%;border:1px solid rgba(250,204,21,.20)}.joy i{position:absolute;left:50%;top:50%;width:52px;height:52px;border-radius:50%;transform:translate(-50%,-50%);background:radial-gradient(circle at 35% 30%,#fff7d1,#facc15 55%,#b45309);box-shadow:0 10px 24px rgba(0,0,0,.34),0 0 22px rgba(250,204,21,.22)}.touch-actions{position:absolute;right:34px;bottom:28px;width:178px;height:158px;pointer-events:none}.touch-btn{position:absolute;border-radius:50%;border:1px solid rgba(255,255,255,.16);color:#fff;font-weight:900;text-shadow:0 2px 8px rgba(0,0,0,.5);box-shadow:0 14px 34px rgba(0,0,0,.34),inset 0 1px 0 rgba(255,255,255,.08);pointer-events:auto;touch-action:none}.touch-btn.attack{right:0;bottom:0;width:82px;height:82px;font-size:24px;background:radial-gradient(circle at 35% 28%,#fde68a,#f59e0b 58%,#7c2d12)}.touch-btn.skill{right:86px;bottom:36px;width:66px;height:66px;font-size:20px;background:radial-gradient(circle at 35% 28%,#ddd6fe,#8b5cf6 58%,#4c1d95)}.touch-btn.small{width:46px;height:46px;font-size:15px;background:linear-gradient(180deg,rgba(15,23,42,.9),rgba(3,7,18,.86))}.touch-btn#touchPotion{right:82px;bottom:104px}.touch-btn#touchBag{right:28px;bottom:110px}.touch-btn:active{transform:scale(.94);filter:brightness(1.16)}
@media(max-width:900px){.touch-controls{display:block}.keyboard-skillbar{display:none}.help{display:none}.mini-map{opacity:.92}.objective{top:10px}.hud-card{transform:scale(.92);transform-origin:left top}}
@media (orientation:portrait) and (max-width:900px){.joy{left:26px;bottom:26px;width:112px;height:112px}.joy i{width:48px;height:48px}.touch-actions{right:24px;bottom:22px}.touch-btn.attack{width:78px;height:78px}.touch-btn.skill{width:62px;height:62px}.hud-card{transform:scale(.86);}.mini-map{transform:scale(.86);transform-origin:right top}}

/* production mobile: keep browser portrait, rotate game surface itself */
@media (orientation: portrait) and (max-width: 900px){
  html, body { width:100%; height:100%; overflow:hidden; background:#05040a; }
  #app{
    position:fixed;
    left:50%; top:50%;
    width:100vh;
    height:100vw;
    transform:translate(-50%,-50%) rotate(90deg);
    transform-origin:center center;
    overflow:hidden;
    display:block;
    background:#05040a;
  }
  #game, #overlay, .overlay-canvas{
    position:absolute;
    inset:0;
    width:100% !important;
    height:100% !important;
    max-width:none !important;
    max-height:none !important;
    border:0 !important;
    box-shadow:none !important;
  }
  #overlay{ pointer-events:none; z-index:1; }
  #ui{ position:absolute; inset:0; z-index:2; }
  .screen{ inset:0; }
  .panel{ width:min(760px, calc(100vh - 28px)); padding:24px; }
  .panel h1{ font-size:38px; }
  .class-grid{ grid-template-columns:repeat(4,1fr); gap:10px; }
  .class-card{ padding:14px; }
  .class-card strong{ font-size:20px; }
  .touch-controls{ display:block; }
  .joy{ left:26px; bottom:24px; width:112px; height:112px; }
  .touch-actions{ right:24px; bottom:20px; }
}

/* mobile UX polish: tighter HUD, better joystick feel */
.touch-controls{user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}.joy{width:138px;height:138px;left:30px;bottom:28px;background:radial-gradient(circle at center,rgba(255,255,255,.11),rgba(255,255,255,.035) 62%,rgba(250,204,21,.055));border:1px solid rgba(250,204,21,.24);box-shadow:0 18px 48px rgba(0,0,0,.42),inset 0 0 26px rgba(250,204,21,.06)}.joy:after{content:"";position:absolute;left:50%;top:50%;width:8px;height:8px;border-radius:50%;transform:translate(-50%,-50%);background:rgba(250,204,21,.55);box-shadow:0 0 12px rgba(250,204,21,.55)}.joy i{transition:transform .035s linear;will-change:transform}.touch-actions{width:210px;height:182px;right:30px;bottom:24px}.touch-btn{backdrop-filter:blur(8px);-webkit-tap-highlight-color:transparent}.touch-btn.attack{width:92px;height:92px;font-size:28px}.touch-btn.skill{right:98px;bottom:44px;width:72px;height:72px}.touch-btn.small{width:50px;height:50px}.touch-btn#touchPotion{right:96px;bottom:122px}.touch-btn#touchBag{right:36px;bottom:128px}
@media(max-width:900px){.hud{left:10px;top:8px;right:174px}.hud-card{padding:8px 10px;border-radius:12px;min-width:172px;background:rgba(5,4,10,.55)}.hud-card b{font-size:12px}.bar{height:7px;margin-top:5px}.mini-map{right:8px;top:7px;width:152px;border-radius:14px}.mini-map canvas{width:134px;height:82px}.mini-map b{font-size:10px}.mini-map span{font-size:10px}.objective{top:8px;min-width:0;max-width:270px;padding:7px 10px;border-radius:12px}.objective b{font-size:11px}.objective span{font-size:12px}.inventory{top:58px;left:12px;right:12px;max-height:calc(100vh - 72px);border-radius:16px}.dialogue{bottom:72px}.keyboard-skillbar{display:none!important}}
@media (orientation: portrait) and (max-width:900px){
  .hud{left:10px;top:8px;right:172px}.hud-card:nth-child(2){display:none!important}.objective{top:8px;left:50%;transform:translateX(-50%);max-width:248px}.mini-map{right:8px;top:8px;transform:none}.joy{left:24px;bottom:22px;width:126px;height:126px}.touch-actions{right:22px;bottom:20px;width:196px;height:170px}.touch-btn.attack{width:88px;height:88px}.touch-btn.skill{right:92px;bottom:42px;width:70px;height:70px}.touch-btn#touchPotion{right:92px;bottom:116px}.touch-btn#touchBag{right:34px;bottom:122px}.inventory{top:54px;max-height:calc(100vw - 64px)}
}

/* rotated portrait coordinate correction: place controls by visual position after 90deg transform */
@media (orientation: portrait) and (max-width:900px){
  .joy{
    left:auto !important;
    right:20px !important;
    bottom:18px !important;
    top:auto !important;
  }
  .touch-actions{
    left:auto !important;
    right:20px !important;
    top:20px !important;
    bottom:auto !important;
  }
  .hud{
    left:12px !important;
    top:10px !important;
    right:auto !important;
    width:220px !important;
    transform:none !important;
  }
  .mini-map{
    left:12px !important;
    right:auto !important;
    top:auto !important;
    bottom:10px !important;
    transform:none !important;
  }
  .objective{
    left:50% !important;
    top:8px !important;
    right:auto !important;
    transform:translateX(-50%) !important;
  }
}
