/* ============================================================
   OOM! — Out of Mana · torchlit obsidian & gold MMO-UI parody
   ============================================================ */
:root {
  --ink: #0c0913;
  --ink2: #151021;
  --panel-a: #1d1730;
  --panel-b: #120d1e;
  --gold: #d9ab4f;
  --gold-hi: #f5d98a;
  --gold-dim: #7a6535;
  --parchment: #ece0c8;
  --text: #d8d0c4;
  --dim: #8f8698;
  --heal: #56e88c;
  --mana: #4fa4ff;
  --danger: #ff5b4a;
  --warn: #ffb84a;
  --rar-common: #b9bcc9;
  --rar-rare: #58aaff;
  --rar-legendary: #ff9d2e;
  --font-display: "Grenze Gotisch", "Palatino Linotype", serif;
  --font-body: "Alegreya Sans", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "Consolas", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#app {
  min-height: 100vh;
  position: relative;
  background:
    radial-gradient(1200px 700px at 50% -10%, #241a3a 0%, transparent 60%),
    radial-gradient(900px 600px at 85% 110%, #1d1226 0%, transparent 55%),
    radial-gradient(900px 600px at 10% 100%, #14101f 0%, transparent 55%),
    var(--ink);
}
#app::before { /* film grain */
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 3;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
#vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 4;
  box-shadow: inset 0 0 180px 60px rgba(0, 0, 0, 0.65);
}
#bg-torches i {
  position: fixed; width: 500px; height: 700px; border-radius: 50%;
  pointer-events: none; z-index: 0; filter: blur(60px);
  background: radial-gradient(closest-side, rgba(255, 150, 50, 0.13), transparent);
  animation: torch 3.2s ease-in-out infinite alternate;
}
#bg-torches i:first-child { left: -180px; top: 15%; }
#bg-torches i:last-child { right: -180px; top: 30%; animation-delay: -1.7s; }
@keyframes torch { from { opacity: 0.65; transform: scale(1); } to { opacity: 1; transform: scale(1.08); } }

/* ---------- screens ---------- */
.screen { display: none; position: relative; z-index: 2; min-height: 100vh; }
.screen.active { display: block; animation: screenIn 0.35s ease-out; }
@keyframes screenIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.screen-title {
  font-family: var(--font-display); font-weight: 900; color: var(--parchment);
  font-size: clamp(30px, 4.5vw, 52px); text-align: center; letter-spacing: 1px;
  text-shadow: 0 3px 0 rgba(0,0,0,0.6), 0 0 40px rgba(217, 171, 79, 0.2);
}
.screen-sub { text-align: center; color: var(--dim); margin: 8px auto 24px; max-width: 720px; font-size: 17px; }

/* ---------- panels & buttons ---------- */
.panel {
  background: linear-gradient(170deg, var(--panel-a), var(--panel-b));
  border: 1px solid var(--gold-dim);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  position: relative;
}
.panel::after {
  content: '◆'; position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  color: var(--gold); font-size: 11px; text-shadow: 0 0 8px rgba(217,171,79,0.8);
}

.btn {
  font-family: var(--font-body); font-weight: 700; font-size: 15px;
  color: var(--parchment); cursor: pointer;
  background: linear-gradient(180deg, #2c2440, #1a1428);
  border: 1px solid var(--gold-dim); border-radius: 8px;
  padding: 10px 22px; letter-spacing: 0.4px;
  transition: transform 0.12s, box-shadow 0.12s, filter 0.12s;
  box-shadow: 0 3px 0 rgba(0,0,0,0.5);
}
.btn:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.15); box-shadow: 0 5px 14px rgba(217,171,79,0.25); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, #e8bd62, #a87b28);
  color: #241a08; border-color: var(--gold-hi);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-huge { font-size: 20px; padding: 16px 38px; border-radius: 12px; }
.btn-back { background: transparent; border-color: #3a3350; color: var(--dim); box-shadow: none; }
.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-daily { border-color: var(--mana); }
.btn-daily small { display: block; font-weight: 400; color: var(--dim); font-size: 12px; }
.icon-btn {
  background: rgba(20, 15, 35, 0.8); border: 1px solid var(--gold-dim); color: var(--parchment);
  border-radius: 8px; width: 36px; height: 36px; cursor: pointer; font-size: 15px;
}
.icon-btn:hover { filter: brightness(1.3); }

.dim { color: var(--dim); font-weight: 400; }
.good { color: var(--heal); }
.bad { color: var(--warn); }
.gold { color: var(--gold-hi); }
.respect { color: #d68aff; }
.grade { color: var(--gold-hi); font-size: 1.2em; }

/* ============================================================
   HUB
   ============================================================ */
.hub-wrap { max-width: 980px; margin: 0 auto; padding: 6vh 20px 40px; display: flex; flex-direction: column; align-items: center; }
.logo-block { text-align: center; margin-bottom: 5vh; animation: logoIn 0.7s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes logoIn { from { opacity: 0; transform: scale(0.7) rotate(-4deg); } to { opacity: 1; transform: none; } }
.logo-burst {
  display: inline-block; position: relative; padding: 30px 56px;
  background: radial-gradient(closest-side, rgba(255, 170, 60, 0.28), transparent 75%);
}
.logo-burst::before {
  content: ''; position: absolute; inset: 6px;
  background: linear-gradient(160deg, #ffce6a, #c47a1e);
  clip-path: polygon(50% 0%, 61% 12%, 76% 5%, 79% 21%, 95% 22%, 89% 37%, 100% 50%, 89% 63%, 95% 78%, 79% 79%, 76% 95%, 61% 88%, 50% 100%, 39% 88%, 24% 95%, 21% 79%, 5% 78%, 11% 63%, 0% 50%, 11% 37%, 5% 22%, 21% 21%, 24% 5%, 39% 12%);
  transform: rotate(8deg);
  filter: drop-shadow(0 8px 20px rgba(0,0,0,0.6));
  animation: burstSpin 24s linear infinite;
}
@keyframes burstSpin { to { transform: rotate(368deg); } }
.logo-oom {
  position: relative; font-family: var(--font-display); font-weight: 900;
  font-size: clamp(64px, 12vw, 130px); color: #2a1505; line-height: 0.9;
  text-shadow: 0 2px 0 #ffe9b0, 0 -1px 0 rgba(0,0,0,0.3);
  letter-spacing: -2px;
}
.logo-sub {
  font-family: var(--font-display); font-weight: 700; color: var(--gold);
  font-size: clamp(17px, 2.6vw, 26px); letter-spacing: 6px; margin-top: 10px; text-transform: uppercase;
}
.logo-tag { color: var(--dim); font-style: italic; margin-top: 8px; font-size: 15px; }

.hub-main { display: flex; gap: 26px; align-items: stretch; flex-wrap: wrap; justify-content: center; }
.hub-buttons { display: flex; flex-direction: column; gap: 14px; min-width: 320px; }
.hub-row { display: flex; gap: 10px; }
.hub-row .btn { flex: 1; }
.hub-side { padding: 20px 24px; min-width: 300px; max-width: 360px; }
.respect-big { font-size: 24px; color: #d68aff; font-weight: 800; margin-bottom: 12px; }
.hub-title-row { margin-bottom: 12px; font-size: 15px; }
.hub-title-row select {
  background: var(--ink2); color: var(--parchment); border: 1px solid var(--gold-dim);
  border-radius: 6px; padding: 4px 8px; font-family: var(--font-body); margin-left: 6px;
}
.hub-stats { color: var(--dim); font-size: 14px; line-height: 1.7; }
.hub-daily-best { margin-top: 10px; font-size: 14px; color: var(--mana); }
.hub-foot { margin-top: 6vh; color: var(--dim); font-style: italic; text-align: center; }

/* ============================================================
   CLASS SELECT
   ============================================================ */
.pick-wrap { max-width: 1080px; margin: 0 auto; padding: 5vh 20px 40px; }
.class-cards { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; margin: 10px 0 26px; }
.class-card {
  width: 300px; padding: 26px 22px; text-align: center;
  transition: transform 0.18s, box-shadow 0.18s;
}
.class-card:not(.locked):hover { transform: translateY(-6px); box-shadow: 0 16px 40px rgba(0,0,0,0.6), 0 0 30px hsla(var(--hue), 70%, 55%, 0.15); }
.class-icon {
  font-size: 46px; width: 84px; height: 84px; margin: 0 auto 10px; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(closest-side, hsla(var(--hue), 65%, 45%, 0.35), transparent);
  border: 2px solid hsla(var(--hue), 60%, 55%, 0.6); border-radius: 50%;
}
.class-name { font-family: var(--font-display); font-weight: 700; font-size: 32px; color: var(--parchment); }
.class-epithet { color: hsl(var(--hue), 65%, 65%); font-style: italic; margin-bottom: 10px; }
.class-desc { color: var(--dim); font-size: 14px; min-height: 84px; line-height: 1.5; }
.class-spells { display: flex; justify-content: center; gap: 6px; margin: 14px 0 18px; }
.mini-spell {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; font-size: 17px;
  background: var(--ink2); border: 1px solid #3a3350; border-radius: 8px; cursor: help;
}
.mini-spell.ult { border-color: var(--gold); box-shadow: 0 0 8px rgba(217,171,79,0.4); }
.class-card.locked { opacity: 0.55; filter: grayscale(0.6); }
.lock-note { color: var(--warn); font-weight: 700; padding: 10px; }
.seed-row { text-align: center; color: var(--dim); font-size: 14px; display: flex; gap: 16px; justify-content: center; align-items: center; flex-wrap: wrap; }
.seed-row input {
  background: var(--ink2); border: 1px solid var(--gold-dim); color: var(--gold-hi);
  font-family: var(--font-mono); padding: 6px 10px; border-radius: 6px; width: 140px; text-transform: uppercase;
}
.ks-row select { background: var(--ink2); color: var(--parchment); border: 1px solid var(--gold-dim); border-radius: 6px; padding: 4px 8px; }
#class-back { display: block; margin: 26px auto 0; }

/* ============================================================
   DRAFT
   ============================================================ */
.draft-wrap { max-width: 1150px; margin: 0 auto; padding: 4vh 20px 40px; }
.draft-section h2 { font-family: var(--font-display); color: var(--gold); font-size: 26px; margin: 22px 0 12px; font-weight: 700; }
.pickcount { color: var(--dim); font-size: 16px; font-family: var(--font-body); }
.cand-row { display: flex; gap: 14px; flex-wrap: wrap; }
.cand-card {
  flex: 1 1 200px; max-width: 270px; min-width: 205px; padding: 16px; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.cand-card:hover { transform: translateY(-4px); }
.cand-card.picked {
  border-color: var(--gold-hi);
  box-shadow: 0 0 0 2px var(--gold), 0 8px 26px rgba(217, 171, 79, 0.25);
  background: linear-gradient(170deg, #2c2340, #1a1226);
}
.cand-card.picked::after { content: '✓'; font-size: 16px; top: -13px; background: var(--gold); color: #241a08; border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.cand-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.cand-name { font-family: var(--font-display); font-weight: 700; font-size: 21px; color: var(--parchment); }
.cand-cls { color: var(--dim); font-size: 13px; }
.cand-stats { color: var(--gold); letter-spacing: 2px; font-size: 13px; margin-bottom: 10px; }
.cand-perk, .cand-quirk { font-size: 13.5px; line-height: 1.45; margin-top: 8px; color: var(--text); }
/* duo chip: hidden until the first member is picked (decisions are visible) */
.cand-duo {
  margin-top: 9px; padding: 7px 9px; border: 1px dashed var(--gold); border-radius: 6px;
  font-size: 12.5px; line-height: 1.4; background: rgba(217, 171, 79, 0.07);
}
.cand-duo.active {
  border-style: solid; background: rgba(217, 171, 79, 0.14);
  box-shadow: 0 0 10px rgba(217, 171, 79, 0.3);
}
.cand-duo > b { color: var(--gold-hi); }
.cand-duo-state { color: var(--gold); font-size: 12px; font-style: italic; }
.cand-duo.active .cand-duo-state { font-style: normal; font-weight: 700; }
.cand-duo-desc { color: var(--text); margin-top: 3px; }
.draft-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 30px; }
.ks-affix-line { margin-top: 8px; font-size: 13px; color: var(--text); }
.ks-affix-line.preview { color: var(--dim); }
.affix-chips { display: inline-flex; flex-wrap: wrap; gap: 5px; vertical-align: middle; }
.affix-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 999px;
  border: 1px solid rgba(217, 171, 79, 0.55); background: rgba(217, 171, 79, 0.11);
  color: var(--gold-hi); font-size: 12px; line-height: 1.3; white-space: nowrap; cursor: help;
}
.affix-chips.preview .affix-chip { border-style: dashed; opacity: 0.78; }

/* ============================================================
   STATUS STRIP (map & events)
   ============================================================ */
.status-strip {
  display: flex; align-items: center; gap: 16px; padding: 10px 18px; margin-bottom: 24px;
  flex-wrap: wrap; font-size: 14px;
}
.status-strip::after { display: none; }
.ss-class { font-weight: 800; color: hsl(var(--hue), 65%, 65%); }
.ss-mana {
  position: relative; width: 150px; height: 18px; background: #0a0812; border-radius: 9px; overflow: hidden;
  border: 1px solid #2a2440;
}
.ss-mana-fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(180deg, #6fbaff, #2668c8); }
.ss-mana i { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-style: normal; font-weight: 700; color: #fff; text-shadow: 0 1px 2px #000; }
.ss-gold { color: var(--gold-hi); font-weight: 700; }
.ss-party { display: flex; gap: 5px; }
.ss-member {
  position: relative; width: 22px; height: 30px; background: #0a0812; border: 1px solid #3a3350;
  border-radius: 4px; overflow: hidden; display: flex; align-items: flex-end; justify-content: center; font-size: 11px;
}
.ss-member .ss-hp { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(180deg, #74e89a, #2b9c54); z-index: 0; }
.ss-member.dead { border-color: var(--danger); }
.ss-items, .ss-boons { display: flex; gap: 4px; flex-wrap: wrap; }
.ss-affixes { display: inline-flex; max-width: 360px; overflow: hidden; }
.gear-chip, .boon-chip {
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  background: var(--ink2); border: 1px solid var(--rar-common); border-radius: 5px; font-size: 12px; cursor: help;
}
.rar-rare { border-color: var(--rar-rare) !important; color: var(--rar-rare); }
.rar-legendary { border-color: var(--rar-legendary) !important; color: var(--rar-legendary); box-shadow: 0 0 8px rgba(255, 157, 46, 0.35); }
.gear-chip.undiscovered { opacity: 0.4; box-shadow: none; }
.ss-seed { margin-left: auto; font-family: var(--font-mono); font-size: 12px; }

/* ============================================================
   MAP
   ============================================================ */
.map-wrap { max-width: 1000px; margin: 0 auto; padding: 3vh 20px 40px; }
.zone-head { text-align: center; margin-bottom: 12px; }
.zone-name {
  font-family: var(--font-display); font-weight: 900; font-size: clamp(28px, 4vw, 44px);
  color: var(--parchment); text-shadow: 0 3px 0 rgba(0,0,0,0.5);
}
.zone-name.theme-crypt { color: #b8c4e8; }
.zone-name.theme-forge { color: #ffb37a; }
.zone-name.theme-spire { color: #c9aaff; }
.zone-name.theme-fields, .node-name.theme-fields { color: #a8d888; }
.zone-name.theme-mire, .node-name.theme-mire { color: #7ecca8; }
.zone-name.theme-bloodwood, .node-name.theme-bloodwood { color: #ff8a80; }
.node-name.theme-crypt { color: #b8c4e8; }
.node-name.theme-forge { color: #ffb37a; }
.node-name.theme-spire { color: #c9aaff; }
.biome-twist { margin-top: 8px; font-size: 13px; color: var(--warn); font-style: italic; }
.set-chip { margin-top: 6px; font-size: 12px; color: #7ecfa8; font-style: italic; }
.cashout-card { border-color: var(--gold); }
.cashout-card .node-name { color: var(--gold-hi); }
.zone-trail { display: flex; align-items: center; justify-content: center; gap: 4px; margin: 16px 0 8px; flex-wrap: wrap; }
.trail-node {
  width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--ink2); border: 2px solid #3a3350; font-size: 16px; transition: all 0.2s;
}
.trail-node.done { border-color: var(--heal); color: var(--heal); opacity: 0.75; }
.trail-node.cur { border-color: var(--gold-hi); box-shadow: 0 0 16px rgba(217, 171, 79, 0.5); transform: scale(1.18); }
.trail-node.final { border-color: var(--danger); }
.trail-line { width: 20px; height: 2px; background: #3a3350; }
.choose-title { text-align: center; font-family: var(--font-display); color: var(--gold); font-weight: 700; font-size: 24px; margin: 20px 0 16px; }
.node-cards, .camp-opts { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.node-card {
  width: 250px; padding: 22px 18px; text-align: center; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.node-card:hover { transform: translateY(-5px) scale(1.02); border-color: var(--gold); box-shadow: 0 14px 34px rgba(0,0,0,0.55), 0 0 24px rgba(217,171,79,0.15); }
.node-icon { font-size: 38px; margin-bottom: 8px; }
.node-name { font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--parchment); margin-bottom: 6px; }
.node-desc { color: var(--dim); font-size: 13.5px; line-height: 1.45; }
.node-boss { border-color: var(--danger); }
.node-boss .node-name { color: #ff9a8a; }
.map-foot { text-align: center; margin-top: 34px; }
.final-gate { text-align: center; padding: 8vh 20px; }
.final-gate .btn { margin-top: 24px; }

/* ============================================================
   EVENTS
   ============================================================ */
.event-wrap { max-width: 900px; margin: 0 auto; padding: 3vh 20px 40px; }
.event-panel { padding: 34px 30px; text-align: center; }
.event-title { font-family: var(--font-display); font-weight: 900; font-size: 34px; color: var(--parchment); }
.event-body { margin-top: 18px; }
.event-result { font-size: 16px; line-height: 1.55; max-width: 560px; margin: 0 auto 22px; }
.drink-stage { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.drink-bar {
  position: relative; width: min(480px, 90%); height: 38px; background: #0a0812;
  border: 2px solid var(--gold-dim); border-radius: 19px; overflow: hidden;
}
.drink-fill {
  position: absolute; inset: 0 auto 0 0; width: 0;
  background: linear-gradient(180deg, #7cc4ff, #2668c8);
  transition: width 0.1s linear;
}
.drink-bar span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; text-shadow: 0 1px 3px #000; }
.drink-warning { color: var(--danger); font-weight: 800; font-size: 18px; animation: blink 0.4s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
.hidden { display: none !important; }
.vendor-gold { margin-bottom: 16px; font-size: 16px; }
.vendor-stock { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 22px; }
.vend-card { width: 205px; padding: 16px 14px; cursor: pointer; text-align: center; transition: transform 0.15s, border-color 0.15s; }
.vend-card:hover { transform: translateY(-4px); border-color: var(--gold); }
.vend-card.sold { opacity: 0.45; cursor: default; }
.vend-card .node-name { font-size: 17px; font-family: var(--font-body); font-weight: 800; }
.vend-card .node-desc { font-size: 12.5px; }
.vend-price { margin-top: 10px; color: var(--gold-hi); font-weight: 800; }

/* ============================================================
   COMBAT LAYOUT
   ============================================================ */
#screen-combat { padding: 0; }
.combat-layout { display: flex; flex-direction: column; height: 100vh; max-width: 1500px; margin: 0 auto; padding: 10px 14px; }
.combat-top { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 8px; min-height: 78px; }
.combat-title { font-family: var(--font-display); font-weight: 700; font-size: 19px; color: var(--gold); white-space: nowrap; padding-top: 6px; min-width: 150px; }
.combat-top-btns { display: flex; gap: 8px; margin-left: auto; }

#enemy-frames { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; flex: 1; }
.eframe {
  width: 190px; background: linear-gradient(180deg, #241626, #170e1c);
  border: 1px solid #5c3040; border-radius: 8px; padding: 6px 9px;
  transition: opacity 0.4s;
}
.eframe.boss { width: 320px; border-color: var(--danger); box-shadow: 0 0 18px rgba(255, 91, 74, 0.2); }
.eframe.dead { opacity: 0.3; }
.eframe.enraged { border-color: #ff2a1a; box-shadow: 0 0 20px rgba(255, 42, 26, 0.5); animation: enragePulse 0.8s ease-in-out infinite alternate; }
@keyframes enragePulse { to { box-shadow: 0 0 32px rgba(255, 42, 26, 0.8); } }
.eframe.targetable { cursor: crosshair; border-color: var(--heal); box-shadow: 0 0 12px rgba(86, 232, 140, 0.5); }
.ef-name { font-size: 13px; font-weight: 800; color: #ffb0a0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ef-hp-wrap { position: relative; height: 14px; background: #0a0710; border-radius: 4px; overflow: hidden; margin-top: 4px; }
.ef-hp { position: absolute; inset: 0 auto 0 0; background: linear-gradient(180deg, #e86a52, #a83224); transition: width 0.15s; }
.eframe:not(.dead) .ef-hp { min-width: 4px; } /* a living enemy's bar can never render invisibly thin */
.ef-hp-text { position: absolute; inset: 0; font-size: 10px; display: flex; align-items: center; justify-content: center; color: #fff; text-shadow: 0 1px 2px #000; font-weight: 700; }
.ef-cast { position: relative; height: 13px; background: #0a0710; border-radius: 4px; overflow: hidden; margin-top: 4px; border: 1px solid var(--warn); }
.ef-cast-fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(180deg, #ffd27a, #c8862a); }
.ef-cast-label { position: absolute; inset: 0; font-size: 9.5px; display: flex; align-items: center; justify-content: center; color: #1d1206; font-weight: 800; }
.eframe.boss .ef-hp-wrap { height: 20px; }
.eframe.boss .ef-hp-text { font-size: 12px; }
.eframe.boss .ef-cast { height: 16px; }
.eframe.boss .ef-cast-label { font-size: 11px; }

.combat-mid { display: flex; gap: 12px; flex: 1; min-height: 0; }

/* party frames — the real playfield */
#party-frames { display: flex; flex-direction: column; gap: 8px; width: 250px; justify-content: center; z-index: 5; }
.pframe {
  display: flex; gap: 8px; padding: 7px 10px;
  background: linear-gradient(180deg, #1d1830, #131020);
  border: 2px solid #3a3350; border-radius: 9px;
  cursor: pointer; transition: border-color 0.15s, transform 0.1s, box-shadow 0.2s;
  position: relative;
}
.pframe:hover { border-color: var(--gold); transform: translateX(3px); }
.pframe.targetable { border-color: var(--heal); box-shadow: 0 0 14px rgba(86, 232, 140, 0.45); animation: targetPulse 0.7s ease-in-out infinite alternate; }
@keyframes targetPulse { to { box-shadow: 0 0 24px rgba(86, 232, 140, 0.7); } }
/* target pair: gold = selected friendly, red = selected hostile; the primary
   side (most recently selected) pulses stronger */
.pframe.sel-friendly { border-color: var(--gold); box-shadow: 0 0 12px rgba(217, 171, 79, 0.5); }
.eframe.sel-hostile { border-color: #ff6b57; box-shadow: 0 0 12px rgba(255, 107, 87, 0.5); }
.pframe.sel-primary { animation: primaryPulseGold 0.9s ease-in-out infinite alternate; }
.eframe.sel-primary { animation: primaryPulseRed 0.9s ease-in-out infinite alternate; }
@keyframes primaryPulseGold {
  from { box-shadow: 0 0 10px rgba(217, 171, 79, 0.45); }
  to   { box-shadow: 0 0 22px rgba(245, 217, 138, 0.85), 0 0 4px rgba(245, 217, 138, 0.9); }
}
@keyframes primaryPulseRed {
  from { box-shadow: 0 0 10px rgba(255, 107, 87, 0.45); }
  to   { box-shadow: 0 0 22px rgba(255, 130, 110, 0.85), 0 0 4px rgba(255, 130, 110, 0.9); }
}
/* in classic mode, hover (tentative, blue) must read differently from selected (committed) */
body.classic-targeting .pframe:hover { border-color: #8fb8ff; }
body.classic-targeting .eframe:hover { border-color: #8fb8ff; cursor: pointer; }
body.classic-targeting .pframe.sel-friendly,
body.classic-targeting .pframe.sel-friendly:hover { border-color: var(--gold); }
body.classic-targeting .eframe.sel-hostile,
body.classic-targeting .eframe.sel-hostile:hover { border-color: #ff6b57; }
.pframe.role-tank { border-left: 4px solid #4f8fe8; }
.pframe.role-dps { border-left: 4px solid #e85b4f; }
.pframe.role-healer { border-left: 4px solid var(--heal); }
.pframe.dead { opacity: 0.55; filter: saturate(0.3); }
.pframe.low { animation: lowPulse 0.55s ease-in-out infinite alternate; }
@keyframes lowPulse { from { box-shadow: 0 0 0 rgba(255, 60, 40, 0); } to { box-shadow: 0 0 18px rgba(255, 60, 40, 0.55); } }
.pframe.hit { border-color: #ff8a7a; }
.pframe.aggro { border-color: var(--danger) !important; box-shadow: 0 0 16px rgba(255, 60, 40, 0.6); }
.pf-left { display: flex; align-items: center; font-size: 16px; }
.pf-main { flex: 1; min-width: 0; }
.pf-name { font-size: 13.5px; font-weight: 800; color: var(--parchment); white-space: nowrap; overflow: hidden; }
.pf-cls { font-size: 11px; font-weight: 400; }
.pf-hp-wrap { position: relative; height: 17px; background: #0a0812; border-radius: 5px; overflow: hidden; margin-top: 3px; }
.pf-hp-chip { position: absolute; inset: 0 auto 0 0; background: rgba(255, 235, 220, 0.35); }
.pf-hp { position: absolute; inset: 0 auto 0 0; transition: width 0.12s; }
.pf-hp.hp-good { background: linear-gradient(180deg, #74e89a, #2b9c54); }
.pf-hp.hp-warn { background: linear-gradient(180deg, #ffd97a, #c89b2a); }
.pf-hp.hp-crit { background: linear-gradient(180deg, #ff8a72, #c23a28); }
.pf-shield { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(-45deg, rgba(126, 200, 255, 0.85) 0 5px, rgba(126, 200, 255, 0.55) 5px 10px); }
.pf-incoming { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(45deg, rgba(255, 90, 60, 0.5) 0 4px, transparent 4px 8px); display: none; }
.pf-incoming.show { display: block; animation: blink 0.5s steps(2) infinite; }
.pf-hp-text { position: absolute; inset: 0; font-size: 10.5px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; text-shadow: 0 1px 2px #000; }
.pf-buffs { display: flex; gap: 3px; margin-top: 3px; min-height: 16px; flex-wrap: wrap; }
.buff { font-size: 11px; line-height: 1; cursor: help; }
.buff.db { filter: drop-shadow(0 0 3px rgba(255, 60, 200, 0.8)); }
.pf-wounded { cursor: help; }

/* battlefield */
.battlefield-wrap {
  position: relative; flex: 1; min-width: 0; border-radius: 12px; overflow: hidden;
  border: 1px solid #2c2440; box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.5);
  display: flex; align-items: center; justify-content: center;
  background: #100c1c; /* letterbox bands when wrap ratio ≠ canvas ratio */
}
/* canvas is a replaced element with an intrinsic 960:430 ratio — height:auto +
   max-height keep it undistorted at any window size (letterboxed, never stretched) */
#bf { width: 100%; height: auto; max-height: 100%; display: block; }
#bubbles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.chat-bubble {
  position: absolute; transform: translateX(-50%); max-width: 230px;
  background: rgba(250, 244, 228, 0.96); color: #241a10;
  font-size: 12.5px; font-weight: 600; line-height: 1.3;
  padding: 7px 11px; border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  animation: bubbleIn 0.25s cubic-bezier(0.2, 1.6, 0.4, 1);
  z-index: 6;
}
.chat-bubble::after {
  content: ''; position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%);
  border: 7px solid transparent; border-top-color: rgba(250, 244, 228, 0.96); border-bottom: none;
}
@keyframes bubbleIn { from { opacity: 0; transform: translateX(-50%) scale(0.6) translateY(8px); } to { opacity: 1; transform: translateX(-50%) scale(1); } }

/* bursts: CLUTCH! / OOM! / ULT */
#bursts { position: absolute; inset: 0; pointer-events: none; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; z-index: 7; }
.burst {
  font-family: var(--font-display); font-weight: 900; text-align: center;
  animation: burstPop 1.4s cubic-bezier(0.2, 1.5, 0.3, 1) forwards;
}
@keyframes burstPop {
  0% { opacity: 0; transform: scale(0.3) rotate(-6deg); }
  12% { opacity: 1; transform: scale(1.15) rotate(2deg); }
  22% { transform: scale(1) rotate(0); }
  78% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.05) translateY(-16px); }
}
.burst-clutch { font-size: 44px; color: #ffe082; -webkit-text-stroke: 2px #7a4a10; text-shadow: 0 4px 0 rgba(0,0,0,0.45), 0 0 30px rgba(255, 200, 80, 0.6); }
.burst-star { color: #fff; }
.burst-sub {
  font-size: 14px; font-weight: 700; color: #fff2cf; -webkit-text-stroke: 0;
  text-shadow: 0 2px 3px rgba(0,0,0,0.7); margin-top: 2px; letter-spacing: 0.3px;
}
.burst-ult { font-size: 52px; color: #b8ffd0; -webkit-text-stroke: 2px #1a5c34; text-shadow: 0 4px 0 rgba(0,0,0,0.45), 0 0 40px rgba(86, 232, 140, 0.7); }
.burst-oom {
  font-size: 96px; color: #ff5b4a; -webkit-text-stroke: 3px #4a0e08;
  text-shadow: 0 6px 0 rgba(0,0,0,0.5), 0 0 60px rgba(255, 91, 74, 0.7);
  animation: oomPop 2s cubic-bezier(0.2, 1.5, 0.3, 1) forwards;
}
@keyframes oomPop {
  0% { opacity: 0; transform: scale(0.2) rotate(-10deg); }
  10% { opacity: 1; transform: scale(1.3) rotate(3deg); }
  20% { transform: scale(1) rotate(-1deg); }
  30% { transform: scale(1.06) rotate(1deg); }
  40% { transform: scale(1) rotate(0); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.1); }
}
.wipe-banner {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  background: rgba(120, 10, 5, 0.92); border: 2px solid var(--danger); border-radius: 10px;
  color: #ffd0c8; font-weight: 800; font-size: 16px; padding: 8px 18px; white-space: nowrap;
  animation: blink 0.6s steps(2) infinite; z-index: 8;
}

/* combat log side */
#combat-side {
  width: 260px; display: flex; flex-direction: column;
  background: rgba(12, 9, 19, 0.85); border: 1px solid #2c2440; border-radius: 10px; overflow: hidden;
  transition: width 0.2s, opacity 0.2s;
}
#combat-side.collapsed { width: 0; opacity: 0; border: none; }
.side-head { padding: 8px 12px; font-weight: 800; font-size: 13px; color: var(--gold); border-bottom: 1px solid #2c2440; }
#combat-log { flex: 1; overflow-y: auto; padding: 8px 10px; font-family: var(--font-mono); font-size: 11px; line-height: 1.5; }
.log-line { margin-bottom: 3px; color: #a8a0b4; }
.log-line.warn { color: var(--warn); }
.log-line.death { color: #ff8a7a; }
.log-line.clutch { color: #ffe082; }
.log-line.ghost { color: #a0c4ff; }
.log-line.boss { color: #ff9a8a; font-style: italic; }
.log-line.sys { color: var(--dim); font-style: italic; }

/* bottom bar */
.combat-bottom { padding-top: 8px; }
.cast-bar-wrap { height: 26px; display: flex; justify-content: center; }
.cast-bar {
  position: relative; width: min(420px, 80%); height: 20px;
  background: #0a0812; border: 1px solid var(--gold-dim); border-radius: 10px; overflow: hidden;
}
.cast-fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(180deg, #ffe49a, #c8962a); }
.cast-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: #241a08; }
.mana-wrap { display: flex; flex-direction: column; align-items: center; margin: 4px 0 8px; }
.mana-bar {
  position: relative; width: min(560px, 92%); height: 24px;
  background: #0a0812; border: 1px solid #2c3a60; border-radius: 12px; overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.7);
}
.mana-fill {
  position: absolute; inset: 0 auto 0 0;
  background: linear-gradient(180deg, #7cc4ff 0%, #2668c8 55%, #1a4a9c 100%);
  transition: width 0.15s;
}
.mana-fill::after { content: ''; position: absolute; inset: 0 0 55% 0; background: rgba(255, 255, 255, 0.22); border-radius: 12px 12px 0 0; }
.mana-fill.mana-low { background: linear-gradient(180deg, #ff9a7c, #c83a26); animation: blink 0.9s steps(2) infinite; }
.mana-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; color: #fff; text-shadow: 0 1px 3px #000; }

.hotbar { display: flex; gap: 7px; justify-content: center; align-items: center; flex-wrap: wrap; }
.hb-slot {
  position: relative; width: 58px; height: 58px; cursor: pointer;
  background: linear-gradient(180deg, #241d3a, #151021);
  border: 2px solid #4a4064; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.1s, border-color 0.12s, filter 0.12s; overflow: hidden;
}
.hb-slot:hover { transform: translateY(-3px); border-color: var(--gold); }
.hb-slot.selected { border-color: var(--heal); box-shadow: 0 0 14px rgba(86, 232, 140, 0.6); }
.hb-slot.unaffordable .hb-icon { filter: grayscale(1) brightness(0.5); }
.hb-slot.unaffordable { border-color: #2a2438; }
.hb-slot.gcd .hb-icon { filter: brightness(0.75); }
.hb-gcd { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: rgba(8, 6, 14, 0.62); z-index: 1; pointer-events: none; }
.hb-slot.ready-flash { animation: gcdReady 0.28s ease-out; }
@keyframes gcdReady {
  0% { border-color: #bfe2ff; box-shadow: 0 0 14px rgba(124, 196, 255, 0.85); }
  100% { }
}
.hb-slot.queued { border-color: var(--gold-hi); animation: queuedPulse 0.5s ease-in-out infinite alternate; }
.hb-slot.channeling { border-color: #c99af0; animation: channelPulse 0.8s ease-in-out infinite alternate; }
@keyframes channelPulse {
  from { box-shadow: 0 0 6px rgba(201, 154, 240, 0.4); }
  to   { box-shadow: 0 0 16px rgba(201, 154, 240, 0.8); }
}
#player-cast.channeling .cast-fill { background: linear-gradient(180deg, #d9b3ff, #8a4fd0); }
/* bard: melody notes + active-song chips */
.melody-bar { display: flex; gap: 10px; justify-content: center; margin-bottom: 4px; }
.melody-bar .note { font-size: 17px; color: #4a4064; text-shadow: none; transition: all 0.25s; }
.melody-bar .note.on { color: #f2a0e0; text-shadow: 0 0 10px rgba(242, 160, 224, 0.8); transform: scale(1.25); }
.melody-bar.chord-flash .note { color: #fff; text-shadow: 0 0 18px #f2a0e0, 0 0 8px #fff; animation: chordPop 0.9s ease-out; }
@keyframes chordPop { 0% { transform: scale(2.1); } 100% { transform: scale(1.25); } }
#song-chips { display: flex; gap: 6px; justify-content: center; margin-top: 3px; min-height: 18px; }
.song-chip {
  font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 9px;
  background: rgba(44, 36, 64, 0.9); border: 1px solid #6a5a8a; color: #e8d8ff;
}
.song-chip.fading { animation: blink 0.4s steps(2) infinite; border-color: #ff8a7a; }
/* Guild Hall training board */
.train-tier { margin-bottom: 14px; }
.train-tier-head { font-family: var(--font-display); font-weight: 700; color: var(--gold); font-size: 18px; margin: 6px 0; }
.train-tier.t-locked .shop-grid { opacity: 0.45; filter: saturate(0.4); }
.train-item .rank-pips { display: flex; gap: 4px; justify-content: center; margin: 6px 0 2px; }
.train-item .rank-pips .pip.on { background: var(--gold); border-color: var(--gold-hi); }
@keyframes queuedPulse {
  from { box-shadow: 0 0 4px rgba(245, 217, 138, 0.35); }
  to   { box-shadow: 0 0 14px rgba(245, 217, 138, 0.75); }
}
.hb-slot.bandage { border-style: dashed; }
.hb-slot.empty { opacity: 0.4; }
.hb-icon { font-size: 25px; transition: filter 0.1s; }
.hb-key {
  position: absolute; top: 2px; left: 5px; font-size: 10px; font-weight: 800; color: var(--gold-hi);
  text-shadow: 0 1px 2px #000; z-index: 2;
}
.hb-cost { position: absolute; bottom: 2px; right: 5px; font-size: 10px; font-weight: 800; color: #7cc4ff; text-shadow: 0 1px 2px #000; z-index: 2; }
.fcost { color: #ffa04a; }
.fervor-bar {
  position: relative; width: min(560px, 92%); height: 14px; margin-bottom: 4px;
  border-radius: 7px; overflow: hidden;
  background: #1a1226; border: 1px solid #4a3520;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.7);
}
.fervor-fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(180deg, #ffb35c, #cc6a1a); transition: width 0.15s; }
.fervor-text {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 10px; color: #fff; text-shadow: 0 1px 2px #000;
}
.hb-cd {
  position: absolute; left: 0; right: 0; bottom: 0; height: 0;
  background: rgba(10, 8, 18, 0.8); color: #fff; font-size: 17px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; z-index: 1;
}
.hb-consumables { display: flex; gap: 5px; margin-left: 14px; }
.hb-consum { width: 44px; height: 44px; }
.hb-consum .hb-icon { font-size: 19px; }
.hb-ult {
  position: relative; width: 68px; height: 68px; margin-left: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(closest-side, #241d3a, #151021);
  border-radius: 50%; border: 2px solid #4a4064;
  transition: transform 0.12s;
}
.hb-ult:hover { transform: scale(1.06); }
.hb-ult .hb-icon { font-size: 27px; filter: grayscale(0.8) brightness(0.6); }
.hb-ult.ready { border-color: var(--gold-hi); animation: ultGlow 1s ease-in-out infinite alternate; }
.hb-ult.ready .hb-icon { filter: none; }
@keyframes ultGlow { from { box-shadow: 0 0 10px rgba(245, 217, 138, 0.4); } to { box-shadow: 0 0 26px rgba(245, 217, 138, 0.85); } }
.ult-ring { position: absolute; inset: -2px; transform: rotate(-90deg); }
.ult-track { fill: none; stroke: #2a2438; stroke-width: 7; }
.ult-prog { fill: none; stroke: var(--gold); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset 0.3s; }
.clutch-pips { display: flex; flex-direction: column-reverse; gap: 4px; margin-left: 10px; }
.pip { width: 12px; height: 12px; border-radius: 50%; background: #241d3a; border: 1px solid #4a4064; transition: all 0.2s; }
.pip.pop { animation: pipPop 0.55s cubic-bezier(0.2, 1.5, 0.3, 1); }
@keyframes pipPop {
  0% { transform: scale(1); }
  40% { transform: scale(2); box-shadow: 0 0 14px var(--gold-hi); }
  100% { transform: scale(1); }
}
.pip.on { background: radial-gradient(circle at 35% 35%, #fff2c8, var(--gold)); border-color: var(--gold-hi); box-shadow: 0 0 8px rgba(245, 217, 138, 0.8); }

/* high-contrast accessibility mode */
body.high-contrast .pf-hp.hp-good { background: #2e7dff; }
body.high-contrast .pf-hp.hp-warn { background: #ffd400; }
body.high-contrast .pf-hp.hp-crit { background: #ff2e9a; }

/* colorblind-safe palette (GDD §10.2 rule 6): the default good/warn/crit HP-bar
   gradient and heal/damage floating numbers both rely on a green vs. red-orange
   distinction, the exact pair deuteranopia/protanopia struggle with most. Swaps
   to a blue/amber/magenta scheme (hue-separated, not just contrast-boosted —
   distinct from high-contrast so the two can be told apart if both are on). */
body.colorblind .pf-hp.hp-good { background: linear-gradient(180deg, #6fb3ff, #1f6fd6); }
body.colorblind .pf-hp.hp-warn { background: linear-gradient(180deg, #ffd25a, #d69a1a); }
body.colorblind .pf-hp.hp-crit { background: linear-gradient(180deg, #ff7ad1, #c22a90); }

/* ============================================================
   OVERLAYS
   ============================================================ */
.overlay {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(6, 4, 12, 0.78); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn 0.2s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } }
.overlay-panel { max-width: 760px; width: 100%; padding: 30px 34px; text-align: center; max-height: 92vh; overflow-y: auto; }
.overlay-panel.wide { max-width: 920px; }
.overlay-title { font-family: var(--font-display); font-weight: 900; font-size: 34px; color: var(--parchment); }
.overlay-sub { color: var(--dim); margin: 6px 0 20px; }
.overlay-btns { display: flex; gap: 12px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }

.boon-cards { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 18px; }
.boon-card, .loot-card {
  width: 215px; padding: 18px 16px; cursor: pointer; text-align: center;
  background: linear-gradient(180deg, #241d3a, #151021);
  border: 2px solid var(--rar-common); border-radius: 12px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.boon-card:hover { transform: translateY(-6px) scale(1.03); box-shadow: 0 14px 30px rgba(0,0,0,0.6); }
.boon-card.rar-rare, .loot-card.rar-rare { border-color: var(--rar-rare); box-shadow: 0 0 16px rgba(88, 170, 255, 0.2); }
.boon-card.rar-legendary, .loot-card.rar-legendary { border-color: var(--rar-legendary); box-shadow: 0 0 22px rgba(255, 157, 46, 0.35); animation: legendShimmer 1.6s ease-in-out infinite alternate; }
@keyframes legendShimmer { to { box-shadow: 0 0 34px rgba(255, 157, 46, 0.6); } }
.boon-rar { font-size: 11px; text-transform: uppercase; letter-spacing: 2px; color: var(--dim); margin-bottom: 6px; }
.rar-rare .boon-rar { color: var(--rar-rare); }
.rar-legendary .boon-rar { color: var(--rar-legendary); }
.boon-name { font-family: var(--font-display); font-weight: 700; font-size: 21px; color: var(--parchment); margin-bottom: 8px; }
.boon-desc { font-size: 13px; color: var(--text); line-height: 1.45; }
.loot-card { width: auto; max-width: 400px; margin: 0 auto; cursor: default; }

/* equip flow: gear strip + new-vs-equipped comparison */
.gear-strip { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 4px 0 16px; }
.gear-slot {
  font-size: 12px; padding: 4px 10px; border-radius: 6px;
  background: #171226; border: 1px solid #2c2440; color: var(--text);
  max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gear-slot.empty { color: var(--dim); }
.gear-slot.hl { border-color: var(--gold); box-shadow: 0 0 8px rgba(217, 171, 79, 0.35); }
.loot-compare { display: flex; gap: 22px; justify-content: center; align-items: flex-start; flex-wrap: wrap; margin-bottom: 18px; }
.loot-col { flex: 1 1 300px; max-width: 380px; display: flex; flex-direction: column; gap: 10px; }
.loot-col .loot-card { margin: 0; max-width: none; }
.loot-col-label { font-size: 11.5px; font-weight: 800; letter-spacing: 2px; color: var(--dim); }
.loot-col-label.new { color: var(--gold-hi); }
.equip-choice { display: flex; flex-direction: column; gap: 6px; }
.loot-card.empty-slot { border-style: dashed; opacity: 0.75; }
.loot-replace { margin-top: 12px; font-size: 12.5px; color: var(--warn); }

.shop-grid, .achv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 12px; margin-bottom: 20px; text-align: left; }
.shop-item { padding: 14px 16px; cursor: pointer; transition: transform 0.12s, border-color 0.12s; }
.shop-item::after { display: none; }
.shop-item:hover:not(.owned) { transform: translateY(-3px); border-color: var(--gold); }
.shop-item.owned { opacity: 0.55; cursor: default; border-color: var(--heal); }
.shop-item.poor { opacity: 0.7; }
.achv-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; background: var(--ink2); border-radius: 8px; border: 1px solid #2c2440; font-size: 13.5px; }
.achv-item.done { border-color: var(--gold-dim); background: linear-gradient(180deg, #241d3a, #1a1428); }
.achv-item:not(.done) { opacity: 0.6; }
.achv-check { font-size: 18px; }
.codex-row { display: flex; gap: 8px; align-items: center; justify-content: center; margin-bottom: 18px; flex-wrap: wrap; }
.setting-row { display: flex; gap: 10px; align-items: center; justify-content: flex-start; text-align: left; padding: 9px 4px; font-size: 16px; }
.setting-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--gold); }
.save-row { justify-content: center; margin-top: 8px; }
#overlay-settings .btn-primary { margin-top: 14px; }

/* ============================================================
   BLAME SCREEN
   ============================================================ */
.blame-wrap { max-width: 1060px; margin: 0 auto; padding: 4vh 20px 40px; }
.blame-title {
  font-family: var(--font-display); font-weight: 900; text-align: center;
  font-size: clamp(36px, 6vw, 64px); letter-spacing: 1px;
  animation: logoIn 0.5s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.blame-title.win { color: var(--gold-hi); text-shadow: 0 0 50px rgba(245, 217, 138, 0.4), 0 4px 0 rgba(0,0,0,0.5); }
.blame-title.loss { color: var(--danger); text-shadow: 0 0 50px rgba(255, 91, 74, 0.3), 0 4px 0 rgba(0,0,0,0.5); }
.blame-cols { display: flex; gap: 20px; margin-top: 24px; flex-wrap: wrap; }
.blame-chat { flex: 1.2; min-width: 320px; padding: 0 0 14px; overflow: hidden; }
.blame-stats { flex: 1; min-width: 300px; padding: 0 0 20px; }
.chat-head {
  background: linear-gradient(180deg, #2c2440, #1d1830); padding: 9px 16px;
  font-family: var(--font-mono); font-size: 12px; color: var(--gold); font-weight: 600;
  border-bottom: 1px solid var(--gold-dim); border-radius: 10px 10px 0 0;
}
.chat-lines { padding: 14px 18px; font-family: var(--font-mono); font-size: 13px; line-height: 1.8; }
.chat-line { opacity: 0; animation: chatIn 0.3s ease-out forwards; }
@keyframes chatIn { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
.chat-who { color: #7cc4ff; }
.chat-line.sys { color: var(--dim); font-style: italic; }
.chat-line.stars { color: var(--gold-hi); margin-top: 8px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 14px 18px; }
.stat-grid > div { padding: 8px 10px; background: rgba(10, 8, 18, 0.5); border-radius: 6px; }
.stat-grid i { display: block; font-style: normal; color: var(--dim); font-size: 11.5px; text-transform: uppercase; letter-spacing: 1px; }
.stat-grid b { font-size: 17px; color: var(--parchment); }
.respect-earn {
  text-align: center; font-size: 21px; font-weight: 800; color: #d68aff;
  padding: 12px; animation: logoIn 0.6s 0.4s cubic-bezier(0.2, 1.4, 0.4, 1) backwards;
}

/* ============================================================
   TOASTS & TOOLTIP
   ============================================================ */
/* top-RIGHT corner (was top-center, where it covered enemy frames and screen titles) */
#toasts { position: fixed; top: 64px; right: 14px; z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast {
  background: linear-gradient(180deg, #2c2440, #17121f);
  border: 1px solid var(--gold-dim); border-radius: 10px;
  padding: 10px 20px; font-size: 14.5px; max-width: min(420px, 70vw);
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  opacity: 0; transform: translateX(18px); transition: all 0.35s cubic-bezier(0.2, 1.2, 0.4, 1);
  text-align: left;
}
.toast.show { opacity: 1; transform: none; }
.toast.achv { border-color: var(--gold); box-shadow: 0 0 24px rgba(217, 171, 79, 0.35); }

#tooltip {
  position: fixed; z-index: 70; pointer-events: none;
  background: rgba(14, 10, 22, 0.97); border: 1px solid var(--gold-dim); border-radius: 8px;
  padding: 9px 13px; font-size: 13px; max-width: 300px; line-height: 1.45;
  box-shadow: 0 8px 24px rgba(0,0,0,0.7);
}

/* ---------- scrollbars ---------- */
::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: #3a3350; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  #party-frames { width: 205px; }
  .pframe { padding: 5px 8px; }
  #combat-side:not(.collapsed) { position: absolute; right: 10px; top: 90px; bottom: 130px; z-index: 20; }
  .combat-mid { position: relative; }
}
@media (max-width: 720px) {
  .combat-layout { height: auto; min-height: 100vh; }
  .combat-mid { flex-direction: column; }
  #party-frames { width: 100%; flex-direction: row; flex-wrap: wrap; }
  .pframe { flex: 1 1 45%; }
  .battlefield-wrap { min-height: 240px; }
  .hb-slot { width: 50px; height: 50px; }
  .blame-cols { flex-direction: column; }
}
