@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@700;900&family=Fredoka:wght@500;600;700&display=swap');

:root {
  --gold: #fbbf24;
  --gold-dark: #b45309;
  --navy: #0f172a;
  --panel: #141829;
  --panel-border: #334155;
  --red: #ef4444;
  --green: #22c55e;
  --cyan: #38bdf8;
  --purple: #a855f7;
  --fire: #ff6b2b;
}

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

body {
  background: radial-gradient(circle at 25% 20%, #1e1b4b 0%, #090d1a 70%);
  color: #f8fafc;
  font-family: 'Fredoka', system-ui, sans-serif;
  height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.app-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  height: 100vh;
  width: 100vw;
  padding: 12px;
}

/* ============ 9:16 VERTICAL TIKTOK LIVE STAGE (EXACT 450x800 WYSIWYG MATCH WITH /overlay) ============ */
.stage-wrapper {
  position: relative;
  width: 450px;
  height: 800px;
  flex-shrink: 0;
  border-radius: 22px;
  overflow: hidden;
  border: 3px solid rgba(251, 191, 36, 0.55);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.85), 0 0 28px rgba(251, 191, 36, 0.16);
  background: #0d1021;
  display: flex;
  flex-direction: column;
}

body.obs-mode .control-panel {
  display: none !important;
}
body.obs-mode .stage-wrapper {
  border-radius: 0;
  border: none;
}
body.obs-mode .app-layout {
  padding: 0;
}

/* Pure /overlay mode (TikTok LIVE Studio / OBS): fixed 450x800 design canvas scaled proportionally with TRANSPARENT sides! */
html:has(body.obs-pure),
body.obs-pure {
  background: transparent !important;
  overflow: hidden;
}
body.obs-pure .app-layout {
  width: 100vw;
  height: 100vh;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
body.obs-pure .stage-wrapper {
  width: 450px !important;
  height: 800px !important;
  max-width: none !important;
  flex-shrink: 0;
  border-radius: 0;
  border: none;
  box-shadow: none;
  transform-origin: center center;
}

#battleCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: auto;
}

/* ============ TOP RPG HUD ============ */
.hud-top {
  position: relative;
  z-index: 10;
  padding: 6px 8px 2px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
}

.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.brand-block {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.brand-logo {
  font-family: 'Cinzel', serif;
  font-weight: 900;
  font-size: 16px;
  line-height: 1;
  letter-spacing: 0.6px;
  background: linear-gradient(180deg, #fff7cc 0%, #fbbf24 55%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.95));
}

.live-pills {
  display: flex;
  align-items: center;
  gap: 5px;
}

.pill-live {
  background: linear-gradient(90deg, #dc2626, #ef4444);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.55);
}

.pill-live.offline {
  background: linear-gradient(90deg, #475569, #334155);
  box-shadow: none;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  animation: pulseDot 1.2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.75); }
}

.pill-viewers {
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.35);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  color: #e2e8f0;
}

.top-actions {
  display: flex;
  gap: 5px;
  pointer-events: auto;
}

.hud-icon-btn {
  background: rgba(15, 23, 42, 0.82);
  border: 1.5px solid rgba(251, 191, 36, 0.5);
  color: #fef08a;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.12s, background 0.15s;
}

.hud-icon-btn:hover {
  background: rgba(30, 41, 59, 0.95);
  transform: scale(1.05);
}

/* Boss Plate */
.boss-plate {
  background: linear-gradient(180deg, rgba(20, 22, 42, 0.92), rgba(12, 14, 28, 0.94));
  border: 2px solid #fbbf24;
  border-radius: 12px;
  padding: 6px 10px 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255,255,255,0.18);
}

.boss-plate-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

.boss-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.boss-skull {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle, #334155, #0f172a);
  border: 1.5px solid #fbbf24;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.boss-subtitle {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #94a3b8;
  line-height: 1;
}

.boss-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 3px rgba(0,0,0,0.9);
  line-height: 1.1;
}

.boss-level-badge {
  background: linear-gradient(180deg, #f59e0b, #b45309);
  border: 1px solid #fde68a;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 7px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.boss-hp-bar {
  position: relative;
  height: 18px;
  background: #1e1b2e;
  border: 1.5px solid #475569;
  border-radius: 9px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.8);
}

.boss-hp-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #991b1b 0%, #ef4444 55%, #fb923c 100%);
  transition: width 0.16s ease-out;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.7);
}

.boss-hp-fill.enraged {
  background: linear-gradient(90deg, #7f1d1d 0%, #dc2626 50%, #facc15 100%);
  animation: hpPulse 0.6s infinite alternate;
}

@keyframes hpPulse {
  from { filter: brightness(1); }
  to { filter: brightness(1.35); }
}

.boss-hp-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px #000, 0 0 5px #000;
}

.boss-statuses {
  display: flex;
  gap: 5px;
  margin-top: 5px;
  min-height: 0;
  flex-wrap: wrap;
}

.status-chip {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 5px;
  letter-spacing: 0.3px;
}
.status-chip.burn { background: rgba(234, 88, 12, 0.9); color: #fff; }
.status-chip.debuff { background: rgba(13, 148, 136, 0.9); color: #fff; }
.status-chip.freeze { background: rgba(14, 165, 233, 0.95); color: #fff; }
.status-chip.enrage { background: rgba(220, 38, 38, 0.95); color: #fef08a; animation: hpPulse 0.5s infinite alternate; }
.status-chip.overdrive { background: rgba(147, 51, 234, 0.95); color: #fde047; }

/* ============ INDEPENDENT PROMO BADGES (FOLLOW ME & LIKES HEAL) ============ */
.promo-badge {
  position: absolute;
  z-index: 16;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 8px;
  pointer-events: none;
  user-select: none;
}

.follow-badge {
  top: 102px;
  left: 8px;
}

.likes-heal-badge {
  top: 158px;
  left: 8px;
}

.pb-crown {
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  line-height: 0;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 6px rgba(251, 191, 36, 0.75));
}

.pb-main {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(180deg, #4c1d95 0%, #1e0b38 65%, #3b0764 100%);
  border: 2px solid #fbbf24;
  border-radius: 12px;
  padding: 4px 10px 4px 7px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.75), 0 0 10px rgba(251, 191, 36, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.pb-follow-ico {
  background: linear-gradient(180deg, #7e22ce, #3b0764);
  border: 1.5px solid #e879f9;
  border-radius: 6px;
  padding: 1px 4px;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 0 8px rgba(232, 121, 249, 0.75);
}

.pb-heart {
  font-size: 13px;
  line-height: 1;
  filter: drop-shadow(0 0 5px rgba(244, 63, 94, 0.85));
}

.pb-title {
  font-family: 'Fredoka', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 800;
  font-style: italic;
  letter-spacing: 0.3px;
  line-height: 1;
  white-space: nowrap;
}

.pb-white {
  color: #ffffff;
  text-shadow: -1px -1px 0 #1e0a3c, 1px -1px 0 #1e0a3c, -1px 1px 0 #1e0a3c, 1px 1px 0 #1e0a3c, 0 2px 3px #000;
}

.pb-gold {
  background: linear-gradient(180deg, #fef9c3 0%, #facc15 55%, #ea580c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1.5px 1px #1e0a3c) drop-shadow(0 0 4px rgba(250, 204, 21, 0.5));
}

.pb-sub {
  position: relative;
  z-index: 3;
  margin-top: -3px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border-radius: 999px;
  padding: 1.5px 8px;
  font-size: 8.5px;
  font-weight: 800;
  font-style: italic;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.75);
}

.pb-follow-sub {
  background: linear-gradient(90deg, #2e1065, #4c1d95, #2e1065);
  border: 1.5px solid #fbbf24;
}

.pb-heal-sub {
  background: linear-gradient(90deg, #052e16, #14532d, #052e16);
  border: 1.5px solid #4ade80;
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.5), 0 2px 6px rgba(0, 0, 0, 0.75);
}

.pb-gold-txt { color: #fde047; text-shadow: 0 1px 2px #000; }
.pb-white-txt { color: #ffffff; text-shadow: 0 1px 2px #000; }
.pb-green-txt { color: #86efac; text-shadow: 0 1px 2px #000; }
.pb-star { color: #fde047; font-size: 8px; }
.pb-chev { color: #4ade80; font-size: 9px; font-style: normal; }

.pb-med-heart {
  background: #ef4444;
  border: 1px solid #86efac;
  border-radius: 50%;
  width: 13px;
  height: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-style: normal;
  color: #fff;
}

.pb-qcard {
  background: #1e0b38;
  border: 1.3px solid #fde047;
  border-radius: 4px;
  padding: 0 4px;
  font-size: 9px;
  font-style: normal;
  color: #fff;
  box-shadow: 0 0 5px rgba(251, 191, 36, 0.65);
}

/* ============ VERTICAL SPECIAL POWERS STACK (RIGHT SIDE BESIDE BOSS) ============ */
.special-powers-stack {
  position: absolute;
  top: 102px;
  right: 7px;
  z-index: 16;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 68px;
}

.sp-card {
  width: 100%;
  border-radius: 13px;
  padding: 2px 3px 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5px;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.14s, filter 0.15s;
}

.sp-card:hover {
  transform: scale(1.05);
  filter: brightness(1.12);
}

.sp-card.sp-kill {
  background: linear-gradient(180deg, rgba(60, 14, 6, 0.94) 0%, rgba(120, 26, 8, 0.92) 55%, rgba(46, 10, 4, 0.96) 100%);
  border: 2px solid #fbbf24;
  box-shadow: 0 0 12px rgba(251, 146, 60, 0.72), inset 0 0 10px rgba(249, 115, 22, 0.35);
}

.sp-card.sp-shield {
  background: linear-gradient(180deg, rgba(36, 10, 62, 0.94) 0%, rgba(68, 18, 110, 0.92) 55%, rgba(24, 8, 46, 0.96) 100%);
  border: 2px solid #d946ef;
  box-shadow: 0 0 12px rgba(217, 70, 239, 0.72), inset 0 0 10px rgba(168, 85, 247, 0.35);
}

.sp-card.sp-shield.active {
  border-color: #38bdf8;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.95), 0 0 10px rgba(217, 70, 239, 0.85);
  animation: hpPulse 0.6s infinite alternate;
}

.sp-svg-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -2px;
  filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.75)) drop-shadow(0 2px 2px #000);
}

.sp-card.sp-shield .sp-svg-icon {
  filter: drop-shadow(0 0 7px rgba(217, 70, 239, 0.9)) drop-shadow(0 2px 2px #000);
}

.sp-label {
  font-size: 7.5px;
  font-weight: 800;
  color: #ffffff;
  text-align: center;
  line-height: 1.02;
  letter-spacing: 0.15px;
  text-shadow: -1px -1px 0 #090d1a, 1px -1px 0 #090d1a, -1px 1px 0 #090d1a, 1px 1px 0 #090d1a, 0 2px 3px #000;
}

.sp-gift-pill {
  width: 94%;
  background: rgba(6, 8, 16, 0.94);
  border: 1.3px solid rgba(251, 191, 36, 0.78);
  border-radius: 10px;
  padding: 1px 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 31px;
  margin-top: 1px;
}

.sp-card.sp-shield .sp-gift-pill {
  border-color: rgba(232, 121, 249, 0.85);
}

.sp-gift-pill img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px #000);
}

/* ============ HERO DEFEATED OVERLAY (LOWER ARENA) ============ */
.defeated-toast-area {
  position: absolute;
  bottom: 356px;
  left: 10px;
  right: 10px;
  z-index: 22;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  pointer-events: none;
}

.defeated-toast {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.92), rgba(69, 10, 10, 0.92), rgba(15, 23, 42, 0.92));
  border: 2px solid #f87171;
  border-radius: 999px;
  padding: 5px 12px 5px 6px;
  box-shadow: 0 4px 18px rgba(239, 68, 68, 0.45), 0 2px 8px rgba(0, 0, 0, 0.75);
  animation: defeatedPop 0.25s ease-out;
  max-width: 92%;
}

@keyframes defeatedPop {
  from { opacity: 0; transform: translateY(10px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.defeated-toast-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #fca5a5;
  object-fit: cover;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
}

.defeated-toast-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.defeated-toast-name {
  font-size: 12px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 1px 3px #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.defeated-toast-sub {
  font-size: 10px;
  font-weight: 700;
  color: #fca5a5;
  text-shadow: 0 1px 2px #000;
}

.defeated-toast-angel {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.7));
}

/* Hero Summoned Arrival Toast (matching style with rarity accent) */
.summon-toast {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.94), rgba(30, 27, 75, 0.94), rgba(15, 23, 42, 0.94));
  border: 2px solid #fbbf24;
  border-radius: 999px;
  padding: 4px 10px 4px 6px;
  box-shadow: 0 4px 18px rgba(251, 191, 36, 0.45), 0 2px 8px rgba(0, 0, 0, 0.75);
  animation: defeatedPop 0.25s ease-out;
  max-width: 94%;
}

.summon-toast.tier-1 { border-color: #38bdf8; box-shadow: 0 4px 16px rgba(56, 189, 248, 0.45); }
.summon-toast.tier-2 { border-color: #4ade80; box-shadow: 0 4px 16px rgba(74, 222, 128, 0.45); }
.summon-toast.tier-3 { border-color: #c084fc; box-shadow: 0 4px 16px rgba(192, 132, 252, 0.5); }
.summon-toast.tier-4 { border-color: #fbbf24; box-shadow: 0 4px 18px rgba(251, 191, 36, 0.65); }

.summon-toast-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #fde047;
  object-fit: cover;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
}

.summon-toast-sub {
  font-size: 10px;
  font-weight: 700;
  color: #fde047;
  text-shadow: 0 1px 2px #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summon-toast-hero {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.75));
}

/* Group Shield Activated Toast (Cyan-Violet Neon!) */
.shield-toast {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(90deg, rgba(8, 47, 73, 0.94), rgba(59, 7, 100, 0.94), rgba(8, 47, 73, 0.94));
  border: 2px solid #38bdf8;
  border-radius: 999px;
  padding: 5px 12px 5px 6px;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.65), 0 0 10px rgba(192, 132, 252, 0.5), 0 2px 8px rgba(0, 0, 0, 0.75);
  animation: defeatedPop 0.25s ease-out;
  max-width: 94%;
}

.shield-toast-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #7dd3fc;
  object-fit: cover;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
}

.shield-toast-sub {
  font-size: 10px;
  font-weight: 800;
  color: #7dd3fc;
  text-shadow: 0 1px 2px #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shield-toast-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.95));
}

/* ============ CUMULATIVE POWER ORBS RAIL (ABOVE PROGRESO IMPERIO) ============ */
.power-rail-wrap {
  position: absolute;
  bottom: 294px;
  left: 8px;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px 0;
}

.power-gold-rail {
  position: absolute;
  left: 4px;
  right: 4px;
  top: 23px;
  height: 10px;
  background: linear-gradient(180deg, #fef08a 0%, #f59e0b 50%, #92400e 100%);
  border: 1.5px solid #451a03;
  border-radius: 5px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.65);
  z-index: 0;
}

.power-orbs {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.power-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 52px;
}

.power-caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(9, 13, 26, 0.78);
  border: 1px solid rgba(251, 191, 36, 0.45);
  border-radius: 6px;
  padding: 1.5px 4px 2px;
  line-height: 1.08;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.65);
}

.power-cap-name {
  font-size: 7.5px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 1px 2px #000;
}

.power-cap-goal {
  font-size: 7.5px;
  font-weight: 700;
  color: #fde047;
  text-shadow: 0 1px 2px #000;
  white-space: nowrap;
}

.power-orb-btn {
  position: relative;
  width: 36px;
  height: 36px;
  transform: rotate(45deg);
  border-radius: 7px;
  border: 2.5px solid #fbbf24;
  outline: 1.5px solid #1c1008;
  background: #141224;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.14s, box-shadow 0.15s;
}

.power-orb-btn.fire {
  box-shadow: 0 0 11px rgba(255, 107, 43, 0.75), inset 0 0 0 1.5px #29150b;
}
.power-orb-btn.ice {
  width: 36px;
  height: 36px;
  box-shadow: 0 0 13px rgba(56, 189, 248, 0.85), inset 0 0 0 1.5px #0b1e2d;
}
.power-orb-btn.arcane {
  box-shadow: 0 0 11px rgba(192, 132, 252, 0.8), inset 0 0 0 1.5px #1f0d33;
}

.power-orb-btn:hover {
  transform: rotate(45deg) scale(1.1);
}

.power-orb-btn.active {
  border-color: #fef08a;
  box-shadow: 0 0 18px #fde047, 0 0 10px #fff;
  animation: hpPulse 0.45s infinite alternate;
}

.power-fill {
  position: absolute;
  left: -30%;
  right: -30%;
  bottom: -30%;
  height: 0%;
  transition: height 0.2s ease-out;
  opacity: 0.92;
}

.power-orb-btn.fire .power-fill {
  background: linear-gradient(0deg, #b91c1c 0%, #f97316 55%, #fde047 100%);
}
.power-orb-btn.ice .power-fill {
  background: linear-gradient(0deg, #0284c7 0%, #38bdf8 55%, #e0f2fe 100%);
}
.power-orb-btn.arcane .power-fill {
  background: linear-gradient(0deg, #6b21a8 0%, #c084fc 55%, #f5d0fe 100%);
}

.power-inner {
  position: absolute;
  inset: 0;
  transform: rotate(-45deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2;
  gap: 0;
}

.power-icon {
  font-size: 13px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px #000);
}

.power-orb-btn.ice .power-icon {
  font-size: 13px;
}

.power-pct {
  font-size: 9px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.05;
  text-shadow: -1px -1px 0 #090d1a, 1px -1px 0 #090d1a, -1px 1px 0 #090d1a, 1px 1px 0 #090d1a, 0 2px 3px #000;
}

/* ============ ALWAYS-VISIBLE SEMI-TRANSPARENT TOP DAMAGE (BELOW BOSS) ============ */
.live-top-damage {
  position: absolute;
  bottom: 294px;
  right: 8px;
  z-index: 14;
  width: 174px;
  background: rgba(10, 14, 28, 0.72);
  border: 1.5px solid rgba(251, 191, 36, 0.48);
  border-radius: 10px;
  padding: 4px 7px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.live-top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 700;
  color: #fde047;
  letter-spacing: 0.4px;
  padding-bottom: 4px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(251, 191, 36, 0.25);
  text-shadow: 0 1px 3px #000;
}

.live-top-metrics {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  line-height: 1.1;
}

.live-top-heroes {
  color: #93c5fd;
  font-size: 9.5px;
  font-weight: 700;
}

.live-top-total {
  color: #e2e8f0;
  font-size: 9.5px;
}

.live-top-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.live-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  font-size: 10.5px;
  line-height: 1.15;
  text-shadow: 0 1px 2px #000;
}

.live-top-rank {
  width: 18px;
  flex-shrink: 0;
  font-weight: 700;
  color: #fbbf24;
}

.live-top-name {
  flex: 1;
  color: #f8fafc;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-top-dmg {
  font-weight: 700;
  color: #4ade80;
  flex-shrink: 0;
}

.live-top-empty {
  font-size: 10px;
  color: #cbd5e1;
  text-align: center;
  padding: 4px 0;
  opacity: 0.85;
}

/* ============ FLOATING EVENT BANNERS ============ */
.event-banner-area {
  position: relative;
  z-index: 26;
  padding: 4px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  min-height: 28px;
}

.toast-banner {
  background: linear-gradient(90deg, rgba(15,23,42,0.15), rgba(15,23,42,0.92) 20%, rgba(15,23,42,0.92) 80%, rgba(15,23,42,0.15));
  border-top: 1px solid rgba(251, 191, 36, 0.6);
  border-bottom: 1px solid rgba(251, 191, 36, 0.6);
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #fef08a;
  text-shadow: 0 2px 4px #000;
  text-align: center;
  animation: bannerPop 0.25s ease-out;
}

@keyframes bannerPop {
  from { opacity: 0; transform: translateY(-8px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.combo-badge {
  position: absolute;
  right: 12px;
  top: 138px;
  z-index: 12;
  background: linear-gradient(135deg, #f97316, #dc2626);
  border: 2px solid #fde047;
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 3px rgba(0,0,0,0.85);
  box-shadow: 0 0 18px rgba(249, 115, 22, 0.7);
  display: none;
  pointer-events: none;
}

.combo-badge.visible {
  display: block;
  animation: bannerPop 0.2s ease-out;
}

/* ============ EPIC VICTORY OVERLAY (¡JEFE DERROTADO!) ============ */
.victory-overlay {
  position: absolute;
  inset: 0;
  z-index: 28;
  background: radial-gradient(circle at 50% 42%, rgba(124, 58, 237, 0.36) 0%, rgba(9, 11, 26, 0.92) 72%);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  pointer-events: none;
}

.victory-overlay.visible {
  display: flex;
  animation: victoryZoomIn 0.32s cubic-bezier(0.22, 1.28, 0.36, 1);
}

@keyframes victoryZoomIn {
  from { opacity: 0; transform: scale(0.84); }
  to { opacity: 1; transform: scale(1); }
}

.victory-frame {
  position: relative;
  width: 92%;
  max-width: 340px;
  background: linear-gradient(180deg, #221048 0%, #120c2c 55%, #1c0f3e 100%);
  border: 3px solid #fbbf24;
  border-radius: 18px;
  padding: 26px 12px 16px;
  box-shadow:
    0 0 36px rgba(168, 85, 247, 0.65),
    0 0 18px rgba(251, 191, 36, 0.5),
    inset 0 0 24px rgba(139, 92, 246, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.victory-crown-top {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 30px;
  line-height: 1;
  filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.95)) drop-shadow(0 3px 3px #000);
}

.victory-ribbon {
  width: 104%;
  margin-top: -6px;
  background: linear-gradient(180deg, #9333ea 0%, #581c87 65%, #3b0764 100%);
  border: 2.5px solid #fbbf24;
  border-radius: 12px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.ribbon-laurel {
  font-size: 20px;
  filter: sepia(1) saturate(4) hue-rotate(5deg) brightness(1.15) drop-shadow(0 2px 3px #000);
}
.ribbon-laurel.flip {
  transform: scaleX(-1);
}

.victory-ribbon-text {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  letter-spacing: 0.6px;
  background: linear-gradient(180deg, #fffbeb 0%, #fde047 50%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 2px #000) drop-shadow(0 0 6px rgba(251, 191, 36, 0.45));
}

.victory-trophy {
  -webkit-text-fill-color: initial;
  font-size: 16px;
}

/* Defeated Boss Portrait Banner */
.victory-boss-banner {
  width: 100%;
  background: linear-gradient(90deg, rgba(88, 28, 135, 0.85) 0%, rgba(30, 27, 75, 0.92) 55%, rgba(67, 56, 202, 0.75) 100%);
  border: 2px solid #818cf8;
  border-radius: 12px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 0 16px rgba(129, 140, 248, 0.4), inset 0 0 12px rgba(192, 132, 252, 0.25);
}

.victory-boss-img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(192, 132, 252, 0.8)) drop-shadow(0 3px 4px #000);
}

.victory-boss-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 3px;
}

.victory-boss-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.15;
  text-shadow: 0 2px 4px #000;
}

.victory-boss-lvl {
  font-size: 10.5px;
  font-weight: 600;
  color: #cbd5e1;
}

.victory-defeated-tag {
  background: linear-gradient(180deg, #fde047 0%, #f59e0b 65%, #b45309 100%);
  border: 1.5px solid #fef9c3;
  border-radius: 6px;
  padding: 1px 12px;
  font-size: 10.5px;
  font-weight: 800;
  color: #29150b;
  letter-spacing: 0.7px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.6);
}

/* 3 Glowing Merit Rows */
.victory-rows {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.victory-row {
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 12px;
  padding: 6px 10px;
  text-align: left;
}

.victory-row.row-mvp {
  background: linear-gradient(90deg, rgba(107, 33, 168, 0.85), rgba(59, 7, 100, 0.88));
  border: 1.5px solid #c084fc;
  box-shadow: 0 0 12px rgba(192, 132, 252, 0.35);
}

.victory-row.row-lasthit {
  background: linear-gradient(90deg, rgba(30, 64, 175, 0.85), rgba(15, 23, 42, 0.92));
  border: 1.5px solid #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

.victory-row.row-exp {
  background: linear-gradient(90deg, rgba(180, 83, 9, 0.85), rgba(69, 26, 3, 0.92));
  border: 1.5px solid #fbbf24;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.35);
}

.v-hex {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 9px;
  border: 2px solid #fde047;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}

.v-hex.hex-gold { background: linear-gradient(180deg, #9333ea, #4c1d95); }
.v-hex.hex-blue { background: linear-gradient(180deg, #2563eb, #1e3a8a); }
.v-hex.hex-exp  { background: linear-gradient(180deg, #a855f7, #581c87); font-size: 10px; letter-spacing: 0.4px; }

.v-row-text {
  flex: 1;
  min-width: 0;
  line-height: 1.2;
}

.v-row-main {
  font-size: 12px;
  color: #ffffff;
  text-shadow: 0 1px 3px #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v-lbl {
  color: #fde047;
  font-weight: 700;
}

.v-row-sub {
  font-size: 10px;
  color: #e2e8f0;
  opacity: 0.9;
}

.victory-footer-pill {
  margin-top: 2px;
  background: linear-gradient(180deg, #4ade80 0%, #16a34a 60%, #15803d 100%);
  border: 2px solid #fde047;
  border-radius: 999px;
  padding: 5px 22px;
  font-size: 12px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.8px;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.8);
  box-shadow: 0 0 16px rgba(74, 222, 128, 0.65), 0 3px 8px rgba(0, 0, 0, 0.6);
}

/* ============ BOTTOM RPG HUD (¡ELIGE TU HÉROE! 2x4 SHOWCASE) ============ */
.hud-bottom {
  position: relative;
  z-index: 10;
  margin-top: auto;
  width: 100%;
  padding: 5px 6px 6px;
  background: linear-gradient(180deg, rgba(11, 13, 30, 0.85) 0%, rgba(11, 13, 30, 0.96) 14%, rgba(9, 11, 24, 0.99) 100%);
  border-top: 2px solid rgba(251, 191, 36, 0.45);
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow: hidden;
}

.showcase-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  width: 100%;
  min-width: 0;
}

.empire-mini {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.empire-crest {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #6d28d9, #312e81);
  border: 1.5px solid #fbbf24;
  border-radius: 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.7);
}

.empire-crest span:first-child {
  font-size: 6.5px;
  color: #fde68a;
  line-height: 1;
}
.empire-crest span:last-child {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.empire-exp-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5px;
}

.empire-exp-label {
  font-size: 8px;
  font-weight: 700;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.empire-exp-track {
  position: relative;
  height: 11px;
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 6px;
  overflow: hidden;
}

.empire-exp-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #16a34a, #4ade80, #bef264);
  transition: width 0.25s ease-out;
}

.empire-exp-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px #000;
}

.choose-hero-banner {
  position: relative;
  text-align: center;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 6px;
}

.choose-crown-svg {
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 6px rgba(251, 191, 36, 0.7));
  line-height: 0;
}

.choose-plate-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.choose-wing {
  width: 11px;
  height: 15px;
  background: linear-gradient(180deg, #fef08a 0%, #f59e0b 45%, #a855f7 100%);
  border: 1.5px solid #451a03;
  box-shadow: 0 0 6px rgba(251, 191, 36, 0.55);
  z-index: 1;
}

.choose-wing.left {
  margin-right: -4px;
  clip-path: polygon(0 10%, 100% 25%, 100% 85%, 22% 100%, 12% 55%);
}

.choose-wing.right {
  margin-left: -4px;
  clip-path: polygon(100% 10%, 0 25%, 0 85%, 78% 100%, 88% 55%);
}

.choose-title {
  position: relative;
  z-index: 2;
  background: linear-gradient(180deg, #581c87 0%, #2e1065 55%, #4c1d95 100%);
  border: 2px solid #fbbf24;
  border-radius: 7px;
  padding: 3px 9px 4px;
  font-family: 'Fredoka', system-ui, sans-serif;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  line-height: 1;
  box-shadow:
    0 2px 10px rgba(168, 85, 247, 0.55),
    0 0 8px rgba(251, 191, 36, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  white-space: nowrap;
}

.choose-title .ct-white {
  color: #f8fafc;
  text-shadow: -1px -1px 0 #1e0a3c, 1px -1px 0 #1e0a3c, -1px 1px 0 #1e0a3c, 1px 1px 0 #1e0a3c, 0 2px 2px #000;
}

.choose-title .ct-gold {
  background: linear-gradient(180deg, #fef9c3 0%, #facc15 55%, #ea580c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1.5px 1px #1e0a3c) drop-shadow(0 0 3px rgba(250, 204, 21, 0.4));
}

.choose-gem {
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 7px;
  height: 7px;
  transform: translateX(-50%) rotate(45deg);
  background: linear-gradient(135deg, #f0abfc, #9333ea);
  border: 1.5px solid #fde047;
  z-index: 4;
  box-shadow: 0 0 6px rgba(217, 70, 239, 0.85);
}

.choose-sub-ribbon {
  margin-top: 2px;
  background: linear-gradient(90deg, rgba(30, 10, 56, 0.92), rgba(59, 7, 100, 0.95), rgba(30, 10, 56, 0.92));
  border: 1px solid rgba(251, 191, 36, 0.65);
  border-radius: 6px;
  padding: 1px 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.65);
}

.choose-sub {
  font-size: 7.5px;
  font-style: italic;
  color: #f8fafc;
  font-weight: 700;
  text-shadow: 0 1px 2px #000;
  white-space: nowrap;
}

.choose-gift-mini {
  font-size: 8.5px;
  line-height: 1;
  filter: hue-rotate(270deg) saturate(1.4) drop-shadow(0 1px 2px #000);
}

.boss-count-pill {
  background: linear-gradient(180deg, #1e293b, #0f172a);
  border: 1.5px solid #818cf8;
  border-radius: 7px;
  padding: 3px 6px;
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 8.5px;
  font-weight: 700;
  color: #e0e7ff;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
}

/* 2x4 Horizontal Hero Cards (strictly 50%/50% with zero horizontal overflow) */
.gift-legend-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 5px;
  width: 100%;
}

.hero-gift-card {
  position: relative;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border-radius: 10px;
  padding: 3px 5px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  border: 1.5px solid #fbbf24;
  background: linear-gradient(90deg, rgba(30, 20, 45, 0.95), rgba(16, 18, 36, 0.95));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: transform 0.12s, filter 0.15s;
  min-height: 48px;
}

.hero-gift-card:hover {
  transform: translateY(-1px);
  filter: brightness(1.12);
}

/* Per-hero elemental card themes matching the reference */
.hero-gift-card.theme-fire {
  border-color: #fb923c;
  background: linear-gradient(90deg, rgba(124, 45, 18, 0.85) 0%, rgba(30, 15, 25, 0.96) 55%, rgba(67, 20, 7, 0.85) 100%);
  box-shadow: 0 0 8px rgba(251, 146, 60, 0.28);
}
.hero-gift-card.theme-ice {
  border-color: #38bdf8;
  background: linear-gradient(90deg, rgba(12, 74, 110, 0.85) 0%, rgba(15, 23, 42, 0.96) 55%, rgba(8, 47, 73, 0.88) 100%);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.28);
}
.hero-gift-card.theme-shadow {
  border-color: #c084fc;
  background: linear-gradient(90deg, rgba(88, 28, 135, 0.85) 0%, rgba(24, 14, 42, 0.96) 55%, rgba(59, 7, 100, 0.88) 100%);
  box-shadow: 0 0 8px rgba(192, 132, 252, 0.28);
}
.hero-gift-card.theme-nature {
  border-color: #4ade80;
  background: linear-gradient(90deg, rgba(20, 83, 45, 0.85) 0%, rgba(12, 26, 22, 0.96) 55%, rgba(6, 78, 59, 0.88) 100%);
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.25);
}
.hero-gift-card.theme-arcane {
  border-color: #e879f9;
  background: linear-gradient(90deg, rgba(112, 26, 117, 0.82) 0%, rgba(28, 16, 46, 0.96) 55%, rgba(74, 4, 78, 0.86) 100%);
  box-shadow: 0 0 8px rgba(232, 121, 249, 0.26);
}
.hero-gift-card.theme-alchemy {
  border-color: #22d3ee;
  background: linear-gradient(90deg, rgba(14, 116, 144, 0.82) 0%, rgba(15, 28, 40, 0.96) 55%, rgba(21, 94, 117, 0.85) 100%);
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.25);
}
.hero-gift-card.theme-bard {
  border-color: #fbbf24;
  background: linear-gradient(90deg, rgba(146, 64, 14, 0.82) 0%, rgba(30, 22, 16, 0.96) 55%, rgba(120, 53, 15, 0.85) 100%);
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.28);
}
.hero-gift-card.theme-dragon {
  border-color: #f87171;
  background: linear-gradient(90deg, rgba(153, 27, 27, 0.88) 0%, rgba(32, 14, 22, 0.96) 55%, rgba(127, 29, 29, 0.88) 100%);
  box-shadow: 0 0 8px rgba(248, 113, 113, 0.32);
}

.hero-card-sprite {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.85));
}

.hero-card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-card-name {
  font-size: 9.5px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.05;
  text-shadow: 0 1px 2px #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-card-role {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  align-self: flex-start;
  max-width: 100%;
  background: rgba(9, 13, 26, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 7.8px;
  font-weight: 800;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-card-role.tier-1 {
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.72);
  background: rgba(8, 47, 73, 0.78);
}
.hero-card-role.tier-2 {
  color: #86efac;
  border-color: rgba(74, 222, 128, 0.75);
  background: rgba(6, 78, 59, 0.8);
}
.hero-card-role.tier-3 {
  color: #f0abfc;
  border-color: rgba(192, 132, 252, 0.8);
  background: rgba(74, 4, 78, 0.82);
}
.hero-card-role.tier-4 {
  color: #fde047;
  border-color: rgba(251, 191, 36, 0.95);
  background: linear-gradient(90deg, rgba(146, 64, 14, 0.92), rgba(180, 83, 9, 0.92));
  box-shadow: 0 0 7px rgba(251, 191, 36, 0.55);
}

.hero-card-giftbox {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: rgba(9, 13, 26, 0.72);
  border: 1.5px solid rgba(251, 191, 36, 0.55);
  border-radius: 9px;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.65);
}

.hero-card-giftimg {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.85));
}

/* ============ LEADERBOARD MODAL INSIDE STAGE ============ */
.modal-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: rgba(9, 13, 26, 0.82);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.open {
  display: flex;
}

.modal-card {
  width: 100%;
  max-height: 78%;
  background: linear-gradient(180deg, #1e293b, #0f172a);
  border: 2px solid #fbbf24;
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.85);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 16px;
  color: #fde047;
}

.modal-close {
  background: #334155;
  border: none;
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}

.lb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 9px;
  padding: 6px 10px;
  font-size: 12px;
}

.lb-rank {
  font-weight: 700;
  color: #fbbf24;
  width: 24px;
}

.lb-user {
  flex: 1;
  font-weight: 600;
  color: #f8fafc;
}

.lb-dmg {
  font-weight: 700;
  color: #4ade80;
}

/* ============ STREAMER CONTROL PANEL (RIGHT) ============ */
.control-panel {
  width: 390px;
  height: calc(100vh - 24px);
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 18px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding-bottom: 8px;
}

.panel-header h2 {
  font-size: 15px;
  color: #fde047;
}

.panel-section {
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-title {
  font-size: 12px;
  font-weight: 700;
  color: #93c5fd;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.input-row {
  display: flex;
  gap: 6px;
}

input[type="text"], input[type="number"], select {
  flex: 1;
  background: #0f172a;
  border: 1px solid #475569;
  color: #f8fafc;
  padding: 6px 8px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px;
  outline: none;
}

input[type="text"]:focus, input[type="number"]:focus, select:focus {
  border-color: #fbbf24;
}

.btn {
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  border: none;
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 11px;
  border-radius: 8px;
  cursor: pointer;
  transition: filter 0.12s, transform 0.1s;
}

.btn:hover { filter: brightness(1.12); }
.btn:active { transform: scale(0.97); }
.btn-gold { background: linear-gradient(180deg, #f59e0b, #d97706); color: #fff; }
.btn-red { background: linear-gradient(180deg, #ef4444, #b91c1c); }
.btn-green { background: linear-gradient(180deg, #22c55e, #15803d); }
.btn-purple { background: linear-gradient(180deg, #a855f7, #7e22ce); }
.btn-dark { background: #334155; }

.status-line {
  font-size: 11px;
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.75);
  color: #cbd5e1;
}

.status-line.connected { color: #4ade80; border: 1px solid rgba(74, 222, 128, 0.4); }
.status-line.error { color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.4); }

.hero-sim-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.hero-sim-btn {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 9px;
  padding: 5px 4px;
  color: #f8fafc;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: border-color 0.15s, transform 0.1s;
}

.hero-sim-btn:hover {
  border-color: #fbbf24;
  transform: translateY(-2px);
}

.hero-sim-btn img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.hero-sim-btn span {
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  line-height: 1.1;
}

.hero-sim-btn small {
  font-size: 9px;
  color: #fde047;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.ult-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.music-controls-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.music-controls-row input[type="range"] {
  flex: 1;
  accent-color: #fbbf24;
  cursor: pointer;
}

.music-vol-icon {
  font-size: 13px;
}

.music-vol-pct {
  font-size: 11px;
  font-weight: 700;
  color: #fde047;
  width: 34px;
  text-align: right;
}

.layout-slider-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: #cbd5e1;
}

.layout-slider-row span {
  width: 52px;
  flex-shrink: 0;
  font-weight: 600;
}

.layout-slider-row input[type="range"] {
  flex: 1;
  accent-color: #fbbf24;
  cursor: pointer;
}

.layout-slider-row strong {
  width: 38px;
  text-align: right;
  color: #fde047;
  font-size: 10.5px;
}

/* Visual highlight when Drag Edit Mode is ON */
body.layout-edit-mode #powerRailWrap,
body.layout-edit-mode #liveTopDamageBox,
body.layout-edit-mode #specialPowersStack,
body.layout-edit-mode #followBadgeBox,
body.layout-edit-mode #likesHealBadgeBox {
  pointer-events: auto !important;
  cursor: grab !important;
  outline: 2px dashed #fde047 !important;
  outline-offset: 3px;
}

body.layout-edit-mode #powerRailWrap *,
body.layout-edit-mode #liveTopDamageBox *,
body.layout-edit-mode #specialPowersStack *,
body.layout-edit-mode #followBadgeBox *,
body.layout-edit-mode #likesHealBadgeBox * {
  pointer-events: none !important;
}

body.layout-edit-mode .dragging-now {
  cursor: grabbing !important;
  outline-color: #4ade80 !important;
}

.rules-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 155px;
  overflow-y: auto;
}

.rule-item {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 9px;
  padding: 5px 7px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rule-item.disabled {
  opacity: 0.5;
}

.rule-item-top {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.rule-item-text {
  flex: 1;
  color: #f8fafc;
  font-weight: 600;
  line-height: 1.15;
}

.rule-item-text strong {
  color: #fde047;
}

.rule-del-btn {
  background: transparent;
  border: none;
  color: #f87171;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  padding: 0 3px;
}

.rule-progress-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  color: #94a3b8;
}

.rule-progress-track {
  flex: 1;
  height: 6px;
  background: #1e293b;
  border-radius: 4px;
  overflow: hidden;
}

.rule-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #4ade80);
  transition: width 0.2s ease-out;
}

.rule-builder {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 4px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.mapping-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 215px;
  overflow-y: auto;
}

.gift-assign-row {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 9px;
  padding: 4px 6px;
}

.gift-assign-hero-img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex-shrink: 0;
}

.gift-assign-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.gift-assign-hero-name {
  font-size: 11px;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gift-assign-gift-name {
  font-size: 9.5px;
  color: #fde047;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gift-assign-preview {
  width: 30px;
  height: 30px;
  object-fit: contain;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(251, 191, 36, 0.45);
  border-radius: 7px;
  padding: 2px;
  flex-shrink: 0;
}

.gift-assign-btn {
  padding: 4px 8px;
  font-size: 10.5px;
  flex-shrink: 0;
}

/* ============ VISUAL TIKTOK GIFT PACK PICKER MODAL ============ */
.gift-picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(6, 9, 20, 0.82);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.gift-picker-backdrop.open {
  display: flex;
}

.gift-picker-dialog {
  width: 680px;
  max-width: 96vw;
  height: 82vh;
  background: linear-gradient(180deg, #1e293b, #0f172a);
  border: 2px solid #fbbf24;
  border-radius: 18px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
}

.gift-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding-bottom: 8px;
}

.gift-picker-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gift-picker-title-wrap img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.gift-picker-title-wrap h3 {
  font-size: 15px;
  color: #fde047;
  line-height: 1.1;
}

.gift-picker-title-wrap small {
  font-size: 11px;
  color: #94a3b8;
}

.gift-picker-filters {
  display: flex;
  gap: 8px;
}

.gift-picker-filters select {
  max-width: 230px;
}

.gift-picker-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
  align-content: start;
  padding: 4px;
}

.gift-pick-item {
  background: #0b1120;
  border: 1.5px solid #334155;
  border-radius: 11px;
  padding: 7px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: #f8fafc;
  font-family: inherit;
  transition: transform 0.12s, border-color 0.14s, background 0.14s;
}

.gift-pick-item:hover {
  transform: translateY(-2px);
  border-color: #fbbf24;
  background: #172038;
}

.gift-pick-item.selected {
  border-color: #4ade80;
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.4);
}

.gift-pick-item img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.gift-pick-name {
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  line-height: 1.1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gift-pick-tier {
  font-size: 8.5px;
  color: #fde047;
}

.event-log {
  background: #090d1a;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 7px;
  height: 115px;
  overflow-y: auto;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.log-item { line-height: 1.25; color: #cbd5e1; }
.log-item.gift { color: #fde047; }
.log-item.success { color: #4ade80; }
.log-item.error { color: #f87171; }
.log-item.social { color: #7dd3fc; }

/* Floating restore button when in OBS mode (hidden completely when opened via ?obs=1) */
.obs-restore-btn {
  position: fixed;
  bottom: 12px;
  right: 12px;
  z-index: 50;
  display: none;
  opacity: 0.35;
}
.obs-restore-btn:hover { opacity: 1; }
body.obs-mode .obs-restore-btn { display: block; }
body.obs-pure .obs-restore-btn { display: none !important; }

.obs-link-box {
  background: rgba(9, 13, 26, 0.72);
  border: 1px dashed rgba(251, 191, 36, 0.45);
  border-radius: 9px;
  padding: 6px 7px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.obs-link-label {
  font-size: 10px;
  font-weight: 700;
  color: #86efac;
}

/* ============ VOICEOVER / NARRATOR PANEL ============ */
.voice-master-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #4ade80;
  cursor: pointer;
}
.voice-master-toggle input {
  width: auto;
  cursor: pointer;
}
.voice-subhead {
  font-size: 10.5px;
  font-weight: 700;
  color: #93c5fd;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.voice-events-grid {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.voice-event-row {
  display: grid;
  grid-template-columns: 98px 1fr 30px;
  gap: 5px;
  align-items: center;
}
.voice-event-lbl {
  font-size: 11px;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.voice-play-btn {
  padding: 4px 0 !important;
  font-size: 11px !important;
  text-align: center;
}
.voice-cooldown-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: #94a3b8;
  margin-top: 2px;
}
.voice-cooldown-row input {
  padding: 3px 6px !important;
  font-size: 11px !important;
}
.voice-sched-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: #94a3b8;
  margin-top: 2px;
}
.voice-sched-next {
  color: #fde047;
  font-weight: 700;
}
