/* =====================================================================================================================
   Port of the s&box GameHud.razor.scss: near-black stone panels with the bronze 9-slice frame, spaced Cinzel capitals,
   recessed sockets with rarity glows, rarity-tinted tooltips. Laid out for 1920x1080 inside #ui, which js/uiscale.js
   scales to the window (so 1280x720 is the same layout at 2/3 size).
   ===================================================================================================================== */
@font-face { font-family: Cinzel; src: url(assets/fonts/Cinzel.woff2) format('woff2'), url(assets/fonts/Cinzel.ttf) format('truetype'); font-weight: 400 900; }
@font-face { font-family: Crimson; src: url(assets/fonts/CrimsonPro.woff2) format('woff2'), url(assets/fonts/CrimsonPro.ttf) format('truetype'); font-weight: 200 900; }

:root {
  --gold: #c9a66b; --gold-hi: #ecd5a2; --gold-dim: #6e5a3c; --line: #3a3027; --line-hi: #8a7048;
  --text: #d4c9b6; --text-dim: #a39684; --blood: #b3170f;
  --common: #e8e4dc; --uncommon: #6fdc5a; --rare: #5a9cff; --epic: #c58cff; --legendary: #ff9a2e; --mythic: #ff4a3d;
  --ascended: #4fe8f0; --celestial: #ff7ccf; --divine: #fff0b8; --primordial: #e9c8ff; --unid: #e0603e;
  --title: Cinzel, 'Times New Roman', serif; --body: Crimson, Georgia, serif;
  --well: linear-gradient(to bottom, rgba(24, 21, 18, 0.9), rgba(10, 9, 8, 0.9));
  --well-hover: linear-gradient(to bottom, rgba(44, 37, 29, 0.95), rgba(18, 15, 12, 0.95));
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #050404; color: var(--text); font-family: var(--body); font-size: 20px; user-select: none; }
canvas#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: default; }
#ui { position: fixed; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; pointer-events: none; font-family: var(--body); font-size: 20px; color: var(--text); }
#ui > * { pointer-events: auto; }
/* Display-only layers must never eat clicks: the held item sits right under the cursor, and the log, banners,
   help text, tooltip and death text cover parts of the world. */
#ui > .held, #ui > .tooltip, #ui > .slotmachine, #ui > .log, #ui > .area, #ui > .banner, #ui > .help, #ui > .death,
#ui > .held *, #ui > .tooltip * { pointer-events: none; }
.w-layer { display: contents; }

/* ---------------- shared pieces (mixins in the scss) ---------------- */
.stone, .window, .slot-card, .acct, .hud-panel, .identify, .invite, .slotmachine {
  background-color: #0f0d0b; background-image: url(assets/ui/stone.webp); background-repeat: repeat; background-size: 256px 256px;
  border: 24px solid transparent; border-image: url(assets/ui/frame.webp) 48 / 24px stretch;
  box-shadow: 0 12px 50px rgba(0, 0, 0, 0.9), inset 0 0 70px rgba(0, 0, 0, 0.75);
}
.well { background: var(--well); border: 1px solid var(--line); box-shadow: inset 0 1px 0 rgba(255, 230, 180, 0.04); }
.caps { font-family: var(--title); font-weight: 700; text-transform: uppercase; }
.dim { color: var(--text-dim); }
.points { color: var(--gold-hi); font-weight: 700; margin-left: 4px; }
.hidden { display: none !important; }

/* Buttons (.button in the scss): bevelled dark bronze, spaced capitals. */
button, .button {
  display: inline-flex; justify-content: center; align-items: center; padding: 7px 20px; margin: 4px; min-width: 110px;
  font-family: var(--title); font-weight: 700; text-transform: uppercase; font-size: 14px; letter-spacing: 1.5px;
  color: #d8c194; text-shadow: 0 1px 2px black;
  background: linear-gradient(to bottom, #2b241d, #14110e); border: 1px solid #5a4a35;
  box-shadow: inset 0 1px 0 rgba(255, 225, 170, 0.1), 0 2px 6px rgba(0, 0, 0, 0.8);
  cursor: pointer; transition: all 0.12s ease-out; white-space: nowrap;
}
button:hover, .button:hover { color: #fff2d0; border-color: #b08e5c; background: linear-gradient(to bottom, #40342a, #1b1612); box-shadow: inset 0 1px 0 rgba(255, 225, 170, 0.18), 0 0 14px rgba(220, 160, 80, 0.3); }
button.danger { color: #ff8f74; border-color: #5e2a1f; }
button.danger:hover { border-color: #b0503a; box-shadow: 0 0 14px rgba(220, 80, 50, 0.3); }
button:disabled, button.disabled { opacity: 0.4; cursor: default; }
button:disabled:hover { color: #d8c194; border-color: #5a4a35; background: linear-gradient(to bottom, #2b241d, #14110e); box-shadow: none; }
button.on, button.highlight { color: #fff2d0; border-color: var(--gold); text-shadow: 0 0 10px #e0a850; }
button.small { min-width: 0; padding: 3px 12px; font-size: 12px; margin: 2px; }
button.link { min-width: 0; margin: 0; padding: 0; background: none; border: none; box-shadow: none; color: var(--gold); text-decoration: underline; text-transform: none; font-family: var(--body); font-weight: 400; font-size: 17px; letter-spacing: 0; }
button.link:hover { color: var(--gold-hi); background: none; box-shadow: none; }

/* Text fields. */
input { font-family: var(--body); font-size: 19px; background-color: rgba(0, 0, 0, 0.8); border: 1px solid var(--line-hi); color: #f2e8d4;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.9); padding: 6px 10px; outline: none; }
input:focus { border-color: var(--gold); }
.row { display: flex; gap: 8px; align-items: center; }
.row > input { flex: 1; min-width: 0; }
.buttons { display: flex; flex-direction: row; justify-content: center; margin-top: 8px; flex-wrap: wrap; }

/* Tabs (the tab mixin): underlined, the active one glows. */
.tabs { display: flex; flex-direction: row; justify-content: center; margin-bottom: 10px; }
.tab { padding: 5px 14px; margin: 0 3px; cursor: pointer; color: var(--text-dim); font-family: var(--title); font-weight: 700; text-transform: uppercase;
  font-size: 14px; letter-spacing: 1.5px; border-bottom: 2px solid transparent; display: flex; align-items: center; }
.tab:hover { color: var(--gold-hi); }
.tab.on { color: var(--gold-hi); border-bottom-color: var(--gold); text-shadow: 0 0 10px rgba(230, 180, 100, 0.45); }
.tab.highlight { color: #fff2d0; text-shadow: 0 0 10px #e0a850; }
.tab .tab-icon { width: 24px; height: 24px; margin-right: 7px; background: center / contain no-repeat; }

/* Rarity text colours. */
.r-common, .common > .ti-name { color: var(--common); } .r-uncommon { color: var(--uncommon); } .r-rare { color: var(--rare); } .r-epic { color: var(--epic); }
.r-legendary { color: var(--legendary); } .r-mythic { color: var(--mythic); } .r-ascended { color: var(--ascended); } .r-celestial { color: var(--celestial); }
.r-divine { color: var(--divine); } .r-primordial { color: var(--primordial); } .r-unid { color: var(--unid); }

/* ---------------- title, sign-in and character select ---------------- */
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 40%, #2a1f16, #0c0a08 55%, #020202); }
.screen .logo { font-family: var(--title); font-size: 66px; font-weight: 700; color: var(--gold-hi); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 8px;
  text-shadow: 0 0 40px rgba(230, 150, 60, 0.45), 0 4px 6px black; }
.screen .online { font-family: var(--title); font-weight: 700; text-transform: uppercase; font-size: 15px; letter-spacing: 3px; color: var(--text-dim); margin-bottom: 30px; }
.screen .acct { width: 860px; padding: 10px 18px; display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.screen .acct.narrow { width: 620px; }
.screen .acct h3, .subtitle { font-family: var(--title); font-weight: 700; text-transform: uppercase; font-size: 15px; letter-spacing: 2px; color: var(--gold); margin: 0; text-align: center; }
.slots { display: flex; flex-direction: row; justify-content: center; margin-bottom: 14px; }
.slot-card { width: 300px; height: 230px; margin: 12px; padding: 6px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; transition: box-shadow 0.15s ease-out; }
.slot-card:hover { box-shadow: 0 12px 50px rgba(0, 0, 0, 0.9), inset 0 0 70px rgba(0, 0, 0, 0.6), 0 0 30px rgba(210, 150, 70, 0.25); }
.slot-card .slot-name { font-family: var(--title); font-size: 28px; font-weight: 700; color: var(--gold-hi); letter-spacing: 1px; text-shadow: 0 2px 4px black; }
.slot-card .slot-info { color: var(--text-dim); margin-bottom: 14px; font-size: 17px; }
.slot-card .slot-empty { font-family: var(--title); font-weight: 700; text-transform: uppercase; font-size: 16px; letter-spacing: 3px; color: var(--text-dim); margin-bottom: 14px; }
.slot-card input { width: 220px; margin-bottom: 8px; text-align: center; }
.slot-card .btns { display: flex; justify-content: center; }
.error, .form-error { color: #ff8a7a; min-height: 1.2em; text-align: center; font-size: 18px; }
.hint { color: var(--text-dim); font-size: 16px; }
.hint a { color: var(--gold); }
.hint.warn, .warn { color: #e0a040; }
.account-bar { justify-content: space-between; border-top: 1px solid var(--line); padding-top: 8px; }
.account-bar .hint { flex: 1; }
.keybox { display: flex; flex-direction: column; gap: 8px; }
.keybox[hidden] { display: none; }
.keybox input.key, input.key { flex: 1; font-family: Consolas, 'Courier New', monospace; letter-spacing: 1px; text-transform: uppercase; font-size: 17px; }

/* ---------------- world overlays ---------------- */
.hud-bottom, .log, .area, .players, .banner, .target, .death, .tooltip, .held, .help, .tutorial, .rift-progress, .party-frames, .hurt-vignette, .connecting { pointer-events: none; }
.hurt-vignette { position: absolute; inset: 0; box-shadow: inset 0 0 200px 50px rgba(150, 0, 0, 0.75); opacity: 0; transition: opacity 0.25s; }
.area { position: absolute; top: 18px; right: 30px; font-family: var(--title); font-weight: 700; text-transform: uppercase; font-size: 18px; letter-spacing: 3px; color: var(--gold-hi);
  text-shadow: 0 0 10px black, 0 2px 2px black; }
.players { position: absolute; top: 48px; right: 30px; font-size: 15px; color: var(--text-dim); text-shadow: 0 0 4px black, 0 1px 2px black; }
.log { position: absolute; left: 30px; bottom: 196px; width: 560px; display: flex; flex-direction: column; justify-content: flex-end; max-height: 330px; overflow: hidden; }
.log .line { font-size: 18px; text-shadow: 0 0 3px black, 0 1px 2px black, 0 0 8px black; }
.log .line b { color: #b8dcff; }
.chat-input { position: absolute; left: 30px; bottom: 160px; width: 560px; pointer-events: auto; }
.banner { position: absolute; top: 22%; left: 0; right: 0; text-align: center; font-family: var(--title); font-size: 44px; font-weight: 700; letter-spacing: 6px; text-transform: uppercase;
  color: var(--gold-hi); text-shadow: 0 0 30px rgba(230, 150, 60, 0.45), 0 3px 4px black; transition: opacity 0.6s; opacity: 0; }
.death { position: absolute; top: 33%; left: 0; width: 100%; display: flex; justify-content: center; font-family: var(--title); font-size: 76px; font-weight: 700;
  color: #c0261c; text-transform: uppercase; letter-spacing: 10px; text-shadow: 0 0 40px rgba(140, 0, 0, 0.9), 0 3px 4px black; }
.connecting { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); color: #ff9a6a; }

/* Hovered monster: name in spaced capitals over a framed bar, top centre. */
.target { position: absolute; top: 16px; left: 50%; width: 560px; margin-left: -280px; display: flex; flex-direction: column; align-items: center; }
.target .target-name { font-family: var(--title); font-weight: 700; text-transform: uppercase; font-size: 19px; letter-spacing: 3px; color: #f3e7cd; text-shadow: 0 0 8px black, 0 2px 2px black; white-space: nowrap; }
.target .target-name.champion { color: #7fa6ff; } .target .target-name.leader { color: #e8c35a; } .target .target-name.boss, .target .target-name.worldboss { color: #ff9a3c; font-size: 22px; }
.target .target-bar { width: 400px; height: 14px; margin-top: 5px; padding: 2px; background-color: rgba(0, 0, 0, 0.9); border: 1px solid var(--line-hi); box-shadow: 0 0 0 1px black, 0 4px 14px rgba(0, 0, 0, 0.8); }
.target .target-bar .fill { height: 100%; background: linear-gradient(to bottom, #ff6a4e, #c01e10 45%, #5a0804); box-shadow: 0 0 8px rgba(255, 60, 30, 0.4); }
.target .target-sub { font-size: 15px; color: var(--text-dim); text-shadow: 0 0 4px black; margin-top: 3px; letter-spacing: 0.5px; white-space: nowrap; }

/* The tutorial tracker and rift progress: a band under the target name (centre zone). */
.tutorial { position: absolute; top: 96px; left: 50%; width: 560px; margin-left: -280px; padding: 10px 16px 8px 16px; display: flex; flex-direction: column;
  background: linear-gradient(to right, rgba(10, 9, 8, 0), rgba(10, 9, 8, 0.88) 12%, rgba(10, 9, 8, 0.88) 88%, rgba(10, 9, 8, 0));
  border-top: 1px solid var(--gold-dim); border-bottom: 1px solid var(--gold-dim); }
.tutorial .tut-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.tutorial .tut-title { font-family: var(--title); font-weight: 700; text-transform: uppercase; font-size: 18px; letter-spacing: 2px; color: var(--gold-hi); text-shadow: 0 2px 3px black, 0 0 12px rgba(230, 170, 80, 0.3); }
.tutorial .tut-step { font-family: var(--title); font-weight: 700; text-transform: uppercase; font-size: 13px; letter-spacing: 1.5px; color: var(--text-dim); }
.tutorial .tut-text { font-size: 18px; color: #f0e6d2; line-height: 24px; }
.tutorial .tut-skip { margin-top: 6px; text-align: right; font-size: 15px; color: var(--text-dim); }
.rift-progress { position: absolute; top: 100px; left: 50%; width: 360px; margin-left: -180px; display: flex; flex-direction: column; align-items: center; }
.rift-progress .rp-title { font-family: var(--title); font-weight: 700; text-transform: uppercase; font-size: 17px; letter-spacing: 3px; color: #d2b0ff; text-shadow: 0 0 10px black, 0 2px 2px black, 0 0 16px rgba(185, 140, 255, 0.4); }
.rift-progress .rp-bar { width: 100%; height: 10px; margin-top: 5px; padding: 1px; background-color: rgba(0, 0, 0, 0.85); border: 1px solid #5a3a86; box-shadow: 0 0 0 1px black; }
.rift-progress .rp-bar .fill { height: 100%; background: linear-gradient(to bottom, #d6a8ff, #7a34c8 55%, #35105e); }
.rift-progress .rp-state { font-size: 17px; color: #e8dcc4; text-shadow: 0 0 6px black; margin-top: 3px; }
.rift-progress .rp-state.boss { color: #ff8a6a; font-family: var(--title); font-weight: 700; text-transform: uppercase; font-size: 14px; letter-spacing: 2px; }
.rift-progress .rp-state.done { color: #6fdc5a; font-family: var(--title); font-weight: 700; text-transform: uppercase; font-size: 14px; letter-spacing: 2px; }

/* Help text between the orbs, above the XP strip. */
.help { position: absolute; bottom: 184px; left: 50%; width: 700px; margin-left: -350px; text-align: center; font-size: 15px; color: #bfb29b; text-shadow: 0 0 4px black, 0 1px 2px black; }

/* ---------------- bottom HUD: stone plate, belt of sockets, two orbs ---------------- */
.hud-bottom { position: absolute; left: 0; right: 0; bottom: 0; height: 200px; }
.hud-panel { position: absolute; left: 50%; bottom: 0; width: 900px; height: 152px; margin-left: -450px; padding: 0 46px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: auto; }
.xp-strip { position: absolute; left: 50%; bottom: 160px; width: 660px; height: 16px; margin-left: -330px;
  background-color: rgba(0, 0, 0, 0.9); border: 1px solid var(--line-hi); box-shadow: 0 0 0 1px black, 0 2px 10px rgba(0, 0, 0, 0.8); }
.xp-strip .fill { height: 100%; background: linear-gradient(to bottom, #ffe7a6, #d79a2a 50%, #6e420a); box-shadow: 0 0 10px rgba(255, 190, 80, 0.5); }
.xp-strip .xp-text { position: absolute; left: 0; top: -1px; width: 100%; height: 16px; display: flex; justify-content: center; align-items: center;
  font-family: var(--title); font-size: 13px; font-weight: 700; letter-spacing: 1px; color: #fff4d8; text-shadow: 0 0 3px black, 0 1px 2px black, 0 0 6px black; }

/* Item sockets (.cell): a deep socket with the item's icon; the frame and an inner glow show the rarity. */
.cell { position: relative; width: 86px; height: 86px; margin: 4px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: radial-gradient(circle at 50% 45%, #1c1916, #0a0908 75%); border: 1px solid #2e261e;
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.95), 0 0 0 1px black; cursor: pointer; }
.cell > * { pointer-events: none; }
.cell:hover { border-color: var(--gold); box-shadow: inset 0 0 18px rgba(201, 166, 107, 0.3), 0 0 0 1px black; }
.cell.common, .doll-slot.common { border-color: #5e5952; }
.cell .icon { position: absolute; left: 7px; top: 7px; width: 72px; height: 72px; background: center / contain no-repeat; }
.cell.unid .icon { opacity: 0.55; }
.cell-unid { position: absolute; right: 6px; top: 2px; font-family: var(--title); font-size: 22px; font-weight: 800; color: var(--unid); text-shadow: 0 0 6px black; }
.cell-tier { position: absolute; left: 5px; bottom: 2px; font-family: var(--title); font-size: 14px; font-weight: 700; color: #d6c8ae; text-shadow: 0 1px 2px black, 0 0 4px black; }
.cell-slot { font-family: var(--title); font-weight: 700; text-transform: uppercase; font-size: 11px; letter-spacing: 1px; color: #8f8170; text-align: center; }

/* rarity-frame mixin: cells, paper doll, anvil. */
.uncommon.rf { border-color: #3f8a33; box-shadow: inset 0 0 16px rgba(111, 220, 90, 0.22), 0 0 0 1px black; }
.rare.rf { border-color: #3565b0; box-shadow: inset 0 0 18px rgba(90, 156, 255, 0.28), 0 0 0 1px black; }
.epic.rf { border-color: #8a5cc8; box-shadow: inset 0 0 22px rgba(197, 140, 255, 0.4), 0 0 0 1px black; }
.legendary.rf { border-color: #c06a12; box-shadow: inset 0 0 24px rgba(255, 154, 46, 0.42), 0 0 0 1px black; }
.mythic.rf { border-color: #b8281e; box-shadow: inset 0 0 26px rgba(255, 74, 61, 0.45), 0 0 0 1px black; }
.ascended.rf { border-color: #2aa6ae; box-shadow: inset 0 0 26px rgba(79, 232, 240, 0.45), 0 0 6px rgba(79, 232, 240, 0.4); }
.celestial.rf { border-color: #c04c96; box-shadow: inset 0 0 28px rgba(255, 124, 207, 0.48), 0 0 8px rgba(255, 124, 207, 0.45); }
.divine.rf { border-color: #e8d48a; box-shadow: inset 0 0 30px rgba(255, 236, 170, 0.5), 0 0 10px rgba(255, 230, 150, 0.55); }
.primordial.rf { border-color: #a23cf0; background: rgba(18, 0, 28, 0.95); box-shadow: inset 0 0 30px rgba(180, 60, 255, 0.6), 0 0 12px rgba(255, 60, 90, 0.5); }
.unid.rf { border-color: #7a2e1c; box-shadow: inset 0 0 20px rgba(224, 96, 62, 0.3), 0 0 0 1px black; }
.rf:hover { border-color: var(--gold) !important; }

/* Belt row inside the plate: 4 gear cells, 3 ability cells, 2 potion cells. */
.belt { display: flex; flex-direction: row; justify-content: center; }
.belt .cell { width: 56px; height: 56px; margin: 0 4px; }
.belt .cell .icon { left: 8px; top: 8px; width: 40px; height: 40px; }
.belt .cell .cell-tier { font-size: 13px; }
.belt .cell .cell-slot { font-size: 10px; color: var(--text-dim); white-space: nowrap; }
.belt .skill-cell { width: 76px; border-color: #5a3a86; overflow: hidden; background: radial-gradient(circle at 50% 45%, #2e1a46, #0e0816 80%);
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.9), 0 0 0 1px black, 0 0 10px rgba(150, 90, 230, 0.15); }
.belt .first { margin-left: 16px; }
.belt .skill-cell.empty { border-color: #3a3027; background: radial-gradient(circle at 50% 45%, #1c1916, #0a0908 75%); box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.95), 0 0 0 1px black; }
.belt .skill-cell.empty .cell-slot { white-space: normal; }
.belt .skill-cell:hover { border-color: #b98cff; }
.belt .skill-cd { position: absolute; left: 0; bottom: 0; width: 100%; height: 0; background-color: rgba(0, 0, 0, 0.72); }
.belt .skill-name { position: relative; font-family: var(--title); font-size: 13px; font-weight: 700; color: #dcb4ff; text-align: center; padding: 0 3px; line-height: 15px; text-shadow: 0 1px 2px black, 0 0 6px black; }
.belt .skill-time { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--title); font-size: 24px; font-weight: 700; color: #fff; text-shadow: 0 0 6px black; }
.belt .skill-key { position: absolute; right: 3px; top: 0; font-family: var(--title); font-size: 10px; font-weight: 700; color: #9a86b8; }
.belt .potion-cell { width: 64px; overflow: hidden; }
.belt .potion-cell.health { border-color: #6a2216; background: radial-gradient(circle at 50% 55%, #2a0d09, #0a0606 75%); }
.belt .potion-cell.mana { border-color: #22346e; background: radial-gradient(circle at 50% 55%, #0c1430, #06070c 75%); }
.belt .potion-key { position: absolute; left: 4px; top: 1px; font-family: var(--title); font-size: 13px; font-weight: 700; color: #d6c8ae; text-shadow: 0 1px 2px black; }
.belt .potion-flask { width: 44px; height: 44px; background: center / contain no-repeat; }
.belt .health .potion-flask { background-image: url(assets/ui/flask_red.webp); }
.belt .mana .potion-flask { background-image: url(assets/ui/flask_blue.webp); }
.belt .potion-count { position: absolute; right: 4px; top: 1px; font-family: var(--title); font-size: 15px; font-weight: 700; color: #fff; text-shadow: 0 0 3px black; }
.belt .potion-pct { position: absolute; width: 100%; bottom: 1px; text-align: center; font-size: 13px; font-weight: 700; color: #e2d6bf; text-shadow: 0 1px 2px black; }

/* The menu under the belt: quiet icon + label buttons, lit on hover. */
.menu { display: flex; flex-direction: row; justify-content: center; margin-top: 10px; }
/* Eight buttons must fit between the orbs (about 780 of the panel's 900 px): keep padding and spacing tight. */
.menu button { min-width: 0; padding: 3px 3px 3px 2px; margin: 0; font-size: 11.5px; letter-spacing: 0.2px; flex-shrink: 0;
  background: transparent; border: 1px solid transparent; box-shadow: none; color: #bfae8c; }
.menu button:hover { background: linear-gradient(to bottom, rgba(201, 166, 107, 0.16), rgba(201, 166, 107, 0.04)); border-color: var(--gold-dim); box-shadow: none; color: #fff2d0; }
.menu button.highlight, .menu button.on { color: #fff2d0; border-color: var(--gold-dim); }
.menu .btn-icon { width: 19px; height: 19px; margin-right: 3px; flex-shrink: 0; background: center / contain no-repeat; }
.menu button.disabled .btn-icon { opacity: 0.5; }

/* Life and mana orbs: liquid clipped to the glass, a slow swirl, glass highlight, bronze frame. */
.orb-wrap { position: absolute; bottom: -14px; width: 196px; height: 196px; pointer-events: auto; }
.orb-wrap.life { left: 50%; margin-left: -588px; }
.orb-wrap.mana { left: 50%; margin-left: 392px; }
.orb-wrap .orb-liquid-clip { position: absolute; left: 31px; top: 31px; width: 134px; height: 134px; border-radius: 67px; overflow: hidden; background-color: rgba(6, 4, 4, 0.97); transition: box-shadow 0.2s; }
.orb-wrap .orb-liquid { position: absolute; left: 0; bottom: 0; width: 100%; overflow: hidden; transition: height 0.15s linear; }
.orb-wrap .orb-swirl { position: absolute; left: 0; bottom: 0; width: 134px; height: 134px; background: url(assets/ui/orb_swirl.webp) 0 0 / 100% 100%; opacity: 0.45; animation: orbswirl 18s linear infinite; }
.orb-wrap.mana .orb-swirl { animation-direction: reverse; }
@keyframes orbswirl { to { transform: rotate(360deg); } }
.orb-wrap.life .orb-liquid { background: radial-gradient(circle at 40% 30%, #ff5a3a, #b3130a 45%, #3a0402); }
.orb-wrap.mana .orb-liquid { background: radial-gradient(circle at 40% 30%, #7c98ff, #1a33b0 45%, #05093a); }
.orb-wrap.hurt .orb-liquid-clip { box-shadow: inset 0 0 30px #ff3a1a; }
.orb-wrap .orb-glass, .orb-wrap .orb-frame { position: absolute; left: 0; top: 0; width: 196px; height: 196px; background-size: 100% 100%; pointer-events: none; }
.orb-wrap .orb-glass { background-image: url(assets/ui/orb_glass.webp); }
.orb-wrap .orb-frame { background-image: url(assets/ui/orb_frame.webp); }
.orb-wrap .orb-text { position: absolute; inset: 0; display: flex; justify-content: center; align-items: center;
  font-family: var(--title); font-weight: 700; font-size: 22px; letter-spacing: 1px; color: #fff; text-shadow: 0 0 6px black, 0 2px 3px black, 0 0 12px black; }

/* ---------------- windows ---------------- */
.window { position: absolute; padding: 6px 12px; display: flex; flex-direction: column; z-index: 10; }
.window .win-title { font-family: var(--title); font-weight: 700; text-transform: uppercase; font-size: 20px; letter-spacing: 4px; color: var(--gold-hi); margin: 0 0 10px 0;
  text-align: center; text-shadow: 0 2px 3px black, 0 0 18px rgba(220, 160, 80, 0.3);
  background: url(assets/ui/divider.webp) center bottom / 100% 12px no-repeat; padding-bottom: 14px; }
.window .win-title.small { font-size: 15px; margin-top: 10px; }
.window .win-sub { color: var(--text-dim); margin-bottom: 10px; text-align: center; font-size: 17px; }
.window .win-hint, .win-hint { color: var(--text-dim); font-size: 15px; margin-top: 6px; text-align: center; font-style: italic; }
.window > button { align-self: center; }
.window .x-close { position: absolute; right: -14px; top: -14px; width: 26px; height: 26px; min-width: 0; padding: 0; margin: 0; font-size: 16px; line-height: 1; border-radius: 13px; letter-spacing: 0; z-index: 2; }
.section { font-family: var(--title); font-weight: 700; text-transform: uppercase; font-size: 14px; letter-spacing: 2px; color: var(--gold); margin: 10px 0 4px 0; padding: 0 6px 3px 6px; border-bottom: 1px solid rgba(201, 166, 107, 0.3); }

/* Zones (1080p layout): left windows, right inventory, centre windows. */
.window.left { left: 24px; top: 96px; }
.window.right { right: 24px; top: 96px; }
.window.centre { left: 50%; top: 96px; width: 500px; margin-left: -250px; }

/* Character window: Character | Skills tabs. */
.character { width: 500px; }
.character .stat-row { display: flex; flex-direction: row; align-items: center; height: 30px; padding: 0 8px; border-bottom: 1px solid rgba(255, 230, 180, 0.06); }
.character .stat-row:hover { background-color: rgba(201, 166, 107, 0.06); }
.character .stat-label { flex-grow: 1; font-family: var(--title); font-weight: 700; text-transform: uppercase; font-size: 14px; letter-spacing: 1.5px; color: #d6c8ae; }
.character .stat-value { width: 70px; font-weight: 700; text-align: right; color: #fff; font-size: 20px; }
.character .stat-base { width: 110px; text-align: right; color: var(--text-dim); font-size: 15px; }
.character .derived { background: var(--well); border: 1px solid var(--line); display: flex; flex-direction: column; margin: 10px 0 4px 0; font-size: 17px; color: #d0c3ab; padding: 6px 10px; }
.character .derived .sk { color: #d9a6ff; }
.character .inv-trees { display: flex; flex-direction: column; width: 100%; }
.character .itree { background: var(--well); border: 1px solid var(--line); display: flex; flex-direction: column; margin: 2px 0; padding: 3px 10px; }
.character .itree.active { border-color: var(--gold-dim); box-shadow: inset 0 0 20px rgba(201, 166, 107, 0.12); }
.character .itree-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 3px; padding-bottom: 3px; border-bottom: 1px solid var(--line); }
.character .tree-name { font-family: var(--title); font-weight: 700; text-transform: uppercase; font-size: 15px; letter-spacing: 2px; color: var(--gold-hi); }
.character .tree-note { font-size: 15px; color: var(--text-dim); }
.character .iskill { display: flex; align-items: center; height: 27px; padding: 0 4px; }
.character .iskill .skill-name { flex-grow: 1; font-family: var(--title); font-size: 16px; color: #efe4cc; }
.character .iskill .skill-rank { width: 140px; font-size: 15px; color: var(--text-dim); text-align: right; margin-right: 8px; }
.plus { width: 26px; height: 26px; display: flex; justify-content: center; align-items: center; flex-shrink: 0; font-family: var(--title); font-weight: 700; font-size: 17px; color: #fff2d0; cursor: pointer;
  background: radial-gradient(circle at 50% 35%, #5a4630, #1a140f); border: 1px solid var(--line-hi); border-radius: 20px; box-shadow: 0 0 0 1px black, 0 2px 6px black; }
.plus:hover { border-color: var(--gold-hi); box-shadow: 0 0 0 1px black, 0 0 12px rgba(230, 170, 80, 0.5); }
.plus.off { opacity: 0.25; cursor: default; }
.plus.off:hover { border-color: var(--line-hi); box-shadow: 0 0 0 1px black, 0 2px 6px black; }

/* Inventory: portrait + paper doll, grid, purse. */
.inventory { width: 590px; align-items: center; }
.inventory .doll-row { display: flex; flex-direction: row; align-items: flex-start; justify-content: center; margin-bottom: 10px; }
.inventory .portrait { position: relative; width: 140px; height: 184px; flex-shrink: 0; margin-right: 6px; overflow: hidden; margin-top: 26px;
  background: radial-gradient(circle at 50% 70%, #2a2118, #080706 80%); border: 1px solid var(--line); box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.9), 0 0 0 1px black; }
.inventory .portrait canvas { position: absolute; left: 0; top: 0; width: 140px; height: 184px; }
.paperdoll { display: flex; flex-direction: row; justify-content: center; align-items: flex-start; }
.doll-col { display: flex; flex-direction: column; align-items: center; }
.doll-col .doll-cap { height: 26px; }
.weapon-sets { display: flex; flex-direction: row; margin: 0 5px 4px 5px; justify-content: space-between; height: 22px; }
.weapon-sets .set-tab { flex-grow: 1; display: flex; justify-content: center; align-items: center; margin: 0 2px; padding: 0; font-family: var(--title); font-size: 14px; font-weight: 700; color: #8f8170;
  background: var(--well); border: 1px solid var(--line); cursor: pointer; }
.weapon-sets .set-tab:hover { border-color: var(--gold); color: #e2d6bf; }
.weapon-sets .set-tab.active { color: var(--gold-hi); border-color: var(--gold); background: linear-gradient(to bottom, rgba(80, 60, 30, 0.8), rgba(30, 22, 12, 0.8)); }
.doll-slot { position: relative; margin: 0 5px; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 45%, #1c1916, #0a0908 75%);
  border: 1px solid #2e261e; box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.95), 0 0 0 1px black; cursor: pointer; }
.doll-slot > * { pointer-events: none; }
.doll-slot:hover { border-color: var(--gold); }
.doll-slot.accepts { border-color: #6fdc5a !important; box-shadow: inset 0 0 18px rgba(111, 220, 90, 0.35), 0 0 0 1px black; }
.doll-slot .doll-icon { position: absolute; inset: 4px; display: flex; align-items: center; justify-content: center; }
.doll-slot .doll-icon.lifted { opacity: 0.25; }
.doll-slot .cell-tier { left: 4px; color: #e2d6bf; }
.purse { display: flex; flex-direction: row; justify-content: space-between; width: 100%; padding: 8px 8px 0 8px; margin-top: 6px; border-top: 1px solid var(--line);
  font-family: var(--title); font-weight: 700; text-transform: uppercase; font-size: 15px; letter-spacing: 1.5px; }
.purse .gold { color: #f0c64a; } .purse .scrap { color: #b9c3cc; }

/* The grid: dark sockets; each item sits over its whole footprint, tinted by rarity. */
.item-grid { position: relative; flex-shrink: 0; background-color: rgba(0, 0, 0, 0.7); border: 1px solid var(--line); box-shadow: 0 0 0 1px black; }
.item-grid .grid-cell { position: absolute; border: 1px solid rgba(0, 0, 0, 0.9); background: radial-gradient(circle at 50% 45%, rgba(30, 26, 22, 0.6), rgba(10, 9, 8, 0.6) 80%); pointer-events: none; }
.grid-item { position: absolute; overflow: hidden; display: flex; align-items: center; justify-content: center; cursor: pointer;
  background-color: rgba(70, 68, 64, 0.22); border: 1px solid rgba(160, 150, 130, 0.3); }
.grid-item > * { pointer-events: none; }
.grid-item.uncommon { background: radial-gradient(circle at 50% 50%, rgba(50, 120, 40, 0.28), rgba(20, 45, 15, 0.18)); border-color: rgba(111, 220, 90, 0.5); }
.grid-item.rare { background: radial-gradient(circle at 50% 50%, rgba(35, 75, 150, 0.32), rgba(12, 28, 60, 0.2)); border-color: rgba(90, 156, 255, 0.55); }
.grid-item.epic { background: radial-gradient(circle at 50% 50%, rgba(120, 60, 190, 0.38), rgba(45, 20, 70, 0.22)); border-color: rgba(197, 140, 255, 0.65); }
.grid-item.legendary { background: radial-gradient(circle at 50% 50%, rgba(170, 85, 15, 0.4), rgba(60, 30, 5, 0.22)); border-color: rgba(255, 154, 46, 0.7); }
.grid-item.mythic { background: radial-gradient(circle at 50% 50%, rgba(160, 30, 25, 0.42), rgba(60, 10, 8, 0.24)); border-color: rgba(255, 74, 61, 0.75); }
.grid-item.ascended { background: radial-gradient(circle at 50% 50%, rgba(25, 130, 140, 0.42), rgba(8, 45, 50, 0.24)); border-color: rgba(79, 232, 240, 0.8); }
.grid-item.celestial { background: radial-gradient(circle at 50% 50%, rgba(160, 55, 125, 0.44), rgba(60, 20, 50, 0.25)); border-color: rgba(255, 124, 207, 0.85); }
.grid-item.divine { background: radial-gradient(circle at 50% 50%, rgba(180, 160, 90, 0.45), rgba(70, 60, 30, 0.26)); border-color: rgba(255, 240, 184, 0.9); }
.grid-item.primordial { background: radial-gradient(circle at 50% 50%, rgba(100, 15, 160, 0.5), rgba(60, 0, 15, 0.4)); border-color: rgba(180, 60, 255, 0.95); }
.grid-item.unid { background: radial-gradient(circle at 50% 50%, rgba(140, 40, 20, 0.32), rgba(50, 15, 8, 0.2)); border-color: rgba(224, 96, 62, 0.5); }
.grid-item:hover { border-color: var(--gold-hi); background-color: rgba(201, 166, 107, 0.2); }
.grid-item.lifted { opacity: 0.25; }
.grid-item.unid canvas { opacity: 0.6; }
.grid-item .cell-tier { left: 3px; bottom: 1px; font-size: 13px; color: #e2d6bf; }
.grid-item .cell-unid { right: 4px; top: 0; font-size: 18px; }
.grid-preview { position: absolute; pointer-events: none; display: none; }
.grid-preview.ok { display: block; background-color: rgba(80, 200, 70, 0.25); border: 2px solid rgba(111, 220, 90, 0.9); }
.grid-preview.bad { display: block; background-color: rgba(200, 50, 40, 0.25); border: 2px solid rgba(239, 97, 80, 0.9); }
.held { position: absolute; z-index: 900; opacity: 0.92; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.9)); }
.held canvas { display: block; }

/* Tooltip: a rarity-tinted header band with the name, then sections split by tapered hairlines. */
.tooltip { position: absolute; z-index: 1000; width: 390px; padding: 0 0 12px 0; display: flex; flex-direction: column; align-items: center;
  background-color: rgba(6, 5, 4, 0.97); border: 1px solid #4a3c2a; box-shadow: 0 0 0 1px black, 0 10px 40px black, inset 0 0 40px rgba(0, 0, 0, 0.8); font-size: 18px; line-height: 1.25; }
.tooltip > * { flex-shrink: 0; padding-left: 16px; padding-right: 16px; text-align: center; }
.tooltip .tt-name { width: 100%; padding-top: 10px; padding-bottom: 6px; font-family: var(--title); font-size: 20px; font-weight: 700; letter-spacing: 1px; text-shadow: 0 2px 3px black;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08); background: linear-gradient(to bottom, rgba(120, 116, 108, 0.28), rgba(40, 38, 35, 0.1)); color: var(--common); }
.tooltip .tt-name.uncommon { color: var(--uncommon); border-bottom-color: rgba(111, 220, 90, 0.3); background: linear-gradient(to bottom, rgba(50, 120, 40, 0.35), rgba(20, 45, 15, 0.1)); }
.tooltip .tt-name.rare { color: var(--rare); border-bottom-color: rgba(90, 156, 255, 0.35); background: linear-gradient(to bottom, rgba(35, 75, 150, 0.4), rgba(12, 28, 60, 0.1)); }
.tooltip .tt-name.epic { color: var(--epic); border-bottom-color: rgba(197, 140, 255, 0.4); background: linear-gradient(to bottom, rgba(110, 55, 170, 0.45), rgba(45, 20, 70, 0.1)); text-shadow: 0 2px 3px black, 0 0 14px rgba(197, 140, 255, 0.5); }
.tooltip .tt-name.legendary { color: var(--legendary); border-bottom-color: rgba(255, 154, 46, 0.45); background: linear-gradient(to bottom, rgba(160, 80, 10, 0.5), rgba(60, 30, 5, 0.1)); text-shadow: 0 2px 3px black, 0 0 14px rgba(255, 154, 46, 0.55); }
.tooltip .tt-name.mythic { color: var(--mythic); border-bottom-color: rgba(255, 74, 61, 0.5); background: linear-gradient(to bottom, rgba(150, 25, 20, 0.5), rgba(60, 10, 8, 0.1)); text-shadow: 0 2px 3px black, 0 0 16px rgba(255, 74, 61, 0.6); }
.tooltip .tt-name.ascended { color: var(--ascended); border-bottom-color: rgba(79, 232, 240, 0.5); background: linear-gradient(to bottom, rgba(20, 120, 130, 0.5), rgba(8, 45, 50, 0.1)); text-shadow: 0 2px 3px black, 0 0 16px rgba(79, 232, 240, 0.6); }
.tooltip .tt-name.celestial { color: var(--celestial); border-bottom-color: rgba(255, 124, 207, 0.55); background: linear-gradient(to bottom, rgba(150, 50, 120, 0.5), rgba(60, 20, 50, 0.1)); text-shadow: 0 2px 3px black, 0 0 18px rgba(255, 124, 207, 0.65); }
.tooltip .tt-name.divine { color: var(--divine); border-bottom-color: rgba(255, 240, 184, 0.6); background: linear-gradient(to bottom, rgba(170, 150, 80, 0.55), rgba(70, 60, 30, 0.1)); text-shadow: 0 2px 3px black, 0 0 18px rgba(255, 236, 170, 0.75); }
.tooltip .tt-name.primordial { color: var(--primordial); border-bottom-color: rgba(180, 60, 255, 0.7); background: linear-gradient(to bottom, rgba(90, 10, 140, 0.6), rgba(120, 10, 30, 0.25)); text-shadow: 0 2px 3px black, 0 0 20px rgba(180, 60, 255, 0.85), 0 0 6px rgba(255, 60, 90, 0.8); }
.tooltip .tt-name.unid { color: var(--unid); border-bottom-color: rgba(224, 96, 62, 0.35); background: linear-gradient(to bottom, rgba(130, 40, 20, 0.4), rgba(50, 15, 8, 0.1)); }
.tooltip .tt-name.skill { color: #dcb4ff; border-bottom-color: rgba(185, 140, 255, 0.4); background: linear-gradient(to bottom, rgba(90, 50, 150, 0.45), rgba(30, 15, 50, 0.1)); }
.tooltip .tt-kind { width: 100%; font-family: var(--title); font-weight: 700; text-transform: uppercase; font-size: 12px; letter-spacing: 1.5px; color: var(--text-dim); padding-top: 6px; padding-bottom: 2px; background-color: rgba(255, 255, 255, 0.02); }
.tooltip .tt-sep { width: 70%; height: 1px; padding: 0; margin: 7px 0; background: linear-gradient(to right, rgba(201, 166, 107, 0), rgba(201, 166, 107, 0.45), rgba(201, 166, 107, 0)); }
.tooltip .tt-base { color: #ece6da; }
.tooltip .tt-req { color: #ece6da; } .tooltip .tt-req.low { color: #ff4a3d; }
.tooltip .tt-line { color: #8fb6ff; }
.tooltip .tt-unknown { color: #b08a7a; font-style: italic; }
.tooltip .tt-skill-name { color: #d9a6ff; font-family: var(--title); font-weight: 700; text-transform: uppercase; font-size: 13px; letter-spacing: 1px; }
.tooltip .tt-skill { color: #cbb8e0; font-size: 16px; }
.tooltip .tt-compare-title { font-family: var(--title); font-weight: 700; text-transform: uppercase; font-size: 12px; letter-spacing: 1.5px; color: var(--gold); margin-bottom: 2px; }
.tooltip .tt-compare2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; width: 100%; box-sizing: border-box; padding: 0 14px; }
.tooltip .tt-cmp-col { min-width: 0; text-align: center; }
.tooltip .tt-cmp-col .tt-diff { font-size: 15px; line-height: 1.25; }
.tooltip .tt-cmp-col + .tt-cmp-col { border-left: 1px solid rgba(201,160,90,0.25); padding-left: 12px; }
.tooltip .tt-cmp-head { font-family: var(--title); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: #b9ab90; margin-bottom: 3px; display: flex; flex-direction: column; }
.tooltip .tt-cmp-head span { font-family: var(--body, inherit); text-transform: none; letter-spacing: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-cmp-head .common { color: var(--common); } .tt-cmp-head .uncommon { color: var(--uncommon); } .tt-cmp-head .rare { color: var(--rare); }
.tt-cmp-head .epic { color: var(--epic); } .tt-cmp-head .legendary { color: var(--legendary); } .tt-cmp-head .mythic { color: var(--mythic); }
.tooltip .tt-diff { font-size: 17px; } .tooltip .tt-diff.good { color: #6fe06a; } .tooltip .tt-diff.bad { color: #ef6150; }
.tooltip .tt-price { color: #f0c64a; font-size: 17px; }
.tooltip .tt-hint { margin-top: 8px; color: var(--text-dim); font-size: 15px; font-style: italic; }

/* ---------------- identify: the slot machine (plays at the cursor like the tooltip) ---------------- */
.slotmachine { position: absolute; z-index: 1001; width: 420px; padding: 4px 10px; display: flex; flex-direction: column; align-items: center; pointer-events: none; transition: box-shadow 0.3s; }
.slotmachine .id-title { font-family: var(--title); font-weight: 700; text-transform: uppercase; font-size: 18px; letter-spacing: 3px; color: var(--gold-hi); margin-bottom: 8px; text-shadow: 0 2px 2px black; text-align: center; }
.slotmachine .id-title .dim { text-transform: none; letter-spacing: 0; font-family: var(--body); font-weight: 400; font-size: 16px; }
.slotmachine .id-hint { margin-top: 6px; font-size: 14px; color: var(--text-dim); font-style: italic; }
.reel { width: 100%; height: 34px; margin: 2px 0; display: flex; justify-content: center; align-items: center; overflow: hidden;
  background-color: rgba(0, 0, 0, 0.75); border: 1px solid var(--line); font-family: var(--title); font-size: 18px; font-weight: 800; color: #8f8070; white-space: nowrap; }
.reel.rarity { height: 48px; font-size: 26px; margin-bottom: 6px; }
.reel.locked { border-color: var(--gold-dim); background-color: rgba(30, 22, 12, 0.85); color: #8fb4ff; }
.reel.locked.blank { color: #4a4238; }
.reel.flash { background-color: rgba(120, 86, 30, 0.9); border-color: #ffe2a0; }
.reel.locked.common { color: var(--common); }
.reel.locked.uncommon { color: var(--uncommon); text-shadow: 0 0 10px rgba(111, 220, 90, 0.5); }
.reel.locked.rare { color: var(--rare); text-shadow: 0 0 12px rgba(90, 156, 255, 0.6); }
.reel.locked.epic { color: var(--epic); text-shadow: 0 0 14px rgba(197, 140, 255, 0.8); }
.reel.locked.legendary { color: var(--legendary); text-shadow: 0 0 16px rgba(255, 154, 46, 0.85); }
.reel.locked.mythic { color: var(--mythic); text-shadow: 0 0 16px rgba(255, 74, 61, 0.9); }
.reel.locked.ascended { color: var(--ascended); text-shadow: 0 0 18px rgba(79, 232, 240, 0.9); }
.reel.locked.celestial { color: var(--celestial); text-shadow: 0 0 18px rgba(255, 124, 207, 0.9); }
.reel.locked.divine { color: var(--divine); text-shadow: 0 0 20px rgba(255, 236, 170, 1); }
.reel.locked.primordial { color: var(--primordial); text-shadow: 0 0 20px rgba(180, 60, 255, 1), 0 0 6px rgba(255, 60, 90, 0.9); }
.slotmachine.done.uncommon { box-shadow: 0 0 36px rgba(111, 220, 90, 0.4); }
.slotmachine.done.rare { box-shadow: 0 0 50px rgba(90, 156, 255, 0.5); }
.slotmachine.done.epic { box-shadow: 0 0 70px rgba(192, 140, 255, 0.8); }
.slotmachine.done.legendary { box-shadow: 0 0 80px rgba(255, 154, 46, 0.85); }
.slotmachine.done.mythic { box-shadow: 0 0 90px rgba(255, 74, 61, 0.9); }
.slotmachine.done.ascended { box-shadow: 0 0 100px rgba(79, 232, 240, 0.9); }
.slotmachine.done.celestial { box-shadow: 0 0 110px rgba(255, 124, 207, 0.95); }
.slotmachine.done.divine { box-shadow: 0 0 120px rgba(255, 236, 170, 1); }
.slotmachine.done.primordial { box-shadow: 0 0 130px rgba(180, 60, 255, 1), 0 0 40px rgba(255, 60, 90, 0.9); }

/* ---------------- town services ---------------- */
.stash { align-items: center; }
.stash .stash-tabs { display: flex; flex-direction: row; justify-content: center; margin-bottom: 8px; }
.merchant { width: 600px; }
.merchant.selling { box-shadow: 0 12px 50px rgba(0, 0, 0, 0.9), inset 0 0 70px rgba(0, 0, 0, 0.6), 0 0 30px rgba(201, 166, 107, 0.45); }
.sell-slot { display: flex; flex-direction: row; align-items: center; padding: 8px 10px; margin-bottom: 8px; min-height: 60px; cursor: pointer;
  background-color: rgba(0, 0, 0, 0.55); border: 1px dashed var(--line-hi); }
.sell-slot.armed { border: 1px solid var(--gold); background-color: rgba(70, 52, 24, 0.75); box-shadow: inset 0 0 20px rgba(201, 166, 107, 0.3); }
.sell-slot.refuse { border: 1px solid #a0402c; background-color: rgba(80, 20, 12, 0.6); }
.sell-slot .sell-icon { width: 42px; height: 42px; flex-shrink: 0; margin-right: 12px; display: flex; justify-content: center; align-items: center; font-family: var(--title); font-size: 24px; font-weight: 700; color: var(--gold-hi);
  background: radial-gradient(circle at 50% 40%, #3a2e20, #100c09); border: 1px solid var(--gold-dim); border-radius: 21px; }
.sell-slot .sell-text { flex: 1; font-size: 17px; color: #efe2c4; }
.gamble-head { display: flex; flex-direction: row; justify-content: center; align-items: center; margin-bottom: 8px; }
.gamble-head .tier-text { font-family: var(--title); font-size: 17px; color: #e8dcc4; margin: 0 14px; }
.gamble-head .tier-text .dim { font-size: 15px; margin-left: 6px; font-family: var(--body); }
.gamble-head .plus { width: 30px; height: 30px; font-size: 16px; }
.gamble-grid { display: flex; flex-direction: row; flex-wrap: wrap; justify-content: center; }
.gamble-card { width: 116px; height: 126px; margin: 4px; padding: 6px 4px; display: flex; flex-direction: column; align-items: center; cursor: pointer;
  background: var(--well); border: 1px solid var(--line); }
.gamble-card > * { pointer-events: none; }
.gamble-card:hover { background: var(--well-hover); border-color: var(--line-hi); box-shadow: inset 0 0 18px rgba(201, 166, 107, 0.15); }
.gamble-card.poor { opacity: 0.45; }
.gamble-card .gamble-icon { width: 100%; height: 64px; background: center / contain no-repeat; }
.gamble-card .gamble-name { font-family: var(--title); font-size: 14px; font-weight: 700; color: #e6dccb; margin-top: 2px; text-align: center; }
.gamble-card .gamble-cost { font-size: 16px; font-weight: 700; color: #f0c64a; }
.gamble-card.uncommon { border-color: #3f8a33; } .gamble-card.rare { border-color: #3565b0; } .gamble-card.epic { border-color: #8a5cc8; } .gamble-card.legendary { border-color: #c06a12; }
.gamble-card.mythic { border-color: #b8281e; } .gamble-card.ascended { border-color: #2aa6ae; } .gamble-card.celestial { border-color: #c04c96; } .gamble-card.divine { border-color: #e8d48a; }
.gamble-card.primordial { border-color: #a23cf0; } .gamble-card.unid { border-color: #7a2e1c; }
.forge { width: 460px; align-items: center; }
.hammer-toggle { display: flex; flex-direction: row; align-items: center; width: 100%; padding: 6px 10px; margin: 6px 0; cursor: pointer; background: var(--well); border: 1px solid var(--line); }
.hammer-toggle:hover { background: var(--well-hover); border-color: var(--line-hi); }
.hammer-toggle.on { border: 1px solid #ff9a4a; background: rgba(90, 40, 14, 0.7); box-shadow: inset 0 0 18px rgba(255, 140, 60, 0.4); }
.hammer-toggle .hammer-icon { width: 38px; height: 38px; flex-shrink: 0; margin-right: 10px; background: url(assets/ui/menu/hammer.webp) center / contain no-repeat; }
.hammer-toggle.reroll .hammer-icon { filter: hue-rotate(200deg) saturate(1.4); }
.hammer-toggle .hammer-text { flex: 1; font-size: 16px; color: #efe2c4; }
.hammer-toggle .hammer-text b { font-family: var(--title); font-size: 14px; letter-spacing: 1px; text-transform: uppercase; color: var(--gold-hi); display: block; }
.waypoint { width: 460px; margin-left: -230px !important; }
.wp-tabs { display: flex; flex-direction: row; justify-content: center; margin: 4px 0 8px 0; }
.wp-tab { flex-grow: 1; text-align: center; padding: 5px 0; margin: 0 2px; cursor: pointer; font-family: var(--title); font-weight: 700; text-transform: uppercase; font-size: 13px; letter-spacing: 1.5px; color: #8f8470;
  background: var(--well); border: 1px solid var(--line); }
.wp-tab:hover { color: #e8dcc4; border-color: var(--line-hi); }
.wp-tab.on { color: var(--gold-hi); border-color: var(--gold); background: linear-gradient(to bottom, rgba(80, 60, 30, 0.8), rgba(30, 22, 12, 0.8)); }
.wp-list { display: flex; flex-direction: column; }
.wp-row { flex-shrink: 0; display: flex; flex-direction: column; padding: 4px 12px; margin: 2px 3px; cursor: pointer; background: var(--well); border: 1px solid var(--line); }
.wp-row:hover { border-color: #8fb4ff; background: linear-gradient(to right, rgba(40, 60, 110, 0.55), rgba(12, 14, 22, 0.6)); }
.wp-row.here { opacity: 0.55; cursor: default; }
.wp-row .wp-name { font-family: var(--title); font-size: 17px; font-weight: 700; color: #b4ceff; }
.wp-row .wp-info { font-size: 15px; color: var(--text-dim); }

/* Item rows (trade offers, auction listings): icon, name in its rarity colour. */
.w-list { display: flex; flex-direction: column; max-height: 360px; overflow-y: auto; padding-right: 2px; }
.w-list.short { max-height: 200px; }
.trade-item { display: flex; flex-direction: row; align-items: center; padding: 4px 8px; margin: 2px 0; background: var(--well); border: 1px solid var(--line); min-width: 0; }
.trade-item.click { cursor: pointer; }
.trade-item:hover { background: var(--well-hover); border-color: var(--line-hi); }
.trade-item .ti-icon { width: 36px; height: 36px; flex-shrink: 0; margin-right: 10px; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.trade-item .ti-info { flex: 1; min-width: 0; display: flex; flex-direction: column; pointer-events: none; }
.trade-item .ti-name { font-family: var(--title); font-size: 15px; font-weight: 700; color: var(--common); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trade-item .ti-sub { font-size: 15px; color: var(--text-dim); }
.trade-item .ah-price { margin-right: 8px; font-size: 17px; font-weight: 700; color: #f0c64a; white-space: nowrap; }
.trade-item.uncommon { border-left: 2px solid #3f8a33; } .trade-item.uncommon .ti-name { color: var(--uncommon); }
.trade-item.rare { border-left: 2px solid #3565b0; } .trade-item.rare .ti-name { color: var(--rare); }
.trade-item.epic { border-left: 2px solid #8a5cc8; } .trade-item.epic .ti-name { color: var(--epic); }
.trade-item.legendary { border-left: 2px solid #c06a12; } .trade-item.legendary .ti-name { color: var(--legendary); }
.trade-item.mythic { border-left: 2px solid #b8281e; } .trade-item.mythic .ti-name { color: var(--mythic); }
.trade-item.ascended { border-left: 2px solid #2aa6ae; } .trade-item.ascended .ti-name { color: var(--ascended); }
.trade-item.celestial { border-left: 2px solid #c04c96; } .trade-item.celestial .ti-name { color: var(--celestial); }
.trade-item.divine { border-left: 2px solid #e8d48a; } .trade-item.divine .ti-name { color: var(--divine); }
.trade-item.primordial { border-left: 2px solid #a23cf0; } .trade-item.primordial .ti-name { color: var(--primordial); }
.trade-item.unid { border-left: 2px solid #7a2e1c; } .trade-item.unid .ti-name { color: var(--unid); }
.trade-cols { display: flex; flex-direction: row; }
.trade-col { flex: 1; min-width: 0; margin: 0 4px; padding: 6px; display: flex; flex-direction: column; min-height: 200px; background: var(--well); border: 1px solid var(--line); }
.trade-col.accepted { border: 1px solid #6fdc5a; box-shadow: inset 0 0 20px rgba(111, 220, 90, 0.22); }
.trade-col .tc-title { font-family: var(--title); font-weight: 700; text-transform: uppercase; font-size: 14px; letter-spacing: 2px; color: var(--gold-hi); text-align: center; margin-bottom: 6px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.trade-col .tc-gold { display: flex; align-items: center; margin-top: 8px; gap: 4px; }
.trade-col .tc-gold input { width: 100px; flex: none; font-size: 17px; height: 32px; }
.trade-col .tc-sum { margin-top: 6px; font-size: 16px; color: #e8dcc4; text-align: center; }
.trade-col .tc-sum .gold { color: #f0c64a; font-weight: 700; }
.ah-nav { display: flex; align-items: center; justify-content: space-between; margin: 4px 0; }
.ah-nav .w-mid { flex: 1; text-align: center; font-family: var(--title); font-size: 15px; font-weight: 700; letter-spacing: 1px; color: #e8dcc4; text-transform: uppercase; }
.gold-amount { color: #f0c64a; font-weight: 700; }

/* Shared look for name/info rows (party, rift ready check, chronicler). */
.party-row { display: flex; flex-direction: row; align-items: center; padding: 6px 10px; margin: 2px 0; background: var(--well); border: 1px solid var(--line); }
.party-row .pr-name { width: 170px; flex-shrink: 0; font-family: var(--title); font-size: 16px; font-weight: 700; color: #b8dcff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.party-row .pr-info { flex-grow: 1; font-size: 16px; color: var(--text-dim); }
.party-row .pr-info.ready { color: #6fdc5a; }
.chronicle input { margin: 6px 0; font-size: 20px; }

/* The Rift. */
.rift-grid { display: flex; flex-direction: row; flex-wrap: wrap; justify-content: center; margin: 4px 0 8px 0; }
.rift-cell { width: 38px; height: 26px; margin: 2px; font-size: 13px !important; display: flex; justify-content: center; align-items: center; cursor: pointer; font-family: var(--title); font-size: 16px; font-weight: 700; color: #c9b8e8;
  background: var(--well); border: 1px solid var(--line); }
.rift-cell:hover { border-color: #b98cff; }
.rift-cell.done { color: #6fdc5a; }
.rift-cell.on { border: 1px solid #b98cff; background: radial-gradient(circle at 50% 50%, rgba(110, 55, 180, 0.8), rgba(40, 18, 70, 0.8)); color: #fff2d0; box-shadow: 0 0 12px rgba(185, 140, 255, 0.4); }
.rift-detail { background: var(--well); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; padding: 10px; margin-bottom: 6px; }
.rift-detail .rt-name { font-family: var(--title); font-weight: 700; text-transform: uppercase; font-size: 17px; letter-spacing: 2px; color: #d2b0ff; }
.rift-detail .rt-info { font-size: 16px; color: var(--text-dim); text-align: center; }

/* ---------------- party frames, invites, player menu ---------------- */
.party-frames { position: absolute; left: 24px; top: 14px; display: flex; flex-direction: column; z-index: 5; }
.pf { width: 230px; margin-bottom: 6px; padding: 6px 10px; display: flex; flex-direction: column; background: linear-gradient(to right, rgba(10, 9, 8, 0.9), rgba(10, 9, 8, 0.55)); border-left: 2px solid var(--gold-dim); }
.pf.self { border-left-color: var(--gold); }
.pf-name { font-family: var(--title); font-size: 15px; font-weight: 700; color: #b8dcff; text-shadow: 0 1px 2px black; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-name .pf-level { color: var(--gold); margin-left: 6px; font-size: 13px; }
.pf-bar { height: 6px; margin-top: 4px; background-color: rgba(0, 0, 0, 0.85); border: 1px solid black; box-shadow: 0 0 0 1px rgba(60, 110, 45, 0.45); }
.pf-bar .fill { height: 100%; background: linear-gradient(to bottom, #86e86e, #2f8a22 60%, #17500f); }
.pf-where { font-size: 15px; color: var(--text-dim); margin-top: 1px; }
.pf-tp { pointer-events: auto; align-self: flex-start; margin-top: 4px; padding: 2px 8px; cursor: pointer; font-family: var(--title); font-weight: 700; text-transform: uppercase; font-size: 11px; letter-spacing: 1px;
  color: #a9c8ff; background-color: rgba(20, 30, 60, 0.7); border: 1px solid rgba(140, 180, 255, 0.45); }
.pf-tp:hover { color: #fff2d0; border-color: var(--gold); }
.invite { position: absolute; left: 50%; bottom: 220px; width: 440px; margin-left: -220px; padding: 6px 12px; display: flex; flex-direction: column; align-items: center; z-index: 12; }
.invite .invite-text { font-family: var(--title); font-size: 18px; color: #fff2d0; margin-bottom: 4px; text-align: center; }
.player-menu { position: absolute; width: 220px; padding: 8px; display: flex; flex-direction: column; z-index: 20;
  background-color: rgba(8, 7, 6, 0.97); border: 1px solid var(--line-hi); box-shadow: 0 0 0 1px black, 0 8px 30px black; }
.player-menu .pm-name { font-family: var(--title); font-size: 18px; font-weight: 700; color: #b8dcff; padding: 0 4px; }
.player-menu .pm-info { font-size: 15px; color: var(--text-dim); margin-bottom: 6px; padding: 0 4px 6px 4px; border-bottom: 1px solid var(--line); }
.player-menu .pm-option { font-family: var(--title); font-weight: 700; text-transform: uppercase; font-size: 13px; letter-spacing: 1.5px; color: #e8dcc4; padding: 6px 8px; margin: 1px 0; cursor: pointer; border-left: 2px solid transparent; }
.player-menu .pm-option:hover { color: #fff2d0; border-left-color: var(--gold); background-color: rgba(201, 166, 107, 0.1); }
.player-menu .pm-option.dim { color: var(--text-dim); }
.player-menu .pm-option.disabled { color: #5e574b; cursor: default; }
.player-menu .pm-option.disabled:hover { color: #5e574b; border-left-color: transparent; background: none; }

/* ---------------- maps ---------------- */
.minimap { position: absolute; top: 84px; right: 24px; width: 200px; height: 200px; cursor: pointer; border-radius: 14px; border: 1px solid rgba(201, 166, 107, 0.3);
  box-shadow: 0 0 0 1px black, 0 6px 20px rgba(0, 0, 0, 0.7); z-index: 3; }
.minimap:hover { border-color: rgba(201, 166, 107, 0.6); }
.mm-key { position: absolute; top: 260px; right: 32px; font-size: 11px; font-weight: 700; color: rgba(255, 255, 255, 0.75); padding: 1px 6px; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 4px; background-color: rgba(0, 0, 0, 0.45); pointer-events: none; z-index: 4; }
.fullmap { position: absolute; left: 50%; top: 96px; margin-left: -330px; width: 660px; padding: 10px; display: flex; flex-direction: column; z-index: 11;
  background-color: rgba(8, 7, 6, 0.85); border: 1px solid rgba(201, 166, 107, 0.3); border-radius: 16px; box-shadow: 0 0 0 1px black, 0 12px 50px black; backdrop-filter: blur(8px); }
.fullmap .fm-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 10px 6px; }
.fullmap .fm-title { font-family: var(--title); font-weight: 700; text-transform: uppercase; font-size: 15px; letter-spacing: 3px; color: var(--gold-hi); }
.fullmap .fm-close { display: flex; align-items: center; font-size: 13px; color: rgba(255, 255, 255, 0.6); cursor: pointer; }
.fullmap .fm-close:hover { color: white; }
.fullmap canvas { width: 640px; height: 640px; border-radius: 12px; }

/* ---------------- options (Esc) ---------------- */
.options-backdrop { position: absolute; inset: 0; z-index: 30; background: radial-gradient(circle at 50% 45%, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.8)); }
.window.options { left: 50%; top: 80px; width: 660px; margin-left: -330px; padding: 8px 16px; }
.options .opt-body { display: flex; flex-direction: column; min-height: 300px; }
.options .opt-row { display: flex; flex-direction: row; align-items: center; padding: 7px 10px; margin: 3px 0; background: var(--well); border: 1px solid var(--line); }
.options .opt-text { display: flex; flex-direction: column; flex: 1; margin-right: 12px; }
.options .opt-label { font-family: var(--title); font-weight: 700; text-transform: uppercase; font-size: 14px; letter-spacing: 1.5px; color: #e8dcc4; }
.options .opt-desc { font-size: 15px; color: var(--text-dim); }
.options .opt-choices { display: flex; flex-shrink: 0; }
.options .opt-choice { padding: 4px 12px; margin-left: 4px; font-family: var(--title); font-weight: 700; text-transform: uppercase; font-size: 12px; letter-spacing: 1px; color: var(--text-dim); cursor: pointer;
  background-color: rgba(0, 0, 0, 0.55); border: 1px solid var(--line); }
.options .opt-choice:hover { color: #fff2d0; border-color: var(--line-hi); }
.options .opt-choice.on { color: var(--gold-hi); border-color: var(--gold); background: linear-gradient(to bottom, rgba(80, 60, 30, 0.85), rgba(30, 22, 12, 0.85)); }
.options .vol { display: flex; align-items: center; flex-shrink: 0; }
.options .vol-mute { padding: 3px 8px; margin-right: 6px; font-size: 15px; color: var(--text-dim); cursor: pointer; border: 1px solid var(--line); background-color: rgba(0, 0, 0, 0.55); }
.options .vol-mute:hover { color: #fff2d0; } .options .vol-mute.on { color: #ff8a6a; border-color: #ff8a6a; }
.options .vol-notch { width: 20px; height: 22px; margin: 0 2px; cursor: pointer; background-color: rgba(0, 0, 0, 0.65); border: 1px solid var(--line); }
.options .vol-notch:hover { border-color: var(--gold); }
.options .vol-notch.on { background: linear-gradient(to bottom, #f0d08a, #9c7f48); border-color: #2a1e10; }
.options .vol.muted .vol-notch.on { opacity: 0.35; }
.options .vol-pct { width: 56px; text-align: right; font-family: var(--title); font-size: 16px; font-weight: 700; color: var(--gold-hi); }
.options .opt-note { margin: 8px 4px 2px 4px; font-size: 15px; color: var(--text-dim); }
.options .bind-row { display: flex; align-items: center; padding: 3px 10px; margin: 1px 0; height: 34px; background: var(--well); border: 1px solid var(--line); }
.options .bind-name { flex: 1; font-size: 16px; color: #e8dcc4; }
.options .bind-key { width: 150px; height: 26px; display: flex; justify-content: center; align-items: center; font-family: var(--title); font-size: 14px; font-weight: 700; color: var(--gold-hi);
  background: linear-gradient(to bottom, #241e18, #0e0c0a); border: 1px solid #4a3c2a; border-radius: 3px; box-shadow: 0 2px 0 black; }
.options .footer { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }

.error:empty { min-height: 0; }

/* =====================================================================================================================
   Dark-gothic finish (art direction: heavy bronze frames, engraved plaques, socketed slots, wings on the orbs).
   ===================================================================================================================== */
.window .win-title { background: url(assets/ui/plaque.webp) center 0 / min(100%, 440px) 46px no-repeat, url(assets/ui/divider.webp) center bottom / 100% 12px no-repeat;
  min-height: 46px; padding: 12px 40px 22px 40px; margin: -2px 0 8px 0; line-height: 22px; }
.window .win-title.small { background: url(assets/ui/divider.webp) center bottom / 100% 12px no-repeat; padding: 0 0 14px 0; min-height: 0; }
.window::before, .window::after { content: ''; position: absolute; top: -40px; width: 30px; height: 30px; background: url(assets/ui/star.webp) center / contain no-repeat; pointer-events: none; filter: drop-shadow(0 2px 3px black); }
.window::before { left: -39px; } .window::after { right: -39px; }
.window { box-shadow: 0 14px 60px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(0, 0, 0, 0.8), inset 0 0 80px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 220, 160, 0.06); }
button { background: url(assets/ui/button.webp) center / 100% 100%; border: 1px solid #4a3a26; }
button:hover { background: url(assets/ui/button_hover.webp) center / 100% 100%; }
button:disabled:hover { background: url(assets/ui/button.webp) center / 100% 100%; }
.menu button, .menu button:hover, button.link, button.link:hover { background-image: none; }
.menu button:hover { background: linear-gradient(to bottom, rgba(201, 166, 107, 0.16), rgba(201, 166, 107, 0.04)); }
.item-grid .grid-cell { background: url(assets/ui/slot.webp) 0 0 / 100% 100%; border: none; opacity: 0.85; }
.doll-slot, .cell { background-image: url(assets/ui/slot.webp); background-size: 100% 100%; }
.belt .skill-cell:not(.empty) { background: url(assets/ui/skill_slot.webp) 0 0 / 100% 100%; }
.belt .potion-cell.health { background: radial-gradient(circle at 50% 55%, rgba(90, 20, 12, 0.55), rgba(0, 0, 0, 0) 70%), url(assets/ui/slot.webp) 0 0 / 100% 100%; }
.belt .potion-cell.mana { background: radial-gradient(circle at 50% 55%, rgba(20, 36, 100, 0.55), rgba(0, 0, 0, 0) 70%), url(assets/ui/slot.webp) 0 0 / 100% 100%; }
.xp-strip { height: 22px; bottom: 158px; border: 5px solid transparent; border-image: url(assets/ui/xp_frame.webp) 10 / 5px stretch; background: rgba(0, 0, 0, 0.92); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.8); }
.xp-strip .xp-text { top: -2px; height: 16px; }
.hud-panel::before { content: ''; position: absolute; left: 50%; top: -44px; width: 40px; height: 40px; margin-left: -20px; background: url(assets/ui/star.webp) center / contain no-repeat; filter: drop-shadow(0 2px 4px black); }
.hud-panel::before { display: none; }
.orb-wing { position: absolute; bottom: 0; width: 150px; height: 188px; background: center bottom / contain no-repeat; pointer-events: none; filter: drop-shadow(0 4px 8px black); }
.orb-wing.left { left: 50%; margin-left: -690px; background-image: url(assets/ui/wing_left.webp); }
.orb-wing.right { left: 50%; margin-left: 540px; background-image: url(assets/ui/wing_right.webp); }
.tooltip { border: 12px solid transparent; border-image: url(assets/ui/frame_thin.webp) 24 / 12px stretch; padding: 0 0 8px 0; width: 400px; background-clip: padding-box;
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.95); }
.tooltip .tt-name { margin-top: 0; }
.slot-card .slot-name::after { content: ''; display: block; height: 12px; margin-top: 6px; background: url(assets/ui/divider.webp) center / 100% 12px no-repeat; }
.screen .logo { background: url(assets/ui/divider.webp) center bottom / 70% 14px no-repeat; padding-bottom: 18px; }

/* Stash tabs, merchant size, compact skill trees. */
.stash-tabs .tab.locked { color: #6e6456; cursor: default; }
.stash-tabs .tab.buy { color: #d8c8a4; border: 1px dashed var(--gold-dim); cursor: pointer; }
.stash-tabs .tab.buy:hover { color: #fff2d0; border-color: var(--gold); }
.stash-tabs .tab.poor { opacity: 0.45; cursor: default; }
.merchant { width: 640px; }
.gamble-card { width: 104px; height: 112px; margin: 3px; padding: 4px; }
.gamble-card .gamble-icon { height: 58px; }
.character .itree { padding: 2px 10px; }
.character .itree-head { margin-bottom: 1px; padding-bottom: 2px; }
.character .iskill { height: 24px; }
.character .stat-row { height: 28px; }
.wp-row .wp-name .dim { font-family: var(--body); font-weight: 400; font-size: 14px; }
.character.skills-tab { width: 700px; }
.character.skills-tab .inv-trees { display: grid; grid-template-columns: 1fr 1fr; column-gap: 6px; }
.character.skills-tab .itree:last-child:nth-child(odd) { grid-column: 1 / span 2; }
.character.skills-tab .iskill .skill-rank { width: 110px; }
.log { bottom: 236px; }
.chat-input { bottom: 200px; }
.character .stat-row { height: 25px; }
.character .stat-value { font-size: 18px; }
.character .derived { font-size: 16px; line-height: 20px; margin: 8px 0 2px 0; }
.gamble-card { width: 88px; height: 100px; margin: 2px; padding: 3px 2px; }
.gamble-card .gamble-icon { height: 50px; }
.gamble-card .gamble-name { font-size: 12px; }
.gamble-card .gamble-cost { font-size: 15px; }

.character.skills-tab .iskill .skill-name { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.character.skills-tab .iskill .skill-rank { width: 96px; font-size: 14px; }

/* The Codex (js/codex.js): the game wiki in a bronze frame over the whole window. It lives on <body>, outside the
   scaled #ui layer, so it uses real window pixels. */
.codex-backdrop { position: fixed; inset: 0; z-index: 100; display: flex; padding: 2.5vh 2.5vw; background: rgba(0, 0, 0, 0.72); }
.codex-backdrop[hidden] { display: none; }
.codex { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0;
  background-color: #0b0908; border: 18px solid transparent; border-image: url(assets/ui/frame.webp) 48 / 18px stretch;
  box-shadow: 0 12px 60px rgba(0, 0, 0, 0.95); }
.codex-bar { display: flex; align-items: center; gap: 16px; padding: 2px 4px 10px 8px; border-bottom: 1px solid var(--line); }
.codex-title { font-family: var(--title); font-weight: 700; text-transform: uppercase; letter-spacing: 3px; font-size: 20px; color: var(--gold-hi); }
.codex-hint { flex: 1; min-width: 0; font-size: 16px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.codex-close { margin: 0; min-width: 0; }
.codex-frame { flex: 1; width: 100%; min-height: 0; border: 0; background: #0b0908; }
/* Bottom menu book icon (no painted icon for it yet). */
.menu button[data-m=codex] .btn-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 4.5C6.5 3.5 9.5 3.6 12 5.2c2.5-1.6 5.5-1.7 8-.7v14.8c-2.5-1-5.5-.9-8 .7-2.5-1.6-5.5-1.7-8-.7z' fill='%232b2119' stroke='%23c9a66b' stroke-width='1.4' stroke-linejoin='round'/%3E%3Cpath d='M12 5.2v14.8' stroke='%23c9a66b' stroke-width='1.2'/%3E%3Cpath d='M6.3 8.2c1.3-.3 2.6-.2 3.9.4M6.3 11.2c1.3-.3 2.6-.2 3.9.4M13.8 8.6c1.3-.6 2.6-.7 3.9-.4M13.8 11.6c1.3-.6 2.6-.7 3.9-.4' stroke='%23ecd5a2' stroke-width='.9' stroke-linecap='round'/%3E%3C/svg%3E"); }
.codex-row { align-items: center; gap: 14px; }
.codex-row button { margin: 0; flex: none; }
.codex-row .hint { flex: 1; text-align: left; }

/* Goblin Mercenary window */
.goblin-win { width: 420px; align-items: center; }
.goblin-win .goblin-portrait { position: relative; width: 130px; height: 184px; flex-shrink: 0; margin-top: 26px; overflow: hidden; background: radial-gradient(circle at 50% 70%, rgba(111,157,69,0.18), transparent 70%); }
.goblin-win .goblin-portrait canvas { position: absolute; left: 0; top: 0; width: 130px; height: 184px; }
.goblin-win .doll-slot { flex-shrink: 0; }
.goblin-win .goblin-blurb { font-size: 13px; line-height: 1.45; color: #c9bfa8; margin: 2px 4px 12px; text-align: center; }
.goblin-win .goblin-slots { display: flex; flex-direction: row; justify-content: center; align-items: flex-start; gap: 10px; margin-bottom: 10px; flex-shrink: 0; }
.goblin-win .goblin-cap { height: 26px; line-height: 26px; font-family: var(--title); font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--gold-hi); }
.goblin-win .goblin-stats { width: 100%; border-top: 1px solid var(--line); padding: 8px 10px 4px; margin-bottom: 10px; }
.goblin-win .gs-row { display: flex; justify-content: space-between; font-size: 14px; padding: 3px 0; color: #c9bfa8; }
.goblin-win .gs-row b { color: #a8e890; font-weight: 700; }
.inv-btns { display: flex; gap: 8px; justify-content: center; }
.menu button[data-m=goblin] .btn-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 7.5l5.2 3.2M22 7.5l-5.2 3.2' stroke='%23c9a66b' stroke-width='1.2'/%3E%3Cpath d='M1.5 7l6.3 2.2-.6 3.3zM22.5 7l-6.3 2.2.6 3.3z' fill='%235d8a3a' stroke='%23c9a66b' stroke-width='1' stroke-linejoin='round'/%3E%3Cpath d='M12 4c3.6 0 5.6 2.6 5.6 6.2 0 4.6-2.6 9.3-5.6 9.3s-5.6-4.7-5.6-9.3C6.4 6.6 8.4 4 12 4z' fill='%236f9d45' stroke='%23c9a66b' stroke-width='1.3'/%3E%3Cpath d='M8.6 10.4l2.2.9M15.4 10.4l-2.2.9' stroke='%232b2119' stroke-width='1.2' stroke-linecap='round'/%3E%3Ccircle cx='9.8' cy='12' r='1' fill='%23ffd34d'/%3E%3Ccircle cx='14.2' cy='12' r='1' fill='%23ffd34d'/%3E%3Cpath d='M9.6 16.1c1.5.9 3.3.9 4.8 0' stroke='%232b2119' stroke-width='1.1' fill='none' stroke-linecap='round'/%3E%3Cpath d='M10.6 16.5l.4 1 .5-.9M12.6 16.6l.5.9.4-1' fill='%23ecd5a2'/%3E%3C/svg%3E"); }
