/* 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);
  /* Clicking and dragging is for playing: no blue text highlights on the windows and panels.
     (Chat, typing boxes and anything marked .selectable can still be selected and copied.) */
  -webkit-user-select: none;
  user-select: none;
}
input, textarea, [contenteditable="true"], .selectable { -webkit-user-select: text; user-select: text; }   /* (0.48.17: chat isn't highlightable; right-click a line to copy it) */

#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, #tooltip2 {
  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); }
/* Pressed: sunk in, without moving. (Before 0.40.3 a pressed button moved down 1px,
   which made a window whose last line is that button scroll by 1px: the scrollbar came, the
   text wrapped again, and the button jumped away from the pointer before the click landed.) */
.panel button:active, .dialog-buttons button:active, button.mini:active { box-shadow: inset 0 2px 3px rgba(60, 35, 5, 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); }
.disc-wait { margin: -6px 0 14px; color: var(--text-dim); font-size: 13px; }
.disc-wait::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: #d9822b; box-shadow: 0 0 8px #d9822b; vertical-align: 1px; animation: disc-pulse 1.6s ease-in-out infinite; }
.disc-wait.good { color: #8fd18a; }
.disc-wait.good::before { background: #8fd18a; box-shadow: 0 0 8px #8fd18a; animation: none; }
@keyframes disc-pulse { 50% { opacity: 0.35; } }

.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; }
.error.info { color: #b9e3a4; }
#email-code-btn { width: 100%; font-size: 13px; padding: 8px 10px; }

/* v0.47: the sign-up form's boxes, the robot check, Discord, two-step login, show-password */
.panel .check-row { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 10px; text-align: left; font-size: 13px; line-height: 1.35; color: var(--text-dim); cursor: pointer; }
.panel .check-row input { width: auto; flex: none; margin: 2px 0 0; padding: 0; box-shadow: none; accent-color: var(--gold); width: 16px; height: 16px; }
.panel .check-row a { color: var(--gold-text); }
.turnstile-box { display: flex; justify-content: center; min-height: 0; margin: 0 0 10px; }
.turnstile-box:empty { display: none; }
.or-row { display: flex; align-items: center; gap: 10px; margin: 12px 0 10px; color: var(--text-faint); font-size: 12px; }
.or-row::before, .or-row::after { content: ''; flex: 1; height: 1px; background: rgba(231, 195, 108, 0.2); }
.panel .discord-btn { background: linear-gradient(#5f6af0, #4752c4); border: 1px solid #3a43a8; color: #fff; box-shadow: 0 2px 0 #2c338a; }
.panel .discord-btn:hover { background: linear-gradient(#6b75f5, #4f5ad0); }
.dim-note { margin: -4px 0 10px; color: var(--text-faint); font-size: 12px; text-align: left; }
.dim-note:empty { display: none; }
#ts-code { text-align: center; letter-spacing: 4px; font-size: 20px; }
.pw-wrap { position: relative; display: block; }
.pw-wrap > input { padding-right: 58px !important; }
.panel .pw-peek, .pw-peek { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: auto !important; padding: 4px 8px !important; font-size: 11.5px !important; font-family: var(--sans) !important; letter-spacing: 0 !important;
  background: rgba(255, 220, 150, 0.08); border: 1px solid rgba(231, 195, 108, 0.25); border-radius: 5px; color: var(--text-dim); box-shadow: none; cursor: pointer; }
.pw-peek:hover { color: var(--text); background: rgba(255, 220, 150, 0.14); }

/* ---- 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;
  will-change: opacity;              /* its own layer: the fade never repaints the page */
}
#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); }
/* (0.50) Waiting for a cleric's Revive: respawn at once instead */
#death-release { margin-top: 14px; padding: 8px 18px; font-size: 15px; pointer-events: auto; }

#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: fixed; right: 4px; bottom: 40px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: min(460px, calc(100vw - 16px)); gap: 4px; padding: 6px; border-radius: 8px; background: var(--wood-solid, #1f1710); border: 1px solid #7a5f36; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5); z-index: 60; overflow-y: auto; scrollbar-width: thin; }
.chat-emotes.hidden { display: none; }
.chat-emotes button { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.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; }
/* (v0.38) The potion and horse buttons show their key as a small badge on the corner, so the
   row fits in the frame with a big gold number and all three buttons. */
.pf-bottom .quick { position: relative; padding: 0 6px; flex: none; }
.pf-bottom .quick kbd { position: absolute; right: -5px; top: -7px; min-width: 0; padding: 0 3px; font-size: 9px; line-height: 12px; background: #2a1e12; border: 1px solid #7a5f36; }
.pf-gold { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.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;
}
/* 0.51.1: windows move by their title bar (public/js/winmove.js); not on touch screens. */
body:not(.touch) .window[id] > .win-head { cursor: move; }
body:not(.touch) .window[id] > .win-head button, body:not(.touch) .window[id] > .win-head input, body:not(.touch) .window[id] > .win-head select { cursor: pointer; }
body.win-dragging, body.win-dragging * { user-select: none !important; cursor: move !important; }
.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-tokens {   /* (v0.43) Tinsel's stall: how many Candy Canes you have */
  display: flex; align-items: center; gap: 6px; padding: 6px 8px; margin-bottom: 4px;
  border-radius: 6px; background: rgba(200, 50, 40, 0.12); border: 1px solid rgba(200, 50, 40, 0.35); font-size: 12px;
}
.wm-portal.sh { margin-left: 6px; }
.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;
}
#talk-prompt .talk-or { font-family: var(--sans, sans-serif); font-size: 12px; font-weight: 400; opacity: 0.7; }

#tooltip, #tooltip2 {
  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; }

/* (0.48.17) Invitations: in the upper middle of the screen, above every window, with a bar
   showing how long is left. */
#invites {
  position: absolute;
  top: 17%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 75;
  pointer-events: none;
}
.invite {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px 15px;
  border-radius: 10px;
  background: var(--wood-solid);
  border: 2px solid var(--gold) !important;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 8px 28px rgba(0, 0, 0, 0.6), 0 0 22px rgba(231, 195, 108, 0.35);
  font-size: 15px;
  font-weight: 700;
  pointer-events: auto;
  animation: invite-in 0.25s ease-out;
  overflow: hidden;
}
.invite .invite-buttons button { font-size: 13px; padding: 5px 14px; }
.invite-time { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--gold); transform-origin: left; animation: invite-time linear forwards; }
@keyframes invite-in { from { opacity: 0; transform: translateY(-8px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes invite-time { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.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; }
.bounty.boss { border-color: #c9a646; background: linear-gradient(90deg, rgba(201, 166, 70, 0.16), transparent); }   /* v0.33 */
.bounty.boss .b-text { color: var(--gold-bright); }
/* v0.33: several quests open at once, picked from a list on the parchment (v0.33.4: dark ink on light rows) */
.quest-picks { display: flex; flex-direction: column; gap: 2px; margin: 0 0 10px; padding: 4px; max-height: 172px; overflow-y: auto;
  border-radius: 6px; background: rgba(107, 74, 30, 0.08); border: 1px solid rgba(138, 106, 53, 0.4); scrollbar-color: #a58550 transparent; }
#dialog .quest-picks .qp { display: flex; flex: none; align-items: center; gap: 8px; width: 100%; min-height: 0; margin: 0; padding: 3px 8px; border-radius: 5px;
  border: 1px solid transparent; background: transparent; box-shadow: none; text-shadow: none; transform: none;
  color: #3b2a17; font: 600 13.5px/1.25 var(--serif); letter-spacing: 0; text-align: left; cursor: pointer; }
#dialog .quest-picks .qp:hover { background: rgba(107, 74, 30, 0.13); }
#dialog .quest-picks .qp.active { background: rgba(255, 251, 238, 0.8); border-color: #a58550; box-shadow: inset 3px 0 0 #7a2e14; color: #2b1d10; }
.quest-picks .qp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quest-picks .qp-star { color: #a0461c; }
.quest-picks .qp-lvl { color: #7a6648; font: 600 11.5px/1 var(--sans); white-space: nowrap; }
.quest-picks .qp-badge { min-width: 62px; padding: 2px 7px; border-radius: 999px; text-align: center; font: 800 10.5px/1.3 var(--sans); white-space: nowrap;
  color: #6b4a1e; border: 1px solid #b8975a; background: rgba(255, 255, 255, 0.35); }
.quest-picks .st-available .qp-badge { color: #fff8e2; background: #b07a1c; border-color: #8a5d12; }
.quest-picks .st-ready .qp-badge { color: #f3ffee; background: #3d8a36; border-color: #2c6a27; }
.slot .refine { position: absolute; left: 2px; top: 1px; font-size: 10px; font-weight: 800; color: #ffd0e6; text-shadow: 0 0 3px #000, 0 0 2px #000; pointer-events: none; }
.tt-refine { color: #ff8cc0; font-weight: 700; font-size: 12px; }   /* refined Mythic gear (v0.33) */
.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; }
/* (0.51) Two branches side by side; the window widens for them (a touch screen shows one, with tabs) */
#char.skills-wide { width: min(700px, calc(100vw - 300px)); }
.sk-branches { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }
.sk-branches.one { grid-template-columns: 1fr; }
.sk-branch { padding: 8px; border: 1px solid rgba(122, 95, 54, 0.45); border-radius: 8px; background: rgba(0, 0, 0, 0.18); min-width: 0; }
.sk-branch-head { display: flex; justify-content: space-between; align-items: baseline; }
.sk-branch-name { font-family: var(--serif); font-size: 16px; font-weight: 700; color: var(--gold-text); }
.sk-branch-pts { font-size: 12px; font-weight: 700; color: #8fe07a; }
.sk-branch-desc { margin: 2px 0 0; font-size: 11.5px; color: var(--text-dim); line-height: 1.35; }
.sk-tabs { margin-top: 8px; }
.sk-nodes.one { grid-template-columns: 1fr; }
.sk-node.special .sk-name::before { content: '✦ '; color: #e7c36c; }
.sk-tier.capstone .sk-node { border-color: #9a7a2e; background: linear-gradient(rgba(255, 210, 110, 0.10), rgba(0, 0, 0, 0.25)); }
.sk-tier.capstone .sk-node.maxed { box-shadow: inset 0 0 14px rgba(255, 210, 110, 0.35); }
.sk-tier { margin-top: 8px; }
.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 */
/* (0.50: six slots and the book are 414 px wide. In the middle of a 1280 px window that reached the chat's
   emote button, so it never starts left of 469 px: the chat is 450 px wide, 10 px in.) */
#hotbar { position: absolute; left: max(50%, 676px); 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); }
/* The ultimate (v0.33): a gold frame (it sits wherever the player put it since 0.50) */
.hb-slot.ult { border-color: #c9a646; box-shadow: 0 0 0 1px #5a4520, 0 0 10px rgba(255, 208, 90, 0.35); }
/* (0.50) Six places; an empty one, the place a dragged skill would land, and the spell book button */
.hb-slot.empty { border-style: dashed; border-color: rgba(122, 95, 54, 0.7); background: rgba(28, 21, 15, 0.55); cursor: default; }
.hb-slot.drop, .sb-slot.drop { border-color: var(--gold-bright); box-shadow: 0 0 0 2px rgba(255, 220, 120, 0.45); }
.hb-book { width: 34px; height: 52px; padding: 0; margin-left: 2px; border-radius: 9px; border: 2px solid #7a5f36; background: #1c150f; font-size: 18px; cursor: pointer; }
.hb-book:hover { border-color: var(--gold); }
.skill-ghost { position: fixed; z-index: 200; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 8px; border: 2px solid var(--gold-bright); pointer-events: none; opacity: 0.9; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5); }
body.skill-dragging .hb-tip { display: none !important; }
body.skill-dragging { cursor: grabbing; }

/* ---- The spell book (0.50) ---- */
#spellbook { left: 50%; top: 56px; transform: translateX(-50%); width: 600px; max-width: calc(100vw - 20px); max-height: calc(100vh - 150px); display: flex; flex-direction: column; z-index: 8; }
.sb-bar { display: flex; justify-content: center; gap: 8px; padding: 8px 10px 4px; }
.sb-slot { position: relative; width: 52px; height: 52px; padding: 0; border-radius: 9px; border: 2px solid #7a5f36; background: #1c150f; cursor: pointer; flex: none; }
.sb-slot img { width: 100%; height: 100%; border-radius: 7px; display: block; pointer-events: none; }
.sb-slot.empty { border-style: dashed; }
.sb-slot.ult { border-color: #c9a646; }
.sb-slot.picked { border-color: var(--gold-bright); box-shadow: 0 0 0 2px rgba(255, 220, 120, 0.5); }
.sb-slot.target { animation: sb-target 1s ease-in-out infinite; }
@keyframes sb-target { 50% { border-color: var(--gold); } }
.sb-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; }
.sb-hint { margin: 2px 12px 6px; text-align: center; color: var(--text-faint); font-size: 12px; }
.sb-list { overflow-y: auto; padding: 0 10px 10px; display: flex; flex-direction: column; gap: 5px; }
.sb-skill { display: flex; gap: 10px; align-items: flex-start; padding: 6px 8px; border-radius: 8px; border: 1px solid rgba(122, 95, 54, 0.5); background: rgba(28, 21, 15, 0.6); cursor: pointer; user-select: none; flex: none; }
.sb-skill:hover { border-color: var(--gold); }
.sb-skill.picked { border-color: var(--gold-bright); background: rgba(70, 52, 26, 0.6); }
.sb-skill.locked { cursor: default; opacity: 0.6; }
.sb-skill.locked:hover { border-color: rgba(122, 95, 54, 0.5); }
.sb-skill.locked .sb-icon { filter: grayscale(1) brightness(0.6); }
.sb-icon { width: 42px; height: 42px; border-radius: 8px; border: 2px solid #7a5f36; flex: none; }
.sb-text { min-width: 0; }
.sb-name { font-family: var(--serif); font-size: 15px; font-weight: 700; color: var(--gold-text); }
.sb-tag { margin-left: 8px; padding: 1px 6px; border-radius: 6px; font-family: system-ui, sans-serif; font-size: 10.5px; font-weight: 700; color: #2a1c0a; background: #c9a646; vertical-align: 1px; }
.sb-meta { margin-top: 1px; font-size: 11.5px; color: #a9d6ff; }
.sb-desc { margin-top: 2px; font-size: 12.5px; line-height: 1.35; color: var(--text); }
.hb-slot.ult:not(.locked):not(.cooling) { animation: hb-ult 2.4s ease-in-out infinite; }
@keyframes hb-ult { 50% { box-shadow: 0 0 0 1px #5a4520, 0 0 16px rgba(255, 208, 90, 0.6); } }
.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; }
#hotbar:hover { z-index: 7; }   /* (0.41.1: an ability's tooltip above the house bar, z-index 6) */
.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); }
/* v0.42: a new character's looks (free here), and an older account's email address */
.cs-looks { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 0 0 12px; }
.cs-look-row { display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 5px; font-size: 12.5px; color: var(--text-dim); }
.cs-look-row > span:first-child { width: 40px; text-align: right; margin-right: 4px; }
.panel .cs-swatch { width: 22px; height: 22px; margin: 0; padding: 0; border-radius: 6px; border: 2px solid rgba(0, 0, 0, 0.55); box-shadow: none; }
.panel .cs-swatch.selected { border-color: #fff; box-shadow: 0 0 0 2px rgba(255, 216, 119, 0.8); }
.panel .cs-look-btn { width: auto; margin: 0; display: inline-block; padding: 3px 10px; font-size: 12px; font-weight: 700; border-radius: 6px; background: rgba(255, 230, 180, 0.08); color: var(--text); border: 1px solid #5d4628; box-shadow: none; }
.panel .cs-look-btn.selected { background: linear-gradient(#f4d886, #c99a3f); color: #2b1b08; border-color: #7a5a22; }
.panel .cs-look-btn:hover { background: rgba(255, 230, 180, 0.16); }
.panel .cs-look-btn.selected:hover { background: linear-gradient(#fbe3a0, #d9ab50); }
.cs-email-view { max-width: 420px; margin: 0 auto; text-align: center; }
.cs-email-form { display: flex; flex-direction: column; gap: 8px; margin: 14px auto 6px; max-width: 300px; }
.cs-email-form input { margin: 0; }
.cs-email-note { min-height: 1.2em; color: #ff8a7a; font-size: 13px; }
.st-ok { color: #8ee07a; }
.st-warn { color: #ffcf6a; }
.st-pw.st-verify { flex-direction: row; flex-wrap: wrap; align-items: center; max-width: 420px; }
.st-pw.st-verify input { width: 130px; letter-spacing: 2px; }
/* v0.47: show-password buttons, game news, two-step login */
.st-pw .pw-wrap > input { width: 100%; box-sizing: border-box; }
.st-pw .pw-peek { padding: 2px 6px !important; font-size: 11px !important; }
.st-check { display: flex; align-items: center; gap: 6px; margin: 6px 0; font-size: 12.5px; color: var(--text-dim); cursor: pointer; }
.st-ts-setup { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.st-qr { width: 164px; height: 164px; image-rendering: pixelated; border-radius: 4px; flex: none; }
.st-ts-key { display: inline-block; margin-top: 4px; padding: 4px 6px; border-radius: 4px; background: var(--wood-deep); font: 700 13px/1.5 ui-monospace, Consolas, monospace; color: var(--gold-text); user-select: all; -webkit-user-select: all; word-break: normal; max-width: 220px; }
.st-backup { display: grid; grid-template-columns: repeat(2, max-content); gap: 4px 14px; margin: 6px 0; padding: 8px 10px; border-radius: 6px; background: var(--wood-deep); }
.st-backup code { font: 700 14px/1.4 ui-monospace, Consolas, monospace; color: var(--gold-text); user-select: all; -webkit-user-select: all; }
.cs-classes { display: grid; grid-template-columns: repeat(4, 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 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vault-row > .gold-input { flex: 0 1 96px; min-width: 64px; width: 96px; }
.vault-row > button { flex: none; }
.vault-row .coin, .needs .coin { width: 14px; height: 14px; vertical-align: -2px; }
.vault-quick { margin-top: 6px; }
.vault-quick > span:first-child { color: var(--text-dim); font-weight: 600; font-size: 12px; }
.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); max-height: calc(100vh - 20px); }
/* v0.48.4: the realm map is one row: a list of places on the left (maps.js renderChain), the map,
   and the details on the right. The list scrolls on its own, so the window never fills the screen. */
.wm-chain { flex: none; width: 200px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; padding-right: 4px; overscroll-behavior: contain; }
.wm-section-title { margin: 0 0 3px 2px; font: 700 10px var(--sans); letter-spacing: 1.1px; text-transform: uppercase; color: var(--text-faint); }
.wm-grid { display: flex; flex-direction: column; gap: 3px; }
.wm-step { flex: none; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; font: 700 10px var(--sans);
  color: #1b1208; background: linear-gradient(#f1d27a, #c79a3c); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
.wm-dot { flex: none; width: 6px; height: 6px; margin: 0 5px; border-radius: 50%; background: #c79a3c; opacity: 0.7; }
.wm-meta { flex: none; color: var(--text); opacity: 0.8; font-size: 11px; }
.wm-zone { display: flex; flex-direction: row; align-items: center; gap: 6px; width: 100%; padding: 4px 7px; border-radius: 6px; cursor: pointer;
  border: 1px solid #4d3a22; color: var(--text); text-align: left; font: 12px var(--sans); }
.wm-zone strong { flex: 1; min-width: 0; font: 700 13px var(--serif); color: var(--gold-text); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wm-zone { background: linear-gradient(135deg, rgba(90, 70, 45, 0.5), rgba(22, 16, 10, 0.92)); }
.wm-zone:hover { border-color: #8a6a3a; }
.wm-zone.here .wm-meta { color: #9fe08f; font-weight: 700; opacity: 1; }
.wm-where { margin: -4px 0 8px; font-size: 12px; 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-starfall { background: linear-gradient(135deg, rgba(110, 200, 255, 0.45), rgba(8, 12, 30, 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-harbour { background: linear-gradient(135deg, rgba(60, 120, 170, 0.5), rgba(12, 18, 28, 0.93)); }
.wm-zone.theme-colosseum { background: linear-gradient(135deg, rgba(200, 175, 130, 0.42), rgba(30, 22, 14, 0.93)); }
.wm-zone.theme-frostfall { background: linear-gradient(135deg, rgba(190, 50, 50, 0.45), rgba(20, 60, 36, 0.6) 55%, rgba(12, 16, 14, 0.94)); }
.wm-zone.theme-house { background: linear-gradient(135deg, rgba(150, 110, 60, 0.45), rgba(24, 16, 10, 0.92)); }
.wm-zone.theme-crypt { background: linear-gradient(135deg, rgba(110, 80, 150, 0.45), rgba(16, 12, 20, 0.92)); }
.wm-zone.theme-frost { background: linear-gradient(135deg, rgba(120, 170, 220, 0.5), rgba(14, 20, 28, 0.92)); }
/* v0.37: the party dungeons, on a row of their own under the lands */
.wm-zone.theme-cave { background: linear-gradient(135deg, rgba(140, 100, 60, 0.5), rgba(22, 14, 8, 0.92)); }
.wm-zone.theme-fungal { background: linear-gradient(135deg, rgba(70, 170, 120, 0.45), rgba(10, 18, 12, 0.93)); }
.wm-zone.theme-icecave { background: linear-gradient(135deg, rgba(150, 200, 240, 0.45), rgba(14, 22, 34, 0.93)); }
.wm-zone.theme-tomb { background: linear-gradient(135deg, rgba(200, 150, 70, 0.5), rgba(30, 20, 10, 0.93)); }
.wm-zone.theme-grotto { background: linear-gradient(135deg, rgba(40, 150, 150, 0.45), rgba(8, 18, 20, 0.93)); }
.wm-zone.theme-rift { background: linear-gradient(135deg, rgba(170, 80, 240, 0.5), rgba(12, 6, 20, 0.94)); }
.wm-zone.theme-astral { background: linear-gradient(135deg, rgba(255, 220, 150, 0.35), rgba(10, 12, 30, 0.94)); }
.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-main { display: flex; gap: 10px; align-items: flex-start; }
.wm-canvas { display: block; border-radius: 6px; }
.wm-info { width: 230px; flex: none; 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: 70px; transform: translateX(-50%); width: 620px; max-width: calc(100vw - 20px); max-height: calc(100vh - 140px); display: flex; flex-direction: column; 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; }
/* Staff tags: a game master's GM and a moderator's MOD (in chat, the Online list, menus) */
.staff-badge { display: inline-block; padding: 0 5px; margin-right: 4px; border-radius: 4px; font: 800 10px/15px var(--sans); letter-spacing: 0.4px; vertical-align: 1px; cursor: help; }
.staff-badge.gm { color: #fff6e0; background: linear-gradient(#d8452a, #a52a16); box-shadow: inset 0 0 0 1px #ffd877; }
.staff-badge.mod { color: #fff; background: linear-gradient(#3a76d8, #2152a8); box-shadow: inset 0 0 0 1px #bfe0ff; }
.menu-staff { margin: -4px 0 6px; color: #ffcf9a; font-size: 12px; }
.in-staff { display: inline-flex; align-items: center; color: #ffcf9a; font-weight: 700; }
#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); }
}

/* ---- 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); }
#fs-btn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 22px; padding: 0; border: 0; border-radius: 4px;
  background: transparent; color: var(--gold-text); font-size: 16px; line-height: 1; }
#fs-btn.hidden { display: none; }
#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; scrollbar-gutter: stable; padding-bottom: 3px; }   /* (0.40.3: room for the scrollbar always, so nothing reflows when it comes) */
.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; flex: 1 1 auto; min-width: 0; }
.st-label small { color: var(--text-faint); font-size: 11.5px; }
.st-row > :not(.st-label) { flex-shrink: 0; }   /* (0.40.3: the control keeps its size; the words wrap) */
.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; gap: 6px; }
/* (v0.48.4) Account buttons line up under their text and with the boxes above, like Change email. */
.st-foot.st-left { justify-content: flex-start; max-width: 300px; }
.st-foot.st-left > button { flex: 1; }
.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, #tutorial { 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, #tutorial 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, #tutorial.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, #tutorial .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, #tutorial .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; }
.fd-buttons { display: flex; flex-direction: column; gap: 4px; flex: none; }
.fd-buttons .mini { min-width: 96px; }
.fd-buttons .fd-heroic:not(:disabled) { background: linear-gradient(#7a3aa8, #4a1a70); border-color: #b06bff; color: #f0dcff; }
.fd-buttons .fd-go { background: linear-gradient(#3f8a3a, #24561f); border-color: #8fdc6f; color: #eaffdf; }
.fd-row.fd-near { box-shadow: inset 3px 0 0 rgba(159, 224, 143, 0.7); }
.fd-row.fd-near.on { box-shadow: inset 3px 0 0 #e0b040; }

#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; }
/* The materials bag (v0.33): a tab in the bag window, with its own tools and grid */
.bag-tabs { margin-bottom: 7px; padding: 3px; }
.window .bag-tabs .tab { padding: 5px 6px; font-size: 13px; white-space: nowrap; }
.bag-tabs .tab small { opacity: 0.8; font-weight: 600; margin-left: 3px; font-size: 11px; }
.bag-tools { flex-wrap: wrap; row-gap: 4px; }   /* never run past the window's edge */
.mats-tools #mats-more { margin-left: auto; }
.bag-grid.mats-grid.big { max-height: min(368px, calc(100vh - 330px)); }
.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 { display: inline-block; white-space: nowrap; margin-left: 6px; padding: 1px 6px; border-radius: 8px; font-size: 10px; font-weight: 700; line-height: 1.4; 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); }

/* ---- Comparing gear (v0.24) ---- */
.tt-cmp-head { color: #e7c36c; font-weight: 700; margin-top: 5px; padding-top: 4px; border-top: 1px solid rgba(231, 195, 108, 0.25); }
.tt-up { color: #8fe07a; font-weight: 700; }
.tt-down { color: #ff8f84; font-weight: 700; }
.tt-cmp-same { color: var(--text-faint); }
.tt-worn { color: var(--text-faint); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 2px; }
#tooltip2 { opacity: 0.97; }

/* ---- The game menu (Esc; v0.25) ---- */
kbd:empty { display: none; }
#game-menu { left: 50%; top: 50%; transform: translate(-50%, -50%); width: 520px; max-width: calc(100vw - 20px); max-height: calc(100vh - 40px); overflow-y: auto; z-index: 12; }
.gm-group + .gm-group { margin-top: 10px; }
.gm-group-name { color: var(--text-faint); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; margin: 0 2px 5px; }
.gm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.gm-item { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 6px 9px; border-radius: 7px; border: 1px solid #5d4628;
  background: linear-gradient(180deg, rgba(70, 48, 26, 0.9), rgba(40, 27, 14, 0.95)); color: var(--text); font: 600 13.5px var(--sans); cursor: pointer; text-align: left; }
.gm-item:hover, .gm-item:focus-visible { border-color: #e0b040; background: linear-gradient(180deg, rgba(96, 66, 32, 0.95), rgba(52, 35, 17, 0.95)); outline: none; }
.gm-item.danger { color: #ffb0a6; }
.gm-icon { font-size: 19px; width: 24px; text-align: center; line-height: 1; }
.gm-label { flex: 1; }
.gm-item 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; }
.gm-foot { margin: 10px 2px 0; color: var(--text-faint); font-size: 11.5px; }
@media (max-width: 560px) { .gm-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---- The tutorial on Dawnrest Isle (v0.25) ---- */
#tutorial { max-width: 270px; }
.tut-count { position: relative; height: 14px; margin: 0 0 6px; border-radius: 7px; background: rgba(0, 0, 0, 0.4); overflow: hidden; border: 1px solid #6b5228; }
.tut-bar { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #c8962e, #f0c850); }
.tut-count span { position: relative; display: block; text-align: center; font: 700 10.5px/14px var(--sans); color: #fff6dc; text-shadow: 0 1px 1px #000; }
#npc-talk { left: 50%; top: 64px; transform: translateX(-50%); width: min(440px, calc(100vw - 20px)); z-index: 9;
  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); }
#npc-talk .win-head { color: #6b2c12; border-image: linear-gradient(90deg, transparent, rgba(107, 44, 18, 0.5), transparent) 1; }
#npc-talk .win-close { color: #7a5a30; }
#npc-talk .npc-line { color: #4a3420; font-family: var(--serif); font-size: 14.5px; line-height: 1.45; margin: 4px 2px 0; }
#npc-talk .dialog-buttons button.secondary { background: rgba(107, 74, 30, 0.12); color: #4a3420; border-color: #a58550; box-shadow: none; }

/* ---- Q / R: which potion (v0.30) ---- */
.quick.picked { border-color: #9a7a3e; box-shadow: inset 0 -2px 0 rgba(231, 195, 108, 0.55); }
#potion-menu {
  position: fixed; z-index: 60; min-width: 230px; padding: 5px;
  background: linear-gradient(#2c2117, #1f1710); border: 1px solid #7a5f36; border-radius: 7px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55);
}
#potion-menu.hidden { display: none; }
#potion-menu .pm-title { padding: 3px 7px 6px; color: var(--gold-text); font-family: var(--serif); font-weight: 700; font-size: 13px; border-bottom: 1px solid rgba(122, 95, 54, 0.5); margin-bottom: 4px; }
#potion-menu .pm-row {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 7px; border: 0; border-radius: 5px;
  background: transparent; color: var(--text); font-size: 13px; text-align: left; cursor: pointer; box-shadow: none;
}
#potion-menu .pm-row:hover { background: rgba(255, 230, 180, 0.08); }
#potion-menu .pm-row.on { background: rgba(231, 195, 108, 0.16); color: var(--gold-text); }
#potion-menu .pm-row.on .pm-name::after { content: '  ✓'; }
#potion-menu .pm-auto { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 4px; background: #4a3826; color: var(--gold-text); font-weight: 800; font-size: 11px; }
#potion-menu .pm-count { margin-left: auto; color: var(--text-dim); font-size: 12px; }

/* ---- Minimized chat (v0.30) ---- */
.chat-min {
  margin-left: auto; align-self: center; width: 26px; height: 22px; padding: 0; border: 0; border-radius: 5px;
  background: transparent; color: var(--text-dim); font-size: 13px; line-height: 22px; box-shadow: none; cursor: pointer;
}
.chat-min:hover { color: var(--gold-text); background: rgba(255, 230, 180, 0.08); }
#chat.minimized .chat-logs { display: none; }
#chat.minimized:not(.typing) #chat-form { display: none; }
#chat.minimized .chat-tabs { border-bottom: 0; padding-bottom: 4px; }
#chat.minimized .chat-tab.active { background: transparent; box-shadow: none; color: var(--text-dim); }
#chat.minimized .chat-tab.active:hover { color: var(--text); }

/* ---- Drag and drop (v0.30) ---- */
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 80; width: 38px; height: 38px; display: grid; place-items: center; pointer-events: none;
  border-radius: 6px; background: rgba(30, 22, 14, 0.85); border: 1px solid var(--gold); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6); opacity: 0.95; }
.drag-ghost .qty { position: absolute; right: 2px; bottom: 0; font-size: 11px; font-weight: 700; text-shadow: 0 1px 2px #000; }
.slot.drag-from { opacity: 0.35; }
.slot.drag-over { outline: 2px solid var(--gold); outline-offset: -2px; background: rgba(231, 195, 108, 0.14); }
body.dragging-item #tooltip, body.dragging-item #tooltip2 { display: none !important; }
body.dragging-item, body.dragging-item * { cursor: grabbing !important; }

/* ---- Waypoints on the world map (v0.30) ---- */
.wm-zone { position: relative; }
.wm-wp-mark { display: inline-block; width: 9px; height: 9px; transform: rotate(45deg); border-radius: 2px;
  background: linear-gradient(135deg, #9ff0ff, #3a9fd8); box-shadow: 0 0 6px rgba(120, 220, 255, 0.8); }
.wm-zone .wm-wp-mark { flex: none; width: 7px; height: 7px; margin-right: 2px; }
.wm-waypoint { margin: 2px 0 10px; padding: 8px 9px; border-radius: 7px; border: 1px solid rgba(120, 200, 240, 0.45);
  background: linear-gradient(rgba(60, 130, 170, 0.18), rgba(10, 20, 26, 0.35)); }
.wm-waypoint.locked { border-color: rgba(122, 95, 54, 0.45); background: rgba(0, 0, 0, 0.2); }
.wm-waypoint.locked .wm-wp-mark { background: #5d5548; box-shadow: none; }
.wm-wp-name { display: flex; align-items: center; gap: 8px; font-weight: 700; color: #bfeaff; margin-bottom: 6px; }
.wm-waypoint.locked .wm-wp-name { color: var(--text-dim); }
.wm-travel { width: 100%; padding: 6px 8px; font-weight: 700; }
.wm-travel.hidden { display: none; }
.wm-travel:disabled { opacity: 0.6; cursor: default; }
.wm-wp-hint { margin-top: 5px; font-size: 11.5px; color: var(--text-dim); line-height: 1.35; }

/* ---- Scrollbars (v0.31): thin and in the game's colours everywhere, instead of the
   browser's plain grey ones (the map's side panel, long lists, windows) ---- */
* { scrollbar-width: thin; scrollbar-color: #8a6a35 rgba(0, 0, 0, 0.3); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.3); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: #8a6a35; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a8823f; }
.wm-info { padding-right: 6px; overscroll-behavior: contain; }

/* ---- Town portal button and waypoint prices (v0.31) ---- */
.wm-portal { margin-left: auto; margin-right: 10px; padding: 4px 12px; font-size: 12.5px; font-weight: 700;
  border: 1px solid rgba(150, 120, 240, 0.7); border-radius: 6px; color: #e8dcff;
  background: linear-gradient(rgba(130, 90, 230, 0.45), rgba(60, 30, 120, 0.55)); box-shadow: 0 0 10px rgba(140, 100, 255, 0.25); cursor: pointer; }
.wm-portal:hover:not(:disabled) { border-color: #c9b6ff; box-shadow: 0 0 14px rgba(160, 120, 255, 0.5); }
.wm-portal:disabled { opacity: 0.6; cursor: default; box-shadow: none; }
.wm-coin { display: inline-block; width: 12px; height: 12px; margin-left: 5px; vertical-align: -1px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff2a8, #e2b13c 55%, #9a6f1c); box-shadow: inset 0 0 0 1px rgba(90, 60, 10, 0.6); }
.drag-ghost.to-ground { border-color: #e2a54a; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6), 0 0 0 3px rgba(226, 165, 74, 0.35); }
.drag-ghost.to-ground::after { content: 'Drop'; position: absolute; top: 100%; margin-top: 3px; padding: 1px 6px; border-radius: 4px;
  background: rgba(0, 0, 0, 0.75); color: #ffd99a; font-size: 11px; font-weight: 700; white-space: nowrap; }

/* ---- The ride / walk button (v0.32) ---- */
#ride-btn.off img { opacity: 0.45; filter: grayscale(1); }
#ride-btn.off { border-style: dashed; }

/* ---- Vault pages III-X (v0.32) ---- */
.vault-tools { flex-wrap: wrap; row-gap: 5px; }
.vault-pages { flex-wrap: wrap; max-width: 100%; }
.page-btn.hidden { display: none; }
.page-btn.locked { opacity: 0.45; border-style: dashed; }

/* ---- The quest log (v0.34, L) ---- */
#questlog { left: 50%; top: 70px; transform: translateX(-50%); width: 720px; max-width: calc(100vw - 20px); height: min(560px, calc(100vh - 150px));
  display: flex; flex-direction: column; z-index: 8; }
#questlog .ql-count { color: var(--text-dim); font-family: var(--sans); font-size: 12px; font-weight: 600; }
#questlog .ql-tabs { margin-bottom: 8px; }
#questlog .ql-tabs .tab small { opacity: 0.75; }
.ql-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 250px 1fr; gap: 12px; }
.ql-list { overflow-y: auto; padding-right: 4px; }
.ql-group + .ql-group { margin-top: 10px; }
.ql-group-title { margin: 0 0 4px 2px; font: 700 11px/1 var(--sans); letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-faint); }
.ql-row { display: flex; align-items: center; gap: 7px; padding: 5px 7px; border-radius: 6px; border: 1px solid transparent; cursor: pointer; font-size: 13px; color: var(--text); }
.ql-row:hover { background: rgba(255, 220, 150, 0.06); }
.ql-row.active { background: linear-gradient(#4a3826, #3a2b1d); border-color: rgba(231, 195, 108, 0.45); }
.ql-row:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.ql-row.off .ql-name { color: var(--text-faint); }
.ql-row.locked { cursor: default; opacity: 0.7; }
.ql-row.locked:hover { background: none; }
.ql-track { margin: 0; accent-color: #d9a441; cursor: pointer; flex: none; }
.ql-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--serif); font-weight: 700; }
.ql-star { color: #f0b04a; }
.ql-prog { flex: none; font-size: 11.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.ql-row.st-ready .ql-prog { color: #8fe07a; font-weight: 700; }
.ql-detail { overflow-y: auto; padding: 4px 6px 4px 14px; border-left: 1px solid rgba(231, 195, 108, 0.18); }
.ql-title { font: 700 20px/1.2 var(--serif); color: var(--gold-text); }
.ql-meta { margin-top: 2px; font-size: 12px; color: var(--text-dim); }
.ql-where { margin-top: 8px; font-size: 13px; color: #cfe3ff; }
.ql-where b { color: var(--text-dim); font-weight: 600; }
.ql-text { margin: 10px 0; font: italic 14.5px/1.5 var(--serif); color: #eadfc6; }
.ql-goal { font-size: 13.5px; color: var(--text); }
.ql-goal b { color: var(--gold-text); }
.ql-detail .b-bar { margin: 6px 0 4px; }
.ql-ready { margin-top: 8px; color: #8fe07a; font-size: 13px; font-weight: 600; }
.ql-rewards { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; font-size: 13px; color: #e7c36c; }
.ql-rewards .reward-icon { display: inline-flex; padding: 2px; border-radius: 5px; background: rgba(0, 0, 0, 0.3); }
.ql-actions { display: flex; gap: 6px; margin-top: 14px; }
.ql-bounties { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.ql-bounty.ready .ql-goal b { color: #8fe07a; }
.ql-empty { color: var(--text-dim); font-size: 13px; margin: 6px 4px; }
.ql-foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; padding-top: 7px; border-top: 1px solid rgba(231, 195, 108, 0.15); font-size: 12px; color: var(--text-dim); }
.ql-foot span { flex: 1; }
@media (max-width: 640px) {
  .ql-body { grid-template-columns: 1fr; grid-template-rows: minmax(120px, 40%) 1fr; }
  .ql-detail { border-left: 0; border-top: 1px solid rgba(231, 195, 108, 0.18); padding: 8px 2px 0; }
}

/* The tracker (v0.34): Log and fold buttons, a click opens the log, ✕ hides a quest */
#quest-tracker .panel-title { display: flex; align-items: center; gap: 6px; }
#quest-tracker .panel-title > span { flex: 1; }
#quest-tracker .qt-fold { min-width: 24px; padding: 2px 5px; }
#quest-tracker.folded { min-width: 0; }
#quest-list li { position: relative; cursor: pointer; padding-right: 16px; border-radius: 5px; }
#quest-list li:hover .q-name { color: #fff3c4; }
#quest-list li.story .q-name::before { content: '★ '; color: #f0b04a; }
#quest-list .qt-hide { position: absolute; top: 0; right: -4px; padding: 0 4px; border: 0; background: none; color: var(--text-faint); font-size: 11px; line-height: 16px;
  cursor: pointer; opacity: 0; transition: opacity 0.15s; }
#quest-list li:hover .qt-hide, #quest-list .qt-hide:focus-visible { opacity: 1; }
#quest-list .qt-hide:hover { color: #ff9a8a; }
#quest-list .qt-more { color: var(--gold-text); font-size: 12px; padding-right: 0; }
#quest-list .qt-more.dim { color: var(--text-faint); }
#quest-list .qt-more:hover { text-decoration: underline; }

/* Staff (v0.35): god mode and vanish show as chips by your name. */
.pf-staff { display: inline-flex; gap: 3px; }
.pf-staff:empty { display: none; }
.pf-staff .chip { font-size: 9px; font-weight: 800; letter-spacing: 0.06em; padding: 1px 5px; border-radius: 6px; line-height: 1.4; }
.pf-staff .chip.god { background: linear-gradient(#ffe08a, #e0a83a); color: #3a2608; box-shadow: 0 0 6px rgba(255, 214, 102, 0.7); }
.pf-staff .chip.vanish { background: rgba(160, 180, 220, 0.25); color: #cfe0ff; border: 1px dashed rgba(200, 215, 255, 0.6); }

/* ---- Ember Shop v0.36: seasons, bundles, services ---- */
#ember-shop .es-tabs .tab { padding: 5px 6px; font-size: 11.5px; }
#ember-shop .es-tabs .es-season-tab { color: #bfe6ff; background: linear-gradient(180deg, rgba(120, 190, 255, 0.18), rgba(120, 190, 255, 0.04)); }
#ember-shop .es-tabs .es-season-tab.active { color: #e8f6ff; }
.es-banner { padding: 8px 10px; border-radius: 7px; border: 1px solid rgba(150, 210, 255, 0.45); background: linear-gradient(135deg, rgba(60, 110, 170, 0.35), rgba(20, 30, 60, 0.4)); }
.es-banner b { display: block; color: #e8f6ff; font-size: 13px; }
.es-banner small { display: block; margin-top: 2px; color: #bcd6ee; font-size: 11px; line-height: 1.4; }
.es-tag.season { background: #9fd8ff; color: #10263a; }
.es-price.soon { color: #c9b98f; font-size: 12px; }
.es-empty { color: var(--text-faint); font-size: 12px; margin: 10px 4px; }
.es-status { padding: 6px 9px; border-radius: 6px; background: rgba(249, 115, 22, 0.12); border: 1px solid rgba(249, 115, 22, 0.4); color: #fcd9a8; font-size: 12px; font-weight: 700; }
.es-input { margin-top: 6px; width: 100%; max-width: 220px; padding: 5px 7px; font-size: 13px; }
.es-service { cursor: default; }
.es-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 6px; }
.es-pick > span { width: 38px; font-size: 11px; color: var(--text-faint); font-weight: 600; }
.es-pick .mini { padding: 2px 7px; font-size: 11px; }
.es-swatch.small { width: 18px; height: 18px; }
.es-contents { margin: 5px 0 0 16px; padding: 0; font-size: 11px; color: #e8dcc0; font-weight: 400; line-height: 1.5; }
.es-bundle { border-color: rgba(200, 160, 255, 0.45); background: linear-gradient(135deg, rgba(90, 42, 138, 0.22), rgba(40, 20, 60, 0.1)); }
.es-name .chat-badge { margin-right: 5px; }

/* ---- Feedback and reports (js/feedback.js, v0.37) ---- */
#feedback { left: 50%; top: 100px; transform: translateX(-50%); width: 440px; max-width: calc(100vw - 20px); z-index: 14; }
.fb-kinds { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 8px; }
.fb-kind { padding: 5px 10px; border-radius: 14px; background: rgba(0, 0, 0, 0.25); border: 1px solid #5d4628; color: var(--text-dim); font-size: 13px; cursor: pointer; }
.fb-kind.on { background: rgba(231, 195, 108, 0.2); border-color: #e0b040; color: var(--gold-text); }
.fb-text { width: 100%; box-sizing: border-box; resize: vertical; min-height: 80px; padding: 7px 9px; border-radius: 6px; border: 1px solid #5d4628;
  background: rgba(0, 0, 0, 0.35); color: var(--text); font: inherit; font-size: 13.5px; }
.fb-status { min-height: 18px; margin: 6px 0 2px; color: #ffb38a; font-size: 13px; }
.fb-buttons { display: flex; justify-content: flex-end; gap: 8px; }
.fb-thanks { font-size: 14px; }
/* Vessa's Daily / Weekly tabs (v0.37) */
.b-tabs { margin: 2px 0 6px; }

/* ---- Phones and tablets (v0.39, js/touch.js) ---- */

#touch { position: absolute; inset: 0; pointer-events: none; z-index: -1; }   /* (under every window) */
#touch > * { pointer-events: auto; }
body.touch { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
body.touch input, body.touch textarea { -webkit-user-select: text; user-select: text; }
body.touch #game { touch-action: none; }
.tc-hint { position: absolute; left: 70px; bottom: 70px; width: 120px; height: 120px; border-radius: 50%; pointer-events: none !important;
  border: 2px dashed rgba(255, 230, 170, 0.28); color: rgba(255, 230, 170, 0.45); font: 600 13px var(--sans, sans-serif);
  display: flex; align-items: center; justify-content: center; text-shadow: 0 1px 2px #000; }
.tc-stick { position: fixed; width: 128px; height: 128px; margin: -64px 0 0 -64px; border-radius: 50%; display: none; pointer-events: none !important;
  background: radial-gradient(circle, rgba(30, 22, 14, 0.25), rgba(30, 22, 14, 0.45)); border: 2px solid rgba(255, 220, 150, 0.45); }
.tc-stick.on { display: block; }
.tc-knob { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #f6dc9a, #b08a46 70%); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5); border: 2px solid #5a4520; }
.tc-btn { position: absolute; border-radius: 50%; padding: 0; border: 2px solid #7a5f36; color: #f6e6c0; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  background: radial-gradient(circle at 40% 35%, rgba(90, 66, 40, 0.92), rgba(36, 26, 16, 0.92)); font-weight: 700; touch-action: none; }
.tc-btn.down { filter: brightness(1.35); transform: scale(0.94); }
#tc-attack { right: 26px; bottom: 26px; width: 100px; height: 100px; font-size: 40px; border-color: #c9a646; }
#tc-attack span { display: block; line-height: 1; text-shadow: 0 2px 3px #000; }
.tc-btn.small { width: 54px; height: 54px; font-size: 14px; right: 288px; }   /* (0.50: moved left to make room for skills 5 and 6) */
#tc-use { bottom: 26px; font-size: 14px; transition: box-shadow 0.15s, opacity 0.15s; }
#tc-use.long { font-size: 12px; }
#tc-use.idle { opacity: 0.6; }
#tc-use.on { border-color: #f0c860; box-shadow: 0 0 0 2px rgba(240, 200, 96, 0.35), 0 4px 12px rgba(0, 0, 0, 0.45); }
#tc-use.wait { border-color: #6fc0e8; }
#tc-use.bite { border-color: #ff6b4d; background: radial-gradient(circle at 40% 35%, #e0483c, #8a1f16); color: #fff; animation: tc-bite 0.3s ease-in-out infinite alternate; }
@keyframes tc-bite { from { transform: scale(1); } to { transform: scale(1.18); } }
body.touch #castbar { pointer-events: auto; bottom: 230px; }
#tc-potion { bottom: 90px; }
#tc-mana { bottom: 154px; }
#tc-ride { bottom: 218px; font-size: 24px; }
#tc-mana.hidden + #tc-ride { bottom: 154px; }
.tc-flask { position: absolute; left: 50%; top: 50%; width: 18px; height: 24px; margin: -14px 0 0 -9px; border-radius: 5px 5px 9px 9px; border: 2px solid #e8dcc0; }
.tc-btn.hp .tc-flask { background: linear-gradient(transparent 35%, #d0453a 35%); }
.tc-btn.mp .tc-flask { background: linear-gradient(transparent 35%, #3a78d0 35%); }
.tc-count { position: absolute; right: -2px; bottom: -2px; min-width: 20px; padding: 0 4px; border-radius: 9px; background: #1c150f; border: 1px solid #7a5f36; font-size: 12px; line-height: 18px; }
.tc-btn.empty { opacity: 0.5; }
/* The ability bar becomes an arc round the Attack button. */
body.touch #hotbar { z-index: -1; left: auto; right: 0; bottom: 0; width: 290px; height: 240px; transform: none; display: block; padding: 0; background: none; border: 0; box-shadow: none; pointer-events: none; }
body.touch #hotbar.hidden { display: none; }
body.touch .hb-slot { position: absolute; width: 60px; height: 60px; pointer-events: auto; touch-action: manipulation; }
body.touch .hb-slot:nth-child(1) { right: 148px; bottom: 22px; }
body.touch .hb-slot:nth-child(2) { right: 140px; bottom: 98px; }
body.touch .hb-slot:nth-child(3) { right: 78px; bottom: 148px; }
body.touch .hb-slot:nth-child(4) { right: 10px; bottom: 150px; margin: 0; }
body.touch .hb-slot:nth-child(5) { right: 218px; bottom: 44px; }   /* (0.50: two more, a second ring to the left: higher up they'd sit under the quest list) */
body.touch .hb-slot:nth-child(6) { right: 210px; bottom: 118px; }
body.touch .hb-book { display: none; }                             /* (the Menu has the spell book) */
body.touch .hb-slot.empty { opacity: 0.45; }
body.touch .hb-slot.down { filter: brightness(1.35); }
body.touch .hb-key, body.touch .hb-slot .hb-tip, body.touch #help { display: none !important; }
/* The chat moves to the bottom middle, out of the thumbs' way. */
body.touch #chat { left: 50%; bottom: 6px; transform: translateX(-50%); width: min(420px, 36vw); }
body.touch #talk-prompt { left: auto; right: 296px; bottom: 30px; transform: none; font-size: 14px; }
body.touch #talk-prompt kbd, body.touch #talk-prompt .talk-or { display: none; }
body.touch kbd[data-bind] { display: none; }
body.touch .win-close { min-width: 34px; min-height: 34px; font-size: 22px; }
#rotate-hint { position: fixed; inset: 0; z-index: 50; background: rgba(12, 9, 6, 0.92); color: var(--text, #f0e2c0); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 30px; font-size: 20px; }
#rotate-hint.hidden { display: none; }
.rh-phone { width: 60px; height: 100px; border: 4px solid #e7c36c; border-radius: 12px; animation: rh-turn 2s ease-in-out infinite; }
@keyframes rh-turn { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }

/* ---- The Discord bot (v0.40) ---- */
.dc-mark { display: inline-block; margin-right: 5px; padding: 0 5px; border-radius: 4px; background: #5865f2; color: #fff; font: 700 9.5px/15px var(--sans, sans-serif);
  letter-spacing: 0.3px; vertical-align: 1px; text-transform: uppercase; }
.st-code { margin: 6px 0; padding: 8px 10px; border-radius: 6px; background: rgba(88, 101, 242, 0.16); border: 1px solid rgba(88, 101, 242, 0.5); font-size: 13px; }
.st-code code { font: 700 14px/1.4 ui-monospace, Consolas, monospace; color: #e6e8ff; user-select: all; -webkit-user-select: all; }

/* The dungeon window's door switch (v0.40.1): heroic is purple, so the change shows. */
.fd-diff-text.heroic { color: #d9c2ff; }
.fd-diffs.heroic { box-shadow: 0 0 0 1px rgba(155, 89, 182, 0.35); border-radius: 8px; }
.event-bar.ev-ward { border-color: #9b7ae0; box-shadow: 0 0 12px rgba(150, 110, 240, 0.35); }
.event-bar.ev-ward b { color: #cdb6ff; }
.event-bar.ev-ward.open { border-color: #e0b040; box-shadow: 0 0 14px rgba(240, 200, 90, 0.4); }
.event-bar.ev-ward.open b { color: #ffd86a; }

/* ---- The target frame (v0.45, js/targeting.js) ---- */
#target-frame { position: absolute; top: 46px; left: 290px; width: 230px; padding: 7px 10px 6px; border-radius: 8px; background: var(--wood); border: 1px solid #8a3a2a; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45); pointer-events: none; }
#target-frame.tf-boss { border-color: #b048c8; box-shadow: 0 0 12px rgba(180, 70, 210, 0.35); }
#target-frame.tf-player { border-color: #d0503a; }
.tf-top { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
#target-frame .pf-level { min-width: 22px; height: 22px; font-size: 12px; }
.tf-name { flex: 1; font-family: var(--serif); font-weight: 700; font-size: 14px; color: #ffd0b8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-tag { font-size: 10.5px; padding: 1px 6px; border-radius: 8px; background: rgba(176, 72, 200, 0.3); color: #f0c8ff; white-space: nowrap; }
#target-frame.tf-player .tf-tag { background: rgba(208, 80, 58, 0.3); color: #ffc0b0; }
.tf-bar { position: relative; height: 14px; border-radius: 7px; overflow: hidden; background: rgba(20, 8, 6, 0.8); border: 1px solid rgba(0, 0, 0, 0.5); }
.tf-fill { height: 100%; background: linear-gradient(#e8604a, #a82a1c); transition: width 0.15s; }
#target-frame.tf-boss .tf-fill { background: linear-gradient(#d060e8, #8a2aa8); }
.tf-num { position: absolute; inset: 0; text-align: center; font-size: 10.5px; line-height: 14px; color: #fff; text-shadow: 0 1px 2px #000; }
.tf-hint { margin-top: 4px; font-size: 10.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.touch #target-frame { display: none; }

/* ---- The damage meter (v0.45, js/meter.js) ---- */
#meter { position: absolute; right: 10px; bottom: 170px; width: 250px; padding: 6px 8px 7px; border-radius: 8px; background: var(--wood-glass); border: 1px solid var(--trim); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4); font-size: 12px; }
.mt-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.mt-title { font-family: var(--serif); font-weight: 700; color: var(--gold-text); font-size: 13px; }
.mt-x { background: none; border: 0; color: var(--text-dim); font-size: 16px; line-height: 1; cursor: pointer; padding: 0 2px; }
.mt-tabs { display: flex; gap: 3px; margin-bottom: 5px; }
.mt-tab { flex: 1; padding: 2px 0; font-size: 11px; border-radius: 5px; border: 1px solid rgba(122, 95, 54, 0.5); background: rgba(0, 0, 0, 0.25); color: var(--text-dim); cursor: pointer; }
.mt-tab.on { background: rgba(231, 195, 108, 0.22); color: var(--gold-text); border-color: #b8862a; }
.mt-rows { display: flex; flex-direction: column; gap: 3px; max-height: 190px; overflow-y: auto; }
.mt-row { position: relative; height: 19px; border-radius: 4px; overflow: hidden; background: rgba(0, 0, 0, 0.3); display: flex; align-items: center; justify-content: space-between; padding: 0 6px; }
.mt-row.me { outline: 1px solid rgba(255, 230, 160, 0.5); }
.mt-fill { position: absolute; left: 0; top: 0; bottom: 0; opacity: 0.55; transition: width 0.3s; }
.mt-name, .mt-val { position: relative; color: #fff; text-shadow: 0 1px 2px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-name { font-weight: 700; max-width: 110px; }
.mt-val { font-size: 11px; }
.mt-empty { margin: 6px 0; color: var(--text-dim); font-size: 11.5px; text-align: center; }
.mt-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 5px; color: var(--text-dim); font-size: 11px; }
.mt-reset { padding: 1px 8px; font-size: 11px; border-radius: 5px; border: 1px solid #7a5f36; background: rgba(0, 0, 0, 0.25); color: var(--text); cursor: pointer; }
body.touch #meter { bottom: auto; top: 120px; right: 8px; width: 210px; }
/* (v0.48.4) With the bag open, the meter moves to its left instead of covering it. */
#hud:has(#bag:not(.hidden)) #meter { right: 282px; }
body.touch #hud:has(#bag:not(.hidden)) #meter { right: 282px; }
/* Invite a friend (v0.46, Settings → Account) */
.st-invite input { flex: 1; min-width: 0; font-size: 12px; }
.st-invited { display: flex; flex-direction: column; gap: 3px; margin-bottom: 6px; }
.st-friend { font-size: 12.5px; }

/* ---- Guilds (v0.46): levels, goals, roster, log, banner ---- */
.g-title { display: inline-flex; align-items: center; gap: 6px; }
.g-tabs { margin: 0 0 8px; }
.g-body { overflow-y: auto; min-height: 0; flex: 1; }
.g-level { padding: 8px 10px; border-radius: 7px; background: rgba(231, 195, 108, 0.1); border: 1px solid rgba(184, 134, 42, 0.45); margin-bottom: 8px; }
.g-level-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.g-level-top b { font-family: var(--serif); color: var(--gold-text); font-size: 15px; }
.g-level-top small, .g-perks small { color: var(--text-dim); font-size: 11.5px; }
.g-xpbar { height: 8px; border-radius: 4px; background: rgba(0, 0, 0, 0.4); overflow: hidden; margin: 5px 0; }
.g-xpbar.small { height: 5px; margin: 3px 0 0; }
.g-xpfill { height: 100%; background: linear-gradient(90deg, #b8862a, #f2c94c); }
.g-perks { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: #d8f0c0; }
.g-goals { padding: 7px 10px; border-radius: 7px; background: rgba(0, 0, 0, 0.22); margin-bottom: 8px; display: flex; flex-direction: column; gap: 5px; }
.g-goals-head { display: flex; justify-content: space-between; align-items: baseline; }
.g-goals-head small { color: var(--text-dim); font-size: 11.5px; }
.g-goal-text { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.g-goal-text small { color: var(--text-dim); white-space: nowrap; }
.g-goal.done .g-goal-text span { color: #a8f08a; }
.g-goals .hint { color: var(--text-faint); font-size: 11px; }
.g-list .g-head th { text-align: left; font-size: 11px; font-weight: 600; color: var(--text-dim); padding: 4px 8px; position: sticky; top: 0; background: #2a1f14; }
.g-contrib { color: #f2d48a; font-variant-numeric: tabular-nums; }
.g-log { display: flex; flex-direction: column; gap: 3px; max-height: 360px; overflow-y: auto; font-size: 12.5px; }
.g-log-row { display: flex; gap: 8px; padding: 3px 6px; border-radius: 5px; background: rgba(0, 0, 0, 0.18); }
.g-log-at { color: var(--text-dim); white-space: nowrap; font-size: 11.5px; min-width: 104px; }
.g-banner-edit { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.g-banner-edit .hint { color: var(--text-dim); font-size: 12px; margin: 3px 0 6px; }
.g-pick { margin-bottom: 6px; }
.g-pick small { color: var(--text-dim); font-size: 11.5px; }
.g-pick-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.g-chip { padding: 3px; border-radius: 6px; border: 1px solid rgba(122, 95, 54, 0.5); background: rgba(0, 0, 0, 0.25); cursor: pointer; line-height: 0; }
.g-chip.on { border-color: #f2c94c; box-shadow: 0 0 0 1px #f2c94c inset; }
.g-swatch { display: inline-block; width: 20px; height: 20px; border-radius: 4px; border: 1px solid rgba(0, 0, 0, 0.5); }
.g-ranks { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.g-ranks label { display: flex; flex-direction: column; gap: 2px; }
.g-ranks small { color: var(--text-dim); font-size: 11px; }
#guild .g-ranks input { width: 120px; }
#guild h4 { margin: 10px 0 4px; font: 700 13px var(--serif); color: var(--gold-text); }
/* ---- Leaderboards (v0.46, js/boards.js) ---- */
#boards { left: 50%; top: 70px; transform: translateX(-50%); width: 640px; max-width: calc(100vw - 20px); max-height: calc(100vh - 140px); display: flex; flex-direction: column; z-index: 8; }
.lb-body { overflow-y: auto; min-height: 0; }
.lb-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.lb-table th { text-align: left; font-size: 11px; color: var(--text-dim); font-weight: 600; padding: 4px 6px; }
.lb-table td { padding: 4px 6px; border-bottom: 1px solid rgba(122, 95, 54, 0.22); }
.lb-time { font-variant-numeric: tabular-nums; color: #f2d48a; white-space: nowrap; }
.lb-names { color: var(--text-dim); }
.lb-guild { display: flex; align-items: center; gap: 4px; }
.lb-switch { display: flex; gap: 6px; margin-bottom: 6px; }
.lb-featured { margin: 0 0 6px; padding: 5px 8px; border-radius: 6px; background: rgba(231, 195, 108, 0.12); color: #ffe7a8; font-size: 12.5px; }
#boards .hint { color: var(--text-faint); font-size: 11.5px; }
.wm-featured { display: block; color: #ffe7a8; font-size: 11.5px; }
.panel .pw-wrap { margin-bottom: 10px; }
.panel .pw-wrap > input { margin-bottom: 0; }
#twostep-view .dim-note { margin: 10px 0 0; }
/* (0.48.11) Turn all in / Accept all sit at the left of the quest window's buttons; the row wraps if it must. */
#dialog .dialog-buttons { flex-wrap: wrap; }
#dialog .dialog-buttons .turn-all, #dialog .dialog-buttons .accept-all { padding-left: 10px; padding-right: 10px; }
#dialog .dialog-buttons > :is(.turn-all, .accept-all):first-child { margin-right: auto; }
#party-list li.pm-gone { opacity: 0.6; cursor: default; }   /* (0.48.14) a member who disconnected, place kept */

/* (0.48.17) Items shown in chat, and the Copy menu */
.chat-log .item-link { cursor: help; font-weight: 600; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6); }
.chat-log .item-link:hover { text-decoration: underline; }
.chat-copy { position: fixed; z-index: 80; padding: 4px; border-radius: 7px; background: var(--wood-solid); border: 1px solid #7a5f36; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55); }
.chat-copy button { padding: 4px 14px; border-radius: 5px; border: 1px solid #5d4628; background: rgba(0, 0, 0, 0.25); color: var(--text); font-size: 13px; cursor: pointer; box-shadow: none; }
.chat-copy button:hover { border-color: #e0b040; color: var(--gold-text); }

/* (0.48.17) A plain "Ember Shop" button in the top bar, so everyone sees the shop is there. */
#shop-btn {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 10px; margin-left: 4px;
  border: 1px solid #f97316; border-radius: 11px; background: linear-gradient(#a8401a, #6e2410);
  color: #ffe3c2; font-weight: 800; font-size: 12px; letter-spacing: 0.2px; cursor: pointer;
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.45); animation: shop-glow 2.8s ease-in-out infinite;
}
#shop-btn:hover { background: linear-gradient(#c24d1f, #842c13); }
.shop-btn-icon { font-size: 13px; line-height: 1; }
@keyframes shop-glow { 0%, 100% { box-shadow: 0 0 6px rgba(249, 115, 22, 0.35); } 50% { box-shadow: 0 0 14px rgba(249, 115, 22, 0.7); } }
