/* Self-hosted fonts (SIL Open Font License, see client/fonts/OFL-*.txt). Hosted locally so they load inside Discord. */
@font-face { font-family: 'Rajdhani'; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/rajdhani-400.woff2) format('woff2'); }
@font-face { font-family: 'Rajdhani'; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/rajdhani-500.woff2) format('woff2'); }
@font-face { font-family: 'Rajdhani'; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/rajdhani-600.woff2) format('woff2'); }
@font-face { font-family: 'Rajdhani'; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/rajdhani-700.woff2) format('woff2'); }
@font-face { font-family: 'Orbitron'; font-style: normal; font-weight: 400 900; font-display: swap; src: url(../fonts/orbitron-var.woff2) format('woff2'); }

:root {
  --bg: rgba(8, 18, 30, 0.86);
  --bg-solid: #0b1622;
  --panel-border: rgba(92, 216, 255, 0.35);
  --accent: #5cd8ff;
  --accent-2: #9ae8ff;
  --text: #dce9f5;
  --muted: #8aa0b4;
  --good: #4fd16b;
  --bad: #e04848;
  --gold: #ffd23a;
  --shield: #5cd8ff;
  --health: #4fd16b;
  --font: 'Rajdhani', 'Segoe UI', system-ui, sans-serif;
  --display: 'Orbitron', 'Rajdhani', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #050a10; color: var(--text); font-family: var(--font); font-size: 15px; user-select: none; }
canvas#game { position: fixed; inset: 0; display: block; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small-text { font-size: 12.5px; }
input, textarea, select { font-family: var(--font); font-size: 15px; background: rgba(0, 0, 0, 0.45); color: var(--text); border: 1px solid rgba(92, 216, 255, 0.3); border-radius: 3px; padding: 6px 8px; outline: none; user-select: text; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 6px rgba(92, 216, 255, 0.35); }
textarea { width: 100%; resize: vertical; }
kbd { font-family: var(--font); background: rgba(92, 216, 255, 0.12); border: 1px solid rgba(92, 216, 255, 0.35); border-radius: 3px; padding: 0 5px; font-size: 13px; color: var(--accent-2); white-space: nowrap; }

.btn { font-family: var(--font); font-weight: 600; font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text); background: linear-gradient(#1d3a4f, #10222f); border: 1px solid rgba(92, 216, 255, 0.45); border-radius: 3px; padding: 6px 14px; cursor: pointer; transition: all 0.12s; }
.btn:hover:not(:disabled) { border-color: var(--accent); box-shadow: 0 0 8px rgba(92, 216, 255, 0.4); color: #fff; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.good { background: linear-gradient(#22573a, #123521); border-color: rgba(79, 209, 107, 0.6); }
.btn.bad { background: linear-gradient(#5a2222, #341212); border-color: rgba(224, 72, 72, 0.6); }
.btn.big { padding: 10px 22px; font-size: 16px; }
.btn.small { padding: 2px 8px; font-size: 12px; }
.btn.full { width: 100%; margin: 6px 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.input-row input { flex: 1; min-width: 0; }

/* ---------------------------------------------------------- pre-game screens */
.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 10; background: radial-gradient(ellipse at center, rgba(5, 10, 16, 0.2), rgba(5, 10, 16, 0.85)); }
.panel { background: var(--bg); border: 1px solid var(--panel-border); border-radius: 6px; padding: 24px 28px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), inset 0 0 30px rgba(92, 216, 255, 0.05); backdrop-filter: blur(4px); }
.panel h2 { font-family: var(--display); font-weight: 600; letter-spacing: 0.12em; color: var(--accent); margin: 0 0 16px; text-transform: uppercase; font-size: 20px; }
.login-panel { width: 420px; text-align: center; }
.login-panel form { display: flex; flex-direction: column; gap: 10px; margin: 18px 0 10px; }
.login-panel .row { justify-content: center; }
.logo { position: relative; padding: 18px 0 6px; }
.logo-ring { position: absolute; left: 50%; top: 4px; width: 300px; height: 70px; transform: translateX(-50%) rotate(-6deg); border: 5px solid rgba(92, 216, 255, 0.5); border-radius: 50%; box-shadow: 0 0 20px rgba(92, 216, 255, 0.4); }
.logo h1 { position: relative; font-family: var(--display); font-weight: 800; font-size: 40px; letter-spacing: 0.18em; margin: 0; color: #fff; text-shadow: 0 0 18px rgba(92, 216, 255, 0.8); }
.logo-sub { font-family: var(--display); letter-spacing: 0.8em; color: var(--accent); font-size: 14px; margin-left: 0.8em; }
.screen-error { color: #ff7a7a; min-height: 20px; font-weight: 600; }
.discord-status { margin: 18px 0 8px; padding: 10px 12px; border-radius: 4px; background: rgba(88, 101, 242, 0.18); border: 1px solid rgba(88, 101, 242, 0.55); color: #dfe3ff; font-weight: 600; }
.disclaimer { margin-top: 16px; font-size: 11.5px; color: #5d7184; line-height: 1.4; }
#motd { margin-top: 6px; }

.char-panel { width: min(860px, 94vw); }
#char-list { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.char-card { width: 170px; padding: 10px; text-align: center; border: 1px solid rgba(92, 216, 255, 0.2); border-radius: 5px; background: rgba(0, 0, 0, 0.3); cursor: pointer; transition: all 0.15s; }
.char-card:hover { border-color: rgba(92, 216, 255, 0.6); }
.char-card.sel { border-color: var(--accent); box-shadow: 0 0 12px rgba(92, 216, 255, 0.45); background: rgba(92, 216, 255, 0.08); }
.char-card.new { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 180px; color: var(--muted); }
.char-card .plus { font-size: 46px; color: var(--accent); }
.cc-name { font-weight: 700; font-size: 17px; }

.create-panel { width: min(900px, 96vw); max-height: 96vh; overflow-y: auto; }
#create-body { display: flex; gap: 22px; }
.create-left { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.create-preview { background: radial-gradient(ellipse at 50% 80%, rgba(92, 216, 255, 0.18), transparent 70%); border: 1px solid rgba(92, 216, 255, 0.2); border-radius: 6px; }
.create-options { flex: 1; }
.choice-row { display: flex; gap: 8px; }
.choice-row.wrap { flex-wrap: wrap; }
.choice { flex: 1; min-width: 180px; text-align: left; font-family: var(--font); color: var(--text); background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(92, 216, 255, 0.2); border-radius: 4px; padding: 8px 10px; cursor: pointer; }
.choice b { font-size: 16px; color: #fff; }
.choice.sel { border-color: var(--accent); background: rgba(92, 216, 255, 0.12); box-shadow: 0 0 8px rgba(92, 216, 255, 0.3); }
.color-row { display: flex; align-items: center; gap: 10px; margin: 4px 0; }
.color-row > span { width: 70px; }
.swatches { display: flex; flex-wrap: wrap; gap: 4px; }
.swatch { width: 20px; height: 20px; border-radius: 3px; border: 2px solid rgba(0, 0, 0, 0.5); cursor: pointer; }
.swatch.sel { border-color: #fff; box-shadow: 0 0 6px #fff; }
.section-title { font-family: var(--display); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin: 12px 0 6px; border-bottom: 1px solid rgba(92, 216, 255, 0.2); padding-bottom: 3px; }

#disconnected { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.7); text-align: center; }

/* ---------------------------------------------------------- HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#hud > * { pointer-events: auto; }
.frame { position: absolute; background: var(--bg); border: 1px solid var(--panel-border); border-radius: 4px; padding: 6px 8px; width: 240px; }
#player-frame { left: 12px; top: 12px; }
#target-frame { left: 264px; top: 12px; }
#target-frame.hostile { border-color: rgba(224, 72, 72, 0.6); }
.frame-head { display: flex; justify-content: space-between; font-weight: 700; font-size: 15px; }
.frame-sub { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.lvl { color: var(--gold); font-weight: 700; }
.bar { position: relative; height: 14px; background: rgba(0, 0, 0, 0.6); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 2px; margin-top: 3px; overflow: hidden; }
.bar.small { height: 6px; margin-top: 2px; }
.bar .fill { height: 100%; transition: width 0.15s; }
.bar.shield .fill { background: linear-gradient(#8ae8ff, #2a9ac8); box-shadow: 0 0 6px rgba(92, 216, 255, 0.6); }
.bar.shield .fill.over { background: linear-gradient(#d8ff8a, #7ac82a); }
.bar.health .fill { background: linear-gradient(#6ae88a, #2a8a48); }
.bar span { position: absolute; inset: 0; text-align: center; font-size: 11px; line-height: 14px; font-weight: 700; text-shadow: 0 0 3px #000, 0 0 2px #000; }
#buffs { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.buff { font-size: 11px; padding: 0 5px; border-radius: 2px; background: rgba(157, 255, 74, 0.15); border: 1px solid rgba(157, 255, 74, 0.5); color: #c8ff9a; text-transform: capitalize; }

#party-frames { position: absolute; left: 12px; top: 110px; display: flex; flex-direction: column; gap: 6px; }
.party-member { width: 180px; background: var(--bg); border: 1px solid rgba(92, 216, 255, 0.25); border-radius: 3px; padding: 4px 6px; cursor: pointer; }
.party-member.dead { opacity: 0.5; }
.pm-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; }
.pm-zone { font-size: 11px; color: var(--muted); }

#minimap-wrap { position: absolute; right: 12px; top: 12px; width: 190px; text-align: center; }
#zone-name { font-family: var(--display); font-size: 12px; letter-spacing: 0.1em; color: var(--accent); text-shadow: 0 0 4px #000; margin-bottom: 4px; text-transform: uppercase; }
#minimap { width: 180px; height: 180px; filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.7)); }
#coords { font-size: 12px; color: var(--muted); text-shadow: 0 0 3px #000; }
#menu-buttons { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin-top: 6px; }
.menu-btn { position: relative; width: 40px; height: 30px; font-family: var(--display); font-weight: 600; font-size: 13px; color: var(--accent-2); background: var(--bg); border: 1px solid var(--panel-border); border-radius: 3px; cursor: pointer; }
.menu-btn:hover { border-color: var(--accent); color: #fff; box-shadow: 0 0 6px rgba(92, 216, 255, 0.4); }
.badge { display: inline-block; min-width: 16px; padding: 0 4px; margin-left: 4px; border-radius: 8px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; font-family: var(--font); }
.menu-btn .badge { position: absolute; top: -6px; right: -6px; margin: 0; }
.fs-btn { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; color: var(--accent-2); background: var(--bg); border: 1px solid var(--panel-border); border-radius: 3px; cursor: pointer; }
.fs-btn:hover { border-color: var(--accent); color: #fff; box-shadow: 0 0 6px rgba(92, 216, 255, 0.4); }
.fs-btn svg { width: 17px; height: 17px; }
#fs-hud { position: absolute; top: 18px; right: 0; }
#fs-lobby { position: fixed; top: 14px; right: 14px; z-index: 20; width: 34px; height: 34px; }

#actionbar { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); display: flex; gap: 6px; padding: 6px; background: var(--bg); border: 1px solid var(--panel-border); border-radius: 5px; }
.ab-slot { position: relative; width: 48px; height: 48px; border: 1px solid rgba(92, 216, 255, 0.4); border-radius: 4px; overflow: hidden; cursor: pointer; }
.ab-slot.consumable { border-color: rgba(255, 210, 58, 0.4); }
.ab-slot.consumable:first-of-type, .ab-slot:nth-child(5) { margin-left: 10px; }
.ab-slot.empty img { filter: grayscale(1) brightness(0.5); }
.ab-slot:hover { border-color: var(--accent); }
.ab-slot img { width: 100%; height: 100%; display: block; }
.ab-cd { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: rgba(0, 0, 0, 0.7); }
.ab-key { position: absolute; top: 1px; left: 3px; font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 0 3px #000; }
.ab-time { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; text-shadow: 0 0 4px #000; }
.ab-count { position: absolute; right: 3px; bottom: 1px; font-size: 12px; font-weight: 700; text-shadow: 0 0 3px #000; }

#xpbar { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); width: min(600px, 60vw); height: 12px; background: rgba(0, 0, 0, 0.65); border: 1px solid rgba(200, 160, 255, 0.4); border-radius: 2px; overflow: hidden; }
#xpfill { height: 100%; background: linear-gradient(#c8a0ff, #6a3aa8); transition: width 0.3s; }
#xptext { position: absolute; inset: 0; text-align: center; font-size: 10.5px; line-height: 12px; font-weight: 700; text-shadow: 0 0 3px #000; }

/* ---------------------------------------------------------- chat */
#chat { position: absolute; left: 12px; bottom: 12px; width: min(440px, 40vw); display: flex; flex-direction: column; background: rgba(5, 12, 20, 0.62); border: 1px solid rgba(92, 216, 255, 0.2); border-radius: 4px; }
#chat-tabs { display: flex; gap: 2px; padding: 3px 3px 0; }
.chat-tab { font-family: var(--font); font-size: 12px; font-weight: 600; color: var(--muted); background: transparent; border: none; border-bottom: 2px solid transparent; padding: 2px 7px; cursor: pointer; }
.chat-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.chat-tab.unread { color: #fff; text-shadow: 0 0 6px var(--accent); }
#chat-log { height: 190px; overflow-y: auto; padding: 4px 8px; font-size: 14px; line-height: 1.3; user-select: text; text-shadow: 0 0 2px #000; }
#chat-log::-webkit-scrollbar, .scroll::-webkit-scrollbar { width: 6px; }
#chat-log::-webkit-scrollbar-thumb, .scroll::-webkit-scrollbar-thumb { background: rgba(92, 216, 255, 0.3); border-radius: 3px; }
.cl { word-wrap: break-word; }
.ctime { color: #4d6275; font-size: 11px; }
.cname { cursor: pointer; font-weight: 700; }
.cname:hover { text-decoration: underline; }
.ch-say { color: #f0f4f8; }
.ch-global { color: #ffb070; }
.ch-party { color: #6ad8ff; }
.ch-guild { color: #7cff9a; }
.ch-whisper { color: #ff9ad5; }
.ch-emote { color: #ffe08a; font-style: italic; }
.gm { color: var(--gold); }
.sys-info { color: #a8bccf; }
.sys-warn { color: #ffb04a; }
.sys-good { color: #7cff9a; }
.sys-epic { color: #ff9a2e; font-weight: 700; }
.sys-quest { color: var(--gold); }
.sys-loot { color: #b0e0ff; }
.sys-friend { color: #7cff9a; }
.sys-party { color: #6ad8ff; }
.sys-guild { color: #7cff9a; }
.sys-duel { color: #ff6a6a; font-weight: 600; }
.sys-roll { color: #c8a0ff; }
#chat-input-row { display: flex; border-top: 1px solid rgba(92, 216, 255, 0.15); }
#chat-chan { font-family: var(--font); font-weight: 700; font-size: 12px; background: rgba(0, 0, 0, 0.5); border: none; border-right: 1px solid rgba(92, 216, 255, 0.2); padding: 0 10px; cursor: pointer; min-width: 74px; }
.chan-say { color: #f0f4f8; } .chan-global { color: #ffb070; } .chan-party { color: #6ad8ff; } .chan-guild { color: #7cff9a; }
#chat-input { flex: 1; border: none; border-radius: 0; background: rgba(0, 0, 0, 0.5); }

/* ---------------------------------------------------------- toasts & banners */
#toasts { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; width: 420px; pointer-events: none; }
.toast { pointer-events: auto; background: var(--bg); border: 1px solid var(--panel-border); border-radius: 4px; padding: 8px 14px; text-align: center; animation: toastIn 0.25s ease-out; font-weight: 600; }
.toast.good { border-color: rgba(79, 209, 107, 0.6); color: #b8ffc8; }
.toast.epic { border-color: rgba(255, 154, 46, 0.7); color: #ffd0a0; }
.toast.invite { border-color: var(--gold); box-shadow: 0 0 14px rgba(255, 210, 58, 0.35); }
.toast-btns { display: flex; gap: 8px; justify-content: center; margin-top: 6px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
#zone-banner { position: absolute; top: 22%; left: 50%; transform: translateX(-50%); text-align: center; pointer-events: none; opacity: 0; }
#zone-banner.show { animation: banner 4s ease-out forwards; }
.zb-title { font-family: var(--display); font-weight: 800; font-size: 38px; letter-spacing: 0.16em; color: #fff; text-shadow: 0 0 16px rgba(92, 216, 255, 0.9), 0 2px 4px #000; text-transform: uppercase; }
.zb-sub { font-size: 18px; color: var(--accent-2); text-shadow: 0 0 6px #000; letter-spacing: 0.08em; }
.zb-lvl { font-size: 14px; color: var(--gold); text-shadow: 0 0 6px #000; }
@keyframes banner { 0% { opacity: 0; } 12% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; } }
#center-msg { position: absolute; top: 34%; left: 50%; transform: translateX(-50%); font-family: var(--display); font-weight: 800; font-size: 34px; letter-spacing: 0.1em; color: #fff; text-shadow: 0 0 14px rgba(92, 216, 255, 0.9), 0 2px 4px #000; pointer-events: none; opacity: 0; transition: opacity 0.2s; }
#center-msg.show { opacity: 1; }
#center-msg.level { color: var(--gold); text-shadow: 0 0 18px rgba(255, 210, 58, 0.9), 0 2px 4px #000; }
#center-msg.duel { color: #ff8a8a; text-shadow: 0 0 18px rgba(255, 60, 60, 0.9), 0 2px 4px #000; }
#duel-flag { position: absolute; top: 70px; left: 50%; transform: translateX(-50%); background: rgba(80, 10, 10, 0.75); border: 1px solid rgba(255, 90, 90, 0.6); border-radius: 3px; padding: 3px 12px; font-weight: 700; color: #ffb0b0; }
#death-screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: radial-gradient(ellipse at center, rgba(80, 0, 0, 0.25), rgba(30, 0, 0, 0.75)); }
.death-title { font-family: var(--display); font-size: 64px; font-weight: 800; letter-spacing: 0.3em; color: #ff5a5a; text-shadow: 0 0 24px rgba(255, 0, 0, 0.8); }
#death-by { font-size: 18px; color: #ffb0b0; }

/* ---------------------------------------------------------- windows */
#windows { position: absolute; inset: 0; pointer-events: none; }
.window { position: absolute; pointer-events: auto; background: var(--bg); border: 1px solid var(--panel-border); border-radius: 5px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6); max-height: 84vh; display: flex; flex-direction: column; }
.win-title { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; background: linear-gradient(rgba(92, 216, 255, 0.18), rgba(92, 216, 255, 0.04)); border-bottom: 1px solid rgba(92, 216, 255, 0.25); cursor: move; font-family: var(--display); font-weight: 600; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-2); }
.win-close { background: none; border: none; color: var(--muted); font-size: 20px; cursor: pointer; line-height: 1; }
.win-close:hover { color: #fff; }
.win-body { padding: 10px 12px; overflow-y: auto; }
.scroll { overflow-y: auto; max-height: 52vh; }
.empty { color: var(--muted); font-style: italic; padding: 10px 0; text-align: center; }
.hint { font-size: 12px; color: var(--muted); margin-top: 8px; }
.tabs { display: flex; gap: 2px; margin-bottom: 8px; border-bottom: 1px solid rgba(92, 216, 255, 0.2); }
.tab { font-family: var(--font); font-weight: 600; font-size: 13.5px; color: var(--muted); background: none; border: none; border-bottom: 2px solid transparent; padding: 4px 10px; cursor: pointer; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.inv-head { display: flex; justify-content: space-between; margin-bottom: 8px; }
.credits { color: var(--gold); font-weight: 700; }
.inv-grid { display: grid; grid-template-columns: repeat(6, 46px); gap: 4px; }
.inv-slot { position: relative; width: 46px; height: 46px; background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(92, 216, 255, 0.15); border-radius: 3px; cursor: pointer; }
.inv-slot:hover { border-color: var(--accent); }
.inv-slot img { width: 44px; height: 44px; display: block; }
.inv-slot.locked img { filter: sepia(1) hue-rotate(-50deg) saturate(3) brightness(0.7); }
.inv-slot.offered { outline: 2px solid var(--gold); }
.qty { position: absolute; right: 2px; bottom: 0; font-size: 12px; font-weight: 700; text-shadow: 0 0 3px #000, 0 0 2px #000; }
.mini-icon { width: 26px; height: 26px; vertical-align: middle; border-radius: 2px; }

.char-top { display: flex; gap: 12px; }
#char-preview, .char-top canvas { background: radial-gradient(ellipse at 50% 80%, rgba(92, 216, 255, 0.15), transparent 70%); border-radius: 5px; }
.char-name { font-family: var(--display); font-size: 18px; color: #fff; }
.guild-line { color: #7cff9a; font-weight: 600; }
.stat-grid { display: grid; grid-template-columns: auto auto; gap: 1px 12px; margin-top: 6px; font-size: 14px; }
.stat-grid b { text-align: right; color: #fff; }
.stat-grid.wide { grid-template-columns: 1fr auto; }
.eq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.eq-slot { display: flex; align-items: center; gap: 6px; padding: 4px; background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(92, 216, 255, 0.15); border-radius: 3px; cursor: pointer; }
.eq-slot img { width: 36px; height: 36px; }
.eq-empty { width: 36px; height: 36px; border: 1px dashed rgba(255, 255, 255, 0.2); font-size: 9px; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.eq-label { font-size: 13px; }

.quest { padding: 8px; margin-bottom: 8px; background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(92, 216, 255, 0.15); border-radius: 4px; }
.quest.complete { border-color: rgba(79, 209, 107, 0.5); }
.quest-head { display: flex; justify-content: space-between; color: var(--gold); }
.quest-desc { font-size: 13.5px; color: #b8c8d8; margin: 4px 0; font-style: italic; }
.quest-obj { font-weight: 600; }
.quest-rewards { font-size: 13px; color: var(--gold); display: flex; gap: 6px; align-items: center; margin: 4px 0; flex-wrap: wrap; }
.progress { height: 6px; background: rgba(0, 0, 0, 0.6); border-radius: 3px; margin: 4px 0; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, #c9a227, #ffd23a); }
.quest .row { justify-content: space-between; font-size: 12px; }

.list { display: flex; flex-direction: column; gap: 3px; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 4px 6px; background: rgba(0, 0, 0, 0.25); border-radius: 3px; }
.list-row > span:last-child { display: flex; gap: 3px; flex-shrink: 0; }
.list-row .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: #555; }
.list-row.online .dot { background: var(--good); box-shadow: 0 0 5px var(--good); }
.list-row.offline { opacity: 0.65; }
.guild-title { font-family: var(--display); font-size: 17px; color: #7cff9a; }

.mail-win { display: flex; gap: 10px; min-height: 320px; }
.mail-list { width: 190px; flex-shrink: 0; border-right: 1px solid rgba(92, 216, 255, 0.15); padding-right: 8px; }
.mail-row { padding: 5px 6px; border-radius: 3px; cursor: pointer; margin-bottom: 2px; background: rgba(0, 0, 0, 0.2); }
.mail-row:hover { background: rgba(92, 216, 255, 0.08); }
.mail-row.sel { background: rgba(92, 216, 255, 0.16); }
.mail-row.unread .mail-subj { font-weight: 700; color: #fff; }
.mail-from { font-size: 12px; color: var(--muted); }
.mail-subj { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-subj.big { font-size: 17px; white-space: normal; color: #fff; }
.mail-read, .mail-compose { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.mail-body { white-space: pre-wrap; background: rgba(0, 0, 0, 0.3); padding: 8px; border-radius: 3px; min-height: 120px; user-select: text; }
.mail-attach { display: flex; align-items: center; gap: 10px; padding: 6px; border: 1px solid rgba(255, 210, 58, 0.35); border-radius: 3px; }
.mail-compose label { font-size: 13px; display: flex; align-items: center; gap: 4px; }
.mail-compose input[type=number] { width: 90px; }
.mail-compose select { max-width: 180px; }

table.lb { width: 100%; border-collapse: collapse; font-size: 14px; }
table.lb th { text-align: left; color: var(--accent); font-weight: 600; border-bottom: 1px solid rgba(92, 216, 255, 0.25); }
table.lb td { padding: 3px 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); }
table.lb td.num { text-align: right; color: var(--gold); font-weight: 600; }
table.lb tr.me { background: rgba(92, 216, 255, 0.12); }

.help-grid { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; font-size: 14px; }
.help p { font-size: 14px; line-height: 1.4; }
.check { display: flex; align-items: center; gap: 6px; margin: 8px 0; }

.npc-greet { font-style: italic; color: #d8e4f0; margin-bottom: 10px; padding: 8px; border-left: 3px solid var(--gold); background: rgba(255, 210, 58, 0.06); }
.npc-quest { padding: 8px; margin-bottom: 8px; background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(92, 216, 255, 0.15); border-radius: 4px; }
.npc-quest.available { border-color: rgba(255, 210, 58, 0.5); }
.npc-quest.complete { border-color: rgba(79, 209, 107, 0.6); }
.npc-quest.locked { opacity: 0.6; }
.reward-item { display: inline-flex; align-items: center; gap: 2px; }

.vendor-list { max-height: 34vh; }
.vendor-row { display: flex; align-items: center; gap: 8px; padding: 4px; border-radius: 3px; }
.vendor-row:hover { background: rgba(92, 216, 255, 0.08); }
.vendor-row.locked { opacity: 0.55; }
.vendor-name { flex: 1; }
.paint { display: flex; gap: 10px; align-items: flex-start; }
.paint .swatch { width: 16px; height: 16px; }

.trade-cols { display: flex; gap: 10px; }
.trade-col { flex: 1; padding: 8px; background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(92, 216, 255, 0.15); border-radius: 4px; display: flex; flex-direction: column; gap: 6px; }
.trade-col.ready { border-color: var(--good); box-shadow: 0 0 10px rgba(79, 209, 107, 0.35); }
.trade-items { min-height: 100px; display: flex; flex-direction: column; gap: 3px; }
.trade-col input { width: 100px; }
.ready-flag { font-weight: 700; color: var(--muted); }
.trade-col.ready .ready-flag { color: var(--good); }

/* ---------------------------------------------------------- tooltip & context menu */
#tooltip { position: fixed; z-index: 2000; max-width: 280px; background: rgba(6, 12, 20, 0.96); border: 1px solid rgba(92, 216, 255, 0.45); border-radius: 4px; padding: 8px 10px; font-size: 13.5px; pointer-events: none; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6); }
.tt-name { font-weight: 700; font-size: 15px; }
.tt-sub { color: var(--muted); font-size: 12.5px; margin-bottom: 4px; }
.tt-good { color: #7cff9a; }
.tt-bad { color: #ff7a7a; }
.tt-note { color: var(--accent-2); font-size: 12px; }
.tt-desc { color: #c8b890; font-style: italic; margin-top: 4px; }
.tt-price { color: var(--gold); margin-top: 4px; font-size: 12.5px; }
#ctxmenu { position: fixed; z-index: 2100; min-width: 170px; background: rgba(6, 12, 20, 0.97); border: 1px solid rgba(92, 216, 255, 0.45); border-radius: 4px; padding: 4px 0; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6); }
.ctx-item { padding: 5px 14px; cursor: pointer; font-size: 14px; }
.ctx-item:hover { background: rgba(92, 216, 255, 0.15); }
.ctx-head { padding: 4px 14px 6px; color: var(--gold); font-weight: 700; border-bottom: 1px solid rgba(92, 216, 255, 0.2); margin-bottom: 2px; }

@media (max-width: 900px) {
  #target-frame { left: 12px; top: 96px; }
  #party-frames { top: 190px; }
  #chat { width: 60vw; }
  #chat-log { height: 120px; }
  #create-body { flex-direction: column; }
}
