/* ========================================================
   VAULTS OF ETERNITY: IDLE RPG — GOTHIC RPG STYLESHEET
   Diablo & Dark Fantasy Deluxe Visual Overhaul
   ======================================================== */

:root {
  --bg-deep: #06070c;
  --bg-panel: rgba(13, 17, 28, 0.95);
  --bg-card: rgba(18, 23, 38, 0.85);
  --bg-card-hover: rgba(26, 34, 54, 0.96);
  --bg-socket: #080a12;

  --gold-accent: #d4af37;
  --gold-bright: #fbbf24;
  --gold-glow: rgba(212, 175, 55, 0.35);

  --mana-cyan: #38bdf8;
  --blood-crimson: #ef4444;
  --void-purple: #a855f7;
  --radiant-yellow: #eab308;
  --heal-green: #10b981;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-gilded: rgba(212, 175, 55, 0.3);
  --border-glow: rgba(212, 175, 55, 0.5);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --font-heading: 'Cinzel', serif;
  --font-data: 'Rajdhani', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 14px;
}

/* Custom Gothic Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(8, 10, 18, 0.8);
}
::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.3);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold-accent);
}

/* ================= TOP HUD HEADER ================= */
#top-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  padding: 0 20px;
  background: linear-gradient(180deg, rgba(14, 18, 30, 0.98) 0%, rgba(8, 10, 18, 0.96) 100%);
  border-bottom: 1px solid var(--border-gilded);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 16px;
}

.hud-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-hud {
  background: linear-gradient(180deg, rgba(30, 38, 58, 0.8) 0%, rgba(18, 24, 38, 0.9) 100%);
  border: 1px solid var(--border-gilded);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 7px 14px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.22s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: normal;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.btn-hud:hover {
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.2) 0%, rgba(180, 83, 9, 0.2) 100%);
  border-color: var(--gold-bright);
  color: #fff;
  box-shadow: 0 0 14px var(--gold-glow);
  transform: translateY(-1px);
}

.btn-danger {
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #fff;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

.brand-title-wrap {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  background: linear-gradient(135deg, #ffffff 20%, var(--gold-bright) 60%, #b45309 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 16px rgba(212, 175, 55, 0.3);
}

.brand-badge {
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--gold-accent);
}

.hud-center {
  display: flex;
  align-items: center;
  gap: 28px;
}

.hud-stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.hud-stat-label {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.hud-stat-val {
  font-family: var(--font-data);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
}

.val-floor { color: var(--mana-cyan); font-family: var(--font-heading); font-size: 1.05rem; }
.val-gold { color: var(--gold-bright); }
.val-dust { color: var(--mana-cyan); }
.val-souls { color: var(--radiant-yellow); }

.hud-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ================= MAIN LAYOUT ================= */
#main-layout {
  display: grid;
  grid-template-columns: 560px 1fr;
  height: calc(100vh - 68px);
  overflow: hidden;
}

/* LEFT COLUMN: ARENA VIEWPORT */
#arena-column {
  position: relative;
  background: #020306;
  border-right: 1px solid var(--border-gilded);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: inset -5px 0 25px rgba(0, 0, 0, 0.7);
}

#arena-canvas {
  width: 100%;
  flex: 1;
  display: block;
  cursor: crosshair;
}

.arena-overlay-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(8, 11, 20, 0.88);
  border: 1px solid var(--border-gilded);
  border-radius: 20px;
  padding: 5px 16px;
  font-size: 0.74rem;
  color: var(--text-dim);
  pointer-events: none;
  white-space: nowrap;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.arena-overlay-hint span {
  color: var(--gold-bright);
  font-weight: bold;
}

/* RIGHT COLUMN: TABS DECK */
#deck-column {
  display: flex;
  flex-direction: column;
  background: var(--bg-deep);
  overflow: hidden;
}

/* NAVIGATION TABS */
#deck-nav {
  display: flex;
  background: rgba(12, 16, 26, 0.98);
  border-bottom: 1px solid var(--border-gilded);
  overflow-x: auto;
}

.nav-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 16px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-dim);
  font-family: var(--font-heading);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.22s;
  white-space: nowrap;
}

.nav-tab-btn:hover {
  color: var(--text-main);
  background: rgba(212, 175, 55, 0.05);
}

.nav-tab-btn.active {
  color: var(--gold-bright);
  border-bottom-color: var(--gold-bright);
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.12) 0%, rgba(12, 16, 26, 0.98) 100%);
  text-shadow: 0 0 10px var(--gold-glow);
}

/* TAB PANELS */
.tab-content-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.tab-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-gilded);
}

.tab-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 1px;
}

/* ================= TAB 1: HERO ROSTER WORKBENCH ================= */
.party-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}

.hero-card {
  background: var(--bg-card);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-top: 3px solid var(--hero-color, #d4af37);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.hero-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(212, 175, 55, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
}

.hero-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-card-icon-frame {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.7), rgba(20, 26, 42, 0.9));
  border: 2px solid var(--hero-color, var(--gold-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
}

.hero-card-icon {
  font-size: 2rem;
}

.hero-lvl-badge {
  position: absolute;
  bottom: -6px;
  right: -6px;
  background: #000;
  border: 1px solid var(--gold-bright);
  color: var(--gold-bright);
  font-family: var(--font-data);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
}

.hero-card-names {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.hero-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-name {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
}

.hero-role-badge {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  letter-spacing: 0.8px;
}

.hero-title-text {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 2px;
}

/* Hero Direct Training Button */
.btn-train-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.25) 0%, rgba(180, 83, 9, 0.25) 100%);
  border: 1px solid var(--gold-accent);
  color: #fff;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 800;
  transition: all 0.2s;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.btn-train-hero:hover:not(.disabled) {
  background: linear-gradient(180deg, var(--gold-bright), #b45309);
  color: #000;
  box-shadow: 0 0 18px var(--gold-glow);
  transform: translateY(-2px);
}

.btn-train-hero.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.train-cost-sub {
  font-family: var(--font-data);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gold-bright);
}
.btn-train-hero:hover:not(.disabled) .train-cost-sub {
  color: #1a0f00;
}

/* HP & XP Meter Bars */
.hero-bars-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hero-bar-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--text-dim);
  font-weight: 600;
}

.hero-hp-counter {
  font-family: var(--font-data);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--heal-green);
}

.hero-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-bar-fill {
  height: 100%;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.hp-fill { background: linear-gradient(90deg, #ef4444, #10b981); }
.xp-fill { background: linear-gradient(90deg, #38bdf8, #a855f7); }

/* Compact Stats Pills */
.hero-stats-pill-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.stat-pill {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 6px 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.stat-pill-icon { font-size: 0.85rem; }
.stat-pill-info { display: flex; flex-direction: column; }
.stat-pill-lbl { font-size: 0.58rem; color: var(--text-dim); font-weight: 700; }
.stat-pill-val { font-family: var(--font-data); font-size: 0.92rem; font-weight: 800; color: #fff; }

/* Signature Ability Box */
.hero-ability-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 8px 10px;
}

.ability-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.ability-name {
  font-family: var(--font-heading);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--gold-bright);
}

.ability-cd-label {
  font-family: var(--font-data);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--mana-cyan);
}

.ability-track {
  width: 100%;
  height: 4px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}

.ability-fill {
  height: 100%;
  background: var(--mana-cyan);
  transition: width 0.2s;
}

.ability-charged {
  background: linear-gradient(90deg, var(--gold-bright), #ef4444);
  box-shadow: 0 0 8px var(--gold-bright);
}

.ability-desc {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Equipment Sockets */
.equipment-slots-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.equip-slot {
  background: var(--bg-socket);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 8px 4px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.equip-slot:hover {
  border-color: var(--gold-bright);
  background: rgba(212, 175, 55, 0.08);
  transform: translateY(-2px);
}

.equip-slot.equipped {
  border-style: solid;
  border-color: var(--socket-border, rgba(255, 255, 255, 0.2));
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.03) 0%, rgba(8, 10, 18, 0.95) 100%);
  box-shadow: 0 0 10px var(--socket-color, transparent);
}

.socket-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
}

.slot-icon-dim { font-size: 1.3rem; opacity: 0.35; margin-bottom: 2px; }
.slot-icon { font-size: 1.4rem; margin-bottom: 2px; filter: drop-shadow(0 0 6px var(--socket-color, #fff)); }
.slot-label { font-size: 0.58rem; color: var(--text-dim); font-weight: 700; }
.slot-status { font-size: 0.62rem; color: #475569; font-weight: 700; }
.slot-item-name { font-size: 0.65rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 90px; }
.slot-badge { font-family: var(--font-data); font-size: 0.62rem; font-weight: 800; color: var(--gold-bright); }

/* ================= TAB 2: INVENTORY & FORGE ================= */
.inv-filter-pills {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.inv-filter-btn {
  background: rgba(20, 26, 42, 0.8);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.18s;
}

.inv-filter-btn:hover {
  border-color: var(--gold-accent);
  color: #fff;
}

.inv-filter-btn.active {
  background: rgba(212, 175, 55, 0.2);
  border-color: var(--gold-bright);
  color: var(--gold-bright);
  box-shadow: 0 0 10px var(--gold-glow);
}

.inventory-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 18px;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.inv-slot {
  aspect-ratio: 1;
  background: var(--bg-socket);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.inv-slot.empty {
  cursor: default;
  opacity: 0.3;
}
.inv-empty-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.inv-slot.filled {
  border-color: var(--socket-border, rgba(255, 255, 255, 0.2));
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.04) 0%, rgba(8, 10, 18, 0.95) 100%);
}

.inv-slot.filled:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 0 14px var(--socket-color, rgba(255, 255, 255, 0.3));
  border-color: var(--socket-color, #fff);
  z-index: 2;
}

.inv-slot.selected {
  outline: 2px solid var(--gold-bright);
  box-shadow: 0 0 16px var(--gold-glow);
  z-index: 3;
}

.inv-item-icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 0 6px var(--socket-color, #fff));
}

.inv-item-plus {
  position: absolute;
  top: 3px;
  right: 5px;
  font-family: var(--font-data);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--gold-bright);
}

.inv-slot-rarity-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
}

/* Item Inspector & Mystic Anvil Panel */
.inspector-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-gilded);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.forge-anvil-banner {
  text-align: center;
  padding: 30px 10px;
  margin: auto;
}

.anvil-icon-glow {
  font-size: 3.5rem;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 16px rgba(212, 175, 55, 0.5));
  animation: anvilFloat 3s ease-in-out infinite alternate;
}

@keyframes anvilFloat {
  from { transform: translateY(-4px); }
  to { transform: translateY(4px); }
}

.anvil-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--gold-bright);
  margin-bottom: 8px;
}

.inspector-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.inspector-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.inspector-icon-wrap {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: var(--bg-socket);
  border: 2px solid var(--socket-border, var(--gold-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 14px var(--socket-color, rgba(0, 0, 0, 0.5));
  flex-shrink: 0;
}

.inspector-icon { font-size: 2.2rem; }
.inspector-title { font-family: var(--font-heading); font-size: 1.05rem; font-weight: 800; }
.inspector-sub { font-size: 0.68rem; color: var(--text-dim); }

.inspector-stats-box {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stats-box-title {
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.inspector-stat-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-data);
  font-size: 0.92rem;
}

/* Anvil Upgrade Section */
.forge-anvil-action-box {
  background: linear-gradient(180deg, rgba(20, 28, 48, 0.8) 0%, rgba(10, 14, 24, 0.95) 100%);
  border: 1px solid var(--border-gilded);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.anvil-status-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  font-weight: 700;
}

.btn-inspect-action {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-upgrade-gear {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.25) 0%, rgba(2, 132, 199, 0.25) 100%);
  border: 1px solid var(--mana-cyan);
  color: #fff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}
.btn-upgrade-gear:hover:not(.disabled) {
  background: linear-gradient(180deg, var(--mana-cyan), #0284c7);
  color: #000;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.6);
  transform: translateY(-2px);
}
.btn-upgrade-gear.disabled { opacity: 0.45; cursor: not-allowed; }

.inspector-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-equip-gear {
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.25) 0%, rgba(180, 83, 9, 0.25) 100%);
  border: 1px solid var(--gold-accent);
  color: #fff;
}
.btn-equip-gear:hover {
  background: linear-gradient(180deg, var(--gold-bright), #b45309);
  color: #000;
  box-shadow: 0 0 18px var(--gold-glow);
  transform: translateY(-2px);
}

.btn-salvage-gear {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--blood-crimson);
  color: var(--blood-crimson);
}
.btn-salvage-gear:hover {
  background: var(--blood-crimson);
  color: #fff;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.4);
  transform: translateY(-2px);
}

/* ================= TAB 3: REBIRTH (HALL OF ANCESTORS) ================= */
.rebirth-hero-banner {
  background: radial-gradient(circle at 50% 50%, rgba(212, 175, 55, 0.22) 0%, rgba(10, 14, 26, 0.98) 75%);
  border: 1px solid var(--gold-accent);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  margin-bottom: 24px;
  box-shadow: 0 0 35px rgba(212, 175, 55, 0.2);
}

.rebirth-title {
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: #fff;
  margin-bottom: 8px;
  text-shadow: 0 0 16px var(--gold-glow);
}

.rebirth-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto 18px auto;
  line-height: 1.55;
}

.rebirth-stats-row {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 18px;
}

.rebirth-stat-item {
  display: flex;
  flex-direction: column;
}

.rebirth-stat-lbl { font-size: 0.68rem; color: var(--text-dim); font-weight: 700; letter-spacing: 0.8px; }
.rebirth-stat-val { font-family: var(--font-data); font-size: 1.45rem; font-weight: 800; color: var(--radiant-yellow); }

.rebirth-req-hint {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  margin-bottom: 18px;
}

.btn-initiate-rebirth {
  background: linear-gradient(135deg, var(--gold-bright), #b45309);
  border: none;
  color: #1a0f00;
  font-family: var(--font-heading);
  font-size: 0.96rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  padding: 14px 32px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 0 25px rgba(212, 175, 55, 0.6);
  transition: all 0.25s;
}

.btn-initiate-rebirth:hover:not(.disabled) {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 40px rgba(212, 175, 55, 0.9);
}

.btn-initiate-rebirth.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}

.talents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.talent-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  gap: 12px;
  transition: all 0.2s;
}

.talent-card.locked { opacity: 0.55; }
.talent-card.affordable { border-color: rgba(212, 175, 55, 0.4); }
.talent-card.maxed { border-color: var(--radiant-yellow); box-shadow: 0 0 14px rgba(234, 179, 8, 0.2); }

.talent-icon-plate {
  width: 46px;
  height: 46px;
  background: var(--bg-socket);
  border: 1px solid var(--border-gilded);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.talent-icon { font-size: 1.8rem; }
.talent-info { flex: 1; display: flex; flex-direction: column; }
.talent-title-wrap { display: flex; justify-content: space-between; margin-bottom: 4px; }
.talent-name { font-family: var(--font-heading); font-size: 0.92rem; font-weight: 700; color: #fff; }
.talent-rank { font-family: var(--font-data); font-size: 0.78rem; color: var(--radiant-yellow); font-weight: 800; }
.talent-desc { font-size: 0.76rem; color: var(--text-muted); margin-bottom: 10px; line-height: 1.35; }
.talent-bottom { margin-top: auto; display: flex; justify-content: space-between; align-items: center; }
.talent-cost { font-family: var(--font-data); font-size: 0.9rem; font-weight: 700; color: var(--radiant-yellow); }

.btn-buy-talent {
  background: rgba(234, 179, 8, 0.2);
  border: 1px solid var(--radiant-yellow);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.18s;
}

.btn-buy-talent:hover:not(.disabled) {
  background: var(--radiant-yellow);
  color: #000;
  box-shadow: 0 0 12px rgba(234, 179, 8, 0.6);
}

.btn-buy-talent.disabled { opacity: 0.4; cursor: not-allowed; }

/* ================= TAB 4: STATS & SETTINGS ================= */
.stats-box, .settings-box {
  background: var(--bg-card);
  border: 1px solid var(--border-gilded);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.88rem;
}
.stat-row:last-child { border-bottom: none; }
.stat-row b { font-family: var(--font-data); color: var(--gold-bright); font-size: 1.05rem; }

.setting-toggle-row {
  margin-bottom: 12px;
}

.setting-toggle-row label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.setting-toggle-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--gold-bright);
}

.save-controls-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
  pointer-events: none;
}

.toast {
  background: rgba(10, 14, 24, 0.95);
  border: 1px solid var(--border-gilded);
  color: #fff;
  padding: 10px 18px;
  border-radius: 6px;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
  animation: toastEnter 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-success { border-color: var(--gold-bright); color: var(--gold-bright); }
.toast-error { border-color: var(--blood-crimson); color: var(--blood-crimson); }
.toast-info { border-color: var(--mana-cyan); color: var(--mana-cyan); }

@keyframes toastEnter {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast-exit {
  opacity: 0;
  transform: translateY(-8px);
  transition: all 0.25s ease;
}

/* Responsive adjustments */
@media (max-width: 1100px) {
  #main-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  #arena-column {
    height: 380px;
    border-right: none;
    border-bottom: 1px solid var(--border-gilded);
  }
}

/* ========================================================
   GOTHIC FLOATING TOOLTIP (DESCRIPTOR BOX)
   ======================================================== */
.rpg-tooltip {
  position: fixed;
  top: 0;
  left: 0;
  width: 320px;
  background: linear-gradient(150deg, rgba(16, 22, 38, 0.98) 0%, rgba(8, 10, 18, 0.98) 100%);
  border: 1px solid var(--border-gilded);
  border-radius: 8px;
  padding: 14px 16px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.85), 0 0 25px rgba(212, 175, 55, 0.15);
  backdrop-filter: blur(14px);
  z-index: 10000;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.15s ease, transform 0.05s ease-out;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rpg-tooltip.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate3d(-9999px, -9999px, 0) !important;
}

.tt-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tt-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: var(--bg-socket);
  border: 2px solid var(--gold-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
}

.tt-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tt-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--gold-bright);
  letter-spacing: 0.5px;
  line-height: 1.25;
}

.tt-category {
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--text-dim);
  letter-spacing: 1.2px;
}

.tt-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-gilded), transparent);
}

.tt-body {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.tt-stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 8px 10px;
}

.tt-stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-data);
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
}

.tt-stat-bullet {
  color: var(--gold-bright);
  font-size: 0.75rem;
}

.tt-cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 5px;
  padding: 6px 10px;
  font-size: 0.74rem;
}

.tt-cost-lbl {
  color: var(--text-dim);
  font-weight: 700;
  font-size: 0.65rem;
  letter-spacing: 0.8px;
}

.tt-cost-val {
  font-family: var(--font-data);
  font-size: 0.95rem;
  color: var(--gold-bright);
}

.tt-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--gold-accent);
  font-style: italic;
  padding-top: 4px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.tt-hint-icon {
  font-style: normal;
}

