/* Everrealm UI overlay — owned by the UI agent. V3: "carved wood + aged iron"
   pixel chrome (ui-polish THEMING). Every panel wears the same hand-authored
   9-slice frame (var(--frame-wood), built in ui_theme.js), carries a themed
   identity banner, and sits on a dithered dark-wood fill. Density rules:
   panels 430–620px, 12px padding, tiles/cards over full-width rows.
   Type: small-caps headers, chunky brass numerals, parchment text (no pure
   white). Tooltips are torn-edge parchment. Buttons are 2px-bevel wood faces
   that press 1px down. */

:root {
  /* retheme of the base palette (overrides base.css) */
  --panel-bg: #241b11;
  --panel-border: #54402c;
  --gold: #e8b04f;
  --text: #e8e4d0;
  --text-dim: #a89f88;
  --accent: #9a7ae0;
  --danger: #e8563f;

  --dock-h: 108px;                /* bottom menu dock clearance */
  --ui-line: #3a2c1c;             /* hairlines inside panels */
  --well-bg: #191410;             /* inset slot wells */
  --wood-face: linear-gradient(180deg, #5f4832, #4a3722 55%, #3c2c1a);
  --hard-shadow: 0 3px 0 rgba(0, 0, 0, .45);
}

/* ---------- generic bits ---------- */

.pe-none { pointer-events: none !important; }
.pe-none * { pointer-events: none !important; }

input, textarea { user-select: text; }
input::placeholder { color: #7a705c; }

/* Beveled wood-face button: 2px bevel, pressed state shifts 1px down. */
.btn {
  background: var(--wood-face);
  border: 2px solid #201709;
  color: var(--text);
  border-radius: 3px;
  padding: 6px 14px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  letter-spacing: .02em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .6);
  box-shadow: inset 0 2px 0 #7a5f40, inset 0 -2px 0 #291d0f, 0 2px 0 #120d07;
  transition: filter .1s ease, transform .06s ease, box-shadow .06s ease;
}
.btn:hover:not(:disabled) { filter: brightness(1.14); }
.btn:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, .5), 0 1px 0 #120d07;
}
.btn:disabled { opacity: .38; cursor: default; }
.btn.primary {
  background: linear-gradient(180deg, #f5cd76, #e8b04f 45%, #c8952a);
  border-color: #6b5210;
  color: #2a1e08;
  text-shadow: 0 1px 0 rgba(255, 245, 210, .5);
  box-shadow: inset 0 2px 0 #ffe9ad, inset 0 -2px 0 #a87d20, 0 2px 0 #120d07;
}
.btn.small { padding: 3px 9px; font-size: .8rem; }
.btn.ghost { opacity: .5; }

/* icon action buttons (inventory Sort) */
.icon-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 9px;
  background: var(--wood-face);
  border: 2px solid #201709;
  border-radius: 3px;
  color: var(--text-dim);
  font: inherit; font-size: .74rem; font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 2px 0 #7a5f40, inset 0 -2px 0 #291d0f, 0 2px 0 #120d07;
  transition: filter .1s ease, transform .06s ease;
}
.icon-btn:hover { filter: brightness(1.14); color: var(--text); }
.icon-btn:active { transform: translateY(1px); }
.icon-btn img { filter: drop-shadow(0 1px 0 rgba(0,0,0,.6)); }
.icon-btn-label { text-transform: uppercase; letter-spacing: .07em; font-size: .64rem; }

.icon-sm { width: 16px; height: 16px; vertical-align: middle; }

/* pixel-crunch every icon image */
.chip img, .icon-sm, img.icon, .lock-icon, .roundel img, .pd-ghost, .fly-icon,
.altar-empty-icon { image-rendering: pixelated; }

/* ---------- icon chips ---------- */

.chip {
  position: relative;
  width: 34px; height: 34px;
  border-radius: 3px;
  border: 2px solid rgba(0, 0, 0, .4);
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .22), inset 0 -2px 0 rgba(0, 0, 0, .28), 0 2px 0 rgba(0, 0, 0, .4);
  flex-shrink: 0;
}
.chip img { width: 21px; height: 21px; filter: drop-shadow(0 1px 0 rgba(0,0,0,.6)); }
.chip-sm { width: 28px; height: 28px; border-radius: 3px; }
.chip-sm img { width: 17px; height: 17px; }
.chip-xs { width: 22px; height: 22px; border-radius: 3px; border-width: 1px; }
.chip-xs img { width: 14px; height: 14px; }
/* rarity border tints — data-rarity + inline border color set by itemChip()
   from shared RARITY; the glow for the top tiers lives here. */
.chip[data-rarity="uncommon"] { border-color: #4fae5a; }
.chip[data-rarity="rare"] {
  border-color: #4a86e8;
  box-shadow: inset 0 0 6px rgba(74, 134, 232, .35),
    inset 0 2px 0 rgba(255, 255, 255, .22), inset 0 -2px 0 rgba(0, 0, 0, .28),
    0 2px 0 rgba(0, 0, 0, .4);
}
.chip[data-rarity="unique"] {
  border-color: #e0a92e;
  box-shadow: inset 0 0 7px rgba(224, 169, 46, .45),
    inset 0 2px 0 rgba(255, 255, 255, .22), inset 0 -2px 0 rgba(0, 0, 0, .28),
    0 2px 0 rgba(0, 0, 0, .4);
}

.chip-qty {
  position: absolute; bottom: -6px; right: -6px;
  background: #150f08;
  border: 1px solid #54402c;
  border-radius: 3px;
  font-size: 10px; line-height: 1.25;
  font-weight: 800;
  padding: 0 3px;
  color: var(--gold);
  pointer-events: none;
}

/* brass roundel (panel banners, dock signs) */
.roundel {
  position: relative;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f5cd76, #d8a13c 55%, #8a6a16 95%);
  border: 2px solid #5c460f;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .3), 0 2px 0 rgba(0, 0, 0, .4);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.roundel img { width: 18px; height: 18px; filter: drop-shadow(0 1px 0 rgba(60,40,8,.8)); }

/* ---------- small-caps labels ---------- */

.col-title, .tt-type, .inv-gold-label, .bag-cap-label,
.quest-rw-label, .dock-label, .afk-food-label, .lv-label,
.talent-points-label, .talent-presets-label, .consum-label {
  text-transform: uppercase;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .09em;
  color: var(--text-dim);
}

/* ---------- thin scrollbars ---------- */

.panel-body, .chat-list, .modal {
  scrollbar-width: thin;
  scrollbar-color: #5a452e transparent;
}
.panel-body::-webkit-scrollbar, .chat-list::-webkit-scrollbar, .modal::-webkit-scrollbar {
  width: 8px; height: 8px;
}
.panel-body::-webkit-scrollbar-thumb, .chat-list::-webkit-scrollbar-thumb,
.modal::-webkit-scrollbar-thumb {
  background: #5a452e; border-radius: 0;
}
.panel-body::-webkit-scrollbar-track, .chat-list::-webkit-scrollbar-track,
.modal::-webkit-scrollbar-track {
  background: transparent;
}

/* =====================================================================
   THE FRAME — one carved chrome motif for every panel-grade surface
   ===================================================================== */

.framed {
  border: 16px solid transparent;
  border-image: var(--frame-wood) 8 round;
  background: var(--panel-bg) var(--tex-noise);
  background-clip: padding-box;
}

/* =====================================================================
   LOGIN — first impression: the full carved treatment
   ===================================================================== */

.login-veil {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(64, 46, 26, .45) 0%, rgba(14, 11, 7, .95) 78%),
    linear-gradient(180deg, #17110a, #0d0a06);
  display: flex; align-items: center; justify-content: center;
}
.login-card {
  width: min(410px, 92vw);
  max-height: 94vh;
  overflow-y: auto;
  border: 16px solid transparent;
  border-image: var(--frame-wood) 8 round;
  background: var(--panel-bg) var(--tex-noise);
  background-clip: padding-box;
  padding: 14px 18px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  box-shadow: 0 8px 0 rgba(0, 0, 0, .45), 0 24px 60px rgba(0, 0, 0, .8);
  animation: panel-in .22s ease;
}
.login-logo { width: 80px; height: 80px; border-radius: 4px; box-shadow: 0 4px 0 rgba(0,0,0,.5); }
.login-title {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: .32em;
  margin-left: .32em; /* visually recenter the tracked-out text */
  color: var(--gold);
  text-shadow: 0 2px 0 rgba(0,0,0,.7), 0 0 18px rgba(232,176,79,.3);
}
.login-tagline { color: var(--text-dim); font-size: .86rem; margin-bottom: 6px; font-style: italic; }

.text-input {
  width: 100%;
  padding: 8px 11px;
  border-radius: 3px;
  border: 2px solid #17110a;
  background: var(--well-bg);
  color: var(--text);
  font: inherit;
  outline: none;
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, .5), inset 0 -1px 0 rgba(255, 255, 255, .05);
  transition: border-color .12s ease;
}
.text-input:focus { border-color: var(--gold); }

.field { width: 100%; display: flex; flex-direction: column; gap: 3px; }
.field-hint { font-size: .72rem; color: var(--text-dim); padding-left: 2px; }
.field-err { font-size: .74rem; color: var(--danger); padding-left: 2px; min-height: 0; }
.field-err:empty { display: none; }

.login-remember {
  align-self: flex-start;
  display: flex; align-items: center; gap: 7px;
  color: var(--text-dim); font-size: .85rem;
  cursor: pointer;
}
.login-remember input { accent-color: var(--gold); cursor: pointer; }

.login-error { min-height: 1.25em; color: var(--danger); font-size: .85rem; text-align: center; }

.login-btns { display: flex; gap: 10px; width: 100%; }
.login-btns .btn { flex: 1; }

.login-conn { display: flex; align-items: center; gap: 7px; color: var(--text-dim); font-size: .8rem; margin-top: 6px; }
.conn-dot { width: 9px; height: 9px; border-radius: 2px; background: #777; transition: background .2s ease; }
.conn-dot.on { background: #58c890; box-shadow: 0 0 8px rgba(88,200,144,.7); }
.conn-dot.off { background: var(--danger); }

/* =====================================================================
   HUD
   ===================================================================== */

.hud { position: absolute; display: flex; flex-direction: column; gap: 7px; z-index: 30; }
.hud-tl { top: 14px; left: 14px; }
.hud-tr { top: 14px; right: 14px; align-items: flex-end; }

.hud-id { display: flex; align-items: center; gap: 8px; }
.hud-name { font-weight: 700; font-size: 1.02rem; text-shadow: 0 1px 0 rgba(0,0,0,.8); }
.lvl-badge {
  background: linear-gradient(180deg, #3c2c1a, #2a1e10);
  border: 2px solid #54402c;
  border-radius: 3px;
  padding: 0 8px;
  font-size: .74rem;
  font-weight: 800;
  color: var(--gold);
  box-shadow: inset 0 1px 0 rgba(255, 228, 180, .12), 0 2px 0 rgba(0, 0, 0, .4);
}

.bar {
  position: relative;
  width: 225px; height: 19px;
  background: var(--well-bg);
  border: 2px solid #17110a;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, .5), var(--hard-shadow);
}
.bar-fill {
  position: absolute; inset: 0 auto 0 0;
  width: 0%;
  transition: width .25s ease, background .25s ease;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.22), inset 0 -2px 0 rgba(0,0,0,.28);
}
.hp-bar .bar-fill { background: linear-gradient(180deg, #e86a70, #d84f5a); }
.bar-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 800;
  color: #f5f2e4;
  text-shadow: 0 1px 0 rgba(0,0,0,.9);
  pointer-events: none;
}
.bar.xp-pulse { animation: xp-pulse .5s ease; }
@keyframes xp-pulse {
  0% { box-shadow: inset 0 2px 0 rgba(0,0,0,.5), 0 0 0 rgba(232,176,79,0); }
  40% { box-shadow: inset 0 2px 0 rgba(0,0,0,.5), 0 0 16px rgba(232,176,79,.8); border-color: var(--gold); }
  100% { box-shadow: inset 0 2px 0 rgba(0,0,0,.5), 0 0 0 rgba(232,176,79,0); }
}

.hud-xp { display: flex; align-items: center; gap: 7px; }
.hud-xp .bar { width: 190px; height: 16px; }
.xp-chip { display: flex; }

.hud-gold {
  position: relative;
  display: flex; align-items: center; gap: 7px;
  background: linear-gradient(180deg, #3c2c1a, #2a1e10);
  border: 2px solid #54402c;
  border-radius: 3px;
  padding: 2px 11px;
  width: fit-content;
  box-shadow: inset 0 1px 0 rgba(255, 228, 180, .1), var(--hard-shadow);
}
.gold-amt { color: var(--gold); font-weight: 800; font-size: .92rem; }
.inv-gold-label { margin-left: 2px; }

/* green "+" delta flash on gold gains */
.gold-delta {
  position: absolute; right: 4px; top: -6px;
  color: #8fe86a;
  font-size: .78rem; font-weight: 800;
  text-shadow: 0 1px 0 rgba(0,0,0,.8);
  pointer-events: none;
  animation: gold-float 1.15s ease forwards;
}
@keyframes gold-float {
  from { opacity: 0; transform: translateY(4px); }
  25% { opacity: 1; }
  to { opacity: 0; transform: translateY(-16px); }
}

/* ---- Alchemy buff chips (small, family-tinted, MM:SS countdown) ---- */
.hud-buffs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.hud-buffs.hidden { display: none; }
.buff-chip {
  display: flex; align-items: center; gap: 5px;
  padding: 2px 7px 2px 6px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--buff) 26%, rgba(20,16,26,.82));
  border: 1px solid var(--buff);
  box-shadow: 0 0 6px color-mix(in srgb, var(--buff) 45%, transparent);
}
.buff-sh { font-size: .62rem; font-weight: 800; letter-spacing: .5px; color: #f3e8cf; text-shadow: 0 1px 0 rgba(0,0,0,.8); }
.buff-time { font-size: .66rem; font-weight: 700; color: #f3e8cf; text-shadow: 0 1px 0 rgba(0,0,0,.8); font-variant-numeric: tabular-nums; }

/* ---- consumable chips (quiver / rune pouch) ---- */

.hud-consum { display: flex; gap: 7px; }
.consum-chip {
  display: flex; align-items: center; gap: 7px;
  padding: 3px 9px 3px 4px;
  background: linear-gradient(180deg, #3c2c1a, #2a1e10);
  border: 2px solid #54402c;
  border-radius: 3px;
  cursor: pointer;
  font: inherit; color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 228, 180, .1), var(--hard-shadow);
  transition: border-color .12s ease, filter .1s ease;
}
.consum-chip:hover { border-color: var(--gold); filter: brightness(1.1); }
.consum-txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.consum-count { font-weight: 800; font-size: .86rem; color: var(--gold); }
.consum-count.spell-name { font-size: .78rem; }
.consum-label { font-size: .56rem; }
.consum-chip.short {
  border-color: #a03830;
  animation: bagfull-pulse 1.5s ease-in-out infinite alternate;
}
.consum-chip.short .consum-count, .consum-chip.short .consum-label { color: #f0a89a; }
.rune-count { display: flex; align-items: center; gap: 3px; font-size: .78rem; font-weight: 800; color: var(--gold); }
.rune-count.short { color: #f07a6a; }

/* popover picker (arrow tiers / spell swap) */
.hud-popover {
  position: fixed;
  z-index: 80;
  min-width: 190px;
  border: 8px solid transparent;
  border-image: var(--frame-wood) 8 round;
  background: var(--panel-bg) var(--tex-noise);
  background-clip: padding-box;
  padding: 4px;
  display: flex; flex-direction: column; gap: 2px;
  box-shadow: 0 6px 0 rgba(0, 0, 0, .4), 0 14px 30px rgba(0, 0, 0, .7);
}
.hud-pop-title {
  text-transform: uppercase; letter-spacing: .09em;
  font-size: .64rem; font-weight: 800; color: var(--text-dim);
  padding: 3px 6px 5px;
  border-bottom: 1px solid var(--ui-line);
  margin-bottom: 2px;
}
.hud-pop-row {
  display: flex; align-items: center; gap: 7px;
  padding: 4px 7px;
  background: none; border: 2px solid transparent; border-radius: 3px;
  color: var(--text);
  font: inherit; font-size: .8rem; text-align: left;
  cursor: pointer;
}
.hud-pop-row:hover { background: rgba(232, 176, 79, .1); border-color: #54402c; }
.hud-pop-row.active { border-color: var(--gold); background: rgba(232, 176, 79, .12); }
.hud-pop-item { display: flex; align-items: center; gap: 7px; pointer-events: none; }

/* persistent "no free inventory slot" warning (ground-items wave) */
.bagfull-chip {
  display: flex; align-items: center; gap: 6px;
  width: fit-content;
  padding: 2px 10px;
  background: rgba(58, 21, 18, .92);
  border: 2px solid #a03830;
  border-radius: 3px;
  color: #f0a89a;
  font-size: .74rem; font-weight: 800;
  letter-spacing: .08em;
  animation: bagfull-pulse 1.5s ease-in-out infinite alternate;
}
@keyframes bagfull-pulse {
  from { box-shadow: var(--hard-shadow), 0 0 4px rgba(232, 86, 63, .15); }
  to { box-shadow: var(--hard-shadow), 0 0 12px rgba(232, 86, 63, .55); }
}

.hud-task { font-size: .78rem; color: var(--text-dim); text-shadow: 0 1px 0 rgba(0,0,0,.8); padding-left: 4px; }

/* forecast: projected rates for the current task — small and dim, 3 lines max */
.hud-forecast {
  display: flex; flex-direction: column; gap: 1px;
  padding-left: 4px;
  font-size: .7rem;
  color: #8a8068;
  text-shadow: 0 1px 0 rgba(0,0,0,.8);
}
.hud-forecast-line { white-space: nowrap; }

.map-pill {
  display: flex; align-items: center; gap: 7px;
  background: linear-gradient(180deg, #3c2c1a, #2a1e10);
  border: 2px solid #54402c;
  border-radius: 3px;
  padding: 4px 13px;
  font-size: .88rem;
  box-shadow: inset 0 1px 0 rgba(255, 228, 180, .1), var(--hard-shadow);
}
.map-pill-name { font-weight: 700; color: var(--gold); }
.pill-sep { color: var(--text-dim); }
.pill-online { color: var(--text-dim); font-size: .8rem; }

/* small settings gear tucked beside the zone pill (the only Settings entry) */
.hud-toprow { display: flex; align-items: center; gap: 8px; }
.hud-gear {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; flex-shrink: 0;
  background: linear-gradient(180deg, #3c2c1a, #2a1e10);
  border: 2px solid #54402c;
  border-radius: 3px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 228, 180, .1), var(--hard-shadow);
  opacity: .78;
  transition: opacity .12s ease, transform .08s ease, border-color .12s ease;
}
.hud-gear img { width: 17px; height: 17px; image-rendering: pixelated; }
.hud-gear:hover { opacity: 1; border-color: var(--gold); transform: rotate(35deg); }

/* =====================================================================
   BOTTOM MENU DOCK — a wooden rail of hanging shop signs
   ===================================================================== */

.menu-dock {
  position: absolute;
  bottom: 6px; left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: flex-start; gap: 7px;
  padding: 12px 14px 6px;
  z-index: 35;
}
/* the rail the signs hang from */
.menu-dock::before {
  content: '';
  position: absolute;
  top: 0; left: -4px; right: -4px;
  height: 11px;
  background: linear-gradient(180deg, #6f5539, #54402c 55%, #3a2c1e);
  border: 2px solid #1a130c;
  border-radius: 3px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 228, 180, .16);
}

.dock-btn {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  background: none; border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
}
/* two brass chains from the rail to the sign */
.dock-hanger {
  width: 26px; height: 9px;
  border-left: 3px solid #8a6a16;
  border-right: 3px solid #8a6a16;
  box-sizing: border-box;
  transition: transform .1s ease;
}
.dock-sign {
  width: 66px;
  border: 8px solid transparent;
  border-image: var(--frame-wood) 8 round;
  background: #4a3722 var(--tex-noise);
  background-clip: padding-box;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 4px 2px 3px;
  transition: transform .1s ease, box-shadow .12s ease, filter .12s ease;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .4);
}
.dock-btn:hover .dock-sign { transform: translateY(-2px); filter: brightness(1.12); }
.dock-btn:active .dock-sign { transform: translateY(1px); }
.dock-roundel { width: 30px; height: 30px; }
.dock-roundel img { width: 17px; height: 17px; }

.dock-key {
  position: absolute; bottom: -6px; right: -10px;
  background: #150f08;
  border: 1px solid #54402c;
  border-radius: 3px;
  font-family: inherit;
  font-size: 9px; font-weight: 700; line-height: 1.3;
  letter-spacing: .02em;
  padding: 0 3px;
  color: var(--text-dim);
  pointer-events: none;
}

.dock-badge {
  position: absolute; top: -7px; right: -9px;
  min-width: 17px;
  background: var(--danger);
  border: 2px solid #1a130c;
  border-radius: 3px;
  color: #fff8ee;
  font-size: .66rem; font-weight: 800; line-height: 1.4;
  text-align: center;
  padding: 0 3px;
  pointer-events: none;
  animation: badge-pop .18s ease;
}
@keyframes badge-pop {
  from { transform: scale(.4); }
  to { transform: scale(1); }
}

.dock-label {
  font-size: .58rem;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .8), 0 -1px 0 rgba(255, 240, 200, .06);
  transition: color .1s ease;
}

/* open panel's sign lights up */
.dock-btn.active .dock-sign {
  box-shadow: 0 0 16px rgba(232, 176, 79, .4), 0 4px 0 rgba(0, 0, 0, .4);
  filter: brightness(1.15);
}
.dock-btn.active .dock-label { color: var(--gold); }

/* AUTO — the lantern sign: amber glass roundel, lit while on */
.dock-btn.auto .dock-roundel {
  border-radius: 6px;
  background: radial-gradient(circle at 50% 42%, #6b4a1c, #3c2c1a 80%);
  border-color: #2a1e10;
}
.dock-btn.auto.lit .dock-roundel {
  background: radial-gradient(circle at 50% 42%, #fff3c4, #f0c040 45%, #a85c14 95%);
  border-color: #6b5210;
  box-shadow: 0 0 16px rgba(240, 192, 64, .8), inset 0 -2px 0 rgba(0, 0, 0, .3);
  animation: lantern-flicker 2.2s ease-in-out infinite;
}
.dock-btn.lit .dock-sign { box-shadow: 0 0 18px rgba(240, 192, 64, .5), 0 4px 0 rgba(0, 0, 0, .4); }
.dock-btn.lit .dock-label { color: var(--gold); text-shadow: 0 0 8px rgba(240,192,64,.6); }
@keyframes lantern-flicker {
  0%, 100% { box-shadow: 0 0 16px rgba(240, 192, 64, .8), inset 0 -2px 0 rgba(0, 0, 0, .3); }
  48% { box-shadow: 0 0 11px rgba(240, 192, 64, .55), inset 0 -2px 0 rgba(0, 0, 0, .3); }
  52% { box-shadow: 0 0 18px rgba(240, 192, 64, .9), inset 0 -2px 0 rgba(0, 0, 0, .3); }
}

/* =====================================================================
   PANELS — docked to the RIGHT EDGE (owner PLACEMENT OVERRIDE, OSRS
   interface-pane style): anchored right w/ 12px margin, growing upward
   from just above the dock to ~64px below the top HUD, 360–460px wide.
   The world stays visible and playable on the left. Slide-in from the
   right (120ms). Modals (AFK / death / update) stay centered.
   ===================================================================== */

.panel {
  position: absolute;
  right: 12px;
  bottom: calc(var(--dock-h) + 10px);
  transform: translateX(18px);
  width: min(var(--pw, 460px), calc(100vw - 24px));
  max-height: calc(100vh - 64px - var(--dock-h) - 20px);
  display: flex; flex-direction: column;
  border: 16px solid transparent;
  border-image: var(--frame-wood) 8 round;
  background: var(--panel-bg) var(--tex-noise);
  background-clip: padding-box;
  box-shadow: 0 8px 0 rgba(0, 0, 0, .45), -8px 14px 40px rgba(0, 0, 0, .6);
  z-index: 40;
  opacity: 0;
  transition: opacity .12s ease, transform .12s ease;
}
.panel.open { opacity: 1; transform: translateX(0); }
.panel.closing { opacity: 0; transform: translateX(18px); }

/* per-panel widths (placement override caps panes at 360–460px) */
.p-inventory { --pw: 460px; }
.p-skills { --pw: 430px; }
.p-talents { --pw: 460px; }
.p-quests { --pw: 460px; }
.p-worldmap { --pw: 460px; }
.p-shop { --pw: 460px; }
.p-bank { --pw: 460px; }
.p-craft-smith, .p-craft-cook { --pw: 460px; }
.p-craft-altar { --pw: 420px; }
/* MENU HUB (owner 2026-07-04): ONE fixed size for every tab, CENTERED like the
   world map — the body scrolls inside so switching tabs never resizes the frame. */
.p-menu {
  --pw: min(880px, 92vw);
  right: auto;
  left: 50%;
  bottom: auto;
  top: 50%;
  height: min(640px, 86vh);
  transform: translate(-50%, calc(-50% + 12px));
}
.p-menu.open { transform: translate(-50%, -50%); }
.p-menu.closing { opacity: 0; transform: translate(-50%, calc(-50% + 12px)); }
.p-menu .hub-body { flex: 1 1 auto; overflow-y: auto; min-height: 0; }

/* Guild "soon" teaser tab */
.hub-tab.soon { opacity: .75; }
.hub-soon-tag {
  font-size: .5rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  background: #7a5a3a; color: #f0e0c0; border-radius: 6px; padding: 1px 5px; margin-left: 6px;
}
.guild-soon { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 34px 18px; text-align: center; }
.guild-soon-roundel { width: 64px; height: 64px; opacity: .8; }
.guild-soon-title { color: #f3e8cf; font-size: 1.1rem; font-weight: 800; letter-spacing: .06em; }
.guild-soon-sub { font-size: .62rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: #c8a860; }

/* Stats tab: weapon-style preview bar + stat grid */
.stats-stylebar { display: flex; gap: 6px; margin: 4px 0 10px; }
.stats-stylebtn {
  flex: 1; padding: 6px 8px; font-weight: 800; font-size: .7rem; letter-spacing: .04em;
  border-radius: 8px; border: 1px solid rgba(0,0,0,.35); background: rgba(0,0,0,.22); cursor: pointer;
}
.stats-stylebtn.active { background: #6d5230; box-shadow: inset 0 0 0 1px rgba(255,220,150,.35); }
.stats-stylebtn.noweapon { opacity: .45; cursor: default; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.stats-row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 8px; background: rgba(0,0,0,.16); border-radius: 6px; }
.stats-label { color: #cdbfa3; font-size: .68rem; }
.stats-val { color: #f3e8cf; font-weight: 800; font-size: .72rem; }

/* ---- identity banner: every panel gets its own themed header strip ---- */

.panel-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  flex-shrink: 0;
  border-bottom: 2px solid #17110a;
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, .3);
}
.banner-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.banner-title {
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  font-size: .9rem;
  color: var(--gold);
  text-shadow: 0 1px 0 rgba(0,0,0,.75);
}
.banner-sub { font-size: .7rem; color: var(--text-dim); text-shadow: 0 1px 0 rgba(0,0,0,.6); }

.banner-divider { height: 2px; flex-shrink: 0; opacity: .8; }

/* per-panel banner identities (ui-polish THEMING #2) */
.b-inventory { background: var(--tex-leather), linear-gradient(180deg, #5f4429, #46311c); }
.b-skills { background: var(--tex-parch), linear-gradient(180deg, #dccb9d, #c4b183); }
.b-skills .banner-title { color: #4a3618; text-shadow: 0 1px 0 rgba(255, 248, 224, .5); }
.b-skills .banner-sub { color: #6b5230; text-shadow: none; }
.b-talents { background: var(--tex-stars), linear-gradient(180deg, #3c2a58, #241736); }
.b-talents .banner-title { color: #cdb4f5; }
.b-quests { background: var(--tex-cork), linear-gradient(180deg, #7a5c38, #5f462a); }
.b-quests::after {
  content: '';
  width: 26px; height: 30px;
  background: var(--motif-note) no-repeat center / contain;
  margin-right: 28px;
  transform: rotate(6deg);
  image-rendering: pixelated;
}
.b-worldmap { background: var(--tex-noise), linear-gradient(180deg, #2c4d54, #1c343a); }
.b-worldmap .banner-title { color: #a8dce0; }
.b-shop { background: repeating-linear-gradient(90deg, #a8422f 0 18px, #ddd2b0 18px 36px); }
.b-shop .banner-titles {
  background: rgba(24, 14, 8, .72);
  border-radius: 3px;
  padding: 2px 9px;
}
.b-bank {
  background:
    radial-gradient(circle 2px at 12px 8px, #8a94a0 0 1.5px, transparent 2px),
    radial-gradient(circle 2px at 12px 8px, #8a94a0 0 1.5px, transparent 2px),
    var(--tex-iron), linear-gradient(180deg, #5d6570, #454e58);
  background-position: 0 0, 16px 24px, 0 0, 0 0;
  background-size: 32px 32px, 32px 32px, auto, auto;
}
.b-bank .banner-title { color: #e2e8ee; }
.b-bank .banner-sub { color: #b8c0ca; }
.b-craft-smith, .b-craft-cook {
  background: var(--tex-embers), linear-gradient(180deg, #331a0c, #4a2410);
  box-shadow: inset 0 -8px 14px rgba(232, 100, 30, .25), inset 0 -3px 6px rgba(0, 0, 0, .3);
}
.b-craft-smith .banner-title, .b-craft-cook .banner-title { color: #f5b06a; }
.b-craft-altar { background: var(--tex-stars), linear-gradient(180deg, #37204e, #221231); }
.b-craft-altar .banner-title { color: #cdb4f5; }
.b-menu { background: var(--tex-noise), linear-gradient(180deg, #54402c, #3c2c1a); }
.b-settings { background: var(--tex-iron), linear-gradient(180deg, #4b525c, #363c44); }
.b-settings .banner-title { color: #e2e8ee; }
.b-settings .banner-sub { color: #b8c0ca; }

.panel-close {
  background: none; border: 2px solid transparent;
  color: var(--text-dim);
  font-size: 1.2rem; line-height: 1;
  width: 26px; height: 26px;
  border-radius: 3px;
  cursor: pointer;
  text-shadow: 0 1px 0 rgba(0,0,0,.6);
}
.panel-close:hover { color: #fff3d6; background: rgba(0,0,0,.25); border-color: rgba(0,0,0,.4); }
.b-skills .panel-close { color: #6b5230; text-shadow: none; }
.b-skills .panel-close:hover { color: #2a1e08; background: rgba(90, 68, 37, .18); }

.panel-body { padding: 12px; overflow-y: auto; }
.panel-foot { margin-top: 10px; font-size: .74rem; color: var(--text-dim); text-align: center; font-style: italic; }

.mini-bar {
  height: 6px;
  background: var(--well-bg);
  border: 1px solid rgba(0,0,0,.55);
  border-radius: 0;
  overflow: hidden;
}
.mini-fill { height: 100%; background: #58c890; transition: width .25s ease; }

.req-bad { color: var(--danger) !important; }

.col-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* ---------- inventory (bags wave: tabs + bag rail + big friendly grid) ---------- */

/* tab strip: Backpack | Equipment — the paperdoll lives on its own page so
   the slot grid gets the panel's full width and breathes */
.inv-tabs {
  display: flex; gap: 5px;
  margin-bottom: 10px;
  border-bottom: 2px solid var(--ui-line);
  padding-bottom: 6px;
}
.inv-tab {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 6px 4px;
  background: rgba(18, 13, 8, .6);
  border: 2px solid #241a10;
  border-radius: 3px;
  color: var(--text-dim);
  font: inherit; font-size: .78rem; font-weight: 700;
  cursor: pointer;
  transition: transform .08s ease, border-color .1s ease, color .1s ease;
}
.inv-tab:hover { color: var(--text); transform: translateY(-1px); }
.inv-tab.active {
  color: var(--gold);
  border-color: #6b5210;
  background: rgba(60, 44, 16, .5);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, .35);
}

.inv-pack { display: flex; flex-direction: column; gap: 10px; }

/* bag sockets rail: 4 wearable-bag sockets + live capacity readout */
.bag-rail {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 7px 10px;
  background: rgba(16, 12, 7, .55);
  border: 2px solid var(--ui-line);
  border-radius: 4px;
}
.bag-sockets { display: flex; gap: 7px; }
.bag-socket {
  width: 46px; height: 46px;
  border-radius: 4px;
  background: var(--well-bg);
  border: 2px dashed #4a3a26;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, .45);
  transition: border-color .1s ease, transform .08s ease;
}
.bag-ghost { width: 22px; height: 22px; opacity: .25; image-rendering: pixelated; }
.bag-socket.filled { border-style: solid; border-color: #54402c; cursor: pointer; }
.bag-socket.filled:hover { border-color: var(--gold); transform: scale(1.05); }
.bag-socket .chip { width: 36px; height: 36px; box-shadow: none; }
.bag-cap { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.bag-cap-num {
  font-size: 1.15rem; font-weight: 800;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .6);
}
.bag-cap.full .bag-cap-num { color: #f07a6a; }

/* mode row: one segmented Use / Sell / Drop control + the Sort action */
.inv-controls { display: flex; align-items: stretch; gap: 7px; }
.sort-btn { flex-shrink: 0; }
.seg-ctl {
  flex: 1;
  display: flex; gap: 2px;
  padding: 2px;
  background: var(--well-bg);
  border: 2px solid #17110a;
  border-radius: 3px;
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, .5);
}
.seg {
  flex: 1;
  padding: 5px 4px;
  background: none;
  border: 2px solid transparent;
  border-radius: 2px;
  color: var(--text-dim);
  font: inherit; font-size: .72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .08em;
  cursor: pointer;
  transition: color .1s ease, background .1s ease, border-color .1s ease;
}
.seg:hover { color: var(--text); }
.seg.active.use {
  background: linear-gradient(180deg, #6b5210, #4a3a10);
  border-color: #c8952a; color: var(--gold);
  box-shadow: inset 0 1px 0 rgba(255, 228, 180, .2);
}
.seg.active.sell {
  background: linear-gradient(180deg, #6b2a22, #4a1c16);
  border-color: #8a3428; color: #f0b0a4;
  box-shadow: inset 0 1px 0 rgba(255, 200, 180, .15);
}
.seg.active.drop {
  background: linear-gradient(180deg, #6b4a1c, #4a3412);
  border-color: #a87d20; color: #e8a05a;
  box-shadow: inset 0 1px 0 rgba(255, 228, 180, .15);
}

/* always-visible "what does a click do" line for the active mode */
.inv-mode-hint {
  padding: 4px 9px;
  font-size: .72rem;
  border: 1px solid var(--ui-line);
  border-radius: 3px;
  background: rgba(18, 13, 8, .55);
  color: var(--text-dim);
}
.inv-mode-hint.m-sell { border-color: #6a2e28; color: #f0b0a4; }
.inv-mode-hint.m-drop { border-color: #7a5c1c; color: #e8a05a; }

/* base slot grid (the bank reuses it at this size). Every well wears the
   carved slot-well 9-slice so cells read as chunky sunken pockets. */
.inv-grid { display: grid; grid-template-columns: repeat(6, 40px); gap: 6px; }
.inv-slot {
  width: 40px; height: 40px;
  border: 4px solid transparent;
  border-image: var(--frame-well) 4;
  background: var(--well-bg);
  background-clip: padding-box;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform .08s ease;
}
.inv-slot.empty { cursor: default; }
.inv-slot:not(.empty):hover {
  outline: 2px solid var(--gold); outline-offset: -1px;
  transform: scale(1.06);
  z-index: 2;
}
.inv-slot .chip { width: 32px; height: 32px; box-shadow: none; border-width: 1px; }
.inv-slot .chip img { width: 20px; height: 20px; }
.inv-slot .chip img.item-png { width: 26px; height: 26px; }

/* the inventory panel itself gets the BIG grid: 7 × 50px wells, larger icons,
   fatter qty badges. Any capacity renders (24 → 52 today); extra rows scroll. */
.p-inventory .inv-grid { grid-template-columns: repeat(7, 50px); justify-content: center; }
.p-inventory .inv-slot { width: 50px; height: 50px; }
.p-inventory .inv-slot .chip { width: 40px; height: 40px; }
.p-inventory .inv-slot .chip img { width: 25px; height: 25px; }
.p-inventory .inv-slot .chip img.item-png { width: 34px; height: 34px; }
.p-inventory .inv-slot .chip-qty { font-size: 11px; bottom: -5px; right: -5px; }

/* drag-to-reorder (inventory panel only) */
.inv-slot.dragging { opacity: .45; }
.inv-slot.drop-target {
  outline: 2px solid var(--gold); outline-offset: -1px;
  background: rgba(60, 44, 16, .8);
  box-shadow: 0 0 8px rgba(232, 176, 79, .35);
}
.inv-slot.drop-target * { pointer-events: none; }  /* keep dragleave from flickering */

.inv-gold {
  align-self: center;
  display: flex; align-items: center; gap: 7px;
  padding: 5px 14px;
  background: var(--well-bg);
  border: 2px solid #17110a;
  border-radius: 3px;
  width: fit-content;
  box-shadow: inset 0 2px 0 rgba(0,0,0,.4);
}

/* paperdoll (Equipment tab): roomy slots around the live character sprite */
.paperdoll {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px 14px;
  background: rgba(16, 12, 7, .55);
  border: 2px solid var(--ui-line);
  border-radius: 4px;
  height: fit-content;
}
.pd-wide { width: fit-content; margin: 2px auto 0; }
.pd-grid {
  display: grid;
  grid-template-areas:
    '.      helmet .'
    'weapon sprite amulet'
    'chest  sprite ring'
    'legs   sprite boots';
  grid-template-columns: 54px 112px 54px;
  grid-auto-rows: minmax(54px, auto);
  gap: 8px;
  align-items: center;
  justify-items: center;
}
.pd-sprite {
  grid-area: sprite;
  align-self: stretch; justify-self: stretch;
  display: flex; align-items: flex-end; justify-content: center;
  background:
    radial-gradient(ellipse 60% 22% at 50% 92%, rgba(0, 0, 0, .5), transparent 70%),
    linear-gradient(180deg, rgba(38, 28, 16, .5), rgba(22, 16, 9, .7));
  border: 2px solid #17110a;
  border-radius: 4px;
  box-shadow: inset 0 2px 0 rgba(0,0,0,.5);
  overflow: hidden;
}
.pd-sprite-cv {
  width: 104px; height: 120px;
  image-rendering: pixelated;
  margin-bottom: 2px;
}
.pd-box {
  width: 54px; height: 54px;
  border-radius: 3px;
  background: var(--well-bg);
  border: 2px dashed #3a2c1c;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 2px 0 rgba(0,0,0,.45);
  transition: border-color .1s ease, transform .08s ease;
}
.pd-box.filled { border-style: solid; border-color: #54402c; cursor: pointer; }
.pd-box.filled:hover { border-color: var(--gold); transform: scale(1.05); }
.pd-box .chip { width: 42px; height: 42px; box-shadow: none; }
.pd-box .chip img { width: 26px; height: 26px; }
.pd-box .chip img.item-png { width: 32px; height: 32px; }
.pd-ghost { width: 20px; height: 20px; opacity: .22; }
.pd-stats { font-size: .78rem; color: var(--text-dim); line-height: 1.55; text-align: center; }
.pd-warn { color: #f07a6a; font-weight: 700; }

/* ---------- skills (OSRS stats-tab tile grid) ---------- */

.skill-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.skill-tile {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px;
  height: 56px;
  padding: 6px 9px 8px;
  background: rgba(18, 13, 8, .62);
  border: 2px solid #1a130c;
  border-left: 3px solid #2c2114;
  border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255, 228, 180, .05), inset 0 -2px 0 rgba(0, 0, 0, .3);
  overflow: hidden;
  transition: transform .08s ease, border-color .08s ease;
  cursor: default;
}
.skill-tile:hover { transform: scale(1.045); border-color: #54402c; z-index: 2; }
.skill-tile-lv { display: flex; flex-direction: column; align-items: flex-end; line-height: 1; gap: 1px; }
.lv-label { font-size: .54rem; }
.lv-num {
  font-size: 1.5rem; font-weight: 800;
  color: var(--gold);
  text-shadow: 0 2px 0 rgba(0,0,0,.65);
  font-variant-numeric: tabular-nums;
}
.skill-tile-bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 3px;
  background: rgba(0, 0, 0, .6);
}
.skill-tile-fill { height: 100%; transition: width .25s ease; }
.total-tile {
  background: rgba(60, 44, 16, .5);
  border-color: #6b5210;
  border-left-color: #6b5210;
}
.total-tile .lv-label { color: var(--gold); }
.skill-tile.clickable { cursor: pointer; }

/* ---------- Level-Up Guide (skill next-unlocks + full ladder) ---------- */

/* "Unlocks next" rows inside a skill tooltip */
.tt-unlocks-title {
  text-transform: uppercase; letter-spacing: .08em;
  font-size: .62rem; font-weight: 800; color: var(--gold);
  margin: 2px 0 3px;
}
.tt-unlock { display: flex; align-items: center; gap: 6px; margin: 2px 0; }
.tt-unlock-lv {
  color: var(--gold); font-weight: 800; font-size: .7rem;
  font-variant-numeric: tabular-nums;
}
.tt-unlock-name { color: var(--text); font-size: .74rem; }

/* full ladder expand view (Skills panel, tile-click) */
.ladder-back {
  display: flex; align-items: center; gap: 5px;
  margin-bottom: 8px; padding: 3px 9px 3px 6px;
  background: rgba(18, 13, 8, .6);
  border: 2px solid #241a10; border-radius: 3px;
  color: var(--text-dim); font: inherit; font-size: .76rem; font-weight: 700;
  cursor: pointer;
  transition: color .1s ease, border-color .1s ease;
}
.ladder-back:hover { color: var(--gold); border-color: #6b5210; }
.ladder-back-arrow { font-size: 1.1rem; line-height: 1; }
.ladder-head { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; }
.ladder-head-name { font-weight: 800; font-size: 1rem; color: var(--gold); letter-spacing: .04em; }
.ladder-head-lv { font-size: .72rem; color: var(--text-dim); }
.ladder-desc {
  font-size: .76rem; color: var(--text-dim); font-style: italic;
  margin-bottom: 9px; line-height: 1.4;
}
.ladder-empty {
  padding: 16px 10px; color: var(--text-dim); font-style: italic;
  font-size: .82rem; line-height: 1.5; text-align: center;
}
.ladder-list { display: flex; flex-direction: column; gap: 4px; }
.ladder-row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 8px;
  background: rgba(18, 13, 8, .5);
  border: 2px solid #201709; border-left: 3px solid #2c2114;
  border-radius: 3px;
}
.ladder-row.reached { opacity: .5; }
.ladder-row.next {
  border-left-color: var(--gold);
  background: rgba(60, 44, 16, .38);
  box-shadow: inset 0 0 8px rgba(232, 176, 79, .12);
}
.ladder-lv {
  min-width: 42px;
  color: var(--gold); font-weight: 800; font-size: .78rem;
  font-variant-numeric: tabular-nums;
}
.ladder-row.reached .ladder-lv { color: var(--text-dim); }
.ladder-name { flex: 1; min-width: 0; font-size: .82rem; }
.ladder-kind {
  font-size: .58rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-dim);
}
.ladder-mark { width: 12px; color: #8fe86a; font-weight: 800; text-align: center; }

/* spell/ammo hotkey (1-4) confirmation flash on the HUD consumable chip */
.consum-chip.just-set { animation: consum-flash .6s ease; }
@keyframes consum-flash {
  0% { border-color: var(--gold); box-shadow: 0 0 0 rgba(232,176,79,0), var(--hard-shadow); }
  30% { border-color: var(--gold); box-shadow: 0 0 14px rgba(232,176,79,.8), var(--hard-shadow); }
  100% { box-shadow: 0 0 0 rgba(232,176,79,0), var(--hard-shadow); }
}

/* ---------- talents (four tabs, IdleOn squares) ---------- */

.talent-tabs {
  display: flex; gap: 5px;
  margin-bottom: 10px;
  border-bottom: 2px solid var(--ui-line);
  padding-bottom: 6px;
}
.talent-tab {
  position: relative;
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 5px 4px;
  background: rgba(18, 13, 8, .6);
  border: 2px solid #241a10;
  border-radius: 3px;
  color: var(--text-dim);
  font: inherit; font-size: .78rem; font-weight: 700;
  cursor: pointer;
  transition: transform .08s ease, border-color .1s ease, color .1s ease;
}
.talent-tab:hover { color: var(--text); transform: translateY(-1px); }
.talent-tab.active {
  color: var(--text);
  border-color: var(--tab-accent, var(--gold));
  box-shadow: 0 0 10px rgba(0, 0, 0, .4), inset 0 0 8px rgba(0, 0, 0, .35);
  background: rgba(30, 22, 12, .85);
}
.talent-tab-badge {
  position: absolute; top: -8px; right: -5px;
  min-width: 17px;
  background: var(--gold);
  border: 2px solid #1a130c;
  border-radius: 3px;
  color: #2a1e08;
  font-size: .64rem; font-weight: 800; line-height: 1.35;
  padding: 0 3px;
  text-align: center;
}

.talent-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.talent-points { display: flex; align-items: baseline; gap: 8px; }
.talent-points-num {
  font-size: 1.55rem; font-weight: 800;
  color: var(--gold);
  text-shadow: 0 2px 0 rgba(0,0,0,.6);
}
.talent-head-btns { display: flex; gap: 6px; }

.talent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 72px);
  justify-content: center;
  gap: 9px;
}
.talent-sq {
  position: relative;
  width: 72px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 3px 5px;
  background: var(--well-bg);
  border: 2px solid #241a10;
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
  box-shadow: inset 0 2px 0 rgba(0,0,0,.5), inset 0 -1px 0 rgba(255,255,255,.04);
  transition: transform .08s ease, border-color .1s ease, box-shadow .12s ease;
}
.talent-sq:hover { transform: scale(1.06); border-color: #54402c; z-index: 2; }
.talent-sq-chip { width: 38px; height: 38px; }
.talent-sq-chip img { width: 23px; height: 23px; }
.talent-sq-rank {
  font-size: .64rem; font-weight: 800;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.talent-sq.dim .talent-sq-chip { filter: grayscale(.55) brightness(.72); }
.talent-sq.dim .talent-sq-rank { color: var(--text-dim); }
.talent-sq.maxed {
  border-color: #c8952a;
  box-shadow: 0 0 10px rgba(232, 176, 79, .3), inset 0 0 10px rgba(232, 176, 79, .1);
}
.talent-sq.maxed .talent-sq-rank { text-shadow: 0 0 8px rgba(240,192,64,.6); }
.talent-pips { display: flex; gap: 2px; }
.pip {
  width: 5px; height: 5px;
  background: #241a10;
  border: 1px solid rgba(0, 0, 0, .6);
}
.pip.on { background: var(--gold); box-shadow: 0 0 3px rgba(232, 176, 79, .6); }
.talent-empty {
  grid-column: 1 / -1;
  padding: 18px 8px;
  text-align: center;
  color: var(--text-dim);
  font-style: italic;
  font-size: .82rem;
}

.talent-presets {
  display: flex; align-items: center; gap: 6px;
  margin-top: 12px;
  padding-top: 9px;
  border-top: 1px solid var(--ui-line);
  flex-wrap: wrap;
}
.talent-presets-label { margin-right: 4px; }

/* ---- sub-classes (specializations) — subclasses.md §11 ---- */

.spec-section { margin: 4px 0 12px; }

/* locked: the level-30 goal banner */
.spec-locked {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px;
  background: var(--well-bg);
  border: 2px solid #241a10;
  border-radius: 5px;
  box-shadow: inset 0 2px 0 rgba(0,0,0,.45);
}
.spec-lock-icon { width: 22px; height: 22px; opacity: .8; flex: 0 0 auto; }
.spec-locked-mid { flex: 1 1 auto; display: flex; flex-direction: column; gap: 4px; }
.spec-locked-title { font-weight: 800; letter-spacing: .02em; }
.spec-locked-sub { font-size: .74rem; color: var(--text-dim); }
.spec-locked .mini-bar { margin: 1px 0; }

/* choose flow */
.spec-pick-title { font-weight: 800; font-size: .96rem; letter-spacing: .02em; }
.spec-pick-sub { font-size: .74rem; color: var(--text-dim); margin: 2px 0 8px; }
.spec-pick-actions { display: flex; gap: 6px; margin-top: 8px; justify-content: center; }
.spec-cards { display: flex; flex-direction: column; gap: 8px; }

/* a spec card (chooser + pinned "active") */
.spec-card {
  --spec-color: var(--accent);
  padding: 9px 11px;
  background: var(--well-bg);
  border: 2px solid #241a10;
  border-left: 4px solid var(--spec-color);
  border-radius: 5px;
  box-shadow: inset 0 2px 0 rgba(0,0,0,.4);
  display: flex; flex-direction: column; gap: 6px;
}
.spec-card.chosen {
  border-color: var(--spec-color);
  box-shadow: 0 0 12px color-mix(in srgb, var(--spec-color) 28%, transparent),
    inset 0 2px 0 rgba(0,0,0,.35);
}
.spec-card-head { display: flex; align-items: center; gap: 9px; }
.spec-card-headtext { flex: 1 1 auto; min-width: 0; }
.spec-card-name { font-weight: 800; font-size: 1rem; color: var(--text); letter-spacing: .01em; }
.spec-card-fantasy { font-size: .74rem; color: var(--text-dim); font-style: italic; }
.spec-card-tag {
  flex: 0 0 auto;
  font-size: .62rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: #2a1e08; background: var(--spec-color);
  padding: 2px 7px; border-radius: 3px;
}
.spec-card-line { display: flex; gap: 7px; font-size: .78rem; line-height: 1.32; }
.spec-card-k {
  flex: 0 0 58px;
  font-size: .62rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--spec-color); padding-top: 2px;
}
.spec-card-v { flex: 1 1 auto; color: var(--text); }
.spec-choose { align-self: flex-end; margin-top: 1px; }
.spec-change { margin-top: 7px; }

/* the chosen spec's own node grid, tinted */
.spec-nodes-head {
  display: flex; align-items: center; gap: 7px;
  margin: 12px 0 8px;
  padding-top: 9px;
  border-top: 2px solid var(--ui-line);
}
.spec-nodes-title {
  text-transform: uppercase; font-size: .7rem; font-weight: 800; letter-spacing: .1em;
  color: var(--text);
}
.spec-grid { --spec-color: var(--accent); }
.talent-sq.spec-sq { border-color: color-mix(in srgb, var(--spec-color) 40%, #241a10); }
.talent-sq.spec-sq:hover { border-color: var(--spec-color); }
.talent-sq.spec-sq.sig {
  box-shadow: 0 0 9px color-mix(in srgb, var(--spec-color) 30%, transparent),
    inset 0 2px 0 rgba(0,0,0,.5);
}
.talent-sq.spec-sq.sig.maxed { border-color: var(--spec-color); }
.spec-sq-star {
  position: absolute; top: 2px; right: 4px;
  font-size: .62rem; color: var(--spec-color);
  text-shadow: 0 1px 2px rgba(0,0,0,.8);
}

/* ---- spellbook (inside the Magic tab) ---- */

.spellbook {
  margin-top: 12px;
  padding-top: 9px;
  border-top: 2px solid var(--ui-line);
  display: flex; flex-direction: column; gap: 6px;
}
.spellbook-title {
  display: flex; align-items: center; gap: 6px;
  text-transform: uppercase;
  font-size: .7rem; font-weight: 800; letter-spacing: .1em;
  color: #cdb4f5;
}
.spell-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 9px;
  background: rgba(30, 22, 44, .45);
  border: 2px solid #2c2140;
  border-radius: 3px;
  transition: border-color .12s ease;
}
.spell-row.active {
  border-color: var(--gold);
  box-shadow: 0 0 9px rgba(232, 176, 79, .22), inset 0 0 10px rgba(232, 176, 79, .05);
}
.spell-row.locked { opacity: .5; }
.spell-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.spell-name { display: flex; align-items: baseline; gap: 8px; font-weight: 700; font-size: .84rem; flex-wrap: wrap; }
.spell-power { color: #cdb4f5; font-size: .72rem; font-weight: 800; }
.spell-req { color: var(--danger); font-size: .7rem; }
.spell-costs { display: flex; gap: 6px; flex-wrap: wrap; }
.spell-side { flex-shrink: 0; }
.spell-active-tag {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(232, 176, 79, .16);
  border: 1px solid #c8952a;
  border-radius: 3px;
  color: var(--gold);
  font-size: .66rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .07em;
}
.spellbook-foot { font-size: .7rem; color: var(--text-dim); font-style: italic; text-align: center; }

/* ---------- world map (painted fantasy board) ---------- */

/* Owner exception to the right-dock rule (2026-07-04, "i like this map. just
   make it open in the middle of the screen and make it larger in the x axis"):
   the world map opens CENTERED like an interrupting modal, and much wider. */
.p-worldmap {
  --pw: min(1240px, 94vw);
  right: auto;
  left: 50%;
  bottom: auto;
  top: 50%;
  /* definite height so the board can flex-fill and fit BOTH axes (static view) */
  height: min(900px, calc(100vh - 64px - var(--dock-h) - 20px));
  transform: translate(-50%, calc(-50% + 12px));
}
.p-worldmap.open { transform: translate(-50%, -50%); }
.p-worldmap.closing { opacity: 0; transform: translate(-50%, calc(-50% + 12px)); }

/* the world-map body fills the panel + never scrolls — the board fits inside */
.wm-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }

.wm-wrap { display: flex; gap: 10px; align-items: stretch; flex: 1; min-height: 0; }

/* worlds rail (left) */
.wm-rail { display: flex; flex-direction: column; gap: 7px; width: 104px; flex: 0 0 104px; }
.wm-rail-head { font-size: .56rem; font-weight: 800; letter-spacing: .18em;
  color: var(--text-dim); text-align: center; margin-bottom: 2px; }
.wm-world { display: flex; align-items: center; gap: 7px; padding: 7px 6px; border-radius: 5px;
  cursor: pointer; text-align: left; font: inherit; position: relative;
  background: linear-gradient(180deg, rgba(60,44,26,.5), rgba(28,20,12,.6));
  border: 2px solid #2a2016; color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05); transition: border-color .12s, transform .08s; }
.wm-world:hover { border-color: #7a5c34; transform: translateX(1px); }
.wm-world.active { border-color: var(--gold); background: linear-gradient(180deg, rgba(232,176,79,.24), rgba(120,84,30,.2)); }
.wm-world.soon { opacity: .5; cursor: default; }
.wm-world.soon:hover { transform: none; border-color: #2a2016; }
.wm-world-badge { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .68rem; color: #241a10;
  background: radial-gradient(circle at 40% 30%, #ffe6a0, #d9a942 70%, #a97e28);
  border: 1px solid #7a5a24; box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 1px 2px rgba(0,0,0,.4); }
.wm-world.soon .wm-world-badge { background: radial-gradient(circle at 40% 30%, #9a948a, #565049 70%); color: #d8d2c6; }
.wm-world-labels { display: flex; flex-direction: column; line-height: 1.08; min-width: 0; }
.wm-world-name { font-size: .64rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wm-world.active .wm-world-name { color: #f4e2b0; }
.wm-world-sub { font-size: .5rem; color: var(--text-dim); }
.wm-world-lock { width: 11px; height: 11px; position: absolute; right: 4px; top: 4px; opacity: .7; }

/* stage (map-header strip + board) */
.wm-stage { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.wm-strip { display: flex; align-items: center; gap: 10px; padding: 5px 4px 2px; margin-bottom: 6px; flex: 0 0 auto; }
.wm-strip-title { font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  font-size: .84rem; color: #a8dce0; text-shadow: 0 1px 0 #000; }

/* map-header readout: "Current Map: …" / "Selected Map: …" (IdleOn) */
.wm-maphead { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.wm-maphead-k { font-size: .64rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-dim); }
.wm-maphead-v { font-weight: 800; font-size: .96rem; color: #a8dce0; text-shadow: 0 1px 0 #000;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wm-maphead-k.sel { color: #ffcf6a; }
.wm-maphead-v.sel { color: #ffe6a0; }
.wm-legend { margin-left: auto; display: flex; gap: 11px; }
.wm-legend-pip { display: flex; align-items: center; gap: 4px; font-size: .58rem; color: var(--text-dim); }
.wm-legend-dot { width: 9px; height: 9px; border-radius: 50%; box-shadow: inset 0 1px 1px rgba(255,255,255,.4), 0 1px 1px rgba(0,0,0,.4); }
.wm-legend-dot.open { background: radial-gradient(circle at 40% 30%, #ffe6a0, #e0a63a 75%); }
.wm-legend-dot.locked { background: radial-gradient(circle at 40% 30%, #9a948a, #565049 75%); }
.wm-legend-dot.fog { background: radial-gradient(circle at 40% 30%, #fff, #b9c6d8 75%); }

/* the painted board: a fixed viewport that flex-fills the stage; the fitted map
   (canvases + node layer) is centered INSIDE it, so letterbox margins read as sea */
.wm-board { position: relative; flex: 1; min-height: 0; width: 100%; overflow: hidden;
  background: #1c4d70;   /* sea tone fallback — the painted canvas covers it edge-to-edge */
  border-radius: 8px; border: 3px solid #120d07;
  outline: 2px solid #5a431f; outline-offset: -6px;
  box-shadow: 0 6px 18px rgba(0,0,0,.55), inset 0 0 0 4px rgba(24,16,8,.6),
    inset 0 0 30px rgba(0,0,0,.32); }
/* canvases + node layer are absolutely placed + sized by JS to the fitted rect */
.wm-canvas { position: absolute; left: 0; top: 0; image-rendering: auto; }
.wm-fog { pointer-events: none; }
.wm-nodes { position: absolute; left: 0; top: 0; pointer-events: none; }

/* dome markers */
.wm-node { position: absolute; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  width: 92px; text-align: center; pointer-events: none; z-index: 2; }
.wm-node.boss { z-index: 3; }
.wm-node.here, .wm-node.selected { z-index: 4; }
.wm-dome { position: relative; width: 38px; height: 38px; padding: 0; border: none; background: none;
  cursor: pointer; pointer-events: auto; transition: transform .12s ease; }
.wm-dome-face { position: absolute; inset: 0; border-radius: 50%; border: 2px solid #4a3212;
  background: radial-gradient(circle at 36% 26%, #ffeaa6 0 16%, #f2b94c 44%, #c67f26 74%, #8a5416 100%);
  box-shadow: 0 3px 5px rgba(0,0,0,.5), inset 0 2px 3px rgba(255,255,255,.65),
    inset 0 -5px 7px rgba(90,50,10,.6); }
.wm-dome-glyph { position: absolute; inset: 0; width: 17px; height: 17px; margin: auto;
  filter: brightness(.28) drop-shadow(0 1px 0 rgba(255,255,255,.35)); opacity: .82; }
.wm-dome:hover { transform: translateY(-3px) scale(1.05); }
.wm-node.open .wm-dome:hover .wm-dome-face { box-shadow: 0 5px 8px rgba(0,0,0,.5),
    inset 0 2px 3px rgba(255,255,255,.7), inset 0 -5px 7px rgba(90,50,10,.6), 0 0 14px rgba(255,206,110,.8); }
.wm-node.locked .wm-dome { cursor: pointer; }
.wm-node.locked .wm-dome-face { border-color: #2c2820;
  background: radial-gradient(circle at 36% 26%, #b6b0a4 0 16%, #7d766a 46%, #4a463e 76%, #2e2b25 100%);
  box-shadow: 0 3px 5px rgba(0,0,0,.55), inset 0 2px 3px rgba(255,255,255,.35), inset 0 -5px 7px rgba(20,18,14,.6); }
.wm-node.locked .wm-dome-glyph { filter: brightness(.4); opacity: .55; }
.wm-node.town .wm-dome { width: 48px; height: 48px; }
.wm-node.town .wm-dome-face { background: radial-gradient(circle at 36% 26%, #fff0c0 0 16%, #f6c85a 44%, #d19430 74%, #9a6a1e 100%);
  border-color: #6a4a18; box-shadow: 0 4px 7px rgba(0,0,0,.5), inset 0 2px 4px rgba(255,255,255,.7),
    inset 0 -6px 8px rgba(120,74,20,.6), 0 0 12px rgba(255,214,120,.5); }
.wm-node.boss .wm-dome { width: 46px; height: 46px; }
.wm-node.boss.open .wm-dome-face { border-color: #4a1418;
  background: radial-gradient(circle at 36% 26%, #ffd08a 0 16%, #e5772e 46%, #a5301f 76%, #6a1a20 100%);
  box-shadow: 0 4px 7px rgba(0,0,0,.55), inset 0 2px 3px rgba(255,220,180,.6),
    inset 0 -6px 8px rgba(80,14,20,.7), 0 0 16px rgba(232,86,63,.55); }
.wm-node.boss .wm-dome-glyph { filter: brightness(.2) drop-shadow(0 1px 0 rgba(255,180,120,.4)); opacity: .9; }

/* here / selected rings */
.wm-dome::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; pointer-events: none;
  border: 2px solid transparent; transition: border-color .12s; }
.wm-node.here .wm-dome::after { border-color: var(--gold); animation: wm-ring 1.6s ease-in-out infinite; }
.wm-node.selected .wm-dome::after { border-color: #8fe0ff; box-shadow: 0 0 10px rgba(120,210,255,.7); }
@keyframes wm-ring { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.16); opacity: .5; } }

.wm-label { font-size: .68rem; font-weight: 800; color: #fff; white-space: nowrap; letter-spacing: .01em;
  text-shadow: 0 1px 0 #000, 0 0 4px #000, 1px 0 0 #000, -1px 0 0 #000, 0 -1px 0 #000; }
.wm-node.locked .wm-label { color: #d2ccbe; }

/* frontier kill-counter chip */
.wm-gate { background: linear-gradient(180deg, rgba(20,14,8,.9), rgba(8,6,3,.9));
  border: 1px solid #5a431f; border-radius: 4px; padding: 2px 6px 3px; min-width: 56px;
  box-shadow: 0 2px 4px rgba(0,0,0,.5); }
.wm-gate-num { font-weight: 800; font-size: .6rem; color: #ffcf6a; font-variant-numeric: tabular-nums; text-shadow: 0 1px 0 #000; }
.wm-gate.done .wm-gate-num { color: #6fe08a; }
.wm-gate-cap { font-size: .5rem; color: var(--text-dim); white-space: nowrap; }
.wm-gate-bar { width: 100%; height: 4px; margin: 2px 0 0; }
.wm-gate-bar .mini-fill { background: linear-gradient(90deg, #e8a63a, #ffd67a); }

/* your standee on the current zone */
.wm-standee { position: absolute; top: -32px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.wm-standee-roundel { width: 24px; height: 24px; animation: wm-bob 2.4s ease-in-out infinite;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.5)); }
.wm-standee-tag { font-size: .56rem; font-weight: 800; color: var(--gold); text-shadow: 0 1px 0 #000, 0 0 3px #000; }
.wm-standee::after { content: ''; position: absolute; bottom: -6px; width: 14px; height: 4px;
  border-radius: 50%; background: rgba(0,0,0,.45); }
@keyframes wm-bob { 50% { transform: translate(-50%, -3px); } }

/* world nameplate ribbon (anchored top-right corner of the board — a clean
   corner plate, no longer floating in empty sea) */
.wm-ribbon { position: absolute; right: 12px; top: 10px; z-index: 3; pointer-events: none;
  padding: 4px 13px; border-radius: 5px;
  background: linear-gradient(180deg, rgba(30,24,14,.82), rgba(16,12,7,.82));
  border: 1px solid #6a5124; box-shadow: 0 2px 7px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.08); }
.wm-ribbon-txt { font-weight: 800; letter-spacing: .14em; text-transform: uppercase; font-size: .72rem;
  color: #f3dc9c; text-shadow: 0 1px 0 #000; }

/* ---- floating INFO BAR: an ABSOLUTE overlay strip across the TOP of the board
   (owner: "open in the top separate from the map"). Sits ON TOP of the painted
   board so selecting a dome never resizes or shifts the map — the board keeps
   its exact fit-scale whether the bar is open or closed. Semi-opaque dark chip,
   light text; slides/fades in from the top edge. ---- */
.wm-infobar { position: absolute; left: 8px; right: 8px; top: 8px; z-index: 8;
  pointer-events: none; opacity: 0; transform: translateY(-8px);
  transition: opacity .18s ease, transform .18s ease; }
.wm-infobar.open { pointer-events: auto; opacity: 1; transform: none; }
.wm-ib { height: 120px; display: flex; align-items: stretch; gap: 0;
  padding: 9px 42px 9px 12px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin;
  border-radius: 8px; border: 2px solid #5a431f;
  background: linear-gradient(180deg, rgba(32,39,50,.97), rgba(18,22,30,.97));
  box-shadow: 0 4px 12px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.06); color: #e8eef6; }
.wm-ib-x { position: absolute; top: 7px; right: 8px; z-index: 2; width: 22px; height: 22px; border-radius: 4px;
  border: 1px solid transparent; background: rgba(255,255,255,.08); color: #cdd6e2; font-size: 1rem; line-height: 1;
  cursor: pointer; }
.wm-ib-x:hover { background: rgba(255,255,255,.16); color: #fff; }

/* identity cell: portrait + name/level + state pill + kills/best-farm */
.wm-ib-id { display: flex; align-items: center; gap: 11px; padding: 2px 16px 2px 4px; flex: 0 0 auto; }
.wm-ib-blob { flex: 0 0 52px; width: 52px; height: 46px; box-shadow: inset 0 -5px 0 rgba(0,0,0,.22); }
.wm-ib-blob::before, .wm-ib-blob::after { top: 16px; width: 7px; height: 7px; }
.wm-ib-blob::before { left: 13px; } .wm-ib-blob::after { right: 13px; }
.wm-ib-blob .wm-mob-crown { top: -13px; width: 20px; height: 20px; }
.wm-ib-badge { flex: 0 0 52px; width: 52px; height: 46px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 38% 28%, #ffe6a0, #d9a942 72%, #a97e28); border: 2px solid #8a6a2e;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 2px 4px rgba(0,0,0,.35); }
.wm-ib-badge.town { background: radial-gradient(circle at 38% 28%, #fff0c0, #f6c85a 60%, #b8801e); }
.wm-ib-badge img { width: 26px; height: 26px; filter: brightness(.28); }
.wm-ib-idtxt { min-width: 0; display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.wm-ib-line1 { display: flex; align-items: center; gap: 9px; }
.wm-ib-name { font-weight: 800; font-size: 1rem; color: #ffe6a0; white-space: nowrap; text-shadow: 0 1px 0 #000; }
.wm-ib-lv { font-size: .68rem; font-weight: 700; color: #b9c6d8; white-space: nowrap; }
.wm-ib-line2 { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.wm-ib-meta { font-size: .68rem; font-weight: 600; color: #aeb9c8; white-space: nowrap; }
.wm-ib-meta.good { color: #8fe0a0; font-weight: 700; }
.wm-ib-dot { color: #566073; font-size: .6rem; }

/* compact unlock-state pill */
.wm-ib-pill { display: inline-flex; align-items: center; gap: 4px; font-size: .58rem; font-weight: 800;
  letter-spacing: .03em; text-transform: uppercase; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.wm-ib-pill.open { background: rgba(70,150,90,.22); color: #8fe0a0; border: 1px solid rgba(120,200,150,.5); }
.wm-ib-pill.here { background: rgba(232,176,79,.22); color: #ffd98a; border: 1px solid rgba(232,196,120,.5); }
.wm-ib-pill.locked { background: rgba(150,110,70,.2); color: #e6c096; border: 1px solid rgba(200,160,110,.45); }
.wm-ib-pilllock { width: 10px; height: 10px; filter: brightness(2.4); opacity: .85; }

/* labelled info segment (divider on its left acts as the "|" separator) */
.wm-ib-seg { display: flex; flex-direction: column; gap: 6px; justify-content: center; padding: 2px 15px; flex: 0 0 auto;
  border-left: 1px solid rgba(255,255,255,.09); }
.wm-ib-seghead { font-size: .53rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; color: #d7a84a; }
.wm-ib-chips { display: flex; align-items: center; gap: 6px; }

/* mob-drop chips (champion signature flagged) */
.wm-ib-chip { position: relative; }
.wm-ib-chip .wm-ib-icon { width: 34px; height: 34px; }
.wm-ib-chip.champ .wm-ib-icon { box-shadow: 0 0 0 2px #e8904a, 0 0 8px rgba(232,140,74,.55); }
.wm-ib-flag { position: absolute; top: -6px; right: -6px; font-size: .72rem; color: #ffcf6a; text-shadow: 0 1px 2px #000; }

/* resource chips */
.wm-ib-res { display: flex; align-items: center; gap: 6px; padding: 3px 8px 3px 4px; border-radius: 6px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); }
.wm-ib-sw { flex: 0 0 20px; width: 20px; height: 20px; border-radius: 5px; border: 1px solid rgba(0,0,0,.4);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.4); }
.wm-ib-restxt { min-width: 0; line-height: 1.12; }
.wm-ib-resname { font-size: .7rem; font-weight: 700; color: #e6ecf4; white-space: nowrap; }
.wm-ib-resreq { font-size: .56rem; color: #9aa6b6; white-space: nowrap; }

/* npc chips (town only) */
.wm-ib-npc { display: flex; align-items: center; gap: 7px; padding: 2px 9px 2px 3px; border-radius: 6px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); }
.wm-ib-npcicon { width: 28px; height: 28px; flex: 0 0 auto; }
.wm-ib-npctxt { min-width: 0; line-height: 1.12; }
.wm-ib-npcname { font-size: .72rem; font-weight: 700; color: #e6ecf4; white-space: nowrap; }
.wm-ib-npctitle { font-size: .56rem; color: #9aa6b6; white-space: nowrap; }

.wm-ib-note { display: flex; align-items: center; font-size: .78rem; font-style: italic; color: #aeb9c8; padding: 0 18px; }

/* mob blob base (shared by the identity portrait) */
.wm-mob-blob { position: relative; flex: 0 0 26px; width: 26px; height: 23px; border-radius: 46% 46% 42% 42%;
  background: radial-gradient(120% 120% at 50% 22%, var(--belly) 0 26%, var(--body) 30%);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.22); }
.wm-mob-blob::before, .wm-mob-blob::after { content: ''; position: absolute; top: 8px; width: 4px; height: 4px;
  border-radius: 50%; background: var(--eye); }
.wm-mob-blob::before { left: 7px; } .wm-mob-blob::after { right: 7px; }
.wm-mob-crown { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); width: 13px; height: 13px;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,.4)); }

/* FREE TELEPORT dock — bottom-left of the board (IdleOn position) */
.wm-tpdock { position: absolute; left: 12px; bottom: 12px; z-index: 7; pointer-events: none;
  opacity: 0; transform: translateY(8px); transition: opacity .18s ease, transform .18s ease; }
.wm-tpdock.open { opacity: 1; transform: none; pointer-events: auto; }
.wm-tp-btn { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 8px;
  cursor: pointer; font: inherit; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  font-size: .86rem; color: #241a08; background: linear-gradient(180deg, #ffdf8e, #e6a838);
  border: 2px solid #8a6a24; box-shadow: 0 4px 0 #7a5a20, 0 6px 16px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.6);
  transition: transform .08s, box-shadow .08s, background .12s; }
.wm-tp-btn:hover:not(:disabled) { background: linear-gradient(180deg, #ffe9a4, #f0b544); }
.wm-tp-btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 2px 0 #7a5a20, 0 4px 10px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.6); }
.wm-tp-btn.here { cursor: default; background: linear-gradient(180deg, #d8c48e, #b89f66);
  border-color: #7a6c50; box-shadow: 0 4px 0 #6a5c42, 0 6px 16px rgba(0,0,0,.5); color: #4a4030; }
.wm-tp-icon { width: 18px; height: 18px; filter: brightness(.28); }

@media (max-width: 720px) {
  .wm-ib { height: 134px; }
  .wm-rail { width: 88px; flex-basis: 88px; }
}

/* ---------- bank ---------- */

.bank-wrap { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.bank-col { display: flex; flex-direction: column; gap: 9px; min-width: 200px; }
.bank-grid {
  display: grid;
  grid-template-columns: repeat(5, 40px);
  gap: 6px;
  align-content: start;
}
.bank-empty { grid-column: 1 / -1; color: var(--text-dim); font-size: .82rem; padding: 12px 4px; font-style: italic; }

/* ---------- crafting ---------- */

.craft-tabs {
  display: flex; gap: 5px;
  margin-bottom: 9px;
}
.craft-tab {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 11px;
  background: rgba(18, 13, 8, .6);
  border: 2px solid #241a10;
  border-radius: 3px;
  color: var(--text-dim);
  font: inherit; font-size: .76rem; font-weight: 700;
  cursor: pointer;
  transition: color .1s ease, border-color .1s ease;
}
.craft-tab:hover { color: var(--text); }
.craft-tab.active { color: var(--gold); border-color: #6b5210; background: rgba(60, 44, 16, .5); }

.craft-list { display: flex; flex-direction: column; gap: 6px; }
.craft-row {
  display: flex; align-items: center; gap: 10px;
  min-height: 44px;
  padding: 5px 9px;
  background: rgba(18, 13, 8, .6);
  border: 2px solid #241a10;
  border-radius: 3px;
  transition: border-color .1s ease;
}
.craft-row:hover { border-color: #3a2c1c; }
.craft-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.craft-top { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.craft-name { font-weight: 700; font-size: .84rem; }
.craft-req { font-size: .7rem; color: var(--text-dim); }
.craft-xp { font-size: .7rem; color: #58c890; }
.craft-burn { font-size: .7rem; color: #e8a05a; }
/* Alchemy potion effect line (light parchment text on the dark craft row). */
.craft-effect { font-size: .72rem; color: #d8c8f0; margin-top: 2px; letter-spacing: .2px; }
.craft-inputs { display: flex; gap: 7px; flex-wrap: wrap; }
.mat-chip {
  display: flex; align-items: center; gap: 5px;
  padding: 2px 6px 2px 2px;
  background: var(--well-bg);
  border: 1px solid #2c2114;
  border-radius: 3px;
}
.mat-count { font-size: .7rem; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.mat-chip.short { border-color: #6a2e28; }
.mat-chip.short .mat-count { color: var(--danger); }
.craft-btns { display: flex; gap: 5px; flex-shrink: 0; }
.craft-btns .btn { min-width: 46px; }

/* full-bag warning row (crafting stays allowed; output drops to the ground) */
.craft-full-warn {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  margin-bottom: 10px;
  background: rgba(58, 21, 18, .5);
  border: 2px solid #6a2e28;
  border-radius: 3px;
  font-size: .78rem;
  color: #e8b0a4;
}

/* ---------- runecrafting altar ---------- */

.altar-card {
  display: flex; align-items: center; gap: 14px;
  padding: 12px;
  background: rgba(24, 16, 34, .6);
  background:
    radial-gradient(ellipse at 50% 110%, color-mix(in srgb, var(--elem, #9a5ad8) 22%, transparent), transparent 70%),
    rgba(24, 16, 34, .6);
  border: 2px solid var(--elem, #9a5ad8);
  border-radius: 4px;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, .4);
}
.altar-face { display: flex; align-items: center; justify-content: center; }
.altar-rune-chip { width: 52px; height: 52px; }
.altar-rune-chip img { width: 30px; height: 30px; }
.altar-rune-chip img.item-png { width: 36px; height: 36px; }
.altar-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.altar-yield { font-size: .78rem; color: var(--text-dim); }
.altar-yield-num {
  font-size: 1.1rem; font-weight: 800;
  color: var(--gold);
  text-shadow: 0 1px 0 rgba(0,0,0,.6);
}
.altar-empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 26px 14px;
  text-align: center;
  color: var(--text-dim);
  font-style: italic;
}
.altar-empty-icon { width: 34px; height: 34px; opacity: .5; }

/* ---------- quests (card grid) ---------- */

.quest-hint {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 11px;
  margin-bottom: 9px;
  background: rgba(60, 44, 16, .5);
  border: 2px solid #6b5210;
  border-radius: 3px;
  font-size: .8rem;
  color: #e8d8a8;
}

.quest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}
.quest-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 8px 10px;
  background: rgba(24, 18, 10, .68);
  border: 2px solid #241a10;
  border-radius: 4px;
  transition: border-color .15s ease, transform .08s ease;
}
.quest-card:hover { transform: scale(1.015); border-color: #3a2c1c; }
.quest-card.ready {
  border-color: #c8952a;
  animation: quest-glow 1.4s ease-in-out infinite alternate;
}
@keyframes quest-glow {
  from { box-shadow: 0 0 6px rgba(240,192,64,.15), inset 0 0 8px rgba(240,192,64,.04); }
  to { box-shadow: 0 0 16px rgba(240,192,64,.4), inset 0 0 12px rgba(240,192,64,.1); }
}
.quest-card-top { display: flex; align-items: flex-start; gap: 9px; }
.quest-card-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.quest-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.quest-name { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: .84rem; flex-wrap: wrap; }
.quest-tag {
  font-size: .6rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .08em;
  padding: 1px 6px;
  border-radius: 3px;
}
.quest-tag.rdy { background: rgba(240,192,64,.16); border: 1px solid #c8952a; color: var(--gold); }
.quest-tag.done { background: rgba(122,232,168,.1); border: 1px solid #3a7a58; color: #7ae8a8; }
.quest-desc { font-size: .72rem; color: var(--text-dim); }

.quest-prog-row { display: flex; align-items: center; gap: 8px; }
.quest-bar { flex: 1; height: 7px; }
.quest-prog-text { font-size: .7rem; font-weight: 700; color: var(--text-dim); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.quest-card.ready .quest-prog-text { color: var(--gold); }

.quest-rewards { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.reward-gold { display: flex; align-items: center; gap: 4px; color: var(--gold); font-weight: 700; font-size: .8rem; }

.quest-side { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; }
.quest-side .btn { min-width: 76px; }
.quest-claimed-mark { font-size: 1.15rem; font-weight: 800; color: #7ae8a8; }

/* completed quests: collapsed single lines */
.quest-done-title { margin: 12px 0 6px; }
.quest-done-list { display: flex; flex-direction: column; gap: 2px; }
.quest-done-row {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 9px;
  color: var(--text-dim);
  font-size: .78rem;
  opacity: .7;
}
.quest-done-row .quest-claimed-mark { font-size: .9rem; }

/* ---------- daily contract (pinned hero card above the grid) ---------- */

.contract-card {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px;
  margin-bottom: 9px;
  background: var(--tex-cork), rgba(52, 38, 20, .72);
  border: 2px solid #6b5230;
  border-radius: 4px;
  transition: border-color .15s ease, opacity .15s ease;
}
.contract-card.ready {
  border-color: #c8952a;
  animation: quest-glow 1.4s ease-in-out infinite alternate;
}
.contract-card.claimed { opacity: .5; }
.contract-card .mini-fill { background: #58c890; }
.contract-card.claimed .mini-fill { background: #6a6288; }
.quest-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.quest-tag.daily { background: rgba(90,99,216,.16); border: 1px solid #5a63d8; color: #b8bef5; }
.contract-sub { font-size: .68rem; font-style: italic; color: var(--text-dim); }
.contract-card .quest-bar { max-width: 240px; }

/* ---------- guiding quest line: pinned Bramble card + HUD beacon ---------- */

.guide-card {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: var(--tex-cork), linear-gradient(180deg, rgba(58,44,22,.86), rgba(40,30,16,.86));
  border: 2px solid #7a5c30;
  border-left: 4px solid var(--gold);
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255,228,180,.1), 0 2px 6px rgba(0,0,0,.35);
}
.guide-portrait {
  flex-shrink: 0;
  width: 46px; height: 46px;
  background: radial-gradient(circle at 50% 38%, #7fa25a, #4a6b39 70%, #33502a);
  border: 2px solid #2a3a1e;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 1px 3px rgba(0,0,0,.5);
}
.guide-portrait.done { filter: saturate(.6) brightness(.85); }
.guide-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.guide-name { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: .9rem; flex-wrap: wrap; }
.guide-tag { background: rgba(122,162,90,.18); border: 1px solid #6c9a4a; color: #bfe89a; }
.guide-step-name { color: var(--text); }
.guide-step-count {
  margin-left: auto; flex-shrink: 0;
  font-size: .66rem; font-weight: 700; letter-spacing: .04em;
  color: var(--text-dim); font-variant-numeric: tabular-nums;
}
.guide-byline {
  font-size: .64rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: #c8a05a;
}
.guide-dir {
  font-size: .78rem; line-height: 1.35; color: #e6dcc2; font-style: italic;
  margin: 1px 0 2px;
}
.guide-rewards { margin-top: 2px; }
.guide-rewards .quest-rw-label { font-size: .64rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); }
.guide-title-chip {
  font-size: .68rem; font-weight: 800; color: var(--gold);
  padding: 1px 7px; border: 1px solid #c8952a; border-radius: 3px;
  background: rgba(240,192,64,.1);
}
.guide-no-reward { font-size: .72rem; font-style: italic; color: var(--text-dim); }

.guide-card.guide-terminal {
  align-items: center;
  border-left-color: #6c9a4a;
  opacity: .82;
}
.guide-terminal-line { font-size: .82rem; font-style: italic; color: #cfe0b4; }

/* HUD beacon — slim pulsing chip above the dock; pops on a new step, fades ~10s */
.guide-beacon {
  position: absolute;
  bottom: 104px; left: 50%;
  transform: translateX(-50%) translateY(8px);
  display: flex; align-items: stretch; gap: 0;
  z-index: 34;
  opacity: 0; pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
}
.guide-beacon.hidden { display: none; }
.guide-beacon.show {
  opacity: 1; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.guide-beacon-body {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 12px 6px 8px;
  background: var(--tex-cork), linear-gradient(180deg, #5f462a, #443118);
  border: 2px solid #7a5c30;
  border-right: none;
  border-radius: 20px 0 0 20px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,228,180,.14);
  animation: guide-beacon-pulse 1.6s ease-in-out infinite;
}
.guide-beacon-body:hover { border-color: var(--gold); }
@keyframes guide-beacon-pulse {
  0%, 100% { box-shadow: 0 3px 10px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,228,180,.14), 0 0 0 rgba(240,192,64,0); }
  50%      { box-shadow: 0 3px 10px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,228,180,.14), 0 0 14px rgba(240,192,64,.5); }
}
.guide-beacon-roundel {
  flex-shrink: 0; width: 30px; height: 30px;
  background: radial-gradient(circle at 50% 38%, #7fa25a, #4a6b39 72%);
  border: 2px solid #2a3a1e;
}
.guide-beacon-txt { display: flex; flex-direction: column; line-height: 1.12; }
.guide-beacon-eyebrow {
  font-size: .58rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #bfe89a;
}
.guide-beacon-title { font-size: .82rem; font-weight: 800; color: var(--text); }
.guide-beacon-x {
  width: 26px; flex-shrink: 0;
  background: linear-gradient(180deg, #4a3420, #33240f);
  border: 2px solid #7a5c30;
  border-radius: 0 20px 20px 0;
  color: #d8c8a8; font-size: 1rem; font-weight: 800; line-height: 1;
  cursor: pointer;
}
.guide-beacon-x:hover { color: #fff; background: linear-gradient(180deg, #5a4028, #3a2812); }

/* ---------- shop ---------- */

.shop-section-title { display: block; margin-bottom: 8px; }
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 7px;
}
.shop-card {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 9px;
  background: rgba(24, 18, 10, .68);
  border: 2px solid #241a10;
  border-radius: 4px;
  transition: border-color .1s ease, transform .08s ease;
}
.shop-card:hover { border-color: #3a2c1c; transform: scale(1.015); }
.shop-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.shop-name { font-weight: 700; font-size: .8rem; }
.shop-price { display: flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; }
.shop-price.short { color: var(--danger); }
.shop-btns { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; align-items: stretch; }
.shop-btns .btn { min-width: 44px; padding: 2px 7px; font-size: .74rem; }
.shop-bulk { display: flex; gap: 4px; }
.bulk-input {
  width: 52px;
  padding: 2px 5px;
  border-radius: 3px;
  border: 2px solid #17110a;
  background: var(--well-bg);
  color: var(--text);
  font: inherit; font-size: .74rem;
  outline: none;
}
.bulk-input:focus { border-color: var(--gold); }

.shop-list { display: flex; flex-direction: column; gap: 7px; }
.shop-row {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 11px;
  background: rgba(24, 18, 10, .68);
  border: 2px solid #241a10;
  border-radius: 4px;
}

/* ---------- shop unlocks (permanent account upgrades) ---------- */

.shop-unlocks-title { display: block; margin: 16px 0 8px; }
.unlock-row.owned { opacity: .55; }
.unlock-desc { font-size: .74rem; color: var(--text-dim); }
.unlock-req { font-size: .7rem; color: #8a8068; }
.unlock-check {
  min-width: 60px;
  text-align: center;
  font-size: 1.3rem; font-weight: 800;
  color: #7ae8a8;
}

/* ---------- menu ---------- */

.menu-wrap { display: flex; flex-direction: column; gap: 16px; }
.menu-section { display: flex; flex-direction: column; gap: 8px; }

.ctrl-table {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 15px;
  align-items: center;
}
.ctrl-keys kbd {
  display: inline-block;
  background: var(--well-bg);
  border: 1px solid #54402c;
  border-bottom-width: 3px;
  border-radius: 3px;
  padding: 1px 8px;
  font-family: inherit;
  font-size: .72rem; font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.ctrl-desc { font-size: .8rem; color: var(--text-dim); }

.menu-note { font-size: .8rem; color: var(--text-dim); line-height: 1.45; }
.menu-share-box {
  font-family: Consolas, 'Courier New', monospace;
  font-size: .86rem;
  color: var(--gold);
  background: var(--well-bg);
  border: 2px solid #17110a;
  border-radius: 3px;
  padding: 7px 11px;
  width: fit-content;
  cursor: pointer;
  user-select: text;
  box-shadow: inset 0 2px 0 rgba(0,0,0,.4);
}
.menu-share-box:hover { border-color: var(--gold); }

.menu-logout { align-self: flex-start; border-color: #6a2e28; color: #f0b0a4; }
.menu-logout:hover:not(:disabled) { background: #55201c; }

.menu-friends { align-self: flex-start; }

/* ---------- THE HUB: top tab strip + swapping body (IdleOn Codex) ---------- */

.hub-tabs {
  display: flex; gap: 5px;
  margin-bottom: 10px;
  border-bottom: 2px solid var(--ui-line);
  padding-bottom: 6px;
}
.hub-tab {
  flex: 1;
  padding: 7px 4px;
  background: rgba(18, 13, 8, .6);
  border: 2px solid #241a10;
  border-radius: 3px;
  color: var(--text-dim);
  font: inherit; font-size: .8rem; font-weight: 800;
  letter-spacing: .04em;
  cursor: pointer;
  transition: transform .08s ease, border-color .1s ease, color .1s ease;
}
.hub-tab:hover { color: var(--text); transform: translateY(-1px); }
.hub-tab.active {
  color: var(--gold);
  border-color: #6b5210;
  background: rgba(60, 44, 16, .5);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, .35);
}
.hub-body { display: flex; flex-direction: column; }

/* ---------- HUB · INFO tab: IdleOn player card ---------- */

.info-card { display: flex; flex-direction: column; gap: 12px; }
.info-head { display: flex; align-items: center; gap: 12px; }
.info-portrait {
  width: 62px; height: 68px; flex-shrink: 0;
  background: var(--well-bg);
  border: 2px solid #54402c;
  border-radius: 4px;
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, .45);
  display: flex; align-items: center; justify-content: center;
}
.info-portrait .pd-sprite-cv { width: 52px; height: 60px; image-rendering: pixelated; }
.info-idcol { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.info-name { font-size: 1.15rem; font-weight: 800; color: var(--text); text-shadow: 0 1px 0 rgba(0,0,0,.7); }
.info-class { font-size: .82rem; color: var(--gold); font-weight: 700; }

.info-cmb {
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 0;
  background: var(--tex-stars, none), linear-gradient(180deg, rgba(60,44,16,.35), rgba(0,0,0,.15));
  border: 2px solid #54402c;
  border-radius: 5px;
}
.info-cmb-num {
  font-size: 2.7rem; font-weight: 900; line-height: 1;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 rgba(0,0,0,.6);
}
.info-cmb-label {
  font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-dim); margin-top: 3px;
}

.info-hpbar { height: 18px; }

.info-stats {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4px 14px;
}
.info-stat {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  padding: 4px 2px;
  border-bottom: 1px solid rgba(255, 236, 200, .06);
}
.info-stat-label { font-size: .8rem; color: var(--text-dim); }
.info-stat-val { font-size: .88rem; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }

.info-style-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.info-style {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px;
  background: rgba(16, 12, 7, .5);
  border: 2px solid #241a10;
  border-radius: 4px;
}
.info-style-txt { display: flex; flex-direction: column; line-height: 1.1; }
.info-style-name { font-size: .74rem; color: var(--text-dim); }
.info-style-lvl { font-size: 1.05rem; font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; }

/* ---------- HUB · EXTRAS tab: big-icon feature grid ---------- */

.extras-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}
.extras-tile {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 14px 6px 11px;
  background: rgba(18, 13, 8, .6);
  border: 2px solid #241a10;
  border-radius: 5px;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: transform .08s ease, border-color .1s ease, background .1s ease;
}
.extras-tile:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  background: rgba(60, 44, 16, .5);
}
.extras-roundel { width: 48px; height: 48px; }
.extras-roundel img { width: 27px; height: 27px; }
.extras-label { font-size: .82rem; font-weight: 800; letter-spacing: .03em; }

/* =====================================================================
   FRIENDS LIST (social-endgame.md §2B) — add-by-name box + presence roster
   ===================================================================== */

.friends-wrap { display: flex; flex-direction: column; gap: 10px; }

.friend-add { display: flex; gap: 6px; align-items: stretch; }
.friend-input {
  flex: 1; min-width: 0;
  background: var(--well-bg);
  border: 2px solid #17110a;
  border-radius: 3px;
  padding: 6px 10px;
  color: var(--text);
  font: inherit;
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, .4);
}
.friend-input:focus { outline: none; border-color: var(--gold); }
.friend-add-btn { flex-shrink: 0; }
.friend-refresh { flex-shrink: 0; padding: 6px 11px; font-size: 1rem; line-height: 1; }

.friend-roster { display: flex; flex-direction: column; gap: 5px; }

.friend-empty {
  padding: 20px 12px;
  text-align: center;
  color: var(--text-dim);
  font-size: .82rem;
  font-style: italic;
}

.friend-row {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 9px;
  background: rgba(24, 18, 10, .68);
  border: 2px solid #241a10;
  border-radius: 4px;
  transition: border-color .15s ease;
}
.friend-row.online { border-color: #3a5a2c; }
.friend-row:hover { border-color: #3a2c1c; }
.friend-row.online:hover { border-color: #4d7a38; }

.friend-dot {
  flex-shrink: 0;
  width: 9px; height: 9px; border-radius: 50%;
  background: #4a4030;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .4);
}
.friend-dot.on {
  background: #6fce4a;
  box-shadow: 0 0 6px rgba(111, 206, 74, .8), inset 0 0 0 1px rgba(0, 0, 0, .3);
}

.friend-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.friend-name {
  font-weight: 700; font-size: .84rem; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.friend-meta {
  display: flex; gap: 8px; font-size: .68rem; color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.friend-total { opacity: .8; }

.friend-status { flex-shrink: 0; text-align: right; max-width: 46%; }
.friend-zone {
  display: block;
  font-size: .74rem; font-weight: 700; color: #9fd47f;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.friend-seen { font-size: .72rem; color: var(--text-dim); font-style: italic; }

.friend-x {
  flex-shrink: 0;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  color: var(--text-dim);
  font-size: 1.05rem; font-weight: 800; line-height: 1;
  cursor: pointer;
  transition: color .12s ease, border-color .12s ease, background .12s ease;
}
.friend-x:hover { color: #f0b0a4; border-color: #6a2e28; background: #55201c; }

/* request / pending groups */
.friend-group-title {
  display: flex; align-items: center; gap: 7px;
  margin: 6px 0 2px;
  font-size: .64rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--text-dim);
}
.friend-group-title:first-child { margin-top: 0; }
.friend-group-count {
  min-width: 16px; height: 16px; padding: 0 4px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(240, 192, 64, .16); border: 1px solid #c8952a; border-radius: 8px;
  color: var(--gold); font-size: .62rem; line-height: 1;
}
.friend-row.req { border-color: #6b5210; }
.friend-row.pending { opacity: .82; }
.friend-acts { display: flex; gap: 5px; flex-shrink: 0; }
.friend-acts .btn { min-width: 0; }
.friend-decline { border-color: #6a2e28; color: #f0b0a4; }
.friend-decline:hover:not(:disabled) { background: #55201c; }
.friend-pending {
  font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em;
  color: #d8b46a; font-style: italic;
}
.friend-empty.small { padding: 8px 12px; font-size: .76rem; opacity: .8; }

/* =====================================================================
   INSPECT CARD — double-click a player in the world (public profile only)
   ===================================================================== */

.inspect-modal {
  position: relative;
  width: min(420px, 92vw);
  display: flex; flex-direction: column; gap: 10px;
  text-align: left;
}
.inspect-x { position: absolute; top: 6px; right: 6px; }
.inspect-head { display: flex; flex-direction: column; gap: 3px; padding-right: 28px; }
.inspect-name { font-size: 1.1rem; font-weight: 800; color: var(--gold); }
.inspect-sub { display: flex; align-items: center; gap: 7px; font-size: .8rem; color: var(--text-dim); }
.inspect-lvls { display: flex; gap: 10px; }
.inspect-cmb, .inspect-total {
  padding: 3px 9px; border-radius: 3px; font-weight: 700; font-size: .82rem;
  background: var(--well-bg); border: 1px solid #3a2c1c;
  font-variant-numeric: tabular-nums;
}
.inspect-cmb { color: var(--gold); }
.inspect-total { color: var(--text); }
.inspect-lbl {
  display: block; margin-bottom: 4px;
  font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em;
  color: var(--text-dim);
}
.inspect-specs { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.inspect-specnames { font-weight: 700; color: #c8a6ff; font-size: .84rem; }
.inspect-equip { display: flex; flex-wrap: wrap; gap: 5px; }
.inspect-skills {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 5px;
}
.inspect-skill {
  display: flex; align-items: center; gap: 5px;
  padding: 3px 5px;
  background: rgba(24, 18, 10, .6); border: 1px solid #241a10; border-radius: 3px;
}
.inspect-skill-lvl { font-weight: 700; font-size: .78rem; color: var(--text); font-variant-numeric: tabular-nums; }
.inspect-foot { display: flex; justify-content: flex-end; margin-top: 2px; }
.inspect-rel { padding: 6px 14px; border-radius: 3px; font-weight: 700; font-size: .82rem; }
.inspect-rel.friends { color: #7ae8a8; border: 1px solid #3a7a58; background: rgba(122, 232, 168, .1); }
.inspect-rel.pending { color: #d8b46a; border: 1px solid #6b5210; background: rgba(240, 192, 64, .08); }

/* =====================================================================
   CHAT DOCK — collapsed slim wooden tab, expands bottom-left
   ===================================================================== */

.chat-dock { position: absolute; left: 10px; bottom: 10px; z-index: 32; }
.chat-dock.collapsed .chat-box { display: none; }
.chat-dock.expanded .chat-collapsed { display: none; }

.chat-collapsed {
  display: flex; align-items: center; gap: 8px;
  background: var(--wood-face);
  border: 2px solid #201709;
  border-radius: 3px;
  padding: 6px 13px;
  cursor: pointer;
  font: inherit;
  box-shadow: inset 0 2px 0 #7a5f40, inset 0 -2px 0 #291d0f, 0 2px 0 #120d07;
}
.chat-collapsed:hover { filter: brightness(1.12); }
.chat-collapsed-label {
  text-transform: uppercase;
  font-size: .72rem; font-weight: 800;
  letter-spacing: .09em;
  color: var(--text-dim);
}
.chat-collapsed:hover .chat-collapsed-label { color: var(--text); }
.chat-collapsed-key {
  font-family: inherit;
  font-size: 9px; font-weight: 700;
  background: #150f08;
  border: 1px solid #54402c;
  border-radius: 3px;
  padding: 0 4px;
  color: var(--text-dim);
}
.chat-collapsed.glow { border-color: #c8952a; }
.chat-collapsed.glow .chat-collapsed-label {
  color: var(--gold);
  animation: tab-glow 1.1s ease-in-out infinite alternate;
}

.chat-box {
  width: 330px;
  border: 8px solid transparent;
  border-image: var(--frame-wood) 8 round;
  background: var(--panel-bg) var(--tex-noise);
  background-clip: padding-box;
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 5px 0 rgba(0,0,0,.45), 0 12px 26px rgba(0, 0, 0, .6);
}

.chat-tabs { display: flex; align-items: center; border-bottom: 2px solid var(--ui-line); }
.chat-tab {
  padding: 5px 15px;
  background: none; border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-dim);
  font: inherit; font-size: .78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  cursor: pointer;
  transition: color .12s ease;
}
.chat-tab:hover { color: var(--text); }
.chat-tab.active { color: var(--text); border-bottom-color: var(--gold); }
.chat-tab.glow {
  color: var(--gold);
  animation: tab-glow 1.1s ease-in-out infinite alternate;
}
@keyframes tab-glow {
  from { text-shadow: 0 0 3px rgba(240,192,64,.25); }
  to { text-shadow: 0 0 11px rgba(240,192,64,.85); }
}
.chat-collapse {
  margin-left: auto;
  background: none; border: none;
  color: var(--text-dim);
  font: inherit; font-size: .9rem;
  width: 30px; height: 26px;
  cursor: pointer;
}
.chat-collapse:hover { color: #fff3d6; }

.chat-list {
  height: 146px;
  overflow-y: auto;
  padding: 7px 10px;
  font-size: .82rem;
  display: flex; flex-direction: column; gap: 2px;
}
.chat-ts { color: #7a705c; font-size: .72rem; }
.chat-line { color: #ddd8c4; overflow-wrap: anywhere; }
.chat-name { font-weight: 700; }
.chat-empty { color: #6b6250; font-style: italic; padding: 4px 0; }

.log-line { overflow-wrap: anywhere; }
.log-info { color: #cdc8b4; }
.log-combat { color: #e88a7a; }
.log-loot { color: #e8b04f; }
.log-system { color: #7ae8a8; }
.log-warn { color: #e8563f; }

.chat-input-row { padding: 6px 7px; border-top: 2px solid var(--ui-line); }
.chat-input {
  width: 100%;
  padding: 5px 9px;
  border-radius: 3px;
  border: 2px solid #17110a;
  background: var(--well-bg);
  color: var(--text);
  font: inherit; font-size: .82rem;
  outline: none;
  box-shadow: inset 0 2px 0 rgba(0,0,0,.4);
}
.chat-input:focus { border-color: var(--gold); }

/* =====================================================================
   TOASTS / MODALS / DEATH / CELEBRATION
   ===================================================================== */

.toast-wrap {
  position: absolute; top: 16px; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  z-index: 90;
}
.toast {
  padding: 7px 18px;
  border: 8px solid transparent;
  border-image: var(--frame-wood) 8 round;
  background: var(--panel-bg) var(--tex-noise);
  background-clip: padding-box;
  box-shadow: 0 5px 0 rgba(0,0,0,.4), 0 10px 22px rgba(0,0,0,.55);
  font-size: .92rem;
  color: var(--text);
  max-width: min(560px, 80vw);
  text-align: center;
  animation: panel-in .18s ease;
  transition: opacity .3s ease, transform .3s ease;
}
.toast.out { opacity: 0; transform: translateY(-8px); }
.toast-error { background-color: #3c1712; color: #f0a89a; }
.toast-gold {
  background-color: #3a2a10;
  color: var(--gold);
  font-weight: 700;
  text-shadow: 0 0 12px rgba(240,192,64,.4);
}

/* level-up confetti + flying skill icon (ui-polish HUD touches) */
.confetti {
  position: fixed;
  z-index: 95;
  border: 1px solid rgba(0, 0, 0, .4);
  pointer-events: none;
}
.fly-icon {
  position: fixed;
  z-index: 95;
  width: 26px; height: 26px;
  margin: -13px 0 0 -13px;
  filter: drop-shadow(0 0 6px rgba(232, 176, 79, .8));
  pointer-events: none;
}

/* milestone (10/25/50/75/99) personal banner — NO chat broadcasts */
.milestone-banner {
  position: absolute;
  top: 26%; left: 50%;
  transform: translateX(-50%);
  z-index: 92;
  animation: milestone-in 3.6s ease forwards;
}
.milestone-inner {
  display: flex; align-items: center; gap: 13px;
  padding: 12px 26px;
  border: 16px solid transparent;
  border-image: var(--frame-wood) 8 round;
  background: linear-gradient(180deg, #4a3410, #33240a) var(--tex-noise);
  background-clip: padding-box;
  box-shadow: 0 0 40px rgba(232, 176, 79, .45), 0 10px 0 rgba(0, 0, 0, .4);
}
.milestone-txt { display: flex; flex-direction: column; gap: 2px; }
.milestone-title {
  font-size: 1.4rem; font-weight: 800;
  letter-spacing: .12em;
  color: var(--gold);
  text-shadow: 0 2px 0 rgba(0,0,0,.7), 0 0 22px rgba(240,192,64,.55);
}
.milestone-sub { font-size: .78rem; color: var(--text-dim); font-style: italic; }
@keyframes milestone-in {
  0% { opacity: 0; transform: translateX(-50%) scale(.7); }
  8% { opacity: 1; transform: translateX(-50%) scale(1.04); }
  12% { transform: translateX(-50%) scale(1); }
  82% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-14px) scale(.98); }
}

.modal-veil {
  position: absolute; inset: 0;
  background: rgba(12, 9, 5, .7);
  display: flex; align-items: center; justify-content: center;
  z-index: 60;
}
.modal {
  width: min(470px, 92vw);
  max-height: 80vh;
  overflow-y: auto;
  border: 16px solid transparent;
  border-image: var(--frame-wood) 8 round;
  background: var(--panel-bg) var(--tex-noise);
  background-clip: padding-box;
  padding: 14px 18px;
  display: flex; flex-direction: column; gap: 13px;
  box-shadow: 0 8px 0 rgba(0,0,0,.45), 0 22px 50px rgba(0,0,0,.8);
  animation: panel-in .18s ease;
}
.modal-title { color: var(--gold); font-weight: 800; font-size: 1.1rem; text-shadow: 0 1px 0 rgba(0,0,0,.7); }
.afk-body { display: flex; flex-direction: column; gap: 12px; }
.afk-line { font-size: .95rem; }
.afk-xp { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.afk-xp-row { display: flex; align-items: center; gap: 8px; font-size: .84rem; }
.afk-loot { display: flex; gap: 10px; flex-wrap: wrap; padding: 2px; }
.afk-gold { display: flex; align-items: center; gap: 7px; color: var(--gold); font-weight: 700; }
.afk-note { font-size: .8rem; color: var(--text-dim); }
.afk-food { display: flex; flex-direction: column; gap: 6px; }
.afk-stop { font-size: .84rem; font-weight: 700; color: #e8a05a; }
.afk-modal .btn.primary { align-self: center; min-width: 160px; }

@keyframes panel-in {
  from { opacity: 0; transform: scale(.94); }
  to { opacity: 1; transform: scale(1); }
}

.death-flash {
  position: absolute; inset: 0;
  z-index: 80;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(96,16,16,.5), rgba(48,8,8,.82));
  animation: death-flash 2.5s ease forwards;
}
.death-text {
  font-size: 1.6rem; font-weight: 800;
  color: #f0c8be;
  letter-spacing: .05em;
  text-shadow: 0 2px 0 rgba(0,0,0,.9), 0 2px 20px rgba(0,0,0,.9);
}
@keyframes death-flash {
  0% { opacity: 0; }
  8% { opacity: 1; }
  72% { opacity: 1; }
  100% { opacity: 0; }
}

/* ---------- stale-client overlay (protocol version mismatch) ---------- */

.stale-overlay {
  position: fixed; inset: 0;
  z-index: 5000;
  background: rgba(10, 8, 5, .93);
  display: flex; align-items: center; justify-content: center;
}
.stale-box {
  width: min(390px, 92vw);
  border: 16px solid transparent;
  border-image: var(--frame-wood) 8 round;
  background: var(--panel-bg) var(--tex-noise);
  background-clip: padding-box;
  padding: 18px 22px;
  display: flex; flex-direction: column; align-items: center; gap: 13px;
  text-align: center;
  box-shadow: 0 8px 0 rgba(0,0,0,.45), 0 22px 50px rgba(0,0,0,.8);
  animation: panel-in .18s ease;
}
.stale-title { color: var(--gold); font-weight: 800; font-size: 1.2rem; letter-spacing: .04em; }
.stale-text { color: var(--text); font-size: .92rem; line-height: 1.5; }
.stale-note { color: var(--text-dim); font-size: .78rem; }
.stale-box .btn.primary { min-width: 150px; }

/* ---------- scheduled update: countdown banner + reconnect overlay ---------- */

/* Slim, non-blocking chip pinned top-centre; game stays fully playable beneath. */
.maint-banner {
  position: fixed; top: 8px; left: 50%; transform: translateX(-50%);
  z-index: 4000; pointer-events: none;
  max-width: min(92vw, 560px);
  padding: 6px 15px;
  border: 2px solid #6a512f;
  border-radius: 999px;
  background: rgba(28, 20, 12, .93);
  box-shadow: 0 3px 0 rgba(0,0,0,.4), 0 8px 22px rgba(0,0,0,.55);
  color: #f3e8cf;                         /* light parchment on the dark chip */
  font-size: .82rem; font-weight: 700; letter-spacing: .02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  animation: panel-in .18s ease;
}

.maint-overlay {
  position: fixed; inset: 0;
  z-index: 5200;                          /* above the stale overlay */
  background: rgba(10, 8, 5, .92);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(2px);
}
.maint-box {
  width: min(360px, 90vw);
  padding: 26px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  text-align: center;
  border: 16px solid transparent;
  border-image: var(--frame-wood) 8 round;
  background: var(--panel-bg) var(--tex-noise);
  background-clip: padding-box;
  box-shadow: 0 8px 0 rgba(0,0,0,.45), 0 22px 50px rgba(0,0,0,.8);
  animation: panel-in .18s ease;
}
.maint-title { color: var(--gold); font-weight: 800; font-size: 1.15rem; letter-spacing: .03em; }
.maint-sub { color: #e8dcc0; font-size: .85rem; line-height: 1.5; }
.maint-spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 4px solid rgba(243, 232, 207, .22);
  border-top-color: var(--gold);
  animation: maint-spin 0.9s linear infinite;
}
@keyframes maint-spin { to { transform: rotate(360deg); } }

/* ---------- tooltip — torn-edge parchment (attached to <body>) ---------- */

.ui-tooltip {
  position: fixed;
  z-index: 2000;
  max-width: 264px;
  /* solid parchment fill + framed edges: the frame's `fill` region tiles with
     visible seams on fractional-DPR displays, so paint the body ourselves */
  background: #e7dcb8;
  border: 6px solid transparent;
  border-image: var(--frame-parch) 6 round;
  padding: 5px 8px;
  font-size: .78rem;
  color: #3a2c18;
  filter: drop-shadow(0 3px 0 rgba(0,0,0,.35)) drop-shadow(0 8px 18px rgba(0,0,0,.5));
  pointer-events: none;
  line-height: 1.4;
}
.ui-tooltip.hidden { display: none; }
.tt { display: flex; flex-direction: column; gap: 3px; }
.tt-head { display: flex; align-items: center; gap: 6px; }
.tt-head .chip { box-shadow: none; }
.tt-head-icon { width: 18px; height: 18px; image-rendering: pixelated; }
.tt-name { font-weight: 800; color: #7a4e10; font-size: .86rem; }
.tt-divider {
  height: 2px;
  margin: 2px 0 3px;
  background: repeating-linear-gradient(90deg, #a8895a 0 3px, transparent 3px 6px);
}
.tt-rarity { font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.tt-type { color: #7a6848; }
.tt-row { display: flex; justify-content: space-between; gap: 14px; }
.tt-k { color: #6b5a3c; }
.tt-v { font-weight: 800; color: #3a2c18; font-variant-numeric: tabular-nums; }

/* "vs equipped" compare block: green = upgrade, red = downgrade */
.tt-cmp-head {
  margin-top: 5px; padding-top: 5px;
  border-top: 1px solid #c4ab7c;
  color: #6b5a3c;
  font-size: .7rem; font-weight: 700;
}
.tt-v.cmp-good { color: #2f7a34; }
.tt-v.cmp-bad { color: #b03328; }
.tt-v.cmp-even { color: #6b5a3c; }
.tt-req { color: #3f6d2a; font-size: .74rem; margin-top: 2px; }
.tt-req.req-bad { color: #b03328 !important; }
.tt-value { color: #6b5a3c; font-size: .72rem; margin-top: 2px; }
.tt-lore { color: #6b5a3c; font-size: .72rem; font-style: italic; margin-top: 3px; }
.tt-hint { color: #5c3f8a; font-size: .72rem; font-style: italic; margin-top: 3px; }
.tt-afk { color: #2f6d5a; font-size: .74rem; font-weight: 700; margin-top: 2px; }

/* =====================================================================
   RESPONSIVE (usable down to ~1100px wide) — the dock scales down
   ===================================================================== */

@media (max-width: 1280px) {
  :root { --dock-h: 100px; }
  .bar { width: 200px; }
  .hud-xp .bar { width: 168px; }
  .chat-box { width: 300px; }
  .chat-list { height: 128px; }
  .dock-sign { width: 60px; }
  .dock-roundel { width: 27px; height: 27px; }
}

@media (max-width: 1120px) {
  :root { --dock-h: 92px; }
  .chat-box { width: 280px; }
  .chat-list { height: 112px; }
  .menu-dock { gap: 4px; padding: 10px 10px 5px; }
  .dock-sign { width: 52px; border-width: 8px; padding: 3px 1px 2px; }
  .dock-roundel { width: 24px; height: 24px; }
  .dock-roundel img { width: 14px; height: 14px; }
  .dock-label { font-size: .52rem; letter-spacing: .05em; }
  .panel { border-width: 12px; }
  .wm-rail { width: 78px; flex-basis: 78px; }
  .wm-node { width: 72px; }
  .wm-dome { width: 34px; height: 34px; }
  .wm-node.town .wm-dome { width: 42px; height: 42px; }
  .talent-grid { grid-template-columns: repeat(auto-fill, 66px); }
  .talent-sq { width: 66px; }
}

/* Settings rows: mute toggle + volume slider */
.settings-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.settings-mute { min-width: 110px; }
.settings-slider { flex: 1; accent-color: var(--gold, #e8b04f); cursor: pointer; }
.settings-slider:disabled { opacity: 0.35; cursor: default; }

/* =====================================================================
   CLASSES + ABILITIES + REAL TREE (classes-abilities-tree.md).
   Ability Bar (bottom-center, above the dock), class header, and the tree
   render with SVG edges. All text = light parchment (owner law).
   ===================================================================== */

/* ---------- Ability Bar ---------- */
.ability-bar {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--dock-h) + 6px);
  z-index: 34;                       /* above game, below open panels */
  display: flex; justify-content: center;
  pointer-events: none;              /* only the slots catch input */
}
.ability-bar.hidden { display: none; }
.ab-rail { display: flex; gap: 8px; pointer-events: auto; padding: 4px 6px; }
.ab-slot {
  --slot-tint: var(--class-tint, #e8563f);
  position: relative;
  width: 46px; height: 46px;
  background: var(--well-bg);
  border: 2px solid var(--slot-tint);
  border-radius: 6px; padding: 0; cursor: pointer;
  box-shadow: 0 3px 0 rgba(0,0,0,.5), inset 0 0 10px rgba(0,0,0,.55);
  overflow: hidden;
  transition: transform .08s ease, box-shadow .1s ease, filter .1s ease;
}
.ab-slot:hover { transform: translateY(-2px); filter: brightness(1.08); }
.ab-slot.locked { border-color: #3a2c1c; cursor: default; opacity: .82; }
.ab-slot.empty { border-style: dashed; border-color: #6a533a; }
.ab-slot.drop { box-shadow: 0 0 0 2px var(--gold), 0 3px 0 rgba(0,0,0,.5); transform: translateY(-2px); }
.ab-face { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.ab-chip { width: 34px; height: 34px; box-shadow: none; }
.ab-chip img { width: 21px; height: 21px; }
.ab-sweep { position: absolute; inset: 0; display: none; pointer-events: none; }
.ab-cd {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  font-size: .95rem; font-weight: 800; color: #f3e8cf; text-shadow: 0 1px 2px #000;
  font-variant-numeric: tabular-nums; pointer-events: none;
}
.ab-key {
  position: absolute; bottom: -1px; right: 1px;
  font-size: .56rem; font-weight: 800; color: #f3e8cf; line-height: 1.35;
  background: rgba(10,7,4,.82); border: 1px solid #201709; border-radius: 3px;
  padding: 0 3px; pointer-events: none;
}
.ab-lock {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1px;
  background: rgba(10,7,5,.58); pointer-events: none;
}
.ab-lock.hidden { display: none; }
.ab-lock-icon { width: 16px; height: 16px; opacity: .85; }
.ab-lock-lv { font-size: .52rem; font-weight: 800; color: #e8dcc0; letter-spacing: .03em; }
.ab-slot.stale .ab-chip { filter: grayscale(.7) brightness(.6); }
.ab-slot.flash { animation: ab-flash .34s ease; }
@keyframes ab-flash {
  0%   { box-shadow: 0 0 0 3px var(--slot-tint), 0 0 20px var(--slot-tint); filter: brightness(1.7); }
  100% { box-shadow: 0 3px 0 rgba(0,0,0,.5), inset 0 0 10px rgba(0,0,0,.55); filter: none; }
}
.ab-slot.blocked { animation: ab-blocked .3s ease; }
@keyframes ab-blocked {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-3px); } 75% { transform: translateX(3px); }
}

/* ---------- Class header (in the Talents panel) ---------- */
.class-header {
  --class-color: var(--accent);
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; margin-bottom: 10px;
  background: linear-gradient(180deg, rgba(30,22,12,.92), rgba(18,13,8,.85));
  border: 2px solid #241a10; border-left: 4px solid var(--class-color);
  border-radius: 6px; box-shadow: inset 0 2px 0 rgba(0,0,0,.4);
}
.class-header-chip { width: 40px; height: 40px; box-shadow: 0 0 12px color-mix(in srgb, var(--class-color) 40%, transparent); }
.class-header-txt { min-width: 0; }
.class-header-eyebrow { font-size: .6rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--class-color); }
.class-header-name { font-size: 1.15rem; font-weight: 800; color: #f3e8cf; letter-spacing: .02em; text-shadow: 0 1px 0 rgba(0,0,0,.6); }
.class-header-line { font-size: .74rem; color: #cabfa4; line-height: 1.3; }

/* ---------- Real talent tree ---------- */
.tree-scroll { overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; margin: 2px 0 6px; }
.tree-canvas { position: relative; margin: 0 auto; }
.tree-edges { position: absolute; inset: 0; pointer-events: none; }
.tree-edge { stroke: #3a2c1c; stroke-width: 3; stroke-linecap: round; }
.tree-edge.on { stroke-width: 3.5; opacity: .9; }
.tree-spine { stroke: #4a3722; stroke-width: 2; stroke-dasharray: 3 4; opacity: .6; }
.tree-colhead {
  position: absolute; top: 0; text-align: center;
  font-size: .6rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-dim);
}
.tree-colhead.spec { color: var(--gold); }
.tree-node {
  --node-color: #e8563f;
  position: absolute; width: 58px; height: 58px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: var(--well-bg);
  border: 2px solid #241a10; border-radius: 8px;
  cursor: pointer; padding: 0; font: inherit;
  box-shadow: inset 0 2px 0 rgba(0,0,0,.5);
  transition: transform .08s ease, border-color .1s ease, box-shadow .12s ease;
}
.tree-node:hover { transform: scale(1.08); z-index: 3; border-color: var(--node-color); }
.tree-node-chip { width: 32px; height: 32px; box-shadow: none; }
.tree-node-chip img { width: 20px; height: 20px; }
.tree-node-rank { font-size: .58rem; font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; }
.tree-node.afford {
  border-color: color-mix(in srgb, var(--node-color) 60%, #241a10);
  box-shadow: 0 0 8px color-mix(in srgb, var(--node-color) 30%, transparent), inset 0 2px 0 rgba(0,0,0,.4);
}
.tree-node.maxed { border-color: #c8952a; box-shadow: 0 0 10px rgba(232,176,79,.35), inset 0 0 8px rgba(232,176,79,.12); }
.tree-node.maxed .tree-node-rank { text-shadow: 0 0 8px rgba(240,192,64,.6); }
.tree-node.locked { cursor: default; }
.tree-node.locked .tree-node-chip { filter: grayscale(.85) brightness(.5); }
.tree-node.locked .tree-node-rank { color: var(--text-dim); }
.tree-node-lock {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(10,7,5,.42); border-radius: 6px;
}
.tree-lock-icon { width: 16px; height: 16px; opacity: .8; }
/* keystone: 1.5× and rounder, glowing rim */
.tree-node.keystone {
  width: 87px; height: 87px; border-radius: 14px;
  border-color: var(--node-color);
  background: radial-gradient(circle at 50% 40%, rgba(40,30,16,.95), var(--well-bg));
  box-shadow: 0 0 14px color-mix(in srgb, var(--node-color) 40%, transparent), inset 0 2px 0 rgba(0,0,0,.4);
}
.tree-node.keystone .tree-node-chip { width: 44px; height: 44px; }
.tree-node.keystone .tree-node-chip img { width: 27px; height: 27px; }
.tree-node.keystone .tree-node-rank { font-size: .64rem; }
.tree-node-star { position: absolute; top: 3px; color: var(--node-color); font-size: .74rem; text-shadow: 0 1px 2px #000; }
.tree-node-badge {
  position: absolute; top: -4px; left: -4px;
  width: 15px; height: 15px; border-radius: 3px;
  background: var(--node-color); color: #1a130c;
  font-size: .56rem; font-weight: 900; line-height: 15px; text-align: center;
  border: 1px solid #1a130c;
}
.tree-node-onbar {
  position: absolute; bottom: 2px; right: 3px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 5px rgba(232,176,79,.85);
}
.tree-node-assign {
  position: absolute; top: -6px; right: -6px;
  width: 17px; height: 17px; border-radius: 4px;
  background: var(--wood-face); border: 1px solid #201709; color: #f3e8cf;
  font-size: .72rem; font-weight: 800; line-height: 1; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 0 #120d07;
}
.tree-node-assign:hover { filter: brightness(1.2); }
