/* Hearthvale's interface: a classic layout (minimap top right, a tabbed panel under it, the chat
   bottom left) in its own look: dark slate glass panels, soft rounded corners, warm amber accents, and clean type. */
:root {
  --glass: rgba(22, 27, 36, 0.86);
  --glass-strong: rgba(18, 22, 30, 0.95);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --cell: rgba(255, 255, 255, 0.05);
  --cell-hover: rgba(255, 255, 255, 0.1);
  --text: #ecebe6;
  --muted: #9aa3ae;
  --accent: #f2b45a;
  --accent-deep: #d9902c;
  --teal: #57c9bd;
  --danger: #e2574c;
  --radius: 14px;
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --panel-w: 236px;
  --chat-w: min(520px, calc(100vw - var(--panel-w) - 30px));
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #22404f; font: 600 13px/1.3 var(--font); color: var(--text); -webkit-user-select: none; user-select: none; }
canvas#world { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: default; }
.hidden { display: none !important; }
button { font: inherit; cursor: pointer; color: inherit; }

.glass {
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.btn {
  background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line-strong); color: var(--text);
  padding: 6px 12px; border-radius: 9px; font-weight: 700; transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: rgba(255, 255, 255, 0.13); }
.btn.primary { background: linear-gradient(180deg, var(--accent), var(--accent-deep)); border-color: transparent; color: #2a1a06; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.small { padding: 3px 10px; font-size: 12px; }
.btn.big { padding: 10px 18px; font-size: 16px; }
.seg { display: inline-flex; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); border-radius: 9px; padding: 2px; gap: 2px; }
.seg button { border: none; background: none; padding: 3px 10px; border-radius: 7px; color: var(--muted); font-weight: 700; }
.seg button.on { background: var(--accent); color: #2a1a06; }

/* ---------- top left: what's under the mouse ---------- */
/* what a left click would do and how many other options there are, in the top-left corner */
#hover-corner { position: fixed; left: 10px; top: 8px; padding: 4px 10px; border-radius: 8px; background: var(--glass-strong); border: 1px solid var(--line);
  font-weight: 800; font-size: 14px; pointer-events: none; white-space: nowrap; z-index: 250; color: #fff; text-shadow: 0 1px 2px #000; }
#hover-corner .t-obj { color: #7fe3d6; }
#hover-corner .t-item { color: #ffb36b; }
#hover-corner .t-npc { color: #ffe46b; }
#hover-corner .t-player { color: #fff; }
#hover-corner .more { color: var(--muted); font-weight: 700; font-size: 12px; margin-left: 4px; }
/* and just the left click's option by the cursor */
#hover-text { position: fixed; left: 0; top: 0; padding: 4px 9px; border-radius: 8px; background: var(--glass-strong); border: 1px solid var(--line-strong);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4); font-weight: 800; font-size: 13px; pointer-events: none; white-space: nowrap; z-index: 250; color: #fff; }
#hover-text .t-obj { color: #7fe3d6; }
#hover-text .t-item { color: #ffb36b; }
#hover-text .t-npc { color: #ffe46b; }
#hover-text .t-player { color: #fff; }
#hover-text .more { color: var(--muted); font-weight: 700; font-size: 11px; margin-left: 4px; }
#area-banner { position: fixed; left: 50%; top: 16%; transform: translateX(-50%); color: #fff; font: 800 30px var(--font); letter-spacing: 0.5px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6); pointer-events: none; transition: opacity 1.2s; z-index: 5; }
#area-banner.fade { opacity: 0; }
body.died canvas#world { animation: died 1.6s ease-out; }
@keyframes died { 0% { filter: brightness(0.2) saturate(0); } 100% { filter: none; } }

/* ---------- top right: the minimap ---------- */
#minimap-frame { position: fixed; right: 8px; top: 8px; width: var(--panel-w); height: calc(var(--panel-w) + 22px); pointer-events: none; z-index: 10; }
#minimap { position: absolute; right: 0; top: 0; width: var(--panel-w); height: var(--panel-w); border-radius: var(--radius); pointer-events: auto; cursor: default;
  border: 1px solid var(--line-strong); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); background: #1b3a4a; }
.orb { position: absolute; right: calc(100% + 8px); height: 30px; min-width: 76px; pointer-events: auto; padding: 0 10px 0 6px; display: flex; align-items: center; gap: 6px;
  background: var(--glass); border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3); font-weight: 800; }
.orb:hover { border-color: var(--line-strong); }
.orb .orb-icon { width: 18px; height: 18px; color: var(--accent); flex: 0 0 auto; }
.orb .orb-label { font-size: 12px; }
#orb-hp { top: 0; overflow: hidden; cursor: default; }   /* (nothing to click: it just shows your hitpoints) */
#orb-hp::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: var(--fill, 100%); background: linear-gradient(90deg, rgba(226, 87, 76, 0.45), rgba(226, 87, 76, 0.25)); transition: width 0.3s; }
#orb-hp > * { position: relative; }
#orb-hp .orb-icon { color: #ff6b5e; }
#orb-hp.low { animation: lowhp 1s ease-in-out infinite; }
@keyframes lowhp { 50% { border-color: var(--danger); } }
#orb-coins { top: 38px; cursor: default; }
#orb-coins .orb-icon { color: #f2c14e; }
#orb-map { top: 76px; }
#orb-lode { top: 114px; }
#orb-lode .orb-icon { color: var(--teal); }
/* under the minimap: the area you're in on the left, frames per second on the right */
#under-map { position: absolute; right: 0; top: calc(var(--panel-w) + 4px); width: var(--panel-w); display: flex; justify-content: space-between; gap: 8px; padding: 0 4px;
  color: var(--text); font-size: 12px; font-weight: 800; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); }
#fps { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- the side panel (pinned to the bottom, level with the chat) ---------- */
#side-panel { position: fixed; right: 8px; bottom: 8px; width: var(--panel-w); z-index: 10; padding: 6px; }
#side-panel .tabs { display: flex; gap: 2px; background: rgba(0, 0, 0, 0.25); border-radius: 10px; padding: 3px; }
#side-panel .tab { flex: 1; height: 34px; border: none; border-radius: 8px; background: none; color: var(--muted); display: grid; place-items: center; transition: background 0.15s, color 0.15s; }
#side-panel .tab .tab-img { width: 30px; height: 27px; filter: saturate(0.55) brightness(0.8); opacity: 0.75; transition: filter 0.15s, opacity 0.15s, transform 0.15s; }
#side-panel .tab:hover .tab-img { filter: none; opacity: 1; }
#side-panel .tab.active .tab-img { filter: none; opacity: 1; transform: scale(1.08); }
#side-panel .tab:hover { color: var(--text); }
#side-panel .tab.active { background: rgba(242, 180, 90, 0.16); color: var(--accent); }
.tab-body { height: 296px; padding: 8px 4px 2px; }
#side-panel .tabs-bottom { margin-top: 6px; }
.tab-page.soon p { color: var(--muted); text-align: center; margin-top: 30px; }
.tab-page { display: none; height: 100%; }
.tab-page.active { display: block; }
.panel-title { color: var(--muted); font-weight: 800; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; margin: 2px 0 10px; }

/* item slots (backpack, bank): every slot is shown, so you can see exactly how many there are */
.slot-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.slot { position: relative; height: 42px; display: grid; place-items: center; border-radius: 9px; cursor: pointer; background: var(--cell); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03); }
.slot img { width: 36px; height: 32px; pointer-events: none; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45)); }
.slot .qty { position: absolute; left: 4px; top: 1px; font-size: 11px; font-weight: 800; pointer-events: none; text-shadow: 0 1px 2px #000; }
.slot:hover { background: var(--cell-hover); }
.slot.drag-from img { opacity: 0.3; }
.slot.drag-over { box-shadow: inset 0 0 0 2px var(--teal); }
#drag-ghost { position: fixed; width: 36px; height: 32px; pointer-events: none; opacity: 0.85; z-index: 100; }

/* the toolbelt */
.toolbelt-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tool { position: relative; height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 10px; background: var(--cell); }
.tool img { width: 36px; height: 32px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45)); }
.tool[data-id] { cursor: pointer; } .tool[data-id]:hover { outline: 1px solid var(--line); }
.tool.missing img { filter: grayscale(1) brightness(0.45); opacity: 0.6; }
.tool .tool-name { font-size: 9px; color: var(--muted); text-align: center; line-height: 1.05; margin-top: 2px; }
.toolbelt-note { margin-top: 14px; color: var(--muted); font-size: 11px; line-height: 1.4; }

/* skills */
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.skill { position: relative; height: 38px; display: grid; grid-template-columns: 30px 1fr; align-items: center; padding: 0 6px 0 3px; border-radius: 9px; background: var(--cell); cursor: default; overflow: hidden; }
.skill:hover { background: var(--cell-hover); }
.skill img { width: 28px; height: 25px; justify-self: center; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.5)); }
.skill .lvl { justify-self: end; font-size: 14px; font-weight: 800; }
.skill .lvl small { color: var(--muted); font-size: 11px; font-weight: 700; }
.skill .bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); border-radius: 0 2px 0 0; }
.skill-total { grid-column: 1 / -1; grid-template-columns: 1fr; text-align: center; color: var(--accent); font-size: 12px; margin-top: 4px; }

/* combat */
.combat-head { display: flex; justify-content: space-between; align-items: baseline; margin: 2px 2px 10px; }
.combat-level { font-size: 13px; color: var(--muted); }
.combat-level b { color: var(--text); font-size: 18px; margin-left: 4px; }
.combat-max { color: var(--muted); font-size: 12px; }
/* what you have on, laid out like a body: cape, helmet and amulet; weapon, body and shield; legs; gloves, boots and ring */
.gear-grid { display: grid; grid-template-columns: repeat(3, 46px); grid-template-rows: repeat(4, 36px); gap: 4px; justify-content: center; margin: 2px 0 8px;
  grid-template-areas: "cape head neck" "weapon body shield" ". legs ." "hands feet ring"; }
.gear-slot { border-radius: 9px; border: 1px solid var(--line); background: var(--cell); display: grid; place-items: center; padding: 0; }
.gear-slot[data-slot="head"] { grid-area: head; } .gear-slot[data-slot="weapon"] { grid-area: weapon; } .gear-slot[data-slot="body"] { grid-area: body; }
.gear-slot[data-slot="shield"] { grid-area: shield; } .gear-slot[data-slot="feet"] { grid-area: feet; } .gear-slot[data-slot="legs"] { grid-area: legs; }
.gear-slot[data-slot="neck"] { grid-area: neck; } .gear-slot[data-slot="ring"] { grid-area: ring; }
.gear-slot[data-slot="cape"] { grid-area: cape; } .gear-slot[data-slot="hands"] { grid-area: hands; }
.gear-slot:not(.empty):hover { border-color: var(--danger); }
.gear-slot img { width: 34px; height: 30px; }
.gear-slot.empty span { color: rgba(255,255,255,0.25); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.bonuses { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; padding: 0 4px; }
.bonuses b { color: var(--text); }
.weapon-slot { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 11px; border: 1px solid var(--line); background: var(--cell); text-align: left; }
.weapon-slot:hover { background: var(--cell-hover); }
.weapon-slot.empty { cursor: default; }
.weapon-slot img { width: 36px; height: 32px; }
.weapon-slot .fist { width: 36px; text-align: center; font-size: 20px; }
.weapon-slot b { display: block; font-size: 13px; }
.weapon-slot small { color: var(--muted); font-size: 11px; }
.styles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.train-title { margin: 12px 2px 6px; }
.style { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 7px 4px; border-radius: 10px; border: 1px solid var(--line); background: var(--cell); font-size: 12px; }
.style .check { width: 16px; height: 16px; border-radius: 5px; border: 2px solid var(--line-strong); flex: 0 0 auto; }
.style.on .check { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 2px rgba(22, 27, 36, 0.9); }
.style small { color: var(--muted); font-size: 11px; }
.style.on { border-color: var(--accent); background: rgba(242, 180, 90, 0.13); }
.style.on b { color: var(--accent); }
.combat-note { margin-top: 10px; color: var(--muted); font-size: 11px; line-height: 1.4; }

/* (the settings outgrow the panel: they scroll) */
#tab-settings { overflow-y: auto; scrollbar-width: thin; padding-right: 4px; }
.settings { display: flex; flex-direction: column; gap: 9px; padding-bottom: 4px; }
.setting { display: flex; align-items: center; gap: 8px; }
.setting input { accent-color: var(--accent); }
.slider { width: 100%; accent-color: var(--accent); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* ---------- bottom left: the chat ---------- */
#chatbox { position: fixed; left: 8px; bottom: 8px; width: var(--chat-w); height: min(270px, 40vh); z-index: 10; display: flex; flex-direction: column; overflow: hidden; }
#chat-view { flex: 1; display: flex; flex-direction: column; min-height: 0; }
#chat-messages { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; padding: 8px 12px 4px; font-size: 13px; display: flex; flex-direction: column; scrollbar-width: thin; }
/* (lines sit at the bottom while there are few; margin-top rather than justify-content: flex-end, which can't be scrolled up past) */
#chat-messages::before { content: ''; margin-top: auto; }
#chat-messages .line { white-space: pre-wrap; overflow-wrap: anywhere; color: #d7dbe0; line-height: 1.4; }
#chat-messages .line.levelup { color: var(--accent); font-weight: 800; }
#chat-messages .line.public .who { font-weight: 800; color: var(--accent); }
#chat-messages .line.public .said { color: #fff; }
#chat-messages .line.warn { color: var(--danger); }
#chat-input-line { display: flex; align-items: center; gap: 8px; margin: 2px 8px 6px; padding: 4px 6px 4px 10px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); border-radius: 9px; }
#chat-name { color: var(--accent); font-weight: 800; }
#chat-input { flex: 1; border: none; background: transparent; color: #fff; font: inherit; font-weight: 600; outline: none; padding: 2px 0; -webkit-user-select: text; user-select: text; caret-color: var(--accent); }
#chat-input::placeholder { color: rgba(255, 255, 255, 0.3); }
.chat-tabs { display: flex; gap: 4px; padding: 0 8px 8px; }
.chat-tab { padding: 3px 12px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--muted); font-size: 12px; font-weight: 800; }
.chat-tab:hover { color: var(--text); }
.chat-tab.on { color: var(--accent); background: rgba(242, 180, 90, 0.12); border-color: rgba(242, 180, 90, 0.25); }

/* the make-x choice: its own window, centred over the world */
#makex { left: calc(50% - var(--panel-w) / 2); top: 50%; transform: translate(-50%, -55%); width: min(560px, calc(100vw - var(--panel-w) - 40px)); max-height: calc(100vh - 80px); display: flex; flex-direction: column; }
#makex.hidden { display: none; }
.makex-items { flex: 1; display: flex; gap: 8px; justify-content: center; align-content: flex-start; flex-wrap: wrap; overflow-y: auto; min-height: 0; padding: 2px; scrollbar-width: thin; }
.makex-item { width: 82px; height: 74px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid var(--line); background: var(--cell); border-radius: 11px; font-size: 11px; text-align: center; line-height: 1.15; padding: 3px; }
.makex-item:hover { background: var(--cell-hover); border-color: var(--accent); }
.makex-item.locked { opacity: 0.4; cursor: not-allowed; }
.makex-item img { width: 36px; height: 32px; }
.makex-item .need { color: var(--danger); font-weight: 800; }
.makex-qty { display: flex; align-items: center; gap: 4px; justify-content: center; margin-top: 6px; color: var(--muted); font-weight: 800; }
.makex-qty button { min-width: 36px; height: 24px; border-radius: 7px; border: 1px solid var(--line); background: var(--cell); font-weight: 800; }
.makex-qty button.on { background: var(--accent); color: #2a1a06; border-color: transparent; }
#makex-x { width: 58px; height: 24px; border-radius: 7px; border: 1px solid var(--line-strong); background: rgba(0, 0, 0, 0.3); color: #fff; padding: 0 6px; font: inherit; }

/* xp globes, beside the minimap (see ui/xpglobe.js) */
#xp-globes { position: fixed; right: calc(var(--panel-w) + 100px); top: 10px; width: 260px; height: 120px; pointer-events: none; z-index: 9; }

/* ---------- windows: the bank, the lodestone network, the world map ---------- */
.window { position: fixed; z-index: 30; padding: 10px 12px 12px; }
.window-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.window-title { flex: 1; font-weight: 800; font-size: 16px; }
.window-close { width: 28px; height: 28px; border: 1px solid var(--line); background: var(--cell); font-size: 18px; line-height: 1; border-radius: 8px; color: var(--muted); }
.window-close:hover { color: #fff; background: var(--cell-hover); }
/* the loot window: beside the backpack, its bottom in line with the panel's */
#loot { position: fixed; right: calc(var(--panel-w) + 16px); bottom: 8px; width: 204px; z-index: 12; padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 8px; }
#loot.hidden { display: none; }
#loot .window-head { margin-bottom: 0; }
#loot-take-all { width: 100%; }
#loot-open { position: fixed; right: calc(var(--panel-w) + 16px); bottom: 8px; z-index: 12; }
/* inspecting another player: their levels, in the Skills tab's grid */
#inspect { left: calc(50% - var(--panel-w) / 2); top: 50%; transform: translate(-50%, -55%); width: min(300px, calc(100vw - var(--panel-w) - 40px)); }
.inspect-sub { color: var(--muted); font-size: 12px; font-weight: 800; margin: -4px 0 10px; }

/* a shop's window: like the bank's, each item with its price under it (stock never runs out) */
#shop { left: calc(50% - var(--panel-w) / 2); top: 50%; transform: translate(-50%, -55%); width: min(440px, calc(100vw - var(--panel-w) - 40px)); }
.shop-grid { grid-template-columns: repeat(8, 1fr); padding: 6px; background: rgba(0, 0, 0, 0.22); border-radius: 10px; }
.shop-grid .slot { height: 56px; grid-template-rows: 1fr auto; padding: 3px 0 2px; }
.shop-grid .slot .price { font-size: 11px; font-weight: 800; color: #f2c14e; text-shadow: 0 1px 2px #000; line-height: 1; }
.shop-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.shop-purse { margin-left: auto; display: flex; align-items: center; gap: 5px; color: var(--text); font-weight: 800; white-space: nowrap; }
.shop-purse .orb-icon { width: 16px; height: 16px; color: #f2c14e; }
/* who you are, at the top of the Settings tab */
.profile { margin: 0 0 10px; display: grid; gap: 3px; font-size: 12px; }
.profile div { display: flex; justify-content: space-between; gap: 8px; }
.profile dt { color: var(--muted); }
.profile dd { margin: 0; font-weight: 800; }
#bank { left: calc(50% - var(--panel-w) / 2); top: 50%; transform: translate(-50%, -55%); width: min(480px, calc(100vw - var(--panel-w) - 40px)); }
#bank-count { color: var(--muted); font-size: 12px; }
/* the bank's filter tabs: everything, then one per skill */
#bank-tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.bank-tab { flex: 1; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--cell); color: var(--muted); font-weight: 800; font-size: 12px; display: grid; place-items: center; }
.bank-tab img { width: 26px; height: 23px; filter: saturate(0.5) brightness(0.85); opacity: 0.8; }
.bank-tab:hover { background: var(--cell-hover); color: var(--text); }
.bank-tab:hover img, .bank-tab.on img { filter: none; opacity: 1; }
.bank-tab.on { background: rgba(242, 180, 90, 0.16); border-color: var(--accent); color: var(--accent); }
.bank-grid { grid-template-columns: repeat(8, 1fr); height: 310px; overflow-y: auto; align-content: start; padding: 6px; background: rgba(0, 0, 0, 0.22); border-radius: 10px; scrollbar-width: thin; }
.bank-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--muted); flex-wrap: wrap; }
#bank-deposit-all { margin-left: auto; }

#lodestones { left: calc(50% - var(--panel-w) / 2); top: 50%; transform: translate(-50%, -55%); width: min(760px, calc(100vw - var(--panel-w) - 40px), calc((100vh - 120px) * 296 / 240)); }
#lode-map { position: relative; width: 100%; aspect-ratio: 296 / 240; background: #2b6f8f; border-radius: 10px; overflow: hidden; }
#lode-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#lode-pins { position: absolute; inset: 0; }
.lode-pin { position: absolute; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; gap: 3px; background: none; border: none; padding: 0; color: #fff;
  text-shadow: 0 1px 3px #000; font-weight: 800; font-size: 12px; white-space: nowrap; }
.lode-pin .stone-icon { width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle, #e8fdff 0 3px, #39c2e6 4px 9px, #11414f 10px); box-shadow: 0 0 12px #6fe6ff, 0 0 0 2px rgba(0, 0, 0, 0.6); transition: transform 0.15s; }
.lode-pin:hover .stone-icon { transform: scale(1.18); }
.lode-pin.locked { cursor: not-allowed; color: #aab; }
.lode-pin.locked .stone-icon { background: radial-gradient(circle, #888 0 3px, #555 4px 9px, #222 10px); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.6); }
.lode-you { position: absolute; width: 9px; height: 9px; background: #fff; border: 2px solid #000; border-radius: 2px; transform: translate(-50%, -50%); }
#skill-guide { right: calc(var(--panel-w) + 24px); bottom: 8px; width: min(400px, calc(100vw - var(--panel-w) - 48px)); }
.guide-icon { width: 30px; height: 27px; }
.guide-level { color: var(--accent); font-weight: 800; }
#guide-list { max-height: min(460px, calc(100vh - 140px)); overflow-y: auto; display: flex; flex-direction: column; gap: 4px; scrollbar-width: thin; }
.guide-row { display: grid; grid-template-columns: 34px 36px 1fr 18px; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: var(--cell); opacity: 0.5; }
.guide-row.got { opacity: 1; }
.guide-row img { width: 36px; height: 32px; }
.guide-noicon { width: 36px; height: 32px; }
.guide-lvl { font-weight: 900; font-size: 15px; text-align: center; color: var(--accent); }
.guide-name b { display: block; font-size: 13px; }
.guide-name small { color: var(--muted); font-size: 11px; }
.guide-tick { color: #5fd46a; font-weight: 900; }
.skill.has-guide { cursor: pointer; }
.lode-foot { margin-top: 8px; color: var(--muted); text-align: center; font-size: 12px; }
.lode-foot.recharging { color: var(--accent); font-weight: 800; }
#lodestones.recharging .lode-pin:not(.locked) { filter: grayscale(0.7) brightness(0.8); }

#worldmap { left: calc(50% - var(--panel-w) / 2); top: 50%; transform: translate(-50%, -52%); width: min(980px, calc(100vw - var(--panel-w) - 40px)); }
#worldmap .window-head .btn { flex: 0 0 auto; }
#worldmap-canvas { display: block; width: 100%; height: min(640px, calc(100vh - 170px)); background: #2b6f8f; border-radius: 10px; cursor: grab; touch-action: none; }
#worldmap-canvas:active { cursor: grabbing; }
.worldmap-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; margin-top: 8px; font-size: 12px; }
.worldmap-legend span { display: flex; align-items: center; gap: 6px; }
.worldmap-legend .hint { margin-left: auto; color: var(--muted); }
.lg { display: inline-block; width: 12px; height: 12px; border: 1px solid #000; }
.lg-you { background: #fff; }
.lg-lode { background: #4fd3f0; transform: rotate(45deg) scale(0.8); }
.lg-bank { background: #f2c94c; border-radius: 50%; }
.lg-cook { background: #e8732c; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; }
.lg-fish { background: #7fd0ff; border-radius: 50%; width: 14px; height: 9px; }
.lg-rock { background: radial-gradient(circle at 40% 40%, #d07a45 0 2px, #8b8f8c 3px); border-radius: 50%; }
.lg-furnace { background: linear-gradient(#5a524a 50%, #ff9a3c 50%); }

/* ---------- the right-click menu ---------- */
#context-menu { position: fixed; z-index: 200; min-width: 150px; padding: 4px; background: var(--glass-strong); border: 1px solid var(--line-strong); border-radius: 11px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5); font-weight: 700; }
#context-menu .menu-head { color: var(--muted); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; padding: 4px 8px 5px; }
#context-menu .opt { padding: 5px 9px; border-radius: 7px; white-space: nowrap; cursor: pointer; }
#context-menu .opt:hover { background: rgba(242, 180, 90, 0.16); }
#context-menu .opt .t-obj { color: #7fe3d6; }
#context-menu .opt .t-item { color: #ffb36b; }
#context-menu .opt .t-npc { color: #ffe46b; }
#context-menu .opt .t-player { color: #fff; }

#tooltip { position: fixed; z-index: 150; max-width: 230px; padding: 6px 9px; background: var(--glass-strong); color: var(--text); border: 1px solid var(--line-strong); border-radius: 9px;
  font-size: 12px; pointer-events: none; white-space: pre-line; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45); }

/* ---------- the login ---------- */
#login { position: fixed; inset: 0; z-index: 500; display: grid; place-items: center;
  background: radial-gradient(ellipse at 50% 25%, rgba(255, 210, 140, 0.28), transparent 60%), linear-gradient(#4f97b8 0%, #6fae8c 55%, #3f7346 100%); }
.login-card { width: min(360px, calc(100vw - 32px)); padding: 26px 26px 20px; display: flex; flex-direction: column; gap: 12px; }
.login-card h1 { margin: 0; text-align: center; font: 800 36px var(--font); color: var(--accent); letter-spacing: 0.5px; }
.login-card .tagline { margin: -6px 0 8px; text-align: center; color: var(--muted); }
.login-card label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 800; }
.login-card input { height: 38px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: rgba(0, 0, 0, 0.3); color: #fff; font: 600 14px var(--font);
  outline: none; -webkit-user-select: text; user-select: text; }
.login-card input:focus { border-color: var(--accent); }
.login-note { margin: 0; font-size: 11px; color: var(--muted); text-align: center; }
#login-error { margin: 0; min-height: 1.2em; color: var(--danger); text-align: center; }

/* Small screens: the panel and chat shrink to fit. */
@media (max-width: 760px) {
  :root { --panel-w: 200px; --chat-w: calc(100vw - 16px); }
  #chatbox { height: min(170px, 30vh); }
  #side-panel { bottom: calc(min(170px, 30vh) + 16px); }
  .tab-body { height: 250px; }
  .slot { height: 34px; }
  #minimap-frame { transform: scale(0.8); transform-origin: top right; }
}
/* Short windows: the panel gives up some height so it never runs up into the minimap. */
@media (max-height: 700px) { .tab-body { height: 240px; } .slot { height: 33px; } }
