/* ============================================
   AETHERIA COMBAT — fullscreen prototype
   Two surface modes: .mode-flat / .mode-ornate
   Accent: --accent, --accent-soft, --accent-glow
============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=Cinzel+Decorative:wght@400;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg-0: #07090e;
  --bg-1: #0a0d14;
  --bg-2: #10141d;
  --bg-3: #161b26;
  --bg-4: #1d2330;
  --line: #2a3142;
  --line-soft: #1d2330;
  --ink-0: #efe9d7;
  --ink-1: #c8c1ac;
  --ink-2: #8d8773;
  --ink-3: #5a5645;
  --hp-good: #5fb86b;
  --hp-mid: #d9a14f;
  --hp-low: #c43c3c;
  --mp: #5fa0e8;
  --fur: #d97a4f;
  --ene: #b08af0;
  --xp: #c8a860;
  --shield: #5fb6d9;
  --crit: #ffb84a;
  --heal: #62d685;
  --accent: #c8a860;
  --accent-soft: #a08840;
  --accent-glow: rgba(200, 168, 96, 0.35);
  --rarity-common: #b8b3a0;
  --rarity-uncommon: #5fb86b;
  --rarity-rare: #5fa0e8;
  --rarity-epic: #b890e0;
  --rarity-legendary: #ffb84a;
}

[data-accent="crimson"] {
  --accent: #c84860;
  --accent-soft: #963444;
  --accent-glow: rgba(200, 72, 96, 0.4);
}
[data-accent="arcane"] {
  --accent: #8a6dd9;
  --accent-soft: #6850a8;
  --accent-glow: rgba(138, 109, 217, 0.4);
}
[data-accent="frost"] {
  --accent: #5fb6d9;
  --accent-soft: #3a8aac;
  --accent-glow: rgba(95, 182, 217, 0.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: #000;
  color: var(--ink-0);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#root, .app-stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-scale {
  width: 1920px;
  height: 1080px;
  position: relative;
  transform-origin: center center;
  overflow: hidden;
  background: var(--bg-0);
}

/* ===== TYPOGRAPHY ===== */
.font-display { font-family: 'Cinzel', serif; font-weight: 600; letter-spacing: 0.04em; }
.font-display-deco { font-family: 'Cinzel Decorative', serif; font-weight: 700; letter-spacing: 0.06em; }
.font-mono { font-family: 'JetBrains Mono', monospace; font-feature-settings: 'tnum'; }
.font-ui { font-family: 'Inter', sans-serif; }
.uppercase { text-transform: uppercase; }
.label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.label-accent { color: var(--accent); }

/* ===== ZONE BACKDROP ===== */
.zone-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.zone-backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 100% 70% at 50% 50%, transparent 30%, rgba(0,0,0,0.55) 95%);
  pointer-events: none;
}
.zone-horizon {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 38%;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.35) 50%, rgba(0,0,0,0.78) 100%);
}
.zone-silhouette {
  position: absolute;
  left: 0; right: 0;
  width: 100%;
  height: 38%;
  bottom: 0;
  opacity: 0.7;
  filter: blur(0.4px);
}
.zone-grain {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  mix-blend-mode: overlay;
  background-image:
    radial-gradient(circle at 12% 24%, rgba(255,255,255,0.04) 0px, transparent 1px),
    radial-gradient(circle at 78% 56%, rgba(255,255,255,0.05) 0px, transparent 1px),
    radial-gradient(circle at 38% 88%, rgba(255,255,255,0.04) 0px, transparent 1px);
  background-size: 90px 90px, 60px 60px, 130px 130px;
  pointer-events: none;
}

/* ===== TOP BAR ===== */
.top-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 88px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 32px;
  z-index: 10;
  background: linear-gradient(180deg, rgba(8,10,14,0.92) 0%, rgba(8,10,14,0.72) 60%, transparent 100%);
}
.top-bar-left { display: flex; flex-direction: column; gap: 4px; }
.top-bar-center { display: flex; align-items: center; gap: 24px; }
.top-bar-right { display: flex; align-items: center; gap: 14px; justify-content: flex-end; }

.zone-name {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 28px;
  color: var(--ink-0);
  letter-spacing: 0.06em;
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.zone-name .tier {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 4px 8px;
  border: 1px solid var(--accent-soft);
  border-radius: 2px;
  background: rgba(0,0,0,0.4);
}
.wave-counter {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.wave-counter .lbl {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.wave-counter .val {
  font-family: 'Cinzel', serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-0);
}
.wave-pips {
  display: flex;
  gap: 4px;
}
.wave-pip {
  width: 22px;
  height: 4px;
  background: var(--bg-3);
  border: 1px solid var(--line-soft);
}
.wave-pip.done { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 6px var(--accent-glow); }
.wave-pip.current { background: var(--accent-soft); border-color: var(--accent); animation: pulse-pip 1.6s ease-in-out infinite; }
.wave-pip.boss { width: 28px; background: var(--bg-4); border-color: var(--accent-soft); position: relative; }
.wave-pip.boss::after { content:''; position:absolute; inset:0; background: linear-gradient(90deg, transparent, var(--accent) 50%, transparent); opacity: 0.4; }
@keyframes pulse-pip { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* zone state icons */
.state-icons {
  display: flex;
  align-items: center;
  gap: 18px;
}
.state-group { display: flex; align-items: center; gap: 6px; padding: 6px 10px 6px 12px; background: rgba(0,0,0,0.5); border: 1px solid var(--line); }
.state-group .lbl-icon { font-size: 10px; letter-spacing: 0.2em; font-weight: 700; }
.state-group.buffs { border-left: 2px solid var(--hp-good); }
.state-group.buffs .lbl-icon { color: var(--hp-good); }
.state-group.debuffs { border-left: 2px solid var(--hp-low); }
.state-group.debuffs .lbl-icon { color: var(--hp-low); }
.state-icon {
  position: relative;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-3);
  border: 1px solid var(--line);
  font-size: 14px;
  cursor: help;
  transition: transform 120ms;
}
.state-icon:hover { transform: translateY(-2px); border-color: var(--accent); }
.state-icon.buff { border-color: rgba(95,184,107,0.5); }
.state-icon.debuff { border-color: rgba(196,60,60,0.5); }
.state-icon .tip {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-1);
  border: 1px solid var(--accent-soft);
  padding: 8px 10px;
  white-space: nowrap;
  font-size: 11px;
  color: var(--ink-0);
  pointer-events: none;
  opacity: 0;
  transition: opacity 140ms;
  z-index: 20;
  min-width: 170px;
  text-align: left;
}
.state-icon .tip::before {
  content: '';
  position: absolute;
  top: -5px; left: 50%;
  margin-left: -5px;
  width: 8px; height: 8px;
  background: var(--bg-1);
  border-left: 1px solid var(--accent-soft);
  border-top: 1px solid var(--accent-soft);
  transform: rotate(45deg);
}
.state-icon:hover .tip { opacity: 1; }
.state-icon .tip .t-name { font-weight: 600; font-size: 12px; letter-spacing: 0.05em; color: var(--ink-0); display: block; margin-bottom: 3px; }
.state-icon.buff .tip .t-name { color: var(--hp-good); }
.state-icon.debuff .tip .t-name { color: var(--hp-low); }
.state-icon .tip .t-desc { font-size: 11px; color: var(--ink-2); font-weight: 400; letter-spacing: 0; }

/* Top right buttons */
.timer {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding: 6px 14px;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
.timer .lbl { font-size: 9px; letter-spacing: 0.22em; color: var(--ink-2); }
.timer .val { font-family: 'JetBrains Mono', monospace; font-size: 22px; font-weight: 600; color: var(--ink-0); }

.btn {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 10px 18px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--ink-1);
  cursor: pointer;
  transition: all 140ms;
  position: relative;
}
.btn:hover { color: var(--ink-0); border-color: var(--accent); }
.btn-accent { background: linear-gradient(180deg, var(--accent-soft), var(--bg-3)); border-color: var(--accent); color: var(--ink-0); }
.btn-accent:hover { background: linear-gradient(180deg, var(--accent), var(--accent-soft)); box-shadow: 0 0 14px var(--accent-glow); }
.btn-danger { color: #f0a0a0; border-color: rgba(196, 60, 60, 0.4); }
.btn-danger:hover { color: #fff; background: rgba(196, 60, 60, 0.18); border-color: var(--hp-low); }
.btn-ghost { background: transparent; }
.btn-lg { padding: 14px 28px; font-size: 13px; }
.btn-xl { padding: 18px 36px; font-size: 15px; }
.btn-icon { padding: 8px 10px; min-width: 38px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== COMBAT ARENA ===== */
.arena {
  position: absolute;
  inset: 88px 0 150px 0;
  display: flex;
  flex-direction: column;
  z-index: 5;
}
.arena.with-log { bottom: 260px; }
.row-enemies, .row-party {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 16px 80px;
  position: relative;
}
.row-enemies { align-items: flex-start; padding-top: 24px; }
.row-party { align-items: flex-end; padding-bottom: 22px; }

.row-label {
  position: absolute;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}
.row-label.enemies { top: 12px; left: 80px; }
.row-label.party { bottom: 12px; right: 80px; }

.vs-divider {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 18px;
  z-index: 6;
}
.vs-line {
  width: 380px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), var(--accent-soft), var(--line), transparent);
  position: relative;
}
.vs-badge {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--accent);
  padding: 8px 16px;
  background: var(--bg-0);
  border: 1px solid var(--accent-soft);
  white-space: nowrap;
}

/* ===== UNIT CARDS (enemies + party) ===== */
.unit-card {
  width: 270px;
  height: 312px;
  background: linear-gradient(180deg, rgba(20,24,33,0.92) 0%, rgba(10,13,20,0.96) 100%);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 140ms, box-shadow 220ms;
}
.unit-card.dead { opacity: 0.4; filter: grayscale(0.7); }
.unit-card.party.active { border-color: var(--accent); box-shadow: 0 0 18px var(--accent-glow), inset 0 0 0 1px var(--accent-soft); }
.unit-card.targeted { border-color: var(--hp-low); box-shadow: 0 0 18px rgba(196,60,60,0.35); }

.unit-head {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(0,0,0,0.5), transparent);
}
.unit-head .name { font-family: 'Cinzel', serif; font-size: 17px; font-weight: 600; letter-spacing: 0.04em; color: var(--ink-0); line-height: 1; }
.unit-head .sub { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2); margin-top: 4px; }
.unit-head-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.unit-rank {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 2px 6px;
  background: rgba(0,0,0,0.6);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.unit-rank.elite { color: var(--accent); border-color: var(--accent-soft); }
.unit-rank.boss { color: #fff; background: var(--hp-low); border-color: var(--hp-low); }

.portrait {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-1);
  border-bottom: 1px solid var(--line-soft);
  overflow: hidden;
}
.portrait::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.018) 0 1px, transparent 1px 8px),
    radial-gradient(ellipse at center, rgba(255,255,255,0.04) 0%, transparent 60%);
}
.portrait .glyph {
  font-size: 84px;
  filter: drop-shadow(0 6px 22px rgba(0,0,0,0.6));
  z-index: 1;
}
.portrait .slot-label {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--ink-3);
  background: rgba(0,0,0,0.6);
  padding: 2px 6px;
  border: 1px dashed var(--line);
  text-transform: lowercase;
}
.portrait .badges {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  gap: 4px;
}
.portrait .badge-mini {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.7);
  border: 1px solid var(--line);
  font-size: 10px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}
.portrait .badge-mini.buff { color: var(--hp-good); border-color: rgba(95,184,107,0.5); }
.portrait .badge-mini.debuff { color: var(--hp-low); border-color: rgba(196,60,60,0.5); }
.portrait .badge-mini.dot { color: var(--accent); border-color: var(--accent-soft); }

.unit-stats {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ===== BARS ===== */
.bar {
  position: relative;
  height: 18px;
  background: var(--bg-1);
  border: 1px solid var(--line-soft);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  position: relative;
  transition: width 220ms cubic-bezier(0.4, 0, 0.2, 1);
}
.bar-hp .bar-fill { background: linear-gradient(180deg, var(--hp-good), color-mix(in oklab, var(--hp-good), black 30%)); }
.bar-hp.mid .bar-fill { background: linear-gradient(180deg, var(--hp-mid), color-mix(in oklab, var(--hp-mid), black 30%)); }
.bar-hp.low .bar-fill { background: linear-gradient(180deg, var(--hp-low), color-mix(in oklab, var(--hp-low), black 30%)); animation: hp-pulse 1.4s ease-in-out infinite; }
@keyframes hp-pulse { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.35); } }
.bar-mp .bar-fill { background: linear-gradient(180deg, var(--mp), color-mix(in oklab, var(--mp), black 35%)); }
.bar-fur .bar-fill { background: linear-gradient(180deg, var(--fur), color-mix(in oklab, var(--fur), black 30%)); }
.bar-ene .bar-fill { background: linear-gradient(180deg, var(--ene), color-mix(in oklab, var(--ene), black 30%)); }
.bar-xp .bar-fill { background: linear-gradient(180deg, var(--xp), color-mix(in oklab, var(--xp), black 30%)); }
.bar-cast .bar-fill { background: linear-gradient(180deg, var(--accent), var(--accent-soft)); }
.bar-cast.heal .bar-fill { background: linear-gradient(180deg, var(--heal), color-mix(in oklab, var(--heal), black 30%)); }

.bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bar-row .key {
  font-family: 'Inter', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--ink-2);
  width: 26px;
  flex-shrink: 0;
}
.bar-row .bar { flex: 1; }
.bar-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-0);
  text-shadow: 0 1px 2px rgba(0,0,0,0.9);
  letter-spacing: 0.02em;
}
.bar-num.pct {
  justify-content: flex-end;
  padding-right: 8px;
}
.bar-cast-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.bar-cast-row .ability-tag {
  flex-shrink: 0;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--ink-1);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar-cast-row .ability-tag .icon { font-size: 11px; }
.bar-cast-row .bar { height: 8px; }
.bar-cast-row .bar-num { font-size: 9px; }
.bar-cast-row .pct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--accent);
  font-weight: 600;
  min-width: 36px;
  text-align: right;
}

/* ===== ABILITY DOCK (bottom) ===== */
.ability-dock {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 0 80px;
  background: linear-gradient(0deg, rgba(8,10,14,0.96) 0%, rgba(8,10,14,0.72) 60%, transparent 100%);
  z-index: 9;
}
.ability-dock.with-log { bottom: 110px; }

.dock-side {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
}
.dock-side .lbl-stack { display: flex; flex-direction: column; gap: 2px; }
.dock-side .lbl-stack .l1 { font-size: 9px; letter-spacing: 0.22em; color: var(--ink-3); font-weight: 700; }
.dock-side .lbl-stack .l2 { font-size: 12px; font-weight: 600; color: var(--ink-1); letter-spacing: 0.05em; }

.ability-slot {
  position: relative;
  width: 76px;
  height: 76px;
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 140ms;
}
.ability-slot:hover { border-color: var(--accent); transform: translateY(-2px); }
.ability-slot.ready { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-soft), 0 0 12px var(--accent-glow); }
.ability-slot.ready::before {
  content: '';
  position: absolute;
  inset: -2px;
  border: 1px solid var(--accent);
  opacity: 0.4;
  animation: ready-pulse 2.2s ease-in-out infinite;
}
.ability-slot.casting { border-color: var(--hp-good); box-shadow: 0 0 18px rgba(95,184,107,0.4); }
.ability-slot.cooldown { opacity: 0.85; }
.ability-slot.disabled { opacity: 0.35; cursor: not-allowed; }
@keyframes ready-pulse { 0%,100% { opacity: 0.5; transform: scale(1); } 50% { opacity: 0; transform: scale(1.08); } }

.ability-slot .glyph { font-size: 38px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6)); }
.ability-slot .hotkey {
  position: absolute;
  top: 3px;
  left: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(0,0,0,0.7);
  border: 1px solid var(--accent-soft);
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.ability-slot .cd-overlay {
  position: absolute;
  left: 0; right: 0; top: 0;
  background: rgba(0,0,0,0.78);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ability-slot .cd-overlay .cd-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 600;
  color: var(--ink-0);
  text-shadow: 0 2px 6px #000;
}

.ability-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.ability-block .owner {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.ability-block .owner.you { color: var(--accent); }
.ability-block .auto-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
  cursor: pointer;
}
.toggle {
  width: 28px;
  height: 14px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  position: relative;
  cursor: pointer;
  transition: background 140ms;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 1px;
  width: 10px;
  height: 10px;
  background: var(--ink-2);
  transition: transform 140ms, background 140ms;
}
.toggle.on { background: rgba(200, 168, 96, 0.25); border-color: var(--accent); }
.toggle.on::after { background: var(--accent); transform: translateX(14px); }

/* ===== COMBAT LOG ===== */
.combat-log {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 110px;
  background: linear-gradient(0deg, rgba(0,0,0,0.94) 0%, rgba(0,0,0,0.82) 100%);
  border-top: 1px solid var(--line);
  z-index: 8;
  display: flex;
  flex-direction: column;
}
.combat-log.hidden { transform: translateY(100%); transition: transform 220ms; }
.combat-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 32px;
  border-bottom: 1px solid var(--line-soft);
}
.combat-log-head .title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 10px;
}
.combat-log-head .title .pulse { width: 6px; height: 6px; background: var(--accent); border-radius: 50%; animation: dot 1.4s ease-in-out infinite; }
@keyframes dot { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.combat-log-body {
  flex: 1;
  overflow: hidden;
  padding: 6px 32px 8px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 0;
}
.log-line {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--ink-1);
  padding: 2px 0;
  letter-spacing: 0.02em;
  animation: log-in 220ms ease-out;
}
@keyframes log-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.log-line .t { color: var(--ink-3); margin-right: 10px; }
.log-line .actor { color: var(--accent); }
.log-line .target { color: var(--ink-0); font-weight: 600; }
.log-line .dmg { color: var(--hp-low); font-weight: 600; }
.log-line .heal { color: var(--hp-good); font-weight: 600; }
.log-line .ability { color: var(--ink-0); font-style: italic; }
.log-line.system { color: var(--accent); font-weight: 500; }
.log-line.crit .dmg { color: var(--crit); }

.log-collapse-btn {
  position: absolute;
  right: 32px;
  bottom: 100%;
  margin-bottom: 4px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 5px 10px;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  z-index: 11;
}
.log-collapse-btn:hover { color: var(--ink-0); border-color: var(--accent); }

/* ===== FLOATING DAMAGE NUMBERS ===== */
.dmg-float {
  position: absolute;
  pointer-events: none;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  z-index: 12;
  animation: dmg-float 1.4s ease-out forwards;
  text-shadow: 0 2px 8px #000, 0 0 18px rgba(0,0,0,0.6);
  letter-spacing: 0.04em;
}
.dmg-float.dmg { color: #f0a888; font-size: 30px; }
.dmg-float.crit { color: var(--crit); font-size: 42px; font-family: 'Cinzel Decorative', serif; font-weight: 700; }
.dmg-float.heal { color: var(--heal); font-size: 28px; }
.dmg-float.miss { color: var(--ink-2); font-size: 22px; }
@keyframes dmg-float {
  0% { opacity: 0; transform: translateY(0) scale(0.8); }
  18% { opacity: 1; transform: translateY(-18px) scale(1.15); }
  38% { transform: translateY(-26px) scale(1); }
  100% { opacity: 0; transform: translateY(-90px) scale(0.95); }
}

/* ===== ORNATE MODE ===== */
.mode-ornate .unit-card,
.mode-ornate .ability-slot,
.mode-ornate .panel,
.mode-ornate .loot-card,
.mode-ornate .party-card,
.mode-ornate .boss-side-panel,
.mode-ornate .swap-card,
.mode-ornate .xp-cell,
.mode-ornate .ready-pill {
  position: relative;
  background:
    linear-gradient(180deg, rgba(28,32,42,0.94) 0%, rgba(14,17,24,0.96) 100%);
  border: 1px solid var(--accent-soft);
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,0.6),
    inset 0 0 0 2px rgba(200,168,96,0.08),
    0 6px 22px rgba(0,0,0,0.4);
}
.mode-ornate .unit-card::before,
.mode-ornate .party-card::before,
.mode-ornate .panel::before,
.mode-ornate .loot-card::before,
.mode-ornate .boss-side-panel::before {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(200, 168, 96, 0.22);
  pointer-events: none;
  z-index: 1;
}
.mode-ornate .unit-card::after,
.mode-ornate .party-card::after,
.mode-ornate .panel::after,
.mode-ornate .loot-card::after,
.mode-ornate .boss-side-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  /* runic corner brackets — 4 corners */
  background-image:
    linear-gradient(to right, var(--accent), var(--accent) 18px, transparent 18px),
    linear-gradient(to bottom, var(--accent), var(--accent) 18px, transparent 18px),
    linear-gradient(to left, var(--accent), var(--accent) 18px, transparent 18px),
    linear-gradient(to bottom, var(--accent), var(--accent) 18px, transparent 18px),
    linear-gradient(to right, var(--accent), var(--accent) 18px, transparent 18px),
    linear-gradient(to top, var(--accent), var(--accent) 18px, transparent 18px),
    linear-gradient(to left, var(--accent), var(--accent) 18px, transparent 18px),
    linear-gradient(to top, var(--accent), var(--accent) 18px, transparent 18px);
  background-position:
    top left, top left,
    top right, top right,
    bottom left, bottom left,
    bottom right, bottom right;
  background-size:
    18px 1px, 1px 18px,
    18px 1px, 1px 18px,
    18px 1px, 1px 18px,
    18px 1px, 1px 18px;
  background-repeat: no-repeat;
  opacity: 0.85;
}
.mode-ornate .ability-slot { border-color: var(--accent-soft); }
.mode-ornate .ability-slot::after {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(200,168,96,0.22);
  pointer-events: none;
}
.mode-ornate .zone-name { font-family: 'Cinzel Decorative', serif; font-weight: 700; }
.mode-ornate .vs-badge { font-family: 'Cinzel Decorative', serif; }
.mode-ornate .top-bar {
  background: linear-gradient(180deg, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.6) 70%, transparent 100%);
  border-bottom: 1px solid rgba(200, 168, 96, 0.18);
}
.mode-ornate .top-bar::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--accent-soft) 20%, var(--accent) 50%, var(--accent-soft) 80%, transparent 100%);
}
.mode-ornate .ability-dock {
  background: linear-gradient(0deg, rgba(0,0,0,0.96) 0%, rgba(0,0,0,0.7) 70%, transparent 100%);
  border-top: 1px solid rgba(200, 168, 96, 0.18);
}
.mode-ornate .ability-dock::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--accent-soft) 20%, var(--accent) 50%, var(--accent-soft) 80%, transparent 100%);
}
.mode-ornate .combat-log { border-top: 1px solid rgba(200,168,96,0.22); }
.mode-ornate .btn {
  background: linear-gradient(180deg, rgba(40,32,18,0.7), rgba(20,18,12,0.85));
  border-color: var(--accent-soft);
  letter-spacing: 0.18em;
}

/* ===== PRE-COMBAT (LOADOUT) ===== */
.loadout-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 60px 80px 50px;
  z-index: 5;
}
.loadout-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 24px;
  margin-bottom: 36px;
}
.loadout-title {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 56px;
  color: var(--ink-0);
  letter-spacing: 0.05em;
  line-height: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mode-ornate .loadout-title { font-family: 'Cinzel Decorative', serif; }
.loadout-title .eyebrow { font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 700; letter-spacing: 0.32em; text-transform: uppercase; color: var(--accent); }
.loadout-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.loadout-summary .big {
  font-family: 'Cinzel', serif;
  font-size: 32px;
  font-weight: 600;
  color: var(--ink-0);
}
.loadout-summary .small {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.loadout-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: min-content;
  align-items: start;
  gap: 24px;
  min-height: 0;
}
.party-card {
  background: linear-gradient(180deg, rgba(20,24,33,0.94) 0%, rgba(10,13,20,0.96) 100%);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.party-card .pc-portrait {
  height: 220px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-1);
  border-bottom: 1px solid var(--line-soft);
}
.party-card .pc-portrait::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 10px),
    radial-gradient(ellipse at center, rgba(255,255,255,0.05) 0%, transparent 65%);
}
.party-card .pc-portrait .glyph { font-size: 110px; z-index: 1; filter: drop-shadow(0 6px 20px rgba(0,0,0,0.6)); }
.party-card .pc-portrait .slot-tag {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--ink-3);
  background: rgba(0,0,0,0.6);
  padding: 3px 8px;
  border: 1px dashed var(--line);
}
.party-card .pc-info {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.party-card .pc-info .nm { font-family: 'Cinzel', serif; font-size: 22px; font-weight: 600; color: var(--ink-0); display: flex; align-items: baseline; gap: 8px; }
.party-card .pc-info .nm .you { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); font-family: 'Inter', sans-serif; }
.party-card .pc-info .meta { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); margin-top: 4px; }
.party-card .pc-stats {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-bottom: 1px solid var(--line-soft);
}
.party-card .pc-stats .stat-row { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: 0.08em; }
.party-card .pc-stats .stat-row .k { color: var(--ink-2); text-transform: uppercase; font-weight: 600; }
.party-card .pc-stats .stat-row .v { color: var(--ink-0); font-family: 'JetBrains Mono', monospace; font-weight: 600; }
.party-card .pc-ability {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.party-card .pc-ability .ab-label {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 700;
}
.party-card .pc-ability .ab-current {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 140ms;
}
.party-card .pc-ability .ab-current:hover { border-color: var(--accent); }
.party-card .pc-ability .ab-current .ab-glyph {
  width: 52px;
  height: 52px;
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  border: 1px solid var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}
.party-card .pc-ability .ab-current .ab-text { flex: 1; min-width: 0; }
.party-card .pc-ability .ab-current .ab-text .n { font-family: 'Cinzel', serif; font-size: 15px; font-weight: 600; color: var(--ink-0); }
.party-card .pc-ability .ab-current .ab-text .d { font-size: 11px; color: var(--ink-2); margin-top: 3px; line-height: 1.4; }
.party-card .pc-ability .ab-current .ab-text .tags { display: flex; gap: 5px; margin-top: 5px; }
.party-card .pc-ability .ab-current .ab-text .tag { font-size: 8.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); padding: 2px 5px; border: 1px solid var(--accent-soft); }
.party-card .pc-ability .ab-current .swap { font-size: 9px; letter-spacing: 0.18em; color: var(--accent); text-transform: uppercase; }
.party-card .pc-ability .autocast-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
}
.party-card .pc-ability .autocast-row .lbl { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-2); font-weight: 600; }
.party-card .pc-ability .autocast-row .hot { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--ink-3); }
.party-card .pc-ability .autocast-row .hot b { color: var(--accent); }

.loadout-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 32px;
  gap: 32px;
}
.loadout-foot .ready-state {
  display: flex;
  align-items: center;
  gap: 32px;
}
.ready-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-weight: 600;
}
.ready-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--hp-good); box-shadow: 0 0 8px rgba(95,184,107,0.6); }

/* ability swap drawer */
.swap-drawer-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 2, 6, 0.85);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  backdrop-filter: blur(4px);
}
.swap-drawer {
  width: 1200px;
  max-height: 100%;
  background: linear-gradient(180deg, rgba(20,24,33,0.98), rgba(10,13,20,1));
  border: 1px solid var(--accent-soft);
  display: flex;
  flex-direction: column;
  position: relative;
}
.swap-drawer-head {
  padding: 22px 28px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.swap-drawer-head .ttl { font-family: 'Cinzel', serif; font-size: 24px; font-weight: 600; color: var(--ink-0); }
.swap-drawer-head .sub { font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-2); margin-top: 4px; }
.swap-drawer-body {
  padding: 24px 28px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  overflow-y: auto;
}
.swap-card {
  padding: 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 140ms;
  display: flex;
  gap: 12px;
}
.swap-card:hover { border-color: var(--accent); }
.swap-card.selected { border-color: var(--accent); background: rgba(200,168,96,0.08); box-shadow: inset 0 0 0 1px var(--accent-soft); }
.swap-card .sc-glyph { width: 48px; height: 48px; background: linear-gradient(180deg, var(--bg-3), var(--bg-1)); border: 1px solid var(--accent-soft); display: flex; align-items: center; justify-content: center; font-size: 26px; flex-shrink: 0; }
.swap-card .sc-text { flex: 1; min-width: 0; }
.swap-card .sc-text .n { font-family: 'Cinzel', serif; font-size: 14px; font-weight: 600; color: var(--ink-0); }
.swap-card .sc-text .d { font-size: 11px; color: var(--ink-2); margin-top: 4px; line-height: 1.4; }
.swap-card .sc-text .meta { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.swap-card .sc-text .meta span { font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); padding: 2px 5px; border: 1px solid var(--line); }
.swap-card .sc-text .meta span.tag { color: var(--accent); border-color: var(--accent-soft); }

/* ===== BOSS MODE ===== */
.boss-arena {
  position: absolute;
  inset: 88px 0 150px 0;
  display: flex;
  flex-direction: column;
  z-index: 5;
}
.boss-arena.with-log { bottom: 260px; }
.boss-stage {
  flex: 1;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 24px 80px 30px;
  position: relative;
  gap: 40px;
}
.boss-card {
  flex: 1;
  max-width: 880px;
  background: linear-gradient(180deg, rgba(28,18,22,0.94) 0%, rgba(10,8,12,0.96) 100%);
  border: 1px solid var(--hp-low);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 50px rgba(196,60,60,0.15), inset 0 0 0 1px rgba(196,60,60,0.2);
}
.boss-card .bc-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(60,20,20,0.4), transparent);
}
.boss-card .bc-head .name { font-family: 'Cinzel', serif; font-size: 32px; font-weight: 700; color: var(--ink-0); letter-spacing: 0.06em; display: flex; align-items: baseline; gap: 12px; }
.mode-ornate .boss-card .bc-head .name { font-family: 'Cinzel Decorative', serif; }
.boss-card .bc-head .name .rank { font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--hp-low); padding: 4px 8px; border: 1px solid rgba(196,60,60,0.4); background: rgba(196,60,60,0.12); font-family: 'Inter', sans-serif; white-space: nowrap; }
.boss-card .bc-head .title { font-size: 12px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink-2); }
.boss-card .bc-portrait {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-1);
  overflow: hidden;
  min-height: 0;
}
.boss-card .bc-portrait::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.018) 0 1px, transparent 1px 12px),
    radial-gradient(ellipse at center top, rgba(200,60,60,0.18) 0%, transparent 50%);
}
.boss-card .bc-portrait .b-glyph { font-size: 240px; filter: drop-shadow(0 8px 30px rgba(0,0,0,0.6)); z-index: 1; animation: boss-loom 5s ease-in-out infinite; }
@keyframes boss-loom { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.boss-card .bc-portrait .b-slot-tag {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ink-3);
  background: rgba(0,0,0,0.7);
  padding: 4px 10px;
  border: 1px dashed var(--line);
}
.boss-card .bc-hp-section {
  padding: 14px 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--line-soft);
}
.boss-hp-bar { height: 28px; }
.boss-hp-bar .bar-num { font-size: 14px; font-weight: 700; }
.boss-hp-bar .threshold {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--accent);
  opacity: 0.6;
}
.boss-hp-bar .threshold::after {
  content: attr(data-pct);
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--accent);
  letter-spacing: 0.04em;
}
.boss-cast-bar { height: 14px; }
.boss-cast-row { display: flex; align-items: center; gap: 12px; font-size: 12px; }
.boss-cast-row .ab { font-family: 'Cinzel', serif; font-weight: 600; color: var(--ink-0); }
.boss-cast-row .bar { flex: 1; }
.boss-cast-row .pct { font-family: 'JetBrains Mono', monospace; color: var(--hp-low); font-weight: 600; }

.boss-side {
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.boss-side-panel {
  background: linear-gradient(180deg, rgba(20,24,33,0.92) 0%, rgba(10,13,20,0.96) 100%);
  border: 1px solid var(--line);
  padding: 14px 16px;
}
.boss-side-panel .h {
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 700;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}
.phase-row { display: flex; gap: 10px; padding: 8px 0; align-items: flex-start; }
.phase-row .num { font-family: 'Cinzel', serif; font-size: 18px; color: var(--ink-3); width: 22px; flex-shrink: 0; }
.phase-row.current .num { color: var(--accent); }
.phase-row .ph-text { flex: 1; min-width: 0; }
.phase-row .ph-text .n { font-family: 'Cinzel', serif; font-size: 13px; font-weight: 600; color: var(--ink-1); }
.phase-row.current .ph-text .n { color: var(--ink-0); }
.phase-row .ph-text .d { font-size: 10.5px; color: var(--ink-2); margin-top: 3px; line-height: 1.4; }

/* boss minion strip */
.boss-minions {
  display: flex;
  gap: 12px;
  padding: 14px 80px 0;
  justify-content: center;
}
.minion-card {
  width: 200px;
  background: linear-gradient(180deg, rgba(20,24,33,0.94), rgba(10,13,20,0.96));
  border: 1px solid var(--line);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.minion-card .m-head { display: flex; align-items: center; gap: 8px; }
.minion-card .m-head .gly { font-size: 24px; }
.minion-card .m-head .nm { font-family: 'Cinzel', serif; font-size: 13px; font-weight: 600; color: var(--ink-0); flex: 1; }

/* party row for boss */
.boss-party-row {
  height: 220px;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 18px;
  padding: 12px 80px 18px;
  position: relative;
}
.party-mini {
  flex: 1;
  max-width: 320px;
  background: linear-gradient(180deg, rgba(20,24,33,0.94) 0%, rgba(10,13,20,0.96) 100%);
  border: 1px solid var(--line);
  display: flex;
  position: relative;
}
.party-mini.active { border-color: var(--accent); box-shadow: 0 0 14px var(--accent-glow); }
.party-mini .pm-portrait {
  width: 90px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-1);
  border-right: 1px solid var(--line-soft);
  flex-shrink: 0;
}
.party-mini .pm-portrait .gly { font-size: 50px; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.6)); }
.party-mini .pm-body { flex: 1; padding: 10px 12px; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.party-mini .pm-body .nm { font-family: 'Cinzel', serif; font-size: 16px; font-weight: 600; color: var(--ink-0); line-height: 1; }
.party-mini .pm-body .meta { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2); }

/* ===== LOOT SCREEN ===== */
.loot-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 80px;
  z-index: 5;
  background:
    radial-gradient(ellipse 100% 70% at 50% 30%, rgba(200,168,96,0.06) 0%, transparent 60%);
}
.loot-banner {
  font-family: 'Cinzel Decorative', serif;
  font-weight: 700;
  font-size: 84px;
  color: var(--ink-0);
  letter-spacing: 0.12em;
  text-align: center;
  position: relative;
  margin-bottom: 8px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--ink-0) 60%, var(--accent-soft) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 30px var(--accent-glow));
}
.loot-sub {
  font-size: 14px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 6px;
}
.loot-zone {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  color: var(--ink-1);
  letter-spacing: 0.08em;
  margin-bottom: 36px;
}
.loot-stats {
  display: flex;
  gap: 48px;
  margin-bottom: 36px;
  padding: 18px 40px;
  background: rgba(0,0,0,0.5);
  border-top: 1px solid var(--accent-soft);
  border-bottom: 1px solid var(--accent-soft);
}
.loot-stat { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.loot-stat .v { font-family: 'Cinzel', serif; font-size: 32px; font-weight: 600; color: var(--ink-0); }
.loot-stat .k { font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink-2); font-weight: 700; }

.loot-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  width: 100%;
  max-width: 1300px;
  margin-bottom: 36px;
}
.loot-card {
  background: linear-gradient(180deg, rgba(20,24,33,0.92) 0%, rgba(10,13,20,0.96) 100%);
  border: 1px solid var(--line);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  position: relative;
  transition: all 220ms;
}
.loot-card[data-rarity="rare"] { border-color: var(--rarity-rare); box-shadow: inset 0 0 0 1px rgba(95,160,232,0.3), 0 0 16px rgba(95,160,232,0.18); }
.loot-card[data-rarity="epic"] { border-color: var(--rarity-epic); box-shadow: inset 0 0 0 1px rgba(184,144,224,0.3), 0 0 18px rgba(184,144,224,0.2); }
.loot-card[data-rarity="legendary"] { border-color: var(--rarity-legendary); box-shadow: inset 0 0 0 1px rgba(255,184,74,0.35), 0 0 22px rgba(255,184,74,0.25); }
.loot-card .l-glyph {
  width: 86px;
  height: 86px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  position: relative;
}
.loot-card[data-rarity="rare"] .l-glyph { border-color: var(--rarity-rare); }
.loot-card[data-rarity="epic"] .l-glyph { border-color: var(--rarity-epic); }
.loot-card[data-rarity="legendary"] .l-glyph { border-color: var(--rarity-legendary); }
.loot-card .l-name { font-family: 'Cinzel', serif; font-size: 15px; font-weight: 600; color: var(--ink-0); line-height: 1.2; }
.loot-card .l-qty { font-family: 'JetBrains Mono', monospace; font-size: 14px; color: var(--accent); font-weight: 600; }
.loot-card .l-sub { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); }
.loot-card .rarity-tag {
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-weight: 700;
}
.loot-card[data-rarity="common"] .rarity-tag { color: var(--ink-2); }
.loot-card[data-rarity="rare"] .rarity-tag { color: var(--rarity-rare); }
.loot-card[data-rarity="epic"] .rarity-tag { color: var(--rarity-epic); }
.loot-card[data-rarity="legendary"] .rarity-tag { color: var(--rarity-legendary); }

.loot-actions {
  display: flex;
  gap: 18px;
}
.party-xp-strip {
  display: flex;
  gap: 22px;
  margin-bottom: 28px;
}
.xp-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--line);
  min-width: 240px;
}
.xp-cell .gly { font-size: 26px; }
.xp-cell .info { flex: 1; }
.xp-cell .info .nm { font-family: 'Cinzel', serif; font-size: 14px; font-weight: 600; color: var(--ink-0); }
.xp-cell .info .v { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--xp); margin-top: 2px; }
.xp-cell .info .bar { margin-top: 4px; height: 4px; }

/* ===== SCREEN TABS ===== */
.screen-tabs {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 2px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  padding: 3px;
  z-index: 100;
}
.screen-tab {
  padding: 8px 18px;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: transparent;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
}
.screen-tab.active { background: var(--accent); color: var(--bg-0); }

/* common helpers */
.row { display: flex; }
.col { display: flex; flex-direction: column; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.center { display:flex; align-items:center; justify-content:center; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.scrollbar::-webkit-scrollbar { width: 6px; }
.scrollbar::-webkit-scrollbar-thumb { background: var(--line); }
