/* Medieval theme: dark oak panels with gold trim, serif headings, parchment for quest text.
   Colours live in the variables below, so the whole look can be retuned in one place. */

:root {
  --wood: linear-gradient(180deg, rgba(46, 35, 25, 0.94), rgba(30, 23, 17, 0.94));
  --wood-solid: linear-gradient(180deg, #2e2319, #1e1711);
  --wood-glass: rgba(28, 21, 15, 0.78);
  --wood-deep: #15100b;
  --trim: #7a5f36;
  --trim-soft: rgba(231, 195, 108, 0.16);
  --gold: #e7c36c;
  --gold-bright: #ffd877;
  --gold-text: #f2d27c;
  --text: #f3e9d2;
  --text-dim: #bba98a;
  --text-faint: #8c7b60;
  --green: #8fd18a;
  --parchment: #f1e4c3;
  --ink: #3b2a17;
  --serif: "Palatino Linotype", "Book Antiqua", Palatino, "URW Palladio L", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #120e0a;
  color: var(--text);
  font-family: var(--sans);
}

#game {
  position: fixed;
  inset: 0;
  display: block;
}

.hidden { display: none !important; }

/* ---- Shared pieces: framed panels and gold buttons ---- */

.panel, .window, #player-frame, #party-frame, #players-panel, #quest-tracker, .invite, #player-menu, #tooltip {
  border: 1px solid var(--trim);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5), inset 0 0 0 2px var(--trim-soft), 0 10px 28px rgba(0, 0, 0, 0.45);
}

.panel button, .dialog-buttons button, button.mini {
  border: 1px solid #7a5a22;
  background: linear-gradient(#f4d886, #c99a3f);
  color: #2b1b08;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 2px 0 #4a3412;
  font-weight: 800;
  cursor: pointer;
}
.panel button:hover, .dialog-buttons button:hover, button.mini:hover { background: linear-gradient(#fbe3a0, #d9ab50); }
.panel button:active, .dialog-buttons button:active, button.mini:active { transform: translateY(1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 0 #4a3412; }

/* ---- Title screen ---- */

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 9, 6, 0.6);
  backdrop-filter: blur(2px);
  z-index: 10;
}
.title-screen { background: #1a1530; backdrop-filter: none; overflow-y: auto; }
#title-bg { position: fixed; inset: 0; display: block; }
.title-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px 0;
  margin: auto;
}

.logo { text-align: center; }
.logo-emblem {
  width: clamp(80px, 11vw, 108px);
  height: clamp(80px, 11vw, 108px);
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.55));
}
.logo-name {
  margin: 2px 0 0;
  font-family: var(--serif);
  font-size: clamp(38px, 7vw, 64px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 2px;
  color: var(--gold-bright);
  background: linear-gradient(180deg, #fff1c4 10%, #f2c25a 55%, #b9822c 95%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 #3d2608) drop-shadow(0 6px 14px rgba(20, 10, 0, 0.6));
}
.logo-tag {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: #f6e3c0;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}
.logo-tag:empty { display: none; }

.panel {
  position: relative;
  width: min(340px, 90vw);
  padding: 22px 24px 18px;
  border-radius: 10px;
  background: var(--wood);
  text-align: center;
}

.panel h1, .panel h2 { margin: 0 0 4px; font-family: var(--serif); letter-spacing: 0.5px; color: var(--gold-text); }
.panel h1 { font-size: 30px; }
.panel .sub { margin: 0 0 16px; color: var(--text-dim); font-size: 15px; font-family: var(--serif); }
.panel .sub strong { color: var(--gold-text); }

.panel input {
  width: 100%;
  padding: 11px 12px;
  margin-bottom: 10px;
  border-radius: 6px;
  border: 1px solid #5d4628;
  background: var(--wood-deep);
  color: inherit;
  font-size: 16px;
  outline: none;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}
.panel input::placeholder { color: var(--text-faint); }
.panel input:focus { border-color: var(--gold); }

.panel button {
  width: 100%;
  padding: 11px;
  border-radius: 6px;
  font-size: 16px;
  font-family: var(--serif);
  letter-spacing: 0.5px;
}
.panel button:disabled { opacity: 0.6; cursor: default; }

.tabs { display: flex; gap: 4px; margin-bottom: 14px; padding: 4px; border-radius: 8px; background: var(--wood-deep); border: 1px solid #3d2e1c; }
.panel .tab {
  flex: 1;
  padding: 7px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-dim);
  box-shadow: none;
  font-size: 14px;
  font-weight: 700;
}
.panel .tab:hover { background: rgba(255, 220, 150, 0.07); }
.panel .tab.active { background: linear-gradient(#4a3826, #3a2b1d); color: var(--gold-text); box-shadow: inset 0 0 0 1px rgba(231, 195, 108, 0.35); }
.panel .link-btn {
  margin-top: 10px;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--text-dim);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  text-decoration: underline;
}
.panel .link-btn:hover { background: none; color: var(--text); }
.error { min-height: 1.2em; margin: 10px 0 0; color: #ff9b8f; font-size: 13px; }

/* ---- HUD ---- */

#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#hud > * { pointer-events: auto; }

#status-bar {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--wood-glass);
  border: 1px solid rgba(122, 95, 54, 0.6);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 7px;
}
#status-dot { width: 8px; height: 8px; border-radius: 50%; background: #e0b84a; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5); }
#status-bar.online #status-dot { background: #6fdc5f; }
#status-bar.offline #status-dot { background: #e0584a; }
#ping { color: var(--text-dim); }

/* Your health / XP, top-left */
/* Your frame, your buffs, your party and the guide, one under the other (js adds the buffs
   and the guide here), so a taller frame (a mana bar, two rows of buttons) never overlaps. */
#hud > #left-stack {
  position: absolute; top: 46px; left: 10px; width: 268px;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
#left-stack > * { pointer-events: auto; }
#player-frame {
  position: relative;
  padding: 8px 10px 9px;
  border-radius: 8px;
  background: var(--wood);
}
.pf-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pf-level {
  min-width: 26px;
  height: 26px;
  padding: 0 5px;
  border-radius: 13px;
  background: radial-gradient(circle at 35% 30%, #fff0b8, #e7b94a 55%, #a8761f);
  border: 1px solid #5a3d10;
  color: #3a2504;
  font-family: var(--serif);
  font-weight: 800;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.pf-name { flex: 1; font-family: var(--serif); font-weight: 700; font-size: 16px; color: var(--gold-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-logout {
  padding: 2px 7px;
  border: 1px solid #5d4628;
  border-radius: 5px;
  background: transparent;
  color: var(--text-dim);
  font-size: 11px;
  cursor: pointer;
}
.pf-logout:hover { color: var(--text); border-color: var(--gold); }
.bar {
  position: relative;
  height: 16px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.7);
  box-shadow: 0 0 0 1px rgba(231, 195, 108, 0.18);
  overflow: hidden;
}
.bar + .bar { margin-top: 5px; }
.bar .fill { position: absolute; inset: 0 auto 0 0; width: 0; transition: width 0.15s ease-out; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.hp-bar .fill { background: linear-gradient(#78e066, #3a9e31); }
.hp-bar.low .fill { background: linear-gradient(#ff7a6b, #c7372b); }
.xp-bar { height: 10px; }
.xp-bar .fill { background: linear-gradient(#ffe08a, #c98f2a); }
.bar-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  text-shadow: 0 1px 2px #000;
}
.xp-bar .bar-text { font-size: 9px; }

#hurt {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(220, 30, 20, 0.55));
  transition: opacity 0.35s ease-out;
}
#hurt.on { opacity: 1; transition: none; }

#death {
  position: fixed;
  left: 50%;
  top: 30%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  z-index: 6;
  text-shadow: 0 2px 6px #000;
}
.death-title { font-family: var(--serif); font-size: 40px; font-weight: 700; letter-spacing: 1px; color: #ff7a6b; }
.death-sub { margin-top: 6px; font-family: var(--serif); font-size: 17px; color: var(--text); }

#right-col {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
#right-col > * { pointer-events: auto; }
#players-panel {
  min-width: 150px;
  max-height: 40vh;
  overflow-y: auto;
  padding: 7px 12px 8px;
  border-radius: 8px;
  background: var(--wood-glass);
  font-size: 13px;
}
.panel-title { font-family: var(--serif); font-weight: 700; font-size: 14px; margin-bottom: 4px; color: var(--gold-text); letter-spacing: 0.3px; }
#player-count { color: var(--text-dim); font-family: var(--sans); font-size: 12px; }
#player-list { list-style: none; margin: 0; padding: 0; }
#player-list li { display: flex; align-items: center; gap: 7px; padding: 2px 0; }
#player-list .swatch { width: 9px; height: 9px; border-radius: 50%; flex: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6); }
#player-list .me { color: var(--gold-text); }
#player-list .lvl { margin-left: auto; padding-left: 10px; color: #a9d6ff; font-size: 12px; }

#chat {
  position: absolute;
  left: 10px;
  bottom: 34px;
  width: min(450px, calc(100vw - 20px));
  display: flex;
  flex-direction: column;
  border-radius: 9px;
  overflow: hidden;
  background: rgba(24, 18, 12, 0.58);
  border: 1px solid rgba(122, 95, 54, 0.5);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  transition: background 0.15s;
}
#chat:hover, #chat.typing { background: rgba(20, 15, 10, 0.86); }
.chat-tabs {
  display: flex;
  gap: 2px;
  padding: 4px 4px 0;
  background: rgba(0, 0, 0, 0.28);
  border-bottom: 1px solid rgba(122, 95, 54, 0.5);
}
.chat-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 6px;
  border: 0;
  border-radius: 6px 6px 0 0;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--serif);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  box-shadow: none;
  cursor: pointer;
}
.chat-tab:hover { color: var(--text); background: rgba(255, 230, 180, 0.06); }
.chat-tab.active { background: linear-gradient(#4a3826, #3a2b1d); color: var(--gold-text); box-shadow: inset 0 1px 0 rgba(231, 195, 108, 0.35); }
.chat-unread { display: none; min-width: 16px; padding: 0 5px; border-radius: 8px; background: #c2412d; color: #fff; font-family: system-ui, sans-serif; font-size: 10.5px; line-height: 16px; text-align: center; }
.chat-unread.on { display: inline-block; }
.chat-tab[data-tab="battle"] .chat-unread { min-width: 8px; padding: 0; width: 8px; height: 8px; font-size: 0; line-height: 0; background: #ff8a3d; }
.chat-logs { position: relative; height: 172px; }
.chat-log {
  height: 100%;
  overflow-y: auto;
  padding: 6px 10px;
  font-size: 13.5px;
  line-height: 1.42;
  overflow-wrap: anywhere;
  scrollbar-width: thin;
  scrollbar-color: rgba(231, 195, 108, 0.35) transparent;
}
.chat-log.hidden { display: none; }
.chat-log .line { text-shadow: 0 1px 2px #000; }
.chat-log .name { font-weight: 700; }
.chat-log .tag { color: #7fe3d0; font-weight: 700; }
.chat-log .system { color: var(--text-dim); font-style: italic; }
.chat-log .notice { color: #ffb36b; }
.chat-log .levelup { color: var(--gold-bright); font-weight: 700; }
.chat-log .danger { color: #ff8f84; }
.chat-log .hit { color: #d8d2c4; }
.chat-log .crit { color: #ffd23f; font-weight: 700; }
.chat-log .hurt { color: #ff9c8f; }
.chat-log .kill { color: #9be38a; }
.chat-log .xp { color: #b9a6ff; }
.chat-log .heal { color: #7fe39a; }
.chat-log .ability { color: #9fd8ff; }
.chat-log .boss { color: #ff8a3d; font-weight: 700; }
.chat-log .motd { color: #ffe9a8; font-family: var(--serif); font-style: italic; }
.chat-log .admin { color: #7fd3ff; font-weight: 700; }
.chat-log .chat.guild { color: #bfe8ff; }
.chat-log .guildnews { color: #8fd3ff; font-style: italic; }
.chat-log .arena { color: #ff9b7a; font-weight: 600; }
.chat-log .whisper { color: #ff9cd2; }
.chat-log .whisper .tag { color: #ff9cd2; font-weight: 400; }
.chat-log .friend { color: #9be38a; font-style: italic; }

#chat-form { display: flex; border-top: 1px solid rgba(122, 95, 54, 0.5); }
.chat-channel {
  flex: 0 0 auto;
  padding: 0 10px;
  border: 0;
  border-right: 1px solid rgba(122, 95, 54, 0.45);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.22);
  color: var(--gold-text);
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 700;
  box-shadow: none;
  cursor: pointer;
}
.chat-channel[data-channel="local"] { color: #a9e3ff; }
.chat-channel[data-channel="party"] { color: #7fe3d0; }
#chat-input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 14px;
  outline: none;
}
#chat-input::placeholder { color: var(--text-faint); }
.chat-emote-btn { flex: 0 0 auto; width: 34px; padding: 0; border: 0; border-left: 1px solid rgba(122, 95, 54, 0.45); border-radius: 0; background: rgba(0, 0, 0, 0.22); color: var(--gold-text); font-size: 17px; box-shadow: none; cursor: pointer; }
.chat-emote-btn:hover { background: rgba(231, 195, 108, 0.15); }
.chat-emotes { position: absolute; right: 4px; bottom: 40px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 6px; border-radius: 8px; background: var(--wood-glass); border: 1px solid #7a5f36; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5); z-index: 5; }
.chat-emotes button { padding: 4px 8px; border-radius: 5px; border: 1px solid #5d4628; background: rgba(0, 0, 0, 0.25); color: var(--text); font-size: 12.5px; cursor: pointer; box-shadow: none; }
.chat-emotes button:hover { border-color: #e0b040; color: var(--gold-text); }
.chat-log .emote { font-style: italic; }
#chat.typing #chat-form { background: rgba(0, 0, 0, 0.25); box-shadow: inset 0 0 0 1px var(--gold); }

#help {
  position: absolute;
  left: 10px;
  bottom: 10px;
  font-size: 12px;
  color: #e6d9bb;
  opacity: 0.8;
  text-shadow: 0 1px 2px #000;
}

/* ---- Player frame: gold, potion and bag buttons ---- */

.pf-bottom { display: flex; align-items: center; gap: 5px; margin-top: 7px; }
.pf-buttons { display: flex; gap: 5px; margin-top: 5px; }
.pf-buttons .quick { flex: 1; justify-content: center; }
.pf-gold { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--gold-bright); margin-right: auto; font-size: 13px; }
img.coin { width: 16px; height: 16px; vertical-align: -3px; }
.quick {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 7px;
  border: 1px solid #5d4628;
  border-radius: 5px;
  background: linear-gradient(rgba(255, 230, 180, 0.08), rgba(0, 0, 0, 0.15));
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.quick:hover { border-color: var(--gold); }
.quick img { width: 18px; height: 18px; }
.quick.empty { opacity: 0.45; }
kbd {
  display: inline-block;
  min-width: 16px;
  padding: 0 4px;
  border-radius: 3px;
  background: rgba(255, 230, 180, 0.12);
  border: 1px solid rgba(255, 230, 180, 0.15);
  color: #e6d9bb;
  font: 700 10px/14px var(--sans);
  text-align: center;
}

/* ---- Quest tracker ---- */

#quest-tracker {
  min-width: 200px;
  max-width: 240px;
  padding: 7px 12px 8px;
  border-radius: 8px;
  background: var(--wood-glass);
  font-size: 13px;
}
#quest-list { list-style: none; margin: 0; padding: 0; }
#quest-list li + li { margin-top: 6px; }
#quest-list .q-name { font-family: var(--serif); font-weight: 700; color: #ffe9a8; }
#quest-list .q-goal { color: #e6d9bb; font-size: 12px; }
#quest-list li.done .q-goal { color: #8fe07a; }

/* ---- Windows (bag, shop, dialog) ---- */

.window {
  position: absolute;
  padding: 10px 12px 10px;
  border-radius: 10px;
  background: var(--wood);
  font-size: 13px;
}
.win-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 -2px 9px;
  padding: 0 2px 6px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--gold-text);
  letter-spacing: 0.3px;
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(90deg, transparent, rgba(231, 195, 108, 0.55), transparent) 1;
}
.win-close {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-dim);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.win-close:hover { background: rgba(255, 220, 150, 0.1); color: #fff; }
.win-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; color: var(--gold-bright); font-weight: 700; }
.win-foot .hint { color: var(--text-faint); font-weight: 400; font-size: 11px; }
.window .tabs { margin-bottom: 8px; }
.window .tab {
  flex: 1;
  padding: 6px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-dim);
  font-weight: 700;
  cursor: pointer;
}
.window .tab.active { background: linear-gradient(#4a3826, #3a2b1d); color: var(--gold-text); box-shadow: inset 0 0 0 1px rgba(231, 195, 108, 0.35); }

#bag { right: 10px; bottom: 40px; width: 262px; }
#shop { right: 282px; bottom: 40px; width: 340px; }
#dialog { left: 50%; top: 64px; transform: translateX(-50%); width: min(440px, calc(100vw - 20px)); }

.slot {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: radial-gradient(circle at 50% 40%, rgba(60, 45, 30, 0.6), rgba(0, 0, 0, 0.55));
  border: 1px solid #4d3b25;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}
.slot.filled { cursor: pointer; background: radial-gradient(circle at 50% 40%, rgba(110, 85, 55, 0.55), rgba(20, 14, 8, 0.6)); }
.slot.filled:hover { border-color: var(--gold); }
.slot.rare { border-color: #7ff3ff; box-shadow: inset 0 0 8px rgba(127, 243, 255, 0.35); }
.slot .icon { width: 34px; height: 34px; pointer-events: none; }
.slot .qty {
  position: absolute;
  right: 3px;
  bottom: 1px;
  font-size: 11px;
  font-weight: 800;
  text-shadow: 0 1px 2px #000, 0 0 2px #000;
  pointer-events: none;
}
.slot-label { font-size: 9px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.5px; }
.equip { width: 50px; height: 50px; }
.equip-row { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.stat-box { margin-left: 6px; font-size: 12px; color: #e6d9bb; line-height: 1.45; }
.stat-box b { color: #fff; }
.bag-grid { display: grid; grid-template-columns: repeat(5, 44px); gap: 6px; }

.npc-line { margin: 0 0 8px; color: #efe3c6; font-family: var(--serif); font-size: 14px; font-style: italic; line-height: 1.4; }
.shop-list { max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.shop-row {
  display: grid;
  grid-template-columns: 34px 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(255, 230, 180, 0.05);
  border: 1px solid rgba(255, 230, 180, 0.06);
}
.shop-row .icon { width: 32px; height: 32px; }
.shop-name small { display: block; color: var(--text-faint); font-size: 11px; }
.price { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; color: var(--gold-bright); }
.price.poor { color: #b9806f; }
.shop-buttons { display: flex; gap: 4px; }
button.mini {
  padding: 4px 9px;
  border-radius: 5px;
  font-size: 12px;
}
button.mini:disabled { background: #3d3124; color: #7d6d58; border-color: #3d3124; box-shadow: none; cursor: default; }
.empty-note { margin: 6px 2px 0; color: var(--text-faint); font-size: 11px; }

/* The quest giver's dialog is written on parchment. */
#dialog {
  background: linear-gradient(180deg, #f6ebcf, #e9d7ad);
  border-color: #8a6a35;
  color: var(--ink);
  box-shadow: inset 0 0 30px rgba(140, 100, 40, 0.35), inset 0 0 0 2px rgba(255, 255, 255, 0.35), 0 12px 32px rgba(0, 0, 0, 0.5);
}
#dialog .win-head { color: #6b2c12; border-image: linear-gradient(90deg, transparent, rgba(107, 44, 18, 0.5), transparent) 1; }
#dialog .win-close { color: #7a5a30; }
#dialog .win-close:hover { background: rgba(107, 44, 18, 0.1); color: #3b2a17; }
#dialog .npc-line { color: #4a3420; }
#dialog .hint { color: #7a6648; }
#dialog .reward-icon { background: rgba(107, 74, 30, 0.15); }
#dialog .quest-name { color: #7a2e14; }
#dialog .quest-goal { color: #4a3420; }
#dialog .quest-goal b { color: #2b1d10; }
#dialog .quest-rewards { color: #6b4a12; }
#dialog .dialog-buttons button.secondary { background: rgba(107, 74, 30, 0.12); color: #4a3420; border-color: #a58550; box-shadow: none; }

.quest-name { font-family: var(--serif); font-size: 18px; font-weight: 700; color: var(--gold-bright); margin-bottom: 6px; }
.quest-goal { margin-bottom: 4px; color: #e6d9bb; }
.quest-goal b { color: #fff; }
.quest-rewards { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: #ffe9a8; }
.reward-icon { display: inline-flex; padding: 2px; border-radius: 6px; background: rgba(0, 0, 0, 0.3); }
.reward-icon .icon { width: 28px; height: 28px; }
.hint { color: var(--text-faint); }
.dialog-buttons { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.dialog-buttons button {
  padding: 8px 14px;
  border-radius: 6px;
  font-family: var(--serif);
  font-size: 14px;
}
.dialog-buttons button.secondary { background: rgba(255, 230, 180, 0.08); color: #e8dcc0; border-color: #5d4628; box-shadow: none; font-weight: 600; }
.dialog-buttons button.secondary:hover { background: rgba(255, 230, 180, 0.14); }
.dialog-buttons button.danger { color: #ff9b8f; }

#talk-prompt {
  position: absolute;
  left: 50%;
  bottom: 112px;
  transform: translateX(-50%);
  padding: 7px 12px;
  border-radius: 6px;
  background: var(--wood-glass);
  border: 1px solid var(--trim);
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

#tooltip {
  position: fixed;
  z-index: 20;
  max-width: 220px;
  padding: 8px 10px;
  border-radius: 7px;
  background: var(--wood-solid);
  pointer-events: none;
  font-size: 12px;
  line-height: 1.4;
}
.tt-name { font-family: var(--serif); font-size: 15px; font-weight: 700; color: var(--text); }
.tt-name.rare { color: #7ff3ff; }
.tt-type { color: var(--text-faint); font-size: 11px; margin-bottom: 3px; }
.tt-stat { color: #8fe07a; font-weight: 700; }
.tt-desc { color: #d9ccb0; font-family: var(--serif); font-style: italic; margin-top: 3px; }
.tt-price { color: var(--gold-bright); margin-top: 3px; }
.tt-hint { color: var(--text-faint); margin-top: 3px; font-size: 11px; }

.chat-log .loot { color: #e8d48a; }
.chat-log .quest { color: var(--gold-bright); font-weight: 700; }

/* ---- Zones ---- */

#zone-banner {
  position: fixed;
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  opacity: 0;
  z-index: 4;          /* under the HUD's windows (the HUD is z-index 5) */
  text-shadow: 0 2px 8px #000, 0 0 2px #000;
}
#zone-banner.show { animation: zone-banner 3.2s ease-out forwards; }
@keyframes zone-banner {
  0% { opacity: 0; transform: translate(-50%, 10px); }
  15% { opacity: 1; transform: translate(-50%, 0); }
  75% { opacity: 1; }
  100% { opacity: 0; }
}
.zb-name { font-family: var(--serif); font-size: 46px; font-weight: 700; letter-spacing: 2px; color: #f8e7b4; }
.zb-sub {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 16px;
  font-style: italic;
  color: #ecdcb8;
}
.zb-sub::before, .zb-sub::after { content: ''; width: 46px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.zb-sub::after { transform: scaleX(-1); }
#player-list .where { color: var(--text-faint); font-size: 11px; font-style: italic; }

/* ---- Parties ---- */

#party-frame {
  position: relative;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--wood);
  font-size: 12px;
}
#party-frame .panel-title { display: flex; justify-content: space-between; align-items: center; }
#party-list { list-style: none; margin: 4px 0 0; padding: 0; }
#party-list li { padding: 4px 0; cursor: pointer; }
#party-list li + li { border-top: 1px solid rgba(255, 230, 180, 0.08); }
.pm-top { display: flex; justify-content: space-between; margin-bottom: 3px; }
.pm-name { font-weight: 700; color: #9dffb0; }
.pm-bar { height: 12px; }
.pm-bar .bar-text { font-size: 9px; }
.pm-away { color: var(--text-faint); font-style: italic; }

#invites {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 8;
}
.invite {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--wood-solid);
  border-color: var(--gold);
  font-size: 14px;
  font-weight: 600;
}
.invite-buttons { display: flex; gap: 6px; }
button.mini.secondary { background: rgba(255, 230, 180, 0.1); color: #e8dcc0; border-color: #5d4628; box-shadow: none; }

#player-menu {
  position: fixed;
  z-index: 15;
  min-width: 160px;
  padding: 6px;
  border-radius: 8px;
  background: var(--wood-solid);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#player-menu .menu-title { padding: 4px 8px 6px; font-family: var(--serif); font-weight: 700; font-size: 15px; color: #ffe9a8; }
#player-menu button {
  padding: 7px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #e8dcc0;
  text-align: left;
  font-size: 13px;
  cursor: pointer;
}
#player-menu button:hover { background: rgba(255, 220, 150, 0.1); }
#player-menu button.danger { color: #ff9b8f; }
#player-menu .hint { padding: 4px 8px; }
#player-list li[data-player] { cursor: pointer; }
#player-list li[data-player]:hover span:nth-child(2) { text-decoration: underline; }

/* ---- Trading ---- */

#trade { left: 50%; top: 64px; transform: translateX(-50%); width: min(500px, calc(100vw - 20px)); z-index: 7; }
.trade-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.trade-col { padding: 8px; border-radius: 7px; background: rgba(0, 0, 0, 0.28); border: 1px solid rgba(255, 230, 180, 0.06); }
.trade-col-title { display: flex; justify-content: space-between; font-family: var(--serif); font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.tick { font-family: var(--sans); font-size: 11px; color: #6b5d48; }
.tick.on { color: #6fdc5f; }
.trade-items { list-style: none; margin: 0 0 8px; padding: 0; min-height: 110px; display: flex; flex-direction: column; gap: 3px; }
.trade-items li {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 6px;
  align-items: center;
  padding: 3px 5px;
  border-radius: 5px;
  background: rgba(255, 230, 180, 0.05);
}
.trade-items li .icon { grid-row: span 2; width: 28px; height: 28px; }
.trade-items li small { grid-column: 2; color: var(--text-faint); font-size: 10px; }
.trade-items li .ti-remove { grid-row: 1 / span 2; grid-column: 3; border: 0; background: transparent; color: #ff9b8f; font-size: 16px; cursor: pointer; }
.trade-items li.empty-note { display: block; background: none; }
.trade-gold { display: flex; align-items: center; gap: 6px; color: var(--gold-bright); font-weight: 700; }
.trade-gold input {
  width: 90px;
  padding: 4px 6px;
  border-radius: 5px;
  border: 1px solid #5d4628;
  background: var(--wood-deep);
  color: var(--gold-bright);
  font-weight: 700;
}
.hint.small { font-size: 11px; margin: 6px 0 0; }
.trade-status { margin-top: 8px; color: #e6d9bb; text-align: center; min-height: 1.3em; }
#trade .dialog-buttons button:disabled { background: #3d3124; color: #7d6d58; border-color: #3d3124; box-shadow: none; cursor: default; }
.slot.offered { opacity: 0.4; outline: 2px dashed var(--gold-bright); outline-offset: -2px; }

.chat-log .party { color: #7fe3d0; }

/* ---- Mana, rarity ---- */

.mp-bar { height: 11px; }
.mp-bar .fill { background: linear-gradient(#7fb2ff, #2f5fd6); }
.mp-bar .bar-text { font-size: 9px; }
.slot.r1 { border-color: #4da6ff; box-shadow: inset 0 0 9px rgba(77, 166, 255, 0.45); }
.slot.r2 { border-color: #ff9d2e; box-shadow: inset 0 0 10px rgba(255, 157, 46, 0.5); }
.slot.r3 { border-color: #ff4f9a; box-shadow: inset 0 0 12px rgba(255, 79, 154, 0.6), 0 0 6px rgba(255, 79, 154, 0.45); }
.tt-bonus { color: #8fe0ff; font-weight: 700; }
.tt-bad { color: #ff8f84; font-weight: 700; }
.tt-req { color: #bba98a; }
.tt-set { color: #e7c36c; font-family: var(--serif); font-weight: 700; margin-top: 4px; }
.tt-setbonus { color: #7d6d58; font-size: 11px; }
.tt-setbonus.on { color: #8fe07a; }
.chat-log .legendary { color: #ff9d2e; font-weight: 700; }
.chat-log .mythic { color: #ff6fb0; font-weight: 800; text-shadow: 0 0 6px rgba(255, 79, 154, 0.6), 0 1px 2px #000; }

/* ---- Character window ---- */

#char { left: 288px; top: 46px; width: 404px; z-index: 6; }
#char .tabs { margin-bottom: 10px; }
#char .tab.has-points { color: #8fe07a; }
#char .tab .pts { color: #8fe07a; }
.paperdoll { display: grid; grid-template-columns: 64px 1fr 64px; gap: 8px; align-items: stretch; }
.pd-col { display: flex; flex-direction: column; gap: 6px; }
.pd-slot { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.pd-slot .slot { width: 50px; height: 50px; cursor: pointer; }
.pd-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  border-radius: 8px;
  background: radial-gradient(ellipse at 50% 70%, rgba(231, 195, 108, 0.16), rgba(0, 0, 0, 0.35) 70%);
  border: 1px solid rgba(231, 195, 108, 0.15);
  padding: 4px 0 6px;
}
.portrait { width: 100%; height: 232px; cursor: pointer; }
.pd-class { font-family: var(--serif); font-style: italic; color: var(--text-dim); font-size: 13px; }
.char-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 14px;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.28);
  font-size: 12px;
}
.cs-row { display: flex; justify-content: space-between; gap: 8px; color: var(--text-dim); }
.cs-row b { color: var(--text); font-weight: 700; text-align: right; }
.cs-row:last-child { grid-column: 1 / -1; }

/* ---- The guild hall row in the guild window ---- */
.g-hall { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin: 0 0 8px; padding: 7px 9px; border-radius: 7px; background: rgba(0, 0, 0, 0.22); }
.g-hall b { font-family: var(--serif); color: var(--gold-text); }
.g-hall small { color: var(--text-dim); }
.g-hall-buttons { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---- Inspecting another player (js/inspect.js) ---- */
#inspect { right: 300px; top: 70px; width: 404px; max-height: calc(100vh - 150px); overflow-y: auto; z-index: 8; }
#inspect .portrait { height: 210px; cursor: default; }
.in-sub { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 0 0 8px; color: var(--text-dim); font-size: 13px; }
.in-guild { color: #9be3c8; }
.in-title { color: var(--gold-text); font-style: italic; }
.in-profs { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 8px; color: var(--text-dim); font-size: 12px; }
.in-profs span { padding: 2px 7px; border-radius: 10px; background: rgba(0, 0, 0, 0.25); }
.char-sets { margin-top: 8px; padding: 6px 10px; border-radius: 7px; background: rgba(0, 0, 0, 0.2); font-size: 12px; }
.cs-set { font-family: var(--serif); font-weight: 700; font-size: 14px; margin-top: 2px; }

/* Skills */
.sk-head { display: flex; justify-content: space-between; align-items: baseline; }
.sk-tree { font-family: var(--serif); font-size: 18px; font-weight: 700; color: var(--gold-text); }
.sk-points { color: #8fe07a; font-weight: 700; }
.sk-tier { margin-top: 10px; }
.sk-tier.locked { opacity: 0.55; }
.sk-tier-name { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-faint); margin-bottom: 4px; }
.sk-nodes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sk-node {
  position: relative;
  padding: 7px 9px;
  border-radius: 7px;
  border: 1px solid #5d4628;
  background: linear-gradient(rgba(255, 230, 180, 0.06), rgba(0, 0, 0, 0.2));
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.sk-node:not(:disabled):hover { border-color: var(--gold); background: linear-gradient(rgba(255, 230, 180, 0.12), rgba(0, 0, 0, 0.2)); }
.sk-node:disabled { cursor: default; }
.sk-node.learned { border-color: #8a7a3a; }
.sk-node.maxed { border-color: var(--gold); box-shadow: inset 0 0 10px rgba(231, 195, 108, 0.25); }
.sk-name { font-family: var(--serif); font-weight: 700; font-size: 14px; color: var(--gold-text); }
.sk-rank { position: absolute; top: 7px; right: 9px; font-weight: 800; font-size: 12px; color: #8fe07a; }
.sk-node:not(.learned) .sk-rank { color: var(--text-faint); }
.sk-desc { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* ---- Class picker ---- */

#class-picker { z-index: 12; background: rgba(10, 7, 4, 0.72); overflow-y: auto; }
.cp-panel {
  margin: auto;
  padding: 22px 24px 24px;
  width: min(860px, 96vw);
  border-radius: 12px;
  border: 1px solid var(--trim);
  background: var(--wood);
  box-shadow: inset 0 0 0 2px var(--trim-soft), 0 20px 60px rgba(0, 0, 0, 0.6);
  text-align: center;
}
.cp-panel h2 { margin: 0; font-family: var(--serif); font-size: 32px; color: var(--gold-bright); letter-spacing: 1px; }
.cp-panel .sub { margin: 6px auto 16px; max-width: 560px; color: var(--text-dim); font-family: var(--serif); font-size: 15px; }
.cp-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.cp-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 14px 14px;
  border-radius: 10px;
  border: 1px solid #5d4628;
  background: radial-gradient(ellipse at 50% 25%, color-mix(in srgb, var(--cls) 22%, transparent), rgba(0, 0, 0, 0.3) 70%);
}
.cp-card:hover { border-color: var(--cls); }
.cp-portrait { width: 130px; height: 170px; }
.cp-name { font-family: var(--serif); font-size: 24px; font-weight: 700; color: var(--cls); }
.cp-role { font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-dim); }
.cp-desc { flex: 1; margin: 8px 0; font-size: 13px; line-height: 1.45; color: #e6d9bb; }
.cp-weapon { font-size: 12px; color: var(--text-faint); margin-bottom: 10px; }
.cp-card button {
  width: 100%;
  padding: 9px;
  border-radius: 6px;
  border: 1px solid #7a5a22;
  background: linear-gradient(#f4d886, #c99a3f);
  color: #2b1b08;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 2px 0 #4a3412;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}
.cp-card button:hover { background: linear-gradient(#fbe3a0, #d9ab50); }

/* The game's own "are you sure?" box (js/confirm.js), instead of the browser's pop-up. */
.confirm-overlay { z-index: 30; background: rgba(10, 7, 4, 0.5); backdrop-filter: blur(1px); }
.confirm-box {
  width: min(360px, calc(100vw - 32px));
  padding: 16px 18px 14px;
  border-radius: 10px;
  background: var(--wood-solid);
  border: 1px solid rgba(231, 195, 108, 0.45);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(0, 0, 0, 0.4);
  animation: confirm-in 0.12s ease-out;
}
.confirm-title { font-family: var(--serif); font-size: 19px; font-weight: 700; color: var(--gold-text); letter-spacing: 0.3px; }
.confirm-text { margin: 8px 0 0; color: var(--text-dim); font-size: 14px; line-height: 1.45; }
.confirm-box .dialog-buttons { margin-top: 16px; }
.confirm-box .dialog-buttons button:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
.confirm-box .dialog-buttons button.danger { background: linear-gradient(#a8372c, #7d2219); border-color: #4a120c; color: #fff1e6; }
@keyframes confirm-in { from { transform: scale(0.96); opacity: 0; } to { transform: none; opacity: 1; } }

/* The ability bar (js/hotbar.js): 1, 2, 3 */
#hotbar { position: absolute; left: 50%; bottom: 30px; transform: translateX(-50%); display: flex; gap: 8px; padding: 6px 8px;
  border-radius: 12px; background: rgba(24, 18, 12, 0.62); border: 1px solid rgba(122, 95, 54, 0.55); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); }
.hb-slot { position: relative; width: 52px; height: 52px; padding: 0; border-radius: 9px; border: 2px solid #7a5f36; background: #1c150f;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6); cursor: pointer; overflow: visible; }
.hb-slot img { width: 100%; height: 100%; border-radius: 7px; display: block; }
.hb-slot:hover { border-color: var(--gold); }
.hb-slot.used { animation: hb-pop 0.25s ease-out; }
@keyframes hb-pop { 0% { transform: scale(0.9); } 60% { transform: scale(1.08); } 100% { transform: none; } }
.hb-cd { position: absolute; inset: 0; border-radius: 7px; pointer-events: none;
  background: conic-gradient(rgba(10, 7, 4, 0.72) var(--p, 0%), transparent 0); }
.hb-cd-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none;
  font-weight: 800; font-size: 15px; color: #fff; text-shadow: 0 1px 3px #000, 0 0 2px #000; }
.hb-key { position: absolute; left: 3px; top: 1px; font-size: 11px; font-weight: 800; color: var(--gold-bright); text-shadow: 0 1px 2px #000; pointer-events: none; }
.hb-mana { position: absolute; right: 3px; bottom: 1px; font-size: 10.5px; font-weight: 800; color: #8fc4ff; text-shadow: 0 1px 2px #000; pointer-events: none; }
.hb-slot.nomana img { filter: saturate(0.3) brightness(0.65); }
.hb-slot.nomana .hb-mana { color: #ff8f84; }
.hb-lock { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; border-radius: 7px; pointer-events: none;
  background: rgba(10, 7, 4, 0.66); font-size: 11.5px; font-weight: 800; color: #e8dcc0; text-shadow: 0 1px 2px #000; }
.hb-slot.locked .hb-lock { display: flex; }
.hb-slot.locked img { filter: grayscale(1) brightness(0.6); }
.hb-tip { display: none; position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); width: 240px; padding: 8px 10px;
  border-radius: 8px; background: var(--wood-solid); border: 1px solid rgba(231, 195, 108, 0.5); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  text-align: left; pointer-events: none; z-index: 20; }
.hb-slot:hover .hb-tip { display: block; }
.hb-tip-name { font-family: var(--serif); font-size: 15px; font-weight: 700; color: var(--gold-text); }
.hb-tip-meta { margin-top: 2px; font-size: 11.5px; color: #a9d6ff; }
.hb-tip-desc { margin-top: 5px; font-size: 12.5px; line-height: 1.4; color: var(--text); }

/* World announcements and the boss health bar */
#announce { position: fixed; left: 50%; top: 92px; transform: translateX(-50%); z-index: 9; max-width: min(720px, calc(100vw - 40px));
  padding: 10px 22px; border-radius: 10px; background: linear-gradient(rgba(60, 14, 8, 0.9), rgba(30, 8, 4, 0.9));
  border: 1px solid #ff8a3d; color: #ffd9b0; font-family: var(--serif); font-size: 19px; font-weight: 700; text-align: center;
  text-shadow: 0 1px 3px #000; box-shadow: 0 0 30px rgba(255, 90, 30, 0.35); opacity: 0; pointer-events: none; }
#announce.show { animation: announce 6s ease forwards; }
@keyframes announce { 0% { opacity: 0; transform: translate(-50%, -10px); } 8% { opacity: 1; transform: translate(-50%, 0); } 85% { opacity: 1; } 100% { opacity: 0; } }
#boss-bar { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); width: min(520px, calc(100vw - 600px)); min-width: 280px; text-align: center; pointer-events: none; }
.bb-name { font-family: var(--serif); font-size: 16px; font-weight: 700; color: #ffd9b0; text-shadow: 0 1px 3px #000, 0 0 8px rgba(255, 90, 30, 0.6); margin-bottom: 4px; }
.bb-track { position: relative; height: 16px; border-radius: 8px; overflow: hidden; background: rgba(20, 8, 6, 0.85); border: 1px solid #a0352a; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); }
.bb-fill { height: 100%; background: linear-gradient(#ff7a4a, #b8221a); transition: width 0.15s; }
.bb-text { position: absolute; inset: 0; font-size: 11px; font-weight: 800; line-height: 16px; color: #fff; text-shadow: 0 1px 2px #000; }

/* ---- Character screen (js/charselect.js) ---- */

.cs-panel { width: min(860px, 94vw); padding: 18px 22px 14px; }
.cs-head h2 { font-size: 26px; }
.cs-head .sub { margin-bottom: 12px; }
.cs-account { color: var(--gold-text); font-weight: 700; }
.cs-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.panel .cs-card {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-height: 214px; padding: 8px 6px 10px; border-radius: 8px;
  border: 1px solid #4d3a22; background: linear-gradient(180deg, rgba(60, 46, 31, 0.9), rgba(26, 20, 14, 0.95));
  color: var(--text); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4); font-family: var(--sans); font-weight: 400;
}
.panel .cs-card:hover { background: linear-gradient(180deg, rgba(78, 60, 40, 0.95), rgba(32, 25, 17, 0.95)); border-color: var(--trim); }
.panel .cs-card.selected {
  border-color: var(--gold-bright);
  box-shadow: inset 0 0 0 1px rgba(255, 216, 119, 0.55), 0 0 14px rgba(255, 210, 110, 0.25);
  background: linear-gradient(180deg, rgba(94, 72, 40, 0.95), rgba(40, 30, 18, 0.95));
}
.cs-portrait { width: 100%; height: 118px; }
.cs-name { font-family: var(--serif); font-size: 17px; text-shadow: 0 1px 2px #000; overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
.cs-line { font-size: 13px; color: var(--text); }
.cs-zone, .cs-time { font-size: 12px; color: var(--text-dim); }
.cs-time { color: var(--text-faint); }
.panel .cs-empty { justify-content: center; color: var(--text-faint); border-style: dashed; background: rgba(20, 15, 10, 0.55); font-size: 14px; }
.panel .cs-empty:hover { color: var(--gold-text); }
.cs-plus { font-size: 40px; line-height: 1; font-family: var(--serif); }
.cs-actions { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }
.panel .cs-play { width: auto; min-width: 220px; padding: 11px 28px; font-size: 17px; }
.panel .cs-delete {
  width: auto; padding: 11px 18px; background: linear-gradient(#5a3a2a, #3d271b); color: #f0c4b2;
  border-color: #7a3f2a; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 2px 0 #24150c; font-size: 15px;
}
.panel .cs-delete:hover { background: linear-gradient(#74402c, #4a2a1c); }
.cs-name-row { display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }
.cs-name-row input { width: 240px; margin: 0; }
.cs-colors { display: grid; grid-template-columns: repeat(7, 22px); gap: 5px; }
.panel .cs-color { width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 2px solid rgba(0, 0, 0, 0.55); box-shadow: none; }
.panel .cs-color:hover { transform: scale(1.12); }
.panel .cs-color.selected { border-color: #fff; box-shadow: 0 0 0 2px rgba(255, 216, 119, 0.8); }
.cs-classes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.panel .cs-class {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 10px 12px; border-radius: 8px;
  border: 1px solid #4d3a22; background: rgba(26, 20, 14, 0.9); color: var(--text); font-family: var(--sans); font-weight: 400;
  box-shadow: none;
}
.panel .cs-class:hover { border-color: var(--trim); background: rgba(52, 40, 27, 0.95); }
.panel .cs-class.selected { border-color: var(--gold-bright); background: rgba(70, 54, 32, 0.95); box-shadow: 0 0 12px rgba(255, 210, 110, 0.22); }
.cs-class-portrait { width: 110px; height: 132px; }
.cs-class strong { font-family: var(--serif); font-size: 20px; }
.cs-role { font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--text-dim); }
.cs-desc { font-size: 12.5px; line-height: 1.35; color: var(--text-dim); }
@media (max-width: 760px) {
  .cs-cards { grid-template-columns: repeat(3, 1fr); }
  .cs-classes { grid-template-columns: 1fr; }
}

/* ---- Orla's vault and Brakk's smithy (js/town.js) ---- */

#bank { right: 282px; bottom: 40px; width: 404px; }
#smith { right: 282px; bottom: 40px; width: 360px; }
.bank-grid { display: grid; grid-template-columns: repeat(8, 44px); gap: 3px; justify-content: center; }
.vault-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--gold-bright); font-weight: 700; }
.vault-row > span:first-child { flex: 1; white-space: nowrap; }
.vault-row .coin, .needs .coin { width: 14px; height: 14px; vertical-align: -2px; }
.gold-input {
  width: 82px; padding: 4px 6px; border-radius: 5px; border: 1px solid #5d4628; background: var(--wood-deep);
  color: var(--text); font-size: 13px;
}
.smith-body { display: flex; flex-direction: column; gap: 4px; max-height: 330px; overflow-y: auto; }
.needs { display: flex; flex-wrap: wrap; gap: 3px 9px; margin-top: 2px; font-size: 12px; color: var(--green); }
.need { display: inline-flex; align-items: center; gap: 2px; }
.need .icon { width: 20px; height: 20px; }
.need.short { color: #ff8f7f; }
.smith-hint { margin: 2px 0 4px; color: var(--text-dim); font-size: 12px; }
.worn-row { display: flex; gap: 3px; justify-content: center; margin-bottom: 6px; }
.slot.small { width: 36px; height: 36px; }
.slot.small .icon { width: 28px; height: 28px; }
.slot.picked { outline: 2px solid var(--gold-bright); outline-offset: 1px; }
.reforge-card { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 7px; background: rgba(0, 0, 0, 0.25); }
.rf-name { font-family: var(--serif); font-size: 16px; font-weight: 700; }
.reforge-card small { color: var(--text-dim); }
.rf-to { margin: 6px 2px 2px; color: var(--text); }
button.mini.rf-go { margin-top: 8px; padding: 7px 10px; font-size: 14px; }

/* ---- Sound button ---- */
#sound-btn { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 20px; margin-left: 2px; padding: 0;
  border: 0; border-radius: 4px; background: transparent; color: var(--gold-text); cursor: pointer; }
#sound-btn:hover { background: rgba(255, 230, 180, 0.12); }
#sound-btn.off { color: var(--text-faint); }
#sound-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 3; display: flex; flex-direction: column; gap: 6px; padding: 8px 10px;
  border-radius: 7px; background: var(--wood-solid); border: 1px solid var(--trim); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45); font-size: 12px; white-space: nowrap; }
#sound-pop label { display: flex; align-items: center; gap: 8px; color: var(--text); }
#sound-pop input[type=range] { width: 120px; accent-color: var(--gold); }
#sound-pop .mute input { accent-color: var(--gold); }

/* ---- Minimap and world map (js/maps.js) ---- */
#minimap { padding: 5px 5px 3px; border-radius: 9px; background: var(--wood-glass); border: 1px solid var(--trim);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5), 0 8px 20px rgba(0, 0, 0, 0.4); }
.mini-canvas { display: block; width: 184px; height: 138px; border-radius: 6px; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6); }
.mini-foot { display: flex; justify-content: space-between; align-items: center; padding: 3px 3px 0; font-family: var(--serif); font-size: 13px; font-weight: 700; color: var(--gold-text); }
.mini-foot kbd { font: 700 10px var(--sans); padding: 1px 5px; border-radius: 3px; background: rgba(0, 0, 0, 0.35); color: var(--text-dim); border: 1px solid #5d4628; }
#worldmap { left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 8; width: auto; max-width: calc(100vw - 20px); }
.wm-chain { display: flex; align-items: stretch; gap: 6px; margin-bottom: 10px; }
.wm-zone { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 7px 10px; border-radius: 7px; cursor: pointer;
  border: 1px solid #4d3a22; color: var(--text); text-align: left; font: 12px var(--sans); }
.wm-zone strong { font: 700 15px var(--serif); color: var(--gold-text); }
.wm-zone em { font-size: 11px; color: var(--text-dim); }
.wm-zone.theme-meadow { background: linear-gradient(135deg, rgba(70, 110, 50, 0.55), rgba(25, 20, 14, 0.9)); }
.wm-zone.theme-dark { background: linear-gradient(135deg, rgba(40, 80, 70, 0.55), rgba(15, 18, 16, 0.92)); }
.wm-zone.theme-volcanic { background: linear-gradient(135deg, rgba(140, 50, 20, 0.55), rgba(25, 14, 10, 0.92)); }
.wm-zone.theme-desert { background: linear-gradient(135deg, rgba(210, 160, 80, 0.5), rgba(30, 20, 10, 0.92)); }
.wm-zone.theme-coast { background: linear-gradient(135deg, rgba(40, 170, 180, 0.5), rgba(10, 24, 26, 0.92)); }
.wm-zone.theme-void { background: linear-gradient(135deg, rgba(150, 70, 230, 0.5), rgba(16, 8, 24, 0.94)); }
.wm-zone.theme-citadel { background: linear-gradient(135deg, rgba(120, 50, 200, 0.55), rgba(10, 6, 16, 0.95)); }
.wm-zone.theme-arena { background: linear-gradient(135deg, rgba(170, 120, 60, 0.5), rgba(28, 18, 10, 0.92)); }
.wm-zone.theme-crypt { background: linear-gradient(135deg, rgba(110, 80, 150, 0.45), rgba(16, 12, 20, 0.92)); }
.wm-sep { width: 1px; margin: 4px 6px; background: rgba(231, 195, 108, 0.3); }
.wm-zone.theme-frost { background: linear-gradient(135deg, rgba(120, 170, 220, 0.5), rgba(14, 20, 28, 0.92)); }
.wm-zone.active { border-color: var(--gold-bright); box-shadow: 0 0 10px rgba(255, 210, 110, 0.25); }
.wm-zone.here em { color: #9fe08f; }
.wm-zone.unknown { opacity: 0.7; }
.wm-link { display: flex; flex-direction: column; align-items: center; justify-content: center; color: #c58cff; font-size: 18px; }
.wm-link small { font-size: 10px; color: var(--text-dim); }
.wm-main { display: flex; gap: 12px; }
.wm-canvas { display: block; border-radius: 6px; }
.wm-info { width: 230px; font-size: 13px; max-height: 420px; overflow-y: auto; }
.wm-info h3 { margin: 0; font: 700 20px var(--serif); color: var(--gold-bright); }
.wm-levels { margin: 2px 0 6px; color: var(--green); font-weight: 700; }
.wm-blurb { margin: 0 0 8px; color: var(--text-dim); font-family: var(--serif); font-style: italic; line-height: 1.4; }
.wm-sub { margin: 6px 0 2px; font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text-faint); }
.wm-monsters { list-style: none; margin: 0 0 8px; padding: 0; }
.wm-monsters li { display: flex; justify-content: space-between; padding: 1px 0; }
.wm-monsters .lv { color: #a9d6ff; }
.wm-monsters li.easy { opacity: 0.6; }
.wm-monsters li.hard .lv { color: #ffc46b; }
.wm-monsters li.deadly .lv { color: #ff7a6a; }
.wm-boss { display: flex; flex-direction: column; gap: 2px; margin: 8px 0; padding: 7px 9px; border-radius: 7px; background: rgba(90, 30, 20, 0.45); border: 1px solid #7a3326; }
.wm-boss strong { color: #ffb08a; font-family: var(--serif); }
.wm-boss span { color: var(--text-dim); font-size: 12px; }
.wm-boss.awake { background: rgba(160, 40, 20, 0.55); border-color: #ff6a3a; animation: boss-pulse 1.6s ease-in-out infinite; }
.wm-boss.awake span { color: #ffd2b8; }
@keyframes boss-pulse { 50% { box-shadow: 0 0 14px rgba(255, 90, 40, 0.55); } }
.wm-legend { margin: 8px 0 0; color: var(--text-faint); font-size: 11px; line-height: 1.8; }
.wm-legend .lg { display: inline-block; width: 8px; height: 8px; margin: 0 3px 0 0; border-radius: 50%; vertical-align: 0; }
.lg.you { background: #ffd877; } .lg.party { background: #6cff7a; } .lg.player { background: #f4f1e8; }
.lg.ore { background: #d9cdb8; border-radius: 1px; transform: rotate(45deg) scale(0.8); } .lg.herb { background: #8be36f; border-radius: 1px; transform: rotate(45deg) scale(0.8); }
.lg.npc { background: #ffd94a; } .lg.mob { background: #e8473a; } .lg.portal { background: #c58cff; border-radius: 1px; transform: rotate(45deg); }

/* ---- Guilds (js/guild.js) ---- */

#guild { left: 50%; top: 80px; transform: translateX(-50%); width: 560px; max-width: calc(100vw - 20px); z-index: 8; }
#guild input[type="text"] {
  flex: 1; min-width: 0; padding: 5px 8px; border-radius: 5px; border: 1px solid #5d4628; background: var(--wood-deep);
  color: var(--text); font-size: 13px;
}
.g-found, .g-motd, .g-invite { display: flex; gap: 6px; align-items: center; margin: 6px 0 8px; }
#guild .g-tag-input { flex: 0 0 64px; text-transform: uppercase; }
.g-count { margin: 4px 0; color: var(--text-dim); font-size: 12px; }
.g-list { max-height: 300px; overflow-y: auto; border-radius: 6px; background: rgba(0, 0, 0, 0.22); border: 1px solid rgba(122, 95, 54, 0.4); }
.g-list table { width: 100%; border-collapse: collapse; font-size: 13px; }
.g-list td { padding: 4px 8px; border-bottom: 1px solid rgba(122, 95, 54, 0.22); white-space: nowrap; }
.g-list tr.off td { color: var(--text-faint); }
.g-dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: #5a5046; vertical-align: 1px; }
.g-dot.on { background: #6fe36a; box-shadow: 0 0 5px #6fe36a; }
.g-rank.leader { color: var(--gold-bright); font-weight: 700; }
.g-rank.officer { color: #8fd3ff; }
.g-where { color: var(--text-dim); font-size: 12px; }
.g-acts { text-align: right; }
.g-acts button { margin-left: 3px; padding: 2px 7px; font-size: 11px; }
#guild .win-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
#guild .win-foot .hint { color: var(--text-faint); font-size: 12px; }
button.mini.danger { background: linear-gradient(#a8372c, #7d2219); border-color: #4a120c; color: #fff1e6; }
.gtag { color: #8fd3ff; font-weight: 700; font-size: 11px; }
#players-panel .panel-title { display: flex; align-items: center; gap: 6px; }
#friends-btn { margin-left: auto; }
.invite.guild { border-color: #8fd3ff; }
.invite.duel { border-color: #ff8a7a; }
.bank-grid.locked .slot { cursor: not-allowed; }

/* ---- Duels and the arena (js/pvp.js) ---- */

#arena-board {
  width: 236px; padding: 7px 12px 9px; border-radius: 8px; background: var(--wood-glass);
  border: 1px solid rgba(200, 80, 50, 0.55); font-size: 13px;
}
#arena-board .panel-title { color: #ffb08a; }
.ab-help { margin: 2px 0 6px; color: var(--text-dim); font-size: 11.5px; line-height: 1.35; }
.ab-me { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 6px; color: var(--text-dim); font-size: 12px; }
.ab-me b { color: #ffd9b0; }
.ab-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ab-table th { text-align: left; color: var(--text-faint); font-weight: 600; font-size: 11px; padding-bottom: 2px; }
.ab-table td { padding: 1px 3px; }
.ab-rank { color: var(--text-faint); width: 16px; }
.ab-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ab-k { color: #9be38a; text-align: right; font-weight: 700; }
.ab-d { color: #ff9c8f; text-align: right; }
.ab-table th:nth-child(3), .ab-table th:nth-child(4) { text-align: right; }

#duel-bar {
  position: absolute; left: 50%; top: 52px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
  padding: 5px 8px 5px 14px; border-radius: 18px; background: rgba(40, 12, 8, 0.85); border: 1px solid #c0503a;
  color: #ffd9b0; font-family: var(--serif); font-weight: 700; font-size: 14px; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}
#duel-count {
  position: absolute; left: 50%; top: 30%; transform: translate(-50%, -50%); pointer-events: none; opacity: 0;
  font-family: var(--serif); font-size: 72px; font-weight: 800; color: #ffe9a8;
  text-shadow: 0 3px 0 #3a1a08, 0 0 26px rgba(255, 140, 60, 0.7);
}
#duel-count.show { animation: duel-pop 1.1s ease forwards; }
#duel-count.fight { color: #ff8a5a; }
#duel-count.won, #duel-count.lost, #duel-count.draw { animation-duration: 2.4s; font-size: 60px; }
#duel-count.won { color: #ffd23f; }
#duel-count.lost { color: #c9b7a8; }
@keyframes duel-pop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(1.6); }
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
}
.wm-chain { flex-wrap: wrap; }

/* ---- Friends (js/friends.js) ---- */

#friends { left: 50%; top: 90px; transform: translateX(-50%); width: 520px; max-width: calc(100vw - 20px); z-index: 8; }
#friends input[type="text"] {
  flex: 1; min-width: 0; padding: 5px 8px; border-radius: 5px; border: 1px solid #5d4628; background: var(--wood-deep);
  color: var(--text); font-size: 13px;
}
.f-add { display: flex; gap: 6px; align-items: center; margin: 2px 0 8px; }
#friends .win-foot { margin-top: 8px; }
#friends .win-foot .hint { color: var(--text-faint); font-size: 12px; }
#player-menu button.danger { color: #ff9b8f; }

/* ---- Vessa's bounties (js/bounties.js) ---- */

#bounties { left: 50%; top: 90px; transform: translateX(-50%); width: 500px; max-width: calc(100vw - 20px); z-index: 8; }
.b-list { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 8px; }
.bounty { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; background: rgba(0, 0, 0, 0.22); border: 1px solid rgba(122, 95, 54, 0.45); }
.bounty.ready { border-color: var(--gold); box-shadow: inset 0 0 0 1px rgba(231, 195, 108, 0.25); }
.bounty.claimed { opacity: 0.6; }
.b-main { flex: 1; min-width: 0; }
.b-text { font-weight: 700; color: var(--gold-text); }
.b-sub { font-size: 12px; color: var(--text-dim); margin: 1px 0 4px; }
.b-bar { height: 6px; border-radius: 3px; background: rgba(0, 0, 0, 0.4); overflow: hidden; }
.b-fill { height: 100%; background: linear-gradient(90deg, #b8862a, #ffd86a); }
.b-side { flex: 0 0 auto; }
.b-done { color: #8fe07a; font-weight: 700; font-size: 13px; }
#bounties .win-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12px; }
.b-bonus { color: var(--text-dim); }
#bounties .win-foot .hint { color: var(--text-faint); white-space: nowrap; }
#quest-list .bounty-line .q-name { color: #e0b040; }

/* ---- Pip's Trading Post (js/post.js) ---- */

#post { right: 282px; bottom: 40px; width: 470px; max-width: calc(100vw - 300px); z-index: 7; }
#post .tabs { margin-bottom: 8px; }
.post-body { display: flex; flex-direction: column; gap: 8px; }
.post-body h4 { margin: 4px 0 0; font: 700 13px var(--serif); color: var(--gold-text); }
.post-body input[type="text"], .post-body textarea, .post-body select {
  padding: 5px 8px; border-radius: 5px; border: 1px solid #5d4628; background: var(--wood-deep); color: var(--text); font-size: 13px;
}
.post-body textarea { resize: vertical; font-family: inherit; }
.mk-search { display: flex; gap: 6px; }
.mk-search input { flex: 1; min-width: 0; }
.mk-list { display: flex; flex-direction: column; gap: 3px; max-height: 300px; overflow-y: auto; }
.mk-list.short { max-height: 170px; }
.mk-row, .ml-row { display: flex; align-items: center; gap: 8px; padding: 3px 6px; border-radius: 6px; background: rgba(0, 0, 0, 0.2); }
.mk-row .slot, .ml-row .slot, .mk-sell .slot { width: 36px; height: 36px; flex: 0 0 auto; }
.mk-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; }
.mk-name small { display: block; font-weight: 400; color: var(--text-dim); font-size: 11.5px; }
.mk-price { color: var(--gold-bright); font-weight: 700; white-space: nowrap; font-size: 13px; }
.mk-price .coin { width: 13px; height: 13px; vertical-align: -2px; }
.mk-mine { color: var(--text-faint); font-size: 12px; font-style: italic; }
.mk-pages { display: flex; justify-content: space-between; }
.mk-sell { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 7px; background: rgba(0, 0, 0, 0.22); border: 1px solid rgba(122, 95, 54, 0.45); }
.mk-sell label { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-dim); }
.mk-sell .gold-input { width: 76px; }
.mk-fee { color: var(--text-dim); }
.empty-slot { border-style: dashed !important; opacity: 0.6; }
.ml-row { cursor: pointer; }
.ml-row.unread .mk-name > div { color: #ffe9a8; }
.ml-row.unread { box-shadow: inset 3px 0 0 #e0b040; }
.ml-row.open { background: rgba(231, 195, 108, 0.12); }
.ml-icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--text-dim); }
.ml-icon .coin { width: 22px; height: 22px; }
.ml-letter { padding: 8px 10px; border-radius: 7px; background: #e8dcc0; color: #3a2a16; }
.ml-letter p { margin: 6px 0; white-space: pre-wrap; font-family: var(--serif); }
.ml-head { display: flex; justify-content: space-between; gap: 8px; }
.ml-head small { color: #6a5a40; }
.ml-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.ml-letter button.mini.secondary { background: rgba(107, 74, 30, 0.12); color: #4a3420; border-color: #a58550; }
.ml-write { display: flex; flex-direction: column; gap: 5px; }
#post .win-foot { display: flex; justify-content: space-between; align-items: center; }
#post .win-foot .hint { color: var(--text-faint); font-size: 12px; }

/* ---- Professions (js/professions.js) ---- */

#profs { left: 50%; top: 70px; transform: translateX(-50%); width: 560px; max-width: calc(100vw - 20px); max-height: calc(100vh - 150px); display: flex; flex-direction: column; z-index: 8; }
#profs .tabs { margin-bottom: 8px; }
.pr-body { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.pr-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pr-three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
#castbar.fishing .cb-fill { background: linear-gradient(90deg, #3a7ab0, #6fc0e8); }
#castbar.bite { animation: bite-pulse 0.35s ease-in-out infinite alternate; }
#castbar.bite .cb-fill { background: #e0483c !important; transition: none !important; width: 100% !important; }
@keyframes bite-pulse { from { transform: translateX(-50%) scale(1); } to { transform: translateX(-50%) scale(1.08); } }
.pr-skill { padding: 6px 8px; border-radius: 7px; background: rgba(0, 0, 0, 0.22); display: flex; flex-direction: column; gap: 4px; }
.pr-skill-head { display: flex; justify-content: space-between; font-size: 13px; }
.pr-skill-head b { font-family: var(--serif); color: var(--gold-text); }
.pr-skill small { color: var(--text-dim); font-size: 11.5px; }
.pr-note { margin: 0; color: var(--text-dim); font-size: 12px; }
.pr-tiers { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.pr-tiers th { text-align: left; color: var(--text-faint); font-weight: 600; padding: 2px 6px; }
.pr-tiers td { padding: 3px 6px; border-top: 1px solid rgba(122, 95, 54, 0.3); }
.pr-mat { display: flex; align-items: center; gap: 6px; }
.pr-mat img { width: 22px; height: 22px; }
.pr-mat small { color: var(--text-faint); margin-left: auto; }
.pr-legend { margin: 0; display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; }
.pr-list { overflow-y: auto; max-height: 420px; display: flex; flex-direction: column; gap: 4px; }
.pr-tier-head { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 4px 8px; border-radius: 6px; border: 1px solid rgba(122, 95, 54, 0.4); background: rgba(0, 0, 0, 0.25); color: var(--gold-text); font: 700 13px var(--serif); cursor: pointer; }
.pr-tier-head small { color: var(--text-faint); font: 400 11.5px var(--sans, inherit); }
.pr-recipes { display: flex; flex-direction: column; gap: 3px; padding: 4px 0 2px; }
.pr-recipe { display: flex; align-items: center; gap: 8px; padding: 3px 6px; border-radius: 6px; background: rgba(0, 0, 0, 0.18); }
.pr-recipe.locked { opacity: 0.6; }
.pr-recipe .slot { width: 36px; height: 36px; flex: 0 0 auto; }
.pr-r-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pr-r-name { font-size: 13px; font-weight: 700; }
.pr-r-main small { color: var(--text-faint); font-size: 11px; }
.pr-needs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11.5px; color: var(--text-dim); }
.pr-need { display: inline-flex; align-items: center; gap: 2px; }
.pr-need img { width: 16px; height: 16px; }
.pr-need.short { color: #e0605a; }
.pr-r-side { display: flex; align-items: center; gap: 5px; }
.pr-times { width: 44px !important; }
#profs .win-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
#profs .win-foot .hint { color: var(--text-faint); }
#profs .win-foot .hint.warn { color: #e9a23b; }
.pr-only { display: flex; align-items: center; gap: 4px; color: var(--text-dim); cursor: pointer; }

#castbar { position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%); width: 240px; height: 20px; border-radius: 6px; background: rgba(20, 14, 8, 0.85); border: 1px solid #7a5f36; overflow: hidden; pointer-events: none; }
#castbar .cb-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #8a6a2a, #e8c25a); }
#castbar .cb-text { position: relative; display: block; text-align: center; font-size: 12px; line-height: 20px; color: #fff4d6; text-shadow: 0 1px 2px #000; }

#buffbar { position: relative; margin: -3px 0 -3px 2px; display: flex; gap: 5px; pointer-events: auto; }
#buffbar:empty { display: none; }
#buffbar .buff { width: 34px; display: flex; flex-direction: column; align-items: center; border-radius: 6px; background: rgba(20, 14, 8, 0.75); border: 1px solid #7a5f36; padding: 2px 0 1px; }
#buffbar .buff img { width: 26px; height: 26px; }
#buffbar .buff span { font-size: 10px; color: #f3e6c4; line-height: 1.1; }

/* ---- Achievements (js/achievements.js) ---- */

#achievements { left: 50%; top: 70px; transform: translateX(-50%); width: 600px; max-width: calc(100vw - 20px); max-height: calc(100vh - 150px); display: flex; flex-direction: column; z-index: 8; }
.ach-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 13px; }
.ach-top b { color: var(--gold-bright); font-family: var(--serif); font-size: 15px; }
.ach-top small { color: var(--text-dim); }
.ach-top select { padding: 3px 6px; border-radius: 5px; border: 1px solid #5d4628; background: var(--wood-deep); color: var(--text); }
.ach-wrap { display: flex; gap: 10px; min-height: 0; }
.ach-cats { display: flex; flex-direction: column; gap: 3px; width: 140px; flex: 0 0 auto; }
.ach-cat { display: flex; justify-content: space-between; align-items: center; padding: 5px 8px; border-radius: 6px; border: 1px solid rgba(122, 95, 54, 0.35); background: rgba(0, 0, 0, 0.2); color: var(--text); font-size: 12.5px; cursor: pointer; text-align: left; }
.ach-cat small { color: var(--text-faint); }
.ach-cat.active { background: rgba(231, 195, 108, 0.16); border-color: #b8862a; color: var(--gold-text); }
.ach-list { flex: 1; overflow-y: auto; max-height: 440px; display: flex; flex-direction: column; gap: 4px; }
.ach { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 7px; background: rgba(0, 0, 0, 0.2); opacity: 0.85; }
.ach.got { opacity: 1; background: rgba(231, 195, 108, 0.1); box-shadow: inset 3px 0 0 #e0b040; }
.ach-badge { font-size: 22px; color: #6d5a3a; width: 24px; text-align: center; }
.ach.got .ach-badge { color: #ffd86a; text-shadow: 0 0 8px rgba(255, 216, 106, 0.6); }
.ach-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ach-name { font-weight: 700; font-size: 13.5px; }
.ach-title { color: #f2cf6b; font-weight: 400; font-style: italic; font-size: 12px; }
.ach-text { color: var(--text-dim); font-size: 12px; }
.ach-main small { color: var(--text-faint); font-size: 11px; }
.ach-pts { min-width: 30px; text-align: center; font: 700 14px var(--serif); color: var(--gold-text); }

#ach-toasts { position: absolute; top: 160px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; pointer-events: none; z-index: 20; }
.ach-toast { min-width: 280px; padding: 8px 16px; border-radius: 9px; text-align: center; background: linear-gradient(180deg, rgba(58, 40, 18, 0.95), rgba(30, 20, 8, 0.95)); border: 1px solid #e0b040; box-shadow: 0 0 18px rgba(255, 200, 80, 0.35); animation: ach-in 0.35s ease-out; transition: opacity 0.5s, transform 0.5s; }
.ach-toast.out { opacity: 0; transform: translateY(-10px); }
.ach-t-head { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: #ffd86a; }
.ach-t-name { font: 700 17px var(--serif); color: #fff3cf; }
.ach-t-text { font-size: 12px; color: #e8dcc0; }
@keyframes ach-in { from { opacity: 0; transform: translateY(-14px) scale(0.96); } to { opacity: 1; transform: none; } }

/* ---- World events banner ---- */

#event-bars { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 4px; align-items: center; pointer-events: none; z-index: 6; }
.event-bar { padding: 4px 14px; border-radius: 16px; font-size: 12.5px; color: #fff3d6; background: rgba(30, 20, 10, 0.85); border: 1px solid #b8862a; text-shadow: 0 1px 2px #000; white-space: nowrap; }
.event-bar b { color: #ffd86a; }
.event-bar.ev-invasion { border-color: #d0503a; box-shadow: 0 0 12px rgba(220, 70, 50, 0.35); }
.event-bar.ev-invasion b { color: #ff9a7a; }
.event-bar.ev-treasure { border-color: #e0b040; }
.event-bar.ev-bonus { border-color: #7ad06a; }
.event-bar.ev-bonus b { color: #a8f08a; }
.ev-icon { margin-right: 6px; }

/* ---- Housing (js/housing.js) ---- */

#housing { left: 50%; top: 70px; transform: translateX(-50%); width: 560px; max-width: calc(100vw - 20px); max-height: calc(100vh - 150px); display: flex; flex-direction: column; z-index: 8; }
.hs-body { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 0; }
.hs-body h4 { margin: 4px 0 0; font: 700 13px var(--serif); color: var(--gold-text); }
.hs-sizes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hs-size { display: flex; flex-direction: column; gap: 4px; align-items: center; padding: 8px; border-radius: 8px; background: rgba(0, 0, 0, 0.22); border: 1px solid rgba(122, 95, 54, 0.45); text-align: center; }
.hs-size b { font-family: var(--serif); color: var(--gold-text); font-size: 15px; }
.hs-size small { color: var(--text-dim); font-size: 11.5px; }
.hs-mine { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px; border-radius: 7px; background: rgba(231, 195, 108, 0.1); }
.hs-mine b { font-family: var(--serif); color: var(--gold-text); }
.hs-mine small { color: var(--text-dim); }
.hs-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-dim); }
.hs-row > span { flex: 1; }
.hs-row input, .hs-row select { padding: 4px 7px; border-radius: 5px; border: 1px solid #5d4628; background: var(--wood-deep); color: var(--text); font-size: 12.5px; }
.hs-row input { width: 140px; }
.hs-shop { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.hs-item { display: flex; align-items: center; gap: 6px; padding: 3px 5px; border-radius: 6px; background: rgba(0, 0, 0, 0.18); }
.hs-item.locked { opacity: 0.55; }
.hs-item .slot { width: 32px; height: 32px; flex: 0 0 auto; }
.hs-name { flex: 1; min-width: 0; font-size: 11.5px; line-height: 1.15; }
.hs-item button { white-space: nowrap; padding: 2px 6px; }
.hs-item .coin { width: 12px; height: 12px; vertical-align: -2px; }

#house-bar { position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; max-width: min(640px, calc(100vw - 20px)); padding: 6px 12px; border-radius: 10px; background: rgba(30, 20, 10, 0.88); border: 1px solid #7a5f36; font-size: 12.5px; color: var(--text); z-index: 6; }
#house-bar b { font-family: var(--serif); color: var(--gold-text); }
#house-bar small { color: var(--text-dim); }
.hb-row { display: flex; align-items: center; gap: 8px; }
.hb-hint { color: #f0e0b0; }

/* ---- Settings (js/settings.js) ---- */

#settings-btn { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 20px; padding: 0;
  border: 0; border-radius: 4px; background: transparent; color: var(--gold-text); cursor: pointer; font-size: 15px; line-height: 1; }
#settings-btn:hover { background: rgba(255, 230, 180, 0.12); }
#settings { left: 50%; top: 70px; transform: translateX(-50%); width: 560px; max-width: calc(100vw - 20px); max-height: calc(100vh - 140px); display: flex; flex-direction: column; z-index: 9; }
#settings .tabs { margin-bottom: 8px; }
.st-body { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 0; }
.st-body h4 { margin: 2px 0 0; font: 700 13px var(--serif); color: var(--gold-text); }
.st-note { margin: 0; color: var(--text-dim); font-size: 12px; }
.st-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 8px; border-radius: 7px; background: rgba(0, 0, 0, 0.2); }
.st-label { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.st-label small { color: var(--text-faint); font-size: 11.5px; }
.st-row select { max-width: 300px; padding: 4px 6px; border-radius: 5px; border: 1px solid #5d4628; background: var(--wood-deep); color: var(--text); }
.st-row input[type="range"] { width: 200px; }
.st-row input[type="checkbox"] { width: 18px; height: 18px; }
.st-keys { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.st-key { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 3px 6px; border-radius: 6px; background: rgba(0, 0, 0, 0.18); font-size: 12.5px; }
.st-key button { min-width: 74px; }
.st-key button.waiting { background: #e0b040; color: #2a1a08; animation: st-blink 0.9s ease-in-out infinite; }
@keyframes st-blink { 50% { opacity: 0.6; } }
.st-foot { display: flex; justify-content: flex-end; }
.st-pw { display: flex; flex-direction: column; gap: 6px; max-width: 300px; }
.st-pw input { padding: 6px 8px; border-radius: 5px; border: 1px solid #5d4628; background: var(--wood-deep); color: var(--text); }
.st-result { margin: 0; font-size: 12.5px; min-height: 1em; }
.st-result.ok { color: #8ee07a; }
.st-result.bad { color: #ff8a7a; }
.colorblind .st-result.ok { color: #8cc8ff; }
.colorblind .st-result.bad, .colorblind .pr-need.short { color: #ffb347; }

/* ---- New-player guide (js/guide.js) ---- */

#guide { position: relative; padding: 8px 11px 7px; border-radius: 8px; background: rgba(36, 24, 12, 0.92);
  border: 1px solid #e0b040; box-shadow: 0 0 14px rgba(255, 200, 80, 0.25); color: var(--text); font-size: 13px; z-index: 6; }
#guide p { margin: 4px 0 6px; line-height: 1.35; }
.gd-head { display: flex; justify-content: space-between; align-items: baseline; }
.gd-head b { font-family: var(--serif); color: #ffd86a; }
.gd-head small { color: var(--text-faint); }
.gd-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.gd-foot .link-btn { margin-left: auto; font-size: 11.5px; }
#guide.flash { animation: gd-flash 0.6s ease-out; }
@keyframes gd-flash { from { box-shadow: 0 0 26px rgba(255, 220, 100, 0.9); } }
#guide .link-btn, #auth-view .link-btn { background: none; border: 0; box-shadow: none; padding: 2px 0; color: var(--text-dim); text-decoration: underline; cursor: pointer; font-weight: 400; }
#guide .link-btn:hover { color: var(--text); }
#forgot-btn { display: block; margin: 8px auto 0; font-size: 12.5px; }

/* ---- Companions (js/companions.js) ---- */

#companions { left: 50%; top: 80px; transform: translateX(-50%); width: 520px; max-width: calc(100vw - 20px); max-height: calc(100vh - 160px); display: flex; flex-direction: column; z-index: 8; }
.pt-list { display: flex; flex-direction: column; gap: 5px; overflow-y: auto; min-height: 0; }
.pt-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; background: rgba(0, 0, 0, 0.2); }
.pt-row.out { background: rgba(231, 195, 108, 0.12); box-shadow: inset 3px 0 0 #e0b040; }
.pt-thumb { width: 44px; height: 40px; flex: 0 0 auto; border-radius: 6px; background: rgba(120, 160, 90, 0.18); }
.pt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pt-name b { font-family: var(--serif); color: var(--gold-text); font-size: 15px; }
.pt-name small { color: var(--text-dim); font-family: var(--sans); font-size: 12px; font-weight: 400; }
.pt-name input { width: 150px; padding: 2px 6px; border-radius: 4px; border: 1px solid #5d4628; background: var(--wood-deep); color: var(--text); }
.pt-knack { font-size: 12.5px; color: #cfe8b0; }
.pt-xp { color: var(--text-faint); font-size: 11px; }
.pt-side { display: flex; flex-direction: column; gap: 4px; }
.colorblind .pt-knack { color: #bfe0ff; }

/* ---- Dungeons and the dungeon finder (js/finder.js) ---- */

#finder { left: 50%; top: 90px; transform: translateX(-50%); width: 470px; max-width: calc(100vw - 20px); max-height: calc(100vh - 170px); overflow-y: auto; z-index: 8; }
.fd-section { margin: 4px 0 6px; color: var(--gold-text); font-family: var(--serif); font-weight: 700; font-size: 15px; }
.fd-diffs { display: flex; gap: 6px; margin-bottom: 8px; }
.fd-diff { flex: 1; padding: 7px 0; border-radius: 6px; background: rgba(0, 0, 0, 0.25); border: 1px solid #5d4628; color: var(--text-dim); font-weight: 700; cursor: pointer; }
.fd-diff.on { background: rgba(231, 195, 108, 0.18); border-color: #e0b040; color: var(--gold-text); }
.fd-diff:last-child.on { background: rgba(170, 60, 200, 0.22); border-color: #b06bff; color: #e6c8ff; }
.fd-diff:disabled { cursor: default; opacity: 0.75; }
.fd-list { display: flex; flex-direction: column; gap: 5px; }
.fd-row { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 8px; background: rgba(0, 0, 0, 0.2); }
.fd-row.on { background: rgba(231, 195, 108, 0.12); box-shadow: inset 3px 0 0 #e0b040; }
.fd-main { flex: 1; min-width: 0; }
.fd-main b { font-family: var(--serif); color: var(--gold-text); }
.fd-main small { color: var(--text-faint); }
.fd-text { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }

#finder-ready {
  position: absolute; left: 50%; top: 120px; transform: translateX(-50%); z-index: 12; width: 320px; padding: 12px 16px;
  border-radius: 10px; background: var(--wood-glass); border: 2px solid #e0b040; box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6); text-align: center;
  animation: fr-in 0.25s ease-out;
}
@keyframes fr-in { from { transform: translate(-50%, -10px); opacity: 0; } }
.fr-title { font-family: var(--serif); font-size: 19px; font-weight: 700; color: var(--gold-text); }
#finder-ready p { margin: 4px 0 8px; color: var(--text); }
.fr-bar { height: 5px; border-radius: 3px; background: rgba(0, 0, 0, 0.4); overflow: hidden; margin-bottom: 10px; }
.fr-fill { height: 100%; background: #e0b040; transition: width 0.2s linear; }
.fr-buttons { display: flex; gap: 8px; justify-content: center; }
.fr-buttons button { padding: 6px 14px; font-size: 13.5px; }
.fr-wait { color: var(--text-dim) !important; font-style: italic; }

/* The arena's season ladder */
.ab-season { margin: 0 0 6px; color: #ffd9b0; font-size: 12px; }
.ab-season small { color: var(--text-faint); }
.ab-tabs { display: flex; gap: 4px; margin: 4px 0; }
.ab-tabs button { flex: 1; padding: 2px 0; border-radius: 4px; border: 1px solid rgba(200, 80, 50, 0.4); background: rgba(0, 0, 0, 0.25); color: var(--text-dim); font-size: 11.5px; cursor: pointer; }
.ab-tabs button.on { color: #ffd9b0; border-color: #c0503a; background: rgba(192, 80, 58, 0.25); }
.ab-r { color: #ffd9b0; text-align: right; font-weight: 700; }
.ab-wl { color: var(--text-dim); text-align: right; font-size: 11.5px; }
.ab-last { margin-top: 5px; color: var(--text-faint); font-size: 11px; }

/* ---- Bigger bags and vaults, sorting and junk (v0.20) ---- */

.bag-count { color: var(--text-faint); font-family: var(--sans); font-size: 12px; font-weight: 600; margin-left: 4px; letter-spacing: 0; }
.bag-tools, .vault-tools { display: flex; align-items: center; gap: 4px; margin-bottom: 7px; }
.bag-tools #bag-more { margin-left: auto; }
.bag-tools button.mini, .vault-tools button.mini { white-space: nowrap; }
.bag-tools button.mini { padding: 4px 7px; font-size: 11.5px; }
.vault-tools .grow { flex: 1; }
button.mini .coin { width: 12px; height: 12px; vertical-align: -2px; margin-left: 3px; }
/* Can't afford it yet: a dark button with readable text (not a washed-out gold one). */
button.mini.poor { background: linear-gradient(#4a3826, #35281b); color: #e8d3a0; border-color: #6a5030; box-shadow: none; }
button.mini.poor:hover { border-color: #a07a40; }
button.mini.active { background: linear-gradient(180deg, #f0d27a, #c99a3c); color: #2a1c0c; }
.junk-panel {
  margin-bottom: 7px; padding: 7px 8px; border-radius: 6px; font-size: 12px; color: #e8dcc0; line-height: 1.4;
  background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(255, 230, 180, 0.12);
}
.junk-panel p { margin: 0 0 6px; color: var(--text-faint); }
.junk-panel label { display: flex; align-items: center; gap: 6px; margin: 4px 0; }
.junk-panel label span { white-space: nowrap; }
#bag .win-foot > span:first-child { white-space: nowrap; }
#bag .win-foot .hint { text-align: right; white-space: nowrap; }
.junk-panel select { flex: 1; padding: 3px 4px; border-radius: 5px; border: 1px solid #5d4628; background: var(--wood-deep); color: var(--text); font-size: 12px; }
.junk-panel input[type=checkbox] { accent-color: var(--gold); }
.junk-sum { margin-top: 5px; color: var(--gold-bright); font-weight: 700; }
/* Bigger bags: slightly smaller slots, as many rows as the screen has room for (all ten on
   taller screens), and a thin themed scrollbar when they don't all fit. */
.bag-grid.big {
  grid-template-columns: repeat(5, 42px); gap: 4px;
  justify-content: center;
  overflow-y: auto; overflow-x: hidden;              /* (max-height: js/panels.js fitBag) */
  scrollbar-width: thin; scrollbar-color: #8a6a35 rgba(0, 0, 0, 0.3);
}
.bag-grid.big .slot { width: 42px; height: 42px; }
.bag-grid.big::-webkit-scrollbar { width: 8px; }
.bag-grid.big::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.3); border-radius: 4px; }
.bag-grid.big::-webkit-scrollbar-thumb { background: #8a6a35; border-radius: 4px; }
.slot.junk .icon { filter: grayscale(0.85) brightness(0.72); }
.slot.junk::before {
  content: ''; position: absolute; top: 3px; left: 3px; width: 8px; height: 8px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffe28a, #b8862b); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.7);
}
.bag-grid.junk-mode .slot.filled { cursor: cell; }
.bag-grid.junk-mode .slot.filled:hover { border-color: #e0b84a; box-shadow: inset 0 0 10px rgba(224, 184, 74, 0.45); }
.tt-junk { color: #e0b84a; font-size: 12px; margin-top: 3px; }
.vault-pages { display: inline-flex; gap: 3px; }
.page-btn {
  min-width: 30px; padding: 3px 8px; border-radius: 5px; border: 1px solid #5d4628; background: var(--wood-deep);
  color: var(--text-faint); font-family: var(--serif); font-weight: 700; font-size: 12px; cursor: pointer;
}
.page-btn.active { color: var(--gold-bright); border-color: var(--gold); background: rgba(255, 210, 120, 0.12); }
.slot.unbought {
  opacity: 0.4; cursor: not-allowed; border-style: dashed;
  background: repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.35) 0 6px, rgba(60, 45, 30, 0.35) 6px 12px);
}
#shop-junk { font-size: 12px; }

/* ---- Embers and the Ember Shop (v0.21) ---- */

#ember-btn {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px 0 5px; margin-left: 2px;
  border: 1px solid rgba(249, 115, 22, 0.55); border-radius: 10px; background: rgba(120, 40, 10, 0.35);
  color: #fcd9a8; font-weight: 700; font-size: 12px; cursor: pointer;
}
#ember-btn:hover { background: rgba(160, 60, 15, 0.5); border-color: #f97316; }
.ember-icon { display: inline-block; vertical-align: -2px; }
#ember-shop { left: 50%; top: 56px; transform: translateX(-50%); width: min(660px, calc(100vw - 20px)); z-index: 7; }
#ember-shop .win-head { align-items: center; }
.es-head-right { display: inline-flex; align-items: center; gap: 10px; }
.es-balance { color: #fcd9a8; font-family: var(--sans); font-size: 13px; font-weight: 700; letter-spacing: 0; }
.es-tabs .tab { font-size: 12px; padding: 6px 4px; }
.es-body { display: flex; gap: 10px; align-items: flex-start; }
.es-left { display: flex; flex-direction: column; align-items: center; gap: 5px; flex: none; }
.es-preview { border-radius: 8px; border: 1px solid var(--trim); box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5); }
.es-trying { max-width: 236px; text-align: center; font-size: 12px; color: var(--gold-bright); font-weight: 700; min-height: 16px; }
.es-reset { font-size: 11px; }
.es-list { flex: 1; display: flex; flex-direction: column; gap: 5px; max-height: 310px; overflow-y: auto; scrollbar-width: thin; }
.es-row {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 7px; cursor: pointer;
  background: rgba(255, 230, 180, 0.05); border: 1px solid rgba(255, 230, 180, 0.08);
}
.es-row:hover { border-color: rgba(231, 195, 108, 0.45); }
.es-row.trying { border-color: #f97316; background: rgba(249, 115, 22, 0.08); }
.es-row.worn { border-color: rgba(111, 220, 95, 0.55); }
.es-dye { cursor: default; }
.es-name { font-weight: 700; color: var(--text); font-size: 13px; }
.es-name small { display: block; margin-top: 2px; font-weight: 400; color: var(--text-faint); font-size: 11px; line-height: 1.35; }
.es-tag { margin-left: 6px; padding: 1px 6px; border-radius: 8px; font-size: 10px; font-weight: 700; color: #1c2a14; background: #8fdc6f; vertical-align: 1px; }
.es-tag.owned { background: #d9c79a; color: #2a1c0c; }
.es-price { display: inline-flex; align-items: center; gap: 2px; color: #fcd9a8; font-weight: 700; white-space: nowrap; }
.es-price.poor { color: #b9806f; }
.es-buttons { display: flex; gap: 4px; }
.es-swatches { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.es-swatch { width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 2px solid rgba(0, 0, 0, 0.5); cursor: pointer; box-shadow: inset 0 -3px 5px rgba(0, 0, 0, 0.3); }
.es-swatch:hover { transform: scale(1.12); }
.es-swatch.on { border-color: #fff3c4; box-shadow: 0 0 0 2px #f97316; }
.es-swatch.none { background: repeating-linear-gradient(45deg, #5a4a38 0 4px, #3a2e22 4px 8px); }
.es-foot { margin: 8px 2px 0; font-size: 11px; color: var(--text-faint); line-height: 1.4; }
@media (max-width: 640px) { .es-body { flex-direction: column; align-items: stretch; } .es-left { align-self: center; } }

/* ---- Social extras: badges, the ☺ menu's shop emotes, the lute (v0.22) ---- */

.chat-badge { display: inline-block; vertical-align: -3px; margin-right: 3px; }
.es-name .chat-badge { vertical-align: -2px; margin-right: 5px; }
.chat-emotes button.shop { border-color: rgba(249, 115, 22, 0.55); color: #fcd9a8; }
.chat-emotes button.more { grid-column: 1 / -1; font-size: 11.5px; color: var(--text-faint); border-style: dashed; }
.es-section { margin: 4px 2px 0; font-size: 11px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-faint); }
.es-section:first-child { margin-top: 0; }
#ember-shop .es-tabs { flex-wrap: wrap; }
#ember-shop .es-tabs .tab { flex: 1 0 auto; padding: 6px 7px; }
#lute { left: 50%; bottom: 96px; transform: translateX(-50%); width: 380px; z-index: 6; }
.lute-tunes { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 8px; }
.lute-tunes .mini { flex: 1; }
.lute-keys { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.lute-key {
  display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 0 5px; border-radius: 6px; cursor: pointer;
  border: 1px solid #8a6a35; background: linear-gradient(#f3e4c0, #d9c08a); color: #3b2612; box-shadow: 0 2px 0 #6a4f26;
}
.lute-key b { font-family: var(--serif); font-size: 15px; }
.lute-key small { font-size: 10px; color: #7a5a30; }
.lute-key:hover { background: linear-gradient(#fff4d6, #e6cf9c); }
.lute-key.down, .lute-key:active { transform: translateY(2px); box-shadow: 0 0 0 #6a4f26; background: linear-gradient(#ffe8a8, #f0c860); }
