:root {
  --panel: rgba(9, 17, 28, .86);
  --panel2: rgba(17, 29, 45, .92);
  --line: rgba(133, 183, 255, .26);
  --text: #edf6ff;
  --muted: #9db3ca;
  --gold: #ffd36a;
  --danger: #ff5b6b;
  --mana: #5aa4ff;
  --xp: #8dff9e;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: #060b12; color: var(--text); font-family: Arial, Helvetica, sans-serif; }
#app { position: relative; width: 100vw; height: 100vh; background: radial-gradient(circle at center, #1a2733 0, #07101a 68%); }
#game { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; image-rendering: auto; }
.hud, .chat-panel, .inventory-panel, .hotbar, .help { backdrop-filter: blur(10px); border: 1px solid var(--line); box-shadow: 0 12px 40px rgba(0,0,0,.28); }
.hud { position: absolute; background: var(--panel); border-radius: 16px; padding: 12px; user-select: none; }
.top-left { left: 16px; top: 16px; width: 290px; }
.top-right { right: 16px; top: 16px; width: 210px; }
.char-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.avatar { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, #36a3ff, #7c4dff); font-weight: 900; letter-spacing: .5px; }
#charName { display: block; font-size: 16px; }
#charMeta { color: var(--muted); font-size: 12px; }
.bar { position: relative; height: 18px; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.08); margin: 7px 0; border: 1px solid rgba(255,255,255,.08); }
.bar span { display: block; height: 100%; width: 50%; transition: width .12s linear; }
.bar em { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; font-style: normal; text-shadow: 0 1px 2px #000; }
.hp span { background: linear-gradient(90deg, #b5152a, var(--danger)); }
.mp span { background: linear-gradient(90deg, #1769dd, var(--mana)); }
.xp span { background: linear-gradient(90deg, #2dbd62, var(--xp)); }
.gold { margin-top: 8px; color: var(--gold); font-size: 14px; }
#mini { width: 180px; height: 120px; display: block; border-radius: 12px; background: #0c1621; margin-top: 8px; border: 1px solid rgba(255,255,255,.09); }
.status, .online { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; margin-top: 8px; }
#netDot { width: 9px; height: 9px; border-radius: 50%; background: #ffb23e; display: inline-block; box-shadow: 0 0 10px currentColor; }
#netDot.ok { background: #54ff8b; }
#netDot.bad { background: #ff5368; }
.quest-panel { left: 16px; top: 220px; width: 290px; }
.quest-panel p { margin: 8px 0 0; color: var(--muted); line-height: 1.35; font-size: 13px; }
.target-panel { right: 16px; top: 215px; width: 210px; display: none; }
.target-panel.show { display: block; }
.target-panel button { width: 100%; margin-top: 8px; border: 0; border-radius: 10px; padding: 10px; background: #e84858; color: #fff; cursor: pointer; font-weight: 700; }
.chat-panel { position: absolute; left: 16px; bottom: 16px; width: 410px; height: 210px; background: var(--panel); border-radius: 16px; padding: 10px; }
#chatLog { height: 155px; overflow-y: auto; font-size: 13px; line-height: 1.35; padding-right: 4px; }
.msg { margin: 0 0 6px; color: #d5e5f6; }
.msg.system { color: #ffd36a; }
.msg b { color: #7ec7ff; }
#chatForm { display: flex; gap: 8px; margin-top: 8px; }
#chatInput { flex: 1; min-width: 0; border: 1px solid var(--line); background: rgba(255,255,255,.08); color: #fff; border-radius: 10px; padding: 10px; outline: none; }
#chatForm button { border: 0; background: #2c8dff; color: #fff; border-radius: 10px; padding: 0 13px; cursor: pointer; font-weight: 700; }
.inventory-panel { position: absolute; right: 16px; bottom: 16px; width: 260px; min-height: 190px; background: var(--panel); border-radius: 16px; padding: 12px; }
.panel-title { font-weight: 800; margin-bottom: 10px; }
.item { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; margin-bottom: 8px; font-size: 13px; }
.empty { color: var(--muted); font-size: 13px; }
.hotbar { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; gap: 8px; background: rgba(6, 12, 20, .72); padding: 10px; border-radius: 18px; }
.hotbar button { width: 58px; height: 54px; border: 1px solid rgba(255,255,255,.16); background: linear-gradient(180deg, #23364c, #111c2b); color: #fff; border-radius: 12px; cursor: pointer; font-weight: 800; }
.hotbar span { font-weight: 400; font-size: 10px; color: var(--muted); }
.login-card { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(460px, calc(100vw - 32px)); background: linear-gradient(180deg, rgba(14, 24, 38, .97), rgba(5, 10, 17, .97)); border: 1px solid rgba(106, 181, 255, .36); border-radius: 24px; padding: 26px; z-index: 10; box-shadow: 0 30px 110px rgba(0,0,0,.55); }
.login-card.hide { display: none; }
.brand-mark { width: 68px; height: 68px; border-radius: 22px; background: linear-gradient(135deg, #21a5ff, #7551ff); display: grid; place-items: center; font-size: 24px; font-weight: 900; margin: 0 auto 12px; box-shadow: 0 0 28px rgba(80,150,255,.45); }
.login-card h1 { margin: 0; text-align: center; }
.login-card p { color: var(--muted); text-align: center; line-height: 1.45; }
.login-card label { display: block; margin-top: 14px; margin-bottom: 6px; color: #c6d8eb; font-size: 13px; }
.login-card input { width: 100%; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.08); color: #fff; padding: 12px 14px; outline: none; }
.class-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.classBtn { border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06); color: #fff; border-radius: 14px; padding: 12px 6px; cursor: pointer; font-weight: 800; }
.classBtn span { display: block; font-size: 10px; color: var(--muted); margin-top: 4px; font-weight: 400; }
.classBtn.active { border-color: #57baff; box-shadow: inset 0 0 0 1px #57baff; background: rgba(42, 142, 255, .2); }
.primary { width: 100%; margin-top: 16px; border: 0; border-radius: 14px; padding: 13px; color: #fff; background: linear-gradient(90deg, #238dff, #7754ff); font-weight: 900; cursor: pointer; }
#loginHint { display: block; color: var(--muted); text-align: center; margin-top: 12px; }
#toast { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); background: rgba(7, 13, 21, .9); border: 1px solid var(--line); border-radius: 999px; padding: 12px 18px; color: #fff; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; box-shadow: 0 15px 50px rgba(0,0,0,.4); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }
.help { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); background: rgba(9,17,28,.72); color: var(--muted); border-radius: 999px; padding: 9px 14px; font-size: 12px; }
@media (max-width: 900px) {
  .top-left { width: calc(100vw - 32px); }
  .top-right, .quest-panel, .inventory-panel { display: none; }
  .chat-panel { width: calc(100vw - 32px); height: 165px; }
  #chatLog { height: 110px; }
  .hotbar { bottom: 190px; }
  .help { display: none; }
}
