:root {
  --panel: rgba(18, 14, 10, 0.84);
  --panel2: rgba(32, 25, 18, 0.95);
  --line: rgba(201, 162, 74, 0.55);
  --gold: #c9a24a;
  --gold2: #f2d58a;
  --text: #f1e7d2;
  --muted: #b5a68a;
  --hp: #c93434;
  --mp: #3a6ad0;
  --xp: #d8b040;
  --good: #6fdc6f;
  --warn: #ffb34a;
  --font: 'Kanit', 'Leelawadee UI', 'Leelawadee', 'Tahoma', sans-serif;
  --title: 'Cinzel', 'Kanit', serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0c0a08; color: var(--text); font-family: var(--font); font-size: 14px; user-select: none; -webkit-user-select: none; }
canvas#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
.hidden { display: none !important; }
button { font-family: var(--font); cursor: pointer; }
input, select { font-family: var(--font); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 22px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(0, 0, 0, 0.45); }

/* ---------- ปุ่ม */
.btn { background: linear-gradient(#3a2f22, #241c14); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 7px 14px; font-size: 14px; transition: filter .12s, transform .06s; }
.btn:hover:not(:disabled) { filter: brightness(1.25); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.gold { background: linear-gradient(#d9b45a, #9a7426); color: #1d140a; font-weight: 600; border-color: #f0d590; }
.btn.red { background: linear-gradient(#a33a2e, #6e2018); border-color: #d77a6a; }
.btn.small { padding: 3px 9px; font-size: 12px; }
.btn.big { padding: 11px 20px; font-size: 17px; width: 100%; }

/* ---------- หน้าจอโหลด / ล็อกอิน */
#loading { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, #2a2016 0%, #0c0a08 70%); z-index: 50; gap: 10px; }
.logo { font-family: var(--title); font-weight: 800; font-size: 54px; letter-spacing: 6px; color: var(--gold2); text-shadow: 0 0 18px rgba(242, 213, 138, 0.35), 0 3px 0 #5a4214; line-height: 1; text-align: center; }
.logo small { display: block; font-size: 17px; letter-spacing: 12px; color: var(--gold); margin-top: 4px; }
.sub { color: var(--muted); font-size: 15px; letter-spacing: 1px; text-align: center; }
#load-bar { width: 360px; max-width: 80vw; height: 10px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; margin-top: 18px; background: rgba(0, 0, 0, 0.4); }
#load-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #9a7426, #f2d58a); transition: width .25s; }
#load-text { color: var(--muted); font-size: 13px; }

#login { position: fixed; inset: 0; display: flex; align-items: center; justify-content: flex-start; padding-left: 6vw; z-index: 40; background: linear-gradient(90deg, rgba(8, 6, 4, 0.75) 0%, rgba(8, 6, 4, 0.2) 55%, transparent 100%); }
.login-panel { width: 440px; max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); overflow-y: auto; padding: 22px 24px; background: var(--panel2); }
.login-panel .logo { font-size: 40px; }
.login-panel .sub { margin: 6px 0 14px; }
#login-form label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 9px; }
#login-form input { display: block; width: 100%; margin-top: 4px; padding: 9px 11px; background: rgba(0, 0, 0, 0.45); border: 1px solid var(--line); border-radius: 6px; color: var(--text); font-size: 15px; outline: none; }
#login-form input:focus { border-color: var(--gold2); box-shadow: 0 0 0 2px rgba(242, 213, 138, 0.2); }
.lg-section { margin: 12px 0 7px; color: var(--gold2); font-size: 14px; }
.lg-section small { color: var(--muted); font-size: 12px; }
#lg-classes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cls-card { border: 1px solid rgba(201, 162, 74, 0.3); border-radius: 8px; padding: 9px 6px; text-align: center; background: rgba(0, 0, 0, 0.3); cursor: pointer; transition: all .12s; }
.cls-card:hover { border-color: var(--gold); }
.cls-card.sel { border-color: var(--gold2); background: rgba(201, 162, 74, 0.18); box-shadow: 0 0 12px rgba(242, 213, 138, 0.25); }
.cls-card .ci { font-size: 28px; }
.cls-card .cn { font-weight: 600; margin-top: 2px; }
.cls-card .cd { font-size: 11px; color: var(--muted); line-height: 1.35; margin-top: 3px; }
#lg-looks .look-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
#lg-looks .look-row span { width: 54px; }
.sw { width: 24px; height: 24px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, 0.6); cursor: pointer; }
.sw.sel { border-color: var(--gold2); box-shadow: 0 0 0 2px rgba(242, 213, 138, 0.45); }
#lg-error { color: #ff8a7a; min-height: 20px; margin: 8px 0 6px; font-size: 13px; }
.lg-note { color: var(--muted); font-size: 12px; margin-top: 8px; text-align: center; }
#lg-status { font-size: 12px; margin-top: 6px; text-align: center; color: var(--muted); }
#lg-status.ok { color: var(--good); }
#lg-status.bad { color: #ff8a7a; }

/* ---------- HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#hud > * { pointer-events: auto; }
#hud > #toasts, #hud > #zone-banner, #hud > #prompt, #hud > #lock-hint, #hud > #tracker { pointer-events: none; }
.bar { position: relative; height: 15px; background: rgba(0, 0, 0, 0.55); border-radius: 4px; overflow: hidden; border: 1px solid rgba(0, 0, 0, 0.6); margin-top: 4px; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; transition: width .2s; }
.bar.hp i { background: linear-gradient(#e85a4a, #a32020); }
.bar.mp i { background: linear-gradient(#5a8cf0, #2443a0); }
.bar span { position: absolute; inset: 0; text-align: center; font-size: 11px; line-height: 14px; text-shadow: 0 1px 2px #000; }
.bar.big { height: 18px; }
.bar.big span { line-height: 17px; font-size: 12px; }

#pframe { position: absolute; left: 12px; top: 12px; width: 290px; padding: 9px 11px; display: flex; gap: 10px; align-items: center; }
.pf-icon { width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 26px; background: radial-gradient(#4a3a26, #1a140e); border: 2px solid var(--gold); flex: none; }
.pf-main { flex: 1; min-width: 0; }
.pf-name { display: flex; justify-content: space-between; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; }
.pf-lv { color: var(--gold2); font-weight: 400; font-size: 13px; }
#pf-buffs { display: flex; gap: 4px; margin-top: 4px; min-height: 0; }
.buff { font-size: 11px; padding: 0 6px; border-radius: 9px; background: rgba(200, 60, 40, 0.5); border: 1px solid #e88a6a; }

#party { position: absolute; left: 12px; top: 96px; width: 210px; display: flex; flex-direction: column; gap: 6px; }
.pm { padding: 6px 9px; font-size: 13px; }
.pm .pm-name { display: flex; justify-content: space-between; }
.pm .bar { height: 9px; margin-top: 3px; }
.pm.dead { opacity: .55; }
.pm.far .pm-name::after { content: ' (ไกล)'; color: var(--muted); font-size: 11px; }

#target { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); width: 360px; padding: 8px 12px; text-align: center; }
.tg-name { font-weight: 600; font-size: 15px; }
#tg-lv { color: var(--gold2); font-weight: 400; font-size: 13px; margin-left: 6px; }
#tg-tag { font-size: 11px; padding: 0 6px; border-radius: 6px; margin-right: 6px; }
#tg-tag.elite { background: #6a4a10; border: 1px solid #f0c04a; color: #ffe08a; }
#tg-tag.boss { background: #4a1060; border: 1px solid #c07aff; color: #e8c8ff; }

#mapbox { position: absolute; right: 12px; top: 12px; width: 204px; padding: 9px; text-align: center; }
#minimap { width: 184px; height: 184px; border-radius: 50%; border: 2px solid var(--gold); display: block; margin: 0 auto; background: #2a3a22; }
#zone-name { margin-top: 5px; font-weight: 600; color: var(--gold2); font-size: 14px; }
.mapinfo { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 2px; }

#tracker { position: absolute; right: 12px; top: 268px; width: 260px; display: flex; flex-direction: column; gap: 6px; }
.tq { background: rgba(18, 14, 10, 0.62); border-left: 3px solid var(--gold); padding: 6px 9px; border-radius: 4px; font-size: 13px; text-shadow: 0 1px 2px #000; }
.tq .tq-name { color: var(--gold2); font-weight: 600; }
.tq .tq-goal { color: var(--text); font-size: 12px; }
.tq.done .tq-goal { color: var(--good); }

#skillbar { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); display: flex; gap: 6px; padding: 7px 9px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.slot { position: relative; width: 54px; height: 54px; border-radius: 8px; background: radial-gradient(#3a2e20, #17120c); border: 1px solid rgba(201, 162, 74, 0.6); display: flex; align-items: center; justify-content: center; font-size: 26px; overflow: hidden; }
.slot .key { position: absolute; left: 3px; top: 1px; font-size: 11px; color: var(--gold2); text-shadow: 0 1px 2px #000; }
.slot .cost { position: absolute; right: 3px; bottom: 1px; font-size: 10px; color: #9ab8ff; text-shadow: 0 1px 2px #000; }
.slot .cnt { position: absolute; right: 3px; bottom: 1px; font-size: 12px; font-weight: 600; text-shadow: 0 1px 2px #000; }
.slot .cd { position: absolute; inset: 0; background: conic-gradient(rgba(0, 0, 0, 0.72) calc(var(--cd, 0) * 360deg), transparent 0); pointer-events: none; }
.slot .cdt { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 600; text-shadow: 0 1px 3px #000; pointer-events: none; }
.slot.nomp { filter: saturate(0.3) brightness(0.7); }
.slot.flash { animation: slotflash .25s; }
.slot-sep { width: 8px; }
@keyframes slotflash { 0% { box-shadow: 0 0 0 0 rgba(255, 230, 150, 0.9); } 100% { box-shadow: 0 0 0 10px rgba(255, 230, 150, 0); } }

#xpbar { position: absolute; left: 0; right: 0; bottom: 0; height: 14px; background: rgba(0, 0, 0, 0.7); border-top: 1px solid var(--line); }
#xp-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(#f0cd60, #a07a18); transition: width .3s; }
#xp-text { position: absolute; inset: 0; text-align: center; font-size: 11px; line-height: 13px; text-shadow: 0 1px 2px #000; }

#chat { position: absolute; left: 12px; bottom: 26px; width: 400px; height: 214px; display: flex; flex-direction: column; padding: 6px; background: rgba(18, 14, 10, 0.55); }
#chat-log { flex: 1; overflow-y: auto; font-size: 13px; line-height: 1.45; padding: 2px 4px; user-select: text; -webkit-user-select: text; scrollbar-width: thin; }
#chat-log .cm { text-shadow: 0 1px 2px #000; word-wrap: break-word; }
#chat-log .cm b { color: var(--gold2); font-weight: 500; }
#chat-log .ch-s { color: #ffd77a; }
#chat-log .ch-w, #chat-log .ch-wo { color: #ff9ad8; }
#chat-log .ch-p { color: #7fdcff; }
#chat-input { margin-top: 4px; padding: 6px 9px; background: rgba(0, 0, 0, 0.55); border: 1px solid rgba(201, 162, 74, 0.35); border-radius: 5px; color: var(--text); font-size: 13px; outline: none; }
#chat-input:focus { border-color: var(--gold2); }

#menu-buttons { position: absolute; right: 12px; bottom: 26px; display: flex; gap: 6px; }
#menu-buttons button { position: relative; width: 46px; height: 46px; font-size: 21px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; color: var(--text); }
#menu-buttons button:hover { filter: brightness(1.35); }
#menu-buttons button span { position: absolute; right: 3px; bottom: 1px; font-size: 10px; color: var(--gold2); }

#prompt { position: absolute; left: 50%; bottom: 104px; transform: translateX(-50%); padding: 7px 16px; background: rgba(18, 14, 10, 0.8); border: 1px solid var(--line); border-radius: 20px; font-size: 14px; }
#prompt kbd { background: var(--gold); color: #1d140a; border-radius: 4px; padding: 0 6px; font-family: var(--font); font-weight: 600; }
#lock-hint { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); padding: 8px 16px; background: rgba(0, 0, 0, 0.6); border-radius: 20px; font-size: 14px; }
#toasts { position: absolute; left: 50%; top: 86px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 5px; }
.toast { padding: 6px 16px; border-radius: 18px; background: rgba(18, 14, 10, 0.85); border: 1px solid var(--line); font-size: 14px; animation: toastin .25s ease-out, toastout .5s ease-in 2.6s forwards; text-shadow: 0 1px 2px #000; }
.toast.quest { border-color: #f0c04a; color: #ffe08a; }
.toast.lvl { border-color: #f0c04a; color: #fff0b0; font-size: 17px; font-weight: 600; background: rgba(90, 60, 10, 0.88); }
.toast.warn { border-color: #e8885a; color: #ffc0a0; }
.toast.gold { color: #ffe08a; }
.toast.loot { color: #d8ffd8; }
@keyframes toastin { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes toastout { to { opacity: 0; transform: translateY(-6px); } }
#zone-banner { position: absolute; left: 0; right: 0; top: 21%; text-align: center; opacity: 0; transition: opacity .8s; text-shadow: 0 2px 10px #000, 0 0 2px #000; }
#zone-banner.show { opacity: 1; }
.zb-name { font-size: 36px; font-weight: 600; color: var(--gold2); letter-spacing: 1px; }
.zb-sub { font-size: 16px; color: var(--text); }

#crosshair { position: fixed; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; pointer-events: none; z-index: 9; }
#crosshair::before, #crosshair::after { content: ''; position: absolute; background: rgba(255, 255, 255, 0.85); box-shadow: 0 0 2px #000; }
#crosshair::before { left: 10px; top: 3px; width: 2px; height: 16px; }
#crosshair::after { left: 3px; top: 10px; width: 16px; height: 2px; }
#crosshair.enemy::before, #crosshair.enemy::after { background: #ff6a5a; }

#vignette { position: fixed; inset: 0; pointer-events: none; z-index: 8; opacity: 0; transition: opacity .3s; background: radial-gradient(ellipse at center, transparent 55%, rgba(150, 0, 0, 0.55) 100%); }
#hurt-flash { position: fixed; inset: 0; pointer-events: none; z-index: 8; opacity: 0; background: radial-gradient(ellipse at center, transparent 40%, rgba(200, 20, 20, 0.45) 100%); }
#hurt-flash.on { animation: hurt .4s ease-out; }
@keyframes hurt { from { opacity: 1; } to { opacity: 0; } }

/* ---------- ป้ายชื่อและตัวเลขดาเมจ */
#labels { position: fixed; inset: 0; pointer-events: none; z-index: 6; overflow: hidden; }
.tag { position: absolute; left: 0; top: 0; text-align: center; white-space: nowrap; will-change: transform; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.tag .tn { font-size: 13px; font-weight: 500; }
.tag .tn .lv { color: var(--gold2); font-size: 11px; margin-left: 3px; }
.tag .tt { font-size: 11px; color: var(--muted); }
.tag .tq { font-size: 30px; font-weight: 700; color: #ffd030; line-height: 1; text-shadow: 0 0 6px rgba(0, 0, 0, 0.9), 0 2px 0 #7a5a00; background: none; border: 0; padding: 0; }
.tag .tq.prog { color: #b8b8b8; text-shadow: 0 0 6px rgba(0, 0, 0, 0.9); }
.tag .thp { width: 66px; height: 6px; margin: 2px auto 0; background: rgba(0, 0, 0, 0.7); border-radius: 3px; overflow: hidden; border: 1px solid rgba(0, 0, 0, 0.8); }
.tag .thp i { display: block; height: 100%; background: #d03a2a; }
.tag.friend .tn { color: #9fe0ff; }
.tag.party .tn { color: #7fffb0; }
.tag.npc .tn { color: #ffe9a8; }
.tag.mon .tn { color: #ffb0a0; }
.tag.mon.passive .tn { color: #e8e8c8; }
.tag.elite .tn { color: #ffd060; }
.tag.boss .tn { color: #e0a0ff; font-size: 16px; }
.tag .bub { display: inline-block; max-width: 240px; white-space: normal; padding: 5px 10px; margin-bottom: 4px; background: rgba(250, 244, 230, 0.95); color: #2a2016; border-radius: 10px; font-size: 13px; text-shadow: none; }
.dmg { position: absolute; left: 0; top: 0; font-weight: 700; font-size: 20px; color: #fff; text-shadow: 0 2px 0 #000, 0 0 4px #000; animation: dmgup .9s ease-out forwards; white-space: nowrap; }
.dmg.crit { color: #ffd030; font-size: 28px; }
.dmg.hurt { color: #ff5a4a; }
.dmg.heal { color: #6fff7a; }
.dmg.miss { color: #c8c8c8; font-size: 16px; }
.dmg.xp { color: #d8b0ff; font-size: 15px; }
@keyframes dmgup { 0% { transform: translate(var(--x), var(--y)) scale(1.4); opacity: 1; } 20% { transform: translate(var(--x), calc(var(--y) - 12px)) scale(1); } 100% { transform: translate(var(--x), calc(var(--y) - 60px)) scale(0.9); opacity: 0; } }

/* ---------- หน้าต่าง */
.window { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 20; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6); max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); display: flex; flex-direction: column; }
.win-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 16px; font-weight: 600; color: var(--gold2); background: linear-gradient(rgba(201, 162, 74, 0.15), transparent); border-radius: 10px 10px 0 0; }
.win-close { background: none; border: 0; color: var(--muted); font-size: 18px; }
.win-close:hover { color: var(--text); }
.win-body { padding: 14px; overflow-y: auto; }
#win-inv { width: auto; }
#win-quest { width: 720px; }
#win-dialog { width: 560px; top: auto; bottom: 120px; transform: translateX(-50%); }
#win-shop { width: 520px; left: calc(50% - 280px); }
#win-shop + .shop-open { }
#win-settings, #win-help { width: 520px; }
#win-map .win-body { padding: 8px; }
#worldmap { display: block; width: min(640px, calc(100vh - 110px)); height: min(640px, calc(100vh - 110px)); border-radius: 6px; }
body.shop-mode #win-inv { left: calc(50% + 270px); width: 470px; }
body.shop-mode #win-inv .inv-left { display: none; }

.inv-wrap { display: flex; gap: 16px; }
.inv-left { width: 250px; flex: none; }
.inv-right { flex: 1; }
.eq-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 10px; }
.stats { font-size: 13px; line-height: 1.75; background: rgba(0, 0, 0, 0.3); border-radius: 6px; padding: 8px 10px; }
.stats div { display: flex; justify-content: space-between; }
.stats div b { font-weight: 500; color: var(--gold2); }
.inv-grid { display: grid; grid-template-columns: repeat(6, 58px); gap: 6px; }
.hue-red { filter: hue-rotate(250deg) saturate(1.4); }
.hue-blue { filter: hue-rotate(95deg) saturate(1.3); }
.islot { position: relative; aspect-ratio: 1; border-radius: 7px; background: rgba(0, 0, 0, 0.42); border: 1px solid rgba(201, 162, 74, 0.25); display: flex; align-items: center; justify-content: center; font-size: 25px; cursor: pointer; }
.islot:hover { border-color: var(--gold2); }
.islot.drag-over { box-shadow: 0 0 0 2px var(--gold2); }
.islot .n { position: absolute; right: 3px; bottom: 0; font-size: 12px; font-weight: 600; text-shadow: 0 1px 2px #000; }
.islot .sl { position: absolute; left: 0; right: 0; bottom: 1px; text-align: center; font-size: 10px; color: var(--muted); }
.islot.r-common { border-color: rgba(214, 214, 214, 0.45); }
.islot.r-uncommon { border-color: #5fd35f; box-shadow: inset 0 0 10px rgba(95, 211, 95, 0.25); }
.islot.r-rare { border-color: #4aa8ff; box-shadow: inset 0 0 10px rgba(74, 168, 255, 0.3); }
.islot.r-epic { border-color: #c07bff; box-shadow: inset 0 0 12px rgba(192, 123, 255, 0.35); }
.islot.r-legendary { border-color: #ff9a2e; box-shadow: inset 0 0 14px rgba(255, 154, 46, 0.45); }
.inv-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 14px; }
.gold-amt { color: #ffd760; font-weight: 600; }
.hint { color: var(--muted); font-size: 12px; }

#tooltip { position: fixed; z-index: 30; pointer-events: none; max-width: 280px; padding: 9px 11px; background: rgba(12, 9, 6, 0.96); border: 1px solid var(--line); border-radius: 7px; font-size: 13px; line-height: 1.5; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6); }
#tooltip .tt-name { font-weight: 600; font-size: 15px; }
#tooltip .tt-sub { color: var(--muted); font-size: 12px; }
#tooltip .tt-stat { color: #9fe09f; }
#tooltip .tt-bad { color: #ff8a7a; }
#tooltip .tt-price { color: #ffd760; margin-top: 3px; }

.q-wrap { display: flex; gap: 14px; min-height: 340px; }
.q-list { width: 240px; flex: none; display: flex; flex-direction: column; gap: 5px; }
.q-item { padding: 7px 10px; border-radius: 6px; background: rgba(0, 0, 0, 0.3); border: 1px solid transparent; cursor: pointer; font-size: 13px; }
.q-item:hover { border-color: var(--line); }
.q-item.sel { border-color: var(--gold2); background: rgba(201, 162, 74, 0.15); }
.q-item .qm { font-size: 11px; color: var(--muted); }
.q-detail { flex: 1; font-size: 14px; line-height: 1.6; }
.q-detail h3 { margin: 0 0 6px; color: var(--gold2); font-weight: 600; font-size: 18px; }
.q-detail .q-goal { background: rgba(0, 0, 0, 0.3); border-radius: 6px; padding: 8px 10px; margin: 8px 0; }
.q-detail .q-rew { color: #ffe08a; }
.q-empty { color: var(--muted); padding: 30px; text-align: center; }

.dlg-text { font-size: 15px; line-height: 1.7; min-height: 60px; margin-bottom: 12px; }
.dlg-opts { display: flex; flex-direction: column; gap: 6px; }
.dlg-opt { text-align: left; padding: 9px 12px; background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(201, 162, 74, 0.3); border-radius: 6px; color: var(--text); font-size: 14px; }
.dlg-opt:hover { border-color: var(--gold2); background: rgba(201, 162, 74, 0.12); }
.dlg-opt .oi { display: inline-block; width: 22px; font-weight: 700; color: #ffd030; }
.dlg-opt.prog .oi { color: #b8b8b8; }
.dlg-reward { margin: 6px 0 12px; padding: 8px 12px; background: rgba(0, 0, 0, 0.3); border-radius: 6px; color: #ffe08a; font-size: 14px; }
.dlg-title-sub { color: var(--muted); font-size: 12px; font-weight: 400; margin-left: 8px; }

.shop-list { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow-y: auto; }
.shop-row { display: flex; align-items: center; gap: 10px; padding: 7px 9px; background: rgba(0, 0, 0, 0.3); border-radius: 7px; }
.shop-row .islot { width: 44px; height: 44px; flex: none; font-size: 22px; }
.shop-row .si { flex: 1; min-width: 0; }
.shop-row .si .sn { font-weight: 500; }
.shop-row .si .ss { font-size: 12px; color: var(--muted); }
.shop-row .sp { color: #ffd760; font-weight: 600; width: 74px; text-align: right; }
.shop-row input { width: 46px; padding: 4px; background: rgba(0, 0, 0, 0.5); border: 1px solid var(--line); border-radius: 4px; color: var(--text); text-align: center; }

.set-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid rgba(201, 162, 74, 0.15); font-size: 14px; }
.set-row select, .set-row input[type=range] { width: 180px; }
.set-row select { background: rgba(0, 0, 0, 0.5); color: var(--text); border: 1px solid var(--line); border-radius: 5px; padding: 4px; }
.help-grid { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 14px; }
.help-grid kbd { display: inline-block; min-width: 26px; text-align: center; padding: 1px 7px; border-radius: 4px; background: rgba(201, 162, 74, 0.25); border: 1px solid var(--line); font-family: var(--font); }
.help-tip { margin-top: 12px; color: var(--muted); font-size: 13px; line-height: 1.6; }

#death { position: fixed; inset: 0; z-index: 25; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: radial-gradient(ellipse at center, rgba(40, 0, 0, 0.35), rgba(0, 0, 0, 0.75)); }
.death-title { font-family: var(--title); font-size: 46px; color: #e85a4a; text-shadow: 0 0 20px rgba(200, 30, 20, 0.6), 0 3px 0 #000; }
#death-info { color: var(--text); font-size: 15px; text-align: center; line-height: 1.7; }
#invite { position: fixed; left: 50%; top: 30%; transform: translateX(-50%); z-index: 26; padding: 14px 18px; text-align: center; }
#invite .row { display: flex; gap: 8px; justify-content: center; margin-top: 10px; }
#disconnect { position: fixed; inset: 0; z-index: 45; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.55); }
#disconnect .panel { padding: 18px 26px; font-size: 16px; }

@media (max-width: 1100px) {
  #chat { width: 300px; height: 170px; }
  #tracker { width: 220px; }
  .slot { width: 46px; height: 46px; font-size: 22px; }
  .inv-left { width: 210px; }
  .inv-grid { grid-template-columns: repeat(6, 50px); }
}
