:root {
  --gold: #e8c27a;
  --gold-dim: #b9985a;
  --ink: #0c0d12;
  --panel: rgba(14, 16, 24, 0.9);
  --panel-edge: rgba(232, 194, 122, 0.35);
  --hp: linear-gradient(180deg, #57d36a, #2e9c44);
  --hp-enemy: linear-gradient(180deg, #e0564f, #a3271f);
  --shadow: 0 6px 24px rgba(0,0,0,0.55);
  --font: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* ---- Stylized scrollbars (everywhere in the game UI) ----------------------
   Replaces the default browser scrollbar with a slim, gilded one that matches
   the Isle's gold-on-dark aesthetic. Firefox uses scrollbar-width/color; WebKit
   (Chrome/Edge/Safari) uses the ::-webkit-scrollbar pseudo-elements. */
* { scrollbar-width: thin; scrollbar-color: var(--gold-dim) rgba(8,10,18,0.35); }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: rgba(8,10,18,0.35); border-radius: 99px; }
::-webkit-scrollbar-thumb {
  border-radius: 99px; border: 2px solid transparent; background-clip: padding-box;
  background-color: var(--gold-dim);
  background-image: linear-gradient(180deg, var(--gold), var(--gold-dim));
}
::-webkit-scrollbar-thumb:hover { background-image: linear-gradient(180deg, #f6d99a, var(--gold)); box-shadow: 0 0 8px rgba(232,194,122,0.5) inset; }
::-webkit-scrollbar-thumb:active { background-image: linear-gradient(180deg, var(--gold), #8f7440); }
::-webkit-scrollbar-corner { background: transparent; }

html, body { width: 100%; height: 100%; overflow: hidden; background: #05060a; font-family: var(--font); color: #f1e9d6; }
body { position: fixed; inset: 0; user-select: none; -webkit-user-select: none; }

#game { display: block; width: 100vw; height: 100vh; outline: none; cursor: default; }
#game.looking { cursor: none; }

/* cinematic vignette — sits over the 3D, under the HUD, never intercepts input */
#vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse 78% 78% at 50% 46%, transparent 58%, rgba(8,10,18,0.30) 100%),
    radial-gradient(ellipse at 50% 120%, rgba(8,10,18,0.22), transparent 55%);
}
body.reduce-motion #vignette { display: none; }

.hidden { display: none !important; }

/* ---------- Title / character select ---------- */
#title { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; transition: opacity 0.6s ease; }
#title.fade { opacity: 0; pointer-events: none; }
.title-bg { position: absolute; inset: 0; background:
  radial-gradient(circle at 50% 28%, #28324f 0%, #0a0d18 70%),
  linear-gradient(180deg, #0b1020, #05060c); }
.title-bg::after { content: ""; position: absolute; inset: 0; background-image:
  radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,.7), transparent),
  radial-gradient(1px 1px at 70% 20%, rgba(255,255,255,.6), transparent),
  radial-gradient(1px 1px at 40% 60%, rgba(255,255,255,.5), transparent),
  radial-gradient(1.5px 1.5px at 85% 50%, rgba(255,255,255,.8), transparent),
  radial-gradient(1px 1px at 15% 75%, rgba(255,255,255,.6), transparent),
  radial-gradient(1px 1px at 60% 80%, rgba(255,255,255,.5), transparent);
  opacity: .7; }
.title-inner { position: relative; width: min(720px, 92vw); text-align: center; }
.title-logo { font-size: 76px; font-weight: 800; letter-spacing: 7px; color: #f4ead2; text-shadow: 0 6px 40px rgba(232,194,122,0.35); }
.title-logo span { color: var(--gold); }
.title-tag { margin-top: 4px; color: #9fb0c8; letter-spacing: 1px; font-size: 14px; }
.title-tag em { color: var(--gold-dim); }
#account-bar { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 18px; font-size: 13px; color: #9fb0c8; }
#account-bar .ab-status b { color: var(--gold); }
#account-bar .ab-tip { color: #6f7c92; font-style: italic; }
#account-bar .ab-link { font-family: var(--font); font-size: 13px; font-weight: 700; cursor: pointer; color: #1a1306; background: linear-gradient(180deg, var(--gold), var(--gold-dim)); border: 1px solid var(--gold); border-radius: 6px; padding: 4px 12px; transition: filter .12s; }
#account-bar .ab-link:hover { filter: brightness(1.15); }
#auth-form { margin-top: 22px; }
#auth-form input { width: 100%; padding: 12px 14px; font-family: var(--font); font-size: 15px; color: #f3ead4; text-align: center; background: #11151f; border: 1px solid var(--panel-edge); border-radius: 9px; margin-bottom: 12px; }
#auth-form input:focus { outline: none; border-color: var(--gold); }
#auth-error { color: #ff9b90; font-size: 13px; min-height: 18px; margin-bottom: 4px; }
.cs-loading { text-align: center; color: #6f7c92; padding: 16px; letter-spacing: 4px; }
.cs-head { font-size: 14px; letter-spacing: 3px; text-transform: uppercase; color: var(--gold); margin: 22px 0 14px; font-weight: 700; }
#char-list { display: flex; flex-direction: column; gap: 10px; max-height: 38vh; overflow-y: auto; padding: 2px; }
.char-card { display: flex; align-items: center; gap: 14px; padding: 12px 16px; cursor: pointer; text-align: left;
  background: linear-gradient(180deg, rgba(28,34,50,0.9), rgba(16,20,30,0.9)); border: 1px solid var(--panel-edge);
  border-radius: 10px; box-shadow: var(--shadow); transition: transform .1s, border-color .15s, filter .15s; }
.char-card:hover { transform: translateY(-2px); border-color: var(--gold); filter: brightness(1.12); }
.char-card .cc-emblem { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 26px; background: radial-gradient(circle at 40% 30%, #39435c, #161a26); border: 1px solid var(--panel-edge); }
.char-card .cc-info { flex: 1; min-width: 0; }
.char-card .cc-cname { font-size: 17px; font-weight: 800; color: #f4ecd6; }
.char-card .cc-meta { font-size: 12px; color: #93a0b8; margin-top: 2px; }
.char-card .cc-play { color: var(--gold); font-weight: 800; font-size: 13px; letter-spacing: 1px; }
.char-card .cc-del { width: 26px; height: 26px; flex: 0 0 26px; border-radius: 6px; border: 1px solid #5a3a3a; background: #2a1c1c; color: #ff9b90; font-weight: 800; cursor: pointer; }
.char-card .cc-del:hover { background: #4a2424; }
/* import (bring browser characters into an account) */
.ci-intro { font-size: 12.5px; color: #9aa6bb; line-height: 1.5; margin-bottom: 14px; }
#ci-list { display: flex; flex-direction: column; gap: 9px; max-height: 38vh; overflow-y: auto; padding: 2px; }
.ci-row { display: flex; align-items: center; gap: 11px; padding: 11px 14px; cursor: pointer;
  background: linear-gradient(180deg, rgba(28,34,50,0.9), rgba(16,20,30,0.9)); border: 1px solid var(--panel-edge);
  border-radius: 10px; box-shadow: var(--shadow); transition: border-color .15s, filter .15s; }
.ci-row:hover { border-color: var(--gold); filter: brightness(1.08); }
.ci-row input { width: 17px; height: 17px; accent-color: var(--gold); cursor: pointer; flex: none; }
.ci-row .ci-emblem { font-size: 24px; }
.ci-row .ci-name { font-size: 16px; font-weight: 800; color: #f4ecd6; }
.ci-row .ci-meta { margin-left: auto; font-size: 12px; color: #93a0b8; }

.cs-bigbtn, .cs-primary, .cc-actions button { font-family: var(--font); cursor: pointer; border-radius: 9px; font-weight: 700; transition: filter .12s, transform .1s; }
.cs-bigbtn { margin-top: 14px; width: 100%; padding: 13px; font-size: 15px; color: #f3e8cf; background: linear-gradient(180deg, #28303f, #181d28); border: 1px dashed var(--panel-edge); }
.cs-bigbtn:hover { filter: brightness(1.2); border-style: solid; }
#cc-name { width: 100%; padding: 12px 14px; font-family: var(--font); font-size: 16px; color: #f3ead4; text-align: center;
  background: #11151f; border: 1px solid var(--panel-edge); border-radius: 9px; margin-bottom: 16px; }
#cc-name:focus { outline: none; border-color: var(--gold); }
#cc-classes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.class-card { padding: 16px 12px; cursor: pointer; border-radius: 11px; text-align: center;
  background: linear-gradient(180deg, rgba(28,34,50,0.9), rgba(16,20,30,0.9)); border: 2px solid #2c3447; transition: all .14s; }
.class-card:hover { border-color: var(--gold-dim); transform: translateY(-3px); }
.class-card.sel { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(232,194,122,0.35), var(--shadow); }
.class-card .cl-emblem { font-size: 34px; }
.class-card .cl-name { font-size: 17px; font-weight: 800; color: #f4ecd6; margin: 4px 0; }
.class-card .cl-stats { font-size: 11px; color: var(--gold-dim); font-variant-numeric: tabular-nums; }
.class-card .cl-blurb { font-size: 11.5px; color: #9aa6bb; line-height: 1.4; margin-top: 6px; min-height: 46px; }
.cc-actions { display: flex; gap: 12px; margin-top: 18px; }
.cc-actions button { flex: 1; padding: 12px; font-size: 14px; }
#cc-back { color: #c8d2e4; background: #1b2230; border: 1px solid #33405a; }
.cs-primary { color: #1a1306; background: linear-gradient(180deg, var(--gold), var(--gold-dim)); border: 1px solid var(--gold); }
.cs-primary:disabled { opacity: .4; cursor: not-allowed; filter: none; }
.cs-primary:not(:disabled):hover { filter: brightness(1.15); }
#guide-link, #dungeon-link, #items-link, #classes-link, #redesign-link { display: inline-block; margin-top: 14px; font-family: var(--font); font-size: 13px; letter-spacing: 0.5px; color: var(--gold-dim); text-decoration: none; border: 1px solid var(--panel-edge); border-radius: 999px; padding: 6px 16px; transition: color .15s, border-color .15s, background .15s, box-shadow .15s; }
#dungeon-link, #items-link, #classes-link, #redesign-link { margin-left: 8px; }
#guide-link:hover, #dungeon-link:hover, #items-link:hover, #classes-link:hover, #redesign-link:hover { color: #1a1306; background: linear-gradient(180deg, var(--gold), var(--gold-dim)); border-color: var(--gold); box-shadow: 0 4px 18px -6px rgba(232,194,122,0.5); }

.title-foot { margin-top: 26px; font-size: 12px; color: #6f7c92; font-style: italic; }

/* ---------- Loader ---------- */
#loader {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 35%, #1a2236, #06070c 75%);
  transition: opacity 0.8s ease;
}
#loader.fade { opacity: 0; pointer-events: none; }
.loader-inner { text-align: center; }
.loader-title { font-size: 72px; font-weight: 800; letter-spacing: 6px; color: #f4ead2; text-shadow: 0 4px 30px rgba(232,194,122,0.4); }
.loader-title span { color: var(--gold); }
.loader-sub { margin-top: 6px; font-style: italic; color: #9fb0c8; letter-spacing: 1px; }
.loader-barwrap { width: 320px; height: 6px; margin: 28px auto 10px; background: rgba(255,255,255,0.08); border-radius: 4px; overflow: hidden; }
#loader-bar { width: 0%; height: 100%; background: linear-gradient(90deg, var(--gold-dim), var(--gold)); transition: width 0.3s ease; }
#loader-status { font-size: 13px; color: #7e8aa0; letter-spacing: 1px; }

/* ---------- HUD generic ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#hud > * { pointer-events: auto; }

/* ---------- Unit frames ---------- */
#player-frame { position: absolute; top: 18px; left: 18px; }
/* party frames */
#party-frames { position: absolute; top: 92px; left: 18px; width: 230px; background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 10px; box-shadow: var(--shadow); padding: 8px 10px; }
.pf-head { font-size: 11px; letter-spacing: 2px; color: var(--gold); font-weight: 700; margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; }
#pf-leave { font-family: var(--font); font-size: 10px; font-weight: 700; cursor: pointer; color: #ffb4ab; background: #2a1c1c; border: 1px solid #5a3a3a; border-radius: 5px; padding: 2px 7px; }
#pf-leave:hover { filter: brightness(1.3); }
.pf-member { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.pf-emblem { font-size: 16px; }
.pf-info { flex: 1; min-width: 0; }
.pf-name { font-size: 12px; font-weight: 700; color: #f0e8d4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-member.me .pf-name { color: #ffe08a; }
.pf-name .pf-leader { color: var(--gold); }
.pf-barwrap { height: 9px; margin-top: 2px; background: #11141d; border: 1px solid rgba(0,0,0,0.6); border-radius: 4px; overflow: hidden; }
.pf-bar { height: 100%; background: var(--hp); transition: width .3s; }
/* party invite popup */
#party-invite { position: absolute; top: 30%; left: 50%; transform: translateX(-50%); background: linear-gradient(180deg, rgba(18,21,31,0.97), rgba(10,12,18,0.97)); border: 1px solid var(--gold); border-radius: 12px; box-shadow: 0 10px 50px rgba(0,0,0,0.7); padding: 16px 20px; text-align: center; z-index: 30; }
.pi-text { font-size: 15px; color: #f1e9d6; margin-bottom: 14px; }
.pi-text b { color: var(--gold); }
.pi-actions { display: flex; gap: 10px; justify-content: center; }
.pi-actions button { font-family: var(--font); font-size: 13px; font-weight: 700; cursor: pointer; padding: 8px 18px; border-radius: 8px; color: #f3e8cf; background: linear-gradient(180deg, #2c3447, #1a2030); border: 1px solid var(--panel-edge); }
.pi-actions button:hover { filter: brightness(1.2); }
.roster-invite { font-family: var(--font); font-size: 10px; font-weight: 700; cursor: pointer; color: #1a1306; background: var(--gold); border: none; border-radius: 5px; padding: 3px 8px; margin-left: auto; }
.roster-invite:hover { filter: brightness(1.15); }
/* roster status dots + friend toggle (2.4 P8) */
.roster-row .r-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; background: #6f7a8c; box-shadow: 0 0 5px rgba(0,0,0,.5); }
.roster-row .r-dot.online { background: #5fd06a; box-shadow: 0 0 6px rgba(95,208,106,.7); }
.roster-row .r-dot.away { background: #ffcf5a; box-shadow: 0 0 6px rgba(255,207,90,.7); }
.roster-row .r-dot.offline { background: #5a6273; }
.roster-row.offline { opacity: 0.6; }
.roster-row .r-fav { color: #ffd86b; }
.roster-fav { margin-left: auto; background: none; border: none; color: #ffd86b; font-size: 15px; cursor: pointer; padding: 0 4px; opacity: 0.8; }
.roster-fav:hover { opacity: 1; transform: scale(1.15); }
.roster-row .roster-invite + .roster-fav { margin-left: 6px; }
#chat-feed .cm.party .cm-name { color: #9af0c8; }
#chat-feed .cm.party .cm-text { color: #cfeede; }

#target-frame { position: absolute; top: 92px; left: 18px; }
body.has-party #target-frame { top: 286px; }
.unit-frame {
  display: flex; gap: 10px; width: 320px; padding: 10px;
  background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 10px;
  box-shadow: var(--shadow);}
.uf-portrait {
  width: 52px; height: 52px; flex: 0 0 52px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  background: radial-gradient(circle at 40% 30%, #39435c, #161a26);
  border: 1px solid var(--panel-edge); color: var(--gold);
}
.uf-body { flex: 1; min-width: 0; }
.uf-name { font-weight: 700; font-size: 15px; color: #f6efdc; text-shadow: 0 1px 2px #000; }
.uf-barwrap { position: relative; height: 18px; margin: 4px 0 3px; background: #11141d; border: 1px solid rgba(0,0,0,0.6); border-radius: 5px; overflow: hidden; }
.uf-bar { height: 100%; width: 100%; transition: width 0.45s cubic-bezier(.2,.8,.2,1); }
.uf-bar.hp { background: var(--hp); }
#target-hp-bar { background: var(--hp-enemy); }
.uf-bartext { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; text-shadow: 0 1px 2px #000; letter-spacing: .5px; }
.uf-level { font-size: 11px; color: #93a0b8; font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uf-lv { font-size: 11px; font-weight: 800; color: #1a1306; background: var(--gold); padding: 1px 6px; border-radius: 4px; vertical-align: middle; }
.uf-xpwrap { position: relative; height: 9px; margin-top: 4px; background: #11141d; border: 1px solid rgba(0,0,0,0.6); border-radius: 4px; overflow: hidden; }
.uf-xp { height: 100%; width: 0%; background: linear-gradient(180deg, #b06bff, #7a3fd6); transition: width .5s cubic-bezier(.2,.8,.2,1); }
.uf-xptext { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; color: #e9ddff; text-shadow: 0 1px 2px #000; letter-spacing: .4px; }

/* ---------- Quest tracker ---------- */
#quest-tracker { position: absolute; top: 362px; right: 18px; width: 200px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 10px; box-shadow: var(--shadow); }
.qt-head { font-size: 11px; letter-spacing: 2px; color: var(--gold); font-weight: 700; margin-bottom: 6px; }
.qt-quest { margin-bottom: 8px; }
.qt-quest:last-child { margin-bottom: 0; }
.qt-name { font-size: 13px; font-weight: 700; color: #f0e8d4; text-shadow: 0 1px 2px #000; }
.qt-obj { font-size: 12px; color: #b6c2d6; margin-top: 1px; display: flex; align-items: center; gap: 6px; }
.qt-obj .qt-count { color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums; }
.qt-obj.done { color: #7ee68a; }
.qt-obj.done .qt-count { color: #7ee68a; }
.qt-ready { font-size: 11px; color: #ffe08a; font-style: italic; margin-top: 2px; }
/* HUD tracker: clicking a quest opens the map to its objective (zone-aware) */
.qt-quest { cursor: pointer; border-radius: 5px; transition: background .12s; }
.qt-quest:hover { background: rgba(255,255,255,0.05); }

/* Buffs / Debuffs panels (2.4 "The Quickened Hours") */
#buffs-panel { position: absolute; top: 250px; left: 18px; }
#debuffs-panel { position: absolute; top: 316px; left: 18px; }
.fx-panel { min-width: 124px; max-width: 220px; padding: 7px 9px; background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 10px; box-shadow: var(--shadow); }
.fx-panel.debuff { border-color: rgba(220,96,96,0.42); }
.fx-head { font-size: 11px; letter-spacing: 2px; color: var(--gold); font-weight: 700; margin-bottom: 5px; }
.fx-panel.debuff .fx-head { color: #ff9a8a; }
.fx-row { display: flex; flex-wrap: wrap; gap: 5px; min-height: 30px; align-content: flex-start; }
.fx-chip { position: relative; width: 30px; height: 30px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 17px; background: rgba(40,52,40,0.62); border: 1px solid rgba(120,200,130,0.5); box-shadow: inset 0 0 8px rgba(120,230,140,0.22), 0 1px 3px #000; cursor: default; }
.fx-panel.debuff .fx-chip { background: rgba(54,34,34,0.62); border-color: rgba(220,110,110,0.55); box-shadow: inset 0 0 8px rgba(255,120,110,0.22), 0 1px 3px #000; }
.fx-chip .fx-count { position: absolute; right: -3px; bottom: -4px; font-size: 9px; font-weight: 800; color: #fff; background: #1c241c; border-radius: 5px; padding: 0 3px; line-height: 13px; font-variant-numeric: tabular-nums; box-shadow: 0 1px 2px #000; }
.fx-panel.debuff .fx-chip .fx-count { background: #2a1818; }
@keyframes fxshimmer { 0%,100% { box-shadow: inset 0 0 7px rgba(120,230,140,0.18), 0 1px 3px #000; } 50% { box-shadow: inset 0 0 13px rgba(150,255,170,0.5), 0 0 7px rgba(150,255,170,0.32), 0 1px 3px #000; } }
.fx-chip.shimmer { animation: fxshimmer 2.3s ease-in-out infinite; }
body.reduce-motion .fx-chip.shimmer { animation: none; }

/* ===== "While you were away" — fullscreen recap (2.5 redesign) ===== */
#recap-modal {
  --rc-display: 'Cinzel Decorative','Cinzel',Georgia,serif;
  --rc-head: 'Cinzel',Georgia,serif;
  --rc-body: 'Spectral','EB Garamond',Georgia,serif;
  --rc-gold: #f3c969;
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; overflow: hidden;
  background:
    radial-gradient(1200px 800px at 78% -10%, rgba(120,110,200,.18), transparent 60%),
    radial-gradient(1000px 700px at 8% 8%, rgba(70,150,160,.14), transparent 55%),
    radial-gradient(900px 900px at 50% 50%, rgba(8,10,20,.86), rgba(5,6,12,.96) 70%);
  backdrop-filter: blur(6px);
}
/* the rotating clock motif the player loves — a big gilded ring + ticks behind everything */
.recap-clock { position: absolute; width: min(150vh,150vw); height: min(150vh,150vw); border-radius: 50%; pointer-events: none; opacity: .5;
  background:
    repeating-conic-gradient(from 0deg, rgba(243,201,105,.16) 0deg 0.4deg, transparent 0.4deg 6deg),
    radial-gradient(circle, transparent 38%, rgba(243,201,105,.10) 38.4%, transparent 39.4%, transparent 47%, rgba(243,201,105,.16) 47.4%, transparent 48.6%);
  filter: drop-shadow(0 0 40px rgba(243,201,105,.18)); animation: recapspin 90s linear infinite; }
.recap-clock.inner { width: min(96vh,96vw); height: min(96vh,96vw); opacity: .42; animation: recapspin 60s linear infinite reverse;
  background: repeating-conic-gradient(from 0deg, rgba(243,201,105,.22) 0deg 0.5deg, transparent 0.5deg 30deg),
    radial-gradient(circle, transparent 60%, rgba(243,201,105,.12) 60.5%, transparent 62%); }
@keyframes recapspin { to { transform: rotate(360deg); } }
body.reduce-motion .recap-clock { animation: none; }
/* drifting gold sparkles */
.recap-spark { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #fff2c0; box-shadow: 0 0 10px 3px rgba(243,201,105,.9); pointer-events: none; animation: recapfloat 4s ease-in-out infinite; }
body.reduce-motion .recap-spark { display: none; }
@keyframes recapfloat { 0%,100% { opacity: .25; transform: translateY(0) scale(.7); } 50% { opacity: 1; transform: translateY(-10px) scale(1.25); } }

.recap-stage { position: relative; z-index: 2; width: min(1180px, 94vw); max-height: 96vh; display: flex; flex-direction: column; align-items: center; }
#recap-card {
  position: relative; width: 100%; box-sizing: border-box; max-height: 94vh; overflow-y: auto;
  padding: clamp(18px,2.6vw,38px) clamp(22px,4vw,62px);
  border-radius: 26px; color: #eef0fb; font-family: var(--rc-body); text-align: center;
  background: linear-gradient(180deg, rgba(26,30,48,.92), rgba(10,12,22,.95));
  border: 2px solid rgba(243,201,105,.5);
  box-shadow: 0 30px 100px rgba(0,0,0,.7), 0 0 70px rgba(243,201,105,.18), inset 0 0 60px rgba(243,201,105,.05);
}
.recap-eyebrow { font-family: var(--rc-head); font-weight: 700; letter-spacing: .42em; text-transform: uppercase; color: var(--rc-gold); font-size: clamp(11px,1.4vw,15px); opacity: .92; }
.recap-title { font-family: var(--rc-display); font-weight: 900; line-height: 1.02; margin: .04em 0 .03em; font-size: clamp(34px,5vw,60px); overflow-wrap: break-word;
  background: linear-gradient(180deg,#fff7df,#f3c969 52%,#b07b2e); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 30px rgba(243,201,105,.3)); }
.recap-sub { font-style: italic; color: #c3c8d8; font-size: clamp(14px,1.7vw,19px); }
.recap-chips { display: flex; flex-wrap: wrap; gap: 7px 9px; justify-content: center; margin: clamp(8px,1.2vw,13px) auto 4px; }
.recap-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 13px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(243,201,105,.16), rgba(243,201,105,.06)); border: 1px solid rgba(243,201,105,.4);
  color: #f3e7c8; font-family: var(--rc-head); font-weight: 700; font-size: clamp(12px,1.5vw,16px); letter-spacing: .04em; }
.recap-chip .rc-i { font-size: 1.05em; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.recap-arrival { font-style: italic; color: #d6cba0; font-size: clamp(13px,1.5vw,17px); margin: clamp(6px,1vw,11px) auto 0; max-width: 80%; line-height: 1.45; }
.recap-rule { height: 1px; width: 70%; margin: clamp(10px,1.8vw,18px) auto; background: linear-gradient(90deg, transparent, rgba(243,201,105,.6), transparent); }
.recap-hero { margin: clamp(10px,1.6vw,18px) 0; padding: clamp(12px,2vw,20px); border-radius: 18px; text-align: left;
  background: radial-gradient(120% 140% at 90% -20%, rgba(180,40,55,.4), transparent 60%), linear-gradient(180deg, rgba(120,20,30,.5), rgba(40,12,16,.5));
  border: 1px solid rgba(255,90,90,.5); box-shadow: inset 0 0 40px rgba(255,80,80,.12); }
.recap-hero .rh-k { font-family: var(--rc-head); font-weight: 700; letter-spacing: .26em; text-transform: uppercase; color: #ff9a8a; font-size: clamp(11px,1.3vw,14px); }
.recap-hero .rh-n { font-family: var(--rc-display); font-weight: 900; color: #fff; font-size: clamp(22px,3vw,36px); line-height: 1.04; margin: .08em 0 .14em; }
.recap-hero .rh-b { color: #ffdfe0; font-size: clamp(14px,1.7vw,19px); line-height: 1.45; }
.recap-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: clamp(7px,1.1vw,12px) clamp(16px,2.4vw,32px); margin: clamp(6px,1vw,12px) auto 0; max-width: 940px; text-align: left; }
.recap-fact { display: flex; gap: 13px; align-items: flex-start; font-size: clamp(14px,1.6vw,19px); line-height: 1.35; }
.recap-fact .rf-i { font-size: clamp(20px,2.2vw,26px); width: clamp(28px,2.6vw,36px); text-align: center; flex: 0 0 auto; filter: drop-shadow(0 0 8px rgba(243,201,105,.4)); }
.recap-fact b { color: var(--rc-gold); }
.recap-flavor { margin-top: clamp(10px,1.8vw,18px); padding-top: clamp(9px,1.4vw,15px); border-top: 1px dashed rgba(243,201,105,.28); }
.recap-flavor div { font-style: italic; color: #aab4cb; font-size: clamp(13px,1.5vw,17px); margin: .28em 0; }
.recap-foot { margin-top: clamp(10px,1.8vw,18px); font-family: var(--rc-head); letter-spacing: .14em; color: #8893a8; font-size: clamp(11px,1.3vw,15px); }
.recap-btns { display: flex; gap: 14px; justify-content: center; margin-top: clamp(12px,1.8vw,20px); }
.recap-btns button { font-family: var(--rc-head); font-weight: 700; letter-spacing: .04em; font-size: clamp(13px,1.5vw,17px); padding: 12px 30px; border-radius: 12px; border: 1px solid var(--panel-edge); background: #1a2030; color: #eef3ff; cursor: pointer; transition: filter .12s, transform .12s; }
.recap-btns button.recap-share { background: linear-gradient(180deg,#f3c969,#b07b2e); color: #20160a; border-color: #ffe9ad; box-shadow: 0 6px 24px rgba(243,201,105,.3); }
.recap-btns button:hover { filter: brightness(1.12); transform: translateY(-1px); }

/* cursor-anchored loot popup on a kill (2.5) */
.loot-pop { position: absolute; min-width: 168px; max-width: 230px; padding: 9px 12px 10px; border-radius: 11px;
  background: linear-gradient(180deg, rgba(24,28,40,0.96), rgba(12,15,23,0.96)); border: 1px solid rgba(243,201,105,0.5);
  box-shadow: 0 10px 34px rgba(0,0,0,0.6), 0 0 22px rgba(243,201,105,0.18); color: #eef2fb; font-family: var(--font);
  transform: translateY(6px); opacity: 0; animation: lpIn .22s ease forwards; }
@keyframes lpIn { to { transform: translateY(0); opacity: 1; } }
.loot-pop.lp-out { animation: lpOut .55s ease forwards; }
@keyframes lpOut { to { transform: translateY(-14px); opacity: 0; } }
.loot-pop .lp-x { position: absolute; top: 5px; right: 6px; width: 18px; height: 18px; line-height: 16px; text-align: center; cursor: pointer;
  font-size: 12px; font-weight: 800; color: #9aa3b6; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); border-radius: 5px; padding: 0; }
.loot-pop .lp-x:hover { color: #fff; background: rgba(255,255,255,0.14); }
.loot-pop .lp-head { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); font-weight: 800; margin-bottom: 6px; padding-right: 18px; }
.loot-pop .lp-empty { font-size: 12px; color: #aeb6c6; font-style: italic; padding: 2px 0; }
.loot-pop .lp-row { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 2px 0; }
.loot-pop .lp-ico { font-size: 16px; width: 20px; text-align: center; }
.loot-pop .lp-name { flex: 1; color: #f0e8d4; }
.loot-pop .lp-qty { color: var(--gold); font-weight: 800; font-variant-numeric: tabular-nums; }
.loot-pop .lp-meta { display: flex; gap: 12px; margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(255,255,255,0.08); font-size: 12px; }
.loot-pop .lp-gold { color: #ffdf8a; } .loot-pop .lp-xp { color: #9fe0ff; }
body.reduce-motion .loot-pop { animation: none; opacity: 1; transform: none; }

/* world-boss recommended-buffs row in the target panel (2.4 P6) */
.tr-row { display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.tr-row .tr-label { font-size: 10px; letter-spacing: 1px; color: #ff9a8a; font-weight: 700; margin-right: 2px; }
.tr-chip { width: 21px; height: 21px; border-radius: 5px; display: flex; align-items: center; justify-content: center; font-size: 13px; background: rgba(0,0,0,.35); border: 1px solid rgba(255,120,110,0.5); filter: grayscale(0.7) opacity(0.55); }
.tr-chip.have { filter: none; border-color: rgba(120,230,140,0.8); box-shadow: 0 0 6px rgba(120,230,140,0.5); }
/* Main Story (MSQ) quests get a gold accent that sets them apart from sidequests */
.qt-quest.msq { border-left: 3px solid #ffce5a; padding-left: 7px; background: linear-gradient(90deg, rgba(255,206,90,0.10), transparent 70%); border-radius: 4px; }
.qt-msq { font-size: 10px; font-weight: 800; color: #1a1306; background: #ffce5a; padding: 0 5px; border-radius: 4px; letter-spacing: .5px; vertical-align: middle; }
.ql-quest.msq { border-color: rgba(255,206,90,0.5); box-shadow: inset 3px 0 0 #ffce5a; }
.ql-msq { font-size: 10px; font-weight: 800; color: #1a1306; background: #ffce5a; padding: 1px 6px; border-radius: 4px; letter-spacing: .5px; margin-right: 6px; }

/* Dungeon / Raid quest badges — same shape language as ❖ MAIN, but in the world
   map's instance colours: a crimson ward-arch for dungeons, a bronze bell for
   raids. The little inline SVG glyph sits left of the label. */
.qt-inst, .ql-inst { display: inline-flex; align-items: center; gap: 3px; vertical-align: middle; font-size: 10px; font-weight: 800; letter-spacing: .4px; padding: 0 5px 0 4px; border-radius: 4px; line-height: 1.5; }
.ql-inst { padding: 1px 7px 1px 5px; margin-right: 6px; font-size: 10px; }
.qt-inst.mini, .ql-inst.mini { padding: 0 3px; gap: 0; }
.qk-ico { width: 12px; height: 12px; display: block; filter: drop-shadow(0 1px 1px rgba(0,0,0,.5)); }
.qt-inst.dungeon, .ql-inst.dungeon { color: #ffd9d9; background: linear-gradient(180deg, #7a1e2a, #531019); border: 1px solid #c8606a; box-shadow: 0 0 8px rgba(200,80,80,.35); }
.qt-inst.raid, .ql-inst.raid { color: #2a1d06; background: linear-gradient(180deg, #e6c45c, #c79a32); border: 1px solid #8a6a1e; box-shadow: 0 0 9px rgba(255,210,90,.4); }
/* a quest entry tinted by its instance kind (a subtle left accent, like MSQ's gold) */
.qt-quest.inst-dungeon { border-left: 3px solid #b34a52; padding-left: 7px; background: linear-gradient(90deg, rgba(180,74,82,0.12), transparent 70%); border-radius: 4px; }
.qt-quest.inst-raid { border-left: 3px solid #d8b24a; padding-left: 7px; background: linear-gradient(90deg, rgba(216,178,74,0.12), transparent 70%); border-radius: 4px; }
.ql-quest.inst-dungeon { box-shadow: inset 3px 0 0 #b34a52; }
.ql-quest.inst-raid { box-shadow: inset 3px 0 0 #d8b24a; }

/* ---------- GM world tools (dev panel) ---------- */
.gm-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 12px; color: #b6c2d6; }
.gm-btn { font: 600 11px system-ui, sans-serif; padding: 4px 8px; border-radius: 6px; cursor: pointer;
  background: rgba(255,206,90,0.14); color: #ffe6a8; border: 1px solid rgba(255,206,90,0.4); }
.gm-btn:hover { background: rgba(255,206,90,0.28); }

/* ---------- Generic panels (inventory / quest log) ---------- */
.panel {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: linear-gradient(180deg, rgba(18,21,31,0.97), rgba(10,12,18,0.97));
  border: 1px solid var(--panel-edge); border-radius: 12px; box-shadow: 0 10px 50px rgba(0,0,0,0.7);
  padding: 16px 18px; z-index: 20;
}
#inventory { right: 26px; width: 320px; max-height: 80vh; overflow-y: auto; }
#quest-log { left: 26px; width: 380px; max-height: 76vh; overflow-y: auto; }
.panel-title { font-size: 17px; font-weight: 800; color: var(--gold); letter-spacing: .5px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.panel-sub { font-size: 13px; color: #ffe08a; font-weight: 700; margin-left: auto; }
.panel-x { cursor: pointer; color: #889; font-weight: 700; margin-left: 8px; }
.panel-x:hover { color: #fff; }
/* drag-to-resize corner on every modal */
.panel-resize { position: absolute; right: 3px; bottom: 3px; width: 16px; height: 16px; z-index: 6; cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 45%, var(--gold-dim) 45%, var(--gold-dim) 60%, transparent 60%, transparent 72%, var(--gold-dim) 72%, var(--gold-dim) 87%, transparent 87%);
  opacity: .45; border-radius: 0 0 10px 0; touch-action: none; }
.panel-resize:hover { opacity: 1; }
.panel-note { margin-top: 12px; font-size: 11.5px; color: #7e8aa0; font-style: italic; line-height: 1.5; }

/* bank / stash panel — two side-by-side item grids */
#bank-panel { left: 50%; transform: translate(-50%, -50%); width: 560px; max-width: 92vw; max-height: 78vh; overflow-y: auto; }
/* Ground messages (2.6) */
.gmsg-box { background: linear-gradient(180deg,#1c1810,#12100a); border: 2px solid #5a4a2c; border-radius: 14px; padding: 18px 20px; width: 380px;
  box-shadow: 0 18px 60px rgba(0,0,0,.6); color: #e8dcb8; text-align: center; }
.gmsg-h { font: 700 16px Georgia, serif; color: var(--gold); margin-bottom: 10px; }
.gmsg-preview { font: italic 17px Georgia, serif; color: #fff2c8; background: rgba(0,0,0,.3); padding: 12px; border-radius: 9px; margin-bottom: 12px; min-height: 24px; }
.gmsg-rows { display: flex; flex-direction: column; gap: 8px; text-align: left; margin-bottom: 12px; }
.gmsg-rows label { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12.5px; color: #cdbf95; }
.gmsg-rows select { flex: 1; max-width: 240px; background: #0e0c08; color: #f0e2c0; border: 1px solid #5a4a2c; border-radius: 6px; padding: 5px 7px; font-size: 12.5px; }
.gmsg-btns { display: flex; gap: 10px; justify-content: center; }
.gmsg-btns button { padding: 7px 18px; border-radius: 8px; font-weight: 700; font-size: 13px; cursor: pointer; border: 1px solid var(--gold-dim); }
#gmsg-place { background: linear-gradient(180deg,#3a3320,#241f12); color: var(--gold); }
#gmsg-cancel { background: rgba(255,255,255,0.06); color: #cdd5e4; border-color: #3a4256; }
.gmsg-btns button:hover { filter: brightness(1.2); }
.gmsg-note { font-size: 10.5px; color: #8a7d5c; margin-top: 10px; }
#gmsg-read { position: fixed; top: 14%; left: 0; right: 0; z-index: 70; pointer-events: none; display: none; justify-content: center; }
.gmsg-read-inner { display: inline-flex; align-items: center; gap: 10px; padding: 10px 26px; border-radius: 999px;
  background: radial-gradient(ellipse at center, rgba(20,16,8,.92), rgba(12,10,6,.82)); border: 1px solid rgba(243,201,105,.5);
  box-shadow: 0 6px 30px rgba(0,0,0,.5), 0 0 24px rgba(243,201,105,.18); animation: gmsgrise .4s ease; }
@keyframes gmsgrise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.gmsg-read-clock { font-size: 18px; filter: drop-shadow(0 0 6px rgba(243,201,105,.7)); }
.gmsg-read-text { font: italic 600 18px Georgia, serif; color: #fff2c8; letter-spacing: .3px; }
.gmsg-read-erase { margin-left: 4px; padding: 2px 9px; border-radius: 999px; font: 600 12px Georgia, serif; letter-spacing: .3px;
  color: #ffd9c0; background: rgba(90,30,20,.45); border: 1px solid rgba(243,150,105,.5); }
.gmsg-read-erase b { color: #fff; }
/* Group Finder / LFG (2.6) */
#lfg-panel { min-width: 380px; max-width: 480px; position: relative; }
.lfg-rolehead { font-size: 12px; color: var(--gold-dim); font-weight: 700; margin-bottom: 6px; }
.lfg-rolehint { font-weight: 400; color: #8893a6; }
.lfg-roles { display: flex; gap: 8px; margin-bottom: 12px; }
.lfg-role { flex: 1; padding: 7px 0; border-radius: 8px; border: 1px solid #3a4256; background: rgba(0,0,0,0.25);
  color: #cdd5e4; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.lfg-role:hover { background: rgba(255,255,255,0.05); }
.lfg-role.on { border-color: var(--gold); color: var(--gold); background: linear-gradient(180deg, rgba(243,201,105,.16), rgba(243,201,105,.04)); }
.lfg-list { display: flex; flex-direction: column; gap: 4px; max-height: 46vh; overflow: auto; }
.lfg-sec { font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--gold-dim); font-weight: 700; margin: 8px 0 3px; }
.lfg-row { display: flex; align-items: center; gap: 8px; padding: 6px 6px; border-radius: 7px; background: rgba(0,0,0,0.22); }
.lfg-row:hover { background: rgba(255,255,255,0.04); }
.lfg-row.poor { opacity: 0.5; }
.lfg-row.raid { background: linear-gradient(180deg, rgba(120,80,30,.2), rgba(0,0,0,.22)); }
.lfg-ico { width: 24px; text-align: center; font-size: 16px; }
.lfg-name { flex: 1; font-size: 12.5px; color: #e8edf6; }
.lfg-name small { display: block; font-size: 10px; color: #8893a6; }
.lfg-btns { display: flex; gap: 5px; }
.lfg-q { background: linear-gradient(180deg,#26405a,#16242f); color: #9fd3ff; border: 1px solid #3a6d90; border-radius: 6px; padding: 4px 9px; font-size: 11px; font-weight: 700; cursor: pointer; }
.lfg-q.heroic { background: linear-gradient(180deg,#3a3320,#241f12); color: var(--gold); border-color: var(--gold-dim); }
.lfg-q:hover { filter: brightness(1.2); }
.lfg-locked { font-size: 11px; color: #6b7488; }
.lfg-finding { position: absolute; inset: 0; border-radius: inherit; background: rgba(8,10,16,0.96); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; text-align: center; z-index: 3; }
.lfg-finding.hidden { display: none; }
.lfg-spin { width: 42px; height: 42px; border-radius: 50%; border: 3px solid rgba(243,201,105,0.25); border-top-color: var(--gold); animation: lfgspin 0.9s linear infinite; }
@keyframes lfgspin { to { transform: rotate(360deg); } }
.lfg-ftitle { font-size: 16px; font-weight: 800; color: var(--gold); }
.lfg-fsub { font-size: 12px; color: #b6c2d6; }
.lfg-party { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; max-width: 300px; }
.lfg-pm { font-size: 11px; padding: 3px 9px; border-radius: 999px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); color: #dfe6f2; }
/* the Chronovault (2.6) */
/* centre the Chronovault (it has no left/right rule of its own, so it used to pin
   to the screen's left edge); still freely draggable. */
#chronovault-panel { min-width: 360px; max-width: 460px; left: 50%; transform: translate(-50%, -50%); max-height: 84vh; overflow-y: auto; }
.chrono-hint { font-size: 12px; color: #b6c2d6; line-height: 1.5; margin-bottom: 8px; }
.chrono-rules { font-size: 11px; color: #93a0b8; line-height: 1.5; margin-bottom: 10px; padding: 6px 8px; border-left: 2px solid #3a4358; background: rgba(255,255,255,0.03); border-radius: 4px; }
.chrono-list { display: flex; flex-direction: column; gap: 5px; max-height: 44vh; overflow: auto; }
.chrono-row { display: flex; align-items: center; gap: 8px; padding: 5px; border-radius: 7px; background: rgba(0,0,0,0.22); }
.chrono-rico { width: 30px; height: 30px; flex: none; display: inline-flex; align-items: center; justify-content: center; }
/* Task 10: constrain the item ICON itself (an <img class="chrono-ico img"> or an
   emoji span) so the sprite PNG can't render at its huge natural size and blow the
   whole panel apart. Base box = 30px (list rows); the sealed-view pair overrides
   to 44px below. object-fit keeps the sprite's aspect inside the box. */
.chrono-ico { width: 30px; height: 30px; object-fit: contain; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; }
.chrono-rname { flex: 1; font-size: 12.5px; }
.chrono-rname small { display: block; font-size: 10.5px; color: #6fd3ff; }
.chrono-seal, .chrono-collect { background: linear-gradient(180deg,#1e3a4a,#11212c); color: #9fe3ff; border: 1px solid #3a7da0;
  border-radius: 6px; padding: 4px 12px; font-size: 12px; font-weight: 700; cursor: pointer; }
.chrono-seal:hover, .chrono-collect:hover { background: linear-gradient(180deg,#27495c,#16303e); }
.chrono-empty { font-size: 12px; color: #6b7488; text-align: center; padding: 16px 4px; }
.chrono-pair { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 6px 0 12px; }
.chrono-item { text-align: center; width: 120px; }
.chrono-item .chrono-ico { width: 44px; height: 44px; margin: 0 auto 4px; font-size: 32px; }
.chrono-iname { font-size: 12px; line-height: 1.3; }
.chrono-arrow { font-size: 18px; color: #6fd3ff; }
.chrono-progress { height: 10px; border-radius: 6px; background: rgba(0,0,0,0.35); overflow: hidden; border: 1px solid #2a3346; }
.chrono-bar { height: 100%; background: linear-gradient(90deg,#2f8fd0,#6fd3ff); transition: width .3s; box-shadow: 0 0 10px rgba(111,211,255,.5); }
.chrono-wait { font-size: 12px; color: #b6c2d6; text-align: center; margin-top: 10px; }
.chrono-ready { font-size: 13px; color: #9fe3ff; text-align: center; margin: 10px 0; font-weight: 700; }
.chrono-collect { display: block; margin: 0 auto; padding: 6px 22px; }
/* town outfitter / shop (2.6) */
#shop-panel { min-width: 460px; max-width: 560px; }
.shop-subhead { font-size: 11.5px; color: var(--gold-dim); margin: -2px 0 10px; letter-spacing: .5px; }
.shop-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.shop-col { background: rgba(0,0,0,0.22); border: 1px solid #232a3a; border-radius: 9px; padding: 8px 8px 4px; min-height: 80px; max-height: 46vh; overflow: auto; }
.shop-colhead { font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--gold-dim); font-weight: 700; margin-bottom: 8px; text-align: center; }
.shop-row { display: flex; align-items: center; gap: 7px; padding: 4px 4px; border-radius: 6px; }
.shop-row:hover { background: rgba(255,255,255,0.04); }
.shop-row.poor { opacity: 0.55; }
.shop-row.unsellable { opacity: 0.5; }
.shop-row.unsellable .shop-name { color: #8a93a6; }
.shop-nosell { min-width: 34px; text-align: center; color: #6b7488; font-size: 13px; cursor: help; }
.shop-ico { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 5px; background: rgba(0,0,0,0.3); font-size: 16px; }
.shop-ico .shop-itemico { width: 22px; height: 22px; }
.shop-name { flex: 1; font-size: 12.5px; color: #e8edf6; line-height: 1.2; }
.shop-name small { display: block; font-size: 10px; color: #8893a6; text-transform: capitalize; }
.shop-buybtn, .shop-sell1, .shop-sellall { background: linear-gradient(180deg,#3a3320,#241f12); color: var(--gold); border: 1px solid var(--gold-dim);
  border-radius: 6px; padding: 3px 8px; font-size: 11.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.shop-buybtn:hover:not(:disabled), .shop-sell1:hover, .shop-sellall:hover { background: linear-gradient(180deg,#4a4126,#2e2716); }
.shop-buybtn:disabled { cursor: default; opacity: 0.5; }
.shop-sellall { padding: 3px 6px; opacity: 0.8; }
.shop-empty { font-size: 11.5px; color: #6b7488; text-align: center; padding: 14px 4px; }
.bank-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bank-colhead { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--gold-dim); font-weight: 700; margin-bottom: 8px; text-align: center; }
.bank-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; align-content: start; min-height: 56px;
  background: rgba(0,0,0,0.22); border: 1px solid #232a3a; border-radius: 9px; padding: 8px; }
.bank-empty { grid-column: 1 / -1; text-align: center; color: #5c6478; font-style: italic; font-size: 12px; padding: 14px 0; }

/* inventory tabs */
.inv-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.inv-tab { flex: 1; font-size: 12px; font-weight: 700; padding: 5px 8px; border-radius: 7px; cursor: pointer; color: #8c9ab5; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1); transition: all .15s; }
.inv-tab.on { color: #f0e6c4; background: rgba(232,194,122,.14); border-color: rgba(232,194,122,.4); }
.inv-tab:hover:not(.on) { color: #cdd4e8; background: rgba(255,255,255,.07); }
/* currency panel */
.inv-currency-panel { padding: 4px 0; }
.inv-cur-list { display: flex; flex-direction: column; gap: 10px; }
.inv-cur-row { display: grid; grid-template-columns: 28px 1fr auto; align-items: start; gap: 6px; padding: 8px 10px; background: rgba(255,255,255,.04); border-radius: 8px; border: 1px solid rgba(255,255,255,.08); }
.inv-cur-icon { font-size: 20px; text-align: center; line-height: 1; grid-row: 1 / 3; align-self: center; }
.inv-cur-name { font-size: 13px; font-weight: 700; color: #e6d8b5; }
.inv-cur-val { font-size: 15px; font-weight: 800; color: #f3c84a; grid-row: 1 / 3; align-self: center; }
.inv-cur-desc { grid-column: 2; font-size: 11.5px; color: #8a95b0; line-height: 1.4; }
.inv-cur-none { font-size: 12.5px; color: #7a86a0; font-style: italic; padding: 8px 0; }

/* inventory grid */
#inv-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.inv-slot {
  position: relative; aspect-ratio: 1; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 26px; background: linear-gradient(180deg, #1c2230, #12161f); border: 1px solid #2c3447;
}
.inv-slot.has { border-color: var(--gold-dim); cursor: grab; }
.inv-slot.use { cursor: pointer; }
/* the cell the cursor is over while dragging an item to reorder the bag */
.inv-slot.drop-target { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold), 0 0 14px rgba(232,194,122,0.6); }
body.ab-dragging .inv-slot { cursor: grabbing; }
.inv-slot.use:hover { border-color: var(--gold); filter: brightness(1.2); }
.inv-slot.relic { border-color: #b06bff; box-shadow: inset 0 0 12px rgba(176,107,255,0.25); }
/* rarity tiers (2.0 Phase 2) — recolour the cell border + inner glow */
.inv-slot.r-common    { border-color: #c2c9d2; box-shadow: inset 0 0 10px rgba(194,201,210,0.14); }
.inv-slot.r-uncommon  { border-color: #5fd06a; box-shadow: inset 0 0 12px rgba(95,208,106,0.22); }
.inv-slot.r-rare      { border-color: #4aa3ff; box-shadow: inset 0 0 12px rgba(74,163,255,0.24); }
.inv-slot.r-epic      { border-color: #c264ff; box-shadow: inset 0 0 13px rgba(194,100,255,0.26); }
.inv-slot.r-legendary { border-color: #ff9a3c; box-shadow: inset 0 0 14px rgba(255,154,60,0.32); }
/* Mythic: animated rainbow-gold shimmer border — the apex tier */
.inv-slot.r-mythic {
  border-color: #ff4fa3;
  box-shadow: inset 0 0 18px rgba(255,79,163,0.35), 0 0 8px rgba(255,79,163,0.3);
  animation: mythic-border 3s linear infinite;
}
@keyframes mythic-border {
  0%   { border-color: #ff4fa3; box-shadow: inset 0 0 18px rgba(255,79,163,0.4), 0 0 10px rgba(255,79,163,0.35); }
  16%  { border-color: #ff9a3c; box-shadow: inset 0 0 18px rgba(255,154,60,0.4), 0 0 10px rgba(255,154,60,0.35); }
  33%  { border-color: #ffd700; box-shadow: inset 0 0 18px rgba(255,215,0,0.4),  0 0 10px rgba(255,215,0,0.35); }
  50%  { border-color: #7bff6e; box-shadow: inset 0 0 18px rgba(123,255,110,0.4), 0 0 10px rgba(123,255,110,0.35); }
  66%  { border-color: #4aa3ff; box-shadow: inset 0 0 18px rgba(74,163,255,0.4),  0 0 10px rgba(74,163,255,0.35); }
  83%  { border-color: #c264ff; box-shadow: inset 0 0 18px rgba(194,100,255,0.4), 0 0 10px rgba(194,100,255,0.35); }
  100% { border-color: #ff4fa3; box-shadow: inset 0 0 18px rgba(255,79,163,0.4), 0 0 10px rgba(255,79,163,0.35); }
}
.inv-qty { position: absolute; bottom: 2px; right: 4px; font-size: 11px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.inv-ilvl { position: absolute; bottom: 2px; left: 3px; font-size: 10px; font-weight: 800; color: #e8d47a; text-shadow: 0 1px 2px #000, 0 0 4px rgba(0,0,0,0.9); line-height: 1; }
/* crisp kit item icons (PNG) inside cells/rows/tooltips */
img.inv-icon.img { width: 82%; height: 82%; object-fit: contain; image-rendering: auto; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.5)); }
img.eq-itemicon.img { width: 30px; height: 30px; object-fit: contain; vertical-align: middle; }
img.it-nameicon.img { width: 18px; height: 18px; object-fit: contain; vertical-align: -3px; }

/* item tooltip */
#item-tooltip, #item-tooltip-compare {
  position: absolute; z-index: 40; max-width: 220px; padding: 8px 10px; pointer-events: none;
  background: rgba(8,10,16,0.96); border: 1px solid var(--panel-edge); border-radius: 8px; box-shadow: var(--shadow);
}
#item-tooltip-compare { z-index: 41; max-width: 232px; opacity: 0.97; }
#item-tooltip-compare.hidden { display: none; }
/* the compare card's name/kind/desc/effects reuse the item-tooltip look */
#item-tooltip-compare .it-name { font-weight: 800; font-size: 14px; }
#item-tooltip-compare .it-kind { font-size: 11px; color: #8aa; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
#item-tooltip-compare .it-desc { font-size: 12.5px; color: #cdd5e4; line-height: 1.45; }
#item-tooltip-compare .it-effect { font-size: 12px; color: #7ee68a; margin-top: 4px; }
.it-comparenote { font-size: 10.5px; color: var(--gold); font-weight: 800; letter-spacing: .8px; text-transform: uppercase; margin-bottom: 5px; opacity: .85; }
.it-up { color: #7ee68a; font-weight: 800; }
.it-down { color: #e6857e; font-weight: 800; }
/* global stylized tooltip — replaces every native title= tooltip in the game */
#tooltip {
  position: fixed; z-index: 130; max-width: 280px; pointer-events: none;
  padding: 8px 11px; border-radius: 9px;
  background: linear-gradient(180deg, rgba(20,23,33,0.98), rgba(10,12,18,0.98));
  border: 1px solid var(--panel-edge); box-shadow: 0 10px 32px rgba(0,0,0,0.6), inset 0 0 18px rgba(232,194,122,0.06);
}
#tooltip.hidden { display: none; }
#tooltip .tt-title { font-weight: 800; font-size: 13px; color: var(--gold); letter-spacing: .3px; margin-bottom: 3px; }
#tooltip .tt-body { font-size: 12px; color: #cdd5e4; line-height: 1.45; }
#item-tooltip .it-name { font-weight: 800; font-size: 14px; }
#item-tooltip .it-kind { font-size: 11px; color: #8aa; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.it-ilvl { color: #e8d47a; font-weight: 800; font-style: normal; text-transform: none; letter-spacing: 0; }
#item-tooltip .it-desc { font-size: 12.5px; color: #cdd5e4; line-height: 1.45; }
#item-tooltip .it-effect { font-size: 12px; color: #7ee68a; margin-top: 4px; }
#item-tooltip { max-width: 232px; }
#item-tooltip .it-3d-mount { width: 100%; height: 116px; display: flex; align-items: center; justify-content: center; margin: -2px 0 4px; }
#item-tooltip canvas.item-3d { width: 116px !important; height: 116px !important; }
/* static sprite shown in the preview box when there's no faithful 3D model */
#item-tooltip .it-3d-static { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
#item-tooltip .it-3d-static .it-3d-staticico, #item-tooltip .it-3d-static img { width: 84px; height: 84px; image-rendering: pixelated; image-rendering: crisp-edges; filter: drop-shadow(0 3px 5px rgba(0,0,0,0.5)); }
#item-tooltip .it-3d-static span { font-size: 64px; line-height: 1; }

/* codex / lore */
#codex { left: 26px; width: 420px; max-height: 80vh; overflow-y: auto; }
#codex-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.codex-tab { font-family: var(--font); font-size: 12px; font-weight: 700; letter-spacing: .5px; color: #8a93a8; cursor: pointer;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(232,194,122,0.18); border-radius: 999px; padding: 5px 14px; transition: color .12s, border-color .12s, background .12s; }
.codex-tab:hover { color: #d9c39a; border-color: var(--gold-dim); }
.codex-tab.active { color: #1a1306; background: linear-gradient(180deg, var(--gold), var(--gold-dim)); border-color: var(--gold); }
.codex-entry.bestiary .cx-title { display: flex; align-items: center; gap: 8px; }
.bx-port { font-size: 18px; }
.bx-kills { margin-left: auto; font-variant-numeric: tabular-nums; color: #ffd98a; font-size: 13px; }
.codex-entry { padding: 11px 12px; border-radius: 10px; background: rgba(255,225,150,0.05); border: 1px solid rgba(232,194,122,0.18); margin-bottom: 10px; }
.codex-entry.locked { background: rgba(255,255,255,0.02); border-color: rgba(255,255,255,0.06); opacity: 0.7; }
.cx-title { font-size: 14px; font-weight: 800; color: var(--gold); margin-bottom: 5px; }
.codex-entry.locked .cx-title { color: #6f7c92; }
.cx-text { font-size: 13px; line-height: 1.55; color: #d8d0bf; font-style: italic; }
.codex-entry.locked .cx-text { color: #6f7c92; }

/* quest log entries */
.ql-quest { padding: 12px; border-radius: 10px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07); margin-bottom: 12px; }
.ql-quest.turnedin { opacity: 0.6; }
.ql-qhead { display: flex; align-items: center; justify-content: space-between; }
.ql-qname { font-size: 15px; font-weight: 800; color: #f3ead4; }
.ql-qstate { font-size: 10px; font-weight: 800; letter-spacing: 1px; padding: 2px 7px; border-radius: 4px; }
.ql-qstate.active { background: var(--gold); color: #1a1306; }
.ql-qstate.ready { background: #5ad36a; color: #06210c; }
.ql-qstate.done { background: #3a4356; color: #aeb9cd; }
.ql-qsummary { font-size: 13px; color: #c2ccdd; margin: 6px 0; line-height: 1.5; }
.ql-qobj { font-size: 13px; color: #b6c2d6; }
.ql-qobj .qt-count { color: var(--gold); font-weight: 700; }
.ql-qobj.done { color: #7ee68a; } .ql-qobj.done .qt-count { color: #7ee68a; }
.ql-qreward { font-size: 12px; color: #93a0b8; }
.ql-qreward b { color: #e8c27a; }
.ql-empty { font-size: 13px; color: #8693a8; font-style: italic; text-align: center; padding: 20px; }
/* quest tracking (2.0 Phase 4) */
.ql-qfoot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 8px; }
.ql-track { font-size: 11px; font-weight: 800; letter-spacing: .4px; padding: 4px 9px; border-radius: 6px; cursor: pointer;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14); color: #c8d2e4; }
.ql-track:hover { border-color: var(--gold); color: #fff; }
.ql-track.on { background: #4aa3ff; border-color: #4aa3ff; color: #04121f; }
.ql-quest.tracked { border-color: #4aa3ff; box-shadow: inset 3px 0 0 #4aa3ff; }
.qt-quest.tracked .qt-name { color: #bfe0ff; }
.qt-pin { font-size: 11px; vertical-align: middle; }
/* recommended-level badge on a quest-log entry */
.ql-qname .ql-lvl { font-size: 11px; font-weight: 700; color: #cdd6ea; background: rgba(255,255,255,0.08);
  border: 1px solid var(--panel-edge); border-radius: 6px; padding: 1px 6px; margin-left: 8px; letter-spacing: .2px; vertical-align: middle; }
/* collapsible "Completed" section in the quest log, in order of completion */
.ql-completed { margin-top: 6px; border-top: 1px solid var(--panel-edge); padding-top: 10px; }
.ql-comp-head { font-size: 13px; font-weight: 800; letter-spacing: .5px; color: #9fb0c8; cursor: pointer; display: flex; align-items: center; gap: 7px; user-select: none; }
.ql-comp-head:hover { color: #e6eefc; }
.ql-comp-caret { display: inline-block; transition: transform .12s; font-size: 10px; }
.ql-completed.open .ql-comp-caret { transform: rotate(90deg); }
.ql-comp-n { color: #7ee68a; font-variant-numeric: tabular-nums; background: rgba(126,230,138,0.12); border-radius: 999px; padding: 0 8px; font-size: 12px; }
.ql-comp-list { display: none; margin-top: 8px; }
.ql-completed.open .ql-comp-list { display: block; }
.ql-comp-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #9aa6ba; padding: 5px 8px; border-radius: 7px; }
.ql-comp-row:hover { background: rgba(255,255,255,0.03); }
.ql-comp-row .ql-comp-check { color: #7ee68a; font-weight: 800; }
.ql-comp-row .ql-comp-name { flex: 1; }
.ql-comp-row.msq .ql-comp-name { color: #d8c89a; }
.ql-comp-choice { display: block; font-size: 11.5px; font-style: italic; color: #c9a3ff; margin-top: 2px; }
.ql-comp-row { align-items: flex-start; }
.ql-comp-row .ql-lvl { font-size: 10.5px; color: #8593a8; background: rgba(255,255,255,0.05); border: 1px solid var(--panel-edge); border-radius: 5px; padding: 0 5px; }

/* dialogue action buttons */
#dlg-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-right: auto; }
#dlg-actions button { font-family: var(--font); font-size: 13px; font-weight: 700; cursor: pointer; padding: 7px 14px; border-radius: 7px; transition: filter .12s;
  color: #f3e8cf; background: linear-gradient(180deg, #2c3447, #1a2030); border: 1px solid var(--panel-edge); }
#dlg-actions .accept { color: #1a1306; background: linear-gradient(180deg, var(--gold), var(--gold-dim)); border: 1px solid var(--gold); }
#dlg-actions .complete { color: #06210c; background: linear-gradient(180deg, #5ad36a, #2e9c44); border: 1px solid #5ad36a; }
#dlg-actions button:hover { filter: brightness(1.2); }

/* action slot item count badge */
.slot .slot-qty { position: absolute; bottom: 2px; right: 4px; font-size: 12px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.slot.no-charges { opacity: 0.55; }

/* ability slots: level lock + cooldown */
.slot.locked-lvl { filter: grayscale(0.8) brightness(0.6); cursor: not-allowed; }
.slot.locked-lvl:hover { transform: none; }
.slot .lock-lvl { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; color: #cdd5e4; text-shadow: 0 1px 3px #000; }
.slot .lock-lvl::before { content: "🔒"; margin-right: 3px; font-size: 12px; }

/* ---------- Equipment / character panel ---------- */
#equipment-panel { left: 26px; width: 560px; max-width: 94vw; }
#eq-body { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
/* gear in clear labelled sections (Task 12): Armor / Weapons / Jewelry / Mount */
#eq-doll { display: flex; flex-direction: column; gap: 12px; }
.eq-group { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07); border-radius: 11px; padding: 9px 11px 11px; }
.eq-group-head { font-family: 'Cinzel', Georgia, serif; font-size: 10.5px; letter-spacing: .15em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 8px; opacity: 0.92; }
.eq-group-slots { display: flex; flex-wrap: wrap; gap: 8px; }
.eq-group-armor .eq-group-slots .eq-slot { flex: 0 0 calc(25% - 6px); }   /* armor: tidy 4-wide rows */
.eq-slot { position: relative; width: 56px; height: 56px; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #11151f; border: 1px solid var(--panel-edge); transition: border-color .12s, box-shadow .12s, transform .12s; }
.eq-slot-label { font-size: 8.5px; color: #7e8aa0; margin-top: 2px; line-height: 1; letter-spacing: .02em; }
.eq-mount-note { margin-top: 9px; font-size: 12px; color: #b6c2d6; line-height: 1.5; }
.eq-mount-line b { color: #f3e7c8; }
.eq-mount-line .up { color: #8ad6ff; font-weight: 800; }
.eq-mount-sub { color: #9aa6ba; }
.eq-mount-hint { font-size: 11.5px; color: #97a2b6; margin-top: 3px; }
.eq-mount-hint b { color: #ffd98a; }
.eq-slot.empty { border-style: dashed; opacity: 0.62; }
.eq-slot.filled { border-color: var(--rc, var(--panel-edge)); box-shadow: 0 0 0 1px var(--rc, transparent) inset, 0 2px 8px rgba(0,0,0,0.4); }
.eq-slot .eq-slot-ico { font-size: 26px; }
/* itemIconHTML tags kit-icon images with class `img` (not `spr`) — size both, or
   the equipped item's sprite renders at its natural size and spills out the slot */
.eq-slot .eq-slot-ico.img, .eq-slot .eq-slot-ico.spr { width: 38px; height: 38px; object-fit: contain; }
.eq-slot .eq-slot-empty { font-size: 22px; opacity: 0.5; }
.eq-slot .eq-unequip { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid #5a3a3a;
  background: #2a1c1c; color: #ff9b90; font-weight: 800; font-size: 12px; line-height: 1; cursor: pointer; display: none; padding: 0; z-index: 2; }
.eq-slot.filled:hover .eq-unequip { display: block; }
.eq-slot.filled:hover { transform: translateY(-1px); }
/* drag-to-equip targeting */
.eq-slot.eq-target { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(243,201,105,0.4); animation: eqPulse 1s ease-in-out infinite; }
.eq-slot.eq-over { border-color: #7ee68a; box-shadow: 0 0 0 3px rgba(126,230,138,0.55); transform: scale(1.06); }
@keyframes eqPulse { 0%,100% { box-shadow: 0 0 0 2px rgba(243,201,105,0.3); } 50% { box-shadow: 0 0 0 3px rgba(243,201,105,0.6); } }
/* side: character details */
#eq-details { margin-bottom: 12px; }
.eq-name { font-size: 16px; font-weight: 800; color: #f3ead4; }
.eq-title { font-size: 12.5px; font-style: italic; color: #ffd98a; margin-top: 1px; }
.eq-xpbar { position: relative; height: 16px; border-radius: 8px; background: rgba(0,0,0,0.4); overflow: hidden; margin: 8px 0; border: 1px solid var(--panel-edge); }
.eq-xpfill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #6a55b0, #b79bff); }
.eq-xptext { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 700 10px var(--font); color: #fff; text-shadow: 0 1px 2px #000; }
.eq-facts { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: #aab4c8; }
.eq-facts b { color: #e6ecf8; }
#eq-stats { margin-top: 4px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.08); display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.eq-stat { display: flex; justify-content: space-between; font-size: 13px; color: #b6c2d6; }
.eq-stat b { color: #f3e7c8; }
.eq-stat.warded { grid-column: 1 / -1; }
.eq-stat.warded b { color: #8ad6ff; }
.eq-stat-sep { grid-column: 1 / -1; height: 1px; background: rgba(255,255,255,0.08); margin: 4px 0 2px; }
.eq-stat-ilvl { grid-column: 1 / -1; font-size: 14px; font-weight: 700; }
.eq-ilvl-val { color: #e8d47a !important; font-size: 15px; }
.eq-ilvl-val.eq-ilvl-max { color: #ff4fa3 !important; text-shadow: 0 0 8px rgba(255,79,163,0.6); }
/* the Weight-of-Hours boon card */
#eq-boon { margin-top: 12px; padding: 10px 12px; border-radius: 10px;
  background: radial-gradient(120% 120% at 100% 0, rgba(150,110,210,0.16), transparent 60%), rgba(255,255,255,0.03);
  border: 1px solid rgba(201,163,255,0.35); }
.eq-boon-head { font-family: 'Cinzel',Georgia,serif; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #c9a3ff; }
.eq-boon-choice { font-size: 14px; font-weight: 700; color: #f0e8ff; margin: 3px 0 2px; }
.eq-boon-effect { font-size: 12px; color: #cfd6ea; line-height: 1.4; }
.eq-boon-on { font-size: 11.5px; color: #9af0b8; margin-top: 4px; font-weight: 700; }
.eq-boon-off { font-size: 11.5px; color: #ffd9a6; margin-top: 4px; }
@media (max-width: 600px) { #eq-body { grid-template-columns: 1fr; } }
#item-tooltip .it-hint { font-size: 11px; color: var(--gold); margin-top: 6px; font-weight: 700; }

/* ---------- Forge / crafting panel ---------- */
#forge-panel { right: 26px; width: 380px; max-height: 80vh; overflow-y: auto; }
.forge-qhead { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }
#forge-queue { margin-bottom: 12px; }
.forge-qrow { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; background: rgba(232,194,122,0.08); border: 1px solid rgba(232,194,122,0.25); margin-bottom: 6px; }
.forge-qicon { font-size: 20px; }
.forge-qname { flex: 1; font-size: 13px; font-weight: 700; color: #f1e9d6; }
.forge-qticks { font-size: 12px; color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums; }
.forge-recipe { display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: 10px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); margin-bottom: 9px; }
.forge-recipe.poor { opacity: 0.72; }
.forge-out { position: relative; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 24px; background: #11151f; border: 1px solid var(--panel-edge); }
.forge-outqty { position: absolute; bottom: 1px; right: 3px; font-size: 11px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px #000; }
.forge-mid { flex: 1; min-width: 0; }
.forge-rname { font-size: 14px; font-weight: 800; color: #f3ead4; }
.forge-rticks { font-size: 11px; color: var(--gold-dim); font-weight: 700; }
.forge-rblurb { font-size: 11.5px; color: #9aa6bb; margin: 2px 0 5px; }
.forge-costs { display: flex; flex-wrap: wrap; gap: 8px; }
.forge-cost { font-size: 12px; color: #b6c2d6; }
.forge-cost small { color: #6f7c92; }
.forge-cost.ok { color: #8ad6a0; } .forge-cost.ok small { color: #5e8a6e; }
.forge-cost.lack { color: #ff9b90; } .forge-cost.lack small { color: #a36a64; }
.forge-btn { font-family: var(--font); font-size: 13px; font-weight: 800; cursor: pointer; padding: 9px 14px; border-radius: 8px; color: #1a1306; background: linear-gradient(180deg, var(--gold), var(--gold-dim)); border: 1px solid var(--gold); align-self: center; transition: filter .12s; }
.forge-btn:hover:not(:disabled) { filter: brightness(1.15); }
.forge-btn:disabled { opacity: 0.35; cursor: not-allowed; background: #333a48; color: #8693a8; border-color: #3a4356; }

/* level-up flourish */
.float-num.levelup { color: #ffe066; font-size: 30px; text-shadow: 0 0 12px rgba(255,210,80,0.9), 0 2px 4px #000; }

/* ---------- Top-right: world info (clock), minimap, quests — independent ---------- */
#tick-clock {
  position: absolute; top: 18px; right: 18px; width: 200px;
  padding: 10px 12px; background: var(--panel); border: 1px solid var(--panel-edge);
  border-radius: 10px; box-shadow: var(--shadow);
}
.tc-row { display: flex; justify-content: space-between; align-items: center; }
.tc-label { font-size: 11px; letter-spacing: 2px; color: var(--gold); font-weight: 700; }
.tc-mode { font-size: 10px; font-weight: 800; letter-spacing: 1px; padding: 2px 6px; border-radius: 4px; background: #5a2; color: #06120a; }
.tc-mode.prod { background: var(--gold); color: #1a1306; }
.tc-mode.dev { background: #4fc3f7; color: #062032; }
.tc-mode.live { background: #4ade80; color: #06210c; }
#online-badge { margin-top: 7px; font-size: 11px; font-weight: 700; color: #8affc0; letter-spacing: .4px; text-align: center; }
.tc-time { font-size: 14px; margin-top: 5px; color: #f3e7c8; font-weight: 700; letter-spacing: .3px; display: flex; align-items: center; gap: 5px; }
.tc-time #tc-phase { font-size: 11px; color: #9fb0c8; font-weight: 600; margin-left: auto; }
#tick-clock.night { box-shadow: var(--shadow), inset 0 0 22px rgba(80,110,220,0.18); }
#tick-clock.night .tc-time { color: #bcd0ff; }
.tc-count { font-size: 13px; margin-top: 4px; color: #d8e0ee; }
.tc-count span { font-weight: 700; color: #fff; }
.tc-next { font-size: 12px; color: #9fb0c8; margin-top: 2px; }
.tc-next span { color: #f3e7c8; font-variant-numeric: tabular-nums; }
.tc-barwrap { height: 5px; margin-top: 7px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; }
#tc-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--gold-dim), var(--gold)); }

#minimap-wrap { position: absolute; top: 150px; right: 18px; width: 200px; height: 200px; }
#minimap {
  width: 200px; height: 200px; border-radius: 50%;
  border: 3px solid var(--panel-edge); box-shadow: var(--shadow), inset 0 0 30px rgba(0,0,0,0.6);
  background: #0a1a12;
}
#minimap-label { position: absolute; bottom: 6px; left: 0; right: 0; text-align: center; font-size: 11px; letter-spacing: 1px; color: var(--gold); text-shadow: 0 1px 3px #000; font-weight: 700; }

/* ---------- Combat log ---------- */
#log {
  position: absolute; left: 18px; bottom: 150px; width: 380px; max-height: 190px;
  overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end;
  font-size: 13px; line-height: 1.45; pointer-events: none;
}
#log .line { opacity: 0; animation: logIn 0.3s forwards; text-shadow: 0 1px 3px #000; padding: 1px 0; }
#log .line.fade { animation: logOut 1s forwards; }
.log-dmg { color: #ffd36b; } .log-dmg b { color: #ff8a5b; }
.log-heal { color: #7ee68a; }
.log-info { color: #aeb9cd; }
.log-tick { color: var(--gold); font-style: italic; }
.log-death { color: #ff7b6e; font-weight: 700; }
@keyframes logIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@keyframes logOut { to { opacity: 0; } }

/* ---------- Chat ---------- */
#chat { position: absolute; left: 18px; bottom: 76px; width: 380px; display: flex; flex-direction: column; gap: 5px; }
#chat-feed { max-height: 150px; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; justify-content: flex-end; font-size: 13px; line-height: 1.4; pointer-events: none; scrollbar-width: thin; }
/* while typing, expand into a taller scrollable backlog you can read + scroll */
#chat.chat-open #chat-feed { max-height: 320px; justify-content: flex-start; pointer-events: auto; background: rgba(10,12,18,0.82); border: 1px solid var(--panel-edge); border-radius: 8px; padding: 6px 8px; }
#chat-feed::-webkit-scrollbar { width: 7px; }
#chat-feed::-webkit-scrollbar-thumb { background: rgba(232,194,122,0.4); border-radius: 4px; }
#chat-feed .cm { opacity: 0; animation: logIn 0.25s forwards; text-shadow: 0 1px 3px #000, 0 0 4px #000; padding: 1px 0; }
#chat-feed .cm .cm-name { font-weight: 800; }
#chat-feed .cm .cm-text { color: #ece3cf; }
#chat-feed .cm.system .cm-text { color: #8fb0c8; font-style: italic; }
#chat-feed .cm.me .cm-name { color: #ffe08a; }
#chat-inputwrap { display: flex; align-items: center; gap: 7px; background: var(--panel); border: 1px solid var(--gold); border-radius: 8px; padding: 5px 9px; box-shadow: var(--shadow); }
.chat-prompt { font-size: 12px; font-weight: 800; color: var(--gold); }
#chat-input { flex: 1; background: transparent; border: none; outline: none; color: #f3ead4; font-family: var(--font); font-size: 14px; }
#emote-bar { display: flex; gap: 5px; }
.emote-btn { width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--panel-edge); background: var(--panel); cursor: pointer; font-size: 16px; line-height: 1; transition: transform .08s, filter .12s; pointer-events: auto; }
.emote-btn:hover { transform: translateY(-2px); filter: brightness(1.3); }

/* speech / emote bubbles over avatars */
.bubble { position: absolute; transform: translate(-50%, -100%); z-index: 11; pointer-events: none;
  background: rgba(248, 246, 238, 0.96); color: #1a1c22; font-size: 13px; font-weight: 600; line-height: 1.3;
  padding: 6px 11px; border-radius: 12px; max-width: 220px; text-align: center; box-shadow: 0 4px 14px rgba(0,0,0,0.5);
  animation: bubbleIn 0.18s ease; }
.bubble::after { content: ""; position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); border: 6px solid transparent; border-top-color: rgba(248,246,238,0.96); border-bottom: 0; }
.bubble.emote { background: none; box-shadow: none; font-size: 40px; padding: 0; }
.bubble.emote::after { display: none; }
@keyframes bubbleIn { from { opacity: 0; transform: translate(-50%, -85%); } to { opacity: 1; transform: translate(-50%, -100%); } }

/* online roster */
#roster { position: absolute; top: 78px; left: 50%; transform: translateX(-50%); width: 300px;
  background: linear-gradient(180deg, rgba(18,21,31,0.97), rgba(10,12,18,0.97)); border: 1px solid var(--panel-edge);
  border-radius: 12px; box-shadow: var(--shadow); padding: 14px 16px; z-index: 22; }
.roster-head { font-size: 13px; letter-spacing: 1px; color: var(--gold); font-weight: 800; margin-bottom: 10px; display: flex; justify-content: space-between; }
.roster-row { display: flex; align-items: center; gap: 9px; padding: 5px 0; font-size: 13px; }
.roster-row .r-emblem { font-size: 18px; }
.roster-row .r-name { font-weight: 700; color: #f1e9d6; }
.roster-row .r-meta { margin-left: auto; font-size: 11px; color: #93a0b8; }
.roster-row.me .r-name { color: #ffe08a; }
.roster-empty { font-size: 12px; color: #8693a8; font-style: italic; text-align: center; padding: 8px; }

/* ---------- Settings gear, FPS, panel ---------- */
#settings-btn { position: absolute; top: 18px; right: 230px; width: 36px; height: 36px; border-radius: 9px;
  background: var(--panel); border: 1px solid var(--panel-edge); color: var(--gold); font-size: 19px; cursor: pointer;
  box-shadow: var(--shadow); transition: transform .12s, filter .12s; pointer-events: auto; }
#settings-btn:hover { transform: rotate(35deg); filter: brightness(1.25); }
/* while editing the HUD the gear is a draggable widget — don't let the decorative
   hover-spin fight the drag (it made the panel appear to rotate until dropped) */
body.ui-edit #settings-btn:hover { transform: none; }
#skills-btn { position: absolute; top: 18px; right: 274px; width: 36px; height: 36px; border-radius: 9px;
  background: var(--panel); border: 1px solid var(--panel-edge); color: var(--gold); font-size: 18px; cursor: pointer;
  box-shadow: var(--shadow); transition: transform .12s, filter .12s; pointer-events: auto; }
#skills-btn:hover { transform: translateY(-2px); filter: brightness(1.25); }

/* Skillbook panel — every slottable skill, in a wide multi-column gallery (Task 6).
   Cards are framed and colour-coded: gold/glowing when slotted on a bar, dim &
   dashed when not — so "on bar" reads at a glance. */
#skillbook { top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(960px, 96vw); max-height: 86vh; overflow-y: auto; }
#skillbook-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 11px; }
.sb-entry { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 12px 13px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(33,40,56,0.66), rgba(18,22,33,0.72)); border: 1px solid #2d3850;
  transition: transform .12s, box-shadow .12s, border-color .12s; }
.sb-entry::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: #3a455e; transition: background .12s; }
.sb-entry.off-bar { cursor: grab; }
.sb-entry.off-bar:hover { transform: translateY(-2px); border-color: #46557a; box-shadow: 0 8px 24px rgba(0,0,0,0.45); }
.sb-entry.on-bar { border-color: rgba(232,194,122,0.55);
  background: linear-gradient(180deg, rgba(58,49,28,0.5), rgba(28,24,16,0.66));
  box-shadow: 0 0 0 1px rgba(232,194,122,0.12) inset, 0 6px 20px rgba(0,0,0,0.4); }
.sb-entry.on-bar::before { background: linear-gradient(180deg, #f6d99a, var(--gold-dim)); box-shadow: 0 0 8px rgba(232,194,122,0.6); }
.sb-entry.locked { opacity: 0.55; }
.sb-entry.locked::before { background: #4a3a3a; }
.sb-ico { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 26px; line-height: 1; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.08); }
.sb-entry.on-bar .sb-ico { border-color: rgba(232,194,122,0.4); box-shadow: 0 0 10px rgba(232,194,122,0.18) inset; }
.sb-body { flex: 1; min-width: 0; }
.sb-head { display: flex; align-items: center; gap: 8px; }
.sb-name { font-size: 14px; font-weight: 800; color: #f1e9d6; flex: 1; }
.sb-key { flex: 0 0 auto; min-width: 28px; padding: 3px 9px; border-radius: 7px; cursor: pointer;
  background: #1a2030; border: 1px solid var(--gold-dim); color: var(--gold); font: 800 12px system-ui; text-transform: uppercase; }
.sb-entry.on-bar .sb-key { background: linear-gradient(180deg, #f6d99a, var(--gold-dim)); color: #1a1306; border-color: var(--gold); }
.sb-key:hover { filter: brightness(1.1); }
.sb-tip { font-size: 11.5px; color: #9aa6bc; margin-top: 4px; line-height: 1.45; }
.sb-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.sb-status { font-size: 10.5px; font-weight: 800; letter-spacing: .02em; padding: 2px 9px; border-radius: 999px; }
.sb-status.on { color: #bff0c4; background: rgba(46,156,68,0.18); border: 1px solid rgba(87,211,106,0.45); }
.sb-status.on b { color: #fff; }
.sb-status.off { color: #c2cbdb; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.14); }
.sb-status.locked { color: #f0c0a0; background: rgba(224,86,79,0.12); border: 1px solid rgba(224,86,79,0.35); }
.sb-chips { display: inline-flex; gap: 5px; margin-left: auto; }
.sb-chip { font-size: 10.5px; font-weight: 700; color: #ffe08a; background: rgba(232,194,122,0.1); border: 1px solid rgba(232,194,122,0.28); border-radius: 6px; padding: 2px 7px; }
.sb-chip.lock { color: #f0c0a0; background: rgba(224,86,79,0.1); border-color: rgba(224,86,79,0.3); }
#fps { position: absolute; top: 92px; right: 18px; font-size: 12px; font-weight: 700; color: #8affc0; background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 6px; padding: 3px 9px; box-shadow: var(--shadow); text-align: right; line-height: 1.45; white-space: nowrap; font-variant-numeric: tabular-nums; pointer-events: none; }
#fps .perf-ms { color: #8affc0; }
#fps .perf-ms.perf-warn { color: #ffd86b; }
#fps .perf-ms.perf-bad { color: #ff7b6e; }

#settings-panel { top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(760px, 94vw); max-height: 88vh; overflow-y: auto; }
/* groups flow into 2+ columns on a wide panel so far less scrolling is needed */
#settings-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 6px 22px; align-items: start; }
.settings-group { margin-bottom: 14px; break-inside: avoid; }
.settings-group:last-of-type { margin-bottom: 6px; }
.settings-gname { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--gold); font-weight: 800; margin-bottom: 8px; border-bottom: 1px solid rgba(232,194,122,0.18); padding-bottom: 4px; }
.setting { display: flex; align-items: center; gap: 12px; padding: 8px 2px; }
.setting .s-main { flex: 1; min-width: 0; }
.setting .s-label { font-size: 14px; color: #f1e9d6; font-weight: 600; }
.setting .s-help { font-size: 11.5px; color: #8693a8; margin-top: 1px; line-height: 1.35; }
.setting .s-control { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
/* toggle switch */
.s-toggle { width: 46px; height: 26px; border-radius: 14px; background: #2a3142; border: 1px solid #3a4356; position: relative; cursor: pointer; transition: background .15s; }
.s-toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #aeb9cd; transition: left .15s, background .15s; }
.s-toggle.on { background: linear-gradient(180deg, var(--gold), var(--gold-dim)); border-color: var(--gold); }
.s-toggle.on::after { left: 22px; background: #1a1306; }
/* slider */
.s-slider { width: 130px; accent-color: var(--gold); }
/* dropdown (select) — matches the dark/gold panel */
.s-select { width: 110px; padding: 5px 8px; border-radius: 7px; background: #2a3142; color: #f3e7c8; border: 1px solid #3a4356; font-size: 12px; font-weight: 700; cursor: pointer; }
.s-select:focus { outline: none; border-color: var(--gold); }
.s-val { font-size: 12px; font-weight: 700; color: #f3e7c8; min-width: 38px; text-align: right; font-variant-numeric: tabular-nums; }
.settings-foot { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.08); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.settings-foot-left { display: flex; align-items: center; gap: 8px; }
#settings-save { font-family: var(--font); font-size: 13px; font-weight: 800; cursor: pointer; color: #0f1a12; background: linear-gradient(180deg, #8ee6a0, #4fc26e); border: 1px solid #2f8a52; border-radius: 7px; padding: 8px 20px; transition: filter .12s; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
#settings-save:hover { filter: brightness(1.1); }
#settings-reset { font-family: var(--font); font-size: 13px; font-weight: 700; cursor: pointer; color: #ffb4ab; background: #251818; border: 1px solid #a3433a; border-radius: 7px; padding: 8px 16px; transition: filter .12s; }
#settings-reset:hover { filter: brightness(1.25); }

/* ---------- Game menu (Esc) ---------- */
#game-menu {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 320px;
  background: linear-gradient(180deg, rgba(18,21,31,0.98), rgba(10,12,18,0.98));
  border: 1px solid var(--panel-edge); border-radius: 14px; box-shadow: 0 14px 60px rgba(0,0,0,0.72);
  padding: 22px 22px 18px; z-index: 60; text-align: center;
}
#game-menu .gmenu-title { font-size: 18px; font-weight: 800; color: var(--gold); letter-spacing: .5px; margin-bottom: 18px; }
#game-menu .gmenu-actions { display: flex; flex-direction: column; gap: 10px; }
#game-menu .gmenu-actions button {
  font-family: var(--font); font-size: 15px; font-weight: 700; cursor: pointer; padding: 12px; border-radius: 9px;
  color: #f3e8cf; background: linear-gradient(180deg, #2c3447, #1a2030); border: 1px solid var(--panel-edge); transition: filter .12s;
}
#game-menu .gmenu-actions button:hover { filter: brightness(1.2); }
#game-menu #gm-resume { color: #1a1306; background: linear-gradient(180deg, var(--gold), var(--gold-dim)); border-color: var(--gold); }
#game-menu .gmenu-danger { color: #ffb4ab; background: #251818; border-color: #a3433a; }
#game-menu .gmenu-note { margin-top: 14px; font-size: 11.5px; color: #7e8aa0; font-style: italic; }

/* ---------- HUD editor ---------- */
/* user-disabled panel — wins over the game's own show/hide */
.ui-off { display: none !important; }

/* while editing, every panel is grabbable (even normally pointer-events:none ones) */
body.ui-edit .ui-movable {
  outline: 2px dashed var(--gold); outline-offset: 2px; cursor: move;
  pointer-events: auto !important; border-radius: 8px; transition: none !important;
  /* even a momentarily-empty panel keeps a visible, grabbable, outlined box so
     EVERY window is clearly editable (no more "only some are outlined"). */
  min-width: 26px; min-height: 18px;
  /* High-contrast halo behind the gold dashes: a tight dark ring brackets the
     dashed outline (offset 2px) so it reads on ANY backdrop — bright grass, sky,
     snow — and stands clear of panels that already have their own gold/edge
     border. Without this the thin gold-on-green dashes were getting visually
     swallowed and several panels looked like they had no outline at all. */
  box-shadow: 0 0 0 1px rgba(8,10,16,0.92), 0 0 0 5px rgba(8,10,16,0.5), 0 0 16px 3px rgba(0,0,0,0.4) !important;
}
body.ui-edit .ui-movable * { pointer-events: none !important; }
body.ui-edit .ui-movable .ui-resize { pointer-events: auto !important; }
body.ui-edit .ui-movable::before {
  content: attr(data-uilabel); position: absolute; top: -9px; left: 6px; z-index: 90;
  font: 700 9px var(--font); letter-spacing: .5px; text-transform: uppercase;
  color: #1a1306; background: var(--gold); padding: 1px 6px; border-radius: 4px; pointer-events: none; white-space: nowrap;
}
/* a panel that isn't active/visible in-game right now (e.g. target frame with no target,
   solo party frames, a disabled minimap) shows see-through so you can still position it */
body.ui-edit .ui-movable.ui-inactive { opacity: .5; }
body.ui-edit .ui-movable.ui-inactive::before { content: attr(data-uilabel) " · inactive"; background: #5b6b86; }
/* a panel marked hidden shows ghosted while editing so you can still move/re-enable it */
body.ui-edit .ui-movable.ui-ghost-off { opacity: .34; outline-style: dotted; }
body.ui-edit .ui-movable.ui-ghost-off::before { content: attr(data-uilabel) " · hidden"; background: #8693a8; }
/* hovering an editor row flags the matching panel */
body.ui-edit .ui-movable.ui-highlight { outline-color: #8ad6ff; box-shadow: 0 0 0 1px rgba(8,10,16,0.9), 0 0 0 4px rgba(138,214,255,.45), 0 0 24px rgba(138,214,255,.6) !important; }

#hud-editor {
  position: fixed; top: 50%; left: 16px; transform: translateY(-50%); width: 248px; max-height: 88vh;
  min-width: 220px; min-height: 200px; overflow: hidden;
  display: flex; flex-direction: column; z-index: 300;
  background: linear-gradient(180deg, rgba(20,24,34,0.98), rgba(12,15,22,0.98));
  border: 1px solid var(--gold); border-radius: 14px; box-shadow: 0 14px 50px rgba(0,0,0,0.7); padding: 14px 14px 12px;
}
/* ◢ resize corner on the editor window (mirrors .panel-resize on modals) */
.hud-ed-resize { position: absolute; right: 3px; bottom: 3px; width: 16px; height: 16px; z-index: 6; cursor: nwse-resize; touch-action: none;
  background: linear-gradient(135deg, transparent 45%, var(--gold-dim) 45%, var(--gold-dim) 60%, transparent 60%, transparent 72%, var(--gold-dim) 72%, var(--gold-dim) 87%, transparent 87%);
  opacity: .5; border-radius: 0 0 12px 0; }
.hud-ed-resize:hover { opacity: 1; }
.hud-ed-list { flex: 1; min-height: 0; }
.hud-ed-head { font-size: 15px; font-weight: 800; color: var(--gold); letter-spacing: .5px; }
.hud-ed-sub { font-size: 11px; color: #93a0b8; margin: 3px 0 10px; line-height: 1.4; }
.hud-ed-list { overflow-y: auto; display: flex; flex-direction: column; gap: 5px; padding-right: 2px; }
.hud-ed-row { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 8px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07); }
.hud-ed-row.off { opacity: .55; }
.hud-ed-row:hover { border-color: var(--panel-edge); background: rgba(255,255,255,0.07); }
.hud-ed-name { flex: 1; font-size: 13px; font-weight: 600; color: #eef2fb; }
.hud-ed-row.off .hud-ed-name { text-decoration: line-through; color: #8693a8; }
.hud-ed-eye, .hud-ed-center { font-family: var(--font); font-size: 14px; cursor: pointer; line-height: 1; width: 30px; height: 26px;
  border-radius: 6px; border: 1px solid var(--panel-edge); background: #1b2130; transition: filter .12s; }
.hud-ed-eye:hover, .hud-ed-center:hover { filter: brightness(1.3); }
.hud-ed-center { color: #cdd6ea; }
.hud-ed-scale { display: inline-flex; align-items: center; gap: 3px; }
.hud-ed-smaller, .hud-ed-bigger { font-family: var(--font); font-size: 14px; font-weight: 800; cursor: pointer; line-height: 1;
  width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--panel-edge); background: #1b2130; color: #cdd6ea; }
.hud-ed-smaller:hover, .hud-ed-bigger:hover { filter: brightness(1.3); }
.hud-ed-pct { font-size: 10.5px; color: #9fb0cc; min-width: 34px; text-align: center; }
.hud-ed-pctin { width: 34px; font: 700 10.5px var(--font); text-align: center; color: #eef2fb; background: #11151f; border: 1px solid var(--panel-edge); border-radius: 5px; padding: 2px 0; }
.hud-ed-pctin:focus { outline: none; border-color: var(--gold); }
.hud-ed-pcts { font-size: 10px; color: #8693a8; }
.hud-ed-mode { font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: #8693a8; margin-left: 7px; opacity: .8; }

/* per-panel resize handle + scale read-out shown while editing */
.ui-resize {
  position: absolute; right: -2px; bottom: -2px; width: 16px; height: 16px; z-index: 92;
  cursor: nwse-resize; border-radius: 0 0 6px 0;
  background: linear-gradient(135deg, transparent 45%, var(--gold) 45%, var(--gold) 60%, transparent 60%, transparent 72%, var(--gold) 72%, var(--gold) 86%, transparent 86%);
}
.ui-scale-tag {
  position: absolute; bottom: -10px; right: 18px; z-index: 92; pointer-events: none;
  font: 700 9px var(--font); color: #1a1306; background: var(--gold); padding: 1px 4px; border-radius: 4px;
  border: none; width: 30px; min-width: 30px; text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.ui-scale-tag:read-only { width: auto; min-width: 36px; }
body.ui-edit .ui-movable .ui-scale-tag { pointer-events: auto; }
.ui-scale-tag:focus { outline: 1px solid #1a1306; }
/* resize-mode panels: the quest tracker auto-fills its new box; lists scroll */
#quest-tracker { display: flex; flex-direction: column; }
#quest-tracker #qt-list { flex: 1 1 auto; overflow-y: auto; min-height: 0; }
#log { overflow-y: auto; }
#chat-feed { overflow-y: auto; }
.hud-ed-foot { display: flex; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.08); }
.hud-ed-foot button { flex: 1; font-family: var(--font); font-size: 13px; font-weight: 700; cursor: pointer; padding: 9px; border-radius: 8px; transition: filter .12s; }
.hud-ed-reset { color: #ffb4ab; background: #251818; border: 1px solid #a3433a; }
.hud-ed-done { color: #1a1306; background: linear-gradient(180deg, var(--gold), var(--gold-dim)); border: 1px solid var(--gold); }
.hud-ed-foot button:hover { filter: brightness(1.2); }

/* a button to open the HUD editor, dropped into the settings footer */
#settings-editui {
  font-family: var(--font); font-size: 13px; font-weight: 700; cursor: pointer; margin-right: 8px;
  color: #f3e8cf; background: linear-gradient(180deg, #2c3447, #1a2030);
  border: 1px solid var(--panel-edge); border-radius: 7px; padding: 8px 16px; transition: filter .12s;
}
#settings-editui:hover { filter: brightness(1.25); }

/* reduce motion — calm the animations */
body.reduce-motion .float-num { animation-duration: 0.5s !important; }
body.reduce-motion .bubble, body.reduce-motion #toast .t, body.reduce-motion .slot.queued { animation: none !important; }
body.reduce-motion .uf-bar, body.reduce-motion .uf-xp, body.reduce-motion .np-hp-fill { transition: none !important; }

/* ---------- Toast ---------- */
#toast { position: absolute; top: 26%; left: 50%; transform: translateX(-50%); text-align: center; pointer-events: none; }
#toast .t {
  display: inline-block; margin-top: 8px; padding: 8px 20px; font-size: 20px; font-weight: 700;
  color: #fff; background: rgba(12,14,22,0.7); border: 1px solid var(--panel-edge); border-radius: 8px;
  text-shadow: 0 2px 8px #000; animation: toastIn 0.4s ease, toastOut 0.5s ease 2.2s forwards;
}
#toast .t.big { font-size: 30px; color: var(--gold); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-12px); } }

/* ---------- Floating combat text (in-world, screen-projected) ---------- */
.float-num {
  position: absolute; font-weight: 800; font-size: 22px; pointer-events: none; z-index: 12;
  text-shadow: 0 2px 4px #000, 0 0 8px rgba(0,0,0,0.7); transform: translate(-50%, -50%);
  animation: floatUp 1.1s ease-out forwards; will-change: transform, opacity;
}
.float-num.dmg { color: #ffd84d; }
.float-num.dmg-player { color: #ff6a5a; font-size: 24px; }
.float-num.heal { color: #6dff7a; text-shadow: 0 0 10px rgba(80,255,100,0.7), 0 2px 4px #000; }
.float-num.miss { color: #b8c4d4; font-size: 16px; font-style: italic; letter-spacing: 1px; opacity: 0.85; }
.float-num.dot  { color: #ff7043; font-size: 17px; font-weight: 700; text-shadow: 0 1px 3px #000; }
.float-num.crit { color: #ffd700; font-size: 36px; font-weight: 900; letter-spacing: -1px;
  text-shadow: 0 0 18px rgba(255,215,0,0.9), 0 0 8px rgba(255,160,0,0.7), 0 2px 5px #000;
  animation: floatUpCrit 1.4s ease-out forwards; }
@keyframes floatUp {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  15%  { opacity: 1; transform: translate(-50%, -90%) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -190%) scale(1); }
}
@keyframes floatUpCrit {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.4) rotate(-4deg); }
  10%  { opacity: 1; transform: translate(-50%, -80%) scale(1.35) rotate(2deg); }
  25%  { transform: translate(-50%, -100%) scale(1.2) rotate(-1deg); }
  100% { opacity: 0; transform: translate(-50%, -220%) scale(1) rotate(0deg); }
}

/* ---------- World nameplates ---------- */
.nameplate {
  position: absolute; transform: translate(-50%, -100%); pointer-events: none; z-index: 9;
  text-align: center; transition: opacity .2s;
}
.nameplate .np-name {
  display: inline-block; font-size: 13px; font-weight: 700; padding: 1px 8px; border-radius: 5px;
  text-shadow: 0 1px 3px #000, 0 0 4px #000; white-space: nowrap;
  background: rgba(8,10,16,0.55); border: 1px solid rgba(255,255,255,0.12);
}
.nameplate.friendly .np-name { color: #8ad6ff; }
.nameplate.hostile .np-name { color: #ff8c80; }
.nameplate.remote .np-name { color: #8affc0; }
.nameplate.boss .np-name { font-size: 16px; color: #ff6a4d; padding: 3px 12px; border-color: rgba(255,106,77,0.5); letter-spacing: .5px; box-shadow: 0 0 14px rgba(255,80,50,0.4); }
.nameplate.boss .np-hp { width: 140px; height: 7px; }
/* a SEALED boss (dungeon sequencing) — dimmed + locked until the prior boss falls */
.nameplate.sealed { opacity: .5; filter: grayscale(.65); }
.nameplate.sealed .np-name::before { content: "🔒 "; }
.nameplate.remote .np-class { display: block; font-size: 10px; color: #9fb0c8; margin-top: 1px; text-shadow: 0 1px 2px #000; }
.nameplate .np-hp { width: 84px; height: 5px; margin: 3px auto 0; background: #20140f; border: 1px solid rgba(0,0,0,0.6); border-radius: 3px; overflow: hidden; }
.nameplate .np-hp-fill { height: 100%; width: 100%; background: var(--hp-enemy); transition: width .4s; }

/* Bell Resonance: golden glow on boss nameplate while the strike window is open */
.nameplate.boss.bell-resonance .np-name {
  border-color: #ffd84d;
  box-shadow: 0 0 18px rgba(255, 210, 60, 0.75), 0 0 6px rgba(255, 210, 60, 0.5);
  animation: bell-pulse 0.5s ease-in-out infinite alternate;
}
@keyframes bell-pulse {
  from { box-shadow: 0 0 12px rgba(255, 210, 60, 0.6); }
  to   { box-shadow: 0 0 26px rgba(255, 210, 60, 0.95), 0 0 8px rgba(255, 210, 60, 0.6); }
}

/* ---------- Quest indicators (! = new quest, ? = turn in — over NPC heads) ---------- */
.quest-ind {
  position: absolute; transform: translate(-50%, -100%); pointer-events: none; z-index: 10;
  font: 900 36px Georgia, serif; line-height: 1; white-space: nowrap;
  text-shadow: 0 0 8px rgba(0,0,0,1), 0 3px 5px #000;
  animation: qind-bob 1.5s ease-in-out infinite;
}
.quest-ind.msq         { color: #ffd23f; }
.quest-ind.side        { color: #8fd0ff; }
/* daily = repeatable daily quest (orange) */
.quest-ind.daily       { color: #ff8c2a; filter: drop-shadow(0 0 6px rgba(255,120,30,0.8)); }
.quest-ind.daily.ready { color: #ffb060; filter: drop-shadow(0 0 10px rgba(255,160,60,0.9)); animation: qind-bob-ready 1.0s ease-in-out infinite; }
/* ready = turn-in (? symbol) — bright gold pulse regardless of quest type */
.quest-ind.ready       { color: #ffe87a; filter: drop-shadow(0 0 10px rgba(255,220,60,0.9)); animation: qind-bob-ready 1.0s ease-in-out infinite; }
@keyframes qind-bob {
  0%, 100% { transform: translate(-50%, -100%); }
  50%      { transform: translate(-50%, -140%); }
}
@keyframes qind-bob-ready {
  0%, 100% { transform: translate(-50%, -100%) scale(1); }
  50%      { transform: translate(-50%, -145%) scale(1.12); }
}

/* ---------- Quest waypoint arrow (points toward the current objective) ---------- */
#quest-arrow {
  position: absolute; transform: translate(-50%, -50%); pointer-events: none; z-index: 8;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
#quest-arrow .qa-tip {
  display: inline-block; font-size: 26px; line-height: 1; color: #ffce5a;
  text-shadow: 0 0 7px rgba(0,0,0,0.9), 0 2px 3px #000;
}
#quest-arrow.side .qa-tip { color: #8fd0ff; }
#quest-arrow .qa-dist {
  margin-top: 2px; font: 700 11px system-ui; color: #ffe9a0;
  background: rgba(10,12,20,0.6); padding: 1px 6px; border-radius: 8px;
  text-shadow: 0 1px 2px #000;
}
#quest-arrow.side .qa-dist { color: #cdecff; }

/* ---------- Main-Story "call to adventure" pip + modal ---------- */
#msq-pip {
  position: absolute; top: 200px; right: 18px; z-index: 70;
  width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
  border: 2px solid #f3c969; color: #1a1306;
  background: radial-gradient(circle at 35% 30%, #fff7df, #f3c969 55%, #b07b2e);
  font: 900 26px 'Cinzel', Georgia, serif; line-height: 1;
  box-shadow: 0 0 0 4px rgba(243,201,105,0.18), 0 4px 18px rgba(243,201,105,0.45);
  animation: msq-pip-pulse 2.4s ease-in-out infinite;
}
#msq-pip:hover { transform: scale(1.08); }
@keyframes msq-pip-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(243,201,105,0.16), 0 4px 16px rgba(243,201,105,0.40); }
  50%      { box-shadow: 0 0 0 9px rgba(243,201,105,0.05), 0 6px 26px rgba(243,201,105,0.62); }
}
#msq-modal {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(900px 600px at 78% 8%, rgba(120,110,200,0.20), transparent 60%),
              rgba(6,8,16,0.74); backdrop-filter: blur(4px);
}
.msq-card {
  max-width: 480px; width: calc(100% - 48px); padding: 30px 32px 24px; text-align: center;
  border: 1px solid rgba(243,201,105,0.35); border-radius: 18px;
  background: linear-gradient(180deg, #161b34, #10142a 70%, #0a0d18);
  box-shadow: 0 24px 70px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04) inset;
  color: #e9e4d6; font-family: 'Spectral', Georgia, serif;
  animation: msq-rise 0.28s ease-out;
}
@keyframes msq-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.msq-eyebrow { font: 700 12px 'Cinzel', Georgia, serif; letter-spacing: 0.4em; text-transform: uppercase; color: #f3c969; opacity: 0.9; }
.msq-title {
  font: 900 clamp(26px,4vw,34px) 'Cinzel Decorative', 'Cinzel', Georgia, serif; margin: 8px 0 14px; line-height: 1.05;
  background: linear-gradient(180deg, #fff7df, #f3c969 52%, #b07b2e);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 18px rgba(243,201,105,0.25));
}
.msq-body { color: #c9c6bd; font-size: 16px; line-height: 1.62; font-style: italic; }
.msq-foot { display: flex; gap: 12px; justify-content: center; margin-top: 24px; }
.msq-foot button {
  font: 600 14px 'Cinzel', Georgia, serif; padding: 11px 20px; border-radius: 12px; cursor: pointer;
  border: 1px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.05); color: #d8d4c8;
}
.msq-foot button:hover { background: rgba(255,255,255,0.10); }
.msq-foot .msq-primary {
  border-color: #f3c969; color: #1a1306;
  background: linear-gradient(180deg, #ffe9a0, #f3c969 60%, #d6a23e);
  box-shadow: 0 4px 16px rgba(243,201,105,0.4);
}
.msq-foot .msq-primary:hover { filter: brightness(1.06); }

/* quest-log foot buttons */
.ql-qbtns { display: inline-flex; gap: 6px; }
.ql-abandon {
  font: 600 11px system-ui; padding: 4px 9px; border-radius: 8px; cursor: pointer;
  border: 1px solid rgba(220,90,90,0.4); background: rgba(190,60,60,0.14); color: #f0b3b3;
}
.ql-abandon:hover { background: rgba(200,60,60,0.28); color: #ffd3d3; }
#dlg-actions button.danger { border-color: rgba(220,90,90,0.5); background: rgba(190,60,60,0.2); color: #f5bcbc; }

/* ---------- Skills HUD widget (compact, always visible) ---------- */
#skills-hud {
  position: absolute; top: 120px; left: 18px; z-index: 6; cursor: pointer;
  background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 10px;
  padding: 6px 8px 7px; min-width: 116px; box-shadow: var(--shadow);
}
#skills-hud .skh-head { font: 700 9px var(--font); letter-spacing: 1px; text-transform: uppercase; color: #b9b6ad; opacity: 0.8; margin-bottom: 4px; }
#skills-hud .skh-row { display: flex; align-items: center; gap: 6px; padding: 2px 0; font-size: 12px; }
#skills-hud .skh-ico { width: 16px; text-align: center; }
#skills-hud .skh-name { flex: 1; color: #e7e2d4; }
#skills-hud .skh-lv { font-weight: 700; color: var(--gold); }
#skills-hud:hover { border-color: var(--gold); }

/* ---------- Professions panel ---------- */
#professions-panel { width: 460px; max-height: 78vh; overflow-y: auto; }
#prof-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.prof-card { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 12px; }
.prof-card.unknown { opacity: 0.82; border-style: dashed; }
.prof-head { display: flex; align-items: center; gap: 8px; }
.prof-head .prof-ico { font-size: 19px; }
.prof-head .prof-name { font-weight: 700; flex: 1; }
.prof-head .prof-lv { color: var(--gold); font-weight: 700; font-size: 13px; }
.prof-head .prof-type { font-size: 10px; text-transform: uppercase; letter-spacing: 0.6px; color: #9aa3b5; }
.prof-blurb { font-size: 11.5px; color: #b6b2a6; margin: 6px 0 8px; line-height: 1.45; }
.prof-xpwrap { position: relative; height: 14px; background: rgba(0,0,0,0.35); border-radius: 7px; overflow: hidden; margin-bottom: 8px; }
.prof-xpbar { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #6aa84f, #9fd07a); }
.prof-xptext { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 700 9.5px var(--font); color: #fff; text-shadow: 0 1px 2px #000; }
.prof-learn { width: 100%; padding: 8px; border-radius: 9px; cursor: pointer; border: 1px solid var(--gold); background: linear-gradient(180deg, #ffe9a0, #f3c969 60%, #d6a23e); color: #1a1306; font-weight: 700; font-size: 12px; }
.prof-learn:hover { filter: brightness(1.06); }
.prof-locked, .prof-hint { font-size: 11px; color: #8b96a8; font-style: italic; }
.prof-hint { line-height: 1.45; }
.prof-recipes { display: flex; flex-direction: column; gap: 7px; }
.prof-recipe { display: flex; align-items: center; gap: 8px; background: rgba(0,0,0,0.22); border: 1px solid rgba(255,255,255,0.07); border-radius: 9px; padding: 6px 8px; }
.prof-recipe.poor { opacity: 0.78; }
.prof-recipe.locked { opacity: 0.55; }
.prc-out { font-size: 20px; position: relative; }
.prc-qty { position: absolute; right: -4px; bottom: -4px; font-size: 9px; background: #222; border-radius: 4px; padding: 0 3px; }
.prc-mid { flex: 1; min-width: 0; }
.prc-name { font-size: 12px; font-weight: 600; }
.prc-lock { color: #d99; font-size: 10px; }
.prc-costs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.prc-cost { font-size: 10.5px; color: #b6b2a6; }
.prc-cost.ok { color: #8fd07a; } .prc-cost.lack { color: #e07a7a; }
.prc-cost small { opacity: 0.6; }
.prc-btn { padding: 6px 11px; border-radius: 8px; border: 1px solid var(--panel-edge); background: rgba(255,255,255,0.06); color: #e7e2d4; cursor: pointer; font-size: 11px; }
.prc-btn:not([disabled]):hover { border-color: var(--gold); }
.prc-btn[disabled] { opacity: 0.4; cursor: default; }

/* ---------- Forge vendor (sell salvage) ---------- */
#forge-sell { margin-top: 12px; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 10px; }
.forge-sellhead { font-weight: 700; font-size: 12px; margin-bottom: 7px; }
.forge-sellempty { font-size: 11px; color: #8b96a8; font-style: italic; }
.forge-sellrow { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 12px; }
.forge-sellicon { width: 18px; text-align: center; }
.forge-sellname { flex: 1; } .forge-sellname small { opacity: 0.6; }
.forge-sellval { color: var(--gold); font-size: 11px; }
.forge-sell1, .forge-sellall { padding: 4px 8px; border-radius: 7px; border: 1px solid var(--panel-edge); background: rgba(255,255,255,0.06); color: #e7e2d4; cursor: pointer; font-size: 10.5px; }
.forge-sell1:hover, .forge-sellall:hover { border-color: var(--gold); }

/* ---------- Interact prompt ---------- */
#interact-prompt {
  position: absolute; top: 210px; left: 50%; transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 24px;
  padding: 8px 18px; font-size: 15px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 8px;
  /* always above other HUD panels so "Quest available" is never hidden */
  z-index: 95;
}
.key { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 6px;
  background: var(--gold); color: #1a1306; font-weight: 800; border-radius: 5px; font-size: 13px; box-shadow: 0 2px 0 #8a6d3a; }

/* ---------- Skill-check minigame ---------- */
.minigame {
  position: absolute; bottom: 300px; left: 50%; transform: translateX(-50%);
  width: 360px; max-width: 80vw; background: var(--panel); border: 1px solid var(--panel-edge);
  border-radius: 14px; padding: 12px 16px 14px; box-shadow: var(--shadow); z-index: 120;
  pointer-events: none; animation: toastIn .16s ease;
}
.minigame.hidden { display: none; }
.minigame.mg-flash { border-color: var(--gold); box-shadow: var(--shadow), 0 0 18px -2px rgba(232,194,122,0.7); }
.mg-head { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #f3ead4; margin-bottom: 9px; }
.mg-head .mg-icon { font-size: 18px; }
.mg-head .mg-title { font-weight: 700; flex: 1; }
.mg-head .mg-round { color: var(--gold-dim); font-variant-numeric: tabular-nums; font-size: 13px; }
.mg-track {
  position: relative; height: 22px; border-radius: 11px; overflow: hidden;
  background: linear-gradient(180deg, #141925, #20283a); border: 1px solid #3a4356;
}
.mg-zone { position: absolute; top: 0; bottom: 0; background: rgba(106,200,120,0.40); border-left: 1px solid rgba(150,235,160,0.7); border-right: 1px solid rgba(150,235,160,0.7); }
.mg-perfect { position: absolute; top: 0; bottom: 0; background: rgba(232,194,122,0.65); }
.mg-marker { position: absolute; top: -2px; bottom: -2px; width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 6px 1px rgba(255,255,255,0.9); border-radius: 2px; }
.mg-hint { margin-top: 8px; font-size: 12px; color: var(--gold-dim); text-align: center; }

/* ---------- Action bar ---------- */
/* lifted clear of the shortcut-key strip below it (which now has a backdrop) */
/* row-gap clears the slot label that hangs ~18px below each slot, so multi-row
   bars never bury the labels of the row above */
/* grid with a fixed column count (--ab-cols) so wrapping into rows is exact and
   reliable — no width math to drift out of sync when settings change */
#action-bar { position: absolute; bottom: 58px; left: 50%; transform: translateX(-50%); display: grid; grid-template-columns: repeat(var(--ab-cols, 12), var(--slot-size, 56px)); justify-content: center; gap: 24px 8px; }
#action-bar-2 { position: absolute; bottom: 138px; left: 50%; transform: translateX(-50%); display: grid; grid-template-columns: repeat(var(--ab-cols, 12), var(--slot-size, 56px)); justify-content: center; gap: 24px 8px; }
#action-bar-3 { position: absolute; bottom: 218px; left: 50%; transform: translateX(-50%); display: grid; grid-template-columns: repeat(var(--ab-cols, 12), var(--slot-size, 56px)); justify-content: center; gap: 24px 8px; }
.slot {
  position: relative; width: var(--slot-size, 56px); height: var(--slot-size, 56px); border-radius: 9px;
  background: linear-gradient(180deg, #232a3a, #141925); border: 2px solid #3a4356;
  display: flex; align-items: center; justify-content: center; font-size: calc(var(--slot-size, 56px) * 0.46);
  box-shadow: var(--shadow), inset 0 0 8px rgba(0,0,0,0.5); cursor: pointer; transition: transform .08s, border-color .15s;
}
.slot:hover { transform: translateY(-3px); }
.slot.filled { border-color: var(--gold-dim); }
.slot.filled:hover { border-color: var(--gold); }
.slot.empty { opacity: 0.32; cursor: default; border-style: dashed; border-color: #3a4356; background: linear-gradient(180deg, rgba(35,42,58,0.4), rgba(20,25,37,0.4)); }
.slot.empty:hover { transform: none; }
/* while dragging a skill, empty slots glow so you can see where it will land */
body.ab-dragging .slot.empty { opacity: 0.75; border-color: var(--gold-dim); border-style: dashed; box-shadow: 0 0 10px rgba(232,194,122,0.3); }
body.ab-dragging .slot { cursor: grabbing; }
/* the floating icon that follows the cursor mid-drag */
.ab-drag-ghost { position: fixed; z-index: 120; pointer-events: none; transform: translate(-50%, -50%) scale(1.1);
  width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; font-size: 28px;
  border-radius: 9px; background: linear-gradient(180deg, #2b3346, #161c2a); border: 2px solid var(--gold);
  box-shadow: 0 8px 24px rgba(0,0,0,0.6), 0 0 16px rgba(232,194,122,0.5); opacity: 0.95; }
.slot.locked::after { content: "🔒"; position: absolute; font-size: 16px; opacity: .5; }
/* the shortcut indicator sits above the (large) icon on a small dark chip so it
   stays legible instead of being hidden behind the artwork */
.slot .key-bind { position: absolute; top: 2px; left: 2px; z-index: 3; pointer-events: none;
  font-size: 10px; line-height: 1; color: #f1e3c4; font-weight: 700; text-shadow: 0 1px 2px #000;
  padding: 1px 3px; border-radius: 4px; background: rgba(8,11,18,0.8); border: 1px solid rgba(0,0,0,0.45); }
.slot .key-bind:empty { display: none; }
.slot .key-bind.chord { font-size: 8.5px; letter-spacing: -0.2px; }
.slot .ico { position: relative; z-index: 1; }
.slot .slot-name { position: absolute; bottom: -18px; left: 0; right: 0; text-align: center; font-size: 10px; color: #cdd5e4; text-shadow: 0 1px 2px #000; white-space: nowrap; }
.slot.queued { border-color: var(--gold); animation: pulse 1.1s infinite; }
/* cooldown/charge overlays sit ABOVE the icon (z 2) so they're actually visible —
   the icon is z 1; the key-bind (z 3) and countdown number (z 4) stay on top. */
.slot .cd-fill { position: absolute; inset: 0; z-index: 2; background: rgba(232,194,122,0.28); transform-origin: bottom; transform: scaleY(0); border-radius: 7px; pointer-events: none; }
/* dim + desaturate the icon while its ability is cooling down, so "not ready" reads at a glance */
.slot.on-cd .ico { filter: grayscale(0.7) brightness(0.5); }
/* Task 4: ability can't be used on the current target (e.g. execute above its HP
   threshold, or target out of range). Red-tinted desaturate — visually distinct
   from the neutral cooldown dim — with a faint red rim and a corner reason tag. */
.slot.unusable .ico { filter: grayscale(0.85) brightness(0.55) sepia(0.4) hue-rotate(-28deg) saturate(1.4); }
.slot.unusable { border-color: rgba(224,86,79,0.6); box-shadow: 0 0 0 1px rgba(224,86,79,0.28) inset; cursor: not-allowed; }
.slot .unusable-tag { position: absolute; left: 0; right: 0; bottom: 2px; z-index: 4; text-align: center;
  font: 800 calc(var(--slot-size, 56px) * 0.21) / 1 system-ui, sans-serif; color: #ffd2cd;
  text-shadow: 0 1px 2px #000, 0 0 4px rgba(0,0,0,0.9); pointer-events: none; letter-spacing: -0.3px; }
/* the live countdown number, centred over the sweep */
.slot .cd-num { position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center;
  font: 800 calc(var(--slot-size, 56px) * 0.34) / 1 system-ui, sans-serif; color: #fff;
  text-shadow: 0 1px 3px #000, 0 0 5px rgba(0,0,0,0.85); pointer-events: none; }
.slot .cd-num:empty { display: none; }
.slot.active-stance { box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(232,194,122,0.6); border-color: var(--gold); }
/* the slot the cursor is over while dragging a skill */
.slot.slot-drop { box-shadow: 0 0 0 2px var(--gold), 0 0 16px rgba(232,194,122,0.7); border-color: var(--gold); transform: translateY(-3px); opacity: 1; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(232,194,122,0.5); } 50% { box-shadow: 0 0 0 5px rgba(232,194,122,0); } }
.slot .gcd { position: absolute; inset: 0; z-index: 2; border-radius: 7px; pointer-events: none; background: conic-gradient(rgba(6,8,14,0.66) var(--a, 0deg), transparent 0deg); }
/* sprite-pack icons (replace emoji) sized per context */
.slot .ico.spr { width: 82%; height: 82%; object-fit: contain; image-rendering: auto; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6)); }
.fx-chip .fx-img.spr { width: 24px; height: 24px; object-fit: contain; image-rendering: auto; }
.sb-ico .sb-img.spr { width: 32px; height: 32px; object-fit: contain; image-rendering: auto; }
.ab-drag-ghost .ico.spr { width: 80%; height: 80%; object-fit: contain; }
.prof-ico.spr { width: 26px; height: 26px; object-fit: contain; image-rendering: auto; vertical-align: middle; }
/* inventory/item sprite icons render crisp like the kit pngs */
.inv-icon.spr, .it-nameicon.spr { image-rendering: auto; }

/* ---------- Hints (shortcut keys) ---------- */
/* sits below the action bar on a grey backdrop so the keys read clearly */
#hints {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  display: flex; flex-wrap: wrap; justify-content: center; gap: 5px 14px;
  max-width: min(920px, 94vw); padding: 6px 14px; font-size: 11px; color: #c2ccdd;
  background: rgba(18, 22, 30, 0.74); border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4); pointer-events: none;
}
#hints b { color: var(--gold); }

/* ---------- Dialogue ---------- */
#dialogue {
  position: absolute; bottom: 124px; left: 50%; transform: translateX(-50%); width: min(620px, 86vw);
  background: linear-gradient(180deg, rgba(18,21,31,0.96), rgba(10,12,18,0.96));
  border: 1px solid var(--panel-edge); border-radius: 12px; box-shadow: var(--shadow); padding: 16px 18px;
}
.dlg-name { color: var(--gold); font-weight: 800; font-size: 17px; letter-spacing: .5px; margin-bottom: 6px; }
.dlg-text { font-size: 15.5px; line-height: 1.55; color: #ece3cf; min-height: 60px; }
.dlg-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }
.dlg-footer button {
  font-family: var(--font); font-size: 13px; font-weight: 700; cursor: pointer; color: #f3e8cf;
  background: linear-gradient(180deg, #2c3447, #1a2030); border: 1px solid var(--panel-edge);
  padding: 7px 14px; border-radius: 7px; transition: filter .12s;
}
.dlg-footer button:hover { filter: brightness(1.25); }
#dlg-next { color: #1a1306; background: linear-gradient(180deg, var(--gold), var(--gold-dim)); border-color: var(--gold); }

/* ---------- Dev panel ---------- */
#dev-panel {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(1040px, 94vw); max-height: 90vh; overflow-y: auto;
  background: linear-gradient(180deg, rgba(16,20,30,0.98), rgba(9,11,17,0.98));
  border: 1px solid #4fc3f7; border-radius: 14px; box-shadow: 0 14px 60px rgba(0,0,0,0.75); padding: 16px 20px;
}
/* redesigned GM tools — a responsive grid of titled cards (2.6) */
#gm-tools { margin-top: 12px; border-top: 1px solid rgba(255,255,255,0.12); padding-top: 12px; }
.gm-status { font-size: 12px; color: #b6c2d6; margin-bottom: 12px; letter-spacing: .2px; }
.gm-status b { color: #e8eef8; }
.gm-on { color: #7fe3a0; font-weight: 700; } .gm-off { color: #c0c6d0; }
.gm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.gm-card { background: rgba(255,255,255,0.03); border: 1px solid rgba(120,170,220,0.18); border-radius: 11px; padding: 11px 12px 12px; }
.gm-card-head { font: 800 13px var(--font, system-ui); color: #6fd0ff; letter-spacing: .4px; margin-bottom: 9px;
  padding-bottom: 7px; border-bottom: 1px solid rgba(120,170,220,0.16); }
.gm-card .gm-row { margin: 6px 0; }
.gm-sub { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: #7c8aa3; font-weight: 700; margin: 8px 0 2px; }
.gm-sub:first-child { margin-top: 0; }
.gm-note { font-size: 11px; color: #9fb0c8; line-height: 1.5; margin: 3px 0; }
.gm-note b { color: #cfe0f4; }
.gm-card input[type=number], .gm-card input[type=text], .gm-card select {
  background: #11151f; border: 1px solid #33405a; color: #e8eef8; border-radius: 6px; padding: 4px 7px; font-size: 12px; font-family: inherit; }
.gm-card input[type=number] { width: 60px; }
.gm-card input[type=text] { flex: 1; min-width: 120px; }
.gm-card select { max-width: 100%; flex: 1; min-width: 0; }
.dev-title { font-size: 17px; font-weight: 800; color: #4fc3f7; letter-spacing: 1px; margin-bottom: 14px; display: flex; justify-content: space-between; }
.dev-x { cursor: pointer; color: #889; font-weight: 700; }
.dev-x:hover { color: #fff; }
.dev-row { display: flex; align-items: center; justify-content: space-between; margin: 10px 0; font-size: 13px; color: #c8d2e4; }
.seg { display: flex; gap: 6px; }
.seg-btn { font-family: var(--font); font-size: 12px; font-weight: 700; cursor: pointer; padding: 7px 10px; border-radius: 7px;
  background: #1b2230; color: #aeb9cd; border: 1px solid #33405a; transition: all .12s; }
.seg-btn:hover { filter: brightness(1.3); }
.seg-btn.on { background: #4fc3f7; color: #06212f; border-color: #4fc3f7; }
#dev-tickrate { width: 90px; font-family: var(--font); background: #11151f; border: 1px solid #33405a; color: #e8eef8; border-radius: 6px; padding: 5px 8px; font-size: 13px; }
.dev-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.dev-actions button { font-family: var(--font); font-size: 13px; font-weight: 700; cursor: pointer; padding: 9px; border-radius: 7px;
  background: linear-gradient(180deg, #28303f, #181d28); color: #e6ddc8; border: 1px solid #3a4356; transition: filter .12s; }
.dev-actions button:hover { filter: brightness(1.3); }
#dev-reset { border-color: #a3433a !important; color: #ffb4ab !important; }
.dev-note { margin-top: 12px; font-size: 11.5px; color: #7e8aa0; line-height: 1.5; font-style: italic; }

/* ===== Dungeons ("The Deepening Hours") — entry, summon, clear modals ===== */
#dungeon-entry, #dungeon-clear, #summon-picker {
  --rc-display: 'Cinzel Decorative','Cinzel',Georgia,serif;
  --rc-head: 'Cinzel',Georgia,serif;
  --rc-body: 'Spectral','EB Garamond',Georgia,serif;
  position: fixed; inset: 0; z-index: 205; display: flex; align-items: center; justify-content: center; overflow: hidden;
  background:
    radial-gradient(1200px 800px at 78% -10%, rgba(150,110,210,.20), transparent 60%),
    radial-gradient(1000px 700px at 8% 8%, rgba(70,150,160,.14), transparent 55%),
    radial-gradient(900px 900px at 50% 50%, rgba(8,8,16,.88), rgba(4,5,10,.97) 70%);
  backdrop-filter: blur(6px);
}
.de-stage { position: relative; z-index: 2; width: min(1120px, 96vw); box-sizing: border-box; max-height: 96vh; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: clamp(10px,1.2vw,18px) clamp(20px,3.2vw,48px);
  border-radius: 24px; color: #eef0fb; font-family: var(--rc-body);
  background: linear-gradient(180deg, rgba(28,24,46,.95), rgba(10,10,20,.97));
  border: 2px solid rgba(201,163,255,.5);
  box-shadow: 0 30px 100px rgba(0,0,0,.75), 0 0 70px rgba(150,110,210,.2), inset 0 0 60px rgba(150,110,210,.06);
}
.de-x { position: absolute; top: 14px; right: 18px; background: none; border: none; color: #9aa; font-size: 26px; font-weight: 700; cursor: pointer; line-height: 1; }
.de-x:hover { color: #fff; }
.de-eyebrow { font-family: var(--rc-head); font-weight: 700; letter-spacing: .38em; text-transform: uppercase; color: #c9a3ff; font-size: clamp(10px,1.3vw,14px); }
.de-title { font-family: var(--rc-display); font-weight: 900; line-height: 1.0; margin: .02em 0; font-size: clamp(24px,3.2vw,38px);
  background: linear-gradient(180deg,#f3e9ff,#c9a3ff 52%,#7b54c0); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 30px rgba(150,110,210,.35)); }
.de-sub { font-style: italic; color: #c3c8d8; font-size: clamp(13px,1.7vw,18px); }
.de-blurb { color: #d6dcef; font-size: clamp(12px,1.2vw,14px); line-height: 1.4; max-width: 860px; margin: 2px auto 0; }
.de-env { color: #a7b0c8; font-style: italic; font-size: clamp(12px,1.3vw,14px); margin: 5px auto 0; max-width: 760px; }
.de-gate { color: #d8e0f0; font-size: clamp(12px,1.3vw,13.5px); margin: 9px auto 0; max-width: 760px; padding: 6px 12px; border-radius: 7px; background: rgba(120,150,210,0.1); border: 1px solid rgba(120,150,210,0.28); }
.de-gate-sequence { background: rgba(180,140,220,0.1); border-color: rgba(180,140,220,0.3); }
.de-gate-gauntlet { background: rgba(220,120,90,0.1); border-color: rgba(220,120,90,0.3); }
/* magazine body: bosses on the (wider) left, spoils + mode-picker on the right,
   side by side so the stage height is max(bosses, rewards) — not their sum */
.de-body { display: grid; grid-template-columns: 1.55fr 1fr; gap: clamp(16px,2.6vw,36px); width: 100%; align-items: start; text-align: left; margin-top: clamp(3px,.6vw,8px); }
.de-pane { display: flex; flex-direction: column; min-width: 0; }
@media (max-width: 760px) { .de-body { grid-template-columns: 1fr; } }
/* entry screens get a tighter divider rule than the shared .recap-rule default */
.de-stage .recap-rule, .re-stage .recap-rule { margin: clamp(6px,1vw,12px) auto; width: 62%; }
.de-section { width: 100%; text-align: left; font-family: var(--rc-head); font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: #c9a3ff; font-size: clamp(11px,1.3vw,14px); margin: clamp(8px,1.2vw,14px) 0 7px; }
.de-pane > .de-section:first-child { margin-top: 0; }
.de-bosses { display: grid; grid-template-columns: 1fr; gap: 8px; width: 100%; text-align: left; }
.de-boss { text-align: left; padding: 8px 13px; border-radius: 12px; background: linear-gradient(180deg, rgba(40,34,62,.6), rgba(18,16,30,.6)); border: 1px solid rgba(201,163,255,.28); }
.de-boss.final { border-color: rgba(255,154,60,.55); background: radial-gradient(120% 160% at 90% -30%, rgba(255,140,60,.22), transparent 60%), linear-gradient(180deg, rgba(48,30,30,.6), rgba(20,14,14,.6)); }
.de-boss-head { display: flex; align-items: center; gap: 9px; margin-bottom: 3px; }
.de-boss-em { font-size: 22px; filter: drop-shadow(0 0 8px rgba(201,163,255,.5)); }
.de-boss-name { font-family: var(--rc-head); font-weight: 700; font-size: clamp(14px,1.6vw,18px); color: #fff; }
.de-final { color: #ffb464; font-size: .78em; letter-spacing: .1em; }
.de-boss-guide { margin: 0; padding-left: 17px; color: #cfd6ea; font-size: clamp(11.5px,1.2vw,13px); line-height: 1.35; }
.de-boss-guide li { margin: 1px 0; }
.de-loots { display: flex; flex-wrap: wrap; gap: 7px; }
.de-loot { font-size: clamp(12px,1.3vw,14px); padding: 4px 10px; border-radius: 999px; background: rgba(0,0,0,.32); border: 1px solid var(--rc, #4aa3ff); color: var(--rc, #4aa3ff); font-weight: 600; }
.de-loot em { color: #cdd4e6; font-style: normal; opacity: .85; }
.de-mount { margin-top: 9px; color: #ffd27a; font-size: clamp(13px,1.4vw,15px); }
.de-mount em { color: #e7c089; font-style: italic; }
.de-modes { display: flex; gap: 12px; margin: 4px 0 0; flex-wrap: wrap; }
.de-mode { cursor: pointer; min-width: 170px; padding: 8px 13px; border-radius: 12px; text-align: center; border: 1px solid rgba(201,163,255,.3); background: rgba(255,255,255,.04); transition: filter .12s, transform .12s, border-color .12s; }
.de-mode b { display: block; font-family: var(--rc-head); font-size: clamp(13.5px,1.4vw,16px); color: #e7defc; }
.de-mode span { display: block; font-size: clamp(11px,1.2vw,12px); color: #a9b2cb; margin-top: 2px; line-height: 1.3; }
.de-mode.on { border-color: #ffce5a; background: linear-gradient(180deg, rgba(243,201,105,.18), rgba(243,201,105,.05)); box-shadow: 0 0 20px rgba(243,201,105,.2) inset; }
.de-mode.on b { color: #ffe6a6; }
.de-mode:hover { filter: brightness(1.1); transform: translateY(-1px); }
.de-col { display: flex; flex-direction: column; gap: 9px; flex: 1 1 180px; min-width: 0; }
.de-col .de-mode { min-width: 0; }
/* Heroic toggle: a menacing skull + a blood-red active glow */
.de-skull { display: inline-block; filter: drop-shadow(0 0 4px rgba(255,70,70,.7)); margin-right: 2px; }
.de-mode.heroic.on { border-color: #ff5a5a; background: linear-gradient(180deg, rgba(255,70,70,.2), rgba(120,12,20,.08)); box-shadow: 0 0 22px rgba(255,60,60,.28) inset; }
.de-mode.heroic.on b { color: #ff9a8a; }
.de-mode.heroic.on .de-skull { filter: drop-shadow(0 0 7px rgba(255,80,80,.95)); animation: deSkullPulse 1.4s ease-in-out infinite; }
@keyframes deSkullPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.18); } }
@media (max-width: 680px) { .de-modes { flex-direction: column; align-items: stretch; } }
.de-enter-wrap { margin-top: clamp(10px,1.4vw,16px); }
.de-enter { font-family: var(--rc-display); font-weight: 900; letter-spacing: .06em; font-size: clamp(16px,1.9vw,21px); padding: 11px 46px; border-radius: 14px; border: 1px solid #ffe9ad; cursor: pointer;
  color: #1a1206; background: linear-gradient(180deg,#ffe9ad,#f3c969 48%,#b07b2e);
  box-shadow: 0 10px 40px rgba(243,201,105,.4), 0 0 0 4px rgba(243,201,105,.12); transition: filter .12s, transform .12s; }
.de-enter:hover { filter: brightness(1.1); transform: translateY(-2px) scale(1.02); }

/* summoning-stone friend picker */
.sp-card { position: relative; width: min(440px, 92vw); padding: 26px 30px; border-radius: 20px; color: #eef0fb; font-family: var(--rc-body); text-align: center;
  background: linear-gradient(180deg, rgba(28,24,46,.96), rgba(10,10,20,.97)); border: 2px solid rgba(183,155,255,.55); box-shadow: 0 24px 80px rgba(0,0,0,.7), 0 0 50px rgba(150,110,210,.22); }
.sp-x { position: absolute; top: 12px; right: 16px; cursor: pointer; color: #99a; font-weight: 700; font-size: 22px; }
.sp-x:hover { color: #fff; }
.sp-title { font-family: var(--rc-display); font-weight: 900; font-size: 26px; color: #d9c4ff; }
.sp-sub { color: #b7bfd6; font-size: 14px; margin: 4px 0 16px; }
.sp-list { display: grid; gap: 8px; }
.sp-row { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-radius: 12px; cursor: pointer; border: 1px solid rgba(183,155,255,.3); background: rgba(255,255,255,.04); color: #eef0fb; font-family: var(--rc-body); transition: filter .12s, transform .12s; }
.sp-row:hover { filter: brightness(1.15); transform: translateY(-1px); border-color: #b79bff; }
.sp-emb { font-size: 18px; color: #c9a3ff; }
.sp-name { font-weight: 700; font-size: 16px; }
.sp-meta { margin-left: auto; color: #9fb0c8; font-size: 12px; }

/* dungeon-clear celebration */
.dc-card { position: relative; z-index: 2; width: min(560px, 92vw); padding: 32px 40px; border-radius: 24px; color: #eef0fb; font-family: var(--rc-body); text-align: center;
  background: linear-gradient(180deg, rgba(26,30,48,.95), rgba(10,12,22,.97)); border: 2px solid rgba(243,201,105,.55); box-shadow: 0 30px 100px rgba(0,0,0,.75), 0 0 70px rgba(243,201,105,.22); }
.dc-eyebrow { font-family: var(--rc-head); font-weight: 700; letter-spacing: .34em; text-transform: uppercase; color: #f3c969; font-size: 13px; }
.dc-title { font-family: var(--rc-display); font-weight: 900; font-size: clamp(30px,5vw,52px); margin: .1em 0;
  background: linear-gradient(180deg,#fff7df,#f3c969 52%,#b07b2e); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dc-rewards { display: flex; gap: 22px; justify-content: center; margin: 8px 0 12px; }
.dc-stat { font-size: 18px; } .dc-stat b { color: #ffe6a6; }
/* Phase 5 — run mastery rating (clear modal) + personal best (entry modal) */
.dc-rating, .rc-rating { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; align-items: center; margin: 6px 0 12px; padding: 8px 12px; border-radius: 12px; background: rgba(0,0,0,.28); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); font-size: 15px; }
.dc-rating-gold .dc-medal, .rc-rating-gold .rc-medal { color: #ffd86b; }
.dc-rating-silver .dc-medal, .rc-rating-silver .rc-medal { color: #d8e0ea; }
.dc-rating-bronze .dc-medal, .rc-rating-bronze .rc-medal { color: #e0a06a; }
.dc-medal, .rc-medal { font-weight: 800; letter-spacing: .4px; }
.dc-flaw, .rc-flaw { color: #9af0b8; font-weight: 700; }
.dc-new, .rc-new { color: #ffd86b; font-weight: 800; }
.dc-prev, .rc-prev { color: #9fb0c8; font-size: 13px; }
.de-best, .re-best { font-size: 13px; color: #ffd9a6; margin-top: 2px; }
.dc-items { display: grid; gap: 6px; margin: 8px auto; max-width: 420px; }
.dc-item { padding: 8px 14px; border-radius: 10px; background: rgba(243,201,105,.1); border: 1px solid rgba(243,201,105,.3); font-weight: 600; }
.dc-none { color: #a9b2cb; font-style: italic; margin: 10px 0; }
.dc-mount { margin: 12px 0; padding: 12px; border-radius: 12px; color: #ffd27a; font-size: 17px; background: radial-gradient(120% 160% at 80% -20%, rgba(255,154,60,.25), transparent 60%), rgba(40,28,16,.5); border: 1px solid rgba(255,154,60,.5); }
.dc-btns { display: flex; gap: 14px; justify-content: center; margin-top: 18px; }
.dc-btns button { font-family: var(--rc-head); font-weight: 700; font-size: 15px; padding: 12px 28px; border-radius: 12px; cursor: pointer; border: 1px solid var(--panel-edge); background: #1a2030; color: #eef3ff; transition: filter .12s, transform .12s; }
.dc-btns .dc-leave { background: linear-gradient(180deg,#f3c969,#b07b2e); color: #20160a; border-color: #ffe9ad; }
.dc-btns button:hover { filter: brightness(1.12); transform: translateY(-1px); }

/* ===== Dungeon Journal (V) — per-boss guide + weekly resets + your spoils ===== */
/* The Dungeon Journal is a DRAGGABLE, non-blocking window — no full-screen
   backdrop, no spinning clock — so you can keep it open, see past it, and keep
   moving during a dungeon. The container catches no pointer events; only the
   window does. */
#dungeon-guide {
  --rc-display: 'Cinzel Decorative','Cinzel',Georgia,serif; --rc-head: 'Cinzel',Georgia,serif; --rc-body: 'Spectral','EB Garamond',Georgia,serif;
  position: fixed; inset: 0; z-index: 205; display: block; overflow: visible;
  background: none; backdrop-filter: none; pointer-events: none; }
/* fixed SIZE so switching dungeons never resizes the window — content scrolls
   inside instead. Centred by default; an explicit left/top (from dragging) wins. */
.dg-stage { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2;
  pointer-events: auto; width: min(1100px, 94vw); height: min(660px, 88vh); box-sizing: border-box; overflow: hidden;
  display: flex; flex-direction: column; padding: clamp(14px,1.8vw,24px) clamp(16px,2.4vw,32px);
  border-radius: 22px; color: #eef0fb; font-family: var(--rc-body);
  background: linear-gradient(180deg, rgba(28,24,46,.98), rgba(10,10,20,.99)); border: 2px solid rgba(201,163,255,.5);
  box-shadow: 0 30px 100px rgba(0,0,0,.75), 0 0 70px rgba(150,110,210,.2); }
.dg-drag-hint { font-family: var(--rc-body); font-size: 11px; font-weight: 600; color: #9a86c8; letter-spacing: .08em; margin-left: 10px; vertical-align: middle; opacity: .7; }
.dg-x { position: absolute; top: 12px; right: 16px; background: none; border: none; color: #9aa; font-size: 26px; font-weight: 700; cursor: pointer; line-height: 1; }
.dg-x:hover { color: #fff; }
.dg-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 1px solid rgba(201,163,255,.25); margin-bottom: 12px; }
.dg-title { font-family: var(--rc-display); font-weight: 900; font-size: clamp(20px,2.4vw,30px); color: #d9c4ff; }
.dg-reset { font-size: 13px; color: #cfd6ea; } .dg-reset b { color: #ffd9a6; } .dg-reset-when { color: #9fb0c8; font-size: 12px; }
.dg-body { display: grid; grid-template-columns: 0.8fr 2fr; gap: clamp(14px,2vw,26px); min-height: 0; flex: 1; }
.dg-list { display: flex; flex-direction: column; gap: 7px; overflow-y: auto; padding-right: 4px; min-height: 0; }
.dg-drow { text-align: left; padding: 8px 11px; border-radius: 11px; cursor: pointer; border: 1px solid rgba(201,163,255,.2); background: rgba(255,255,255,.03); transition: filter .12s, border-color .12s; }
.dg-drow:hover { filter: brightness(1.15); border-color: rgba(201,163,255,.5); }
.dg-drow.sel { border-color: #ffce5a; background: linear-gradient(180deg, rgba(243,201,105,.16), rgba(243,201,105,.04)); }
.dg-drow-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.dg-dname { font-family: var(--rc-head); font-weight: 700; font-size: 14px; color: #f0e8ff; }
.dg-dlv { font-size: 11px; font-weight: 700; color: #cdd6ea; background: rgba(255,255,255,.08); border-radius: 5px; padding: 0 5px; }
.dg-drow-sub { font-size: 11.5px; color: #a9b2cb; margin-top: 2px; }
.dg-detail { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.dg-dhead { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.dg-dtitle { font-family: var(--rc-display); font-weight: 900; font-size: clamp(20px,2.6vw,30px); color: #f3e9ff; }
.dg-dmeta { font-size: 13px; color: #b6c2d6; } .dg-best { color: #ffd9a6; margin-left: 6px; }
.dg-locks { margin-left: auto; display: flex; gap: 7px; }
/* a checkbox, not a lock: checked (green) = acquired this week, empty = still to earn */
.dg-loot-check { font-size: 11.5px; padding: 2px 10px; border-radius: 999px; font-weight: 600; }
.dg-loot-check.got { color: #9af0b8; background: rgba(60,150,90,.18); border: 1px solid rgba(90,200,130,.45); }
.dg-loot-check.pending { color: #c2cae0; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.18); }
.dg-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.dg-tab { font-family: var(--rc-head); font-size: 12.5px; font-weight: 700; padding: 6px 12px; border-radius: 9px; cursor: pointer; color: #cdd6ea; background: rgba(255,255,255,.04); border: 1px solid rgba(201,163,255,.22); transition: filter .12s; }
.dg-tab:hover { filter: brightness(1.18); }
.dg-tab.on { color: #1a1206; background: linear-gradient(180deg,#e7defc,#c9a3ff); border-color: #d9c4ff; }
.dg-tab.final { border-color: rgba(255,154,60,.5); }
.dg-tab.final.on { background: linear-gradient(180deg,#ffd7a0,#ff9a3c); border-color: #ffb464; }
.dg-cols { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(14px,2vw,28px); overflow-y: auto; min-height: 0; align-content: start; }
.dg-sec { font-family: var(--rc-head); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #c9a3ff; font-size: 11.5px; margin: 4px 0 7px; }
.dg-col > .dg-sec:not(:first-child) { margin-top: 14px; }
.dg-guide { margin: 0; padding-left: 18px; color: #d6dcef; font-size: 13px; line-height: 1.45; }
.dg-guide li { margin: 3px 0; }
.dg-mechs { display: flex; flex-direction: column; gap: 7px; }
.dg-mech { display: flex; gap: 9px; align-items: flex-start; padding: 7px 10px; border-radius: 9px; background: rgba(255,255,255,.03); border: 1px solid rgba(201,163,255,.16); }
.dg-mech-ico { font-size: 18px; flex: 0 0 auto; }
.dg-mech b { display: block; font-size: 13px; color: #f0e8ff; }
.dg-mech-tell { display: block; font-size: 12px; color: #b6c2d6; line-height: 1.35; margin-top: 1px; }
.dg-loots { display: flex; flex-wrap: wrap; gap: 6px; }
.dg-loot { font-size: 12.5px; padding: 4px 10px; border-radius: 999px; background: rgba(0,0,0,.3); border: 1px solid var(--rc, #4aa3ff); color: var(--rc, #4aa3ff); font-weight: 600; }
.dg-loot em { color: #cdd4e6; font-style: normal; opacity: .85; }
.dg-ilvl { color: #e8d47a; font-weight: 800; font-style: normal; }
.dg-mount { margin-top: 8px; color: #ffd27a; font-size: 13px; } .dg-mount em { color: #e7c089; font-style: italic; }
.dg-gots { display: flex; flex-wrap: wrap; gap: 6px; }
.dg-got { font-size: 12.5px; padding: 4px 10px; border-radius: 8px; background: rgba(120,200,140,.1); border: 1px solid rgba(120,200,140,.35); color: #bdeccb; }
.dg-got-none { font-size: 12.5px; color: #a9b2cb; font-style: italic; }
@media (max-width: 820px) { .dg-body { grid-template-columns: 1fr; } .dg-cols { grid-template-columns: 1fr; } }

/* ===== Player title (under the unit-frame name) ===== */
.uf-title { font-size: 11px; font-weight: 700; letter-spacing: .3px; margin-top: 1px;
  color: #ffd98a; text-shadow: 0 1px 2px #000; user-select: none; }
.uf-title:hover { color: #fff0c4; text-decoration: underline dotted; }

/* ===== Title picker modal ===== */
#title-picker { position: fixed; inset: 0; z-index: 210; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(900px 900px at 50% 40%, rgba(8,8,16,.86), rgba(4,5,10,.96) 70%); backdrop-filter: blur(5px); }
.tp-card { position: relative; width: min(520px, 92vw); max-height: 86vh; overflow-y: auto; padding: 24px 26px 26px; border-radius: 18px;
  color: #f3ecd8; font-family: 'Spectral','EB Garamond',Georgia,serif; text-align: center;
  background: linear-gradient(180deg, rgba(36,28,18,.96), rgba(20,16,12,.98));
  box-shadow: 0 18px 60px rgba(0,0,0,.6), inset 0 0 0 1px rgba(255,200,120,.22); }
.tp-x { position: absolute; top: 12px; right: 16px; cursor: pointer; font-size: 20px; color: #c9bfa6; }
.tp-x:hover { color: #fff; }
.tp-head { font-family: 'Cinzel',Georgia,serif; font-weight: 800; font-size: 22px; color: #ffd98a; letter-spacing: .5px; }
.tp-sub { font-size: 13px; color: #c9bfa6; margin: 6px 0 16px; line-height: 1.4; }
.tp-list { display: flex; flex-direction: column; gap: 8px; }
.tp-row { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; border-radius: 11px; cursor: pointer;
  border: 1px solid rgba(255,200,120,.18); background: rgba(255,255,255,.03); color: #eee6d2; transition: filter .12s, border-color .12s; }
.tp-row:hover { filter: brightness(1.15); border-color: rgba(255,200,120,.5); }
.tp-row.on { border-color: #ffd98a; background: rgba(255,200,120,.1); }
.tp-mark { width: 16px; color: #ffd98a; font-weight: 800; }
.tp-body { display: flex; flex-direction: column; }
.tp-title { font-weight: 800; font-size: 15px; color: #ffe9b8; font-family: 'Cinzel',Georgia,serif; }
.tp-desc { font-size: 12px; color: #bdb39a; line-height: 1.35; }

/* ===== RAID — "The Hour Eternal" entry + clear views ===== */
#raid-entry, #raid-clear {
  --rc-display: 'Cinzel Decorative','Cinzel',Georgia,serif;
  --rc-head: 'Cinzel',Georgia,serif;
  --rc-body: 'Spectral','EB Garamond',Georgia,serif;
  position: fixed; inset: 0; z-index: 206; display: flex; align-items: center; justify-content: center; overflow: hidden;
  background:
    radial-gradient(1200px 800px at 80% -10%, rgba(255,180,80,.18), transparent 60%),
    radial-gradient(1000px 700px at 6% 6%, rgba(255,120,60,.12), transparent 55%),
    radial-gradient(900px 900px at 50% 50%, rgba(10,7,4,.9), rgba(5,4,3,.98) 70%);
  backdrop-filter: blur(6px);
}
.re-stage { position: relative; z-index: 2; width: min(1180px, 96vw); box-sizing: border-box; max-height: 96vh; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: clamp(10px,1.2vw,18px) clamp(18px,3vw,44px);
  border-radius: 22px; color: #f3ecd8; font-family: var(--rc-body);
  background: linear-gradient(180deg, rgba(40,30,18,.96), rgba(20,15,10,.985));
  box-shadow: 0 22px 70px rgba(0,0,0,.62), inset 0 0 0 1px rgba(255,200,120,.26); }
.re-x { position: absolute; top: 14px; right: 18px; cursor: pointer; font-size: 22px; color: #c9bfa6; z-index: 3; }
.re-x:hover { color: #fff; }
.re-eyebrow { font-family: var(--rc-head); font-weight: 700; font-size: 14px; letter-spacing: 2.5px; text-transform: uppercase; color: #ffb454; }
.re-title-big { font-family: var(--rc-display); font-weight: 900; font-size: clamp(24px,3.1vw,37px); line-height: 1.0; color: #ffe7b0;
  text-shadow: 0 2px 0 #6e4a18, 0 0 30px rgba(255,180,80,.35); margin: 1px 0; }
.re-sub { font-size: 13px; color: #d8caa6; } .re-clears { color: #ffb454; }
.re-blurb { font-size: clamp(12px,1.2vw,13.5px); line-height: 1.35; color: #efe6cf; max-width: 940px; margin: 2px 0; }
.re-env { font-size: 12.5px; font-style: italic; color: #c2b58e; max-width: 800px; margin-bottom: 4px; }
.re-section { width: 100%; text-align: left; font-family: var(--rc-head); font-weight: 800; font-size: 13.5px; letter-spacing: 1px;
  color: #ffd98a; margin: clamp(6px,1vw,11px) 0 6px; padding-bottom: 3px; border-bottom: 1px solid rgba(255,200,120,.22); text-transform: uppercase; }
.re-mythic { color: #ff4fa3; } .re-rarest { color: #ff4fa3; font-style: italic; }
/* magazine body: the Wardens (a 2-col grid) on the wide left, spoils + titles
   + climb picks on the right — side by side so height = max(bosses, rewards) */
.re-body { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(16px,2.4vw,32px); width: 100%; align-items: start; margin-top: clamp(3px,.6vw,8px); }
.re-pane { display: flex; flex-direction: column; min-width: 0; }
.re-pane > .re-section:first-child { margin-top: 0; }
@media (max-width: 820px) { .re-body { grid-template-columns: 1fr; } }
.re-bosses { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 12px; width: 100%; }
.re-boss { text-align: left; padding: 7px 12px; border-radius: 12px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,200,120,.16); }
.re-boss.final { border-color: rgba(255,79,163,.5); background: rgba(255,79,163,.07); grid-column: 1 / -1; }
.re-boss-head { display: flex; align-items: center; gap: 8px; }
.re-floor { font-size: 10px; font-weight: 800; color: #1a1306; background: #ffb454; padding: 1px 6px; border-radius: 4px; }
.re-boss-em { font-size: 19px; } .re-boss-name { font-family: var(--rc-head); font-weight: 800; font-size: 15px; color: #ffe9b8; }
.re-final { color: #ff7fc0; font-size: 12px; }
.re-boss-guide { margin: 2px 0 0; padding-left: 15px; font-size: 10.5px; line-height: 1.26; color: #ddd2b4; }
.re-boss-guide li { margin: 1px 0; }
.re-loots { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.re-loot { font-size: 11.5px; padding: 3px 9px; border-radius: 8px; background: rgba(255,255,255,.03); border: 1px solid var(--rc, #4aa3ff); color: var(--rc, #4aa3ff); }
.re-loot em { color: #d8caa6; font-style: normal; }
.re-mount { width: 100%; text-align: left; margin-top: 6px; font-size: 12px; line-height: 1.3; color: #ffe2a8; padding: 6px 10px; border-radius: 9px; background: rgba(255,180,80,.08); border: 1px solid rgba(255,180,80,.3); }
.re-mount.heroic { color: #ffc0e4; background: rgba(255,79,163,.08); border-color: rgba(255,79,163,.4); }
.re-titles { display: flex; flex-wrap: wrap; gap: 7px; width: 100%; }
.re-title { font-size: 12.5px; padding: 4px 10px; border-radius: 9px; color: #ffe9b8; background: rgba(255,200,120,.08); border: 1px solid rgba(255,200,120,.3); }
.re-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.re-col { display: flex; flex-direction: column; gap: 7px; }
.re-pick { text-align: left; padding: 7px 12px; border-radius: 11px; cursor: pointer; border: 1px solid rgba(255,200,120,.2); background: rgba(255,255,255,.02); transition: filter .12s, border-color .12s, background .12s; }
.re-pick b { display: block; font-family: var(--rc-head); font-size: 14px; color: #f3ecd8; }
.re-pick span { font-size: 11.5px; color: #c2b58e; line-height: 1.3; } .re-pick em { color: #ff9a8a; font-style: normal; }
.re-pick:hover { filter: brightness(1.12); border-color: rgba(255,200,120,.5); }
.re-pick.on { border-color: #ffd98a; background: rgba(255,200,120,.12); box-shadow: 0 0 0 1px rgba(255,200,120,.3); }
.re-pick.re-heroic.on { border-color: #ff5a5a; background: linear-gradient(180deg, rgba(255,70,70,.18), rgba(120,12,20,.06)); box-shadow: 0 0 0 1px rgba(255,70,70,.4), 0 0 18px rgba(255,60,60,.22) inset; }
.re-pick.re-heroic.on b { color: #ff9a8a; }
.re-pick.re-heroic.on .de-skull { animation: deSkullPulse 1.4s ease-in-out infinite; }
.re-enter-wrap { margin-top: clamp(8px,1.4vw,14px); }
.re-enter { font-family: var(--rc-head); font-weight: 800; font-size: 17px; letter-spacing: .5px; padding: 11px 38px; border-radius: 14px; cursor: pointer;
  border: 1px solid #ffe9ad; color: #20160a; background: linear-gradient(180deg,#ffd773,#c8842c); box-shadow: 0 8px 28px rgba(255,160,60,.35); transition: filter .12s, transform .12s; }
.re-enter:hover { filter: brightness(1.1); transform: translateY(-1px); }
.rc-card { box-shadow: 0 22px 70px rgba(0,0,0,.62), inset 0 0 0 1px rgba(255,200,120,.3); }
.rc-secret { margin: 10px 0; padding: 12px 16px; border-radius: 12px; font-size: 14px; line-height: 1.5; color: #ffd1ec;
  background: rgba(255,79,163,.1); border: 1px solid rgba(255,79,163,.45); }
@media (max-width: 680px) { .re-bosses, .re-modes { grid-template-columns: 1fr; } }

/* ===== Raid party frames (4 AI Keepers) ===== */
#party-frames { display: flex; flex-direction: column; gap: 5px; margin-top: 7px; }
#party-frames.hidden { display: none; }
.pf { display: flex; align-items: center; gap: 7px; padding: 4px 8px; border-radius: 9px;
  background: linear-gradient(180deg, rgba(30,26,20,.82), rgba(18,15,11,.82)); box-shadow: inset 0 0 0 1px rgba(255,200,120,.2); width: 184px; }
.pf.dead { opacity: .42; filter: grayscale(.7); }
.pf-ico { font-size: 15px; }
.pf-body { flex: 1; min-width: 0; }
.pf-name { font-size: 11px; font-weight: 700; color: #f0e8d4; text-shadow: 0 1px 2px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-barwrap { height: 6px; border-radius: 4px; background: rgba(0,0,0,.5); overflow: hidden; margin-top: 2px; }
.pf-bar { height: 100%; width: 100%; background: linear-gradient(90deg,#3a7a44,#6fd07a); transition: width .2s; }
.pf.dead .pf-bar { background: #5a2a2a; }

/* ---- Server-redeploy reload modal (Task 2) -------------------------------
   A blocking, full-screen "the world is updating" notice. The only way out is
   to reload (button or auto-countdown). Themed to the Isle's gold-on-dark glass
   with a soft sandglass shimmer so it feels like part of the world, not a crash. */
.server-reload-overlay {
  position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(120% 100% at 50% 30%, rgba(28,22,12,0.86), rgba(6,7,12,0.96));
  backdrop-filter: blur(7px) saturate(0.9); -webkit-backdrop-filter: blur(7px) saturate(0.9);
  animation: srl-fade .5s ease both; font-family: var(--font);
}
@keyframes srl-fade { from { opacity: 0; } to { opacity: 1; } }
.srl-card {
  width: min(92vw, 540px); padding: 38px 40px 30px; text-align: center;
  background: linear-gradient(180deg, rgba(22,24,33,0.96), rgba(12,13,20,0.97));
  border: 1px solid var(--panel-edge); border-radius: 18px;
  box-shadow: 0 18px 70px rgba(0,0,0,0.7), 0 0 0 1px rgba(232,194,122,0.08) inset, 0 0 60px rgba(232,194,122,0.06) inset;
  animation: srl-rise .55s cubic-bezier(.2,.9,.25,1) both;
}
@keyframes srl-rise { from { transform: translateY(16px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.srl-glyph {
  font-size: 52px; line-height: 1; display: inline-block; margin-bottom: 12px;
  filter: drop-shadow(0 0 16px rgba(232,194,122,0.5)); animation: srl-tip 2.6s ease-in-out infinite;
}
@keyframes srl-tip { 0%,100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
.srl-title {
  font-size: 27px; font-weight: 800; letter-spacing: 0.5px; margin: 0 0 10px;
  color: var(--gold); text-shadow: 0 2px 14px rgba(232,194,122,0.35);
}
.srl-sub { font-size: 15px; line-height: 1.55; color: #d7d2c4; margin: 0 auto 18px; max-width: 42ch; }
.srl-saved {
  display: inline-block; font-size: 13.5px; font-weight: 700; padding: 8px 16px; border-radius: 999px; margin-bottom: 22px;
}
.srl-saved.ok { color: #bff0c4; background: rgba(46,156,68,0.16); border: 1px solid rgba(87,211,106,0.45); }
.srl-saved.warn { color: #f3d79a; background: rgba(232,194,122,0.12); border: 1px solid rgba(232,194,122,0.4); }
.srl-btn {
  display: block; width: 100%; font-family: var(--font); font-size: 16px; font-weight: 800; letter-spacing: 0.4px;
  color: #1a1306; cursor: pointer; padding: 14px 18px; border-radius: 12px; border: 1px solid var(--gold);
  background: linear-gradient(180deg, #f6d99a, var(--gold-dim));
  box-shadow: 0 6px 22px rgba(232,194,122,0.28), 0 1px 0 rgba(255,255,255,0.4) inset;
  transition: filter .12s, transform .12s;
}
.srl-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.srl-btn:active { transform: translateY(1px); filter: brightness(0.96); }
.srl-btn:focus-visible { outline: 2px solid #fff3d6; outline-offset: 2px; }
.srl-count { margin-top: 16px; font-size: 12.5px; color: #9b958a; letter-spacing: 0.3px; }
.srl-count b { color: var(--gold); font-variant-numeric: tabular-nums; }

/* ---- Reusable confirm dialog (Task 7: sell/destroy safety) ----------------
   A compact yes/no modal over a dimmed backdrop. `.danger` paints the confirm
   button red for destructive actions (destroy / sell a rare item). */
.confirm-overlay {
  position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center;
  background: rgba(6,7,12,0.62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: srl-fade .16s ease both; font-family: var(--font);
}
.confirm-card {
  width: min(92vw, 420px); padding: 22px 24px 18px; text-align: center;
  background: linear-gradient(180deg, rgba(22,24,33,0.98), rgba(12,13,20,0.99));
  border: 1px solid var(--panel-edge); border-radius: 14px;
  box-shadow: 0 16px 60px rgba(0,0,0,0.7); animation: srl-rise .22s cubic-bezier(.2,.9,.25,1) both;
}
.confirm-card.danger { border-color: rgba(224,86,79,0.5); }
.confirm-title { font-size: 18px; font-weight: 800; color: var(--gold); margin-bottom: 10px; }
.confirm-card.danger .confirm-title { color: #ff9c92; }
.confirm-body { font-size: 14px; line-height: 1.55; color: #d7d2c4; margin-bottom: 16px; }
.confirm-body b { color: #fff; }
.confirm-warn { margin-top: 10px; font-size: 12.5px; font-weight: 700; color: #f3c0a0;
  background: rgba(224,86,79,0.12); border: 1px solid rgba(224,86,79,0.4); border-radius: 8px; padding: 7px 10px; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }
.confirm-actions button {
  font-family: var(--font); font-size: 14px; font-weight: 800; cursor: pointer; padding: 10px 20px; border-radius: 10px;
  transition: filter .12s, transform .1s;
}
.confirm-actions button:active { transform: translateY(1px); }
.confirm-no { color: #d7d2c4; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.18); }
.confirm-no:hover { background: rgba(255,255,255,0.12); }
.confirm-yes { color: #1a1306; background: linear-gradient(180deg, #f6d99a, var(--gold-dim)); border: 1px solid var(--gold); }
.confirm-yes:hover { filter: brightness(1.08); }
.confirm-yes.danger { color: #fff; background: linear-gradient(180deg, #e0564f, #a3271f); border: 1px solid #e0564f; }
.confirm-actions button:focus-visible { outline: 2px solid #fff3d6; outline-offset: 2px; }

/* ---- Cutscene / cinematic director (Task 16) -----------------------------
   Letterbox bars slide in, a dialogue card rises, a Skip sits top-right. The
   3D camera is framed by the director (it reuses the follow-rig). */
.cutscene { position: fixed; inset: 0; z-index: 8000; pointer-events: none; }
.cutscene.on { pointer-events: auto; }
.cs-bar { position: absolute; left: 0; right: 0; height: 11vh; background: #000; transform: scaleY(0); transition: transform .5s cubic-bezier(.2,.9,.25,1); }
.cs-top { top: 0; transform-origin: top; }
.cs-bot { bottom: 0; transform-origin: bottom; }
.cutscene.on .cs-bar { transform: scaleY(1); }
.cs-skip { position: absolute; top: calc(11vh + 14px); right: 22px; opacity: 0; transition: opacity .4s .3s;
  font: 800 13px var(--font); letter-spacing: .04em; color: #1a1306; cursor: pointer; padding: 7px 16px; border-radius: 999px;
  background: linear-gradient(180deg, #f6d99a, var(--gold-dim)); border: 1px solid var(--gold); }
.cutscene.on .cs-skip { opacity: 0.92; }
.cs-skip:hover { filter: brightness(1.08); }
.cs-dialogue { position: absolute; left: 50%; bottom: calc(11vh + 26px); transform: translate(-50%, 16px); width: min(760px, 90vw);
  padding: 16px 22px 14px; border-radius: 14px; text-align: center; opacity: 0; transition: opacity .3s, transform .3s;
  background: linear-gradient(180deg, rgba(22,24,33,0.94), rgba(10,12,18,0.96)); border: 1px solid var(--panel-edge);
  box-shadow: 0 14px 50px rgba(0,0,0,0.6); }
.cs-dialogue.on { opacity: 1; transform: translate(-50%, 0); }
.cs-who { font-family: 'Cinzel', Georgia, serif; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }
.cs-text { font-size: 17px; line-height: 1.5; color: #efe7d4; font-style: italic; }
.cs-hint { margin-top: 10px; font-size: 11px; color: #8b8678; letter-spacing: .04em; }

/* ---------- Combat Meter widget ---------- */
#meter-widget {
  position: absolute; right: 200px; top: 18px; z-index: 8;
  background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 10px;
  padding: 6px 10px 8px; min-width: 142px; box-shadow: var(--shadow);
}
.mw-head { display: flex; align-items: center; gap: 4px; font: 700 9px var(--font); letter-spacing: 1.2px; text-transform: uppercase; color: #c0b8ae; margin-bottom: 5px; }
.mw-state { flex: 1; font-size: 9px; font-weight: 700; letter-spacing: 0.5px; }
.mw-state.active { color: #f05555; }
.mw-state.ready { color: #a0e070; }
.mw-clear-btn { background: none; border: none; cursor: pointer; color: #7a808d; font-size: 12px; line-height: 1; padding: 0 2px; margin-left: auto; }
.mw-clear-btn:hover { color: #e06060; }
.mw-rows { display: flex; flex-direction: column; gap: 3px; margin-bottom: 5px; }
.mw-row { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.mw-label { width: 36px; color: #9ca3b5; font-size: 10.5px; font-weight: 700; letter-spacing: .3px; }
.mw-bar-wrap { flex: 1; height: 6px; background: rgba(255,255,255,.07); border-radius: 3px; overflow: hidden; }
.mw-bar { height: 100%; border-radius: 3px; transition: width .3s; }
.mw-dps .mw-bar { background: linear-gradient(90deg, #f05555, #ff8c6a); }
.mw-hps .mw-bar { background: linear-gradient(90deg, #4fba7a, #90e8a4); }
.mw-thr .mw-bar { background: linear-gradient(90deg, #d4a04a, #ffd77e); }
.mw-val { min-width: 38px; text-align: right; font-size: 11px; font-weight: 700; }
.mw-dps .mw-val { color: #ff8c6a; }
.mw-hps .mw-val { color: #90e8a4; }
.mw-thr .mw-val { color: #ffd77e; }
.mw-detail-btn { width: 100%; font-size: 10.5px; font-weight: 700; color: #bbb6ac; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); border-radius: 6px; padding: 3px 6px; cursor: pointer; transition: all .13s; }
.mw-detail-btn:hover { color: #f0e6c4; background: rgba(232,194,122,.12); border-color: rgba(232,194,122,.35); }
/* Combat Meter full detail panel */
#meter-panel { width: 360px; }
#meter-body { padding: 4px 2px; display: flex; flex-direction: column; gap: 12px; }
.mb-section { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.09); border-radius: 10px; padding: 10px 12px; }
.mb-sec-head { font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase; font-weight: 800; color: var(--gold-dim); margin-bottom: 8px; }
.mb-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.mb-stat { display: flex; flex-direction: column; gap: 1px; }
.mb-stat-label { font-size: 10px; color: #8a95b0; letter-spacing: .4px; }
.mb-stat-val { font-size: 16px; font-weight: 800; color: #e6dcc8; }
.mb-stat-val.dps { color: #ff8c6a; }
.mb-stat-val.hps { color: #90e8a4; }
.mb-stat-val.crit { color: #ffd060; }
.mb-timeline { display: flex; flex-direction: column; gap: 3px; }
.mb-tl-label { font-size: 10px; color: #8a95b0; margin-bottom: 4px; }
.mb-tl-bars { display: flex; align-items: flex-end; gap: 2px; height: 36px; }
.mb-tl-bar { flex: 1; border-radius: 2px 2px 0 0; min-height: 2px; background: linear-gradient(180deg,#ff8c6a,#c04040); opacity: .85; }
.mb-tl-bar.heal { background: linear-gradient(180deg,#90e8a4,#3a9050); }
.mb-clear { width: 100%; margin-top: 4px; font-size: 11px; font-weight: 700; color: #cc6060; background: rgba(200,60,60,.08); border: 1px solid rgba(200,60,60,.3); border-radius: 7px; padding: 5px 10px; cursor: pointer; transition: all .13s; }
.mb-clear:hover { background: rgba(200,60,60,.18); border-color: rgba(200,60,60,.6); }
