/* ==========================================================================
   DESIGN SYSTEM & VARIABLES
   ========================================================================== */
:root {
  --bg-color: #0b0d19;
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-title: 'Space Grotesk', sans-serif;

  /* Cores Principais */
  --primary: #6366f1;       /* Indigo */
  --primary-glow: rgba(99, 102, 241, 0.4);
  --accent: #f43f5e;        /* Rose / Vermelho Dragão */
  --accent-glow: rgba(244, 63, 94, 0.4);
  --success: #10b981;       /* Esmeralda / Cura Fênix */
  --success-glow: rgba(16, 185, 129, 0.4);
  --warning: #f59e0b;       /* Amber / Energia */
  --warning-glow: rgba(245, 158, 11, 0.4);
  --defense: #3b82f6;       /* Blue / Escudo Golem */
  --defense-glow: rgba(59, 130, 246, 0.4);
  --purple: #a855f7;        /* Purple / Caos Quimera & Veriko */
  --purple-glow: rgba(168, 85, 247, 0.4);

  /* Tons de Fundo */
  --glass-bg: rgba(12, 18, 34, 0.48);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-border-hover: rgba(255, 255, 255, 0.25);
  --card-bg: rgba(30, 41, 59, 0.7);

  /* Variáveis Dinâmicas de Imagem de Fundo (definidas via JS ou Fallback) */
  --bg-battle-url: none;
  --bg-map-url: none;
  --bg-menu-url: none;

  /* Parâmetros Globais de Design de Cartas (Desktop por Padrão) */
  --card-w: clamp(140px, 11vw, 168px);
  --card-h: clamp(200px, 26vh, 245px);
  --card-art-h: clamp(90px, 11.5vh, 115px);
  --card-font-name: clamp(0.75rem, 1vh, 0.85rem);
  --card-font-desc: clamp(0.65rem, 0.9vh, 0.72rem);
  --card-overlap: clamp(-24px, -1.8vw, -16px);
  --card-cost-size: clamp(20px, 2.5vh, 24px);
  --card-cost-font: clamp(0.75rem, 1vh, 0.85rem);
}

/* ==========================================================================
   RESET & CONFIGURAÇÕES BÁSICAS
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

/* Melhora tempo de resposta de clique no celular eliminando delay de 300ms */
button, .btn, .card, .map-node, .char-card, .relic-select-card, .close-btn {
  touch-action: manipulation;
}

body {
  background-color: var(--bg-color);
  color: #f1f5f9;
  font-family: var(--font-main);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
}

.font-title {
  font-family: var(--font-title);
  font-weight: 700;
  letter-spacing: -0.5px;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-accent { color: var(--accent); }
.text-bright { color: #ffffff; font-weight: 600; }
.hidden { display: none !important; }

/* ==========================================================================
   FUNDO DINÂMICO E GRADIENTES FALLBACK
   ========================================================================== */
.dynamic-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -10;
  background-size: cover;
  background-position: center;
  transition: opacity 0.5s ease-in-out;
  background-image: var(--bg-image, none);
  pointer-events: none;
}

#menu-bg-video, #battle-bg-video {
  object-fit: cover;
  z-index: -9;
  pointer-events: none;
}

#game-bg {
  z-index: -8;
  pointer-events: none;
}

/* Fallback de backgrounds caso as imagens não existam */
#game-bg.fallback-menu {
  background: radial-gradient(circle at center, #1e1b4b 0%, #0f172a 60%, #090d16 100%);
  background-size: cover;
}
#game-bg.fallback-map {
  background: var(--bg-image, none), radial-gradient(circle at center, #0f172a 0%, #020617 100%);
  background-size: cover;
}
#game-bg.fallback-battle-forest {
  background: var(--bg-image, none), radial-gradient(circle at center, rgba(6, 78, 59, 0.4) 0%, rgba(2, 44, 34, 0.6) 40%, #0b0f19 100%);
  background-size: cover;
}
#game-bg.fallback-battle-cave {
  background: var(--bg-image, none), radial-gradient(circle at center, #312e81 0%, #1e1b4b 40%, #020617 100%);
  background-size: cover;
}
#game-bg.fallback-battle-castle {
  background: var(--bg-image, none), radial-gradient(circle at center, #581c87 0%, #3b0764 45%, #090514 100%);
  background-size: cover;
}

/* Forcar centralizacao e proporcoes corretas de background em todas as telas */
#game-bg {
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-size: cover !important;
  background-attachment: fixed !important;
}

/* Alinhamento de piso em cena de batalha ancorado na base para acomodar perfeitamente heróis e inimigos */
#game-bg.battle-scene-bg {
  background-position: center bottom !important;
  transition: none !important;
}

#bg-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -5;
  background: linear-gradient(0deg, rgba(11, 13, 25, 0.4) 0%, rgba(11, 13, 25, 0.1) 100%);
  pointer-events: none;
}

/* ==========================================================================
   HUD E ELEMENTOS DE CABEÇALHO
   ========================================================================== */
#game-hud {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 60px;
  box-sizing: border-box;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 40px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
}

.hud-left, .hud-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.hud-item {
  font-size: 1.1rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  gap: 8px;
}

#hud-character-name {
  color: var(--primary);
  border-color: var(--primary-glow);
}

#hud-hp {
  border-color: var(--accent-glow);
}

#hud-gold {
  border-color: var(--warning-glow);
}

.hud-relics-label {
  font-size: 0.9rem;
  color: #94a3b8;
  font-weight: 600;
}

.relic-container {
  display: flex;
  gap: 8px;
  min-width: 50px;
}

.relic-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.relic-icon:hover {
  transform: scale(1.1);
  border-color: var(--primary);
}

/* Tooltip simples */
.relic-icon:not([data-tooltip])::after {
  display: none !important;
}

.relic-icon[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 40px;
  right: 0;
  background: #0f172a;
  color: #f1f5f9;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--primary);
  font-size: 0.8rem;
  width: 200px;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-5px);
  transition: all 0.2s;
  z-index: 100;
}

.relic-icon[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.hud-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.hud-btn:hover {
  background: #4f46e5;
  box-shadow: 0 0 10px var(--primary-glow);
  transform: translateY(-1px);
}

/* ==========================================================================
   ESTILOS GERAIS DE CARDS GLASSMORPHISM & BOTÕES
   ========================================================================== */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: border 0.3s ease;
}

.glass-card:hover {
  border-color: var(--glass-border-hover);
}

.btn {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.1rem;
  padding: 12px 28px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  background: #4f46e5;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.9rem;
}

.btn-large {
  padding: 16px 36px;
  font-size: 1.2rem;
}

/* ==========================================================================
   ESTILOS DE TELAS
   ========================================================================== */
#game-container {
  flex: 1;
  position: relative;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10;
}

.screen {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Telas longas que necessitam de rolagem (melhoria de UX) */
#screen-global-rewards,
#screen-history-rank,
#screen-shop,
#screen-rest,
#screen-rewards,
#screen-game-over {
  height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  align-items: flex-start;
  padding: 40px 20px;
  box-sizing: border-box;
}

/* Customização de Scrollbar para as Telas Longas */
#screen-global-rewards::-webkit-scrollbar,
#screen-history-rank::-webkit-scrollbar,
#screen-shop::-webkit-scrollbar,
#screen-rest::-webkit-scrollbar,
#screen-rewards::-webkit-scrollbar,
#screen-game-over::-webkit-scrollbar {
  width: 8px;
}
#screen-global-rewards::-webkit-scrollbar-track,
#screen-history-rank::-webkit-scrollbar-track,
#screen-shop::-webkit-scrollbar-track,
#screen-rest::-webkit-scrollbar-track,
#screen-rewards::-webkit-scrollbar-track,
#screen-game-over::-webkit-scrollbar-track {
  background: transparent;
}
#screen-global-rewards::-webkit-scrollbar-thumb,
#screen-history-rank::-webkit-scrollbar-thumb,
#screen-shop::-webkit-scrollbar-thumb,
#screen-rest::-webkit-scrollbar-thumb,
#screen-rewards::-webkit-scrollbar-thumb,
#screen-game-over::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.4);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
#screen-global-rewards::-webkit-scrollbar-thumb:hover,
#screen-history-rank::-webkit-scrollbar-thumb:hover,
#screen-shop::-webkit-scrollbar-thumb:hover,
#screen-rest::-webkit-scrollbar-thumb:hover,
#screen-rewards::-webkit-scrollbar-thumb:hover,
#screen-game-over::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.75);
}

/* 1. Tela: Menu Principal e Animação de Entrada Cinematográfica */
.menu-container {
  max-width: 480px;
  width: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  padding: 20px;
  background: transparent;
  border: none;
  box-shadow: none;
}

#screen-main-menu.active .menu-container {
  animation: menuEntrance 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#screen-main-menu.active .game-logo {
  animation: logoDropIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.2s backwards;
}

#screen-main-menu.active .menu-buttons button:nth-child(1) {
  animation: buttonRise 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.45s backwards;
}
#screen-main-menu.active .menu-buttons button:nth-child(2) {
  animation: buttonRise 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.6s backwards;
}
#screen-main-menu.active .menu-buttons button:nth-child(3) {
  animation: buttonRise 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.75s backwards;
}
#screen-main-menu.active .menu-buttons button:nth-child(4) {
  animation: buttonRise 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.9s backwards;
}
#screen-main-menu.active .menu-buttons button:nth-child(5) {
  animation: buttonRise 0.8s cubic-bezier(0.16, 1, 0.3, 1) 1.05s backwards;
}

@keyframes menuEntrance {
  0% {
    opacity: 0;
    transform: scale(0.92) translateY(20px);
    filter: blur(8px);
  }
  60% {
    filter: blur(2px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
}

@keyframes logoDropIn {
  0% {
    opacity: 0;
    transform: translateY(-25px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes buttonRise {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.title-branding-group {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  margin-bottom: 5px;
}

.game-presenter-subtitle {
  font-family: 'Cinzel', 'Times New Roman', serif;
  font-size: clamp(0.48rem, 1.0vw, 0.62rem);
  letter-spacing: clamp(0.5px, 0.1vw, 1px);
  color: #cbd5e1;
  text-transform: uppercase;
  margin-bottom: 4px;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.9), 0 0 18px rgba(168, 85, 247, 0.4);
  line-height: 1.2;
  white-space: nowrap;
}

.game-logo {
  font-family: 'Cinzel', 'Times New Roman', serif;
  font-weight: 900;
  font-size: clamp(2.2rem, 9vw, 4.5rem);
  line-height: 1.02;
  margin-bottom: 0;
  color: #ffffff;
  text-shadow: 0 0 20px rgba(0, 0, 0, 0.9), 0 0 35px var(--primary-glow);
  letter-spacing: clamp(1.5px, 0.8vw, 4px);
  text-transform: uppercase;
  max-width: 100%;
  box-sizing: border-box;
  text-align: left;
  width: 100%;
}

.game-logo .logo-main-word {
  display: block;
}

.logo-accent {
  display: block;
  width: 100%;
  text-align: center;
  color: var(--purple);
  text-shadow: 0 0 35px var(--purple-glow), 0 0 15px rgba(0, 0, 0, 0.9);
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-width: 320px;
  width: 100%;
}

/* Botão do Modo Ranqueado */
.btn-ranked-mode {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  user-select: none;
  transition: all 0.2s ease;
}

.btn-ranked-mode.locked,
.btn-ranked-mode:disabled {
  opacity: 0.65;
  cursor: not-allowed !important;
  border-style: dashed !important;
  border-color: rgba(251, 191, 36, 0.45) !important;
  color: #cbd5e1 !important;
  background: rgba(15, 23, 42, 0.6) !important;
  transform: none !important;
  box-shadow: none !important;
}

.btn-ranked-mode.btn-ranked-unlocked,
.btn-ranked-mode.unlocked,
.btn-ranked-mode:not(.locked) {
  opacity: 1 !important;
  cursor: pointer !important;
  border-style: solid !important;
  border: 1px solid var(--glass-border) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: #e2e8f0 !important;
  box-shadow: none !important;
}

.btn-ranked-mode.btn-ranked-unlocked:hover,
.btn-ranked-mode.unlocked:hover,
.btn-ranked-mode:not(.locked):hover {
  background: rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  transform: translateY(-2px) !important;
}

.btn-ranked-mode .ranked-badge-pill {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #fbbf24;
}

.btn-ranked-mode.btn-ranked-unlocked .ranked-badge-pill,
.btn-ranked-mode.unlocked .ranked-badge-pill,
.btn-ranked-mode:not(.locked) .ranked-badge-pill {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.5);
  color: #4ade80;
}

/* 2. Tela: Seleção de Personagem */
.select-container {
  width: 100%;
  max-width: 900px;
}

.section-title {
  font-size: 2.2rem;
  margin-bottom: 30px;
}

.characters-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

/* ========================================================
   NOVA TELA DIEGÉTICA: SELEÇÃO DE PERSONAGEM (TEMPLO ARRUINADO)
   ======================================================== */
#screen-char-select {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  box-sizing: border-box;
  padding: 12px 24px 18px 24px;
  background-color: #030407;
  z-index: 10;
  user-select: none;
}

#screen-char-select.hidden {
  display: none !important;
}

/* Background com imagem do templo em baixa iluminação (Low-Key) */
.char-select-scene-bg {
  position: absolute;
  inset: 0;
  background: url('../../assets/backgrounds/char_select_temple_bg.jpg') center center / cover no-repeat;
  filter: brightness(0.35) contrast(1.15) saturate(0.85);
  transform: scale(1.02);
  z-index: 0;
  pointer-events: none;
  transition: filter 0.8s ease;
}

/* Vinheta e Sombras Diegéticas */
.char-select-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 32%, rgba(4, 6, 12, 0.05) 0%, rgba(2, 3, 7, 0.65) 60%, rgba(1, 1, 3, 0.96) 100%),
              linear-gradient(180deg, rgba(3, 4, 8, 0.7) 0%, transparent 16%, transparent 60%, rgba(2, 3, 6, 0.97) 100%);
  pointer-events: none;
  z-index: 1;
}

/* Foco de Luz Quente Dinâmico */
.char-select-spotlight {
  position: absolute;
  top: 0;
  left: 50%;
  width: 650px;
  height: 85vh;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 22%, rgba(255, 215, 120, 0.38) 0%, rgba(245, 158, 11, 0.15) 45%, transparent 75%);
  pointer-events: none;
  z-index: 2;
  transition: left 0.45s cubic-bezier(0.2, 0.8, 0.25, 1), opacity 0.4s ease;
  mix-blend-mode: screen;
}

/* Topo Central: Título da Tela e Instrução */
.char-select-header {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  text-align: center;
  pointer-events: none;
  width: 100%;
  max-width: 900px;
}

.char-select-title {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #f8fafc;
  text-shadow: 0 0 16px rgba(251, 191, 36, 0.4), 0 3px 8px rgba(0, 0, 0, 0.9);
  margin: 0;
}

.char-select-subtitle {
  font-size: 0.8rem;
  letter-spacing: 0.8px;
  color: #94a3b8;
  margin: 2px 0 0 0;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.9);
}

/* Nome em Destaque do Personagem: Rebaixado para não tampar o título */
.char-active-floating-name {
  position: absolute;
  top: 96px; /* Mais para baixo conforme solicitado */
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  text-align: center;
  pointer-events: none;
}

.active-hero-badge-title {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #fbbf24;
  text-shadow: 0 0 22px rgba(251, 191, 36, 0.9), 0 3px 8px #000;
  background: rgba(10, 14, 24, 0.55);
  padding: 5px 24px;
  border-radius: 20px;
  border: 1px solid rgba(251, 191, 36, 0.45);
  backdrop-filter: blur(10px);
  display: inline-block;
  animation: glowPulse 2.5s infinite alternate;
}

@keyframes glowPulse {
  0% { box-shadow: 0 0 14px rgba(251, 191, 36, 0.35); transform: scale(0.98); }
  100% { box-shadow: 0 0 28px rgba(251, 191, 36, 0.7); transform: scale(1.02); }
}

/* Palco de Personagens: Imagem Gigante e Alta */
.char-stage-wrapper {
  position: absolute;
  top: 40px;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100vw;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2; /* Layer de Trás das Caixas de HUD */
  pointer-events: auto;
}

.char-stage-arrow-btn {
  position: absolute;
  top: 40%;
  transform: translateY(-50%);
  background: rgba(15, 23, 42, 0.65);
  border: 1.5px solid rgba(251, 191, 36, 0.45);
  color: #f1f5f9;
  font-size: 2.6rem;
  line-height: 1;
  width: 52px;
  height: 68px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.25, 1);
  z-index: 12;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.7);
}
.char-stage-arrow-btn.prev-btn { left: 30px; }
.char-stage-arrow-btn.next-btn { right: 30px; }

.char-stage-arrow-btn:hover {
  background: rgba(245, 158, 11, 0.35);
  border-color: #fbbf24;
  color: #fbbf24;
  transform: translateY(-50%) scale(1.12);
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.6);
}

.char-stage-line {
  position: relative;
  width: 100vw;
  height: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  pointer-events: none;
}

/* Slot do Personagem: Alinhado verticalmente com o centro da tela */
.char-stand {
  position: absolute;
  top: 70px; /* Posiciona o topo do herói logo abaixo do nome em destaque */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  cursor: pointer;
  width: 580px; /* Largura ampla para suportar imagens horizontais ou 1024x1024 */
  height: 70vh; /* Ocupa com imponência até acima das caixas */
  max-height: 650px;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), 
              opacity 0.55s ease, 
              filter 0.55s ease;
  pointer-events: auto;
  user-select: none;
}

/* Personagem NÃO FOCADO, mas LIBERADO */
.char-stand.stand-unlocked {
  filter: brightness(0.25) contrast(1.15) saturate(0.5);
  opacity: 0.6;
}

.char-stand.stand-unlocked:hover {
  filter: brightness(0.48) contrast(1.2) saturate(0.8);
  opacity: 0.88;
}

/* Ponto de luz no aventureiro liberado não-focado */
.char-stand.stand-unlocked .char-stand-light-point {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fde68a;
  box-shadow: 0 0 14px 7px rgba(251, 191, 36, 0.75), 0 0 28px 12px rgba(245, 158, 11, 0.4);
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 4;
  animation: candleFlicker 2.4s ease-in-out infinite alternate;
}

@keyframes candleFlicker {
  0% { opacity: 0.4; transform: translate(-50%, -50%) scale(0.85); box-shadow: 0 0 8px 4px rgba(251, 191, 36, 0.55); }
  50% { opacity: 0.85; transform: translate(-52%, -48%) scale(1.15); box-shadow: 0 0 18px 9px rgba(251, 191, 36, 0.85); }
  100% { opacity: 0.55; transform: translate(-49%, -51%) scale(0.95); box-shadow: 0 0 12px 6px rgba(245, 158, 11, 0.65); }
}

/* Personagem NÃO FOCADO e BLOQUEADO (Sem cadeado) */
.char-stand.stand-locked {
  filter: brightness(0) contrast(160%);
  opacity: 0.35;
  cursor: pointer;
}

.char-stand.stand-locked:hover {
  opacity: 0.52;
  filter: brightness(0.08) contrast(180%);
}

.char-stand.stand-locked .char-stand-lock-badge {
  position: absolute;
  top: 45%;
  background: rgba(10, 14, 24, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #94a3b8;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 12px;
  border-radius: 4px;
  z-index: 5;
  display: flex;
  align-items: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
}

/* Personagem EM FOCO: Destacado, grande, nítido e iluminado */
.char-stand.stand-active {
  filter: brightness(1.15) contrast(1.08) drop-shadow(0 0 35px rgba(251, 191, 36, 0.8)) drop-shadow(0 0 70px rgba(245, 158, 11, 0.35));
  opacity: 1;
  z-index: 4;
}

.char-stand.stand-active.stand-locked {
  filter: brightness(0.12) contrast(140%) drop-shadow(0 0 25px rgba(239, 68, 68, 0.65));
  opacity: 0.95;
}

/* Figura de corpo inteiro: Preenchimento total do espaço com alinhamento superior/central */
.char-stand-figure {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.char-stand-img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center top;
  pointer-events: none;
  filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.75));
}

/* ========================================================
   CARD DE INFORMAÇÕES GEOMÉTRICO (GLASSMORPHISM translúcido)
   ======================================================== */
.char-details-geometric {
  position: relative;
  z-index: 5;
  width: 100%;
  max-width: 980px;
  background: rgba(10, 14, 24, 0.45);
  border: 1px solid rgba(251, 191, 36, 0.35);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 0 20px rgba(251, 191, 36, 0.04);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 12px 20px;
  border-radius: 6px;
  animation: fadeIn 0.35s ease;
  box-sizing: border-box;
  margin-top: 0;
  margin-bottom: 10px;
}

.char-card-corner {
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: #fbbf24;
  border-style: solid;
  pointer-events: none;
}
.char-card-corner.top-left { top: -2px; left: -2px; border-width: 2px 0 0 2px; }
.char-card-corner.top-right { top: -2px; right: -2px; border-width: 2px 2px 0 0; }
.char-card-corner.bottom-left { bottom: -2px; left: -2px; border-width: 0 0 2px 2px; }
.char-card-corner.bottom-right { bottom: -2px; right: -2px; border-width: 0 2px 2px 0; }

.char-cleared-seal {
  position: absolute;
  top: 10px;
  right: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  cursor: help;
  z-index: 10;
  animation: sealPulse 3s ease-in-out infinite alternate;
}

.char-cleared-seal.hidden {
  display: none !important;
}

.seal-svg {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.75));
  transition: transform 0.25s ease;
}

.char-cleared-seal:hover .seal-svg {
  transform: scale(1.15) rotate(15deg);
}

.seal-label {
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 1px;
  color: #fbbf24;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.8), 0 2px 4px #000;
  margin-top: -2px;
}

.char-details-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
  margin-bottom: 6px;
  padding-right: 60px;
}

.char-title-block {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.details-hero-name {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fbbf24;
  margin: 0;
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.4);
}

.details-hero-class {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.1);
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.details-stats-inline {
  display: flex;
  gap: 12px;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 4px;
}
.stat-pill.hp-pill {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}
.stat-pill.gold-pill {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fde68a;
}

.details-hero-lore {
  font-size: 0.82rem;
  line-height: 1.4;
  color: #cbd5e1;
  margin: 0 0 6px 0;
}

.char-passive-geometric {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.03) 100%);
  border-left: 3px solid #fbbf24;
  border-radius: 0 4px 4px 0;
  padding: 5px 12px;
  margin-bottom: 6px;
}

.passive-icon-sigil {
  font-size: 1.05rem;
  color: #fbbf24;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.8);
}

.passive-hero-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: #fbbf24;
}

.passive-hero-desc {
  font-size: 0.76rem;
  color: #e2e8f0;
  line-height: 1.3;
}

.details-deck-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.deck-label {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #94a3b8;
}

/* ========================================================
   RODAPÉ INFERIOR: ELEVADO & SELETOR DE ARTEFATOS ESTILO "GAMES"
   ======================================================== */
.char-select-footer {
  position: relative;
  z-index: 5;
  width: 100%;
  max-width: 1360px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 0;
  margin-bottom: 4px;
}

.footer-left-action, .footer-right-action {
  flex-shrink: 0;
}

.char-footer-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  font-size: 0.95rem;
  font-weight: 800;
  border-radius: 4px;
  letter-spacing: 0.8px;
  transition: all 0.25s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
}

.char-footer-btn.back-btn {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
}
.char-footer-btn.back-btn:hover {
  background: rgba(30, 41, 59, 0.8);
  color: #f8fafc;
  border-color: #94a3b8;
}

.char-footer-btn.confirm-btn {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.85) 0%, rgba(180, 83, 9, 0.85) 100%);
  border: 1.5px solid #fbbf24;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
.char-footer-btn.confirm-btn:hover {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.6);
  transform: translateY(-2px);
}

.btn-arrow-forward {
  font-size: 1.15rem;
  transition: transform 0.2s ease;
}
.char-footer-btn.confirm-btn:hover .btn-arrow-forward {
  transform: translateX(4px);
}

/* ========================================================
   SELETOR DE ARTEFATOS ESTILO "GAMES": PEDESTAL DE RELÍQUIAS
   ======================================================== */
.relic-select-section {
  flex: 1;
  max-width: 680px;
  background: rgba(10, 14, 24, 0.52);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 8px;
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.artifact-carousel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 4px;
}

.artifact-carousel-title {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #fbbf24;
}

.artifact-carousel-hint {
  font-size: 0.72rem;
  color: #94a3b8;
}

.artifact-3d-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.artifact-nav-btn {
  background: rgba(15, 23, 42, 0.7);
  border: 1.5px solid rgba(251, 191, 36, 0.4);
  color: #f1f5f9;
  font-size: 1.6rem;
  line-height: 1;
  width: 36px;
  height: 42px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.25, 1);
  z-index: 10;
  backdrop-filter: blur(6px);
  flex-shrink: 0;
}
.artifact-nav-btn:hover {
  border-color: #fbbf24;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.35);
  transform: scale(1.1);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.4);
}

/* Palco Central do Carrossel de Artefatos */
.artifact-carousel-stage {
  width: 380px;
  height: 64px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent 0%, black 15%, black 85%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 15%, black 85%, transparent 100%);
}

/* Faixa deslizante contínua com transition suave */
.artifact-carousel-ring {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  display: flex;
  align-items: center;
  will-change: transform;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Cada slot de artefato no carrossel */
.relic-select-card {
  width: 52px;
  height: 52px;
  margin: 0 8px; /* Largura total do slot = 52 + 16 = 68px */
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.7);
  border: 1.5px solid rgba(148, 163, 184, 0.25);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0.4;
  transform: scale(0.78);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), 
              opacity 0.45s ease, 
              border-color 0.35s ease, 
              box-shadow 0.35s ease;
  user-select: none;
  box-sizing: border-box;
}

.relic-select-card:hover {
  border-color: rgba(251, 191, 36, 0.7);
  opacity: 0.8;
  transform: scale(0.9);
}

/* Artefato Selecionado: No centro da janela com destaque dourado */
.relic-select-card.selected {
  opacity: 1;
  transform: scale(1.15);
  border-color: #fbbf24;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.28) 0%, rgba(20, 26, 45, 0.95) 100%);
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.8), inset 0 0 12px rgba(251, 191, 36, 0.35);
  z-index: 5;
}

.relic-select-icon {
  width: 38px;
  height: 38px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.3s ease;
}

.relic-select-card.selected .relic-select-icon {
  transform: scale(1.08);
  filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.6));
}

.relic-none-icon {
  font-size: 1.35rem;
  opacity: 0.8;
}

.artifact-selected-desc-box {
  width: 100%;
  margin-top: 6px;
  padding: 6px 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  font-size: 0.78rem;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  min-height: 34px;
  box-sizing: border-box;
  animation: fadeIn 0.25s ease;
}

/* Pílulas de Cartas Exclusivas */
.cards-preview-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.preview-card-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
}

.artifact-selected-desc-box .effect-label {
  font-weight: 700;
  color: var(--primary-bright);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  flex-shrink: 0;
}

/* ==========================================================================
   3. MAPA PROCEDURAL
   ========================================================================== */
#screen-map {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 68px 16px 16px 16px !important;
  box-sizing: border-box !important;
  z-index: 20;
  overflow: hidden !important;
}

#screen-map.active {
  display: flex !important;
}

#screen-map.hidden,
#screen-map:not(.active) {
  display: none !important;
  pointer-events: none !important;
}

#map-bg {
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  z-index: 1;
}

.map-screen-overlay {
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.1) 0%, rgba(15, 23, 42, 0.4) 100%);
  z-index: 2;
  pointer-events: none;
}

.map-wrapper {
  width: 96%;
  max-width: 1350px;
  height: calc(100vh - 95px);
  display: flex;
  flex-direction: column;
  background: rgba(10, 15, 28, 0.18) !important;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  border-radius: 20px;
  padding: 14px 24px;
  box-sizing: border-box;
  animation: fadeIn 0.35s ease-out;
  position: relative;
  z-index: 3;
}

.map-header-container {
  text-align: center;
  margin-bottom: 6px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.map-act-badge {
  display: inline-block;
  background: rgba(245, 158, 11, 0.25);
  border: 1px solid #f59e0b;
  color: #fbbf24;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 5px 18px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.2);
}

.map-act-title {
  margin: 6px auto 2px auto !important;
  font-size: 1.05rem !important;
  font-weight: 500 !important;
  font-style: italic;
  color: #f1f5f9 !important;
  max-width: 960px !important;
  line-height: 1.45 !important;
  letter-spacing: 0.25px !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95) !important;
  padding: 0 12px;
}

.map-hint {
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-top: 3px;
  margin-bottom: 6px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.map-scroll-container {
  flex: 1;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 20px;
  box-sizing: border-box;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 158, 11, 0.45) rgba(15, 23, 42, 0.35);
  display: flex;
  align-items: center;
}

.map-scroll-container::-webkit-scrollbar {
  height: 8px;
}

.map-scroll-container::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.45);
  border-radius: 4px;
}

.map-scroll-container::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.45);
  border-radius: 4px;
}

.map-scroll-container::-webkit-scrollbar-thumb:hover {
  background: rgba(245, 158, 11, 0.8);
}

.map-grid {
  display: flex;
  flex-direction: row; /* Orientação Horizontal: Andar 1 à esquerda, Boss à direita */
  justify-content: flex-start;
  align-items: stretch;
  gap: 160px; /* Espaçamento horizontal amplo e generoso */
  min-width: max-content;
  height: 100%;
  min-height: 380px;
  padding: 20px 80px;
  position: relative;
  box-sizing: border-box;
}

/* Colunas verticais de nós em cada andar horizontal */
.map-floor-row {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  min-width: 80px;
  height: 100%;
  position: relative;
  z-index: 10 !important;
}

.map-node {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.9);
  border: 2px solid #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  cursor: pointer;
  position: relative;
  z-index: 15 !important;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.map-node:hover {
  transform: scale(1.15);
}

.map-node.accessible {
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}

.map-node.accessible:hover {
  background: var(--primary);
  color: white;
}

.map-node.visited {
  border-color: var(--success);
  opacity: 0.6;
}

.map-node.locked {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Rótulo do nó ao passar o mouse */
.map-node::after {
  content: attr(data-label);
  position: absolute;
  bottom: -25px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #cbd5e1;
  white-space: nowrap;
  pointer-events: none;
}

/* Estilos de tipo de nó */
.map-node[data-type="Boss"] {
  width: 70px;
  height: 70px;
  border-color: var(--accent);
  box-shadow: 0 0 15px var(--accent-glow);
}

.map-node[data-type="Boss"].accessible:hover {
  background: var(--accent);
}

.map-node[data-type="Elite"] {
  border-color: var(--purple);
}

.map-node[data-type="Shop"] {
  border-color: var(--warning);
}

.map-node[data-type="Rest"] {
  border-color: var(--success);
}

.map-node[data-type="Event"] {
  border-color: #38bdf8; /* Azul celeste / ciano místico */
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.45);
}

/* Canvas para desenhar as linhas de conexão do mapa */
.map-connections-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1 !important;
  pointer-events: none;
}

/* ==========================================================================
   4. SISTEMA DE COMBATE (BATTLE)
   ========================================================================== */
#screen-battle {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  max-height: 100%;
  width: 100%;
  padding-top: clamp(48px, 6.5vh, 65px);
  padding-bottom: clamp(4px, 1vh, 10px);
  box-sizing: border-box;
  overflow: hidden;
}

.battle-arena {
  flex: 1 1 0;
  min-height: 0;
  max-height: calc(100vh - 350px);
  display: flex;
  justify-content: space-between; /* Hero left, enemies right */
  align-items: flex-end; /* Personagens e inimigos apoiados no chão da arena */
  padding: 6px clamp(4%, 6vw, 8%) 0 clamp(4%, 6vw, 8%);
  margin-bottom: -10px; /* Alinhamento ao solo do cenário */
  gap: clamp(16px, 3vw, 40px);
  position: relative;
  --base-combatant-size: clamp(130px, min(20vw, 30vh), 240px);
}

/* Escala e Proporcionalidade Dinâmica de Combate: Lado do Jogador e Inimigos compartilham o mesmo tamanho base */
.battle-arena.enemy-count-1,
.battle-arena:has(.enemies-wrapper.count-1) {
  --base-combatant-size: clamp(140px, min(22vw, 32vh), 250px);
}
.battle-arena.enemy-count-2,
.battle-arena:has(.enemies-wrapper.count-2) {
  --base-combatant-size: clamp(115px, min(16vw, 24vh), 190px);
}
.battle-arena.enemy-count-3,
.battle-arena:has(.enemies-wrapper.count-3) {
  --base-combatant-size: clamp(95px, min(12vw, 18vh), 150px);
}
.battle-arena.enemy-count-4,
.battle-arena.enemy-count-5,
.battle-arena:has(.enemies-wrapper.count-4),
.battle-arena:has(.enemies-wrapper.count-5) {
  --base-combatant-size: clamp(80px, min(10vw, 15vh), 120px);
}

/* Combatente Layout - Proporcionalidade individual por personagem via --sprite-scale */
.combatant-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(4px, 0.8vh, 8px);
  position: relative;
  width: calc(var(--base-combatant-size) * var(--sprite-scale, 1));
  min-width: clamp(90px, 10vw, 120px);
  max-height: 100%;
}

.enemies-wrapper {
  display: flex;
  gap: clamp(14px, 2vw, 28px);
  align-items: flex-end;
  justify-content: center;
  flex-wrap: wrap;
}

/* Lado do Jogador se mantém alinhado no chão da arena */
.player-side-container .combatant-wrapper {
  justify-content: flex-end;
}

/* Dynamic sizes for layout */
.player-wrapper {
  width: calc(var(--base-combatant-size) * var(--sprite-scale, 1));
  min-width: clamp(100px, 12vw, 130px);
}

.enemies-wrapper .combatant-wrapper {
  width: calc(var(--base-combatant-size) * var(--sprite-scale, 1));
  min-width: clamp(100px, 12vw, 130px);
}

/* Ajuste específico para 3 inimigos: mantém largura mínima confortável para status sem apertar */
.enemies-wrapper.count-3 .combatant-wrapper {
  min-width: clamp(105px, 13vw, 140px);
}

/* Force 2x2 grid when 4 enemies */
.enemies-wrapper.count-4 {
  max-width: clamp(240px, 26vw, 340px);
}

/* CONTÊINER DO SPRITE - Dimensionamento dinâmico ancorado na base */
.sprite-container {
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center bottom;
  width: calc(var(--base-combatant-size) * var(--sprite-scale, 1));
  height: calc(var(--base-combatant-size) * var(--sprite-scale, 1));
  max-height: clamp(150px, 36vh, 320px);
  max-width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: transform 0.15s ease-out;
  box-sizing: border-box;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  position: relative;
}

.sprite-container img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center bottom !important;
}

.sprite-container.has-image {
  background-image: none !important;
}

.sprite-container.has-image::before {
  display: none !important;
}

/* SPRITE DO HERÓI: Quadro invisível para visual orgânico */
.player-wrapper .sprite-container {
  width: calc(var(--base-combatant-size) * var(--sprite-scale, 1));
  height: calc(var(--base-combatant-size) * var(--sprite-scale, 1));
  border: none !important;
  border-image: none !important;
  box-shadow: none !important;
  background: transparent !important;
  background-color: transparent !important;
  position: relative;
}

/* Moldura interna invisível */
.player-wrapper .sprite-container::after {
  display: none !important;
}

/* SPRITE DOS INIMIGOS: Quadro invisível para visual orgânico */
.enemies-wrapper .sprite-container {
  width: calc(var(--base-combatant-size) * var(--sprite-scale, 1));
  height: calc(var(--base-combatant-size) * var(--sprite-scale, 1));
  border: none !important;
  border-image: none !important;
  box-shadow: none !important;
  background: transparent !important;
  background-color: transparent !important;
  position: relative;
}

/* Moldura interna invisível */
.enemies-wrapper .sprite-container::after {
  display: none !important;
}

/* Emojis dinâmicos baseados no tamanho do container */
.player-wrapper .sprite-container::before {
  font-size: 8rem !important;
}
.enemies-wrapper.count-1 .sprite-container::before { font-size: 8rem !important; }
.enemies-wrapper.count-2 .sprite-container::before { font-size: 5.5rem !important; }
.enemies-wrapper.count-3 .sprite-container::before { font-size: 4rem !important; }
.enemies-wrapper.count-4 .sprite-container::before,
.enemies-wrapper.count-5 .sprite-container::before { font-size: 3rem !important; }

/* Fallback visual das classes de Heróis se não houver imagens */
.sprite-player.fallback-dragon {
  background-image: url('../../assets/character_dragon.png');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}
.sprite-player.fallback-dragon::before {
  display: none;
}

.sprite-player.fallback-golem {
  background: radial-gradient(circle, rgba(59,130,246,0.8) 0%, rgba(59,130,246,0) 70%);
  box-shadow: 0 0 20px var(--defense-glow);
  position: relative;
}
.sprite-player.fallback-golem::before {
  content: '🤖';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.sprite-player.fallback-phoenix {
  background: radial-gradient(circle, rgba(16,185,129,0.8) 0%, rgba(16,185,129,0) 70%);
  box-shadow: 0 0 20px var(--success-glow);
  position: relative;
}
.sprite-player.fallback-phoenix::before {
  content: '🐦';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.sprite-player.fallback-chimera {
  background: radial-gradient(circle, rgba(168,85,247,0.8) 0%, rgba(168,85,247,0) 70%);
  box-shadow: 0 0 20px var(--purple-glow);
  position: relative;
}
.sprite-player.fallback-chimera::before {
  content: '🦁';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.sprite-player.hero-ad_smashblack {
  background-image: url('../../assets/heroes/ad_smashblack.png');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}
.sprite-player.hero-ad_smashblack::before {
  display: none;
}

.sprite-player.hero-aurelio {
  background-image: url('../../assets/heroes/Aurelio.png');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}
.sprite-player.hero-aurelio::before {
  display: none;
}
#screen-rest {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  max-height: 100vh;
  z-index: 90;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
  box-sizing: border-box;
  overflow-y: auto;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.char-card-avatar.hero-aurelio {
  background-image: url('../../assets/heroes/Aurelio.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.sprite-player.hero-thomas {
  background-image: url('../../assets/heroes/thomas.png');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}
.sprite-player.hero-thomas::before {
  display: none;
}
.char-card-avatar.hero-thomas {
  background-image: url('../../assets/heroes/thomas.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Fallback de Inimigos */
.sprite-enemy.fallback-goblin {
  background: radial-gradient(circle, rgba(245,158,11,0.6) 0%, rgba(0,0,0,0) 70%);
  position: relative;
}
.sprite-enemy.fallback-goblin::before {
  content: '👺';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.sprite-enemy.fallback-slime {
  background: radial-gradient(circle, rgba(16,185,129,0.6) 0%, rgba(0,0,0,0) 70%);
  position: relative;
}
.sprite-enemy.fallback-slime::before {
  content: '🦠';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.sprite-enemy.fallback-zulu {
  background-image: url('../../assets/enemies/zulu.png');
  background-size: cover;
  background-position: center;
  position: relative;
}
/* Fallback caso a imagem não exista */
.sprite-enemy.fallback-zulu::before {
  content: '🗡️';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0; /* Oculta o emoji se a imagem carregar. Pode ajustar depois. */
}

.sprite-enemy.fallback-golem-elite {
  background: radial-gradient(circle, rgba(59,130,246,0.7) 0%, rgba(0,0,0,0) 70%);
  box-shadow: 0 0 15px var(--defense-glow);
  position: relative;
}
.sprite-enemy.fallback-golem-elite::before {
  content: '🪨';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.sprite-enemy.fallback-ratzinger {
  background: url('../../assets/enemies/ratzinger.png') center/contain no-repeat;
  box-shadow: 0 0 35px rgba(255, 32, 96, 0.8), 0 0 70px rgba(200, 0, 100, 0.4);
  filter: drop-shadow(0 0 16px rgba(255, 0, 80, 0.9));
  position: relative;
  animation: ratzinger-boss-pulse 2.5s ease-in-out infinite;
}

@keyframes ratzinger-boss-pulse {
  0%, 100% {
    box-shadow: 0 0 35px rgba(255, 32, 96, 0.8), 0 0 70px rgba(200, 0, 100, 0.4);
    filter: drop-shadow(0 0 16px rgba(255, 0, 80, 0.9));
  }
  50% {
    box-shadow: 0 0 55px rgba(255, 0, 100, 1), 0 0 110px rgba(255, 50, 200, 0.6);
    filter: drop-shadow(0 0 25px rgba(255, 0, 150, 1));
  }
}


/* Yume, a Miragem Escarlate */
.sprite-enemy.fallback-yume {
  background: url('../../assets/enemies/yume.png') center/contain no-repeat;
  box-shadow: 0 0 30px rgba(220, 20, 60, 0.9), 0 0 60px rgba(180, 0, 0, 0.4);
  filter: drop-shadow(0 0 12px rgba(220, 20, 60, 0.8));
  position: relative;
}

/* Dúplice Escarlate (cópia falsa de Yume) */
.sprite-enemy.fallback-yume-duplique {
  background: url('../../assets/enemies/yume.png') center/contain no-repeat;
  box-shadow: 0 0 20px rgba(220, 20, 60, 0.5), 0 0 40px rgba(180, 0, 0, 0.2);
  filter: drop-shadow(0 0 8px rgba(220, 20, 60, 0.5)) opacity(0.65) saturate(0.5);
  position: relative;
  opacity: 0.7;
}

/* Assassino da Guilda de Yume */
.sprite-enemy.fallback-assassin {
  background: url('../../assets/enemies/assassin.png') center/contain no-repeat;
  box-shadow: 0 0 20px rgba(159, 18, 57, 0.7), 0 0 40px rgba(0, 0, 0, 0.3);
  filter: drop-shadow(0 0 10px rgba(159, 18, 57, 0.8));
  position: relative;
}

/* Peso Fantasma Gurai */
.sprite-enemy.fallback-gurai {
  background: url('../../assets/enemies/gurai.png') center/contain no-repeat;
  box-shadow: 0 0 30px rgba(0, 210, 230, 0.7), 0 0 60px rgba(0, 150, 200, 0.3);
  filter: drop-shadow(0 0 14px rgba(0, 200, 220, 0.9));
  position: relative;
}

/* ==========================================
   DADO D20 - GURAI PESO FANTASMA
   ========================================== */

#gurai-dice-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  backdrop-filter: blur(4px);
  animation: gurai-fade-in 0.3s ease-out forwards;
}

@keyframes gurai-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

#gurai-dice-overlay .gurai-title {
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #00d4e8;
  text-shadow: 0 0 18px rgba(0, 212, 232, 0.9), 0 2px 4px rgba(0,0,0,0.8);
  letter-spacing: 0.06em;
  text-align: center;
  animation: gurai-title-pulse 1.5s ease-in-out infinite;
}

@keyframes gurai-title-pulse {
  0%, 100% { text-shadow: 0 0 18px rgba(0, 212, 232, 0.9), 0 2px 4px rgba(0,0,0,0.8); }
  50% { text-shadow: 0 0 35px rgba(0, 212, 232, 1), 0 0 12px rgba(0, 150, 200, 0.6), 0 2px 4px rgba(0,0,0,0.8); }
}

#gurai-dice-overlay .gurai-hint {
  position: absolute;
  bottom: 2%;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  color: #38bdf8;
  letter-spacing: 0.04em;
  background: rgba(0, 0, 0, 0.85);
  padding: 8px 20px;
  border-radius: 20px;
  border: 1px solid rgba(56, 189, 248, 0.4);
  z-index: 100;
  animation: gurai-hint-blink 1.2s ease-in-out infinite;
}

@keyframes gurai-hint-blink {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Dado D20 */
#gurai-d20 {
  width: 160px;
  height: 160px;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: gurai-dice-float 2s ease-in-out infinite;
  transition: transform 0.1s ease;
  user-select: none;
}

#gurai-d20:hover {
  transform: scale(1.08) !important;
  filter: brightness(1.2);
}

#gurai-d20:active {
  transform: scale(0.96) !important;
}

@keyframes gurai-dice-float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  25% { transform: translateY(-12px) rotate(3deg); }
  75% { transform: translateY(-6px) rotate(-2deg); }
}

/* SVG do D20 */
#gurai-d20 svg {
  width: 160px;
  height: 160px;
  filter: drop-shadow(0 0 20px rgba(0, 210, 230, 0.8));
}

/* Animação de rolagem do dado */
#gurai-d20.rolling,
#interactive-dice.rolling {
  animation: gurai-dice-roll 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  cursor: default;
  pointer-events: none;
}

@keyframes gurai-dice-roll {
  0% { transform: translateX(0) translateY(0) rotate(0deg); }
  15% { transform: translateX(-80px) translateY(-40px) rotate(-90deg); }
  30% { transform: translateX(60px) translateY(-60px) rotate(120deg); }
  45% { transform: translateX(-50px) translateY(20px) rotate(-200deg); }
  60% { transform: translateX(40px) translateY(-20px) rotate(280deg); }
  75% { transform: translateX(-20px) translateY(10px) rotate(-320deg); }
  90% { transform: translateX(10px) translateY(-5px) rotate(350deg); }
  100% { transform: translateX(0) translateY(0) rotate(360deg); }
}

/* Face do resultado */
#gurai-dice-result {
  position: absolute;
  bottom: 28%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  opacity: 0;
  pointer-events: none;
}

#gurai-dice-result.show-sun {
  animation: gurai-result-sun 0.6s ease-out 1.2s forwards;
}

#gurai-dice-result.show-skull {
  animation: gurai-result-skull 0.6s ease-out 1.2s forwards;
}

@keyframes gurai-result-sun {
  0% { opacity: 0; transform: translateX(-50%) scale(0.5); }
  60% { opacity: 1; transform: translateX(-50%) scale(1.15); }
  100% { opacity: 1; transform: translateX(-50%) scale(1); }
}

@keyframes gurai-result-skull {
  0% { opacity: 0; transform: translateX(-50%) scale(0.5); }
  30% { opacity: 1; transform: translateX(-50%) scale(1.3) rotate(-5deg); }
  60% { transform: translateX(-50%) scale(0.95) rotate(3deg); }
  100% { opacity: 1; transform: translateX(-50%) scale(1) rotate(0deg); }
}

#gurai-dice-result .result-label {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  display: block;
  margin-top: 8px;
}

#gurai-dice-result.show-sun .result-label {
  color: #ffd700;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

#gurai-dice-result.show-skull .result-label {
  color: #ef4444;
  text-shadow: 0 0 20px rgba(239, 68, 68, 0.8);
}

/* Animação de repulsa das cartas */
.card-repelled {
  animation: card-repel-fly 0.6s ease-in forwards !important;
}

@keyframes card-repel-fly {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  40% { transform: translateY(-30px) scale(1.05) rotate(-5deg); opacity: 0.7; }
  100% { transform: translateY(-120px) scale(0.5) rotate(-15deg); opacity: 0; }
}

/* Onda de repulsa que atravessa a arena */
.gurai-repel-wave {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  border: 4px solid rgba(0, 210, 230, 0.9);
  border-radius: 50%;
  pointer-events: none;
  z-index: 8900;
  animation: gurai-wave-expand 0.8s ease-out forwards;
}

@keyframes gurai-wave-expand {
  0% { width: 60px; height: 60px; opacity: 0.9; border-color: rgba(0, 210, 230, 0.9); }
  50% { border-color: rgba(99, 102, 241, 0.4); }
  100% { width: 800px; height: 800px; opacity: 0; border-color: rgba(0, 210, 230, 0); }
}

.artifact-container {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
}

.compendium-dict-btn {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.compendium-dict-btn:hover {
  transform: translateY(-2px) scale(1.08) !important;
  background-color: rgba(56, 189, 248, 0.25) !important;
  border-color: rgba(56, 189, 248, 0.7) !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4) !important;
}

.compendium-dict-btn:active {
  transform: translateY(0) scale(0.96) !important;
}

.dictionary-list p {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  line-height: 1.5;
}
.dictionary-list p:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.dictionary-list strong {
  color: var(--accent);
  font-family: var(--font-title);
  letter-spacing: 0.5px;
}

@media (max-width: 768px) {
  /* Mobile adjustments */
}

/* Texto flutuante de repulsa */
#gurai-repel-text {
  position: fixed;
  top: 35%;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  font-weight: 900;
  color: #00d4e8;
  text-shadow: 0 0 20px rgba(0, 212, 232, 1), 0 0 40px rgba(200, 100, 255, 0.6);
  letter-spacing: 0.08em;
  z-index: 9100;
  pointer-events: none;
  opacity: 0;
  animation: gurai-repel-text-show 2s ease-out forwards;
}

@keyframes gurai-repel-text-show {
  0% { opacity: 0; transform: translateX(-50%) translateY(20px) scale(0.8); }
  20% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1.1); }
  60% { opacity: 1; transform: translateX(-50%) translateY(-10px) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-40px) scale(0.9); }
}

/* ==========================================
   DADO D20 - RATZINGER (18 Sol / 2 Caveira)
   ========================================== */

#ratzinger-dice-overlay,
#kamui-dodge-overlay,
.kamui-dodge-overlay,
#generic-2d6-overlay,
#generic-d10-overlay {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0, 0, 0, 0.88) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 10050 !important;
  backdrop-filter: blur(8px) !important;
  animation: ratz-fade-in 0.4s ease-out forwards;
  pointer-events: all !important;
  box-sizing: border-box !important;
}

@keyframes ratz-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

#ratzinger-dice-overlay .ratz-title,
#kamui-dodge-overlay .ratz-title,
.kamui-dodge-overlay .ratz-title,
#generic-2d6-overlay .ratz-title,
#generic-d10-overlay .ratz-title {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 900;
  color: #ff2060;
  text-shadow: 0 0 20px rgba(255, 32, 96, 1), 0 0 40px rgba(200, 0, 100, 0.6);
  letter-spacing: 0.05em;
  text-align: center;
  white-space: nowrap;
  animation: ratz-title-flicker 1.8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes ratz-title-flicker {
  0%, 90%, 100% { opacity: 1; }
  92% { opacity: 0.4; }
  96% { opacity: 1; }
  98% { opacity: 0.2; }
}

#ratzinger-dice-overlay .ratz-subtitle,
#kamui-dodge-overlay .ratz-subtitle,
.kamui-dodge-overlay .ratz-subtitle,
#generic-2d6-overlay .ratz-subtitle,
#generic-d10-overlay .ratz-subtitle {
  position: absolute;
  top: calc(15% + 2.8rem);
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  color: rgba(255, 100, 140, 0.75);
  letter-spacing: 0.06em;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}

#ratzinger-dice-overlay .ratz-hint,
#kamui-dodge-overlay .ratz-hint,
.kamui-dodge-overlay .ratz-hint,
#generic-2d6-overlay .ratz-hint,
#generic-d10-overlay .ratz-hint {
  position: absolute;
  bottom: 3%;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #fbbf24;
  letter-spacing: 0.04em;
  background: rgba(0, 0, 0, 0.85);
  padding: 8px 24px;
  border-radius: 20px;
  border: 1px solid rgba(251, 191, 36, 0.5);
  z-index: 100;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
  animation: ratz-hint-blink 1s ease-in-out infinite;
  cursor: pointer;
}

@keyframes ratz-hint-blink {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; color: rgba(255, 100, 140, 0.9); }
}

/* Dado D20 do Ratzinger e Dados D6/D10 genéricos */
#ratzinger-d20,
.ratz-d6-die,
#finn-d10 {
  width: 140px;
  height: 140px;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: ratz-dice-float 2.2s ease-in-out infinite;
  user-select: none;
}

#ratzinger-d20 {
  width: 180px;
  height: 180px;
}

#ratzinger-d20:hover,
.ratz-d6-die:hover,
#finn-d10:hover {
  transform: scale(1.1) !important;
}

#ratzinger-d20.rolling,
.ratz-d6-die.rolling,
#finn-d10.rolling {
  animation: ratz-dice-roll 1.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  cursor: default;
  pointer-events: none;
}

@keyframes ratz-dice-roll {
  0%   { transform: translateX(0) translateY(0) rotate(0deg) scale(1); }
  10%  { transform: translateX(100px) translateY(-70px) rotate(100deg) scale(1.1); }
  25%  { transform: translateX(-80px) translateY(-50px) rotate(-200deg) scale(0.9); }
  40%  { transform: translateX(70px) translateY(40px) rotate(300deg) scale(1.05); }
  55%  { transform: translateX(-50px) translateY(-30px) rotate(-400deg) scale(0.95); }
  70%  { transform: translateX(30px) translateY(15px) rotate(500deg) scale(1.02); }
  85%  { transform: translateX(-10px) translateY(-8px) rotate(520deg) scale(0.99); }
  100% { transform: translateX(0) translateY(0) rotate(720deg) scale(1); }
}

#ratzinger-d20 svg {
  width: 180px;
  height: 180px;
  filter: drop-shadow(0 0 25px rgba(255, 32, 96, 0.8));
}

@keyframes ratz-dice-float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  30% { transform: translateY(-16px) rotate(-4deg); }
  70% { transform: translateY(-8px) rotate(3deg); }
}

/* Resultado do dado Ratzinger */
#ratzinger-dice-result {
  position: absolute;
  bottom: 12%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  width: 90%;
  max-width: 1000px;
  white-space: normal;
  padding: 1rem;
}

#ratzinger-dice-result.show-sun {
  animation: ratz-result-sun 0.5s ease-out 1.4s forwards;
}

#ratzinger-dice-result.show-skull {
  animation: ratz-result-skull 0.5s ease-out 1.4s forwards;
}

@keyframes ratz-result-sun {
  0%  { opacity: 0; transform: translateX(-50%) scale(0.4); }
  70% { opacity: 1; transform: translateX(-50%) scale(1.1); }
  100% { opacity: 1; transform: translateX(-50%) scale(1); }
}

@keyframes ratz-result-skull {
  0%  { opacity: 0; transform: translateX(-50%) scale(0.4) rotate(-10deg); }
  40% { opacity: 1; transform: translateX(-50%) scale(1.4) rotate(5deg); }
  70% { transform: translateX(-50%) scale(0.9) rotate(-2deg); }
  100% { opacity: 1; transform: translateX(-50%) scale(1) rotate(0deg); }
}

#ratzinger-dice-result .result-label {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  display: block;
  margin-top: 8px;
}

#ratzinger-dice-result.show-sun .result-label {
  color: #ffd700;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

#ratzinger-dice-result.show-skull .result-label {
  color: #ef4444;
  text-shadow: 0 0 20px rgba(239, 68, 68, 0.8);
}

/* Efeito de morte instantânea: tela tremendo */
@keyframes ratz-screen-shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-10px) rotate(-1deg); }
  30% { transform: translateX(10px) rotate(1deg); }
  45% { transform: translateX(-8px) rotate(-0.5deg); }
  60% { transform: translateX(8px) rotate(0.5deg); }
  75% { transform: translateX(-4px); }
  90% { transform: translateX(4px); }
}

body.ratz-screen-shake {
  animation: ratz-screen-shake 0.5s ease-in-out;
}

/* Flash vermelho de morte */
#ratz-death-flash {
  position: fixed;
  inset: 0;
  background: rgba(255, 0, 60, 0.6);
  z-index: 9500;
  pointer-events: none;
  animation: ratz-flash-out 0.8s ease-out forwards;
}

@keyframes ratz-flash-out {
  0%  { opacity: 1; }
  100% { opacity: 0; }
}


.sprite-container.idle {
  animation: none !important;
}

.sprite-container.animate-attack {
  animation: character-attack 0.4s ease-in-out forwards;
}

@keyframes character-attack {
  0% { transform: scale(1) translateX(0); }
  30% { transform: scale(1.1) translateX(-30px); }
  100% { transform: scale(1) translateX(0); }
}

/* Inversão para o jogador atacar para a direita */
.player-wrapper .sprite-container.animate-attack {
  animation: character-attack-player 0.4s ease-in-out forwards;
}

@keyframes character-attack-player {
  0% { transform: scale(1) translateX(0); }
  30% { transform: scale(1.1) translateX(30px); }
  100% { transform: scale(1) translateX(0); }
}

.sprite-container.animate-hurt {
  animation: character-hurt 0.3s ease-in-out forwards;
}

/* Hit-Stop / Impact Freeze */
.hit-stop {
  animation-play-state: paused !important;
  transform: scale(0.96) !important;
  filter: brightness(2.2) contrast(1.5) drop-shadow(0 0 16px rgba(255, 255, 255, 0.95)) !important;
}

/* Flash de Dano Branco Instantâneo (Action Game Juice) */
.damage-flash-white {
  animation: damage-flash-white-anim 0.28s cubic-bezier(0.18, 0.89, 0.32, 1) forwards !important;
}

@keyframes damage-flash-white-anim {
  0% {
    filter: brightness(0) invert(1) drop-shadow(0 0 16px rgba(255, 255, 255, 0.95));
  }
  25% {
    filter: brightness(2.6) contrast(1.6) drop-shadow(0 0 12px rgba(239, 68, 68, 0.9));
  }
  60% {
    filter: brightness(1.25) sepia(0.5) saturate(3) hue-rotate(-50deg);
  }
  100% {
    filter: brightness(1) contrast(1) sepia(0) saturate(1) hue-rotate(0deg);
  }
}

/* Knockback Elástico Direcional do Inimigo (recuo para direita) */
.knockback-enemy {
  animation: knockback-enemy-anim 0.32s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards !important;
}

.knockback-enemy.heavy {
  animation: knockback-enemy-heavy-anim 0.42s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards !important;
}

@keyframes knockback-enemy-anim {
  0% { transform: translateX(0) scale(1) skewX(0); }
  22% { transform: translateX(20px) scale(0.96) skewX(-4deg); }
  52% { transform: translateX(-5px) scale(1.02) skewX(1deg); }
  78% { transform: translateX(2px) scale(0.99); }
  100% { transform: translateX(0) scale(1) skewX(0); }
}

@keyframes knockback-enemy-heavy-anim {
  0% { transform: translateX(0) scale(1) skewX(0); }
  20% { transform: translateX(36px) scale(0.92) skewX(-7deg); }
  48% { transform: translateX(-8px) scale(1.04) skewX(2deg); }
  74% { transform: translateX(3px) scale(0.99); }
  100% { transform: translateX(0) scale(1) skewX(0); }
}

/* Knockback Elástico Direcional do Jogador / Aliado (recuo para esquerda) */
.knockback-player {
  animation: knockback-player-anim 0.32s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards !important;
}

.knockback-player.heavy {
  animation: knockback-player-heavy-anim 0.42s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards !important;
}

@keyframes knockback-player-anim {
  0% { transform: translateX(0) scale(1) skewX(0); }
  22% { transform: translateX(-20px) scale(0.96) skewX(4deg); }
  52% { transform: translateX(5px) scale(1.02) skewX(-1deg); }
  78% { transform: translateX(-2px) scale(0.99); }
  100% { transform: translateX(0) scale(1) skewX(0); }
}

@keyframes knockback-player-heavy-anim {
  0% { transform: translateX(0) scale(1) skewX(0); }
  20% { transform: translateX(-36px) scale(0.92) skewX(7deg); }
  48% { transform: translateX(8px) scale(1.04) skewX(-2deg); }
  74% { transform: translateX(-3px) scale(0.99); }
  100% { transform: translateX(0) scale(1) skewX(0); }
}

@keyframes character-hurt {
  0% { transform: translateX(0); filter: brightness(0) invert(1); }
  25% { transform: translateX(-12px); filter: brightness(2) contrast(1.5) drop-shadow(0 0 10px rgba(239, 68, 68, 0.8)); }
  50% { transform: translateX(8px); filter: brightness(1.2) sepia(0.5) saturate(3) hue-rotate(-50deg); }
  75% { transform: translateX(-4px); }
  100% { transform: translateX(0); filter: none; }
}

/* Painel de Informações de Vida / Escudo */
.combatant-info {
  width: 100%;
  max-width: 260px;
  box-sizing: border-box;
  padding: 0 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.name-tag {
  font-size: 0.95rem;
  text-align: center;
  margin-bottom: 5px;
  height: 1.4rem;
  line-height: 1.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.hp-bar-container {
  width: 100%;
  height: 16px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  position: relative;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.hp-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 8px;
  transition: width 0.3s ease-out;
}

.hp-text {
  position: absolute;
  left: 0;
  width: 100%;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  text-shadow: 1px 1px 2px black;
  pointer-events: none;
}

.block-value {
  position: absolute;
  left: -15px;
  top: -6px;
  background: var(--defense);
  border: 2px solid white;
  color: white;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  box-shadow: 0 0 10px var(--defense-glow);
  z-index: 3;
}

/* Status Effects List */
.status-list {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
  justify-content: center;
  min-height: 24px;
  align-items: center;
  max-width: 100%;
}

.status-icon {
  font-size: 0.75rem;
  background: rgba(0, 0, 0, 0.6);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  position: relative;
}

.status-icon:hover::after {
  content: attr(data-desc);
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--primary);
  font-size: 0.7rem;
  width: 120px;
  text-align: center;
  z-index: 10;
  white-space: normal;
}

/* Intenção do Inimigo */
.enemy-intent {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.9);
  border: 1.5px solid rgba(0, 210, 255, 0.4);
  border-radius: 8px;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 25;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 10px rgba(0, 210, 255, 0.2);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  animation: bounce 2s infinite;
}

.enemy-intent:hover {
  border-color: #00d2ff;
  box-shadow: 0 4px 15px rgba(0, 210, 255, 0.5);
  transform: translateX(-50%) scale(1.1);
}

.enemy-intent-icon {
  font-size: 1.15rem;
}

@keyframes bounce {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, -6px); }
}

/* Card Pop-up Destacado de Intenção do Inimigo (Sobre o Adversário) */
.enemy-intent-popup {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 88%;
  max-width: 250px;
  background: rgba(8, 14, 28, 0.78);
  backdrop-filter: blur(8px);
  border: 1.5px solid rgba(0, 210, 255, 0.75);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 210, 255, 0.35);
  color: #f8fafc;
  z-index: 500;
  pointer-events: none;
  animation: popupFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popupFadeIn {
  from { opacity: 0; transform: translate(-50%, -45%) scale(0.92); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.intent-popup-header {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.intent-popup-icon {
  font-size: 1.6rem;
  filter: drop-shadow(0 0 8px rgba(0, 210, 255, 0.8));
}

.intent-popup-titles {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.intent-popup-enemy-name {
  font-size: 0.72rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.intent-popup-action-name {
  font-size: 0.98rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
}

.intent-popup-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.intent-popup-badge.attack { background: #7f1d1d; color: #fecaca; border: 1px solid #ef4444; }
.intent-popup-badge.defend { background: #1e3a8a; color: #bfdbfe; border: 1px solid #60a5fa; }
.intent-popup-badge.debuff { background: #713f12; color: #fef08a; border: 1px solid #eab308; }
.intent-popup-badge.veriko { background: #831843; color: #fbcfe8; border: 1px solid #f472b6; }

.intent-popup-body {
  font-size: 0.85rem;
  line-height: 1.4;
  color: #cbd5e1;
}

.intent-popup-stat {
  font-size: 0.95rem;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 4px;
}

.intent-popup-desc {
  margin: 0;
  font-size: 0.82rem;
}

/* Layer de Mira / Linha de Energia Luminosa */
.targeting-svg-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 999999;
}

.energy-beam-pulse {
  animation: energyFlow 0.5s linear infinite;
}

@keyframes energyFlow {
  from { stroke-dashoffset: 30; }
  to { stroke-dashoffset: 0; }
}

.reticle-ring-pulse {
  animation: reticlePulse 1.2s ease-in-out infinite alternate;
}

@keyframes reticlePulse {
  0% { transform: scale(0.85); opacity: 0.75; }
  100% { transform: scale(1.15); opacity: 1; filter: drop-shadow(0 0 12px #00d2ff); }
}

.targeted-enemy-aura {
  /* Remove a caixa retangular azul de luz no entorno do inimigo durante a mira */
  box-shadow: none !important;
  border: none !important;
  border-color: transparent !important;
  outline: none !important;
  transform: none !important;
}

/* Botão Badge de Log no Herói (Espelhado ao do Adversário) */
.hero-log-btn {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.9);
  border: 1.5px solid rgba(56, 189, 248, 0.6);
  border-radius: 8px;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #f8fafc;
  cursor: pointer;
  z-index: 25;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 10px rgba(56, 189, 248, 0.2);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  animation: bounce 2s infinite;
}

.hero-log-btn:hover {
  border-color: #38bdf8;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.5);
  transform: translateX(-50%) scale(1.08);
}

/* Header de Prestígio e Identificação acima da cabeça dos combatentes (Modo Ranqueado Online) */
.combatant-header-prestige {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 100%;
  max-width: 260px;
  margin-bottom: 4px;
  pointer-events: none;
  z-index: 20;
}

.combatant-header-prestige .arena-prestige-title-tag {
  margin: 0;
  max-width: 100%;
}

.combatant-header-prestige .arena-echo-base-hero-tag {
  margin: 0;
  max-width: 100%;
}

.combatant-header-prestige .name-tag {
  margin-bottom: 0;
  height: auto;
  line-height: 1.2;
}

/* Overlay do Log de Combate sobre o Herói */
.combat-log-container.hero-log-popup {
  position: absolute !important;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 380px;
  max-width: 92vw;
  height: 82%;
  max-height: 320px;
  background: rgba(8, 14, 28, 0.88) !important;
  backdrop-filter: blur(12px);
  border: 1.5px solid rgba(56, 189, 248, 0.75) !important;
  border-radius: 14px;
  padding: 14px 18px;
  overflow-y: auto;
  z-index: 500;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.85), 0 0 20px rgba(56, 189, 248, 0.35);
  opacity: 1 !important;
  box-sizing: border-box;
}

/* ==========================================================================
   CAMERA JUICE / SCREEN SHAKE
   ========================================================================== */
.screen-shake-light {
  animation: screen-shake-light-anim 0.2s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.screen-shake-heavy {
  animation: screen-shake-heavy-anim 0.35s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.screen-chromatic-aberration {
  animation: screen-chromatic-anim 0.35s ease-out both;
}

@keyframes screen-shake-light-anim {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-4px, 3px); }
  40% { transform: translate(4px, -3px); }
  60% { transform: translate(-3px, -2px); }
  80% { transform: translate(3px, 2px); }
  100% { transform: translate(0, 0); }
}

@keyframes screen-shake-heavy-anim {
  0% { transform: translate(0, 0) rotate(0deg); }
  15% { transform: translate(-8px, 6px) rotate(-0.5deg); }
  30% { transform: translate(8px, -6px) rotate(0.5deg); }
  45% { transform: translate(-6px, -4px) rotate(-0.3deg); }
  60% { transform: translate(6px, 4px) rotate(0.2deg); }
  75% { transform: translate(-3px, 2px) rotate(0deg); }
  90% { transform: translate(2px, -1px); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes screen-chromatic-anim {
  0% {
    filter: drop-shadow(-4px 0 0 rgba(239, 68, 68, 0.65)) drop-shadow(4px 0 0 rgba(56, 189, 248, 0.65));
  }
  50% {
    filter: drop-shadow(-2px 0 0 rgba(239, 68, 68, 0.35)) drop-shadow(2px 0 0 rgba(56, 189, 248, 0.35));
  }
  100% {
    filter: none;
  }
}

/* Camera Punch Direcional de Arena */
.battle-arena {
  /* transitions handled via keyframe animations */
}

.camera-punch-heavy {
  animation: camera-punch-heavy-anim 0.35s cubic-bezier(0.18, 0.89, 0.32, 1.25) both !important;
}

.camera-punch-critical {
  animation: camera-punch-critical-anim 0.42s cubic-bezier(0.18, 0.89, 0.32, 1.35) both !important;
}

.camera-punch-impact {
  animation: camera-punch-impact-anim 0.28s cubic-bezier(0.18, 0.89, 0.32, 1.2) both !important;
}

@keyframes camera-punch-impact-anim {
  0% { transform: scale(1); }
  30% { transform: scale(1.035); }
  100% { transform: scale(1); }
}

@keyframes camera-punch-heavy-anim {
  0% { transform: scale(1); }
  28% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

@keyframes camera-punch-critical-anim {
  0% { transform: scale(1); }
  25% { transform: scale(1.09); filter: contrast(1.1); }
  100% { transform: scale(1); filter: none; }
}

/* Efeito de Jackpot Pop nos contadores de recompensa (Slot Machine Feel) */
.jackpot-pop {
  animation: jackpot-scale-anim 0.38s cubic-bezier(0.18, 0.89, 0.32, 1.45) forwards;
}

@keyframes jackpot-scale-anim {
  0% { transform: scale(1); }
  45% { transform: scale(1.35); color: #fde047; text-shadow: 0 0 14px rgba(253, 224, 71, 0.95); }
  100% { transform: scale(1); }
}

/* Sunburst Giratório de Vitória (Slot Machine Feel) */
.victory-sunburst-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 750px;
  height: 750px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(251, 191, 36, 0.16) 0%, rgba(245, 158, 11, 0.05) 50%, transparent 72%);
  pointer-events: none;
  z-index: 0;
  animation: sunburst-rotate 22s linear infinite;
}

@keyframes sunburst-rotate {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ==========================================================================
   DANO / TEXTO FLUTUANTE (PARABÓLICO & CRÍTICO)
   ========================================================================== */
#floating-text-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 500;
}

.floating-text {
  position: absolute;
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 2.2rem;
  animation: floatParabolic 1.15s cubic-bezier(0.18, 0.89, 0.32, 1) forwards;
  text-shadow: 0 2px 4px rgba(0,0,0,0.9), 0 0 10px rgba(0,0,0,0.8);
  white-space: nowrap;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  will-change: transform, opacity;
}

.floating-text.damage {
  color: #ff385c;
  text-shadow: 0 0 14px rgba(255, 56, 92, 0.85), 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000;
}

.floating-text.critical {
  font-size: 2.8rem;
  color: #fbbf24;
  text-shadow: 0 0 20px rgba(245, 158, 11, 0.95), 0 0 8px #dc2626, 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000;
  z-index: 550;
}

.floating-badge-crit {
  display: block;
  font-size: 0.85rem;
  letter-spacing: 2.5px;
  color: #fef08a;
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.9), 1px 1px 0 #000;
  text-transform: uppercase;
  font-weight: 900;
  background: linear-gradient(135deg, rgba(185, 28, 28, 0.9), rgba(120, 53, 15, 0.9));
  border: 1px solid rgba(251, 191, 36, 0.7);
  padding: 1px 8px;
  border-radius: 4px;
  margin-bottom: 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}

.floating-badge-combo {
  display: block;
  font-size: 0.82rem;
  letter-spacing: 2px;
  color: #38bdf8;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.95), 1px 1px 0 #000;
  text-transform: uppercase;
  font-weight: 900;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.9), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(56, 189, 248, 0.7);
  padding: 1px 8px;
  border-radius: 4px;
  margin-bottom: 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
  animation: combo-badge-pop 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.35) forwards;
}

@keyframes combo-badge-pop {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* Flying Loot Magnet (Vampire Survivors Loop) */
.flying-loot-item {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  font-size: 1.6rem;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.9));
  will-change: transform, opacity;
}

.flying-loot-hope {
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.95));
}

.hud-pulse {
  animation: hud-item-pulse-anim 0.28s cubic-bezier(0.18, 0.89, 0.32, 1.45) forwards !important;
}

@keyframes hud-item-pulse-anim {
  0% { transform: scale(1); }
  50% { transform: scale(1.25); color: #fde047; text-shadow: 0 0 10px rgba(253, 224, 71, 0.9); }
  100% { transform: scale(1); }
}

.floating-text.block-gain {
  color: #38bdf8;
  text-shadow: 0 0 14px rgba(56, 189, 248, 0.85), 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000;
}

.floating-text.heal {
  color: #4ade80;
  text-shadow: 0 0 14px rgba(74, 222, 128, 0.85), 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000;
}

.floating-text.buff {
  color: #facc15;
  text-shadow: 0 0 14px rgba(250, 204, 21, 0.85), 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000;
}

@keyframes floatParabolic {
  0% {
    transform: translate(0, 0) scale(0.35);
    opacity: 0.1;
  }
  15% {
    transform: translate(calc(var(--drift-x, 0px) * 0.35), -35px) scale(1.35);
    opacity: 1;
  }
  30% {
    transform: translate(calc(var(--drift-x, 0px) * 0.65), -52px) scale(1.05);
    opacity: 1;
  }
  70% {
    transform: translate(var(--drift-x, 0px), -68px) scale(0.98);
    opacity: 0.92;
  }
  100% {
    transform: translate(calc(var(--drift-x, 0px) * 1.25), -38px) scale(0.85);
    opacity: 0;
  }
}

/* ==========================================================================
   MÃO E CONTROLES DE BATALHA
   ========================================================================== */
.battle-controls-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.2vh, 12px);
  flex-shrink: 0;
  z-index: 20;
}

.battle-stats-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 2.8vw, 34px);
  margin-bottom: clamp(10px, 1.8vh, 18px);
  position: relative;
  z-index: 35;
}

/* Energia / Momentum Orb */
.energy-orb-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.energy-orb {
  width: clamp(52px, 6vh, 62px);
  height: clamp(52px, 6vh, 62px);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #f59e0b 0%, #d97706 70%, #78350f 100%);
  box-shadow: 0 0 20px var(--warning-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-weight: 800;
  font-size: clamp(1.25rem, 2vh, 1.55rem);
  color: white;
  border: 2px solid white;
}

.energy-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--warning);
  letter-spacing: 1px;
}

.card-pile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  position: relative;
  cursor: pointer;
}

.card-pile:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
}

.pile-icon {
  width: 100%;
  height: 100%;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pile-icon-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  vertical-align: middle;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.7));
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card-pile:hover .pile-icon-img {
  transform: scale(1.12);
}

/* Tooltip Customizada */
.tooltip-target {
  position: relative;
  cursor: pointer;
}

.tooltip-target::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background: rgba(15, 23, 42, 0.95);
  color: #f8fafc;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.72rem;
  line-height: 1.4;
  width: 230px;
  text-align: center;
  border: 1px solid rgba(168, 85, 247, 0.5);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
  font-weight: 500;
}

.tooltip-target::before {
  content: "";
  position: absolute;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: rgba(168, 85, 247, 0.5) transparent transparent transparent;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
}

.tooltip-target:hover::after,
.tooltip-target:active::after,
.tooltip-target:focus::after,
.tooltip-target:focus-within::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.tooltip-target:hover::before,
.tooltip-target:active::before,
.tooltip-target:focus::before,
.tooltip-target:focus-within::before {
  opacity: 1;
}

.merchant-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255, 215, 0, 0.15);
  color: #ffd700;
  border: 1px solid rgba(255, 215, 0, 0.4);
}

.merchant-gold-chip {
  font-size: 0.9rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pile-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  border: 1px solid white;
}

.btn-end-turn {
  padding: 10px 24px;
}

/* MÃO DE CARTAS */
.hand-container {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: clamp(190px, 26vh, 245px);
  padding: 0 16px 20px 16px;
  position: relative;
  overflow: visible;
}

/* CARTAS DESIGN */
.card {
  width: var(--card-w);
  height: var(--card-h);
  background: rgba(15, 23, 42, 0.95); /* Opaque high-contrast background */
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.12); /* Default common border */
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  cursor: grab;
  transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1), border-color 0.25s, box-shadow 0.25s;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.55), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  margin: 0 var(--card-overlap);
  transform-origin: bottom center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  -webkit-font-smoothing: subpixel-antialiased;
  transform: translateZ(0);
}

/* Remove negative margin when in grid (compendium or selection) */
.deck-grid .card {
  margin: 0;
}

.card:hover {
  transform: translateY(-35px) scale(1.22) translateZ(0) rotate(0deg) !important;
  border-color: #fbbf24; /* Golden glow on hover */
  box-shadow: 
    0 15px 30px rgba(0, 0, 0, 0.7), 
    0 0 20px rgba(251, 191, 36, 0.4);
  z-index: 999 !important;
  cursor: pointer;
}

/* Molduras e Cores de Fundo Especiais por Raridade com Cantos Arredondados */
.card[data-rarity="comum"] {
  border: 1.5px solid rgba(148, 163, 184, 0.35); /* Slate gray frame */
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.85); /* Azul escuro padrao */
}
.card[data-rarity="comum"]:hover {
  border-color: #38bdf8 !important; /* Glow azul-celeste */
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.7), 0 0 20px rgba(56, 189, 248, 0.55);
}

.card[data-rarity="incomum"] {
  border: 1.5px solid rgba(16, 185, 129, 0.4); /* Green border */
  border-radius: 12px;
  background: rgba(20, 42, 28, 0.88); /* Verde musgo escuro */
  box-shadow: 0 5px 15px rgba(16, 185, 129, 0.12), 0 10px 25px rgba(0, 0, 0, 0.55);
}
.card[data-rarity="incomum"] .card-name {
  color: #a7f3d0 !important; /* Soft mint title */
}
.card[data-rarity="incomum"]:hover {
  border-color: #34d399 !important; /* Glow verde esmeralda */
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.7), 0 0 20px rgba(52, 211, 153, 0.5);
}

.card[data-rarity="exclusiva"],
.card[data-rarity="exclusivo"] {
  border: 2px solid transparent;
  border-radius: 12px;
  background: 
    linear-gradient(135deg, #031326 0%, #0c2d48 50%, #02101e 100%) padding-box,
    linear-gradient(135deg, #e0f2fe 0%, #38bdf8 35%, #0284c7 70%, #0369a1 100%) border-box;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.45), 0 10px 25px rgba(0, 0, 0, 0.65);
}

.card[data-rarity="exclusiva"] .card-name,
.card[data-rarity="exclusivo"] .card-name {
  color: #e0f2fe !important; /* Titulo em azul claro brilhante */
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.85); /* Brilho ciano */
}

.card[data-rarity="exclusiva"]:hover,
.card[data-rarity="exclusivo"]:hover {
  background: 
    linear-gradient(135deg, #031326 0%, #0c2d48 50%, #02101e 100%) padding-box,
    linear-gradient(135deg, #ffffff 0%, #7dd3fc 40%, #38bdf8 100%) border-box;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.75), 0 0 25px rgba(56, 189, 248, 0.75);
}

.card[data-rarity="rara"],
.card[data-rarity="raro"] {
  border: 2px solid transparent;
  border-radius: 12px;
  background: 
    linear-gradient(135deg, #120324 0%, #2e0854 50%, #090214 100%) padding-box,
    linear-gradient(135deg, #d8b4fe 0%, #a855f7 35%, #7e22ce 70%, #4c1d95 100%) border-box;
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.35), 0 10px 25px rgba(0, 0, 0, 0.65);
}

.card[data-rarity="rara"] .card-name,
.card[data-rarity="raro"] .card-name {
  color: #f3e8ff !important; /* Titulo em roxo claro brilhante */
  text-shadow: 0 0 8px rgba(216, 180, 254, 0.75); /* Brilho ametista */
}
.card[data-rarity="rara"]:hover,
.card[data-rarity="raro"]:hover {
  background: 
    linear-gradient(135deg, #120324 0%, #2e0854 50%, #090214 100%) padding-box,
    linear-gradient(135deg, #f3e8ff 0%, #d8b4fe 50%, #a855f7 100%) border-box;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.75), 0 0 25px rgba(168, 85, 247, 0.55);
}

/* Moldura, fundo dourado com animacao de estrelas cintilantes para cartas Lendarias */
.card.type-veriko,
.card[data-rarity="lendaria"],
.card[data-rarity="lendario"] {
  border: 2px solid transparent;
  border-radius: 12px;
  background: 
    linear-gradient(135deg, #78350f 0%, #d97706 35%, #fbbf24 50%, #d97706 65%, #78350f 100%) padding-box,
    linear-gradient(135deg, #bf953f 0%, #fcf6ba 25%, #b38728 50%, #fbf5b7 75%, #aa771c 100%) border-box;
  box-shadow: 
    0 0 15px rgba(251, 191, 36, 0.45),
    0 10px 25px rgba(0, 0, 0, 0.55);
  animation: star-sparkle 5s ease infinite alternate;
}

.card.type-veriko .card-name,
.card[data-rarity="lendaria"] .card-name {
  color: #fffbeb !important; /* Goldenish white title */
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.85);
}
.card[data-rarity="lendaria"]:hover,
.card.type-veriko:hover {
  background: 
    linear-gradient(135deg, #78350f 0%, #d97706 35%, #fbbf24 50%, #d97706 65%, #78350f 100%) padding-box,
    linear-gradient(135deg, #ffffff 0%, #fbbf24 50%, #d97706 100%) border-box;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.75), 0 0 25px rgba(251, 191, 36, 0.65);
}

@keyframes star-sparkle {
  0% {
    background-position: 0px 0px, 0px 0px, 0px 0px, 0px 0px, 0px 0px, 0% 0%;
    filter: brightness(0.95) contrast(1);
  }
  50% {
    filter: brightness(1.12) contrast(1.1);
  }
  100% {
    background-position: 3px -5px, -4px 6px, 5px -3px, -6px 4px, 4px -4px, 100% 100%;
    filter: brightness(0.95) contrast(1);
  }
}

.card.upgraded {
  border: 2px dashed #38bdf8; /* Cyan dotted light for upgraded */
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25), 0 10px 25px rgba(0, 0, 0, 0.55);
}

.card.upgraded .card-name {
  color: #38bdf8 !important; /* Cyan title for upgraded cards */
}

/* ========================================================
   CARTAS FRAGMENTADAS (FOIL HOLOGRÁFICO COM RACHADURAS)
   ======================================================== */
.card.fragmented {
  position: relative;
  border: 2px solid transparent !important;
  border-radius: 12px;
  background-clip: padding-box, border-box;
  background-origin: padding-box, border-box;
  background-image: 
    linear-gradient(135deg, rgba(15, 23, 42, 0.92) 0%, rgba(30, 27, 75, 0.95) 100%),
    linear-gradient(135deg, #ff0055, #ff9900, #ffee00, #00ff66, #00ffff, #0066ff, #9900ff, #ff00aa, #ff0055) !important;
  box-shadow: 
    0 0 15px rgba(255, 255, 255, 0.8),
    0 0 30px rgba(168, 85, 247, 0.7),
    0 0 45px rgba(56, 189, 248, 0.5),
    inset 0 0 12px rgba(255, 255, 255, 0.3) !important;
  animation: foil-rainbow-glow 4s linear infinite;
  overflow: visible !important;
}

@keyframes foil-rainbow-glow {
  0% { filter: drop-shadow(0 0 6px rgba(255, 0, 128, 0.6)); }
  25% { filter: drop-shadow(0 0 8px rgba(0, 255, 200, 0.6)); }
  50% { filter: drop-shadow(0 0 10px rgba(255, 230, 0, 0.7)); }
  75% { filter: drop-shadow(0 0 8px rgba(160, 32, 240, 0.6)); }
  100% { filter: drop-shadow(0 0 6px rgba(255, 0, 128, 0.6)); }
}

/* Camada Foil Holográfico Arco-Íris que reflete sobre a carta */
.card.fragmented::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: 
    linear-gradient(115deg, 
      transparent 0%, 
      rgba(255, 0, 128, 0.18) 18%, 
      rgba(255, 200, 0, 0.22) 32%, 
      rgba(0, 255, 200, 0.25) 48%, 
      rgba(0, 150, 255, 0.22) 65%, 
      rgba(180, 0, 255, 0.2) 82%, 
      transparent 100%
    );
  background-size: 200% 200%;
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 2;
  animation: foil-shimmer 3s ease-in-out infinite alternate;
}

@keyframes foil-shimmer {
  0% { opacity: 0.65; background-position: 0% 50%; }
  100% { opacity: 1; background-position: 100% 50%; }
}

/* Rachaduras Místicas de Cristal na composição (Fragmentada) */
.card.fragmented::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='300' viewBox='0 0 200 300'%3E%3Cpath d='M20,0 L65,70 L40,130 L110,180 L80,240 L130,300 M65,70 L140,55 L175,110 L110,180 M140,55 L200,30 M40,130 L0,160 M110,180 L160,220 L200,210 M80,240 L30,270 L0,290' fill='none' stroke='rgba(255,255,255,0.75)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' filter='drop-shadow(0 0 3px %2300ffff)'/%3E%3Cpath d='M65,70 L95,115 L140,55 M110,180 L125,235 L80,240' fill='none' stroke='rgba(255,235,150,0.85)' stroke-width='1' stroke-linecap='round' stroke-linejoin='round' filter='drop-shadow(0 0 2px %23ff00aa)'/%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 3;
  opacity: 0.85;
}

/* Badge de custo com brilho prismático em carta fragmentada */
.card.fragmented .card-cost {
  position: absolute;
  top: -8px;
  right: -8px;
  z-index: 30 !important;
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 50%, #06b6d4 100%) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  border: 2px solid #ffffff !important;
  box-shadow: 0 0 10px #38bdf8, 0 0 16px #ec4899, 0 2px 4px rgba(0, 0, 0, 0.5) !important;
}

/* Selo de estrela prismática no compêndio e na carta */
.fragmented-star-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fde047;
  font-size: 1.15rem;
  margin-left: 6px;
  filter: drop-shadow(0 0 6px #f59e0b) drop-shadow(0 0 12px #ec4899);
  animation: star-spin-pulse 2.5s infinite ease-in-out;
  cursor: help;
}

@keyframes star-spin-pulse {
  0% { transform: scale(0.9) rotate(0deg); filter: drop-shadow(0 0 4px #fbbf24); }
  50% { transform: scale(1.25) rotate(15deg); filter: drop-shadow(0 0 10px #ec4899) drop-shadow(0 0 15px #38bdf8); }
  100% { transform: scale(0.9) rotate(0deg); filter: drop-shadow(0 0 4px #fbbf24); }
}

/* Badge de custo da carta (Gema de Momentum) */
.card-cost {
  position: absolute;
  top: -8px;
  right: -8px;
  width: var(--card-cost-size);
  height: var(--card-cost-size);
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%); /* Gold/amber energy orb */
  color: #0f172a;
  font-weight: 800;
  font-size: var(--card-cost-font);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.6), 0 2px 4px rgba(0,0,0,0.4);
  z-index: 25;
}

.card-cost.star-cost-badge {
  background: radial-gradient(circle, #fef08a 0%, #ca8a04 100%) !important;
  color: #1e293b !important;
  border: none !important;
  border-radius: 0 !important;
  clip-path: polygon(50% 0%, 65% 35%, 100% 35%, 75% 55%, 85% 95%, 50% 70%, 15% 95%, 25% 55%, 0% 35%, 35% 35%) !important;
  box-shadow: none !important;
  filter: drop-shadow(0 0 5px rgba(234, 179, 8, 0.7)) drop-shadow(0 2px 4px rgba(0,0,0,0.4));
  font-size: calc(var(--card-cost-font) * 1.2); /* slightly larger for readability */
}

/* Cartas sem Momentum suficiente / Inacessíveis */
.card.unaffordable {
  filter: brightness(0.65) saturate(0.6);
  opacity: 0.85;
}

.card.unaffordable:hover {
  filter: brightness(0.8) saturate(0.75);
}

.card.unaffordable .card-cost {
  background: linear-gradient(135deg, #ef4444 0%, #991b1b 100%) !important;
  border-color: #fca5a5 !important;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.8), 0 2px 4px rgba(0, 0, 0, 0.4) !important;
}

@keyframes cardShakeAnim {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.card.card-shake {
  animation: cardShakeAnim 0.3s ease-in-out !important;
}

.stars-orb-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-left: 15px;
}

.stars-orb {
  width: 55px;
  height: 55px;
  border-radius: 0;
  background: radial-gradient(circle, #fef08a 0%, #ca8a04 100%);
  border: none;
  box-shadow: none;
  filter: drop-shadow(0 0 10px rgba(234, 179, 8, 0.7));
  clip-path: polygon(50% 0%, 65% 35%, 100% 35%, 75% 55%, 85% 95%, 50% 70%, 15% 95%, 25% 55%, 0% 35%, 35% 35%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.3rem;
  color: #1e293b;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.4);
}

.stars-label {
  font-size: 0.60rem;
  font-weight: 700;
  color: #ca8a04;
  margin-top: 4px;
  letter-spacing: 0.05em;
  text-shadow: 0 0 5px rgba(234, 179, 8, 0.3);
}

.card-name {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: var(--card-font-name);
  margin-top: 2px;
  text-align: center;
  line-height: 1.1;
  color: #f1f5f9;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  letter-spacing: 0.5px;
}

/* MOLDURA DA ARTE DA CARTA (CARD ART FRAME) */
.card-art {
  height: var(--card-art-h);
  min-height: 38px;
  max-height: 125px;
  flex-shrink: 1;
  width: 100%;
  border-radius: 6px;
  margin: 4px 0;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255, 255, 255, 0.15); /* Elegant inner frame border */
  box-shadow: 
    inset 0 0 15px rgba(0,0,0,0.85),
    0 2px 5px rgba(0,0,0,0.4);
  position: relative;
  overflow: hidden;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: high-quality;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
}

/* Adiciona um efeito reflexivo diagonal por cima da arte */
.card-art::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-25deg);
  transition: 0.75s;
  pointer-events: none;
}

.card:hover .card-art::after {
  left: 200%;
}

/* Fallback de Arte de Cartas por Classe/Tipo */
.card.type-ataque .card-art {
  background-image: var(--card-img, none), radial-gradient(circle, #7f1d1d 0%, #3f0f15 100%);
}
.card.type-defesa .card-art {
  background-image: var(--card-img, none), radial-gradient(circle, #1e3a8a 0%, #0f1c4a 100%);
}
.card.type-suporte .card-art {
  background-image: var(--card-img, none), radial-gradient(circle, #065f46 0%, #022f28 100%);
}
.card.type-caos .card-art {
  background-image: var(--card-img, none), radial-gradient(circle, #581c87 0%, #2e0854 100%);
}
.card.type-veriko .card-art {
  background-image: var(--card-img, none), radial-gradient(circle, #db2777 0%, #4d0a30 100%);
}
.card.type-efeito .card-art {
  background-image: var(--card-img, none), radial-gradient(circle, #1d4ed8 0%, #1e1b4b 100%);
}
.card.type-terreno .card-art {
  background-image: var(--card-img, none), radial-gradient(circle, #0f766e 0%, #115e59 100%);
}
.card.type-invocacao .card-art {
  background-image: var(--card-img, none), radial-gradient(circle, #b45309 0%, #78350f 100%);
}

.card-desc {
  font-size: var(--card-font-desc);
  color: #e2e8f0;
  text-align: center;
  line-height: 1.2;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  overflow: hidden;
  word-break: break-word;
}

.card-type-label {
  font-size: 0.55rem;
  text-transform: uppercase;
  color: #94a3b8;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 4px;
  margin-top: 2px;
}

/* Borda Especial por Raridade/Tipo */
.card.type-veriko {
  border-color: #db2777;
  box-shadow: 0 0 8px rgba(219, 39, 119, 0.4);
}
.card.type-veriko:hover {
  border-color: #db2777;
  box-shadow: 0 0 20px rgba(219, 39, 119, 0.8);
}
.card.type-maldição {
  border-color: #7f1d1d;
  box-shadow: 0 0 8px rgba(127, 29, 29, 0.4);
  background: rgba(18, 5, 7, 0.95);
}
.card.type-maldição:hover {
  border-color: #b91c1c;
  box-shadow: 0 0 20px rgba(185, 28, 28, 0.8);
}
.card.type-maldição .card-name {
  color: #f87171 !important;
}
.card.type-maldição .card-art {
  background-image: var(--card-img, none), radial-gradient(circle, #3f050b 0%, #1a0003 100%);
}
.card.upgraded {
  border-style: double;
  border-width: 3px;
  border-color: var(--warning);
}
.card.upgraded .card-name {
  color: var(--warning);
}

#screen-shop {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  min-height: 100vh;
  max-height: 100vh;
  width: 100vw;
  z-index: 90;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 85px 20px 40px 20px;
  box-sizing: border-box;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #080d1a;
  box-shadow: inset 0 0 140px rgba(0, 0, 0, 0.75);
}

/* ==========================================================================
   5. TELA: LOJA (SHOP) - JRPG Merchants System
   ========================================================================== */
.shop-layout-wrapper {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 20px;
  max-width: 1300px;
  width: 95%;
  margin: auto;
  position: relative;
  z-index: 2;
}

.merchant-big-portrait-container {
  width: 360px;
  min-width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-self: stretch;
}

.merchant-big-portrait {
  width: 100%;
  height: 100%;
  min-height: 560px;
  border-radius: 20px;
  border: 3px solid var(--glass-border);
  background-size: contain;
  background-position: center bottom;
  background-repeat: no-repeat;
  background-color: rgba(15, 23, 42, 0.45);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.6), inset 0 0 25px rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.merchant-big-portrait:hover {
  transform: translateY(-4px) scale(1.02);
}

.merchant-fallback-icon {
  font-size: 5rem;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.7));
}

.shop-container {
  flex: 1;
  max-width: 880px;
  position: relative;
  background: rgba(15, 23, 42, 0.18) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
  transition: border-color 0.4s ease, box-shadow 0.4s ease, background 0.4s ease;
  padding: 25px 30px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
}

/* JRPG Merchant Header Layout */
.shop-merchant-header {
  display: flex;
  align-items: center;
  gap: 24px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 18px 24px;
  margin-bottom: 25px;
  backdrop-filter: blur(10px);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.4), 0 8px 32px rgba(0, 0, 0, 0.3);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.merchant-portrait-wrapper {
  position: relative;
  flex-shrink: 0;
}

.merchant-portrait {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 3px solid #fbbf24;
  background-size: cover;
  background-position: center;
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
  background-color: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  transition: transform 0.3s ease;
}

.merchant-info-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.merchant-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid rgba(251, 191, 36, 0.3);
  align-self: flex-start;
}

.merchant-name-text {
  font-size: 1.5rem;
  color: #f8fafc;
  margin: 2px 0 6px 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.merchant-speech-bubble {
  position: relative;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 10px 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.merchant-speech-bubble::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 14px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 8px solid rgba(30, 41, 59, 0.85);
}

.merchant-dialogue {
  font-size: 0.9rem;
  line-height: 1.4;
  color: #e2e8f0;
  font-style: italic;
  margin: 0;
}

/* Themes for 5 Merchants */
.merchant-theme-torneko .merchant-portrait {
  border-color: #38bdf8;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}
.merchant-theme-torneko .merchant-badge {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
}

.merchant-theme-bamba .merchant-portrait {
  border-color: #a855f7;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
}
.merchant-theme-bamba .merchant-badge {
  color: #c084fc;
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.35);
}

.merchant-theme-groschner .merchant-portrait {
  border-color: #f97316;
  box-shadow: 0 0 20px rgba(249, 115, 22, 0.4);
}
.merchant-theme-groschner .merchant-badge {
  color: #fb923c;
  background: rgba(249, 115, 22, 0.15);
  border-color: rgba(249, 115, 22, 0.35);
}

.merchant-theme-carl .merchant-portrait {
  border-color: #34d399;
  box-shadow: 0 0 20px rgba(52, 211, 153, 0.4);
}
.merchant-theme-carl .merchant-badge {
  color: #34d399;
  background: rgba(52, 211, 153, 0.15);
  border-color: rgba(52, 211, 153, 0.35);
}

.merchant-theme-torneko_god .merchant-portrait {
  border-color: #ffd700;
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.7);
  animation: god-portrait-pulse 2s ease-in-out infinite alternate;
}
.merchant-theme-torneko_god .merchant-badge {
  color: #ffd700;
  background: rgba(255, 215, 0, 0.2);
  border-color: rgba(255, 215, 0, 0.5);
  font-size: 0.85rem;
}
.merchant-theme-torneko_god .shop-merchant-header {
  border-color: rgba(255, 215, 0, 0.4);
  box-shadow: inset 0 0 30px rgba(255, 215, 0, 0.15), 0 8px 32px rgba(0, 0, 0, 0.4);
}

@keyframes god-portrait-pulse {
  from { transform: scale(1); box-shadow: 0 0 20px rgba(255, 215, 0, 0.5); }
  to { transform: scale(1.05); box-shadow: 0 0 35px rgba(255, 215, 0, 0.9); }
}

.shop-sections-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 30px;
  margin-bottom: 30px;
}

.shop-section {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.shop-section h3 {
  font-size: 1.2rem;
  border-bottom: 2px solid var(--glass-border);
  padding-bottom: 5px;
}

.shop-cards-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.shop-card-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.shop-price-tag {
  font-weight: 700;
  color: var(--warning);
  font-size: 0.95rem;
}

.shop-services-row {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.shop-item-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  text-align: center;
  border-color: rgba(255,255,255,0.05);
}

.shop-item-card .service-icon {
  font-size: 2.2rem;
  margin-bottom: 10px;
}

.shop-item-card .item-name {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 5px;
}

.shop-item-card .item-desc {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 15px;
}

/* ==========================================================================
   6. TELA: ACAMPAMENTO (REST CAMP)
   ========================================================================== */
.rest-container {
  max-width: 600px;
  width: 90%;
}

.campfire-animation {
  font-size: 5rem;
  margin: 30px 0;
  animation: fire-flicker 0.15s infinite alternate;
}

@keyframes fire-flicker {
  0% { transform: scale(1) rotate(-2deg); text-shadow: 0 0 20px rgba(239, 68, 68, 0.4); }
  100% { transform: scale(1.05) rotate(2deg); text-shadow: 0 0 35px rgba(245, 158, 11, 0.8); }
}

.rest-description {
  color: #94a3b8;
  margin-bottom: 40px;
}

.rest-options {
  display: flex;
  justify-content: center;
  gap: 20px;
}

/* ==========================================================================
   7. RECOMPENSAS DE COMBATE (BATTLE REWARD)
   ========================================================================== */
.rewards-container {
  max-width: 860px;
  width: 95%;
}

.rewards-container .section-title,
.rewards-container .reward-desc {
  position: relative;
  z-index: 1005 !important;
}

.rewards-cards-row {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin: 55px 0 35px;
  perspective: 1000px;
  position: relative;
  z-index: 5;
}

.rewards-cards-row .card:hover {
  transform: translateY(-12px) scale(1.08) translateZ(0) rotate(0deg) !important;
  z-index: 998 !important;
}

.reward-gold-row {
  margin-bottom: 30px;
}

.gold-earned {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--warning);
}

.rewards-actions {
  display: flex;
  justify-content: center;
  gap: 20px;
}

/* ==========================================================================
   8. TELA: CONQUISTAS E RECOMPENSAS GLOBAIS
   ========================================================================== */
.global-rewards-container {
  max-width: 1000px;
  width: 95%;
}

.rewards-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin: 30px 0;
}

.rewards-list-panel {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  height: 500px; /* Altura fixa garantindo rolagem interna */
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.2);
}

.rewards-list-panel h3 {
  font-size: 1.25rem;
  margin-bottom: 20px;
  color: #cbd5e1;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 10px;
}

.unlocked-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto; /* Rolagem interna */
  flex: 1;
  padding-right: 8px; /* Espaço para o scrollbar */
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.5) transparent;
}

/* Customização Premium de Scrollbar */
.unlocked-list::-webkit-scrollbar {
  width: 6px;
}

.unlocked-list::-webkit-scrollbar-track {
  background: transparent;
}

.unlocked-list::-webkit-scrollbar-thumb {
  background-color: rgba(99, 102, 241, 0.4);
  border-radius: 10px;
}

.unlocked-list::-webkit-scrollbar-thumb:hover {
  background-color: var(--primary);
}

.unlocked-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  transition: transform 0.2s, background-color 0.2s, border-color 0.2s;
}

.unlocked-item:hover {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-2px);
}

.unlocked-item.locked {
  background: rgba(15, 23, 42, 0.4);
  border-color: rgba(255, 255, 255, 0.04);
}

.unlocked-status-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
}

.unlocked-status-badge.status-liberado {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.unlocked-status-badge.status-bloqueado {
  background: rgba(244, 63, 94, 0.2);
  color: var(--accent);
}

/* ==========================================================================
   9. TELA: GAME OVER
   ========================================================================== */
.game-over-container {
  max-width: 500px;
  width: 90%;
  border-color: var(--accent-glow);
}

.game-over-text {
  font-size: 3rem;
  color: var(--accent);
  text-shadow: 0 0 15px var(--accent-glow);
  margin-bottom: 10px;
}

.game-over-container.victory {
  border-color: var(--success-glow);
}
.game-over-container.victory .game-over-text {
  color: var(--success);
  text-shadow: 0 0 15px var(--success-glow);
}

.run-stats {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.05);
  padding: 15px;
  margin: 25px 0 35px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 1rem;
}

/* ==========================================================================
   MODAIS (DECK & SELECTOR)
   ========================================================================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100;
  background: rgba(11, 13, 25, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  width: 85%;
  max-width: 980px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 15px;
  margin-bottom: 12px;
}

.close-btn {
  background: transparent;
  border: none;
  font-size: 2rem;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
}

.close-btn:hover {
  color: white;
}

.cards-grid {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 22px;
  padding: 46px 24px 36px 24px;
  scrollbar-width: thin;
  scroll-padding-top: 46px;
}

/* Comportamento de cartas em grades de modais (evita corte do topo da primeira fileira) */
.cards-grid .card,
.deck-grid .card {
  margin: 0;
  transform-origin: center center;
}

.cards-grid .card:hover,
.deck-grid .card:hover {
  transform: translateY(-8px) scale(1.15) translateZ(0) rotate(0deg) !important;
  z-index: 999 !important;
}

/* Garante visibilidade e acessibilidade da lupa nas cartas da grade */
.cards-grid .card-art-zoom-btn,
.deck-grid .card-art-zoom-btn {
  opacity: 0.65;
}

.cards-grid .card:hover .card-art-zoom-btn,
.deck-grid .card:hover .card-art-zoom-btn {
  opacity: 1 !important;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.85);
}

/* ==========================================================================
   ANIMAÇÕES GERAIS E EFEITOS
   ========================================================================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

.animate-pulse {
  animation: pulse 2s infinite ease-in-out;
}

/* Herois e Artefatos Bloqueados - camada de cor preta com opacidade 93% na frente das imagens */
.locked-obscured {
  position: relative !important;
}

.char-dark-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.93) !important;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
}

.relic-dark-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.93) !important;
  pointer-events: none;
  z-index: 2;
}

.char-card-avatar.locked-obscured {
  position: relative !important;
}

.redacted-effect {
  background-color: #000;
  color: #000 !important;
  border-radius: 4px;
  padding: 2px 6px;
  user-select: none;
  border: 1px solid #1e293b;
  display: inline-block;
}

.unlocked-item-left {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 1;
}

.unlocked-item-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.player-side-container {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 20px;
  justify-content: flex-start;
}

.allies-container-arena {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 15px;
  align-items: flex-end;
  margin-bottom: 0;
  justify-content: flex-end;
}

.sprite-ally {
  width: calc(var(--base-combatant-size) * var(--sprite-scale, 1)) !important;
  height: calc(var(--base-combatant-size) * var(--sprite-scale, 1)) !important;
  max-height: 520px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  position: relative;
  background-color: rgba(15, 23, 42, 0.75);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sprite-ally.is-v2-summon {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  overflow: visible !important;
}

.ally-wrapper {
  width: calc(var(--base-combatant-size) * var(--sprite-scale, 1));
  min-width: clamp(100px, 12vw, 130px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.ally-sprite:hover {
  transform: scale(1.1) translateY(-2px);
  border-color: rgba(255, 255, 255, 0.3);
}

.ally-sprite-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.ally-sprite-fallback {
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Quando tem imagem, esconde o fallback do emoji */
.ally-sprite.has-image .ally-sprite-fallback {
  display: none !important;
}

/* Terreno e Arena indicador */
.active-terrain-indicator {
  position: absolute;
  top: 68px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 20px;
  background: rgba(15, 23, 42, 0.94);
  border: 1.5px solid #a855f7;
  border-radius: 30px;
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  width: max-content;
  max-width: 90%;
  box-shadow: 0 4px 20px rgba(168, 85, 247, 0.35), 0 0 10px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #f8fafc;
  z-index: 80;
  pointer-events: none;
  transition: all 0.3s ease;
}

/* Placeholder de Arte do Menu Principal */
.menu-artwork-placeholder {
  width: 100%;
  height: 350px;
  border-radius: 16px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, rgba(15, 23, 42, 0.6) 100%), url('../../assets/menu_artwork.png') no-repeat center center;
  background-size: cover;
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.3);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.menu-artwork-placeholder:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 35px rgba(99, 102, 241, 0.5);
  border-color: var(--primary-bright);
}

.menu-artwork-placeholder::before {
  content: 'FRAGMENTA RLD';
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.85);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  letter-spacing: 2px;
  font-family: 'Space Grotesk', sans-serif;
  border: 1px solid var(--glass-border);
  text-shadow: 0 0 10px var(--primary-glow);
  white-space: nowrap;
}


/* ==========================================================================
   SISTEMA DE CONTAS & RANKINGS (NOVO)
   ========================================================================== */

/* Cabeçalho do Perfil de Usuário */
.user-profile-header {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Estilo premium do botão de controle de áudio */
.audio-toggle-btn {
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: white;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1), background-color 0.25s, border-color 0.25s;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.audio-toggle-btn:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.audio-toggle-btn.muted,
#hud-audio-btn.muted {
  opacity: 0.6;
  border-color: rgba(244, 63, 94, 0.3) !important;
  background: rgba(244, 63, 94, 0.05) !important;
  color: #fda4af !important;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
}

.user-badge-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-avatar-slot {
  position: relative;
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  border: 2px solid #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
  flex-shrink: 0;
}

.header-avatar-slot:hover {
  transform: scale(1.12);
  border-color: #7dd3fc;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.7);
}

.header-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.user-badge-icon {
  font-size: 1.1rem;
}

#user-status-text {
  font-weight: 600;
  color: #fff;
}

.currency-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1;
  transition: all 0.2s ease;
  user-select: none;
}

.currency-pill.pill-sparks {
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.currency-pill.pill-hope {
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}

.currency-pill.pill-fear {
  background: rgba(168, 85, 247, 0.14);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #c084fc;
  text-shadow: 0 0 8px rgba(168, 85, 247, 0.4);
}

.currency-icon {
  display: inline-block;
  vertical-align: middle;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  fill: currentColor;
}

.currency-icon.icon-lg {
  width: 20px;
  height: 20px;
}

.user-currencies-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-small {
  padding: 4px 10px;
  font-size: 0.8rem;
  border-radius: 6px;
}

/* Modal de Autenticação */
.auth-modal-content {
  max-width: 400px;
  border-radius: 16px;
  padding: 25px;
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 20px;
}

.auth-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 10px 0;
  font-size: 1rem;
  font-family: var(--font-title);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
}

.auth-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 15px;
  text-align: left;
}

.form-group label {
  font-size: 0.85rem;
  color: #94a3b8;
  font-weight: 600;
}

.form-group input {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--glass-border);
  color: white;
  padding: 10px 12px;
  border-radius: 8px;
  font-family: var(--font-main);
  font-size: 0.95rem;
  transition: border-color 0.2s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
}

.auth-error {
  color: var(--accent);
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.2);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 15px;
  text-align: left;
}

.auth-success {
  color: var(--success);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 15px;
  text-align: left;
}

/* Tela de Histórico e Rankings */
.history-rank-container {
  width: 95%;
  max-width: 1150px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  padding: 30px;
  margin: auto;
  overflow: hidden;
}

.total-play-time-badge {
  text-align: center;
  font-family: var(--font-title);
  font-size: 1rem;
  color: #cbd5e1;
  margin-top: -10px;
  margin-bottom: 20px;
  letter-spacing: 0.5px;
}

.total-play-time-badge span {
  color: #f472b6;
  font-weight: 700;
  margin-left: 4px;
}

.tab-selectors {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 25px;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 15px;
}

.tab-select-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  color: #94a3b8;
  padding: 8px 24px;
  border-radius: 30px;
  cursor: pointer;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-select-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
}

.tab-panel-content {
  flex: 1;
  overflow-y: auto;
  padding-right: 5px;
}

/* Tabela de Rankings */
.ranking-table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--glass-border);
}

.rank-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.rank-table th {
  background: rgba(30, 41, 59, 0.8);
  padding: 12px 16px;
  font-weight: 700;
  color: #cbd5e1;
  font-family: var(--font-title);
  white-space: nowrap;
}

.rank-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  white-space: nowrap;
}

.rank-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.rank-table tr:nth-child(1) td { color: #ffd700; font-weight: bold; } /* Ouro */
.rank-table tr:nth-child(2) td { color: #c0c0c0; font-weight: bold; } /* Prata */
.rank-table tr:nth-child(3) td { color: #cd7f32; font-weight: bold; } /* Bronze */

/* Grids do Histórico */
.history-grids-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
}

.history-column-box {
  display: flex;
  flex-direction: column;
  gap: 15px;
  background: rgba(15, 23, 42, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 20px;
  max-height: 50vh;
  overflow-y: auto;
}

.runs-history-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Card de Run Individual */
.run-history-card {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.run-history-card:hover {
  transform: translateY(-2px);
  border-color: var(--glass-border-hover);
}

.run-card-avatar {
  width: 45px;
  height: 45px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background-size: cover;
  background-position: center;
}

.run-card-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
}

.run-card-hero {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.95rem;
}

.run-card-stats {
  font-size: 0.8rem;
  color: #94a3b8;
}

.run-card-badge {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.run-card-score {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.1rem;
}

.run-card-outcome {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.run-card-outcome.victory {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.run-card-outcome.defeat {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent);
}

/* Aviso de Anônimo */
.anonymous-warning-box {
  padding: 40px 20px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  max-width: 500px;
  margin: 40px auto;
}

.warning-icon {
  font-size: 3rem;
  margin-bottom: 15px;
}

/* Nível de Conta Badge */
.account-level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(217, 119, 6, 0.35));
  border: 1px solid rgba(245, 158, 11, 0.7);
  color: #fbbf24;
  padding: 2px 8px;
  border-radius: 9999px;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.5px;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.25);
  user-select: none;
  vertical-align: middle;
}

/* Célula de Jogador no Ranking */
.ranking-player-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.tier-card {
  white-space: nowrap;
}

/* Prime Hall of Fame Styles */
.prime-records-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 15px;
}

.prime-record-card {
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid rgba(234, 179, 8, 0.3);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.prime-record-card:hover {
  transform: translateY(-2px);
  border-color: rgba(234, 179, 8, 0.6);
  box-shadow: 0 6px 18px rgba(234, 179, 8, 0.15);
}

.prime-record-card.unclaimed {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.3);
  opacity: 0.75;
}

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

.prime-badge-tag {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  background: rgba(234, 179, 8, 0.2);
  color: #fde047;
  border: 1px solid rgba(234, 179, 8, 0.4);
}

.prime-laurel {
  color: #ffd700;
  font-size: 1.1rem;
}

.prime-item-title {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.prime-pioneer-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.85rem;
}

/* Speed Runs Grid */
.speedrun-heroes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.speedrun-hero-card {
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.2s, border-color 0.2s;
}

.speedrun-hero-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
}

.speedrun-hero-avatar {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  border: 1.5px solid rgba(255,255,255,0.15);
  flex-shrink: 0;
}

.speedrun-hero-details {
  flex: 1;
  min-width: 0;
}

.speedrun-hero-name {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.speedrun-time-display {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 1.15rem;
  color: #38bdf8;
  margin-top: 2px;
}

.speedrun-record-holder {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 2px;
}

/* Capitalismo Lists */
.capitalism-ranks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.capitalism-rank-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.4);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.9rem;
}

.capitalism-rank-item:nth-child(1) { border-color: rgba(255, 215, 0, 0.4); background: rgba(255, 215, 0, 0.05); }
.capitalism-rank-item:nth-child(2) { border-color: rgba(192, 192, 192, 0.35); background: rgba(192, 192, 192, 0.04); }
.capitalism-rank-item:nth-child(3) { border-color: rgba(205, 127, 50, 0.3); background: rgba(205, 127, 50, 0.03); }

.capitalism-rank-num {
  font-weight: 800;
  width: 24px;
  color: #94a3b8;
}
.capitalism-rank-item:nth-child(1) .capitalism-rank-num { color: #ffd700; }
.capitalism-rank-item:nth-child(2) .capitalism-rank-num { color: #c0c0c0; }
.capitalism-rank-item:nth-child(3) .capitalism-rank-num { color: #cd7f32; }

.capitalism-player-info {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  padding: 0 8px;
}

.capitalism-amount {
  font-weight: 800;
  font-family: var(--font-title);
}

/* Pause Modal Styles */
.pause-modal-content {
  max-width: 380px !important;
  padding: 25px !important;
  border-radius: 16px !important;
}

.btn-danger-action {
  background: rgba(244, 63, 94, 0.15) !important;
  border-color: rgba(244, 63, 94, 0.3) !important;
  color: #fda4af !important;
}

.btn-danger-action:hover {
  background: rgba(244, 63, 94, 0.3) !important;
  border-color: rgba(244, 63, 94, 0.6) !important;
  color: white !important;
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.4) !important;
}

/* ==========================================================================
   9. INTERFACE E RESPONSIVIDADE PARA CELULAR (MOBILE UX)
   ========================================================================== */
@media (max-width: 768px) {
  :root {
    --card-w: 105px;
    --card-h: 155px;
    --card-art-h: 60px;
    --card-font-name: 0.68rem;
    --card-font-desc: 0.55rem;
    --card-overlap: -20px;
    --card-cost-size: 20px;
    --card-cost-font: 0.7rem;
  }

  /* 0. Menu Principal (Mobile) */
  #screen-main-menu {
    padding: 15px !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }
  .menu-container {
    width: 100% !important;
    max-width: 360px !important;
    gap: 20px !important;
    padding: 10px 15px !important;
    box-sizing: border-box !important;
  }
  .title-branding-group {
    align-items: flex-start !important;
    text-align: left !important;
    width: 100% !important;
    max-width: 320px !important;
    margin: 0 auto 5px auto !important;
  }
  .game-presenter-subtitle {
    font-size: clamp(0.42rem, 2.3vw, 0.55rem) !important;
    letter-spacing: 0.5px !important;
    white-space: nowrap !important;
  }
  .game-logo {
    font-size: clamp(1.8rem, 8.5vw, 2.8rem) !important;
    letter-spacing: clamp(1px, 0.8vw, 3px) !important;
    line-height: 1.05 !important;
    margin-bottom: 5px !important;
    word-break: keep-all !important;
    text-align: left !important;
    width: 100% !important;
  }
  .logo-accent {
    text-align: center !important;
    width: 100% !important;
  }
  .menu-buttons {
    max-width: 280px !important;
    gap: 12px !important;
  }
  .menu-buttons .btn {
    padding: 12px 18px !important;
    font-size: 1rem !important;
  }

  /* 1. Header (HUD) */
  #game-hud {
    padding: 5px 10px;
    height: auto;
    min-height: 50px;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
  }
  .hud-left, .hud-right {
    gap: 6px;
  }
  .hud-item {
    font-size: 0.85rem;
    padding: 4px 10px;
  }
  .hud-artifacts-label {
    display: none;
  }
  #hud-character-name {
    display: none;
  }

  /* 2. Seleção de Personagem */
  .characters-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 20px !important;
  }
  .char-card {
    padding: 10px !important;
    border-radius: 8px !important;
  }
  .char-card-name {
    font-size: 0.9rem !important;
  }
  .char-card-class {
    font-size: 0.7rem !important;
  }
  .char-details-panel {
    padding: 12px !important;
    margin-bottom: 15px !important;
  }
  .section-title {
    font-size: 1.5rem !important;
    margin-bottom: 15px !important;
  }
  .details-stats {
    gap: 15px !important;
    font-size: 0.85rem !important;
  }

  /* 3. Arena de Batalha */
  .battle-arena {
    flex-direction: column-reverse !important;
    gap: 20px !important;
    padding: 10px !important;
    justify-content: flex-end !important;
    min-height: auto !important;
  }
  .enemies-wrapper {
    flex-direction: row !important;
    justify-content: center !important;
    gap: 15px !important;
    max-width: 100% !important;
  }
  .battle-arena {
    --base-combatant-size: clamp(80px, 18vw, 105px) !important;
  }
  .combatant-wrapper {
    width: calc(var(--base-combatant-size, 90px) * var(--sprite-scale, 1)) !important;
    gap: 8px !important;
  }
  .player-wrapper {
    width: calc(var(--base-combatant-size, 90px) * var(--sprite-scale, 1)) !important;
  }
  .player-wrapper .sprite-container {
    width: calc(var(--base-combatant-size, 90px) * var(--sprite-scale, 1)) !important;
    height: calc(var(--base-combatant-size, 90px) * var(--sprite-scale, 1)) !important;
    border: none !important;
    box-shadow: none !important;
  }
  .player-wrapper .sprite-container::after,
  .enemies-wrapper .sprite-container::after {
    display: none !important;
  }
  .player-wrapper .sprite-container::before {
    font-size: 2.8rem !important;
  }
  .enemies-wrapper .sprite-container {
    width: calc(var(--base-combatant-size, 90px) * var(--sprite-scale, 1)) !important;
    height: calc(var(--base-combatant-size, 90px) * var(--sprite-scale, 1)) !important;
    border: none !important;
    box-shadow: none !important;
  }
  .enemies-wrapper .sprite-container::before {
    font-size: 2.2rem !important;
  }
  .combatant-info {
    width: 100% !important;
  }
  .name-tag {
    font-size: 0.85rem !important;
  }
  .hp-bar-container {
    height: 14px !important;
  }
  .hp-text {
    font-size: 0.75rem !important;
    line-height: 14px !important;
  }

  /* 4. Controles de Batalha (Mão e Status) */
  .battle-stats-row {
    gap: 10px !important;
    justify-content: space-around !important;
    margin-bottom: 8px !important;
    position: relative !important;
    z-index: 35 !important;
  }
  .energy-orb-container {
    gap: 5px !important;
  }
  .energy-orb {
    width: 44px !important;
    height: 44px !important;
    font-size: 1.1rem !important;
  }
  .energy-label {
    font-size: 0.6rem !important;
  }
  .card-pile {
    font-size: 1.1rem !important;
    padding: 4px 8px !important;
  }
  .btn-end-turn {
    padding: 8px 16px !important;
    font-size: 0.8rem !important;
  }
  .hand-container {
    height: 160px !important;
    padding: 0 10px !important;
  }

  /* 5. Loja / Comerciante */
  .shop-welcome {
    font-size: 0.85rem !important;
    margin-bottom: 15px !important;
  }
  .shop-sections-grid {
    grid-template-columns: 1fr !important;
    gap: 15px !important;
  }
  .shop-cards-row {
    justify-content: center !important;
    gap: 10px !important;
  }

  /* 6. Sparks Loja / Conquistas */
  .rewards-sections {
    grid-template-columns: 1fr !important;
    gap: 15px !important;
    margin: 15px 0 !important;
  }
  .rewards-list-panel {
    height: 250px !important;
    padding: 12px !important;
  }
  .rewards-list-panel h3 {
    font-size: 1rem !important;
    margin-bottom: 10px !important;
  }
  .unlocked-item-left {
    gap: 8px !important;
  }
  .unlocked-item-left img, .unlocked-item-left .char-card-avatar, .unlocked-item-left .relic-icon {
    width: 40px !important;
    height: 40px !important;
    font-size: 1.2rem !important;
  }

  /* 7. Procedural Map */
  .map-wrapper {
    padding: 12px !important;
  }
  .map-node {
    width: 38px !important;
    height: 38px !important;
    font-size: 1rem !important;
  }
  .map-grid {
    display: flex;
    flex-direction: row;
    gap: 50px;
    padding: 10px 20px;
    min-width: max-content;
    height: 100%;
    position: relative;
  }

  /* 8. Modais */
  .modal-content {
    width: 95% !important;
    max-height: 90% !important;
    padding: 15px !important;
  }

  /* 8.5 Histórico e Rankings Mobile */
  .user-profile-header {
    top: 8px !important;
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    max-width: calc(100vw - 16px) !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 6px !important;
    box-sizing: border-box !important;
  }
  body.has-jukebox .user-profile-header {
    top: 48px !important;
  }
  .audio-toggle-btn {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    font-size: 0.88rem !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
  }
  .user-badge {
    padding: 3px 6px !important;
    gap: 5px !important;
    font-size: 0.72rem !important;
    flex: 1 !important;
    min-width: 0 !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }
  .user-badge-info {
    min-width: 0 !important;
    flex-shrink: 1 !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    overflow: hidden !important;
    white-space: nowrap !important;
  }
  .header-avatar-slot {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
  }
  #user-status-text {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    display: inline-block !important;
    max-width: 70px !important;
    font-size: 0.72rem !important;
  }
  .account-level-badge {
    font-size: 0.65rem !important;
    padding: 1px 4px !important;
    border-radius: 4px !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }
  .user-currencies-bar {
    display: flex !important;
    align-items: center !important;
    gap: 3px !important;
    flex-shrink: 0 !important;
  }
  .currency-pill {
    padding: 2px 5px !important;
    font-size: 0.70rem !important;
    gap: 2px !important;
    border-radius: 6px !important;
    white-space: nowrap !important;
  }
  .currency-icon {
    width: 11px !important;
    height: 11px !important;
    min-width: 11px !important;
  }
  .user-badge-actions {
    gap: 3px !important;
    flex-shrink: 0 !important;
    display: flex !important;
  }
  .user-badge-actions .btn-small {
    padding: 2px 6px !important;
    font-size: 0.68rem !important;
    white-space: nowrap !important;
    min-height: 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  @media (max-width: 480px) {
    #user-status-text {
      display: none !important;
    }
    .user-badge {
      gap: 4px !important;
      padding: 3px 5px !important;
    }
  }
  .history-rank-container {
    width: 95% !important;
    padding: 15px !important;
    max-height: 90vh !important;
  }
  .tab-selectors {
    margin-bottom: 15px !important;
    padding-bottom: 10px !important;
    gap: 10px !important;
  }
  .tab-select-btn {
    padding: 6px 16px !important;
    font-size: 0.85rem !important;
  }
  .history-grids-container {
    grid-template-columns: 1fr !important;
    gap: 15px !important;
  }
  .history-column-box {
    max-height: 30vh !important;
    padding: 12px !important;
  }
  .rank-table th, .rank-table td {
    padding: 8px 10px !important;
    font-size: 0.8rem !important;
  }
  .run-history-card {
    padding: 8px 12px !important;
    gap: 8px !important;
  }
  .run-card-avatar {
    width: 35px !important;
    height: 35px !important;
  }
  .run-card-hero {
    font-size: 0.85rem !important;
  }
  .run-card-score {
    font-size: 0.95rem !important;
  }

  .ally-sprite {
    width: 26px !important;
    height: 39px !important;
    border-radius: 4px !important;
  }

  .ally-sprite-fallback {
    font-size: 1.1rem !important;
  }
}

/* Efeitos Visuais de Combate e Ajustes da Loja */
#particles-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.shop-tab-selectors .tab-select-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  padding: 10px 24px;
  font-size: 1rem;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.25s ease;
  font-weight: 600;
}

.shop-tab-selectors .tab-select-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.shop-tab-selectors .tab-select-btn.active {
  background: var(--primary-glow);
  color: #fff;
  border-color: var(--primary-bright);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.shop-char-details {
  animation: fadeIn 0.3s ease;
}

.shop-exclusive-cards div {
  transition: background 0.2s ease;
}

.shop-exclusive-cards div:hover {
  background: rgba(255, 255, 255, 0.06) !important;
}

/* Estilos de Créditos e Opções (Switches e Links) */
.btn-credits-link {
  padding: 8px 16px;
  border-radius: 20px;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.75);
  color: #cbd5e1;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.2s ease;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.btn-credits-link:hover {
  background: rgba(168, 85, 247, 0.3);
  color: #fff;
  border-color: rgba(168, 85, 247, 0.6);
  transform: scale(1.05);
}

.mobile-keyboard-btn {
  background: rgba(15, 23, 42, 0.75);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 8px;
  width: 34px;
  height: 34px;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
}

.mobile-keyboard-btn:hover {
  background: rgba(168, 85, 247, 0.3);
  border-color: rgba(168, 85, 247, 0.6);
  transform: scale(1.05);
}

/* Interruptor (Toggle Switch) de Opções */
#toggle-tutorial:checked + .switch-label,
#toggle-track-per-hero:checked + .switch-label,
#toggle-run-timer:checked + .switch-label,
#toggle-combat-log:checked + .switch-label,
#toggle-killik-grayscale:checked + .switch-label,
#toggle-thomas-jukebox:checked + .switch-label {
  background-color: var(--primary-bright) !important;
  border-color: var(--primary-glow) !important;
}

.switch-label:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

#toggle-tutorial:checked + .switch-label:before,
#toggle-track-per-hero:checked + .switch-label:before,
#toggle-run-timer:checked + .switch-label:before,
#toggle-combat-log:checked + .switch-label:before,
#toggle-killik-grayscale:checked + .switch-label:before,
#toggle-thomas-jukebox:checked + .switch-label:before {
  transform: translateX(26px);
}

/* Painel de Log de Combate (Combat Log) */
.combat-log-container {
  position: absolute;
  bottom: 15px;
  left: 20px;
  width: 290px;
  height: 140px;
  background: rgba(15, 23, 42, 0.25);
  backdrop-filter: blur(2px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 12px;
  overflow-y: auto;
  z-index: 99;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-family: 'Consolas', 'Courier New', Courier, monospace;
  font-size: 0.70rem;
  color: #e2e8f0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  text-align: left;
  line-height: 1.35;
  transition: background 0.2s ease, opacity 0.2s ease;
  opacity: 0.55;
}

.combat-log-container:hover {
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  opacity: 1;
}

.combat-log-entry {
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 3px;
  word-wrap: break-word;
  white-space: pre-wrap;
}

/* Esconde o log em dispositivos móveis/celulares */
@media (max-width: 768px) {
  .combat-log-container {
    display: none !important;
  }
}

/* ==========================================================================
   POPUP NOTIFICAÇÃO "NOW PLAYING" (TOCANDO AGORA)
   ========================================================================== */
#now-playing-container {
  position: fixed;
  bottom: 25px;
  left: 25px;
  z-index: 100050;
  pointer-events: none;
}

.now-playing-popup {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45), 0 0 15px rgba(99, 102, 241, 0.15);
  transform: translateX(-125%);
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
  pointer-events: auto;
}

.now-playing-popup.show {
  transform: translateX(0);
  opacity: 1;
}

.now-playing-popup.fade-out {
  transform: translateY(15px);
  opacity: 0;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.8s ease;
}

.now-playing-icon {
  font-size: 1.4rem;
  color: var(--primary);
  filter: drop-shadow(0 0 6px var(--primary-glow));
  animation: pulse-music 2.2s infinite ease-in-out;
}

.now-playing-info {
  display: flex;
  flex-direction: column;
}

.now-playing-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #94a3b8;
  font-weight: 600;
  margin-bottom: 2px;
}

.now-playing-title {
  font-family: var(--font-title);
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.08);
}

@keyframes pulse-music {
  0% { transform: scale(1) rotate(0deg); opacity: 0.85; }
  50% { transform: scale(1.15) rotate(8deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 0.85; }
}

.input-modern {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--glass-border);
  color: white;
  padding: 10px 12px;
  border-radius: 8px;
  font-family: var(--font-main);
  font-size: 0.95rem;
  transition: border-color 0.2s ease;
}

.input-modern:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
}

select.input-modern option {
  background: rgba(15, 23, 42, 0.95);
  color: white;
}

/* Mobile keyboard */
.mobile-keyboard-btn { display: none !important; }
@media (max-width: 768px) { .mobile-keyboard-btn { display: flex !important; } }


/* ==========================================
   DEBUG MENU STYLES
   ========================================== */

.debug-section {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 18px;
}

.debug-section-title {
  font-family: var(--font-title);
  font-size: 1rem;
  color: var(--primary);
  margin: 0 0 10px 0;
  letter-spacing: 0.05em;
}

.debug-hint {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.45);
  margin: 0 0 14px 0;
}

.debug-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.debug-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.debug-field label {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
}

.debug-select {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.88rem;
  font-family: var(--font-main);
  cursor: pointer;
  transition: border-color 0.2s;
  appearance: auto;
}

.debug-select:focus {
  outline: none;
  border-color: var(--primary);
}

.debug-select option {
  background: #1a1a2e;
  color: #fff;
}

.debug-btn-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.debug-btn {
  flex: 1;
  min-width: 150px;
  padding: 12px 16px;
  font-size: 0.9rem;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.15s, box-shadow 0.15s;
  text-align: center;
  line-height: 1.4;
}

.debug-btn:hover {
  transform: translateY(-2px);
}

.debug-btn-green {
  background: linear-gradient(135deg, #065f46, #059669);
  color: #fff;
  box-shadow: 0 4px 15px rgba(5, 150, 105, 0.3);
}

.debug-btn-green:hover {
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.5);
}

.debug-btn-red {
  background: linear-gradient(135deg, #7f1d1d, #b91c1c);
  color: #fff;
  box-shadow: 0 4px 15px rgba(185, 28, 28, 0.3);
}

.debug-btn-red:hover {
  box-shadow: 0 6px 20px rgba(185, 28, 28, 0.5);
}

.debug-status-text {
  margin-top: 10px;
  font-size: 0.82rem;
  color: #10b981;
  min-height: 20px;
  font-style: italic;
}

.debug-cheat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.debug-cheat-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.debug-cheat-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.debug-cheat-icon {
  font-size: 1.6rem;
}

.debug-cheat-info strong {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
}

/* Toggle switch para cheats */
.debug-toggle {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

.debug-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.debug-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: 0.3s;
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,0.15);
}

.debug-toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 3px;
  background-color: rgba(255,255,255,0.7);
  transition: 0.3s;
  border-radius: 50%;
}

.debug-toggle input:checked + .debug-toggle-slider {
  background-color: var(--primary);
  border-color: var(--primary);
}

.debug-toggle input:checked + .debug-toggle-slider:before {
  transform: translateX(22px);
  background-color: #fff;
}

/* ── Debug: Métricas de Desbloqueio ── */
.dbg-metric-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.dbg-metric-char {
  font-weight: 700;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.92);
}

.dbg-metric-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(100, 100, 255, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(100, 100, 255, 0.3);
  white-space: nowrap;
}

.dbg-metric-badge.available {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.3);
}

.dbg-metric-badge.locked {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.25);
}

.dbg-metric-badge.unlocked {
  background: rgba(234, 179, 8, 0.15);
  color: #fde047;
  border-color: rgba(234, 179, 8, 0.3);
}

.dbg-metric-cond {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.45);
  margin: 0;
}

.dbg-metric-bar-wrap {
  background: rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  height: 8px;
  overflow: hidden;
}

.dbg-metric-bar {
  height: 100%;
  width: 0%;
  border-radius: 6px;
  background: linear-gradient(90deg, #22c55e, #16a34a);
  transition: width 0.5s ease;
  max-width: 100%;
}

.dbg-metric-label {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.5);
  font-family: monospace;
}

/* ==========================================================================
   ANIMAÇÃO CINEMÁTICA DO VERIKO
   ========================================================================== */

/* ---- Overlay de fundo ---- */
@keyframes veriko-bg-flash {
  0%   { opacity: 0; }
  8%   { opacity: 1; }
  85%  { opacity: 1; }
  100% { opacity: 0; }
}

#veriko-cinematic-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  overflow: hidden;
  background: radial-gradient(ellipse at center,
    rgba(219, 39, 119, 0.18) 0%,
    rgba(10, 5, 30, 0.92) 70%
  );
  animation: veriko-bg-flash 3s ease forwards;
}

/* ---- Scanlines de jogo antigo ---- */
#veriko-cinematic-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.12) 2px,
    rgba(0,0,0,0.12) 4px
  );
  pointer-events: none;
}

/* ---- Faixas diagonais que cortam a tela ---- */
@keyframes veriko-slash-in {
  0%   { transform: translateX(-110%) skewX(-12deg); opacity: 0; }
  15%  { transform: translateX(0%)    skewX(-12deg); opacity: 1; }
  80%  { transform: translateX(0%)    skewX(-12deg); opacity: 1; }
  100% { transform: translateX(110%)  skewX(-12deg); opacity: 0; }
}

@keyframes veriko-slash-in-rev {
  0%   { transform: translateX(110%)  skewX(-12deg); opacity: 0; }
  20%  { transform: translateX(0%)    skewX(-12deg); opacity: 1; }
  80%  { transform: translateX(0%)    skewX(-12deg); opacity: 1; }
  100% { transform: translateX(-110%) skewX(-12deg); opacity: 0; }
}

.veriko-slash {
  position: absolute;
  left: -20%;
  width: 140%;
  animation: veriko-slash-in 3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.veriko-slash.top {
  top: 28%;
  height: 18%;
}
.veriko-slash.bottom {
  top: 54%;
  height: 18%;
  animation: veriko-slash-in-rev 3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ---- Linha de energia central correndo pela faixa ---- */
@keyframes veriko-energy-run {
  0%   { left: -5%; opacity: 0; }
  5%   { opacity: 1; }
  95%  { opacity: 1; }
  100% { left: 105%; opacity: 0; }
}
.veriko-energy-line {
  position: absolute;
  top: 36.5%;
  width: 12%;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg,
    transparent, #fde68a, #fff, #f9a8d4, transparent
  );
  filter: blur(1px);
  box-shadow: 0 0 18px 4px #fde68a, 0 0 40px 8px rgba(219,39,119,0.6);
  animation: veriko-energy-run 0.6s ease-in-out infinite;
  animation-delay: 0.3s;
}
.veriko-energy-line.b {
  top: 60.5%;
  animation-direction: reverse;
  animation-delay: 0.15s;
}

/* ---- Texto central "VERIKO ATIVADO" ---- */
@keyframes veriko-title-in {
  0%   { opacity: 0; transform: scale(0.3) skewX(-8deg); letter-spacing: 0.8em; }
  25%  { opacity: 1; transform: scale(1.05) skewX(-8deg); letter-spacing: 0.12em; }
  40%  { transform: scale(1)    skewX(-8deg); }
  80%  { opacity: 1; transform: scale(1) skewX(-8deg); }
  100% { opacity: 0; transform: scale(0.9) skewX(-8deg); }
}

@keyframes veriko-subtitle-in {
  0%   { opacity: 0; transform: translateY(20px) skewX(-8deg); }
  30%  { opacity: 0; }
  55%  { opacity: 1; transform: translateY(0px) skewX(-8deg); }
  80%  { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes veriko-text-glow-pulse {
  0%, 100% { text-shadow:
    0 0 20px #db2777,
    0 0 60px rgba(219,39,119,0.5),
    0 2px 4px rgba(0,0,0,0.8);
  }
  50% { text-shadow:
    0 0 40px #f9a8d4,
    0 0 100px rgba(219,39,119,0.8),
    0 0 6px #fff,
    0 2px 4px rgba(0,0,0,0.8);
  }
}

.veriko-cinematic-text-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  z-index: 10;
}

/* Cinemática de Habilidade Suprema do Inimigo: Texto à esquerda para não sobrepor o Sprite integral à direita */
.enemy-ultimate-cutin-overlay .veriko-cinematic-text-wrap {
  left: 5%;
  right: auto;
  transform: translateY(-50%);
  align-items: flex-start;
  text-align: left;
  max-width: 52vw;
}

/* Cinemática de Veriko do Jogador: Texto à direita para não sobrepor o Sprite integral à esquerda */
#veriko-cinematic-overlay .veriko-cinematic-text-wrap {
  left: auto;
  right: 5%;
  transform: translateY(-50%);
  align-items: flex-end;
  text-align: right;
  max-width: 52vw;
}

.veriko-cinematic-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(0.85rem, 1.8vw, 1.3rem);
  color: #e2e8f0;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 2px;
  opacity: 0.9;
  animation: veriko-title-in 3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  -webkit-text-stroke: none;
}

.veriko-cinematic-subtitle {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 900;
  font-size: clamp(2.4rem, 6.5vw, 5.2rem);
  color: #fff;
  letter-spacing: 0.06em;
  line-height: 1.1;
  text-transform: uppercase;
  animation:
    veriko-subtitle-in 3s ease forwards,
    veriko-text-glow-pulse 0.5s ease-in-out 0.5s infinite;
  text-shadow:
    0 0 25px rgba(255,255,255,0.8),
    0 0 60px var(--glow, #f59e0b),
    0 3px 8px rgba(0,0,0,0.9);
  -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.9);
}

/* ---- Ícone/emblema central ---- */
@keyframes veriko-emblem-spin {
  0%   { transform: translate(-50%,-50%) scale(0) rotate(-180deg); opacity: 0; }
  25%  { transform: translate(-50%,-50%) scale(1.2) rotate(10deg); opacity: 0.8; }
  40%  { transform: translate(-50%,-50%) scale(1) rotate(0deg); opacity: 0.15; }
  85%  { transform: translate(-50%,-50%) scale(1.05) rotate(5deg); opacity: 0.12; }
  100% { transform: translate(-50%,-50%) scale(0.8) rotate(20deg); opacity: 0; }
}
.veriko-emblem {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(300px, 40vw);
  height: min(300px, 40vw);
  transform: translate(-50%,-50%);
  border: 3px solid rgba(219,39,119,0.4);
  border-radius: 50%;
  box-shadow:
    0 0 60px 20px rgba(219,39,119,0.2),
    inset 0 0 60px 20px rgba(147,51,234,0.1);
  animation: veriko-emblem-spin 3s ease forwards;
}

/* ---- Partículas de energia ---- */
@keyframes veriko-particle-fly {
  0%   { transform: translate(0,0) scale(1); opacity: 1; }
  100% { transform: translate(var(--px), var(--py)) scale(0); opacity: 0; }
}
.veriko-particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: veriko-particle-fly var(--dur) ease-out var(--delay) forwards;
}

/* ---- Raios/Relâmpagos (SVG gerados via JS) ---- */
.veriko-lightning-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ---- Glitch flicker no começo ---- */
@keyframes veriko-glitch {
  0%        { clip-path: inset(0 0 95% 0); transform: skewX(-5deg); }
  5%        { clip-path: inset(40% 0 50% 0); transform: skewX(3deg); }
  10%       { clip-path: inset(80% 0 10% 0); transform: skewX(-3deg); }
  15%, 100% { clip-path: inset(0 0 0 0); transform: skewX(0); }
}
.veriko-glitch-layer {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(219, 39, 119, 0.3),
    rgba(147, 51, 234, 0.3),
    transparent
  );
  animation: veriko-glitch 0.4s steps(2) forwards;
  mix-blend-mode: screen;
}

/* ---- Vinheta lateral (colunas escuras) ---- */
.veriko-vignette-left,
.veriko-vignette-right {
  position: absolute;
  top: 0; bottom: 0;
  width: 20%;
  pointer-events: none;
}
.veriko-vignette-left  { left: 0;  background: linear-gradient(90deg,  rgba(0,0,0,0.7), transparent); }
.veriko-vignette-right { right: 0; background: linear-gradient(-90deg, rgba(0,0,0,0.7), transparent); }

/* ---- Bordas de corte nas faixas ---- */
.veriko-slash::before,
.veriko-slash::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent,
    rgba(255,255,255,0.9) 20%,
    rgba(255,255,255,0.9) 80%,
    transparent
  );
  box-shadow: 0 0 10px 2px rgba(255,255,255,0.5);
}
.veriko-slash::before { top: 0; }
.veriko-slash::after  { bottom: 0; }

/* Card Pop-up Destacado de Intenção de Aliados Invocados */
.ally-intent-popup {
  position: absolute !important;
  top: 0 !important;
  left: calc(100% + 10px) !important;
  bottom: auto !important;
  transform: none !important;
  width: 260px !important;
  min-width: 260px !important;
  max-width: 280px !important;
  background: rgba(10, 18, 32, 0.95) !important;
  backdrop-filter: blur(12px) !important;
  border: 1.5px solid rgba(16, 185, 129, 0.75) !important;
  border-radius: 12px !important;
  padding: 12px 14px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9), 0 0 20px rgba(16, 185, 129, 0.35) !important;
  color: #f8fafc !important;
  z-index: 9999 !important;
  pointer-events: none !important;
  text-align: left !important;
  white-space: normal !important;
  word-break: break-word !important;
  display: none;
}

.ally-intent-popup.visible {
  display: block !important;
  animation: allyPopupFade 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@keyframes allyPopupFade {
  from { opacity: 0; transform: translateY(6px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================================================
   MODO DE VISUALIZAÇÃO DE CARTAS (FULL ART & TEXTO EXPANDIDO)
   ========================================================================== */

/* Container de Ações no Canto Superior Esquerdo da Ilustração */
.card-art-actions {
  position: absolute;
  top: 5px;
  left: 5px;
  display: flex;
  gap: 4px;
  z-index: 20;
  pointer-events: auto;
}

/* Botões de Ação na Ilustração (20% menores: 24px x 24px) */
.card-art-zoom-btn,
.card-desc-zoom-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 15, 29, 0.88);
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
  cursor: pointer;
  opacity: 0;
  pointer-events: auto;
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
  outline: none;
  padding: 0;
  font-size: 0.72rem;
  line-height: 1;
}

.card-art-zoom-btn {
  border: 1px solid rgba(251, 191, 36, 0.75);
  color: #fbbf24;
}

.card-desc-zoom-btn {
  border: 1px solid rgba(147, 197, 253, 0.75);
  color: #93c5fd;
}

/* Exibe com suavidade quando o mouse sobrepõe a carta */
.card:hover .card-art-zoom-btn,
.card:hover .card-desc-zoom-btn {
  opacity: 0.75;
}

/* Destaque quando o cursor passa direto no botão */
.card-art-zoom-btn:hover {
  opacity: 1 !important;
  transform: scale(1.18);
  border-color: #fef08a;
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.95);
}

.card-desc-zoom-btn:hover {
  opacity: 1 !important;
  transform: scale(1.18);
  border-color: #bfdbfe;
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 0 12px rgba(96, 165, 250, 0.95);
}

/* Em dispositivos touch/mobile, mantém visível de forma confortável */
body.is-mobile .card-art-zoom-btn,
body.is-mobile .card-desc-zoom-btn {
  opacity: 0.85;
  width: 26px;
  height: 26px;
}

/* Modal do Inspetor de Cartas (Totalmente Responsivo para Monitores e Celulares) */
.card-inspector-dialog {
  max-width: 720px;
  width: min(94vw, 720px);
  max-height: 92vh;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.98) 0%, rgba(20, 29, 52, 0.98) 100%);
  border: 2px solid rgba(251, 191, 36, 0.55);
  border-radius: clamp(12px, 2.5vw, 18px);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.95), 0 0 30px rgba(251, 191, 36, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: inspectorModalAppear 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: default !important;
  position: relative;
  z-index: 10005;
  box-sizing: border-box;
}

@keyframes inspectorModalAppear {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.card-inspector-header {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.35);
  gap: 12px;
  box-sizing: border-box;
  width: 100%;
}

.card-inspector-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.card-inspector-title {
  font-family: 'Cinzel', 'Times New Roman', serif;
  font-size: clamp(0.95rem, 2vw, 1.25rem);
  font-weight: 800;
  color: #fffbeb;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  padding: 2px 4px;
}

.card-inspector-nav {
  display: flex;
  align-items: center;
  gap: clamp(6px, 1.5vw, 10px);
  flex-shrink: 0;
}

.card-inspector-tab-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #cbd5e1;
  font-family: 'Cinzel', 'Times New Roman', serif;
  font-size: clamp(0.76rem, 1.7vw, 0.88rem);
  font-weight: 700;
  padding: clamp(6px, 1.3vw, 8px) clamp(12px, 2.5vw, 18px);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.card-inspector-tab-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border-color: rgba(251, 191, 36, 0.5);
}

.card-inspector-tab-btn.active {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #ffffff;
  border-color: #fbbf24;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.4);
}

.card-inspector-close-btn {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  width: clamp(28px, 5vw, 34px);
  height: clamp(28px, 5vw, 34px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 4px;
  flex-shrink: 0;
}

.card-inspector-close-btn:hover {
  background: rgba(239, 68, 68, 0.8);
  color: #ffffff;
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
}

.card-inspector-body {
  padding: clamp(24px, 5.5%, 38px) clamp(16px, 4.5%, 32px) clamp(24px, 5.5%, 38px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-height: calc(92vh - 80px);
  box-sizing: border-box;
  width: 100%;
}

/* Painel de Arte Completa */
.card-inspector-art-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  padding: 0;
}

.card-inspector-full-art-container {
  width: min(512px, 86vw);
  height: min(512px, 86vw, 55vh);
  aspect-ratio: 1 / 1;
  border-radius: clamp(10px, 2vw, 14px);
  overflow: hidden;
  border: 2px solid rgba(251, 191, 36, 0.65);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.9), inset 0 0 15px rgba(0, 0, 0, 0.75);
  background-color: rgba(5, 8, 16, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-sizing: border-box;
}

.card-inspector-full-art-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Painel de Texto Expandido */
.card-inspector-text-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: clamp(10px, 2%, 20px) 0;
}

.card-inspector-desc-card {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: clamp(12px, 2.5vw, 16px);
  padding: clamp(22px, 5.5%, 38px) clamp(22px, 5.5%, 42px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  max-width: 620px;
}

.card-inspector-desc-body {
  font-size: clamp(1.1rem, 2.4vw, 1.35rem);
  line-height: 1.7;
  color: #f8fafc;
  margin: 0;
  font-weight: 500;
  text-align: center;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Nova Caixa: Texto de História (Flavor Text) */
.card-inspector-history-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: clamp(12px, 2.5vw, 16px);
  padding: clamp(16px, 4%, 24px) clamp(20px, 5%, 32px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  max-width: 620px;
  margin-top: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.card-inspector-history-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.card-inspector-history-label {
  font-family: var(--font-title);
  font-size: 0.85rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #fbbf24;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.card-inspector-history-body {
  font-size: clamp(0.95rem, 2.1vw, 1.15rem);
  line-height: 1.65;
  color: #cbd5e1;
  margin: 0;
  font-style: italic;
  text-align: center;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Otimização Específica para Dispositivos Móveis */
@media (max-width: 768px) {
  .card-inspector-dialog {
    width: 96vw;
    max-height: 94vh;
    border-radius: 14px;
  }
  .card-inspector-header {
    padding: 3.5% 4.5%;
  }
  .card-inspector-body {
    padding: 6% 4% 6%;
  }
  .card-inspector-desc-card {
    padding: 7% 5%;
  }
}

/* ==========================================================================
   MODAL DE DESTAQUE DE CARTA (PADRÃO UNIFICADO: REGISTRO, SELEÇÃO, ECO)
   ========================================================================== */
.standout-modal-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 95vw;
  max-height: 95vh;
}

.standout-modal-close-btn {
  position: absolute;
  top: -45px;
  right: -25px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.9);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  color: #f1f5f9;
  font-size: 1.15rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.standout-modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.9);
  border-color: #fca5a5;
  color: #ffffff;
  transform: scale(1.1);
}

.standout-card-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

/* Preview Lateral da Carta Selecionada em Combate (Anexo 3 - Mobile / Destaque Lateral) */
.battle-side-card-preview {
  position: absolute;
  left: max(16px, env(safe-area-inset-left));
  top: 60px;
  z-index: 95;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 20px rgba(56, 189, 248, 0.45));
  animation: battleSidePreviewPop 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.battle-side-card-preview.hidden {
  display: none !important;
}

.battle-side-card-preview .card {
  margin: 0 !important;
  transform: scale(1.35) !important;
  transform-origin: top left !important;
  pointer-events: none !important;
  border-width: 2px !important;
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.6), 0 10px 30px rgba(0, 0, 0, 0.95) !important;
}

@keyframes battleSidePreviewPop {
  0% {
    opacity: 0;
    transform: translateX(-24px) scale(0.92);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@media (max-height: 520px), (max-width: 900px) and (orientation: landscape) {
  .battle-side-card-preview {
    left: max(12px, env(safe-area-inset-left));
    top: 50px;
    z-index: 100;
  }
  .battle-side-card-preview .card {
    transform: scale(1.18) !important;
  }
}

.standout-card-view {
  transform: scale(1.45) !important;
  transform-origin: center center !important;
  margin: 0 !important;
  pointer-events: auto !important;
  cursor: default !important;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.85), 0 0 35px rgba(0, 0, 0, 0.6) !important;
  transition: box-shadow 0.2s ease !important;
}

.standout-card-view:hover {
  transform: scale(1.45) !important;
  cursor: default !important;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.95), 0 0 35px rgba(251, 191, 36, 0.25) !important;
}

/* Lupa na carta em destaque: permanentemente visível, destacada e facilmente clicável */
.standout-card-view .card-art-zoom-btn {
  opacity: 0.92 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.85) !important;
}

.standout-card-view .card-art-zoom-btn:hover {
  opacity: 1 !important;
  transform: scale(1.22) !important;
  box-shadow: 0 0 18px rgba(251, 191, 36, 1) !important;
}

@media (max-width: 650px), (max-height: 700px) {
  .standout-card-view {
    transform: scale(1.15) !important;
  }
  .standout-card-view:hover {
    transform: scale(1.15) !important;
  }
  .standout-modal-close-btn {
    top: -38px;
    right: -10px;
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
  }
  .standout-card-wrapper {
    padding: 20px;
  }
}





/* --- Bestiário Expandido: Fallbacks Visuais para Inimigos Novos --- */
.sprite-enemy.fallback-gnoll { background: radial-gradient(circle, rgba(180,83,9,0.7) 0%, rgba(0,0,0,0) 70%); position: relative; }
.sprite-enemy.fallback-gnoll::before { content: '🐺'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 2.2rem; }

.sprite-enemy.fallback-pirate { background: radial-gradient(circle, rgba(30,58,138,0.7) 0%, rgba(0,0,0,0) 70%); position: relative; }
.sprite-enemy.fallback-pirate::before { content: '🏴‍☠️'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 2.2rem; }

.sprite-enemy.fallback-elemental { background: radial-gradient(circle, rgba(217,119,6,0.7) 0%, rgba(0,0,0,0) 70%); position: relative; }
.sprite-enemy.fallback-elemental::before { content: '🌪️'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 2.2rem; }

.sprite-enemy.fallback-gelatinous { background: radial-gradient(circle, rgba(34,197,94,0.7) 0%, rgba(0,0,0,0) 70%); position: relative; }
.sprite-enemy.fallback-gelatinous::before { content: '🟩'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 2.2rem; }

.sprite-enemy.fallback-lamia { background: radial-gradient(circle, rgba(236,72,153,0.7) 0%, rgba(0,0,0,0) 70%); position: relative; }
.sprite-enemy.fallback-lamia::before { content: '🐍'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 2.5rem; }

.sprite-enemy.fallback-owlbear { background: radial-gradient(circle, rgba(146,64,14,0.7) 0%, rgba(0,0,0,0) 70%); position: relative; }
.sprite-enemy.fallback-owlbear::before { content: '🦉'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 2.5rem; }

.sprite-enemy.fallback-valdez { background: radial-gradient(circle, rgba(220,38,38,0.8) 0%, rgba(0,0,0,0) 70%); position: relative; box-shadow: 0 0 25px rgba(220,38,38,0.7); }
.sprite-enemy.fallback-valdez::before { content: '⚓'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 3rem; }

.sprite-enemy.fallback-keg { background: radial-gradient(circle, rgba(234,88,12,0.8) 0%, rgba(0,0,0,0) 70%); position: relative; animation: pulse 1s infinite; }
.sprite-enemy.fallback-keg::before { content: '💣'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 2rem; }

.sprite-enemy.fallback-djinn { background: radial-gradient(circle, rgba(168,85,247,0.8) 0%, rgba(0,0,0,0) 70%); position: relative; box-shadow: 0 0 30px rgba(168,85,247,0.7); }
.sprite-enemy.fallback-djinn::before { content: '🧞'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 3rem; }

.sprite-enemy.fallback-soldier { background: radial-gradient(circle, rgba(71,85,105,0.7) 0%, rgba(0,0,0,0) 70%); position: relative; }
.sprite-enemy.fallback-soldier::before { content: '⚔️'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 2.2rem; }

.sprite-enemy.fallback-archer { background: radial-gradient(circle, rgba(14,165,233,0.7) 0%, rgba(0,0,0,0) 70%); position: relative; }
.sprite-enemy.fallback-archer::before { content: '🏹'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 2.2rem; }

.sprite-enemy.fallback-mimic { background: radial-gradient(circle, rgba(180,83,9,0.7) 0%, rgba(0,0,0,0) 70%); position: relative; }
.sprite-enemy.fallback-mimic::before { content: '📦'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 2.2rem; }

.sprite-enemy.fallback-mecha { background: radial-gradient(circle, rgba(234,179,8,0.7) 0%, rgba(0,0,0,0) 70%); position: relative; box-shadow: 0 0 25px rgba(234,179,8,0.6); }
.sprite-enemy.fallback-mecha::before { content: '🤖'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 2.8rem; }

.sprite-enemy.fallback-mui { background: radial-gradient(circle, rgba(13,148,136,0.8) 0%, rgba(0,0,0,0) 70%); position: relative; box-shadow: 0 0 30px rgba(13,148,136,0.7); }
.sprite-enemy.fallback-mui::before { content: '🧪'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 3rem; }

.sprite-enemy.fallback-banthalon { background: radial-gradient(circle, rgba(202,138,4,0.8) 0%, rgba(0,0,0,0) 70%); position: relative; box-shadow: 0 0 30px rgba(202,138,4,0.7); }
.sprite-enemy.fallback-banthalon::before { content: '🛡️'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 3rem; }

.sprite-enemy.fallback-crawler { background: radial-gradient(circle, rgba(100,116,139,0.7) 0%, rgba(0,0,0,0) 70%); position: relative; }
.sprite-enemy.fallback-crawler::before { content: '🕷️'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 2.2rem; }

.sprite-enemy.fallback-cultist { background: radial-gradient(circle, rgba(88,28,135,0.7) 0%, rgba(0,0,0,0) 70%); position: relative; }
.sprite-enemy.fallback-cultist::before { content: '🕯️'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 2.2rem; }

.sprite-enemy.fallback-mutant { background: radial-gradient(circle, rgba(132,204,22,0.7) 0%, rgba(0,0,0,0) 70%); position: relative; }
.sprite-enemy.fallback-mutant::before { content: '🧬'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 2.5rem; }

.sprite-enemy.fallback-echo { background: radial-gradient(circle, rgba(6,182,212,0.7) 0%, rgba(0,0,0,0) 70%); position: relative; }
.sprite-enemy.fallback-echo::before { content: '⏳'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 2.2rem; }

.sprite-enemy.fallback-mindflayer { background: radial-gradient(circle, rgba(147,51,234,0.7) 0%, rgba(0,0,0,0) 70%); position: relative; }
.sprite-enemy.fallback-mindflayer::before { content: '🦑'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 2.5rem; }

.sprite-enemy.fallback-knight { background: radial-gradient(circle, rgba(51,65,85,0.8) 0%, rgba(0,0,0,0) 70%); position: relative; }
.sprite-enemy.fallback-knight::before { content: '💀'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 2.5rem; }

.sprite-enemy.fallback-miramar { background: radial-gradient(circle, rgba(192,38,211,0.8) 0%, rgba(0,0,0,0) 70%); position: relative; box-shadow: 0 0 30px rgba(192,38,211,0.7); }
.sprite-enemy.fallback-miramar::before { content: '🔮'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 2.8rem; }

.sprite-enemy.fallback-sinisther { background: radial-gradient(circle, rgba(153,27,27,0.8) 0%, rgba(0,0,0,0) 70%); position: relative; box-shadow: 0 0 30px rgba(153,27,27,0.7); }
.sprite-enemy.fallback-sinisther::before { content: '🗡️'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 2.8rem; }

.sprite-enemy.fallback-kundalinny { background: radial-gradient(circle, rgba(124,58,237,0.9) 0%, rgba(0,0,0,0) 70%); position: relative; box-shadow: 0 0 35px rgba(124,58,237,0.8); }
.sprite-enemy.fallback-kundalinny::before { content: '🧙'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 3rem; }

.sprite-enemy.fallback-brodar { background: radial-gradient(circle, rgba(249,115,22,0.8) 0%, rgba(0,0,0,0) 70%); position: relative; box-shadow: 0 0 25px rgba(249,115,22,0.6); }
.sprite-enemy.fallback-brodar::before { content: '🥋'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 2.8rem; }

.sprite-enemy.fallback-rufallo { background: radial-gradient(circle, rgba(59,130,246,0.8) 0%, rgba(0,0,0,0) 70%); position: relative; box-shadow: 0 0 25px rgba(59,130,246,0.6); }
.sprite-enemy.fallback-rufallo::before { content: '🦏'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 2.8rem; }

.sprite-enemy.fallback-parasite { background: radial-gradient(circle, rgba(225,29,72,0.9) 0%, rgba(0,0,0,0) 70%); position: relative; box-shadow: 0 0 45px rgba(225,29,72,0.9); animation: pulse 1.8s infinite; }
.sprite-enemy.fallback-parasite::before { content: '👁️'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 3.2rem; }

/* ==========================================================================
   JUKEBOX - TOP BAR PLAYER & LAYOUT OVERRIDES
   ========================================================================== */
#jukebox-player-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 40px;
  background: rgba(13, 17, 28, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1.5px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: 0 20px;
  box-sizing: border-box;
  transition: transform 0.3s ease;
}

body.has-jukebox #game-hud {
  top: 40px !important;
}

body.has-jukebox .user-profile-header {
  top: 50px !important;
}

.jukebox-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 1.5px;
  color: #f59e0b;
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
  user-select: none;
}

.jukebox-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.jukebox-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #e2e8f0;
  width: 32px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.jukebox-btn:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
  color: #fbbf24;
  transform: translateY(-1px);
}

.jukebox-play-btn {
  width: 36px;
  font-size: 0.95rem;
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.jukebox-loop-btn.active,
.jukebox-shuffle-btn.active {
  background: rgba(245, 158, 11, 0.3);
  border-color: #f59e0b;
  color: #fbbf24;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.jukebox-select {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 6px;
  color: #f1f5f9;
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  padding: 4px 10px;
  max-width: 380px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.jukebox-select:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

@media (max-width: 768px) {
  #jukebox-player-bar {
    padding: 0 10px;
    gap: 8px;
  }
  .jukebox-brand {
    display: none;
  }
  .jukebox-select {
    max-width: 180px;
    font-size: 0.75rem;
  }
}

/* =========================================================================
   UX: SELEÇÃO DE ARTEFATO INICIAL NO MENU DE PERSONAGENS
   ========================================================================= */
.relic-select-section {
  margin-top: 15px;
  width: 100%;
}

.relic-select-section h4 {
  font-size: 0.92rem;
  color: #94a3b8;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.relic-select-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.65);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-height: 120px;
  overflow-y: auto;
  box-sizing: border-box;
}

.relic-select-row::-webkit-scrollbar {
  width: 5px;
}
.relic-select-row::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.relic-select-card {
  width: 48px;
  height: 48px;
  padding: 0 !important;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  cursor: pointer;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.relic-select-card:hover {
  transform: translateY(-2px) scale(1.05);
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.relic-select-card.selected {
  border-color: #fbbf24 !important;
  background: rgba(251, 191, 36, 0.18) !important;
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.6) !important;
  transform: scale(1.08);
  z-index: 2;
}

.relic-select-icon {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: block;
}

.relic-none-icon {
  font-size: 1.25rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.artifact-selected-desc-box {
  margin-top: 10px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(30, 41, 59, 0.85) 100%);
  border: 1.5px solid rgba(251, 191, 36, 0.3);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  animation: fadeIn 0.2s ease-in-out;
}

/* =========================================================================
   ALIADOS INVOCADOS: POSICIONAMENTO DA INTENÇÃO E BOTÃO DE LUPA
   ========================================================================= */
.ally-wrapper {
  position: relative !important;
  overflow: visible !important;
}

.ally-intent {
  top: -52px !important;
  transform: translateX(-50%) !important;
  white-space: nowrap !important;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.7), 0 0 8px rgba(0, 210, 255, 0.25) !important;
}

.sprite-ally {
  position: relative !important;
}

.ally-inspect-btn {
  position: absolute !important;
  top: 4px !important;
  right: 4px !important;
  width: 22px !important;
  height: 22px !important;
  border-radius: 5px !important;
  background: rgba(15, 23, 42, 0.85) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  color: #fff !important;
  font-size: 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  z-index: 25 !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.6) !important;
  padding: 0 !important;
  line-height: 1 !important;
}

.ally-inspect-btn:hover {
  transform: scale(1.18) !important;
  background: rgba(0, 210, 255, 0.4) !important;
  border-color: #00d2ff !important;
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.7) !important;
}

/* Scrollbars para os modais */
#options-modal .modal-content::-webkit-scrollbar,
#ally-inspection-modal .modal-content::-webkit-scrollbar {
  width: 6px;
}
#options-modal .modal-content::-webkit-scrollbar-track,
#ally-inspection-modal .modal-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
}
#options-modal .modal-content::-webkit-scrollbar-thumb,
#ally-inspection-modal .modal-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}
#options-modal .modal-content::-webkit-scrollbar-thumb:hover,
#ally-inspection-modal .modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 210, 255, 0.5);
}

/* =========================================================================
   LUPA DE AMPLIAÇÃO & ÍCONE DE LOG / INTENÇÃO (TAMANHO REAL E AÇÕES)
   ========================================================================= */
.entity-art-zoom-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 15, 29, 0.88);
  backdrop-filter: blur(6px);
  border: 1.5px solid rgba(251, 191, 36, 0.75);
  color: #fbbf24;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
  cursor: pointer;
  opacity: 0;
  pointer-events: auto;
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
  outline: none;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1;
  z-index: 35;
}

/* Ícone de Log / Próximo Ataque (Alinhado exatamente abaixo da Lupa) */
.entity-art-action-btn {
  position: absolute;
  top: 42px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 15, 29, 0.88);
  backdrop-filter: blur(6px);
  border: 1.5px solid rgba(56, 189, 248, 0.75);
  color: #38bdf8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
  cursor: pointer;
  opacity: 0;
  pointer-events: auto;
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
  outline: none;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1;
  z-index: 35;
}

.entity-art-action-btn.intent-action {
  border-color: rgba(248, 113, 113, 0.75);
  color: #f87171;
}

/* Na seleção de personagens (dentro do avatar circular) */
.char-card-avatar {
  position: relative !important;
}

.char-card-avatar .entity-art-zoom-btn {
  top: -2px;
  right: -2px;
  width: 24px;
  height: 24px;
  font-size: 0.75rem;
}

/* No Nexus: Heróis, Artefatos e Conquistas */
.char-card-avatar-wrapper,
.relic-icon-wrapper,
.achievement-icon-wrapper {
  position: relative !important;
}

.char-card-avatar-wrapper .entity-art-zoom-btn,
.relic-icon-wrapper .entity-art-zoom-btn,
.achievement-icon-wrapper .entity-art-zoom-btn {
  top: -2px;
  right: -2px;
  width: 24px;
  height: 24px;
  font-size: 0.75rem;
}

/* Exibe a lupa e o ícone de ação suavemente no hover do personagem ou inimigo */
.sprite-container:hover .entity-art-zoom-btn,
.sprite-container:hover .entity-art-action-btn,
.combatant-wrapper:hover .entity-art-zoom-btn,
.combatant-wrapper:hover .entity-art-action-btn,
.char-card:hover .entity-art-zoom-btn,
.char-card-avatar:hover .entity-art-zoom-btn,
.unlocked-item:hover .entity-art-zoom-btn,
.char-card-avatar-wrapper:hover .entity-art-zoom-btn,
.relic-icon-wrapper:hover .entity-art-zoom-btn,
.achievement-icon-wrapper:hover .entity-art-zoom-btn,
.achievements-grid > div:hover .entity-art-zoom-btn {
  opacity: 0.85;
}

/* Destaque no hover direto dos botões */
.entity-art-zoom-btn:hover {
  opacity: 1 !important;
  transform: scale(1.22);
  border-color: #fef08a;
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.95);
}

.entity-art-action-btn:hover {
  opacity: 1 !important;
  transform: scale(1.22);
  border-color: #7dd3fc;
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.95);
}

.entity-art-action-btn.intent-action:hover {
  border-color: #fca5a5;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.95);
}

/* Em dispositivos mobile touch */
body.is-mobile .entity-art-zoom-btn,
body.is-mobile .entity-art-action-btn {
  opacity: 0.85;
  width: 32px;
  height: 32px;
  font-size: 0.95rem;
}

body.is-mobile .entity-art-action-btn {
  top: 46px;
}

/* Dialog e Conteúdo de Visualização em Tamanho Real */
.entity-inspector-dialog {
  max-width: 820px;
  width: min(94vw, 820px);
  max-height: 94vh;
}

.entity-inspector-badge {
  font-family: 'Cinzel', 'Times New Roman', serif;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-left: 8px;
}

.entity-inspector-badge.badge-hero {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.5);
}

.entity-inspector-badge.badge-enemy {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.5);
}

.entity-inspector-badge.badge-boss {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.35), rgba(168, 85, 247, 0.35));
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.8);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.entity-inspector-badge.badge-elite {
  background: rgba(168, 85, 247, 0.25);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.6);
}

.entity-inspector-art-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
}

.entity-inspector-full-art-container {
  width: min(660px, 88vw);
  height: min(660px, 88vw, 68vh);
  border-radius: clamp(10px, 2vw, 14px);
  overflow: auto;
  border: 2px solid rgba(251, 191, 36, 0.65);
  box-shadow: 0 0 35px rgba(0, 0, 0, 0.95), inset 0 0 25px rgba(0, 0, 0, 0.85);
  background: radial-gradient(circle at center, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.95) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-sizing: border-box;
  padding: 12px;
}

.entity-inspector-full-art-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 20px rgba(0, 0, 0, 0.85));
  transition: transform 0.25s ease;
  user-select: none;
  cursor: zoom-in;
}

.entity-inspector-full-art-img.zoom-100 {
  max-width: none !important;
  max-height: none !important;
  width: auto !important;
  height: auto !important;
  cursor: zoom-out !important;
}

.entity-inspector-subtitle {
  margin-top: 14px;
  margin-bottom: 6px;
  font-size: 0.92rem;
  color: #94a3b8;
  text-align: center;
  max-width: 620px;
  line-height: 1.5;
}

.entity-inspector-zoom-toggle {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #cbd5e1;
  padding: 5px 16px;
  border-radius: 16px;
  font-size: 0.8rem;
  font-family: var(--font-title);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.entity-inspector-zoom-toggle:hover {
  background: rgba(251, 191, 36, 0.2);
  border-color: #fbbf24;
  color: #fff;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
}

/* =========================================================================
   TELA DE FINAL DE PERSONAGEM (VISUAL NOVEL DE CAMPANHA)
   ========================================================================= */
#screen-ending {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  overflow: hidden;
  background: #000;
  z-index: 9999 !important;
}

#ending-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-size: cover;
  background-position: center;
  z-index: 1;
}

#screen-ending.sword-shake {
  animation: endingScreenShake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes endingScreenShake {
  10%, 90% { transform: translate3d(-3px, 0, 0); }
  20%, 80% { transform: translate3d(5px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
  40%, 60% { transform: translate3d(6px, 0, 0); }
}

.ending-char-slot {
  transition: opacity 0.35s ease, filter 0.35s ease, transform 0.35s ease;
  pointer-events: none;
}

.ending-char-slot img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 25px rgba(0, 0, 0, 0.8));
}

.ending-char-slot.speaker-active {
  opacity: 1 !important;
  filter: brightness(1.08) drop-shadow(0 0 20px rgba(251, 191, 36, 0.45));
  transform: translateY(-4px) scale(1.02);
}

.ending-char-slot.speaker-dim {
  opacity: 0.45 !important;
  filter: brightness(0.65) grayscale(25%);
  transform: translateY(0) scale(1);
}

.ending-dialog-box {
  background: rgba(10, 15, 28, 0.40) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  border: 1.5px solid rgba(218, 165, 32, 0.5) !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6) !important;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
  user-select: none;
}

.ending-dialog-box:hover {
  border-color: rgba(251, 191, 36, 0.85) !important;
  box-shadow: 0 10px 45px rgba(0, 0, 0, 0.8), 0 0 25px rgba(251, 191, 36, 0.35) !important;
}

.ending-typewriter-text {
  min-height: 80px;
  word-break: break-word;
}

/* Event Screen Fullscreen */
#screen-event {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 85 !important;
}

/* =========================================================================
   NEXUS: ABA "A HISTÓRIA" (CAPÍTULOS E FINAIS)
   ========================================================================= */
#shop-panel-story.rewards-list-panel {
  height: auto;
  min-height: unset;
  max-height: none;
  overflow: visible;
}

.story-chapters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 8px 6px;
  max-height: 58vh;
  overflow-y: auto;
  overflow-x: hidden;
  align-content: start;
}

.story-chapter-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid var(--glass-border);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: visible;
  min-height: 290px;
  height: auto;
  box-sizing: border-box;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.story-chapter-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
}

.story-chapter-card.unlocked {
  border-color: rgba(245, 158, 11, 0.6);
  background: linear-gradient(135deg, rgba(20, 25, 45, 0.9) 0%, rgba(35, 25, 15, 0.85) 100%);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.15);
}

.story-chapter-card.unlocked:hover {
  border-color: #fbbf24;
  box-shadow: 0 6px 30px rgba(245, 158, 11, 0.35);
}

.story-chapter-card.locked {
  opacity: 0.65;
  filter: grayscale(80%);
  background: rgba(10, 15, 25, 0.6);
  border-color: rgba(255, 255, 255, 0.08);
}

.story-chapter-thumb-wrapper {
  position: relative;
  width: 100%;
  height: 140px;
  border-radius: 10px;
  overflow: hidden;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.story-chapter-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.story-chapter-card.unlocked:hover .story-chapter-thumb {
  transform: scale(1.05);
}

.story-chapter-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(15, 23, 42, 0.9);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  font-family: var(--font-title);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.story-chapter-card.unlocked .story-chapter-badge {
  background: rgba(245, 158, 11, 0.25);
  color: #fef08a;
  border-color: rgba(245, 158, 11, 0.6);
}

.story-chapter-card.locked .story-chapter-badge {
  color: #94a3b8;
}

.story-chapter-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.story-chapter-title {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
}

.story-chapter-card.unlocked .story-chapter-title {
  color: #fef08a;
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.story-chapter-hero {
  font-size: 0.85rem;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.story-chapter-desc {
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.4;
  margin-top: 4px;
}

.btn-replay-story {
  margin-top: 6px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-replay-story:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.6);
}

/* ========================================================
   FASE 3: DESBLOQUEIOS TRIUNFAIS (HERÓIS, ARTEFATOS, CONQUISTAS)
   ======================================================== */

/* 1. Cinemática de Desbloqueio de Novo Herói */
.hero-unlock-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.85) 0%, rgba(2, 6, 23, 0.98) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(8px);
}

.hero-unlock-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.hero-unlock-spotlight {
  position: absolute;
  width: 450px;
  height: 450px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.35) 0%, rgba(245, 158, 11, 0.08) 50%, transparent 70%);
  filter: blur(25px);
  animation: unlock-spotlight-pulse 3s infinite alternate ease-in-out;
  pointer-events: none;
}

@keyframes unlock-spotlight-pulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.15); opacity: 1; }
}

.hero-unlock-shockwave {
  position: absolute;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px solid rgba(251, 191, 36, 0.9);
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.8), inset 0 0 20px rgba(245, 158, 11, 0.6);
  opacity: 0;
  pointer-events: none;
}

.hero-unlock-shockwave.fire {
  animation: shockwave-expand 1.2s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes shockwave-expand {
  0% { transform: scale(0.2); opacity: 1; border-width: 8px; }
  70% { opacity: 0.8; }
  100% { transform: scale(7.5); opacity: 0; border-width: 1px; }
}

.hero-unlock-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  transform: scale(0.7);
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hero-unlock-overlay.active .hero-unlock-container {
  transform: scale(1);
  opacity: 1;
}

.hero-unlock-avatar-box {
  width: 220px;
  height: 220px;
  border-radius: 24px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 40px rgba(245, 158, 11, 0.4);
  background: rgba(15, 23, 42, 0.9);
  border: 2px solid rgba(245, 158, 11, 0.6);
  overflow: hidden;
}

.hero-unlock-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.hero-unlock-badge {
  font-family: var(--font-title);
  font-size: 0.85rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #fbbf24;
  font-weight: 800;
  margin-bottom: 8px;
  text-shadow: 0 0 12px rgba(245, 158, 11, 0.8);
}

.hero-unlock-title {
  font-family: var(--font-title);
  font-size: 2.4rem;
  color: #ffffff;
  font-weight: 900;
  letter-spacing: 1px;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.9), 0 0 30px rgba(245, 158, 11, 0.5);
  margin-bottom: 6px;
  text-align: center;
}

.hero-unlock-subtitle {
  font-size: 1.1rem;
  color: #cbd5e1;
  margin-bottom: 24px;
  text-align: center;
  max-width: 480px;
  line-height: 1.5;
}

.hero-unlock-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
  color: #ffffff;
  border: 1px solid rgba(254, 240, 138, 0.4);
  padding: 14px 36px;
  border-radius: 12px;
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(245, 158, 11, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.4);
  transition: all 0.25s ease;
}

.hero-unlock-btn:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 15px 40px rgba(245, 158, 11, 0.6), inset 0 1px 2px rgba(255, 255, 255, 0.7);
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
}

/* 2. Pedestal de Apresentação de Artefatos */
.relic-pedestal-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 20px;
}

.relic-pedestal-light-ray {
  position: absolute;
  top: -40px;
  width: 140px;
  height: 220px;
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.25) 0%, rgba(14, 165, 233, 0.05) 75%, transparent 100%);
  clip-path: polygon(30% 0%, 70% 0%, 100% 100%, 0% 100%);
  pointer-events: none;
  animation: pedestal-light-pulse 3s infinite ease-in-out alternate;
}

@keyframes pedestal-light-pulse {
  0% { opacity: 0.5; transform: scaleX(0.9); }
  100% { opacity: 0.9; transform: scaleX(1.15); }
}

.relic-floating-item {
  width: 80px;
  height: 80px;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 15px 20px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 18px rgba(56, 189, 248, 0.7));
  animation: relic-bobbing 2.6s infinite ease-in-out alternate;
}

@keyframes relic-bobbing {
  0% { transform: translateY(0px) rotate(-1deg); }
  100% { transform: translateY(-14px) rotate(2deg); }
}

.relic-pedestal-base {
  width: 110px;
  height: 18px;
  background: radial-gradient(ellipse at center, rgba(56, 189, 248, 0.7) 0%, rgba(14, 165, 233, 0.2) 60%, transparent 80%);
  border-radius: 50%;
  filter: blur(4px);
  margin-top: 8px;
  animation: pedestal-shadow-pulse 2.6s infinite ease-in-out alternate;
}

@keyframes pedestal-shadow-pulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(0.7); opacity: 0.4; }
}

/* 3. Toasts de Conquistas Estilizados (Estilo Real) */
.achievement-toast-royal {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10000000 !important; /* Prioridade máxima absoluta na tela (acima de baú, cinemáticas, telas e modais) */
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  background: linear-gradient(135deg, rgba(20, 24, 38, 0.98) 0%, rgba(10, 13, 24, 0.99) 100%);
  border: 1.5px solid rgba(245, 158, 11, 0.9);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.9), 0 0 35px rgba(245, 158, 11, 0.6);
  backdrop-filter: blur(12px);
  overflow: hidden;
  transform: translateX(120%);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
  opacity: 0;
  pointer-events: none;
}

.achievement-toast-royal.show {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.achievement-toast-royal::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -150%;
  width: 80%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: rotate(30deg);
  pointer-events: none;
}

.achievement-toast-royal.show::before {
  animation: toast-sheen-slide 2.2s infinite 0.6s ease-in-out;
}

@keyframes toast-sheen-slide {
  0% { left: -150%; }
  60%, 100% { left: 200%; }
}

.achievement-crest-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.8));
  display: flex;
  align-items: center;
  justify-content: center;
}

.achievement-toast-content {
  display: flex;
  flex-direction: column;
}

.achievement-toast-header {
  font-family: var(--font-title);
  font-size: 0.75rem;
  letter-spacing: 2px;
  color: #fbbf24;
  text-transform: uppercase;
  font-weight: 800;
}

.achievement-toast-name {
  font-family: var(--font-title);
  font-size: 1.05rem;
  color: #ffffff;
  font-weight: 800;
  margin-top: 2px;
}

.achievement-toast-desc {
  font-size: 0.82rem;
  color: #94a3b8;
  margin-top: 2px;
  max-width: 280px;
}

/* ========================================================
   FASE 4: DESINTEGRAÇÃO DE INIMIGOS E MORTE DE BOSSES
   ======================================================== */

/* 1. Morte de Inimigos Comuns: Estilhaçamento e Dissolução */
.enemy-shattering {
  pointer-events: none !important;
  animation: enemy-shatter-dissolve 0.85s cubic-bezier(0.25, 1, 0.5, 1) forwards !important;
}

@keyframes enemy-shatter-dissolve {
  0% {
    transform: scale(1) translateY(0) rotate(0deg);
    filter: brightness(1) drop-shadow(0 0 0 rgba(255, 255, 255, 0));
    opacity: 1;
  }
  25% {
    transform: scale(1.08) translateY(-8px) rotate(-3deg);
    filter: brightness(2.2) contrast(1.4) drop-shadow(0 0 20px rgba(239, 68, 68, 0.9));
  }
  45% {
    transform: scale(1.02) translateY(6px) rotate(4deg);
    filter: brightness(3) drop-shadow(0 0 35px rgba(255, 255, 255, 1));
    opacity: 0.9;
  }
  75% {
    transform: scale(0.75) translateY(25px) rotate(12deg);
    filter: blur(4px) brightness(1.5);
    opacity: 0.35;
  }
  100% {
    transform: scale(0.3) translateY(50px) rotate(25deg);
    filter: blur(12px) brightness(0.2);
    opacity: 0;
  }
}

/* Partículas de Fragmento de Vidro Mágico (Fragmenta) */
.glass-shard-particle {
  position: absolute;
  pointer-events: none;
  z-index: 800;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(56, 189, 248, 0.7) 50%, rgba(147, 51, 234, 0.8) 100%);
  clip-path: polygon(50% 0%, 100% 70%, 75% 100%, 0% 80%);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.9);
  animation: shard-physics 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes shard-physics {
  0% {
    transform: translate(0, 0) scale(1) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate(var(--shard-vx, 40px), var(--shard-vy, 60px)) scale(0) rotate(var(--shard-rot, 180deg));
    opacity: 0;
  }
}

/* 2. Morte de Chefes de Ato (Cinemática Triunfal) */
.boss-death-bars {
  position: fixed;
  inset: 0;
  z-index: 99990;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.boss-death-bar-top,
.boss-death-bar-bottom {
  height: 0px;
  background: #000000;
  transition: height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.boss-death-bars.active .boss-death-bar-top,
.boss-death-bars.active .boss-death-bar-bottom {
  height: 60px;
}

.boss-slash-cut {
  position: absolute;
  height: 4px;
  background: linear-gradient(90deg, transparent 0%, #ffffff 50%, transparent 100%);
  box-shadow: 0 0 25px #ffffff, 0 0 50px rgba(239, 68, 68, 0.9);
  pointer-events: none;
  z-index: 99995;
  transform-origin: center center;
  animation: slash-cut-anim 0.45s ease-out forwards;
}

@keyframes slash-cut-anim {
  0% {
    width: 0%;
    opacity: 1;
    transform: scaleY(2.5);
  }
  50% {
    width: 140%;
    opacity: 1;
    transform: scaleY(4);
  }
  100% {
    width: 160%;
    opacity: 0;
    transform: scaleY(0.2);
  }
}

.boss-dying-dramatic {
  animation: boss-dramatic-death 1.6s cubic-bezier(0.22, 1, 0.36, 1) forwards !important;
  pointer-events: none !important;
}

@keyframes boss-dramatic-death {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }
  20% {
    transform: scale(1.15) translateY(-10px);
    filter: brightness(3.5) drop-shadow(0 0 40px #ffffff);
  }
  40% {
    transform: scale(1.05) translateY(-5px);
    filter: brightness(1.8) drop-shadow(0 0 50px rgba(245, 158, 11, 0.9));
  }
  65% {
    transform: scale(1.2) translateY(-15px);
    filter: brightness(4) drop-shadow(0 0 70px #ffffff);
    opacity: 0.95;
  }
  100% {
    transform: scale(0.1) translateY(40px) rotate(15deg);
    filter: blur(20px) brightness(5);
    opacity: 0;
  }
}

/* Explosão de Centelhas em Direção ao HUD */
.sparks-flying-particle {
  position: fixed;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle, #fde047 0%, #f59e0b 60%, transparent 100%);
  box-shadow: 0 0 15px #fde047, 0 0 30px #f59e0b;
  pointer-events: none;
  z-index: 99997;
  transition: all 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Modo de Foco da Derrota de Boss: Esconde toda a HUD e o herói para focar exclusivamente na morte do Chefe */
.boss-death-focus-mode .player-side-container,
.boss-death-focus-mode .battle-controls-container,
.boss-death-focus-mode #hud,
.boss-death-focus-mode #battle-terrain-container,
.boss-death-focus-mode .active-terrain-indicator,
.boss-death-focus-mode .targeting-svg-layer,
.boss-death-focus-mode #floating-text-layer {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: opacity 0.35s ease, visibility 0.35s ease !important;
}

/* ============================================================
   ANIMAÇÕES DE MORTE DE INIMIGOS E HERÓI — Desmaterialização Espectral
   ============================================================ */

/* 1. Morte de Inimigo Comum / Elite: Desmaterialização Espectral em ondas com a cor de alma do adversário */
.sprite-container.enemy-death-common,
.enemy-death-common,
.sprite-container.enemy-death-elite,
.enemy-death-elite {
  pointer-events: none !important;
  animation: enemy-spectral-dematerialize-anim 1.45s cubic-bezier(0.2, 0.8, 0.25, 1) forwards !important;
}

.dead,
.sprite-container.dead,
.combatant-wrapper.dead {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

@keyframes enemy-spectral-dematerialize-anim {
  0% {
    transform: scale(1) translateY(0) rotate(0deg);
    filter: brightness(1) drop-shadow(0 0 0 rgba(255, 255, 255, 0));
    opacity: 1;
  }
  15% {
    transform: scale(1.08) translateY(-8px) rotate(1deg);
    filter: brightness(3.5) drop-shadow(0 0 25px var(--spectral-color, #38bdf8)) drop-shadow(0 0 45px var(--spectral-color, #38bdf8));
    opacity: 1;
  }
  35% {
    transform: scale(1.02) translateY(-18px) rotate(-1deg);
    filter: brightness(2.2) drop-shadow(0 0 35px var(--spectral-color, #38bdf8));
    opacity: 0.85;
  }
  60% {
    transform: scale(0.92) translateY(-38px) scaleX(0.95);
    filter: brightness(1.6) blur(2.5px) drop-shadow(0 0 25px var(--spectral-color, #38bdf8));
    opacity: 0.5;
  }
  85% {
    transform: scale(0.82) translateY(-60px) scaleX(0.85);
    filter: brightness(1.2) blur(6px) drop-shadow(0 0 15px var(--spectral-color, #38bdf8));
    opacity: 0.2;
  }
  100% {
    transform: scale(0.7) translateY(-85px) scaleX(0.7);
    filter: brightness(0.8) blur(12px);
    opacity: 0;
  }
}

/* 3. Morte do Herói e Ecos: Desmaterialização espectral personalizada com brilho e flutuação fantasmagórica */
.player-defeat-anim,
.spectral-echo-dematerialize {
  pointer-events: none !important;
  animation: spectral-echo-dematerialize-keyframes 1.5s cubic-bezier(0.2, 0.8, 0.25, 1) forwards !important;
}

@keyframes spectral-echo-dematerialize-keyframes {
  0% {
    transform: scale(1) translateY(0) rotate(0deg);
    filter: brightness(1) drop-shadow(0 0 0 rgba(255, 255, 255, 0));
    opacity: 1;
  }
  15% {
    transform: scale(1.08) translateY(-10px) rotate(1deg);
    filter: brightness(3.5) drop-shadow(0 0 25px var(--spectral-color, #ef4444)) drop-shadow(0 0 45px var(--spectral-color, #ef4444));
    opacity: 1;
  }
  35% {
    transform: scale(1.02) translateY(-20px) rotate(-1deg);
    filter: brightness(2.2) drop-shadow(0 0 35px var(--spectral-color, #ef4444));
    opacity: 0.85;
  }
  60% {
    transform: scale(0.92) translateY(-40px) scaleX(0.95);
    filter: brightness(1.6) blur(2.5px) drop-shadow(0 0 25px var(--spectral-color, #ef4444));
    opacity: 0.5;
  }
  85% {
    transform: scale(0.82) translateY(-65px) scaleX(0.85);
    filter: brightness(1.2) blur(6px) drop-shadow(0 0 15px var(--spectral-color, #ef4444));
    opacity: 0.2;
  }
  100% {
    transform: scale(0.7) translateY(-90px) scaleX(0.7);
    filter: brightness(0.8) blur(12px);
    opacity: 0;
  }
}

/* Partícula espectral de alma ascendente */
.spectral-wisp-particle {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 99995;
  opacity: 1;
  animation: spectral-wisp-float 1.2s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}

@keyframes spectral-wisp-float {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
  100% {
    transform: translate(var(--wisp-vx, 0px), var(--wisp-vy, -80px)) scale(0.2);
    opacity: 0;
  }
}

/* Fragmento de morte de Elite */
.enemy-death-shard {
  position: fixed;
  border-radius: 2px;
  pointer-events: none;
  z-index: 99990;
  opacity: 1;
  animation: enemy-shard-fly 0.9s cubic-bezier(0.2, 0.8, 0.4, 1) forwards;
}

@keyframes enemy-shard-fly {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
    opacity: 1;
  }
  60% {
    opacity: 0.85;
  }
  100% {
    transform: translate(var(--shard-vx), var(--shard-vy)) rotate(var(--shard-rot)) scale(0.3);
    opacity: 0;
  }
}

/* Partícula de poeira de morte de Comum */
.enemy-death-dust {
  position: fixed;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200,180,140,0.9) 0%, rgba(120,100,80,0.4) 70%, transparent 100%);
  pointer-events: none;
  z-index: 99989;
  opacity: 1;
  animation: enemy-dust-fly 0.7s ease-out forwards;
}

@keyframes enemy-dust-fly {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 0.8;
  }
  100% {
    transform: translate(var(--dust-vx), var(--dust-vy)) scale(0.2);
    opacity: 0;
  }
}

/* ========================================================
   FASE 6: VAMPIRE SURVIVORS CHEST CINEMATIC & SUPER JUICE
   ======================================================== */

/* 1. Efeito de Pulso no Botão de Baú da Vitória */
.btn-chest-pulse {
  animation: chestBtnGlow 1.8s infinite ease-in-out;
}

@keyframes chestBtnGlow {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.6);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 32px rgba(251, 191, 36, 0.95), 0 0 50px rgba(245, 158, 11, 0.5);
  }
}

/* 2. Overlay do Baú de Tesouro estilo Vampire Survivors */
.vs-chest-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.94) 0%, rgba(3, 7, 18, 0.98) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: hidden;
}

.vs-chest-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Volumetric Godrays & Aura de Luz Tridimensional (Vampire Survivors Style) */
.vs-chest-rays-container {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  overflow: hidden;
  z-index: 2;
}

.vs-chest-core-glow {
  position: absolute;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(254, 240, 138, 0.45) 0%, rgba(245, 158, 11, 0.25) 30%, rgba(180, 83, 9, 0.1) 55%, transparent 75%);
  border-radius: 50%;
  filter: blur(25px);
  animation: vsCorePulse 2.4s ease-in-out infinite alternate;
  opacity: 0;
  transition: opacity 0.5s ease;
}

@keyframes vsCorePulse {
  0% { transform: scale(0.92); opacity: 0.5; }
  100% { transform: scale(1.18); opacity: 0.95; }
}

.vs-chest-rays {
  position: absolute;
  width: 1600px;
  height: 1600px;
  background: conic-gradient(
    from 0deg,
    rgba(254, 240, 138, 0.32) 0deg 14deg,
    transparent 18deg 30deg,
    rgba(251, 191, 36, 0.35) 30deg 44deg,
    transparent 48deg 60deg,
    rgba(245, 158, 11, 0.38) 60deg 74deg,
    transparent 78deg 90deg,
    rgba(254, 240, 138, 0.32) 90deg 104deg,
    transparent 108deg 120deg,
    rgba(251, 191, 36, 0.35) 120deg 134deg,
    transparent 138deg 150deg,
    rgba(245, 158, 11, 0.38) 150deg 164deg,
    transparent 168deg 180deg,
    rgba(254, 240, 138, 0.32) 180deg 194deg,
    transparent 198deg 210deg,
    rgba(251, 191, 36, 0.35) 210deg 224deg,
    transparent 228deg 240deg,
    rgba(245, 158, 11, 0.38) 240deg 254deg,
    transparent 258deg 270deg,
    rgba(254, 240, 138, 0.32) 270deg 284deg,
    transparent 288deg 300deg,
    rgba(251, 191, 36, 0.35) 300deg 314deg,
    transparent 318deg 330deg,
    rgba(245, 158, 11, 0.38) 330deg 344deg,
    transparent 348deg 360deg
  );
  border-radius: 50%;
  -webkit-mask-image: radial-gradient(circle, rgba(0,0,0,1) 18%, rgba(0,0,0,0.55) 48%, rgba(0,0,0,0) 72%);
  mask-image: radial-gradient(circle, rgba(0,0,0,1) 18%, rgba(0,0,0,0.55) 48%, rgba(0,0,0,0) 72%);
  animation: vsRaySpin 18s linear infinite;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
  filter: drop-shadow(0 0 35px rgba(251, 191, 36, 0.8));
}

.vs-chest-rays-secondary {
  position: absolute;
  width: 1700px;
  height: 1700px;
  background: conic-gradient(
    from 15deg,
    rgba(255, 255, 255, 0.22) 0deg 8deg,
    transparent 12deg 25deg,
    rgba(253, 224, 71, 0.25) 25deg 33deg,
    transparent 38deg 50deg,
    rgba(255, 255, 255, 0.22) 50deg 58deg,
    transparent 62deg 75deg,
    rgba(253, 224, 71, 0.25) 75deg 83deg,
    transparent 88deg 100deg,
    rgba(255, 255, 255, 0.22) 100deg 108deg,
    transparent 112deg 125deg,
    rgba(253, 224, 71, 0.25) 125deg 133deg,
    transparent 138deg 150deg,
    rgba(255, 255, 255, 0.22) 150deg 158deg,
    transparent 162deg 175deg,
    rgba(253, 224, 71, 0.25) 175deg 183deg,
    transparent 188deg 200deg,
    rgba(255, 255, 255, 0.22) 200deg 208deg,
    transparent 212deg 225deg,
    rgba(253, 224, 71, 0.25) 225deg 233deg,
    transparent 238deg 250deg,
    rgba(255, 255, 255, 0.22) 250deg 258deg,
    transparent 262deg 275deg,
    rgba(253, 224, 71, 0.25) 275deg 283deg,
    transparent 288deg 300deg,
    rgba(255, 255, 255, 0.22) 300deg 308deg,
    transparent 312deg 325deg,
    rgba(253, 224, 71, 0.25) 325deg 333deg,
    transparent 338deg 350deg,
    rgba(255, 255, 255, 0.22) 350deg 358deg,
    transparent 360deg
  );
  border-radius: 50%;
  -webkit-mask-image: radial-gradient(circle, rgba(0,0,0,0.95) 15%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0) 70%);
  mask-image: radial-gradient(circle, rgba(0,0,0,0.95) 15%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0) 70%);
  animation: vsRaySpinRev 26s linear infinite;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
  filter: blur(2px);
}

.vs-chest-overlay.burst .vs-chest-core-glow,
.vs-chest-overlay.burst .vs-chest-rays,
.vs-chest-overlay.burst .vs-chest-rays-secondary {
  opacity: 1;
}

@keyframes vsRaySpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes vsRaySpinRev {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

.vs-chest-container {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 600px;
  padding: 20px;
}

.vs-chest-badge {
  font-family: var(--font-title);
  font-size: 0.95rem;
  letter-spacing: 3px;
  font-weight: 800;
  text-transform: uppercase;
  color: #fbbf24;
  margin-bottom: 8px;
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.9);
}

.vs-chest-title {
  font-family: var(--font-title);
  font-size: 2.3rem;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 25px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9), 0 0 25px rgba(245, 158, 11, 0.7);
}

.vs-chest-stage {
  position: relative;
  width: 240px;
  height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 30px;
  user-select: none;
}

.vs-chest-box {
  width: 190px;
  height: 160px;
  position: relative;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.25);
  user-select: none;
}

.vs-chest-gif-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 20px rgba(251, 191, 36, 0.6));
  transition: filter 0.3s ease, transform 0.3s ease;
}

.vs-chest-pedestal {
  width: 150px;
  height: 18px;
  background: radial-gradient(ellipse, rgba(251, 191, 36, 0.7) 0%, rgba(245, 158, 11, 0.3) 50%, transparent 80%);
  border-radius: 50%;
  filter: blur(4px);
  margin-top: -12px;
  position: relative;
  z-index: 1;
}

/* Animação de tremor do baú (Rumble) */
.vs-chest-box.rumbling {
  animation: vsChestRumble 0.07s infinite alternate !important;
}

.vs-chest-box.rumbling .vs-chest-gif-img {
  filter: drop-shadow(0 0 35px rgba(254, 240, 138, 1)) drop-shadow(0 0 60px rgba(251, 191, 36, 0.8)) brightness(1.25);
}

@keyframes vsChestRumble {
  0% { transform: translate(-4px, 2px) rotate(-3deg) scale(1.04); }
  50% { transform: translate(4px, -3px) rotate(3deg) scale(1.08); }
  100% { transform: translate(-3px, -2px) rotate(-2deg) scale(1.1); }
}

/* Abertura e explosão do baú */
.vs-chest-overlay.burst .vs-chest-box {
  transform: translateY(20px) scale(0.92);
  filter: brightness(1.3);
  opacity: 0.85;
}

/* Modal de Limite de Artefatos (3/3) */
.relic-limit-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(245, 158, 11, 0.4);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.relic-limit-card:hover {
  border-color: #fbbf24;
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.35);
  background: rgba(30, 41, 59, 0.95);
}

.relic-limit-card img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  margin-bottom: 10px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.6));
}

.relic-limit-card .relic-limit-card-title {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 800;
  color: #fbbf24;
  margin-bottom: 4px;
}

.relic-limit-card .relic-limit-card-desc {
  font-size: 0.8rem;
  color: #cbd5e1;
  line-height: 1.35;
  margin-bottom: 12px;
  flex: 1;
}

.relic-limit-card .btn-replace-relic {
  width: 100%;
  padding: 6px 10px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid #ef4444;
  color: #fca5a5;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.relic-limit-card:hover .btn-replace-relic {
  background: #ef4444;
  color: #ffffff;
}

/* Canvas para partículas ricas do baú */
.vs-chest-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

/* Apresentação da Recompensa Revelada (Fluxo Natural sem sobreposição) */
.vs-reward-revealed {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  opacity: 0;
  transform: scale(0.85);
  transition: all 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.25);
  z-index: 20;
}

.vs-chest-overlay.revealed .vs-chest-stage {
  display: none !important;
}

.vs-chest-overlay.revealed .vs-reward-revealed {
  display: flex !important;
  opacity: 1 !important;
  transform: scale(1) !important;
  pointer-events: auto;
  animation: vsRewardFloat 3s ease-in-out infinite alternate;
}

@keyframes vsRewardFloat {
  0% { transform: translateY(0); }
  100% { transform: translateY(-8px); }
}

.vs-reward-avatar-box {
  width: 140px;
  height: 140px;
  border-radius: 24px;
  border: 4px solid #fbbf24;
  box-shadow: 0 0 45px rgba(251, 191, 36, 0.8), 0 15px 30px rgba(0,0,0,0.8);
  background: radial-gradient(circle, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  position: relative;
}

.vs-reward-avatar-box img {
  width: 85%;
  height: 85%;
  object-fit: contain;
  filter: drop-shadow(0 0 16px rgba(251, 191, 36, 0.9));
}

.vs-reward-title {
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 800;
  color: #fbbf24;
  margin-bottom: 6px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.9);
}

.vs-reward-desc {
  font-size: 0.95rem;
  color: #e2e8f0;
  max-width: 420px;
  line-height: 1.5;
  margin-bottom: 20px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

.vs-claim-btn {
  background: linear-gradient(135deg, #f59e0b, #b45309);
  color: #ffffff;
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 800;
  padding: 14px 38px;
  border-radius: 35px;
  border: 2px solid #fef08a;
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.7);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.vs-claim-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 0 45px rgba(251, 191, 36, 0.95);
}

/* Partícula de confete / estrela de explosão do baú */
.vs-chest-confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 99998;
  animation: vsConfettiFly 1.2s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes vsConfettiFly {
  0% {
    transform: translate(0, 0) scale(1) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate(var(--vs-vx), var(--vs-vy)) scale(0.4) rotate(var(--vs-rot));
    opacity: 0;
  }
}

/* 3. Super Impacto Crítico (Flash e Camera Punch) */
.super-crit-impact {
  animation: superCritFlash 0.18s ease-out;
}

@keyframes superCritFlash {
  0% {
    filter: invert(1) brightness(2.2);
  }
  50% {
    filter: brightness(1.7);
  }
  100% {
    filter: none;
  }
}

.camera-punch-super {
  animation: cameraPunchSuperAnim 0.35s cubic-bezier(0.18, 0.89, 0.32, 1.28) !important;
}

@keyframes cameraPunchSuperAnim {
  0% {
    transform: scale(1);
  }
  20% {
    transform: scale(1.08) rotate(-0.5deg);
  }
  50% {
    transform: scale(0.97) rotate(0.5deg);
  }
  80% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

/* Badge de Super Crítico */
.floating-badge-super-crit {
  display: inline-block;
  font-family: var(--font-title);
  font-size: 1.35rem;
  font-weight: 900;
  color: #fef08a;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.95), rgba(185, 28, 28, 0.95));
  border: 2px solid #fbbf24;
  border-radius: 8px;
  padding: 4px 14px;
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.9), 0 0 40px rgba(251, 191, 36, 0.8);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
  animation: superCritPulse 0.4s infinite alternate ease-in-out;
  margin-bottom: 4px;
}

@keyframes superCritPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.12); }
}

/* ==========================================================================
   ESPELHAMENTO AUTOMÁTICO DE ASSETS V2 NO LADO DIREITO (INIMIGO / PVP ECO)
   ========================================================================== */

/* Imagens v2 no lado direito da tela (lado inimigo, eco oponente, minions da direita) */
.is-v2-mirrored,
#battle-enemies-container .is-v2-asset,
#battle-enemies-container img.is-v2-asset,
.enemies-wrapper .is-v2-asset,
.enemies-wrapper img.is-v2-asset,
.sprite-enemy.is-v2-enemy .enemy-sprite-img,
.sprite-enemy.is-v2-enemy .hero-sprite-img,
.sprite-enemy.is-v2-enemy img,
#enemy-allies-container .is-v2-asset,
#enemy-allies-container img,
.enemy-allies-container .is-v2-asset,
.enemy-allies-container img,
.enemy-side .is-v2-asset,
.enemy-side .ally-sprite-img,
.opponent-side .is-v2-asset,
.opponent-side .ally-sprite-img,
.sprite-ally.is-enemy img,
.sprite-ally.is-right img,
.ally-sprite-img.is-v2-mirrored {
  transform: scaleX(-1) !important;
}

/* Proteção canônica: Lado do Jogador (esquerdo) NUNCA é espelhado */
.player-wrapper .hero-sprite-img,
.player-wrapper .is-v2-asset,
#player-side-container .is-v2-asset,
#player-side-container img.is-v2-asset,
#player-allies-container .is-v2-asset,
#player-allies-container .ally-sprite-img,
.sprite-player .is-v2-asset,
.sprite-player.is-v2-player img,
.sprite-ally:not(.is-enemy):not(.is-right) img {
  transform: none !important;
}

/* Proteção canônica: Modais de inspeção (lupa), seleção de herói e galeria NUNCA são espelhados */
.card-inspector-dialog img,
.entity-inspector-dialog img,
.entity-inspector-full-art-img,
.hero-select-card img,
.hero-unlock-container img,
.speedrun-hero-avatar,
.run-history-card img {
  transform: none !important;
}

/* =========================================================================
   INTERNACIONALIZAÇÃO (i18n) & SUPRESSÃO VISUAL DO GOOGLE TRANSLATE
   ========================================================================= */

/* Estilos das Pílulas (Pills) de Idioma no Modal de Opções */
.lang-pills-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  width: 100%;
}

.lang-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  user-select: none;
}

.lang-pill-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #f8fafc;
  transform: translateY(-1px);
}

.lang-pill-btn.active {
  background: rgba(56, 189, 248, 0.25) !important;
  border-color: #38bdf8 !important;
  color: #38bdf8 !important;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
}

.lang-flag {
  font-size: 1.15rem;
  line-height: 1;
}

/* Supressão Total da Barra Superior, Banners e Popups Nativos do Google */
.goog-te-banner-frame.skiptranslate,
.goog-te-banner-frame,
iframe.goog-te-banner-frame,
iframe.skiptranslate,
iframe[class*="VIpgJd"],
.VIpgJd-ZVi9od-ORHb-OEVmcd,
.VIpgJd-yAWNEb-L7lbkb,
.goog-te-gadget,
#goog-gt-tt,
.goog-tooltip,
.goog-tooltip:hover {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  height: 0 !important;
  width: 0 !important;
}

/* Impede o Google de empurrar o layout do jogo para baixo */
body {
  top: 0px !important;
  position: static !important;
}

/* Remove qualquer realce de texto automático que o Google tente injetar */
.goog-text-highlight {
  background: transparent !important;
  box-shadow: none !important;
}









/* ==========================================================================
   SISTEMA DE PRESTÍGIO RANQUEADO, VESTIÁRIO E AURAS VISUAIS
   ========================================================================== */

/* Botão Obter Medo em Destaque */
.btn-fear-highlight {
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 50%, #8b5cf6 100%) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  border: 1px solid #f472b6 !important;
  box-shadow: 0 0 16px rgba(236, 72, 153, 0.5), inset 0 0 10px rgba(255, 255, 255, 0.2) !important;
  animation: fearPulseBtn 2.4s infinite ease-in-out !important;
  transition: all 0.25s ease !important;
  position: relative;
  cursor: pointer;
}

.btn-fear-highlight:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 0 25px rgba(236, 72, 153, 0.8), inset 0 0 14px rgba(255, 255, 255, 0.4) !important;
}

@keyframes fearPulseBtn {
  0%, 100% {
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.45);
  }
  50% {
    box-shadow: 0 0 24px rgba(236, 72, 153, 0.75), 0 0 8px rgba(192, 132, 252, 0.9);
  }
}

/* Tooltip do Botão Obter Medo */
.fear-tooltip-wrapper {
  position: relative;
  display: inline-flex;
}

.fear-tooltip-wrapper .fear-tooltip-box {
  visibility: hidden;
  opacity: 0;
  width: 250px;
  background: rgba(15, 23, 42, 0.96);
  color: #f1f5f9;
  text-align: center;
  border: 1px solid #c084fc;
  border-radius: 10px;
  padding: 8px 12px;
  position: absolute;
  z-index: 10010;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  transition: opacity 0.25s, transform 0.25s;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 12px rgba(168, 85, 247, 0.35);
  pointer-events: none;
  line-height: 1.35;
}

.fear-tooltip-wrapper .fear-tooltip-box::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border-width: 6px;
  border-style: solid;
  border-color: #c084fc transparent transparent transparent;
}

.fear-tooltip-wrapper:hover .fear-tooltip-box {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* O Novo Vestiário (Wardrobe Preview) */
#shop-panel-cosmetics.rewards-list-panel {
  height: auto;
  min-height: unset;
  max-height: none;
  overflow: visible;
}

#screen-global-rewards {
  flex-direction: column;
  align-items: center;
}

.wardrobe-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: radial-gradient(circle at 75% 50%, rgba(88, 28, 135, 0.25) 0%, rgba(15, 23, 42, 0.88) 70%), linear-gradient(135deg, rgba(30, 27, 75, 0.55) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1.5px solid rgba(168, 85, 247, 0.4);
  border-radius: 16px;
  padding: 12px 24px;
  min-height: 175px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(168, 85, 247, 0.12);
  margin-bottom: 12px;
  position: relative;
  overflow: visible;
}

.wardrobe-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 220px;
}

.wardrobe-avatar-slot {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: 2.5px solid #38bdf8;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  flex-shrink: 0;
  overflow: hidden;
}

.wardrobe-avatar-slot:hover {
  transform: scale(1.08);
  border-color: #7dd3fc;
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.7);
}

.wardrobe-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.wardrobe-player-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.wardrobe-player-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wardrobe-click-hint {
  font-size: 0.72rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Palco da Skin e Balão do Título */
.wardrobe-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  padding: 4px 16px;
  min-width: 200px;
  min-height: 145px;
}

.wardrobe-speech-bubble {
  position: relative;
  background: rgba(15, 23, 42, 0.95);
  border: 2px solid #fbbf24;
  color: #fef08a;
  padding: 5px 14px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.85rem;
  text-align: center;
  box-shadow: 0 3px 14px rgba(251, 191, 36, 0.35);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  animation: floatingBubble 3.2s infinite ease-in-out;
  max-width: 290px;
  word-break: break-word;
}

.wardrobe-speech-bubble:hover {
  transform: scale(1.05);
  border-color: #fde047;
  box-shadow: 0 6px 22px rgba(251, 191, 36, 0.6);
}

.wardrobe-speech-bubble::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 8px 7px 0;
  border-style: solid;
  border-color: #fbbf24 transparent;
  display: block;
  width: 0;
}

@keyframes floatingBubble {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

.wardrobe-skin-slot {
  position: relative;
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.25s ease;
  border-radius: 16px;
}

.wardrobe-skin-slot:hover {
  transform: scale(1.06);
}

.wardrobe-skin-img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  z-index: 2;
  position: relative;
}

.wardrobe-pedestal {
  position: absolute;
  bottom: 0px;
  width: 105px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(168, 85, 247, 0.65) 0%, rgba(99, 102, 241, 0.35) 50%, transparent 80%);
  filter: blur(2px);
  z-index: 1;
}

/* ==========================================
   ESTILOS DAS 8 AURAS MÍSTICAS (CSS ANIMADO)
   ========================================== */

.skin-aura-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* 1. Chamas Infernais */
.aura-inferno {
  filter: drop-shadow(0 0 12px #f97316) drop-shadow(0 -8px 18px #ef4444);
  animation: auraInfernoPulse 1.8s infinite ease-in-out;
}
@keyframes auraInfernoPulse {
  0%, 100% {
    filter: drop-shadow(0 0 10px #f97316) drop-shadow(0 -6px 14px #dc2626);
  }
  50% {
    filter: drop-shadow(0 0 20px #fb923c) drop-shadow(0 -14px 26px #ea580c);
  }
}

/* 2. Vórtice Cósmico */
.aura-cosmic {
  filter: drop-shadow(0 0 14px #a855f7) drop-shadow(0 0 24px #38bdf8);
  animation: auraCosmicPulse 3s infinite linear;
}
@keyframes auraCosmicPulse {
  0% {
    filter: drop-shadow(0 0 12px #a855f7) drop-shadow(0 0 20px #38bdf8);
  }
  50% {
    filter: drop-shadow(0 0 22px #c084fc) drop-shadow(0 0 32px #818cf8);
  }
  100% {
    filter: drop-shadow(0 0 12px #a855f7) drop-shadow(0 0 20px #38bdf8);
  }
}

/* 3. Tempestade Elétrica */
.aura-thunder {
  filter: drop-shadow(0 0 8px #06b6d4) drop-shadow(0 0 16px #38bdf8);
  animation: auraThunderFlicker 0.4s infinite alternate;
}
@keyframes auraThunderFlicker {
  0% {
    filter: drop-shadow(0 0 6px #06b6d4) drop-shadow(0 0 12px #38bdf8);
    opacity: 0.9;
  }
  100% {
    filter: drop-shadow(0 0 18px #67e8f9) drop-shadow(0 0 28px #0284c7);
    opacity: 1;
  }
}

/* 4. Centelha Divina */
.aura-divine {
  filter: drop-shadow(0 0 14px #facc15) drop-shadow(0 -10px 22px #eab308);
  animation: auraDivineGlow 2.2s infinite ease-in-out;
}
@keyframes auraDivineGlow {
  0%, 100% {
    filter: drop-shadow(0 0 10px #facc15) drop-shadow(0 -6px 16px #ca8a04);
  }
  50% {
    filter: drop-shadow(0 0 24px #fef08a) drop-shadow(0 -14px 30px #f59e0b);
  }
}

/* 5. Gélida Glacial */
.aura-frost {
  filter: drop-shadow(0 0 12px #bae6fd) drop-shadow(0 0 20px #38bdf8);
  animation: auraFrostPulse 2.8s infinite ease-in-out;
}
@keyframes auraFrostPulse {
  0%, 100% {
    filter: drop-shadow(0 0 8px #bae6fd) drop-shadow(0 0 16px #0284c7);
  }
  50% {
    filter: drop-shadow(0 0 18px #e0f2fe) drop-shadow(0 0 28px #38bdf8);
  }
}

/* 6. Miasma das Trevas */
.aura-miasma {
  filter: drop-shadow(0 0 12px #701a75) drop-shadow(0 8px 20px #1e1b4b);
  animation: auraMiasmaPulse 2.5s infinite ease-in-out;
}
@keyframes auraMiasmaPulse {
  0%, 100% {
    filter: drop-shadow(0 0 10px #86198f) drop-shadow(0 6px 16px #0f172a);
  }
  50% {
    filter: drop-shadow(0 0 20px #a21caf) drop-shadow(0 12px 28px #3b0764);
  }
}

/* 7. Vapores da Ruína */
.aura-toxic {
  filter: drop-shadow(0 0 12px #10b981) drop-shadow(0 -8px 20px #22c55e);
  animation: auraToxicPulse 2.2s infinite ease-in-out;
}
@keyframes auraToxicPulse {
  0%, 100% {
    filter: drop-shadow(0 0 8px #10b981) drop-shadow(0 -6px 14px #15803d);
  }
  50% {
    filter: drop-shadow(0 0 18px #4ade80) drop-shadow(0 -12px 26px #16a34a);
  }
}

/* 8. Vórtice Carmesim */
.aura-blood {
  filter: drop-shadow(0 0 14px #e11d48) drop-shadow(0 0 24px #9f1239);
  animation: auraBloodBeat 1.4s infinite ease-in-out;
}
@keyframes auraBloodBeat {
  0%, 100% {
    filter: drop-shadow(0 0 10px #e11d48) drop-shadow(0 0 18px #881337);
    transform: scale(1);
  }
  50% {
    filter: drop-shadow(0 0 22px #fb7185) drop-shadow(0 0 32px #be123c);
    transform: scale(1.02);
  }
}

/* Itens Não Comprados: Aparência Oculta / Silhueta com Cadeado */
.cosmetic-locked-silhouette {
  filter: brightness(0) contrast(150%) opacity(0.25) !important;
  transition: all 0.3s ease;
}

.cosmetic-locked-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 12px;
  overflow: hidden;
}

.cosmetic-lock-badge {
  position: absolute;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(168, 85, 247, 0.5);
  color: #c084fc;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
  z-index: 5;
}

.title-text-censored {
  letter-spacing: 2px;
  background: linear-gradient(90deg, #475569, #64748b, #475569);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  user-select: none;
  font-weight: 700;
}

/* ==========================================================================
   ACCORDIONS DA LOJA DE PRESTÍGIO (AVATARES, SKINS, TÍTULOS, AURAS)
   ========================================================================== */
.cosmetics-accordions-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.cosmetic-accordion-item {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.cosmetic-accordion-item:hover {
  border-color: rgba(168, 85, 247, 0.3);
}

.cosmetic-accordion-item.open {
  border-color: rgba(168, 85, 247, 0.45);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  background: rgba(15, 23, 42, 0.75);
}

.cosmetic-accordion-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #f8fafc;
  font-family: inherit;
  text-align: left;
  user-select: none;
  transition: background 0.2s ease;
}

.cosmetic-accordion-header:hover {
  background: rgba(255, 255, 255, 0.04);
}

.cosmetic-accordion-title {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #ffffff !important;
}

.cosmetic-accordion-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cosmetic-accordion-count {
  font-size: 0.78rem;
  color: #94a3b8;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 9px;
  border-radius: 10px;
}

.cosmetic-accordion-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 4px 10px;
  border-radius: 14px;
  transition: all 0.2s ease;
}

.cosmetic-accordion-header:hover .cosmetic-accordion-toggle-btn {
  background: rgba(168, 85, 247, 0.2);
  border-color: rgba(168, 85, 247, 0.4);
  color: #e2e8f0;
}

.accordion-arrow {
  display: inline-block;
  font-size: 0.72rem;
  line-height: 1;
}

.cosmetic-accordion-content {
  padding: 0 16px 16px 16px;
  transition: all 0.3s ease;
  max-height: 2000px;
  opacity: 1;
  overflow: visible;
}

.cosmetic-accordion-item.closed .cosmetic-accordion-content {
  max-height: 0;
  opacity: 0;
  padding: 0 16px;
  overflow: hidden;
  pointer-events: none;
}

.cosmetics-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  max-height: 480px;
  overflow-y: auto;
  padding: 4px;
}

/* ==========================================================================
   RESPONSIVIDADE PROPORCIONAL DE BATALHA: TELAS DE ALTURA COMPACTA
   ========================================================================== */
@media (max-height: 840px) {
  #screen-battle {
    padding-top: clamp(40px, 5.5vh, 52px);
    padding-bottom: 4px;
  }
  .battle-arena {
    padding-top: 2px;
    margin-bottom: -6px;
    --base-combatant-size: clamp(110px, 25vh, 180px);
  }
  .sprite-container {
    max-height: clamp(130px, 32vh, 240px);
  }
  .hand-container {
    height: clamp(170px, 24vh, 215px);
  }
  .card {
    width: clamp(120px, 9.5vw, 145px);
    height: clamp(170px, 23.5vh, 210px);
    padding: 8px 10px;
  }
  .card-art {
    height: clamp(70px, 10vh, 95px);
  }
  .energy-orb {
    width: 48px;
    height: 48px;
    font-size: 1.15rem;
  }
  .battle-controls-container {
    gap: 4px;
  }
}

@media (max-height: 720px) {
  #screen-battle {
    padding-top: 36px;
    padding-bottom: 2px;
  }
  .battle-arena {
    --base-combatant-size: clamp(95px, 22vh, 150px);
  }
  .sprite-container {
    max-height: clamp(110px, 28vh, 180px);
  }
  .hand-container {
    height: clamp(155px, 23vh, 185px);
  }
  .card {
    width: clamp(105px, 9vw, 130px);
    height: clamp(150px, 22vh, 185px);
    padding: 6px 8px;
  }
  .card-art {
    height: clamp(60px, 9vh, 80px);
  }
}

/* ==========================================================================
   NEXUS E VESTIÁRIO COMPACTO (BOTÃO VOLTAR SEMPRE VISÍVEL)
   ========================================================================== */
#screen-global-rewards {
  padding-top: 10px;
  padding-bottom: 10px;
}

.global-rewards-container {
  padding: 14px 22px !important;
  max-height: 95vh;
  overflow-y: auto;
}

.global-rewards-container .section-title {
  margin-bottom: 8px !important;
  font-size: 1.5rem !important;
}

.sparks-shop-balance-container {
  margin-bottom: 12px !important;
  gap: 10px !important;
}

.shop-tab-selectors {
  margin-bottom: 14px !important;
}

.cosmetics-header {
  padding: 10px 16px !important;
  margin-bottom: 10px !important;
}

/* ==========================================================================
   PROTEÇÃO CONTRA CORTE DE CARTAS NA BASE DA MÃO
   ========================================================================== */
.hand-container {
  padding-bottom: clamp(14px, 2.2vh, 24px) !important;
  overflow: visible !important;
}

.card {
  transform-origin: 50% 90% !important;
}

@media (max-height: 840px) {
  #screen-battle {
    padding-bottom: 8px !important;
  }
  .hand-container {
    padding-bottom: 14px !important;
  }
}

@media (max-height: 720px) {
  #screen-battle {
    padding-bottom: 6px !important;
  }
  .hand-container {
    padding-bottom: 12px !important;
  }
}

/* ==========================================================================
   MODO RANQUEADO ASSÍNCRONO (DUELO DE ECOS) - MENU, GRANDE HUB, VERSUS E ARENA
   ========================================================================== */

/* Botão Ranqueado no Menu Principal + Tooltip de Requisito */
.ranked-btn-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
}

.ranked-btn-wrapper .btn-ranked-mode {
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.25s ease;
}

.btn-ranked-mode.locked {
  opacity: 0.65;
  cursor: not-allowed;
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.7);
}

.btn-ranked-mode.unlocked,
.btn-ranked-mode.btn-ranked-unlocked {
  opacity: 1;
  cursor: pointer;
  border-style: solid !important;
  border: 1px solid var(--glass-border) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: #e2e8f0 !important;
  box-shadow: none !important;
}

.btn-ranked-mode.unlocked:hover,
.btn-ranked-mode.btn-ranked-unlocked:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  transform: translateY(-2px);
  box-shadow: none !important;
}

.ranked-menu-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  width: 310px;
  padding: 10px 14px;
  background: rgba(10, 15, 29, 0.96);
  border: 1.5px solid rgba(245, 158, 11, 0.65);
  border-radius: 10px;
  color: #fef3c7;
  font-size: 0.83rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.85), 0 0 15px rgba(245, 158, 11, 0.25);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 999;
}

.ranked-btn-wrapper:hover .btn-ranked-mode.locked + .ranked-menu-tooltip,
.ranked-btn-wrapper.show-locked-tooltip .ranked-menu-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Tela Principal do Grande HUB Ranqueado */
#screen-ranked {
  padding: 6px 14px;
  overflow-y: auto;
}

.ranked-hub-wrapper {
  width: 98%;
  max-width: 1380px;
  margin: 0 auto;
  padding: 10px 18px;
  border-radius: 16px;
  background: rgba(10, 14, 26, 0.9);
  border: 1.5px solid rgba(168, 85, 247, 0.35);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(139, 92, 246, 0.15);
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 96vh;
  overflow-y: auto;
}

.ranked-hub-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ranked-hub-eyebrow {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #c084fc;
  text-transform: uppercase;
  display: block;
}

.ranked-hub-main-title {
  font-size: 1.32rem;
  margin: 1px 0 0 0;
  background: linear-gradient(90deg, #f8fafc, #e9d5ff, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ranked-hub-top-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ranked-daily-matches-pill {
  background: rgba(139, 92, 246, 0.16);
  border: 1px solid rgba(168, 85, 247, 0.45);
  color: #e9d5ff;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
}

/* Banner Dopamínico de Defesa Assíncrona */
.ranked-defense-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(168, 85, 247, 0.22));
  border: 2px solid #fbbf24;
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.35);
  animation: pulseGlowGold 2s infinite alternate;
}

@keyframes pulseGlowGold {
  from { box-shadow: 0 0 15px rgba(245, 158, 11, 0.3); }
  to { box-shadow: 0 0 30px rgba(245, 158, 11, 0.65); }
}

.ranked-defense-banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ranked-defense-chest-icon {
  font-size: 1.6rem;
  filter: drop-shadow(0 0 10px #fbbf24);
}

.ranked-defense-banner-title {
  font-family: var(--font-title);
  font-weight: 800;
  color: #fde68a;
  font-size: 0.92rem;
}

.ranked-defense-banner-sub {
  font-size: 0.8rem;
  color: #f8fafc;
}

/* Grid Principal do HUB: Esquerda (Prestígio) + Direita (Deck & Forja) */
.ranked-hub-main-grid {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 14px;
  align-items: stretch;
}

@media (max-width: 1100px) {
  .ranked-hub-main-grid {
    grid-template-columns: 1fr;
  }
}

.ranked-hub-prestige-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ranked-elo-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 12px;
  padding: 8px 12px;
}

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

.ranked-elo-label {
  font-size: 0.62rem;
  letter-spacing: 1.5px;
  color: #94a3b8;
  font-weight: 700;
}

.ranked-elo-title {
  font-size: 1.12rem;
  font-weight: 900;
  color: #fbbf24;
}

.ranked-rp-box {
  text-align: right;
}

.ranked-rp-number {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 900;
  color: #c084fc;
}

.ranked-rp-unit {
  font-size: 0.75rem;
  font-weight: 800;
  color: #94a3b8;
}

.ranked-elo-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin: 5px 0;
}

.ranked-elo-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #8b5cf6, #ec4899, #fbbf24);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.ranked-elo-stats-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  color: #cbd5e1;
}

/* Palco de Prestígio Compactado no HUB */
.ranked-prestige-stage-card {
  background: radial-gradient(circle at 50% 65%, rgba(139, 92, 246, 0.22), rgba(15, 23, 42, 0.92));
  border: 1.5px solid rgba(192, 132, 252, 0.45);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55), 0 0 20px rgba(168, 85, 247, 0.18);
  border-radius: 14px;
  padding: 9px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.ranked-prestige-user-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ranked-prestige-avatar-wrap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #c084fc;
  box-shadow: 0 0 12px rgba(192, 132, 252, 0.5);
  overflow: hidden;
  flex-shrink: 0;
  background: #0f172a;
}

.ranked-prestige-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ranked-prestige-user-meta {
  flex: 1;
  min-width: 0;
}

.ranked-prestige-name {
  font-size: 1.05rem;
  font-weight: 900;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.ranked-prestige-arena-stats {
  font-size: 0.74rem;
  color: #a5b4fc;
  margin-top: 1px;
}

.ranked-prestige-speech-bubble {
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  padding: 3px 14px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  position: relative;
  text-align: center;
  max-width: 90%;
}

.ranked-prestige-speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px 5px 0;
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.96) transparent;
}

.ranked-prestige-character-stage {
  position: relative;
  height: 112px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.ranked-prestige-skin-img {
  max-height: 98px;
  max-width: 115px;
  object-fit: contain;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.7));
}

/* Card do Eco Guardião Compactado + Palco Espiritual do Eco */
.ranked-guardian-echo-card {
  background: radial-gradient(circle at 50% 30%, rgba(56, 189, 248, 0.12), rgba(15, 23, 42, 0.88));
  border: 1.5px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55), 0 0 16px rgba(56, 189, 248, 0.14);
  border-radius: 14px;
  padding: 9px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

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

.ranked-echo-badge-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.4px;
}

.ranked-echo-expiry-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.55);
  color: #fcd34d;
}

/* Palco Gráfico do Campeão Guardião (Eco Espiritual) */
.ranked-echo-character-stage {
  position: relative;
  height: 92px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  background: radial-gradient(circle at 50% 70%, rgba(56, 189, 248, 0.2), transparent 70%);
  border-radius: 10px;
  padding-bottom: 4px;
  box-sizing: border-box;
}

.echo-spirit-wrapper {
  position: relative;
  z-index: 2;
  animation: echoSpiritFloat 3.5s ease-in-out infinite alternate;
}

@keyframes echoSpiritFloat {
  0% {
    transform: translateY(0px) scale(1);
    filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.8)) brightness(1.15);
  }
  100% {
    transform: translateY(-5px) scale(1.03);
    filter: drop-shadow(0 0 20px rgba(56, 189, 248, 0.98)) brightness(1.3);
  }
}

.ranked-echo-sprite-img {
  max-height: 78px;
  max-width: 95px;
  object-fit: contain;
  opacity: 0.94;
}

.echo-pedestal {
  width: 110px;
  height: 12px;
  background: radial-gradient(ellipse at center, rgba(56, 189, 248, 0.7) 0%, rgba(14, 165, 233, 0.3) 50%, transparent 75%);
  border-radius: 50%;
  margin-top: -4px;
  z-index: 1;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.7);
}

.echo-spirit-tag {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #38bdf8;
  background: rgba(14, 165, 233, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.45);
  padding: 2px 8px;
  border-radius: 999px;
  margin-top: 2px;
  text-transform: uppercase;
}

.ranked-echo-card-body {
  font-size: 0.78rem;
  color: #e2e8f0;
  line-height: 1.35;
}

.ranked-echo-reset-notice {
  margin-top: 2px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.68rem;
  color: #fbbf24;
}

.ranked-matchmaking-hint {
  font-size: 0.74rem;
  color: #94a3b8;
  text-align: center;
}

/* Abas e Painéis do HUB Ranqueado (Forja do Livro vs Deck de Duelo) */
.ranked-hub-tabs-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  width: 100%;
}

.ranked-tabs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 5px;
  margin-bottom: 0;
}

.ranked-tab-nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 6px 16px;
  color: #94a3b8;
  font-family: var(--font-title);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ranked-tab-nav-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.25);
}

.ranked-tab-nav-btn.active {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(59, 130, 246, 0.25));
  border-color: #c084fc;
  color: #f8fafc;
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.3);
}

.ranked-tab-count-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-weight: 800;
}

.ranked-tab-nav-btn.active .ranked-tab-count-badge {
  background: rgba(34, 197, 94, 0.22);
  border: 1px solid rgba(74, 222, 128, 0.6);
  color: #4ade80;
}

.ranked-tab-panel {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.ranked-tab-panel.hidden {
  display: none !important;
}

.ranked-current-deck-panel,
.ranked-forge-book-panel {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.ranked-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.ranked-panel-title {
  font-size: 1rem;
  color: #f8fafc;
  margin: 0;
}

.ranked-panel-sub {
  font-size: 0.75rem;
  color: #94a3b8;
  margin: 1px 0 0 0;
}

.ranked-deck-count-pill {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.ranked-deck-count-pill.valid {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid #10b981;
  color: #34d399;
}

.ranked-deck-count-pill.invalid {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid #f59e0b;
  color: #fbbf24;
}

.ranked-deck-actions-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ranked-deck-save-status {
  margin-left: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(74, 222, 128, 0.45);
  font-size: 0.76rem;
  color: #34d399;
  font-weight: 800;
  white-space: nowrap;
}

.ranked-current-deck-list {
  flex: 1;
  max-height: 215px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 6px;
  padding-right: 4px;
}

.ranked-deck-compact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}

.ranked-deck-compact-row:hover {
  background: rgba(51, 65, 85, 0.9);
  transform: translateY(-2px);
}

.ranked-deck-compact-row.frag-row {
  border-color: rgba(244, 63, 94, 0.6);
  background: linear-gradient(90deg, rgba(136, 19, 55, 0.35), rgba(30, 41, 59, 0.8));
}

/* Gerenciador de Múltiplos Decks (Até 5 Decks) */
.ranked-decks-manager-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 4px;
  max-height: 135px;
  overflow-y: auto;
  padding-right: 4px;
}

.ranked-deck-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.75);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
}

.ranked-deck-row-item:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(168, 85, 247, 0.45);
}

.ranked-deck-row-item.active-battle-deck {
  border-color: #10b981;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.15), rgba(30, 41, 59, 0.85));
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.18);
}

.ranked-deck-row-item.currently-editing {
  border-color: #a855f7;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.22);
}

.ranked-deck-info-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ranked-deck-name-text {
  font-size: 0.9rem;
  font-weight: 800;
  color: #f8fafc;
}

.ranked-deck-badge-active {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.25);
  border: 1px solid #10b981;
  color: #34d399;
  text-transform: uppercase;
}

.ranked-deck-counter-badge {
  font-size: 0.74rem;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.ranked-deck-counter-badge.valid {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid #10b981;
  color: #34d399;
}

.ranked-deck-counter-badge.invalid {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid #f59e0b;
  color: #fbbf24;
}

.ranked-deck-actions-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ranked-deck-editor-wrapper {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ranked-deck-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}

.ranked-editing-tag {
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #c084fc;
}

.ranked-editing-deck-name {
  font-size: 1rem;
  font-weight: 800;
  color: #f8fafc;
  margin: 1px 0 0 0;
}

.ranked-forge-target-deck-badge {
  font-size: 0.76rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.5);
  color: #e9d5ff;
}


.ranked-forge-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ranked-forge-cards-grid {
  flex: 1;
  max-height: 340px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  padding-right: 4px;
}

.ranked-forge-card-item {
  background: rgba(30, 41, 59, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.ranked-forge-card-item:hover {
  border-color: rgba(168, 85, 247, 0.65);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.ranked-forge-card-item.not-in-book {
  opacity: 0.48;
  filter: grayscale(0.75);
}

/* Área Inferior Centralizada: Botão Buscar Batalha (Fora das Abas) */
.ranked-bottom-battle-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  padding: 8px 0 4px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ranked-find-match-cta {
  width: 100%;
  max-width: 560px;
  padding: 11px 24px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #7c3aed, #db2777);
  border: 1.5px solid #f472b6;
  box-shadow: 0 0 22px rgba(219, 39, 119, 0.45);
  transition: all 0.25s ease;
  cursor: pointer;
  border-radius: 10px;
}

.ranked-find-match-cta:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 35px rgba(219, 39, 119, 0.7);
}

.ranked-find-match-cta:disabled {
  background: rgba(30, 41, 59, 0.85) !important;
  border-color: rgba(245, 158, 11, 0.45) !important;
  color: #fbbf24 !important;
  box-shadow: none !important;
  opacity: 0.9;
  cursor: not-allowed;
}

/* Seção Inferior: Histórico Recente de Batalhas Online */
.ranked-hub-history-section {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 14px 18px;
}

.ranked-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.ranked-battles-history-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 10px;
  max-height: 210px;
  overflow-y: auto;
}

.ranked-history-row-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.65);
  border-left: 4px solid #64748b;
}

.ranked-history-row-card.win {
  border-left-color: #10b981;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.12), rgba(30, 41, 59, 0.65));
}

.ranked-history-row-card.loss {
  border-left-color: #ef4444;
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.12), rgba(30, 41, 59, 0.65));
}

/* Modal de Versus Cinematográfico */
.ranked-versus-modal-content {
  max-width: 980px !important;
  width: 95% !important;
  padding: 24px !important;
  background: radial-gradient(circle at center, rgba(46, 16, 101, 0.92), rgba(10, 14, 26, 0.98)) !important;
  border: 2px solid #a855f7 !important;
  box-shadow: 0 0 60px rgba(168, 85, 247, 0.5) !important;
}

.ranked-versus-top-tag {
  text-align: center;
  font-family: var(--font-title);
  font-weight: 900;
  letter-spacing: 3px;
  color: #fbbf24;
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.ranked-versus-arena-grid {
  display: grid;
  grid-template-columns: 1fr 220px 1fr;
  gap: 18px;
  align-items: center;
}

@media (max-width: 820px) {
  .ranked-versus-arena-grid {
    grid-template-columns: 1fr;
  }
}

.ranked-vs-combatant {
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.ranked-vs-combatant.defender-side {
  border-color: rgba(244, 63, 94, 0.45);
}

.ranked-vs-role-tag {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
}

.ranked-vs-role-tag.defender {
  background: rgba(244, 63, 94, 0.2);
  color: #fda4af;
}

.ranked-vs-speech-bubble {
  background: #f8fafc;
  color: #0f172a;
  font-weight: 800;
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: 12px;
}

.ranked-vs-stage {
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ranked-vs-skin-img {
  max-height: 120px;
  max-width: 140px;
  object-fit: contain;
}

.ranked-vs-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  justify-content: center;
}

.ranked-vs-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid #fbbf24;
  object-fit: cover;
}

.ranked-vs-username {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
}

.ranked-vs-base-hero-pill {
  display: inline-block;
  margin-top: 2px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fcd34d;
  font-size: 0.75rem;
  font-weight: 700;
}

.ranked-vs-rp-sub {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 2px;
}

.ranked-vs-center-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.ranked-vs-emblem {
  font-size: 3rem;
  font-weight: 900;
  color: #fbbf24;
  text-shadow: 0 0 25px rgba(245, 158, 11, 0.85), 0 0 50px rgba(219, 39, 119, 0.65);
}

.ranked-vs-bounty-box {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: 12px;
  padding: 10px 12px;
  width: 100%;
}

.ranked-vs-bounty-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: #fde68a;
  margin-bottom: 6px;
}

.ranked-vs-rewards-title {
  font-size: 0.68rem;
  color: #94a3b8;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.ranked-vs-rewards-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.vs-reward-pill {
  font-size: 0.76rem;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
}

.ranked-vs-opp-history-box {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  padding: 8px 10px;
  margin-top: 4px;
}

.ranked-vs-opp-history-title {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 700;
  margin-bottom: 4px;
}

.ranked-vs-opp-history-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.75rem;
}

.ranked-versus-actions {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
}

/* Modal de Resultado Ranqueado */
.ranked-result-modal-content {
  max-width: 560px !important;
  width: 92% !important;
  padding: 28px !important;
  position: relative;
  overflow: hidden;
  border: 2px solid #fbbf24 !important;
}

.ranked-result-badge {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #fde68a;
  position: relative;
  z-index: 5;
}

.ranked-result-title {
  font-size: 2rem;
  margin: 6px 0;
  color: #fbbf24;
  position: relative;
  z-index: 5;
}

.ranked-result-subtitle {
  color: #e2e8f0;
  font-size: 0.95rem;
  margin-bottom: 18px;
  position: relative;
  z-index: 5;
}

.ranked-result-rewards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  position: relative;
  z-index: 5;
}

.ranked-result-reward-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rr-label {
  font-size: 0.75rem;
  color: #94a3b8;
}

.rr-value {
  font-family: var(--font-title);
  font-size: 1.3rem;
  font-weight: 900;
  color: #f8fafc;
}

/* Elementos de Prestígio e Carta Jogada pelo Eco na Arena de Batalha */
.arena-prestige-speech-bubble {
  background: rgba(255, 255, 255, 0.94);
  color: #0f172a;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.76rem;
  font-weight: 800;
  margin-bottom: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  z-index: 15;
}

.arena-echo-base-hero-tag {
  display: inline-block;
  margin-top: 2px;
  margin-bottom: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(168, 85, 247, 0.25);
  border: 1px solid #c084fc;
  color: #e9d5ff;
  font-size: 0.72rem;
  font-weight: 700;
}

.echo-played-card-showcase {
  position: fixed;
  top: 24%;
  right: 28%;
  z-index: 9500;
  pointer-events: none;
  animation: echoCardCastAnim 1.15s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes echoCardCastAnim {
  0% { opacity: 0; transform: translateY(30px) scale(0.75); }
  20% { opacity: 1; transform: translateY(0) scale(1.05); }
  75% { opacity: 1; transform: translateY(-6px) scale(1); }
  100% { opacity: 0; transform: translateY(-25px) scale(0.85); }
}

/* ==========================================================================
   MODAL DEDICADO DE EDIÇÃO E MONTAGEM DE DECK RANQUEADO
   ========================================================================== */
.ranked-deck-editor-modal-content {
  max-width: 960px;
  width: 94vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border: 1.5px solid rgba(168, 85, 247, 0.45);
  box-shadow: 0 0 35px rgba(168, 85, 247, 0.25), 0 20px 40px rgba(0, 0, 0, 0.85);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(24, 15, 38, 0.98));
}

.ranked-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: rgba(30, 41, 59, 0.7);
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.1);
  gap: 12px;
}

.ranked-editor-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.ranked-editor-icon {
  font-size: 1.6rem;
}

.ranked-editor-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  max-width: 400px;
}

.ranked-editor-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #a855f7;
  letter-spacing: 0.5px;
}

.ranked-editor-name-input {
  background: rgba(15, 23, 42, 0.8);
  border: 1.5px solid rgba(168, 85, 247, 0.5);
  border-radius: 8px;
  color: #f8fafc;
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 800;
  padding: 4px 10px;
  transition: all 0.2s ease;
  width: 100%;
}

.ranked-editor-name-input:focus {
  outline: none;
  border-color: #c084fc;
  box-shadow: 0 0 12px rgba(192, 132, 252, 0.4);
  background: rgba(30, 41, 59, 0.95);
}

.ranked-editor-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ranked-editor-counter-pill {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 900;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.2);
  border: 1.5px solid #ef4444;
  color: #fca5a5;
  transition: all 0.25s ease;
}

.ranked-editor-counter-pill.valid {
  background: rgba(34, 197, 94, 0.2);
  border-color: #22c55e;
  color: #86efac;
  box-shadow: 0 0 14px rgba(34, 197, 94, 0.35);
}

.ranked-editor-validation-banner {
  padding: 6px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  background: rgba(239, 68, 68, 0.15);
  border-bottom: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  transition: all 0.2s ease;
}

.ranked-editor-validation-banner.valid {
  background: rgba(34, 197, 94, 0.12);
  border-bottom-color: rgba(34, 197, 94, 0.25);
  color: #86efac;
}

.ranked-editor-split-body {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 12px;
  padding: 14px;
  flex: 1;
  min-height: 380px;
  max-height: calc(90vh - 170px);
  overflow: hidden;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .ranked-editor-split-body {
    grid-template-columns: 1fr;
    max-height: none;
    overflow-y: auto;
  }
}

.ranked-editor-col {
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
  overflow: hidden;
}

.ranked-editor-col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  gap: 8px;
  flex-wrap: wrap;
}

.col-header-title {
  font-family: var(--font-title);
  font-size: 0.88rem;
  font-weight: 800;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 6px;
}

.col-header-title .sub-counter {
  font-size: 0.78rem;
  color: #94a3b8;
  font-weight: 600;
}

.ranked-editor-deck-quick-actions,
.ranked-editor-filters {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ranked-editor-search-input {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #f8fafc;
  font-size: 0.78rem;
  padding: 4px 8px;
  width: 120px;
}

.ranked-editor-select {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #cbd5e1;
  font-size: 0.78rem;
  padding: 4px 6px;
}

.ranked-editor-deck-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

.ranked-editor-deck-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 6px 10px;
  gap: 8px;
  transition: all 0.15s ease;
}

.ranked-editor-deck-card-item:hover {
  background: rgba(51, 65, 85, 0.8);
  border-color: rgba(255, 255, 255, 0.25);
}

.deck-card-info-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.deck-card-cost-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.25);
  border: 1px solid #60a5fa;
  color: #bfdbfe;
  white-space: nowrap;
}

.deck-card-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deck-card-qty-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(251, 191, 36, 0.2);
  border: 1px solid rgba(251, 191, 36, 0.6);
  color: #fbbf24;
}

.btn-remove-deck-card {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-remove-deck-card:hover {
  background: #ef4444;
  color: #ffffff;
}

.ranked-editor-pool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

.ranked-editor-pool-card {
  display: flex;
  flex-direction: column;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 6px;
  gap: 4px;
  position: relative;
  transition: all 0.18s ease;
}

.ranked-editor-pool-card:hover {
  border-color: rgba(168, 85, 247, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.ranked-editor-pool-card.maxed {
  opacity: 0.6;
  border-color: rgba(255, 255, 255, 0.05);
}

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

.pool-card-cost {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid #60a5fa;
  color: #bfdbfe;
}

.pool-card-copies-count {
  font-size: 0.68rem;
  font-weight: 800;
  color: #94a3b8;
}

.pool-card-copies-count.active {
  color: #fbbf24;
}

.pool-card-title {
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.pool-card-desc-snippet {
  font-size: 0.68rem;
  color: #94a3b8;
  line-height: 1.25;
  height: 32px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-add-to-deck {
  margin-top: auto;
  background: rgba(168, 85, 247, 0.25);
  border: 1px solid rgba(168, 85, 247, 0.5);
  color: #f3e8ff;
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.btn-add-to-deck:hover:not(:disabled) {
  background: #a855f7;
  color: #ffffff;
}

.btn-add-to-deck:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.08);
  color: #64748b;
}

.ranked-editor-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(30, 41, 59, 0.75);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.ranked-editor-save-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  border: 1.5px solid #34d399;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.4);
  font-weight: 800;
}

.ranked-editor-save-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.7);
  box-shadow: none;
}

/* ========================================================
   CONTROLES DE VELOCIDADE E PAUSA (MODO RANQUEADO / DUELO)
   ======================================================== */
.ranked-combat-controls {
  position: absolute;
  top: 14px;
  right: 18px;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 30px;
  padding: 4px 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 12px rgba(251, 191, 36, 0.15);
}

.ranked-combat-controls.hud-integrated {
  position: static !important;
  top: auto !important;
  right: auto !important;
  z-index: auto !important;
  background: rgba(15, 23, 42, 0.92);
  border: 1.5px solid rgba(251, 191, 36, 0.6);
  padding: 3px 8px;
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.25);
  animation: fadeIn 0.3s ease-out;
}

.ranked-combat-controls.hidden {
  display: none !important;
}

.btn-ranked-ctrl {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f8fafc;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 5px;
  user-select: none;
}

.btn-ranked-ctrl:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: #fbbf24;
  color: #fde047;
  transform: translateY(-1px);
  box-shadow: 0 2px 10px rgba(251, 191, 36, 0.3);
}

.btn-ranked-ctrl.active {
  background: linear-gradient(135deg, #d97706, #b45309);
  border-color: #fbbf24;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.btn-ranked-ctrl.paused {
  background: linear-gradient(135deg, #dc2626, #991b1b);
  border-color: #f87171;
  color: #ffffff;
  animation: pulsePause 1.5s infinite;
}

@keyframes pulsePause {
  0%, 100% { box-shadow: 0 0 8px rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 18px rgba(239, 68, 68, 0.8); }
}



/* ==========================================================================
   ZOOMS DINÂMICOS DE CÂMERA & COMBAT BARKING (CAMPANHA)
   ========================================================================== */

/* Zoom Dinâmico no Veriko (Tensão dramática pré-corte) */
.camera-punch-veriko {
  animation: cameraPunchVerikoAnim 0.85s cubic-bezier(0.16, 1, 0.3, 1) both !important;
}

@keyframes cameraPunchVerikoAnim {
  0% { transform: scale(1); filter: brightness(1); }
  25% { transform: scale(1.08) translateY(10px); filter: brightness(1.2) contrast(1.15); }
  70% { transform: scale(1.04) translateY(4px); filter: brightness(1.1); }
  100% { transform: scale(1) translateY(0); filter: brightness(1); }
}

/* Zoom Dinâmico na Esquiva Kamui (Sidestep elástico) */
.camera-punch-kamui {
  animation: cameraPunchKamuiAnim 0.45s cubic-bezier(0.25, 1, 0.5, 1) both !important;
}

@keyframes cameraPunchKamuiAnim {
  0% { transform: scale(1) translateX(0); }
  25% { transform: scale(1.035) translateX(-18px) rotate(-0.5deg); }
  55% { transform: scale(1.01) translateX(6px) rotate(0.2deg); }
  100% { transform: scale(1) translateX(0) rotate(0deg); }
}

/* Zoom Dinâmico na Morte de Elite/Boss (Slow-Motion Finisher) */
.camera-punch-elite-kill {
  animation: cameraPunchEliteKillAnim 0.9s cubic-bezier(0.16, 1, 0.3, 1) both !important;
}

@keyframes cameraPunchEliteKillAnim {
  0% { transform: scale(1); }
  35% { transform: scale(1.09) translateY(-8px); filter: saturate(1.25); }
  75% { transform: scale(1.03); }
  100% { transform: scale(1); filter: none; }
}

/* Balão de Fala do Herói em Combate (Combat Barking) */
.hero-combat-bark {
  position: absolute;
  bottom: calc(100% + 22px);
  left: 50%;
  transform: translateX(-50%) translateY(12px) scale(0.8);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.98));
  color: #ffffff;
  border: 2.5px solid #f8fafc;
  border-radius: 14px;
  padding: 10px 18px;
  font-family: 'Cinzel', serif, system-ui;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 9999 !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.8), 0 0 25px rgba(255, 255, 255, 0.35);
  opacity: 0;
  transition: transform 0.32s cubic-bezier(0.175, 0.885, 0.32, 1.35), opacity 0.24s ease-out;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Cauda do balão apontando para o sprite do herói */
.hero-combat-bark::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 8px 7px 0 7px;
  border-style: solid;
  border-color: rgba(15, 23, 42, 0.96) transparent transparent transparent;
}

.hero-combat-bark.bark-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

.hero-combat-bark.bark-leaving {
  opacity: 0;
  transform: translateX(-50%) translateY(-12px) scale(0.95);
  transition: transform 0.35s ease-in, opacity 0.35s ease-in;
}

/* Temas Visuais de Barks por Herói */
.hero-combat-bark[data-hero="gladiator"] {
  border-color: #f59e0b;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 16px rgba(245, 158, 11, 0.35);
}
.hero-combat-bark[data-hero="killik"] {
  border-color: #a855f7;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 16px rgba(168, 85, 247, 0.4);
}
.hero-combat-bark[data-hero="babosa"] {
  border-color: #10b981;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 16px rgba(16, 185, 129, 0.4);
}
.hero-combat-bark[data-hero="magal"] {
  border-color: #ec4899;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 16px rgba(236, 72, 153, 0.4);
}
.hero-combat-bark[data-hero="valkyrie"] {
  border-color: #06b6d4;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 16px rgba(6, 182, 212, 0.4);
}
.hero-combat-bark[data-hero="chaos_mage"] {
  border-color: #8b5cf6;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 16px rgba(139, 92, 246, 0.4);
}
.hero-combat-bark[data-hero="ad_smashblack"] {
  border-color: #ef4444;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 16px rgba(239, 68, 68, 0.45);
}
.hero-combat-bark[data-hero="ionely"] {
  border-color: #eab308;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 16px rgba(234, 179, 8, 0.4);
}
.hero-combat-bark[data-hero="aurelio"] {
  border-color: #fef08a;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 18px rgba(254, 240, 138, 0.5);
}
.hero-combat-bark[data-hero="thomas"] {
  border-color: #38bdf8;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 16px rgba(56, 189, 248, 0.4);
}

/* ==========================================================================
   HP BARS & ESCUDO
   ========================================================================== */
.hp-bar-container {
  position: relative;
  overflow: visible !important;
}

.hp-bar {
  position: relative;
  z-index: 2;
  transition: width 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.hp-text {
  z-index: 4 !important;
}

.block-value {
  z-index: 10 !important;
}

/* ==========================================================================
   AURAS DINÂMICAS DE COMBATE (LOW HP, FULL ENERGY, FORÇA, KAMUI AFTERIMAGE)
   ========================================================================== */

/* 1. Aura de Perigo Crítico (HP < 25% com Heartbeat Glow aplicado na imagem) */
.sprite-container.aura-low-hp img {
  animation: auraHeartbeatGlow 1.2s infinite ease-in-out !important;
}

@keyframes auraHeartbeatGlow {
  0%, 100% {
    filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.8)) drop-shadow(0 0 20px rgba(185, 28, 28, 0.6));
  }
  30% {
    filter: drop-shadow(0 0 24px rgba(239, 68, 68, 1)) drop-shadow(0 0 36px rgba(220, 38, 38, 0.85));
  }
  45% {
    filter: drop-shadow(0 0 14px rgba(239, 68, 68, 0.85)) drop-shadow(0 0 24px rgba(185, 28, 28, 0.7));
  }
  60% {
    filter: drop-shadow(0 0 28px rgba(239, 68, 68, 1)) drop-shadow(0 0 42px rgba(239, 68, 68, 0.9));
  }
}

/* 2. Aura de Pico de Energia (Full Momentum Ready Glow aplicado na imagem) */
.sprite-container.aura-full-energy img {
  animation: auraEnergyPulse 1.6s infinite alternate ease-in-out !important;
}

@keyframes auraEnergyPulse {
  0% {
    filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.75)) drop-shadow(0 0 20px rgba(99, 102, 241, 0.5));
  }
  100% {
    filter: drop-shadow(0 0 24px rgba(56, 189, 248, 1)) drop-shadow(0 0 40px rgba(129, 140, 248, 0.85));
  }
}

/* Temas de Aura de Energia por Herói */
.sprite-container.aura-full-energy[data-hero="gladiator"] img,
.sprite-container.aura-full-energy[data-hero="ad_smashblack"] img {
  animation: auraEnergyFire 1.5s infinite alternate ease-in-out !important;
}
@keyframes auraEnergyFire {
  0% { filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.8)) drop-shadow(0 0 20px rgba(239, 68, 68, 0.5)); }
  100% { filter: drop-shadow(0 0 26px rgba(245, 158, 11, 1)) drop-shadow(0 0 42px rgba(239, 68, 68, 0.85)); }
}

.sprite-container.aura-full-energy[data-hero="killik"] img,
.sprite-container.aura-full-energy[data-hero="chaos_mage"] img {
  animation: auraEnergyVoid 1.5s infinite alternate ease-in-out !important;
}
@keyframes auraEnergyVoid {
  0% { filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.8)) drop-shadow(0 0 20px rgba(126, 34, 206, 0.5)); }
  100% { filter: drop-shadow(0 0 26px rgba(192, 132, 252, 1)) drop-shadow(0 0 42px rgba(147, 51, 234, 0.85)); }
}

.sprite-container.aura-full-energy[data-hero="babosa"] img {
  animation: auraEnergyNature 1.5s infinite alternate ease-in-out !important;
}
@keyframes auraEnergyNature {
  0% { filter: drop-shadow(0 0 10px rgba(34, 197, 94, 0.8)) drop-shadow(0 0 20px rgba(21, 128, 61, 0.5)); }
  100% { filter: drop-shadow(0 0 26px rgba(74, 222, 128, 1)) drop-shadow(0 0 42px rgba(22, 163, 74, 0.85)); }
}

.sprite-container.aura-full-energy[data-hero="aurelio"] img {
  animation: auraEnergyHoly 1.5s infinite alternate ease-in-out !important;
}
@keyframes auraEnergyHoly {
  0% { filter: drop-shadow(0 0 12px rgba(253, 224, 71, 0.85)) drop-shadow(0 0 24px rgba(234, 179, 8, 0.5)); }
  100% { filter: drop-shadow(0 0 30px rgba(254, 240, 138, 1)) drop-shadow(0 0 50px rgba(250, 204, 21, 0.9)); }
}

/* 3. Aura de Poder & Força Elevada (>= 3 de Força aplicado na imagem) */
.sprite-container.aura-high-strength img {
  animation: auraStrengthRise 1.4s infinite ease-in-out !important;
}

@keyframes auraStrengthRise {
  0%, 100% {
    filter: drop-shadow(0 0 12px #f59e0b) drop-shadow(0 -4px 16px #dc2626);
  }
  50% {
    filter: drop-shadow(0 0 24px #fbbf24) drop-shadow(0 -12px 28px #ef4444);
  }
}

/* 4. Afterimage Motion-Blur (Kamui / Evasão / Vulto Rápido) */
.kamui-afterimage-ghost {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  opacity: 0.75;
  filter: blur(3px) drop-shadow(0 0 18px #38bdf8);
  animation: kamuiGhostFade 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes kamuiGhostFade {
  0% {
    transform: translateX(0) scale(1);
    opacity: 0.85;
  }
  50% {
    transform: translateX(-35px) scale(1.04);
    opacity: 0.45;
    filter: blur(6px) drop-shadow(0 0 25px #0284c7);
  }
  100% {
    transform: translateX(-70px) scale(1.08);
    opacity: 0;
    filter: blur(10px);
  }
}

/* ========================================================
   BALÕES DE TÍTULOS DE PRESTÍGIO E LOG DE COMBATE DO ECO
   ======================================================== */
.arena-prestige-title-tag {
  display: inline-block;
  margin-top: 1px;
  margin-bottom: 3px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(6px);
  border: 1px solid #fbbf24;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6), 0 0 8px rgba(251, 191, 36, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  max-width: 95%;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.arena-prestige-title-bubble {
  display: none !important;
}

.enemy-log-btn {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.92);
  border: 1.5px solid rgba(239, 68, 68, 0.65);
  border-radius: 8px;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #f8fafc;
  cursor: pointer;
  z-index: 25;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 10px rgba(239, 68, 68, 0.25);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  animation: bounce 2s infinite;
}

.enemy-log-btn:hover {
  border-color: #ef4444;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.55);
  transform: translateX(-50%) scale(1.08);
}

.combat-log-container.enemy-log-popup {
  position: absolute !important;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 380px;
  max-width: 92vw;
  height: 82%;
  max-height: 320px;
  background: rgba(18, 10, 15, 0.92) !important;
  backdrop-filter: blur(12px);
  border: 1.5px solid rgba(239, 68, 68, 0.85) !important;
  border-radius: 14px;
  padding: 14px 18px;
  overflow-y: auto;
  z-index: 500;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.85), 0 0 20px rgba(239, 68, 68, 0.4);
  opacity: 1 !important;
  box-sizing: border-box;
}


/* ==========================================================================
   SISTEMA DE RITMO & RESSONÂNCIA HARMÔNICA (GROOVE, BEAT DROP & CLÍMAX)
   ========================================================================== */

/* 1. Barra de Ressonância Harmônica (Groove) */
.rhythm-resonance-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(15, 23, 42, 0.88);
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  border-radius: 10px;
  padding: 4px 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), 0 0 10px rgba(56, 189, 248, 0.15);
  cursor: help;
  user-select: none;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.rhythm-resonance-container:hover {
  border-color: #38bdf8;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 15px rgba(56, 189, 248, 0.35);
  transform: translateY(-2px);
}

.rhythm-resonance-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 4px;
}

.rhythm-icon {
  font-size: 0.85rem;
  animation: grooveNoteBob 1.2s infinite ease-in-out;
}

@keyframes grooveNoteBob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-2px) rotate(8deg); }
}

.rhythm-title {
  color: #38bdf8;
  text-shadow: 0 0 6px rgba(56, 189, 248, 0.6);
}

.rhythm-bpm-badge {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #7dd3fc;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
}

.rhythm-percentage-badge {
  background: rgba(14, 165, 233, 0.25);
  color: #38bdf8;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 800;
  border: 1px solid rgba(56, 189, 248, 0.4);
  transition: all 0.3s ease;
}

.rhythm-progress-track {
  width: 140px;
  height: 10px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
}

.rhythm-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0284c7 0%, #38bdf8 70%, #7dd3fc 100%);
  border-radius: 999px;
  transition: width 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.7);
}

.rhythm-progress-shine {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.25) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: grooveProgressShine 2.5s infinite linear;
  pointer-events: none;
}

@keyframes grooveProgressShine {
  0% { transform: translateX(-100%); }
  50%, 100% { transform: translateX(100%); }
}

.rhythm-resonance-container.beat-drop-ready {
  border-color: #fbbf24 !important;
  box-shadow: 0 0 25px rgba(251, 191, 36, 0.8), 0 0 45px rgba(245, 158, 11, 0.6) !important;
  animation: beatDropContainerPulse 0.4s infinite alternate ease-in-out;
}

.rhythm-resonance-container.beat-drop-ready .rhythm-percentage-badge {
  background: rgba(245, 158, 11, 0.35);
  color: #fef08a;
  border-color: #fbbf24;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.8);
}

.rhythm-resonance-container.beat-drop-ready .rhythm-progress-bar {
  background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 60%, #fffbeb 100%) !important;
  box-shadow: 0 0 18px #fbbf24, 0 0 30px rgba(245, 158, 11, 0.9) !important;
}

@keyframes beatDropContainerPulse {
  0% { transform: scale(1); filter: brightness(1.05); }
  100% { transform: scale(1.06); filter: brightness(1.35); }
}

/* 2. Flash Cinematográfico do Beat Drop */
.beat-drop-screen-flash {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.35) 0%, rgba(239, 68, 68, 0.45) 50%, rgba(10, 5, 20, 0.92) 100%);
  z-index: 10006;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  animation: beatDropFlashAnim 1.9s ease-out forwards;
}

@keyframes beatDropFlashAnim {
  0% { opacity: 0; }
  15% { opacity: 1; }
  75% { opacity: 1; }
  100% { opacity: 0; }
}

.beat-drop-banner-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  animation: beatDropWrapperEntrance 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes beatDropWrapperEntrance {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.beat-drop-sub {
  font-size: clamp(0.75rem, 1.8vw, 1.15rem);
  font-weight: 800;
  letter-spacing: 0.25em;
  color: #38bdf8;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.8);
}

.beat-drop-banner {
  font-family: var(--font-title, sans-serif);
  font-size: clamp(2.5rem, 6.5vw, 4.6rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #fffbeb;
  text-shadow: 0 0 25px #fbbf24, 0 0 50px #f59e0b, 0 0 80px #ef4444;
  animation: beatDropGlowPulsing 0.6s infinite alternate ease-in-out;
}

@keyframes beatDropGlowPulsing {
  0% { transform: scale(1); filter: brightness(1); }
  100% { transform: scale(1.05); filter: brightness(1.3); }
}

.beat-drop-rewards {
  font-size: clamp(0.85rem, 2vw, 1.3rem);
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #34d399;
  background: rgba(16, 185, 129, 0.2);
  padding: 6px 18px;
  border-radius: 999px;
  border: 1.5px solid rgba(52, 211, 153, 0.7);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

/* 3. Overlay do Minigame de Clímax Rítmico (100% Transparente & Neon) */
.rhythm-climax-overlay {
  position: fixed;
  inset: 0;
  z-index: 10007;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 68px; /* Fica logo abaixo do menu superior de groove */
  user-select: none;
}

.rhythm-climax-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(4, 8, 22, 0.34) 0%, transparent 62%) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  pointer-events: none;
  animation: fadeIn 0.25s ease-out;
}

.rhythm-climax-modal {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 94%;
  max-width: 440px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 6px 10px;
  animation: modalPopIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.rhythm-climax-modal.intro-bloom {
  animation: modalIntroBloom 0.5s cubic-bezier(0.18, 0.9, 0.25, 1) forwards !important;
}

@keyframes modalIntroBloom {
  0% {
    opacity: 0;
    transform: scale(0.35) translateY(20px);
    filter: brightness(3) contrast(1.4) drop-shadow(0 0 50px var(--intro-glow, #38bdf8));
  }
  40% {
    opacity: 0.95;
    transform: scale(1.06) translateY(-4px);
    filter: brightness(1.6) drop-shadow(0 0 35px var(--intro-glow, #38bdf8));
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: brightness(1) drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
  }
}

/* ─── Transição Cinematográfica do Minigame Rítmico (Dissolução de Carta + Feixe de Luz) ─── */
.rhythm-transition-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10008;
  overflow: hidden;
}

.rhythm-intro-card-proxy {
  position: fixed;
  border-radius: 12px;
  overflow: hidden;
  box-sizing: border-box;
  z-index: 10009;
  pointer-events: none;
  animation: cardIgniteDissolve 0.45s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  will-change: transform, opacity, filter;
}

@keyframes cardIgniteDissolve {
  0% {
    transform: scale(1) translateY(0);
    opacity: 1;
    filter: brightness(1) drop-shadow(0 0 0px transparent);
  }
  40% {
    transform: scale(1.15) translateY(-35px);
    opacity: 1;
    filter: brightness(2.2) contrast(1.2) drop-shadow(0 0 32px var(--intro-glow, #38bdf8));
  }
  75% {
    transform: scale(1.05) translateY(-55px);
    opacity: 0.75;
    filter: brightness(3) drop-shadow(0 0 50px var(--intro-glow, #38bdf8));
  }
  100% {
    transform: scale(0.25) translateY(-75px);
    opacity: 0;
    filter: brightness(4) blur(10px);
  }
}

.rhythm-intro-spark {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: sparkDisperse 0.45s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes sparkDisperse {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx, 0px), var(--ty, 0px)) scale(0);
    opacity: 0;
  }
}

.rhythm-intro-comet {
  position: fixed;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 25px 8px var(--intro-glow, #38bdf8), 0 0 55px 18px var(--intro-glow, #38bdf8);
  pointer-events: none;
  z-index: 10010;
  transform: translate(-50%, -50%);
  will-change: left, top, opacity, transform;
}

.rhythm-intro-comet-trail {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 10009;
  transform: translate(-50%, -50%);
  animation: cometTrailFade 0.28s linear forwards;
}

@keyframes cometTrailFade {
  0% {
    opacity: 0.9;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2);
  }
}

.rhythm-intro-nova {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 10011;
  transform: translate(-50%, -50%) scale(0);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, var(--intro-glow, rgba(56, 189, 248, 0.75)) 45%, transparent 70%);
  animation: novaBurst 0.5s cubic-bezier(0.1, 0.85, 0.25, 1) forwards;
}

.rhythm-intro-ring {
  position: fixed;
  border-radius: 50%;
  border: 3px solid var(--intro-glow, #38bdf8);
  box-shadow: 0 0 25px var(--intro-glow, #38bdf8);
  pointer-events: none;
  z-index: 10011;
  transform: translate(-50%, -50%) scale(0);
  animation: ringExpand 0.5s cubic-bezier(0.12, 0.8, 0.3, 1) forwards;
}

@keyframes novaBurst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.1);
  }
  25% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.6);
  }
}

@keyframes ringExpand {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.2);
    border-width: 4px;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(2.2);
    border-width: 1px;
  }
}

@keyframes modalPopIn {
  0% { opacity: 0; transform: scale(0.9) translateY(15px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.rhythm-climax-header {
  text-align: center;
  margin-bottom: 10px;
  pointer-events: none;
  background: rgba(8, 12, 26, 0.86);
  border: 1.5px solid rgba(56, 189, 248, 0.48);
  border-radius: 16px;
  padding: 8px 22px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.8), 0 0 18px rgba(56, 189, 248, 0.25);
}

.rhythm-climax-badge {
  display: inline-block;
  padding: 2px 14px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  background: rgba(251, 191, 36, 0.22);
  border: 1.5px solid #fbbf24;
  color: #fef08a;
  text-shadow: 0 0 10px #fbbf24, 0 0 20px #f59e0b;
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.45);
  margin-bottom: 4px;
}

.rhythm-climax-badge.veriko {
  background: rgba(168, 85, 247, 0.26);
  border-color: #c084fc;
  color: #f3e8ff;
  text-shadow: 0 0 12px #c084fc, 0 0 24px #a855f7;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.6);
}

.rhythm-climax-title {
  font-size: 1.4rem;
  font-weight: 900;
  color: #ffffff;
  margin: 0;
  text-shadow: 0 2px 6px #000000, 0 0 16px rgba(56, 189, 248, 0.9);
}

.rhythm-climax-desc {
  font-size: 0.86rem;
  font-weight: 700;
  color: #f1f5f9;
  margin: 4px 0 0 0;
  text-shadow: 0 2px 4px #000000;
}

/* Oculta o clone gigante da carta para nunca sobrepor o texto nem poluir a arena */
.rhythm-climax-card-stage {
  display: none !important;
}

/* Pista Rítmica Totalmente Transparente com Cordas de Laser e Receptores */
.rhythm-lane-container {
  position: relative;
  width: 100%;
  max-width: 360px;
  height: 260px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  overflow: visible !important;
  margin: 6px 0 4px 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* Guias Verticais de Feixe de Luz (4 Colunas) */
.rhythm-laser-guides {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 33px;
  pointer-events: none;
  z-index: 1;
}

.rhythm-laser-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  transform: translateX(-50%);
  border-radius: 999px;
}

.rhythm-laser-line[data-dir="left"] {
  background: linear-gradient(to bottom, transparent 0%, rgba(236, 72, 153, 0.4) 30%, rgba(244, 114, 182, 0.95) 100%);
  box-shadow: 0 0 14px rgba(236, 72, 153, 0.75);
}
.rhythm-laser-line[data-dir="down"] {
  background: linear-gradient(to bottom, transparent 0%, rgba(6, 182, 212, 0.4) 30%, rgba(34, 211, 238, 0.95) 100%);
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.75);
}
.rhythm-laser-line[data-dir="up"] {
  background: linear-gradient(to bottom, transparent 0%, rgba(16, 185, 129, 0.4) 30%, rgba(52, 211, 153, 0.95) 100%);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.75);
}
.rhythm-laser-line[data-dir="right"] {
  background: linear-gradient(to bottom, transparent 0%, rgba(245, 158, 11, 0.4) 30%, rgba(251, 191, 36, 0.95) 100%);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.75);
}

.rhythm-receptors-row {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  place-items: center;
  width: 100%;
  padding: 6px 0;
  background: transparent !important;
  border: none !important;
  z-index: 5;
}

/* Linha Horizontal Luminosa de Alvo que atravessa o centro dos 4 receptores */
.rhythm-receptors-row::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 6%;
  right: 6%;
  height: 2px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, transparent 0%, rgba(56, 189, 248, 0.85) 20%, rgba(255, 255, 255, 0.95) 50%, rgba(56, 189, 248, 0.85) 80%, transparent 100%);
  box-shadow: 0 0 12px #38bdf8, 0 0 24px rgba(56, 189, 248, 0.8);
  z-index: -1;
  pointer-events: none;
}

.rhythm-receptor {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.35);
  border: 2.5px solid rgba(255, 255, 255, 0.6);
  color: #ffffff;
  font-size: 1.55rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.08s ease, border-color 0.08s ease, box-shadow 0.08s ease, background 0.08s ease;
}

.rhythm-receptor[data-dir="left"] {
  border-color: #f472b6;
  color: #fbcfe8;
  box-shadow: 0 0 14px rgba(236, 72, 153, 0.65), inset 0 0 10px rgba(236, 72, 153, 0.35);
}
.rhythm-receptor[data-dir="down"] {
  border-color: #22d3ee;
  color: #cffafe;
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.65), inset 0 0 10px rgba(6, 182, 212, 0.35);
}
.rhythm-receptor[data-dir="up"] {
  border-color: #34d399;
  color: #d1fae5;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.65), inset 0 0 10px rgba(16, 185, 129, 0.35);
}
.rhythm-receptor[data-dir="right"] {
  border-color: #fbbf24;
  color: #fef3c7;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.65), inset 0 0 10px rgba(245, 158, 11, 0.35);
}

.rhythm-receptor.hit-flash {
  transform: scale(1.3);
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #ffffff !important;
  box-shadow: 0 0 25px #ffffff, 0 0 50px #38bdf8, 0 0 80px currentColor !important;
}

/* Explosão Luminosa de Impacto no Receptor */
.rhythm-hit-burst {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  box-shadow: 0 0 20px #ffffff, 0 0 40px #fbbf24;
  pointer-events: none;
  animation: rhythmBurstRing 0.42s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes rhythmBurstRing {
  0% { transform: scale(0.7); opacity: 1; }
  100% { transform: scale(2.1); opacity: 0; }
}

/* Trilhas onde as notas luminosas caem */
.rhythm-notes-track {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 33px;
  pointer-events: none;
  z-index: 6;
}

.rhythm-falling-note {
  position: absolute;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 900;
  color: #ffffff;
  border: 2.5px solid #ffffff;
  transform: translate(-50%, -50%);
  will-change: top, opacity, transform;
  text-shadow: 0 0 10px #ffffff;
}

/* Halo Externo Pulsante de Luz nas Notas */
.rhythm-falling-note::before {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 18px currentColor;
  animation: noteHaloPulse 0.35s infinite alternate ease-in-out;
  pointer-events: none;
}

/* Cauda de Cometa Luminosa (Rastro de Luz Vertical) */
.rhythm-falling-note::after {
  content: "";
  position: absolute;
  bottom: 85%;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 75px;
  border-radius: 999px;
  background: linear-gradient(to top, rgba(255, 255, 255, 0.85), var(--note-glow, #38bdf8) 45%, transparent 100%);
  filter: blur(3px);
  opacity: 0.9;
  pointer-events: none;
}

@keyframes noteHaloPulse {
  0% { transform: scale(0.92); opacity: 0.65; }
  100% { transform: scale(1.16); opacity: 1; }
}

.rhythm-falling-note[data-dir="left"] {
  --note-glow: #ec4899;
  background: radial-gradient(circle, #fbcfe8 0%, #ec4899 55%, #be185d 100%);
  box-shadow: 0 0 14px #ffffff, 0 0 28px #ec4899, 0 0 55px rgba(236, 72, 153, 0.95);
}
.rhythm-falling-note[data-dir="down"] {
  --note-glow: #06b6d4;
  background: radial-gradient(circle, #cffafe 0%, #06b6d4 55%, #0e7490 100%);
  box-shadow: 0 0 14px #ffffff, 0 0 28px #06b6d4, 0 0 55px rgba(6, 182, 212, 0.95);
}
.rhythm-falling-note[data-dir="up"] {
  --note-glow: #10b981;
  background: radial-gradient(circle, #d1fae5 0%, #10b981 55%, #047857 100%);
  box-shadow: 0 0 14px #ffffff, 0 0 28px #10b981, 0 0 55px rgba(16, 185, 129, 0.95);
}
.rhythm-falling-note[data-dir="right"] {
  --note-glow: #f59e0b;
  background: radial-gradient(circle, #fef3c7 0%, #f59e0b 55%, #b45309 100%);
  box-shadow: 0 0 14px #ffffff, 0 0 28px #f59e0b, 0 0 55px rgba(245, 158, 11, 0.95);
}

/* ========================================================
   NOTAS LONGAS (HOLD NOTES - SUSTENTADAS NO RITMO DA MÚSICA)
   ======================================================== */
.rhythm-note-arrow-glyph {
  position: relative;
  z-index: 3;
  line-height: 1;
  pointer-events: none;
}

.rhythm-falling-note.is-hold-note::after {
  display: none !important;
}

.rhythm-hold-tail {
  position: absolute;
  bottom: 50%;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  min-height: 0;
  border-radius: 12px 12px 0 0;
  border-left: 2px solid rgba(255, 255, 255, 0.9);
  border-right: 2px solid rgba(255, 255, 255, 0.9);
  border-top: 2px solid rgba(255, 255, 255, 0.95);
  background: linear-gradient(
    to top,
    var(--note-glow, #38bdf8) 0%,
    rgba(255, 255, 255, 0.55) 50%,
    var(--note-glow, #38bdf8) 100%
  );
  box-shadow: 0 0 16px var(--note-glow, #38bdf8), inset 0 0 8px rgba(255, 255, 255, 0.8);
  z-index: -1;
  pointer-events: none;
  overflow: visible;
}

.rhythm-hold-end-cap {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 16px;
  border-radius: 999px;
  background: #ffffff;
  border: 2px solid var(--note-glow, #38bdf8);
  box-shadow: 0 0 14px #ffffff, 0 0 24px var(--note-glow, #38bdf8);
  pointer-events: none;
}

.rhythm-hold-label {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.55rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #fde047;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid #fde047;
  border-radius: 999px;
  padding: 1px 6px;
  white-space: nowrap;
  text-shadow: 0 0 6px rgba(253, 224, 71, 0.9);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
  z-index: 5;
  pointer-events: none;
}

.rhythm-falling-note.is-holding-active {
  transform: translate(-50%, -50%) scale(1.18);
  border-color: #fde047 !important;
  box-shadow: 0 0 22px #ffffff, 0 0 42px #fde047, 0 0 70px var(--note-glow, #38bdf8) !important;
}

.rhythm-falling-note.is-holding-active .rhythm-hold-tail {
  background: linear-gradient(
    to top,
    #fde047 0%,
    #ffffff 45%,
    var(--note-glow, #38bdf8) 100%
  );
  box-shadow: 0 0 24px #fde047, 0 0 40px var(--note-glow, #38bdf8), inset 0 0 12px #ffffff;
  animation: holdTailEnergyPulse 0.16s infinite alternate ease-in-out;
}

@keyframes holdTailEnergyPulse {
  0% { filter: brightness(1); width: 23px; }
  100% { filter: brightness(1.35); width: 27px; }
}

.rhythm-receptor.holding-active {
  transform: scale(1.22);
  background: rgba(253, 224, 71, 0.32) !important;
  border-color: #fde047 !important;
  color: #ffffff !important;
  box-shadow: 0 0 22px #fde047, 0 0 45px currentColor, inset 0 0 16px #ffffff !important;
  animation: receptorHoldPulse 0.2s infinite alternate ease-in-out;
}

@keyframes receptorHoldPulse {
  0% { transform: scale(1.16); }
  100% { transform: scale(1.28); }
}

.accuracy-text-holding {
  color: #fde047;
  font-size: 1.2rem;
  text-shadow: 0 0 14px #fde047, 0 0 28px #f59e0b;
  animation: readyPulseAnim 0.22s infinite alternate ease-in-out;
}

/* Feedback de Precisão Flutuante */
.rhythm-accuracy-display {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.95);
  margin-top: 2px;
}

.accuracy-text-ready {
  color: #7dd3fc;
  font-size: 1.15rem;
  text-shadow: 0 0 14px #38bdf8, 0 0 28px rgba(56, 189, 248, 0.8);
  animation: readyPulseAnim 0.45s infinite alternate ease-in-out;
}

@keyframes readyPulseAnim {
  0% { transform: scale(0.96); opacity: 0.8; }
  100% { transform: scale(1.06); opacity: 1; }
}

.accuracy-text-perfect {
  color: #fde047;
  text-shadow: 0 0 15px #fde047, 0 0 30px #f59e0b, 0 0 50px #ea580c;
  animation: accuracyPopAnim 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.accuracy-text-great {
  color: #38bdf8;
  text-shadow: 0 0 15px #38bdf8, 0 0 30px #0284c7;
  animation: accuracyPopAnim 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.accuracy-text-ok {
  color: #e2e8f0;
  animation: accuracyPopAnim 0.3s ease-out forwards;
}

.accuracy-text-miss {
  color: #f87171;
  text-shadow: 0 0 14px rgba(239, 68, 68, 0.9);
  animation: accuracyPopAnim 0.3s ease-out forwards;
}

@keyframes accuracyPopAnim {
  0% { transform: scale(0.6); opacity: 0; }
  50% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* Oculta a segunda fileira de botões para eliminar setas duplicadas (os próprios 4 receptores já respondem ao toque/clique e teclado) */
.rhythm-mobile-touch-pad {
  display: none !important;
}

.rhythm-touch-btn {
  flex: 1;
  max-width: 76px;
  height: 48px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.45);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  color: #f8fafc;
  font-size: 1.5rem;
  font-weight: 900;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.08s ease, background 0.08s ease, border-color 0.08s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.5);
}

.rhythm-touch-btn:active {
  transform: scale(0.92);
  filter: brightness(1.4);
}

.rhythm-touch-btn[data-touch-dir="left"]:active { background: #ec4899; border-color: #f472b6; }
.rhythm-touch-btn[data-touch-dir="down"]:active { background: #06b6d4; border-color: #22d3ee; }
.rhythm-touch-btn[data-touch-dir="up"]:active { background: #10b981; border-color: #34d399; }
.rhythm-touch-btn[data-touch-dir="right"]:active { background: #f59e0b; border-color: #fbbf24; }


/* Pulso do Compasso na Carta Selecionada (Indicador Visual em Tempo Real) */
.card.selected.card-beat-pulse {
  border-color: #fde047 !important;
  box-shadow: 
    0 15px 35px rgba(0, 0, 0, 0.8), 
    0 0 25px #fbbf24, 
    0 0 45px rgba(251, 191, 36, 0.7) !important;
  filter: brightness(1.18);
}

.card.selected.card-beat-pulse::after,
.card.fragmented.selected.card-beat-pulse::after {
  content: "⚡ CLIQUE P/ ATIVAR NO RITMO! [ESPAÇO] 🎵";
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.95), rgba(239, 68, 68, 0.95));
  border: 1.5px solid #fff;
  color: #ffffff;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  white-space: nowrap;
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.95), 0 0 35px rgba(239, 68, 68, 0.75);
  pointer-events: none;
  animation: cardBeatPulseBadge 0.25s infinite alternate ease-in-out;
  z-index: 1000 !important;
}

/* Quando fragmentada e selecionada no ritmo, preserva a textura de cristal no pseudo antes */
.card.fragmented.selected.card-beat-pulse {
  border-color: #fde047 !important;
  box-shadow: 
    0 15px 35px rgba(0, 0, 0, 0.8), 
    0 0 25px #fbbf24, 
    0 0 45px rgba(251, 191, 36, 0.85) !important;
  filter: brightness(1.22);
}

.card.fragmented.selected::after {
  /* Evita que o ::after de rachadura de cristal esmague o badge ::after da carta selecionada */
  display: none !important;
}
  content: "⚡ CLIQUE P/ ATIVAR NO RITMO! [ESPAÇO] 🎵";
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.95), rgba(239, 68, 68, 0.95));
  border: 1.5px solid #fff;
  color: #ffffff;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  white-space: nowrap;
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.95), 0 0 35px rgba(239, 68, 68, 0.75);
  pointer-events: none;
  animation: cardBeatPulseBadge 0.25s infinite alternate ease-in-out;
  z-index: 1000;
}

@keyframes cardBeatPulseBadge {
  from { transform: translateX(-50%) scale(0.96); filter: brightness(1); }
  to { transform: translateX(-50%) scale(1.05); filter: brightness(1.25); }
}

/* Pulso Rítmico na Linha de Mira de Alvo */
.targeting-svg-layer.beam-beat-glow #targeting-line-glow {
  stroke: #fbbf24 !important;
  stroke-width: 16px !important;
  opacity: 0.9 !important;
}

.targeting-svg-layer.beam-beat-glow #reticle-outer {
  stroke: #fbbf24 !important;
  stroke-width: 4.5px !important;
  transform: scale(1.25);
  transform-origin: center center;
}

.targeting-svg-layer.beam-beat-glow #reticle-inner {
  fill: #fef08a !important;
  r: 9px !important;
}

/* ==========================================================================
   HUD RÍTMICO SUPERIOR (ESTILO CRYPT OF THE NECRODANCER & GROOVE UNIFICADO)
   POSICIONADO ABAIXO DO #game-hud E ACIMA DO BANNER DE ARENA
   ========================================================================== */
.necrodancer-rhythm-hud {
  position: absolute;
  top: 66px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 95;
  pointer-events: auto;
  user-select: none;
  background: rgba(10, 15, 30, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(56, 189, 248, 0.45);
  border-radius: 16px;
  padding: 5px 16px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.65), 0 0 15px rgba(56, 189, 248, 0.25);
}

body.has-jukebox .necrodancer-rhythm-hud {
  top: 106px !important;
}

/* Garante que o Indicador de Arena fique SEMPRE abaixo do HUD Rítmico */
#screen-battle .active-terrain-indicator,
#battle-terrain-container.active-terrain-indicator {
  top: 122px !important;
  z-index: 90;
}

body.has-jukebox #screen-battle .active-terrain-indicator,
body.has-jukebox #battle-terrain-container.active-terrain-indicator {
  top: 162px !important;
}

.boss-death-focus-mode .necrodancer-rhythm-hud {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Trilhas Laterais por onde as barras de compasso viajam */
.necro-track {
  position: relative;
  width: 130px;
  height: 24px;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.2), rgba(15, 23, 42, 0.85));
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.7);
}

.necro-track-right {
  background: linear-gradient(-90deg, rgba(15, 23, 42, 0.2), rgba(15, 23, 42, 0.85));
}

/* Linhas de Batida que se movem em direção ao centro */
.necro-beat-line {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 0;
  width: 4px;
  border-radius: 2px;
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8, 0 0 16px rgba(56, 189, 248, 0.95);
  pointer-events: none;
  will-change: transform;
}

#necro-line-l2, #necro-line-r2 {
  opacity: 0.6;
  background: #818cf8;
  box-shadow: 0 0 8px #818cf8;
}

/* Centro: Ressonador e Coração */
.necro-center-resonator {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.necro-beat-heart {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.95);
  border: 2px solid #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.5), inset 0 0 8px rgba(56, 189, 248, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  cursor: pointer;
  transition: transform 0.08s ease, border-color 0.08s ease, box-shadow 0.08s ease;
  flex-shrink: 0;
}

.necro-beat-heart.on-beat-pulse {
  transform: scale(1.24);
  border-color: #fbbf24;
  box-shadow: 0 0 20px #fbbf24, 0 0 35px rgba(245, 158, 11, 0.85);
}

.necro-groove-flash-text {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
  font-weight: 900;
  color: #38bdf8;
  text-shadow: 0 0 10px #38bdf8, 0 0 18px #0284c7;
  white-space: nowrap;
  animation: grooveFlashPop 0.55s ease-out forwards;
}

@keyframes grooveFlashPop {
  0% { opacity: 0; transform: translateX(-50%) scale(0.6) translateY(4px); }
  35% { opacity: 1; transform: translateX(-50%) scale(1.2) translateY(-2px); }
  100% { opacity: 0; transform: translateX(-50%) scale(1) translateY(-12px); }
}

@media (max-width: 768px) {
  .necrodancer-rhythm-hud {
    top: 56px;
    padding: 4px 10px;
    gap: 8px;
    transform: translateX(-50%) scale(0.88);
  }
  body.has-jukebox .necrodancer-rhythm-hud {
    top: 96px !important;
  }
  #screen-battle .active-terrain-indicator,
  #battle-terrain-container.active-terrain-indicator {
    top: 106px !important;
  }
  body.has-jukebox #screen-battle .active-terrain-indicator,
  body.has-jukebox #battle-terrain-container.active-terrain-indicator {
    top: 146px !important;
  }
  .necro-track {
    width: 80px;
    height: 20px;
  }
  .necro-beat-heart {
    width: 34px;
    height: 34px;
    font-size: 1.15rem;
  }
}

/* 5. AURA DEMONÍACA RADICAL: POSSESSÃO DE ZABOEL (Maldade >= 5) */
.sprite-container.aura-zaboel-possessed {
  position: relative;
}

.sprite-container.aura-zaboel-possessed img {
  animation: zaboelPossessionPulse 0.85s infinite alternate ease-in-out !important;
  filter: 
    drop-shadow(0 0 15px rgba(220, 38, 38, 0.95)) 
    drop-shadow(0 0 35px rgba(147, 51, 234, 0.9)) 
    drop-shadow(0 0 55px rgba(0, 0, 0, 0.95)) 
    contrast(1.35) 
    saturate(1.4) 
    hue-rotate(-25deg) !important;
}

@keyframes zaboelPossessionPulse {
  0% {
    transform: scale(1) translateY(0);
    filter: 
      drop-shadow(0 0 15px rgba(220, 38, 38, 0.95)) 
      drop-shadow(0 0 35px rgba(147, 51, 234, 0.85)) 
      drop-shadow(0 0 50px rgba(0, 0, 0, 0.95)) 
      contrast(1.3) 
      saturate(1.35);
  }
  50% {
    transform: scale(1.04) translateY(-3px);
    filter: 
      drop-shadow(0 0 25px rgba(239, 68, 68, 1)) 
      drop-shadow(0 0 55px rgba(168, 85, 247, 1)) 
      drop-shadow(0 0 70px rgba(17, 24, 39, 1)) 
      contrast(1.5) 
      saturate(1.6);
  }
  100% {
    transform: scale(1.02) translateY(1px);
    filter: 
      drop-shadow(0 0 35px rgba(185, 28, 28, 1)) 
      drop-shadow(0 0 65px rgba(126, 34, 206, 1)) 
      drop-shadow(0 0 85px rgba(0, 0, 0, 1)) 
      contrast(1.45) 
      saturate(1.5);
  }
}

/* Chamas e Névoa Demoníaca Flutuante de Zaboel sobre Ionely */
.sprite-container.aura-zaboel-possessed::before {
  content: "👿";
  position: absolute;
  top: -42px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2.2rem;
  filter: drop-shadow(0 0 15px #ef4444) drop-shadow(0 0 30px #9333ea);
  animation: zaboelHeadFloat 1.2s infinite ease-in-out alternate;
  z-index: 100;
  pointer-events: none;
}

@keyframes zaboelHeadFloat {
  0% { transform: translateX(-50%) translateY(0) scale(0.92); opacity: 0.85; }
  100% { transform: translateX(-50%) translateY(-8px) scale(1.15); opacity: 1; filter: drop-shadow(0 0 25px #dc2626) drop-shadow(0 0 45px #a855f7); }
}

.sprite-container.aura-zaboel-possessed::after {
  content: "POSSUÍDA POR ZABOEL";
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 7, 26, 0.95);
  border: 1.5px solid #ef4444;
  color: #fca5a5;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 1px;
  padding: 2px 10px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.8), 0 0 25px rgba(147, 51, 234, 0.6);
  animation: pulse 0.5s infinite alternate ease-in-out;
  z-index: 100;
  pointer-events: none;
}

/* Atenuação de HUD e Sprites durante o Minigame Clímax */
body.rhythm-climax-active #battle-entities,
body.rhythm-climax-active .combatant-hud,
body.rhythm-climax-active #hero-log-btn,
body.rhythm-climax-active #combat-log-box,
body.rhythm-climax-active .enemy-intent-container,
body.rhythm-climax-active .enemy-intent-badge,
body.rhythm-climax-active .status-effects-list,
body.rhythm-climax-active .status-list,
body.rhythm-climax-active .combatant-info,
body.rhythm-climax-active .name-tag,
body.rhythm-climax-active .hp-bar-container,
body.rhythm-climax-active .hp-text,
body.rhythm-climax-active .block-value,
body.rhythm-climax-active .combatant-name,
body.rhythm-climax-active .combatant-hp-bar-wrapper,
body.rhythm-climax-active .combatant-hp-text {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.25s ease-out;
}

body.rhythm-climax-active .sprite-container {
  opacity: 0.28 !important;
  filter: grayscale(0.5) blur(1px) !important;
  transition: opacity 0.25s ease-out, filter 0.25s ease-out;
}

body.rhythm-climax-active #battle-hand,
body.rhythm-climax-active .battle-controls-container {
  opacity: 0.18 !important;
  pointer-events: none !important;
  filter: blur(1.5px);
  transition: opacity 0.25s ease-out;
}

.floating-text.groove-text {
  color: #00d2ff;
  font-size: 1.5rem !important;
  font-weight: 900;
  letter-spacing: 1.5px;
  text-shadow: 0 0 16px rgba(0, 210, 255, 0.95), 0 0 6px #0284c7, 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000;
  z-index: 600;
}

/* ========================================================
   OVERLAY DE PAUSA TOTAL DA TELA (MODO RANQUEADO / DUELO)
   ======================================================== */
.ranked-pause-screen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9200;
  background: rgba(3, 7, 18, 0.65);
  backdrop-filter: blur(1.5px);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.ranked-pause-screen-overlay.hidden {
  display: none !important;
}

.ranked-pause-screen-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.95);
  border: 2px solid #f87171;
  border-radius: 20px;
  padding: 22px 36px;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.8), 0 0 25px rgba(239, 68, 68, 0.4);
  pointer-events: auto;
  cursor: pointer;
  animation: pulsePauseScreen 2s infinite ease-in-out;
}

.ranked-pause-screen-badge .pause-icon {
  font-size: 2.2rem;
}

.ranked-pause-screen-badge .pause-title {
  font-family: var(--font-title);
  font-size: 1.35rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 2px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.ranked-pause-screen-badge .pause-sub {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fca5a5;
  letter-spacing: 0.8px;
}

@keyframes pulsePauseScreen {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.8), 0 0 20px rgba(239, 68, 68, 0.35);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.8), 0 0 35px rgba(239, 68, 68, 0.65);
  }
}

/* ==========================================================================
   MARCADOR VISUAL DE CARTA RÍTMICA / MINIGAME DE RITMO (🎵)
   ========================================================================== */
.card-rhythm-badge {
  position: absolute;
  top: -8px;
  left: -8px;
  width: var(--card-cost-size, 22px);
  height: var(--card-cost-size, 22px);
  min-width: 20px;
  min-height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #38bdf8 0%, #0284c7 50%, #0369a1 100%);
  border: 1.5px solid #e0f2fe;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.75), 0 2px 6px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 25;
  pointer-events: none;
  animation: rhythm-badge-pulse 2.2s infinite ease-in-out;
}

.card-rhythm-badge .rhythm-note-icon {
  font-size: clamp(0.68rem, 1vh, 0.8rem);
  line-height: 1;
  display: inline-block;
  transform: translateY(-0.5px);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8));
}

@keyframes rhythm-badge-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.65), 0 2px 5px rgba(0, 0, 0, 0.6);
  }
  50% {
    transform: scale(1.12);
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.95), 0 0 6px rgba(255, 255, 255, 0.8), 0 3px 8px rgba(0, 0, 0, 0.7);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.65), 0 2px 5px rgba(0, 0, 0, 0.6);
  }
}

.card-inspector-rhythm-badge {
  font-size: 1.25rem;
  color: #38bdf8;
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.8));
  display: inline-flex;
  align-items: center;
  cursor: help;
  animation: rhythm-badge-pulse 2s infinite ease-in-out;
}

/* =========================================================================
   GRITO DE HABILIDADE & ULTIMATE CINEMATIC DO INIMIGO
   ========================================================================= */
.enemy-ability-shout {
  position: absolute;
  transform: translate(-50%, -100%) scale(0.7);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(185, 28, 28, 0.95) 100%);
  border: 2px solid #fecaca;
  color: #ffffff;
  padding: 6px 18px;
  border-radius: 999px;
  font-family: var(--font-title, sans-serif);
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.95), 0 6px 18px rgba(0, 0, 0, 0.85);
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  animation: enemyShoutPop 2s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

@keyframes enemyShoutPop {
  0% {
    opacity: 0;
    transform: translate(-50%, -70%) scale(0.6);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, -115%) scale(1.15);
  }
  28% {
    transform: translate(-50%, -105%) scale(1);
  }
  80% {
    opacity: 1;
    transform: translate(-50%, -110%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -140%) scale(0.9);
  }
}

/* Cinemática de Habilidade Suprema do Inimigo (Estilo Corte de Olho / Cut-in) */
.enemy-ultimate-cutin-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99990;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(3, 7, 18, 0.72);
  animation: enemyCutinFadeInOut 1.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.enemy-ultimate-banner {
  position: relative;
  width: 100vw;
  height: 220px;
  background: linear-gradient(90deg, rgba(127, 29, 29, 0.98) 0%, rgba(153, 27, 27, 0.95) 15%, rgba(153, 27, 27, 0.95) 85%, rgba(127, 29, 29, 0.98) 100%);
  border-top: 3.5px solid #ef4444;
  border-bottom: 3.5px solid #ef4444;
  box-shadow: 0 0 50px rgba(239, 68, 68, 0.85), inset 0 0 35px rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transform: skewX(-7deg);
}

/* Portrait do Inimigo no Lado Direito (quadro amarelo) - Virado para a esquerda encarando o jogador */
.enemy-ultimate-portrait-strip {
  position: absolute;
  right: 4%;
  left: auto;
  width: 380px;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  filter: contrast(1.25) drop-shadow(0 0 22px rgba(239, 68, 68, 0.95));
  mask-image: linear-gradient(90deg, transparent 0%, black 15%, black 85%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 15%, black 85%, transparent 100%);
  pointer-events: none;
  z-index: 5;
}

.enemy-ultimate-portrait-strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 10%; /* Foco canônico no rosto e olhos */
  transform: scaleX(-1) skewX(7deg) scale(1.35); /* Invertido para a esquerda encarando o herói */
  transform-origin: center top;
}

/* Ajustes de enquadramento facial individual para sprites específicos */
.enemy-ultimate-portrait-strip.focus-yume img {
  object-position: center 4%;
  transform: scaleX(-1) skewX(7deg) scale(1.45);
}

.enemy-ultimate-portrait-strip.focus-kou img {
  object-position: center 2%;
  transform: scaleX(-1) skewX(7deg) scale(1.4);
}

.enemy-ultimate-portrait-strip.focus-valdez img {
  object-position: center 12%;
  transform: scaleX(-1) skewX(7deg) scale(1.3);
}

.enemy-ultimate-portrait-strip.focus-mecha img {
  object-position: center 15%;
  transform: scaleX(-1) skewX(7deg) scale(1.3);
}

.enemy-ultimate-portrait-strip.focus-mui img {
  object-position: center 8%;
  transform: scaleX(-1) skewX(7deg) scale(1.35);
}

.enemy-ultimate-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transform: skewX(7deg);
  text-align: center;
  padding: 0 40px;
  max-width: 65vw;
}

/* Portrait do Inimigo Atacando nos Supremos/Vériko Inimigo (Lado Direito, virado para a esquerda encarando o herói) */
.veriko-enemy-portrait-strip {
  position: absolute;
  right: 2%;
  left: auto;
  width: clamp(380px, 36vw, 600px);
  height: 100%;
  max-height: 100%;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: contrast(1.15) drop-shadow(0 0 25px var(--veriko-enemy-glow, rgba(239, 68, 68, 0.95)));
  mask-image: linear-gradient(90deg, transparent 0%, black 10%, black 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 10%, black 100%);
  pointer-events: none;
  z-index: 15;
}

.veriko-enemy-portrait-strip img {
  width: auto;
  height: 95%;
  max-width: 100%;
  max-height: 95%;
  object-fit: contain;
  object-position: center center;
  transform: scaleX(-1); /* Invertido para a esquerda encarando o herói com sprite integral */
  transform-origin: center center;
}

/* Portrait do Herói nos Verikos do Jogador (Lado Esquerdo, virado para a direita) */
.veriko-hero-portrait-strip {
  position: absolute;
  left: 2%;
  right: auto;
  width: clamp(380px, 36vw, 600px);
  height: 100%;
  max-height: 100%;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: contrast(1.15) drop-shadow(0 0 25px var(--veriko-hero-glow, rgba(234, 179, 8, 0.95)));
  mask-image: linear-gradient(90deg, black 0%, black 90%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, black 0%, black 90%, transparent 100%);
  pointer-events: none;
  z-index: 15;
}

.veriko-hero-portrait-strip img {
  width: auto;
  height: 95%;
  max-width: 100%;
  max-height: 95%;
  object-fit: contain;
  object-position: center center;
  transform: scaleX(1); /* Virado naturalmente para a direita com sprite integral */
  transform-origin: center center;
}

.enemy-ultimate-boss-badge {
  font-family: var(--font-title, sans-serif);
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 3.5px;
  color: #fca5a5;
  text-transform: uppercase;
  margin-bottom: 6px;
  text-shadow: 0 0 12px rgba(239, 68, 68, 0.9);
}

.enemy-ultimate-skill-name {
  font-family: var(--font-title, sans-serif);
  font-size: 2.6rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-shadow: 0 0 25px rgba(239, 68, 68, 1), 0 0 45px rgba(245, 158, 11, 0.9), 2px 2px 6px #000;
}

@keyframes enemyCutinFadeInOut {
  0% {
    opacity: 0;
    transform: scaleY(0.4);
  }
  12% {
    opacity: 1;
    transform: scaleY(1);
  }
  80% {
    opacity: 1;
    transform: scaleY(1);
  }
  100% {
    opacity: 0;
    transform: scaleY(0.7);
  }
}

/* ==========================================================================
   FEEDBACK ARCADE ORGÂNICO DE RITMO (RANK STAMP / ESTILO JOGO DE RITMO)
   ========================================================================== */
.rhythm-arcade-feedback {
  position: fixed;
  inset: 0;
  z-index: 10010;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.4) 0%, transparent 75%);
  transition: opacity 0.2s ease-out;
}

.rhythm-arcade-feedback.fade-out {
  opacity: 0;
}

.rhythm-arcade-stamp {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transform-origin: center center;
  animation: arcadeStampSlam 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes arcadeStampSlam {
  0% { transform: scale(2.2) rotate(-8deg); opacity: 0; filter: blur(6px); }
  60% { transform: scale(0.92) rotate(1deg); opacity: 1; filter: blur(0); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.rhythm-arcade-tier-line {
  display: flex;
  align-items: center;
  gap: 16px;
}

.rhythm-arcade-icon {
  font-size: clamp(2rem, 4vw, 3.2rem);
  animation: arcadeIconBob 0.8s infinite alternate ease-in-out;
}

@keyframes arcadeIconBob {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-4px) scale(1.15); }
}

.rhythm-arcade-tier-title {
  font-size: clamp(3.2rem, 8vw, 5.8rem);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
}

/* Tiers Estilizados com Cores e Brilhos Neon Específicos */
.rhythm-arcade-feedback.tier-perfeito .rhythm-arcade-tier-title {
  color: #fffbeb;
  text-shadow: 0 0 25px #fbbf24, 0 0 50px #f59e0b, 0 0 80px #d97706;
  animation: perfectShine 0.5s infinite alternate ease-in-out;
}

.rhythm-arcade-feedback.tier-excelente .rhythm-arcade-tier-title {
  color: #f0f9ff;
  text-shadow: 0 0 25px #38bdf8, 0 0 50px #0284c7, 0 0 80px #0369a1;
}

.rhythm-arcade-feedback.tier-bom .rhythm-arcade-tier-title {
  color: #f0fdf4;
  text-shadow: 0 0 20px #34d399, 0 0 45px #059669;
}

.rhythm-arcade-feedback.tier-ruim .rhythm-arcade-tier-title {
  color: #fff7ed;
  text-shadow: 0 0 20px #fb923c, 0 0 40px #c2410c;
}

.rhythm-arcade-feedback.tier-mediocre .rhythm-arcade-tier-title {
  color: #fef2f2;
  text-shadow: 0 0 25px #ef4444, 0 0 50px #991b1b;
}

@keyframes perfectShine {
  0% { filter: brightness(1) drop-shadow(0 0 10px #fbbf24); }
  100% { filter: brightness(1.25) drop-shadow(0 0 30px #f59e0b); }
}

.rhythm-arcade-subline {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  padding: 8px 24px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.7);
  font-size: clamp(0.95rem, 2vw, 1.3rem);
}

.rhythm-notes-tag {
  color: #cbd5e1;
  font-weight: 700;
}

.rhythm-pct-tag {
  font-weight: 900;
  color: #ffffff;
}

.rhythm-badge-tag {
  padding: 2px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.85em;
}

.rhythm-badge-tag.is-bonus {
  background: rgba(52, 211, 153, 0.25);
  color: #34d399;
  border: 1px solid #34d399;
}

.rhythm-badge-tag.is-penalty {
  background: rgba(239, 68, 68, 0.25);
  color: #ef4444;
  border: 1px solid #ef4444;
}

.rhythm-veriko-flag {
  font-size: clamp(1.1rem, 2.5vw, 1.8rem);
  font-weight: 900;
  padding: 4px 20px;
  border-radius: 8px;
  letter-spacing: 0.08em;
}

.rhythm-veriko-flag.fail {
  background: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  border: 1.5px solid #ef4444;
  text-shadow: 0 0 15px #ef4444;
}

.rhythm-veriko-flag.success {
  background: rgba(251, 191, 36, 0.3);
  color: #fef08a;
  border: 1.5px solid #fbbf24;
  text-shadow: 0 0 20px #fbbf24;
}

/* Cinemática de Falha do Vériko */
.veriko-failed-cinematic-overlay {
  position: fixed;
  inset: 0;
  z-index: 10009;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(127, 29, 29, 0.85) 0%, rgba(20, 5, 5, 0.95) 100%);
  pointer-events: none;
  animation: verikoFailEntrance 0.35s ease-out forwards;
}

.veriko-failed-cinematic-overlay.fade-out {
  opacity: 0;
  transition: opacity 0.3s ease-out;
}

@keyframes verikoFailEntrance {
  0% { opacity: 0; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1); }
}

.veriko-failed-banner {
  border-top: 2px solid #ef4444;
  border-bottom: 2px solid #ef4444;
  background: rgba(0, 0, 0, 0.75);
  padding: 24px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: 0 0 35px rgba(239, 68, 68, 0.7);
}

.veriko-failed-title {
  font-size: clamp(2rem, 5vw, 3.8rem);
  font-weight: 900;
  color: #f87171;
  text-shadow: 0 0 25px #ef4444;
}

.veriko-failed-sub {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fca5a5;
  letter-spacing: 0.1em;
}

.veriko-failed-reason {
  font-size: 0.85rem;
  color: #94a3b8;
  letter-spacing: 0.05em;
}


/* ==========================================================================
   Dual-Layer Action Crossfade Sprite System
   ========================================================================== */
.sprite-container {
  position: relative;
}
.sprite-layer-action {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  pointer-events: none;
  transition: opacity 75ms ease-out;
  z-index: 2;
}
.sprite-layer-action.active {
  opacity: 1;
}
.sprite-layer-idle {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 75ms ease-out;
  z-index: 1;
}
.sprite-layer-idle.suppressed {
  opacity: 0;
}

/* ==========================================================================
   LEGIBILIDADE DAS ANIMAÇÕES DE COMBATE (Attack / Hit)
   Enquanto o GIF de ação está ativo, os movimentos CSS ficam só em translação
   (sem scale/skew), para não distorcer nem borrar a animação.
   ========================================================================== */
.sprite-container.action-playing.animate-attack {
  animation: character-attack-clean 0.4s ease-in-out forwards;
}
.player-wrapper .sprite-container.action-playing.animate-attack {
  animation: character-attack-player-clean 0.4s ease-in-out forwards;
}
@keyframes character-attack-clean {
  0% { transform: translateX(0); }
  30% { transform: translateX(-18px); }
  100% { transform: translateX(0); }
}
@keyframes character-attack-player-clean {
  0% { transform: translateX(0); }
  30% { transform: translateX(18px); }
  100% { transform: translateX(0); }
}
.sprite-container.action-playing.knockback-enemy,
.sprite-container.action-playing.knockback-enemy.heavy {
  animation: knockback-enemy-clean 0.32s ease-out forwards !important;
}
.sprite-container.action-playing.knockback-player,
.sprite-container.action-playing.knockback-player.heavy {
  animation: knockback-player-clean 0.32s ease-out forwards !important;
}
@keyframes knockback-enemy-clean {
  0% { transform: translateX(0); }
  25% { transform: translateX(10px); }
  100% { transform: translateX(0); }
}
@keyframes knockback-player-clean {
  0% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  100% { transform: translateX(0); }
}
.sprite-container.action-playing.hit-stop {
  transform: none !important;
  filter: brightness(1.4) !important;
}
/* Flash curto e leve aplicado sobre o GIF de Hit (substitui o invert agressivo) */
.sprite-layer-action.action-hit-flash {
  animation: action-hit-flash-anim 0.14s ease-out forwards;
}
@keyframes action-hit-flash-anim {
  0% { filter: brightness(1.8) drop-shadow(0 0 8px rgba(255, 255, 255, 0.7)); }
  100% { filter: brightness(1); }
}
/* Pulso sutil para cartas não-ofensivas (Defesa, Suporte, Efeito) - Fase 4 */
.sprite-container.animate-cast {
  animation: character-cast-pulse 0.36s ease-out forwards;
}
@keyframes character-cast-pulse {
  0% { transform: translateY(0); filter: brightness(1); }
  40% { transform: translateY(-6px); filter: brightness(1.18) drop-shadow(0 0 10px rgba(56, 189, 248, 0.45)); }
  100% { transform: translateY(0); filter: brightness(1); }
}

/* ==========================================================================
   MOBILE & TABLET LANDSCAPE OVERHAUL v2 — HUD REDESENHADO + ARENA POKÉMON
   ========================================================================== */

/* 0. ISOLAMENTO ESTRITO DE TELAS OCULTAS & RESET DE VIEWPORT */
.hidden,
.screen.hidden,
#game-hud.hidden,
body.is-mobile .screen.hidden,
body.is-mobile.is-landscape .screen.hidden,
body.is-mobile #screen-main-menu.hidden,
body.is-mobile #screen-char-select.hidden,
body.is-mobile #screen-battle.hidden,
body.is-mobile #screen-map.hidden,
body.is-mobile #screen-shop.hidden,
body.is-mobile #screen-rest.hidden,
body.is-mobile #screen-rewards.hidden,
body.is-mobile #screen-ending.hidden,
body.is-mobile #screen-event.hidden {
  display: none !important;
}

/* 1. OVERLAY DE ORIENTAÇÃO HORIZONTAL OBRIGATÓRIA */
.mobile-rotate-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  z-index: 999999;
  background: radial-gradient(circle at 50% 35%, rgba(17, 24, 39, 0.98) 0%, rgba(3, 7, 18, 0.99) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}
.mobile-rotate-overlay.hidden {
  display: none !important;
}
.mobile-rotate-card {
  max-width: 360px;
  width: 100%;
  background: rgba(15, 23, 42, 0.95);
  border: 1.5px solid rgba(251, 191, 36, 0.55);
  border-radius: 18px;
  padding: 26px 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 28px rgba(251, 191, 36, 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.mobile-rotate-card h2 {
  margin: 0;
  color: #fbbf24;
  font-size: 1.35rem;
  letter-spacing: 1.5px;
}
.mobile-rotate-card p {
  margin: 0;
  color: #e2e8f0;
  font-size: 0.94rem;
  line-height: 1.5;
}
.mobile-rotate-phone-icon {
  font-size: 3rem;
  display: inline-block;
  animation: rotate-phone-hint 2.2s ease-in-out infinite;
}
@keyframes rotate-phone-hint {
  0%, 20% { transform: rotate(0deg); }
  55%, 80% { transform: rotate(-90deg); }
  100% { transform: rotate(0deg); }
}

/* 2. BOTÃO DE ATALHO PWA NA TELA INICIAL E GUIA DE INSTALAÇÃO */
.btn-install-mobile {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.24), rgba(56, 189, 248, 0.2)) !important;
  border: 1.5px solid rgba(52, 211, 153, 0.72) !important;
  color: #a7f3d0 !important;
  font-weight: 800 !important;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.25) !important;
}
.btn-install-mobile:active {
  transform: scale(0.97);
}

#pwa-install-guide-modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
#pwa-install-guide-modal.hidden {
  display: none !important;
}
.pwa-guide-card {
  width: min(560px, 95vw);
  max-height: 90dvh;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.97);
  border: 1.5px solid rgba(56, 189, 248, 0.45);
  border-radius: 16px;
  padding: 18px 22px;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pwa-guide-card h2 {
  margin: 0;
  font-size: 1.2rem;
  color: #fde68a;
  text-align: center;
}
.pwa-guide-card p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #cbd5e1;
  text-align: center;
}
.pwa-guide-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.pwa-step-block {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  padding: 10px 12px;
  text-align: left;
}
body.is-ios .pwa-step-ios,
body:not(.is-ios) .pwa-step-android {
  border-color: rgba(56, 189, 248, 0.72);
  background: rgba(14, 116, 144, 0.2);
}
.pwa-step-block h4 {
  margin: 0 0 6px 0;
  font-size: 0.86rem;
  color: #f8fafc;
}
.pwa-step-block ol {
  margin: 0;
  padding-left: 16px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #cbd5e1;
}
.pwa-guide-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* 3. TOOLTIP FLUTUANTE POR TOQUE & BOTÃO DE LEITURA AMPLIADA DA CARTA */
.mobile-tap-tooltip {
  position: fixed;
  z-index: 100050;
  max-width: min(300px, calc(100vw - 24px));
  background: rgba(7, 11, 22, 0.96);
  border: 1.5px solid rgba(251, 191, 36, 0.65);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.78rem;
  line-height: 1.38;
  color: #f8fafc;
  pointer-events: none;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.85);
}
.mobile-tap-tooltip.hidden {
  display: none !important;
}

.card-text-zoom-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid #fbbf24;
  background: rgba(15, 23, 42, 0.94);
  color: #fef3c7;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 30;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.75);
}

/* 4. ESTABILIDADE MOBILE, VIEWPORT 100DVH E CONTAINER FULLSCREEN */
html:has(body.is-mobile),
body.is-mobile {
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

body.is-mobile #game-container {
  padding: 0 !important;
  margin: 0 !important;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
}

body.is-mobile .glass-card,
body.is-mobile #game-hud,
body.is-mobile .necrodancer-rhythm-hud,
body.is-mobile .event-dialog-box,
body.is-mobile .ending-dialog-box,
body.is-mobile .modal-overlay {
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
}

/* Impede efeito :hover preso após toque nas cartas */
body.is-mobile .hand-container .card:hover:not(.selected):not(.card-dragging) {
  transform: none !important;
  border-color: inherit !important;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5) !important;
  z-index: auto !important;
}
body.is-mobile .card.card-dragging {
  border-color: #38bdf8 !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.75), 0 0 22px rgba(56, 189, 248, 0.65) !important;
}

/* 5. HUD SUPERIOR REDESENHADO (LINHA ÚNICA DE 28PX NO MOBILE LANDSCAPE) */
body.is-mobile.is-landscape #game-hud:not(.hidden) {
  height: 28px !important;
  min-height: 28px !important;
  padding: 0 max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left)) !important;
  gap: 6px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: nowrap !important;
  overflow: hidden !important;
  background: linear-gradient(180deg, rgba(5, 9, 20, 0.94) 0%, rgba(10, 16, 32, 0.84) 100%) !important;
  border-bottom: 1px solid rgba(56, 189, 248, 0.25) !important;
  z-index: 120 !important;
}
body.is-mobile.is-landscape #game-hud .hud-left,
body.is-mobile.is-landscape #game-hud .hud-center,
body.is-mobile.is-landscape #game-hud .hud-right {
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
  flex-wrap: nowrap !important;
  min-width: 0 !important;
}
body.is-mobile.is-landscape #game-hud .hud-item,
body.is-mobile.is-landscape #game-hud .hud-btn {
  white-space: nowrap !important;
  height: 21px !important;
  min-height: 21px !important;
  padding: 0 7px !important;
  font-size: 0.68rem !important;
  line-height: 21px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 3px !important;
  border-radius: 6px !important;
}
body.is-mobile.is-landscape #hud-character-name {
  max-width: 118px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
body.is-mobile.is-landscape #hud-floor {
  max-width: 145px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
body.is-mobile.is-landscape #hud-audio-btn {
  width: 24px !important;
  min-width: 24px !important;
  height: 21px !important;
  padding: 0 !important;
  font-size: 0.78rem !important;
}
body.is-mobile.is-landscape #hud-artifacts-list {
  max-width: 18vw !important;
  overflow-x: auto !important;
  scrollbar-width: none;
  gap: 3px !important;
}
body.is-mobile.is-landscape #hud-artifacts-list .relic-icon {
  width: 19px !important;
  height: 19px !important;
}
body.is-mobile.is-landscape #jukebox-player-bar {
  top: 28px !important;
  height: 26px !important;
  padding: 0 8px !important;
}

/* ==========================================================================
   6. MENU INICIAL (#screen-main-menu) EM MOBILE LANDSCAPE
   ========================================================================== */
body.is-mobile.is-landscape #screen-main-menu:not(.hidden) {
  position: relative !important;
  width: 100vw !important;
  height: 100dvh !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 34px max(12px, env(safe-area-inset-right)) 24px max(12px, env(safe-area-inset-left)) !important;
  overflow: hidden !important;
}
body.is-mobile.is-landscape #screen-main-menu .user-profile-header {
  top: 6px !important;
  right: max(10px, env(safe-area-inset-right)) !important;
  transform: scale(0.82);
  transform-origin: top right;
  z-index: 30 !important;
}
body.is-mobile.is-landscape #screen-main-menu .menu-container {
  margin: 0 auto !important;
  padding: 8px 12px !important;
  width: min(410px, 60vw) !important;
  max-width: min(410px, 60vw) !important;
  gap: 9px !important;
  background: radial-gradient(ellipse at center, rgba(5, 8, 20, 0.56) 0%, rgba(5, 8, 20, 0.16) 72%, transparent 100%);
  border-radius: 16px;
}
body.is-mobile.is-landscape #screen-main-menu .title-branding-group {
  align-items: center !important;
  text-align: center !important;
  margin-bottom: 0 !important;
}
body.is-mobile.is-landscape #screen-main-menu .game-presenter-subtitle {
  font-size: 0.52rem !important;
  margin-bottom: 2px !important;
}
body.is-mobile.is-landscape #screen-main-menu .game-logo {
  font-size: clamp(1.38rem, 4.1vw, 2.25rem) !important;
  text-align: center !important;
  line-height: 0.98 !important;
}
body.is-mobile.is-landscape #screen-main-menu .menu-buttons {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 7px 10px !important;
  width: 100% !important;
  max-width: 390px !important;
  margin: 0 auto !important;
}
body.is-mobile.is-landscape #screen-main-menu .menu-buttons > #btn-start-run {
  grid-column: 1 / -1 !important;
  height: 34px !important;
  min-height: 34px !important;
  font-size: 0.88rem !important;
  padding: 0 12px !important;
}
body.is-mobile.is-landscape #screen-main-menu .menu-buttons .btn,
body.is-mobile.is-landscape #screen-main-menu .ranked-btn-wrapper {
  width: 100% !important;
  height: 31px !important;
  min-height: 31px !important;
  padding: 0 8px !important;
  font-size: 0.76rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  border-radius: 9px !important;
}
body.is-mobile.is-landscape #screen-main-menu .ranked-btn-wrapper {
  padding: 0 !important;
}
body.is-mobile.is-landscape #screen-main-menu .ranked-btn-wrapper .btn-ranked-mode {
  gap: 5px !important;
  height: 31px !important;
  min-height: 31px !important;
  padding: 0 8px !important;
}
body.is-mobile.is-landscape #screen-main-menu .btn-ranked-mode .ranked-badge-pill {
  font-size: 0.54rem !important;
  padding: 1px 5px !important;
}
body.is-mobile.is-landscape #screen-main-menu .menu-buttons .btn.hidden,
body.is-mobile.is-landscape #btn-show-debug.hidden {
  display: none !important;
}
body.is-mobile.is-landscape #btn-install-pwa:not(.hidden),
body.is-mobile.is-landscape #btn-show-debug:not(.hidden) {
  grid-column: 1 / -1 !important;
  height: 30px !important;
  min-height: 30px !important;
  margin-top: 0 !important;
  font-size: 0.74rem !important;
  display: flex !important;
}
body.is-mobile.is-landscape #screen-main-menu .ranked-menu-tooltip {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body.is-mobile.is-landscape #screen-main-menu > div:has(#btn-show-credits) {
  bottom: 8px !important;
  right: max(10px, env(safe-area-inset-right)) !important;
  gap: 6px !important;
  z-index: 40 !important;
}

/* ==========================================================================
   7. SELEÇÃO DE PERSONAGEM (#screen-char-select) — SPLIT 2 COLUNAS MASTER-DETAIL
   ========================================================================== */
body.is-mobile.is-landscape #screen-char-select:not(.hidden) {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  padding: 0 !important;
  display: block !important;
  overflow: hidden !important;
}
body.is-mobile.is-landscape #char-select-spotlight {
  width: 340px !important;
  height: 75dvh !important;
}
body.is-mobile.is-landscape #screen-char-select .char-select-header {
  position: absolute !important;
  top: 6px !important;
  left: max(8px, env(safe-area-inset-left)) !important;
  width: 41vw !important;
  max-width: 41vw !important;
  transform: none !important;
  margin: 0 !important;
  z-index: 16 !important;
  text-align: center !important;
}
body.is-mobile.is-landscape #screen-char-select .char-select-title {
  font-size: clamp(0.76rem, 1.8vw, 1.05rem) !important;
  letter-spacing: 1px !important;
  margin: 0 !important;
}
body.is-mobile.is-landscape #screen-char-select .char-select-subtitle {
  display: none !important;
}
body.is-mobile.is-landscape #screen-char-select .char-active-floating-name {
  position: absolute !important;
  top: 25px !important;
  left: max(8px, env(safe-area-inset-left)) !important;
  width: 41vw !important;
  transform: none !important;
  z-index: 16 !important;
}
body.is-mobile.is-landscape #screen-char-select .active-hero-badge-title {
  font-size: clamp(0.78rem, 2vw, 1.05rem) !important;
  padding: 2px 12px !important;
  letter-spacing: 1.4px !important;
}
body.is-mobile.is-landscape #screen-char-select .char-stage-wrapper {
  position: absolute !important;
  top: 48px !important;
  left: max(6px, env(safe-area-inset-left)) !important;
  right: auto !important;
  bottom: auto !important;
  width: 41.5vw !important;
  height: calc(100dvh - 154px) !important;
  min-height: 0 !important;
  overflow: hidden !important;
  z-index: 8 !important;
}
body.is-mobile.is-landscape #screen-char-select .char-stage-arrow-btn {
  top: 50% !important;
  width: 32px !important;
  height: 46px !important;
  font-size: 1.5rem !important;
  z-index: 20 !important;
}
body.is-mobile.is-landscape #screen-char-select .char-stage-arrow-btn.prev-btn { left: 2px !important; }
body.is-mobile.is-landscape #screen-char-select .char-stage-arrow-btn.next-btn { right: 2px !important; }
body.is-mobile.is-landscape #screen-char-select .char-stage-line {
  width: 100% !important;
  height: 100% !important;
  align-items: center !important;
}
body.is-mobile.is-landscape #screen-char-select .char-stand {
  top: 0 !important;
  width: clamp(120px, 21vw, 240px) !important;
  height: 100% !important;
  max-height: none !important;
}
body.is-mobile.is-landscape #screen-char-select .char-stand-figure {
  align-items: center !important;
}
body.is-mobile.is-landscape #screen-char-select .char-stand-img {
  object-position: center center !important;
}
body.is-mobile.is-landscape #screen-char-select .char-select-footer {
  display: contents !important;
}
body.is-mobile.is-landscape #screen-char-select .relic-select-section {
  position: absolute !important;
  left: max(8px, env(safe-area-inset-left)) !important;
  bottom: 8px !important;
  width: 41vw !important;
  max-width: 41vw !important;
  padding: 4px 8px !important;
  margin: 0 !important;
  z-index: 16 !important;
}
body.is-mobile.is-landscape #screen-char-select .artifact-carousel-header {
  margin-bottom: 2px !important;
}
body.is-mobile.is-landscape #screen-char-select .artifact-carousel-title {
  font-size: 0.64rem !important;
}
body.is-mobile.is-landscape #screen-char-select .artifact-carousel-hint {
  display: none !important;
}
body.is-mobile.is-landscape #screen-char-select .artifact-3d-wrapper {
  height: 40px !important;
  gap: 6px !important;
}
body.is-mobile.is-landscape #screen-char-select .artifact-nav-btn {
  width: 26px !important;
  height: 32px !important;
  font-size: 1.15rem !important;
}
body.is-mobile.is-landscape #screen-char-select .artifact-carousel-stage {
  width: 100% !important;
  flex: 1 !important;
  height: 40px !important;
}
body.is-mobile.is-landscape #screen-char-select .relic-select-card {
  width: 38px !important;
  height: 38px !important;
  margin: 0 6px !important;
}
body.is-mobile.is-landscape #screen-char-select .relic-select-icon {
  width: 28px !important;
  height: 28px !important;
}
body.is-mobile.is-landscape #screen-char-select #artifact-selected-desc {
  margin-top: 2px !important;
  padding: 2px 4px !important;
  min-height: 26px !important;
  max-height: 34px !important;
  overflow: hidden !important;
}
body.is-mobile.is-landscape #screen-char-select #artifact-selected-desc strong {
  font-size: 0.68rem !important;
}
body.is-mobile.is-landscape #screen-char-select #artifact-selected-desc span,
body.is-mobile.is-landscape #screen-char-select #artifact-selected-desc div {
  font-size: 0.61rem !important;
  line-height: 1.14 !important;
}

/* Coluna Direita: Ficha do Herói + Botões Voltar / Começar */
body.is-mobile.is-landscape #screen-char-select #char-details.char-details-geometric {
  position: absolute !important;
  top: 8px !important;
  left: 43.5vw !important;
  right: max(10px, env(safe-area-inset-right)) !important;
  width: auto !important;
  max-width: none !important;
  height: calc(100dvh - 54px) !important;
  max-height: calc(100dvh - 54px) !important;
  margin: 0 !important;
  padding: 9px 13px !important;
  overflow-y: auto !important;
  z-index: 14 !important;
}
body.is-mobile.is-landscape #screen-char-select .char-cleared-seal {
  top: 6px !important;
  right: 8px !important;
  transform: scale(0.75);
  transform-origin: top right;
}
body.is-mobile.is-landscape #screen-char-select .char-details-topbar {
  padding-bottom: 4px !important;
  margin-bottom: 4px !important;
  padding-right: 40px !important;
  flex-wrap: wrap !important;
  gap: 5px !important;
}
body.is-mobile.is-landscape #screen-char-select .details-hero-name {
  font-size: 1.02rem !important;
}
body.is-mobile.is-landscape #screen-char-select .details-hero-class {
  font-size: 0.62rem !important;
  padding: 1px 6px !important;
}
body.is-mobile.is-landscape #screen-char-select .stat-pill {
  font-size: 0.68rem !important;
  padding: 2px 7px !important;
}
body.is-mobile.is-landscape #screen-char-select .details-hero-lore {
  font-size: 0.72rem !important;
  line-height: 1.28 !important;
  margin-bottom: 5px !important;
}
body.is-mobile.is-landscape #screen-char-select .char-passive-geometric {
  padding: 4px 8px !important;
  margin-bottom: 5px !important;
  gap: 7px !important;
}
body.is-mobile.is-landscape #screen-char-select .passive-hero-name {
  font-size: 0.72rem !important;
}
body.is-mobile.is-landscape #screen-char-select .passive-hero-desc {
  font-size: 0.66rem !important;
  line-height: 1.22 !important;
}
body.is-mobile.is-landscape #screen-char-select .details-deck-row {
  gap: 4px !important;
}
body.is-mobile.is-landscape #screen-char-select .deck-label {
  font-size: 0.64rem !important;
}
body.is-mobile.is-landscape #screen-char-select .preview-card-pill {
  font-size: 0.64rem !important;
  padding: 2px 7px !important;
}
body.is-mobile.is-landscape #screen-char-select #char-select-sparks-pill {
  padding: 2px 10px !important;
  font-size: 0.74rem !important;
}
body.is-mobile.is-landscape #screen-char-select .footer-left-action {
  position: absolute !important;
  left: 43.5vw !important;
  bottom: 8px !important;
  z-index: 20 !important;
}
body.is-mobile.is-landscape #screen-char-select .footer-right-action {
  position: absolute !important;
  right: max(10px, env(safe-area-inset-right)) !important;
  bottom: 8px !important;
  z-index: 20 !important;
}
body.is-mobile.is-landscape #screen-char-select .char-footer-btn {
  width: clamp(135px, 24.5vw, 220px) !important;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 10px !important;
  font-size: 0.76rem !important;
  justify-content: center !important;
  border-radius: 8px !important;
}

/* ==========================================================================
   8. ARENA DE COMBATE ESTILO POKÉMON + HUD REDESENHADO (#screen-battle)
   ========================================================================== */
body.is-mobile.is-landscape #screen-battle:not(.hidden) {
  width: 100vw !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  padding: 28px 0 0 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  align-items: stretch !important;
  overflow: hidden !important;
  position: relative !important;
}

/* Cápsula de Groove ultra-fina no topo central (nunca cobre cabeças dos combatentes) */
body.is-mobile.is-landscape #necrodancer-rhythm-hud:not(.hidden) {
  top: 28px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  padding: 2px 10px !important;
  gap: 6px !important;
  border-radius: 0 0 11px 11px !important;
  border-top: none !important;
  height: 24px !important;
  z-index: 95 !important;
}
body.is-mobile.is-landscape.has-jukebox #necrodancer-rhythm-hud:not(.hidden) {
  top: 54px !important;
}
body.is-mobile.is-landscape #necrodancer-rhythm-hud .necro-track {
  width: 64px !important;
  height: 14px !important;
}
body.is-mobile.is-landscape #necrodancer-rhythm-hud .necro-beat-heart {
  width: 20px !important;
  height: 20px !important;
  font-size: 0.72rem !important;
}
body.is-mobile.is-landscape #necrodancer-rhythm-hud .rhythm-resonance-header {
  gap: 4px !important;
  font-size: 0.62rem !important;
}
body.is-mobile.is-landscape #necrodancer-rhythm-hud .rhythm-icon,
body.is-mobile.is-landscape #necrodancer-rhythm-hud .rhythm-title,
body.is-mobile.is-landscape #necrodancer-rhythm-hud .rhythm-percentage-badge,
body.is-mobile.is-landscape #necrodancer-rhythm-hud .rhythm-bpm-badge {
  font-size: 0.6rem !important;
  padding: 0 3px !important;
}
body.is-mobile.is-landscape #necrodancer-rhythm-hud .rhythm-progress-track {
  height: 3px !important;
  margin-top: 1px !important;
}

body.is-mobile.is-landscape #screen-battle .active-terrain-indicator,
body.is-mobile.is-landscape #battle-terrain-container.active-terrain-indicator {
  top: 56px !important;
  transform: translateX(-50%) scale(0.76);
  transform-origin: top center;
}
body.is-mobile.is-landscape.has-jukebox #screen-battle .active-terrain-indicator,
body.is-mobile.is-landscape.has-jukebox #battle-terrain-container.active-terrain-indicator {
  top: 82px !important;
}
body.is-mobile.is-landscape #ranked-combat-controls {
  top: 32px !important;
  right: max(10px, env(safe-area-inset-right)) !important;
  transform: scale(0.82);
  transform-origin: top right;
}

/* Arena no chão alinhada (Layout Original / Clássico de Combate) */
body.is-mobile.is-landscape .battle-arena {
  width: 100% !important;
  max-width: 100% !important;
  flex: 1 1 0 !important;
  min-height: 0 !important;
  max-height: none !important;
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-between !important;
  align-items: flex-end !important;
  padding: 6px max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left)) !important;
  margin: 0 !important;
  gap: clamp(12px, 3vw, 24px) !important;
  position: relative !important;
  --base-combatant-size: clamp(86px, min(15vw, 28dvh), 140px) !important;
}
body.is-mobile.is-landscape .battle-arena.enemy-count-1,
body.is-mobile.is-landscape .battle-arena:has(.enemies-wrapper.count-1) {
  --base-combatant-size: clamp(92px, min(16vw, 30dvh), 148px) !important;
}
body.is-mobile.is-landscape .battle-arena.enemy-count-2,
body.is-mobile.is-landscape .battle-arena:has(.enemies-wrapper.count-2) {
  --base-combatant-size: clamp(76px, min(12.5vw, 24dvh), 122px) !important;
}
body.is-mobile.is-landscape .battle-arena.enemy-count-3,
body.is-mobile.is-landscape .battle-arena:has(.enemies-wrapper.count-3) {
  --base-combatant-size: clamp(64px, min(10.5vw, 20dvh), 102px) !important;
}
body.is-mobile.is-landscape .battle-arena.enemy-count-4,
body.is-mobile.is-landscape .battle-arena.enemy-count-5,
body.is-mobile.is-landscape .battle-arena:has(.enemies-wrapper.count-4),
body.is-mobile.is-landscape .battle-arena:has(.enemies-wrapper.count-5) {
  --base-combatant-size: clamp(52px, min(8.5vw, 16dvh), 86px) !important;
}

/* Destaque ao arrastar carta de efeito / defesa / AoE */
body.is-mobile.is-landscape .battle-arena.mobile-cast-zone-active::after {
  content: "SOLTE PARA JOGAR";
  position: absolute;
  top: 28%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.25);
  border: 1.5px solid rgba(56, 189, 248, 0.85);
  color: #e0f2fe;
  font-family: var(--font-title);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.45);
  pointer-events: none;
  z-index: 60;
}

/* HERÓI (LADO ESQUERDO APOIADO NO CHÃO DA ARENA) */
body.is-mobile.is-landscape .player-side-container {
  align-self: flex-end !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-end !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  margin-left: clamp(4px, 1.5vw, 16px) !important;
  margin-bottom: 2px !important;
  z-index: 12 !important;
}
body.is-mobile.is-landscape .player-wrapper {
  width: auto !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 4px !important;
  position: relative !important;
}
body.is-mobile.is-landscape .player-wrapper .sprite-container {
  width: clamp(92px, min(15vw, 29dvh), 150px) !important;
  height: clamp(92px, min(15vw, 29dvh), 150px) !important;
  max-height: 31dvh !important;
  flex-shrink: 0 !important;
  position: relative !important;
  z-index: 3 !important;
}
body.is-mobile.is-landscape .player-wrapper::before {
  content: "";
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(100px, min(16vw, 30dvh), 160px);
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(56, 189, 248, 0.3) 0%, rgba(15, 23, 42, 0.78) 62%, transparent 78%);
  border: 1.5px solid rgba(56, 189, 248, 0.36);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.65);
  z-index: 1;
  pointer-events: none;
}

/* Botões do Herói alinhados na borda externa esquerda (não cobrem o rosto/corpo) */
body.is-mobile.is-landscape .player-wrapper .sprite-container .entity-art-zoom-btn {
  top: 4px !important;
  left: -10px !important;
  right: auto !important;
  width: 22px !important;
  height: 22px !important;
  font-size: 0.7rem !important;
  opacity: 0.92 !important;
}
body.is-mobile.is-landscape .player-wrapper .sprite-container #hero-log-btn {
  top: 30px !important;
  left: -10px !important;
  right: auto !important;
  width: 22px !important;
  height: 22px !important;
  font-size: 0.7rem !important;
  opacity: 0.92 !important;
  animation: none !important;
}

/* Aliados invocados compactos ao lado esquerdo do herói */
body.is-mobile.is-landscape .allies-container-arena {
  gap: 6px !important;
}
body.is-mobile.is-landscape .ally-wrapper {
  width: 78px !important;
  min-width: 72px !important;
  gap: 2px !important;
}
body.is-mobile.is-landscape .ally-wrapper .sprite-container {
  width: 68px !important;
  height: 68px !important;
}
body.is-mobile.is-landscape .ally-wrapper .combatant-info {
  width: 82px !important;
  min-width: 72px !important;
  padding: 2px 5px !important;
}

/* INIMIGOS (LADO DIREITO APOIADOS NO CHÃO DA ARENA) */
body.is-mobile.is-landscape .enemies-wrapper {
  align-self: flex-end !important;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  justify-content: flex-end !important;
  align-items: flex-end !important;
  gap: clamp(8px, 1.8vw, 18px) !important;
  margin-top: 0 !important;
  margin-right: clamp(6px, 1.5vw, 18px) !important;
  margin-bottom: 2px !important;
  max-width: 60vw !important;
  z-index: 10 !important;
}

/* Inimigo: Posicionado no solo com barra de vida e intenção limpas */
body.is-mobile.is-landscape .enemies-wrapper .combatant-wrapper {
  width: auto !important;
  min-width: 82px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 4px !important;
  position: relative !important;
}
body.is-mobile.is-landscape .enemies-wrapper.count-1 .sprite-container {
  width: clamp(92px, min(15vw, 29dvh), 146px) !important;
  height: clamp(92px, min(15vw, 29dvh), 146px) !important;
  max-height: 31dvh !important;
  flex-shrink: 0 !important;
  position: relative !important;
  z-index: 3 !important;
}
body.is-mobile.is-landscape .enemies-wrapper:not(.count-1) .sprite-container {
  width: calc(var(--base-combatant-size) * var(--sprite-scale, 1)) !important;
  height: calc(var(--base-combatant-size) * var(--sprite-scale, 1)) !important;
  max-height: 27dvh !important;
  z-index: 3 !important;
}
body.is-mobile.is-landscape .enemies-wrapper .combatant-wrapper::before {
  content: "";
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(248, 113, 113, 0.28) 0%, rgba(15, 23, 42, 0.78) 62%, transparent 78%);
  border: 1.5px solid rgba(248, 113, 113, 0.38);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.6);
  z-index: 1;
  pointer-events: none;
}

/* Botões Lupa e Intenção/Log na borda externa direita do Inimigo (sem tampar o sprite) */
body.is-mobile.is-landscape .enemies-wrapper .sprite-container .entity-art-zoom-btn {
  top: 2px !important;
  right: -10px !important;
  width: 21px !important;
  height: 21px !important;
  font-size: 0.68rem !important;
  opacity: 0.92 !important;
}
body.is-mobile.is-landscape .enemies-wrapper .sprite-container .entity-art-action-btn {
  top: 27px !important;
  right: -10px !important;
  width: 21px !important;
  height: 21px !important;
  font-size: 0.68rem !important;
  opacity: 0.92 !important;
}
body.is-mobile.is-landscape .combatant-header-prestige {
  position: absolute !important;
  top: -22px !important;
  right: 0 !important;
  width: auto !important;
  transform: scale(0.8);
  transform-origin: bottom right;
}

/* PLACAS DE STATUS (COMPACTAS, NO TOPO OU BASE DO COMBATENTE SEM CAIXA VAZIA) */
body.is-mobile.is-landscape .combatant-info {
  background: linear-gradient(155deg, rgba(15, 23, 42, 0.93), rgba(2, 6, 23, 0.96)) !important;
  border: 1px solid rgba(56, 189, 248, 0.45) !important;
  padding: 4px 8px !important;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.7) !important;
  z-index: 6 !important;
  flex-shrink: 0 !important;
}
body.is-mobile.is-landscape .player-wrapper .combatant-info {
  width: clamp(120px, 16vw, 165px) !important;
  max-width: none !important;
  border-left: 4px solid #38bdf8 !important;
  border-radius: 6px !important;
  margin-top: 2px !important;
}
body.is-mobile.is-landscape .enemies-wrapper .combatant-info {
  width: clamp(100px, 14vw, 150px) !important;
  max-width: none !important;
  border-color: rgba(248, 113, 113, 0.48) !important;
  border-right: 4px solid #f43f5e !important;
  border-radius: 6px !important;
  margin-top: 2px !important;
}
body.is-mobile.is-landscape .combatant-info .name-tag {
  font-size: 0.68rem !important;
  height: auto !important;
  line-height: 1.15 !important;
  margin-bottom: 3px !important;
  text-align: left !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  width: 100% !important;
}
body.is-mobile.is-landscape .enemies-wrapper:not(.count-1) .combatant-info .name-tag {
  text-align: center !important;
  font-size: 0.62rem !important;
}
body.is-mobile.is-landscape .hp-bar-container {
  height: 12px !important;
  border-radius: 6px !important;
}
body.is-mobile.is-landscape .hp-text {
  font-size: 0.64rem !important;
  line-height: 12px !important;
}
body.is-mobile.is-landscape .block-value {
  width: 20px !important;
  height: 20px !important;
  left: -10px !important;
  top: -4px !important;
  font-size: 0.66rem !important;
}
body.is-mobile.is-landscape .status-list {
  min-height: 0 !important;
  gap: 3px !important;
  margin-top: 3px !important;
}
body.is-mobile.is-landscape .status-list:empty {
  display: none !important;
}
body.is-mobile.is-landscape .status-icon,
body.is-mobile.is-landscape .status-badge {
  font-size: 0.6rem !important;
  padding: 1px 4px !important;
}
body.is-mobile.is-landscape .combatant-wrapper.targeted-enemy-aura .sprite-container {
  filter: drop-shadow(0 0 14px rgba(56, 189, 248, 0.95)) drop-shadow(0 0 6px #fde047) !important;
}
body.is-mobile.is-landscape .combat-log-container.hero-log-popup:not(.hidden) {
  display: flex !important;
  position: absolute !important;
  left: 0 !important;
  top: auto !important;
  bottom: calc(100% + 6px) !important;
  transform: none !important;
  width: min(300px, 68vw) !important;
  height: auto !important;
  min-height: 76px !important;
  max-height: 155px !important;
  z-index: 520 !important;
}
body.is-mobile.is-landscape .combat-log-container.enemy-log-popup:not(.hidden) {
  display: flex !important;
  position: absolute !important;
  right: 0 !important;
  left: auto !important;
  top: calc(100% + 4px) !important;
  transform: none !important;
  width: min(300px, 68vw) !important;
  height: auto !important;
  min-height: 76px !important;
  max-height: 155px !important;
  z-index: 520 !important;
}
body.is-mobile.is-landscape .enemy-intent-popup {
  top: calc(100% + 4px) !important;
  right: 0 !important;
  left: auto !important;
  transform: none !important;
  width: 230px !important;
  max-width: 60vw !important;
  padding: 8px 10px !important;
  z-index: 520 !important;
}

/* ==========================================================================
   9. CONTROLES ANCORADOS NOS CANTOS + MÃO DE CARTAS COMPLETA NA BASE
   ========================================================================== */
body.is-mobile.is-landscape #screen-battle {
  --card-w: 76px;
  --card-h: 100px;
  --card-overlap: -6px;
}
body.is-mobile.is-landscape .battle-controls-container {
  position: relative !important;
  width: 100% !important;
  height: 108px !important;
  min-height: 108px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-end !important;
  align-items: center !important;
  padding: 0 !important;
  margin: 0 !important;
  gap: 0 !important;
  background: linear-gradient(180deg, transparent 0%, rgba(3, 7, 18, 0.68) 45%, rgba(2, 6, 23, 0.92) 100%) !important;
  overflow: visible !important;
  z-index: 25 !important;
}
body.is-mobile.is-landscape .battle-stats-row {
  position: absolute !important;
  inset: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: none !important;
  z-index: 40 !important;
}
body.is-mobile.is-landscape .battle-stats-row .energy-orb-container {
  position: absolute !important;
  left: max(8px, env(safe-area-inset-left)) !important;
  bottom: 52px !important;
  pointer-events: auto !important;
  gap: 5px !important;
}
body.is-mobile.is-landscape .energy-orb {
  width: 34px !important;
  height: 34px !important;
  font-size: 0.9rem !important;
}
body.is-mobile.is-landscape .energy-label,
body.is-mobile.is-landscape .stars-label {
  font-size: 0.52rem !important;
  letter-spacing: 0.5px !important;
}
body.is-mobile.is-landscape .battle-stats-row #deck-draw-pile {
  position: absolute !important;
  left: max(8px, env(safe-area-inset-left)) !important;
  bottom: 8px !important;
  pointer-events: auto !important;
}
body.is-mobile.is-landscape .battle-stats-row #stars-orb-container:not(.hidden) {
  position: absolute !important;
  left: calc(max(8px, env(safe-area-inset-left)) + 48px) !important;
  bottom: 8px !important;
  margin-left: 0 !important;
  pointer-events: auto !important;
}
body.is-mobile.is-landscape .stars-orb {
  width: 28px !important;
  height: 28px !important;
  font-size: 0.78rem !important;
}
body.is-mobile.is-landscape .battle-stats-row #deck-discard-pile {
  position: absolute !important;
  right: max(10px, env(safe-area-inset-right)) !important;
  bottom: 52px !important;
  pointer-events: auto !important;
}
body.is-mobile.is-landscape .battle-stats-row #btn-end-turn {
  position: absolute !important;
  right: max(10px, env(safe-area-inset-right)) !important;
  bottom: 8px !important;
  pointer-events: auto !important;
  min-width: 98px !important;
  height: 36px !important;
  padding: 0 10px !important;
  font-size: 0.74rem !important;
  font-weight: 800 !important;
  border-radius: 10px !important;
  white-space: nowrap !important;
}
body.is-mobile.is-landscape .card-pile {
  width: 42px !important;
  height: 34px !important;
  padding: 2px 4px !important;
  flex-direction: row !important;
  gap: 3px !important;
  border-radius: 9px !important;
}
body.is-mobile.is-landscape .pile-icon-img {
  width: 22px !important;
  height: 22px !important;
}
body.is-mobile.is-landscape .pile-count {
  font-size: 0.68rem !important;
  top: -5px !important;
  right: -5px !important;
  padding: 1px 5px !important;
}

/* Mão de cartas centralizada entre os docks laterais — altura extra superior evita corte de seleção/custo mesmo com scroll X */
body.is-mobile.is-landscape .hand-container {
  width: calc(100vw - 236px) !important;
  max-width: calc(100vw - 236px) !important;
  height: 136px !important;
  margin: -28px auto 0 auto !important;
  padding: 28px 8px 6px 8px !important;
  box-sizing: border-box !important;
  display: flex !important;
  justify-content: safe center !important;
  align-items: flex-end !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scrollbar-width: none;
}
body.is-mobile.is-landscape .hand-container::-webkit-scrollbar {
  display: none;
}
body.is-mobile.is-landscape .hand-container .card {
  width: var(--card-w) !important;
  height: var(--card-h) !important;
  padding: 4px 5px !important;
  border-radius: 8px !important;
  flex-shrink: 0 !important;
  margin: 0 var(--card-overlap) !important;
}
body.is-mobile.is-landscape .hand-container .card.selected {
  transform: translateY(-14px) scale(1.08) translateZ(0) !important;
  border-color: #fbbf24 !important;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.85), 0 0 16px rgba(251, 191, 36, 0.55) !important;
  z-index: 65 !important;
}
body.is-mobile.is-landscape .hand-container .card .card-name {
  font-size: 0.51rem !important;
  line-height: 1.04 !important;
  margin-top: 1px !important;
}
body.is-mobile.is-landscape .hand-container .card .card-art {
  height: 30px !important;
  min-height: 26px !important;
  max-height: 32px !important;
  margin: 2px 0 !important;
  border-radius: 4px !important;
}
body.is-mobile.is-landscape .hand-container .card .card-desc {
  font-size: 0.46rem !important;
  line-height: 1.06 !important;
  padding: 0 1px !important;
}
body.is-mobile.is-landscape .hand-container .card .card-cost,
body.is-mobile.is-landscape .hand-container .card .card-star-cost {
  width: 18px !important;
  height: 18px !important;
  font-size: 0.62rem !important;
  top: -5px !important;
  right: -5px !important;
}
body.is-mobile.is-landscape .hand-container .card .card-type-label {
  font-size: 0.4rem !important;
  padding: 2px 2px 0 2px !important;
  margin-top: 1px !important;
  letter-spacing: 0.3px !important;
}

/* Oculta lupas de cartas na mão enquanto não selecionadas para nunca cobrir a ilustração */
body.is-mobile .hand-container .card:not(.selected) .card-art-actions {
  opacity: 0 !important;
  pointer-events: none !important;
}
body.is-mobile .hand-container .card.selected .card-art-actions {
  opacity: 1 !important;
  pointer-events: auto !important;
  top: 2px !important;
  left: 2px !important;
  gap: 2px !important;
}
body.is-mobile .hand-container .card.selected .card-art-zoom-btn,
body.is-mobile .hand-container .card.selected .card-desc-zoom-btn {
  width: 20px !important;
  height: 20px !important;
  font-size: 0.62rem !important;
  opacity: 0.95 !important;
}

/* ==========================================================================
   10. RHYTHM CLIMAX COM TOUCH PAD ATIVO E PISTA ESCALADA PARA LANDSCAPE BAIXA
   ========================================================================== */
@media (pointer: coarse) {
  .rhythm-mobile-touch-pad {
    display: flex !important;
    gap: 12px;
    justify-content: center;
    margin-top: 6px;
    z-index: 20;
  }
}
body.is-mobile .rhythm-mobile-touch-pad {
  display: flex !important;
  gap: 12px;
  justify-content: center;
  margin-top: 6px;
  z-index: 20;
}
body.is-mobile .rhythm-touch-btn {
  min-width: 58px;
  min-height: 46px;
  border-radius: 12px;
  border: 1.5px solid rgba(56, 189, 248, 0.65);
  background: rgba(15, 23, 42, 0.9);
  color: #f8fafc;
  font-size: 1.35rem;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7);
}
body.is-mobile .rhythm-touch-btn:active {
  transform: scale(0.92);
  background: rgba(56, 189, 248, 0.35);
}

@media screen and (max-height: 540px) and (orientation: landscape) {
  .rhythm-climax-modal {
    padding: 8px 14px !important;
    max-height: 96dvh !important;
  }
  .rhythm-climax-title {
    font-size: 1.05rem !important;
  }
  .rhythm-climax-desc {
    font-size: 0.72rem !important;
    margin-top: 2px !important;
  }
  .rhythm-lane-container {
    height: 142px !important;
    margin: 4px 0 !important;
  }
  .rhythm-touch-btn {
    min-width: 54px !important;
    min-height: 40px !important;
    font-size: 1.2rem !important;
  }
}

/* ==========================================================================
   11. INTROS, FINAIS (#screen-ending) & EVENTOS (#screen-event) EM LANDSCAPE
   ========================================================================== */
body.is-mobile.is-landscape #screen-ending:not(.hidden) {
  height: 100dvh !important;
  width: 100vw !important;
}
body.is-mobile.is-landscape #screen-ending .ending-content {
  padding: 10px max(14px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)) !important;
}
body.is-mobile.is-landscape #btn-skip-story {
  padding: 6px 14px !important;
  font-size: 0.76rem !important;
}
body.is-mobile.is-landscape #ending-char-left,
body.is-mobile.is-landscape #ending-char-center,
body.is-mobile.is-landscape #ending-char-right {
  bottom: 24dvh !important;
  height: 70dvh !important;
}
body.is-mobile.is-landscape #ending-dialog-box {
  width: 94% !important;
  min-height: 76px !important;
  max-height: 33dvh !important;
  padding: 10px 16px !important;
  overflow-y: auto !important;
}
body.is-mobile.is-landscape #ending-dialog-title {
  font-size: 1rem !important;
  margin-bottom: 4px !important;
}
body.is-mobile.is-landscape #ending-dialog-text {
  font-size: 0.88rem !important;
  line-height: 1.42 !important;
}
body.is-mobile.is-landscape #ending-prompt-next {
  font-size: 0.74rem !important;
  margin-top: 4px !important;
}

/* Eventos: personagem à esquerda, diálogo compacto e legível à direita */
body.is-mobile.is-landscape #screen-event:not(.hidden) .event-content {
  padding: 34px max(12px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)) !important;
  justify-content: center !important;
}
body.is-mobile.is-landscape #event-character-container {
  width: 34% !important;
  max-width: 280px !important;
  height: 76dvh !important;
  left: 2% !important;
  bottom: 0 !important;
}
body.is-mobile.is-landscape #screen-event:not(.hidden) .event-dialog-box {
  width: 60% !important;
  max-width: 560px !important;
  margin-left: auto !important;
  margin-right: 1.5vw !important;
  min-height: auto !important;
  max-height: 78dvh !important;
  overflow-y: auto !important;
  padding: 12px 16px !important;
}
body.is-mobile.is-landscape #event-title {
  font-size: 1.05rem !important;
  margin-bottom: 6px !important;
}
body.is-mobile.is-landscape #event-text {
  font-size: 0.86rem !important;
  line-height: 1.42 !important;
  margin-bottom: 10px !important;
}
body.is-mobile.is-landscape #event-choices {
  gap: 6px !important;
}
body.is-mobile.is-landscape #event-choices .btn {
  padding: 8px 12px !important;
  font-size: 0.8rem !important;
}

/* ==========================================================================
   12. DEMAIS TELAS E MODAIS EM MOBILE LANDSCAPE
   ========================================================================== */
body.is-mobile.is-landscape #screen-map:not(.hidden) {
  padding: 34px 10px 8px 10px !important;
}
body.is-mobile.is-landscape .map-wrapper {
  max-height: calc(100dvh - 42px) !important;
  padding: 8px 12px !important;
}
body.is-mobile.is-landscape .map-header-container {
  margin-bottom: 2px !important;
  flex-shrink: 0 !important;
}
body.is-mobile.is-landscape .map-act-badge {
  font-size: 0.78rem !important;
  padding: 3px 12px !important;
}
body.is-mobile.is-landscape .map-act-title {
  font-size: 0.8rem !important;
  line-height: 1.25 !important;
  max-width: 90vw !important;
  margin: 3px auto 1px auto !important;
}
body.is-mobile.is-landscape .map-hint {
  font-size: 0.68rem !important;
  margin-top: 1px !important;
  margin-bottom: 3px !important;
}
body.is-mobile.is-landscape .map-scroll-container {
  overflow-y: auto !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-x pan-y !important;
  padding: 10px 14px !important;
}
body.is-mobile.is-landscape .map-grid {
  min-height: 280px !important;
  padding: 15px 40px !important;
  align-items: center !important;
}

body.is-mobile.is-landscape #screen-shop:not(.hidden),
body.is-mobile.is-landscape #screen-rest:not(.hidden),
body.is-mobile.is-landscape #screen-rewards:not(.hidden),
body.is-mobile.is-landscape #screen-global-rewards:not(.hidden),
body.is-mobile.is-landscape #screen-history-rank:not(.hidden),
body.is-mobile.is-landscape #screen-game-over:not(.hidden),
body.is-mobile.is-landscape #screen-ranked:not(.hidden) {
  padding-top: 34px !important;
  padding-bottom: 12px !important;
  overflow-y: auto !important;
}
body.is-mobile.is-landscape .rest-container {
  margin: 8px auto !important;
  padding: 14px 18px !important;
  max-width: min(640px, 92vw) !important;
}
body.is-mobile.is-landscape #rest-title {
  font-size: 1.2rem !important;
  margin: 4px 0 6px 0 !important;
}
body.is-mobile.is-landscape #rest-desc {
  font-size: 0.86rem !important;
  margin: 6px 0 12px 0 !important;
}
body.is-mobile.is-landscape .rewards-container,
body.is-mobile.is-landscape .global-rewards-container {
  padding: 14px !important;
  max-width: 94vw !important;
  margin: 4px auto !important;
}

/* Modais adaptados para altura baixa em Paisagem */
body.is-mobile.is-landscape .modal-content,
body.is-mobile.is-landscape .modal-card,
body.is-mobile.is-landscape .ranked-modal-card,
body.is-mobile.is-landscape .card-inspector-dialog {
  max-height: 92dvh !important;
  overflow-y: auto !important;
}

/* ==========================================================================
   13. ESTILOS DO SISTEMA DE NÍVEL DE PODER, AFINIDADE E MODAL DE PROGRESSÃO
   ========================================================================== */
.stat-pill.power-level-pill {
  cursor: pointer;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  font-family: inherit;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.stat-pill.power-level-pill:hover,
.stat-pill.power-level-pill.has-power-active {
  background: rgba(245, 158, 11, 0.22);
  border-color: #fbbf24;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
}

.artifact-header-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.artifact-slot-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(15, 23, 42, 0.8);
  padding: 2px 4px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.artifact-slot-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.artifact-slot-btn:hover {
  color: #f1f5f9;
}

.artifact-slot-btn.active {
  background: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.3);
}

.relic-select-card.selected-other-slot {
  border-color: rgba(56, 189, 248, 0.6) !important;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.4) !important;
}

/* Modal de Progressão do Herói */
.hero-progression-modal-card {
  max-width: 680px;
  width: 92vw;
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  padding: 22px 26px;
  border: 1.5px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 0 35px rgba(0, 0, 0, 0.8), 0 0 15px rgba(245, 158, 11, 0.15);
}

.hero-prog-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
}

.hero-prog-modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: #fbbf24;
}

.hero-prog-modal-sub {
  margin: 4px 0 0 0;
  font-size: 0.82rem;
  color: #94a3b8;
}

.hero-prog-modal-body {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-right: 4px;
}

.hero-prog-inheritance-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 10px;
  padding: 10px 14px;
}

.hero-prog-inheritance-banner.empty {
  background: rgba(148, 163, 184, 0.06);
  border: 1px dashed rgba(148, 163, 184, 0.25);
}

.hero-prog-inheritance-banner .inh-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.hero-prog-inheritance-banner .inh-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.84rem;
  color: #cbd5e1;
}

.hero-prog-inheritance-banner .inh-info strong {
  color: #38bdf8;
  font-size: 0.9rem;
}

.hero-prog-inheritance-banner.empty .inh-info strong {
  color: #94a3b8;
}

.hero-prog-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero-prog-section-title {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: 0.5px;
}

.hero-prog-section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.hero-prog-xp-text {
  font-size: 0.78rem;
  color: #f59e0b;
  font-weight: 600;
}

.hero-prog-xp-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(15, 23, 42, 0.8);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-prog-xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
  transition: width 0.3s ease;
}

.hero-prog-tiers-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero-prog-tier-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 14px;
  transition: border-color 0.2s ease;
}

.hero-prog-tier-item.unlocked {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.08);
}

.hero-prog-tier-item.locked {
  opacity: 0.55;
}

.hero-prog-tier-item .tier-badge {
  font-family: var(--font-title);
  font-size: 0.85rem;
  font-weight: 800;
  color: #fbbf24;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.3);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-prog-tier-item.locked .tier-badge {
  color: #64748b;
}

.hero-prog-tier-item .tier-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.hero-prog-tier-item .tier-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hero-prog-tier-item .tier-status-tag {
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

.hero-prog-tier-item.unlocked .tier-status-tag {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.hero-prog-tier-item .tier-desc {
  font-size: 0.78rem;
  color: #cbd5e1;
  line-height: 1.35;
}

.affinity-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 6px;
}

.affinity-step-pill {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 0.74rem;
}

.affinity-step-pill.unlocked {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.08);
}

.affinity-step-pill.locked {
  opacity: 0.5;
}

.affinity-step-pill .aff-lvl {
  font-weight: 800;
  color: #38bdf8;
  font-size: 0.72rem;
}

.affinity-step-pill.locked .aff-lvl {
  color: #64748b;
}

.affinity-step-pill .aff-desc {
  color: #cbd5e1;
  font-size: 0.7rem;
  line-height: 1.25;
}

/* Mobile Landscape adjustments */
body.is-mobile.is-landscape .hero-progression-modal-card {
  max-width: min(620px, 94vw) !important;
  max-height: 94dvh !important;
  padding: 12px 18px !important;
}

body.is-mobile.is-landscape .hero-prog-modal-header h3 {
  font-size: 1.05rem !important;
}

body.is-mobile.is-landscape .hero-prog-modal-sub {
  font-size: 0.72rem !important;
}

body.is-mobile.is-landscape .hero-prog-tier-item {
  padding: 6px 10px !important;
}

body.is-mobile.is-landscape .hero-prog-tier-item .tier-badge {
  font-size: 0.74rem !important;
  padding: 2px 6px !important;
}

body.is-mobile.is-landscape .hero-prog-tier-item .tier-title {
  font-size: 0.8rem !important;
}

body.is-mobile.is-landscape .hero-prog-tier-item .tier-desc {
  font-size: 0.72rem !important;
}



