@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Cinzel:wght@700;900&display=swap');

:root {
  --font-display: 'Cinzel', 'Orbitron', serif;
  --font-tech: 'Orbitron', -apple-system, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, sans-serif;

  --bg-dark: #07090e;
  --bg-card: rgba(13, 19, 33, 0.9);
  --bg-card-hover: rgba(22, 33, 56, 0.95);
  --border-glow: rgba(59, 130, 246, 0.35);

  --gold: #fbbf24;
  --gold-glow: rgba(251, 191, 36, 0.5);
  --primary: #3b82f6;
  --primary-glow: rgba(59, 130, 246, 0.5);
  --cyan: #06b6d4;
  --violet: #8b5cf6;
  --emerald: #10b981;
  --crimson: #ef4444;

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

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

html, body {
  width: 100%;
  height: 100%;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  position: fixed;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  background-image:
    radial-gradient(circle at 50% 20%, rgba(30, 58, 138, 0.3), transparent 65%),
    linear-gradient(to bottom, rgba(7, 9, 14, 0.82), rgba(7, 9, 14, 0.96)),
    url('deserto.jpg');
  background-size: cover;
  background-position: center;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* Partículas de Poeira Estelar do Deserto */
.sandstorm-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.sand-particle {
  position: absolute;
  background: rgba(251, 191, 36, 0.3);
  border-radius: 50%;
  pointer-events: none;
  animation: sandFly 12s linear infinite;
}

@keyframes sandFly {
  0% { transform: translate(-10vw, 110vh) scale(0.6); opacity: 0; }
  15% { opacity: 0.8; }
  85% { opacity: 0.8; }
  100% { transform: translate(110vw, -10vh) scale(1.2); opacity: 0; }
}

/* Container Principal - Ocupa uma parte muito maior da tela sem rolagem */
.rpg-app {
  width: 100%;
  max-width: 1440px;
  width: min(96vw, 1440px);
  height: 100%;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 10;
  padding: 8px 16px;
  justify-content: space-between;
  overflow: hidden;
}

/* Barra de Navegação Compacta e Elegante */
.game-nav {
  height: 52px;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(13, 19, 33, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 0 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  font-size: 28px;
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.6));
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 900;
  letter-spacing: 1.2px;
  background: linear-gradient(135deg, #fde047, #f59e0b, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-btn {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  border-radius: 12px;
  padding: 7px 14px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.nav-btn span:first-child {
  font-size: 1.15rem;
}

.nav-btn:hover {
  background: rgba(59, 130, 246, 0.3);
  border-color: rgba(59, 130, 246, 0.6);
}

.nav-btn-highlight {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(217, 119, 6, 0.4));
  border-color: #fbbf24;
  color: #fef3c7;
}

/* Telas do Jogo */
.screen-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  margin: 6px 0;
}

.hidden {
  display: none !important;
}

/* ========================================================
   TELA INICIAL: SELEÇÃO COM FOTOS REAIS DE VITOR
   ======================================================== */
.hero-intro-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-glow);
  border-radius: 20px;
  padding: 14px 22px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  overflow: hidden; /* A tela não rola; apenas a parte das classes */
  min-height: 0;
}

.intro-header-block {
  text-align: center;
  margin-bottom: 6px;
  flex-shrink: 0;
}

.intro-badge {
  display: inline-block;
  background: rgba(251, 191, 36, 0.18);
  color: #fde047;
  border: 1px solid rgba(251, 191, 36, 0.4);
  padding: 4px 14px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.game-main-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.6vw, 2.25rem);
  font-weight: 900;
  letter-spacing: 1.5px;
  color: #fff;
  text-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
}

.game-main-title span {
  background: linear-gradient(135deg, #fbbf24, #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.game-subtitle {
  color: var(--text-muted);
  font-size: 0.92rem;
  max-width: 740px;
  margin: 2px auto 0;
  line-height: 1.35;
}

/* Container de Seleção: Grade 2-colunas com rolagem + Painel Lateral */
.class-selection-container {
  display: flex;
  gap: 18px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
  margin: 6px 0 8px;
  overflow: hidden;
}

.class-scroll-wrapper {
  flex: 1.3;
  min-width: 0;
  height: 100%;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
}

.class-scroll-wrapper::-webkit-scrollbar {
  width: 7px;
}
.class-scroll-wrapper::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 4px;
}
.class-scroll-wrapper::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #f59e0b, #d97706);
  border-radius: 4px;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}

/* Grid de Classes - ESTRITAMENTE 2 UMA DO LADO DA OUTRA */
.class-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.class-card {
  background: rgba(15, 23, 42, 0.75);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
}

.class-card:hover {
  border-color: var(--gold);
  background: rgba(30, 41, 59, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.class-card.selected {
  border-color: var(--gold);
  background: rgba(245, 158, 11, 0.2);
  box-shadow: 0 0 22px rgba(245, 158, 11, 0.35);
}

.class-card.selected::after {
  content: '✓ ATIVO';
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 0.7rem;
  font-weight: 900;
  color: #000;
  background: var(--gold);
  padding: 3px 9px;
  border-radius: 9999px;
  letter-spacing: 0.5px;
}

/* Foto Redonda/Arredondada de Vitor MAIOR */
.class-photo-wrapper {
  width: 86px;
  height: 86px;
  min-width: 86px;
  border-radius: 18px;
  overflow: hidden;
  border: 2.5px solid rgba(255, 255, 255, 0.25);
  position: relative;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.class-card.selected .class-photo-wrapper {
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.6);
}

.class-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.class-info-block {
  flex: 1;
  min-width: 0;
}

.class-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 900;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.5px;
}

.class-role {
  font-size: 0.82rem;
  color: var(--gold);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.class-tag-preview {
  display: inline-block;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  padding: 3px 8px;
  font-size: 0.76rem;
  color: #cbd5e1;
  margin-top: 5px;
}

/* PAINEL LATERAL: PONTOS FORTES, FRAQUEZAS E DETALHES */
.class-details-panel {
  flex: 0.95;
  min-width: 320px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 18px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.5);
  height: 100%;
  max-height: 100%;
}

.class-details-panel::-webkit-scrollbar {
  width: 6px;
}
.class-details-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
}

.detail-header-card {
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
  flex-shrink: 0;
}

.detail-avatar-thumb {
  width: 70px;
  height: 70px;
  border-radius: 16px;
  overflow: hidden;
  border: 2.5px solid var(--gold);
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.4);
  flex-shrink: 0;
}
.detail-avatar-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-title-h3 {
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.5px;
}

.detail-subtitle-p {
  font-size: 0.82rem;
  color: var(--gold);
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 2px;
}

/* Seção de Pontos Fortes e Fraquezas */
.detail-section-title {
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.detail-section-title span:first-child {
  font-size: 1.1rem;
}

.detail-strengths-title {
  color: #34d399;
}

.detail-weaknesses-title {
  color: #f87171;
}

.detail-trait-list {
  list-style: none;
  padding: 0;
  margin: 0 0 8px 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.detail-trait-item {
  font-size: 0.8rem;
  line-height: 1.4;
  padding: 5px 10px;
  border-radius: 8px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.detail-trait-item span:first-child {
  font-size: 1.05rem;
  flex-shrink: 0;
}

.detail-strength-item {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #d1fae5;
}

.detail-weakness-item {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fee2e2;
}

/* Mini barras de Atributos */
.detail-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  background: rgba(30, 41, 59, 0.5);
  padding: 9px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.detail-stat-box {
  display: flex;
  flex-direction: column;
}

.detail-stat-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
}

.detail-stat-val {
  font-family: var(--font-tech);
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
}

.input-error-shake {
  animation: inputShake 0.4s ease;
  border-color: #ef4444 !important;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.6) !important;
}
@keyframes inputShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* Rodapé da Criação */
.hero-input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
  flex-shrink: 0;
}

.hero-input-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-input {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 9px 16px;
  border-radius: 12px;
  font-size: 0.98rem;
  font-weight: 600;
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.96rem;
  border: none;
  padding: 11px 26px;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-primary span:first-child {
  font-size: 1.15rem;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
}

.btn-secondary {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-secondary span:first-child {
  font-size: 1.1rem;
}

/* ========================================================
   TELA DA BATALHA: FIT 100% NA TELA SEM ROLAGEM
   ======================================================== */
.battle-screen-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 0;
  gap: 8px;
  overflow: hidden;
}

/* HUD Superior Compacto e Amplo */
.battle-hud-compact {
  height: 54px;
  min-height: 54px;
  background: rgba(13, 19, 33, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 4px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.hud-player-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hud-photo-thumb {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 12px;
  border: 2.5px solid var(--gold);
  overflow: hidden;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
}

.hud-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hud-name-and-lvl {
  display: flex;
  flex-direction: column;
}

.hud-player-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
}

.hud-player-sub {
  font-size: 0.76rem;
  color: var(--gold);
  font-weight: 700;
}

/* Barras Compactas */
.hud-bars-wrap {
  flex: 1;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

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

.hud-bar-tag {
  font-family: var(--font-tech);
  font-size: 0.74rem;
  font-weight: 800;
  width: 28px;
}

.hud-meter-track {
  flex: 1;
  height: 13px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 7px;
  overflow: hidden;
  position: relative;
}

.hud-meter-fill {
  height: 100%;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hp-fill { background: linear-gradient(90deg, #ef4444, #10b981); }
.mp-fill { background: linear-gradient(90deg, #06b6d4, #8b5cf6); }

.hud-meter-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.7rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 2px #000;
}

.hud-gold-zone {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.hud-gold-val {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fde047;
}

.hud-zone-val {
  font-size: 0.78rem;
  color: #93c5fd;
  font-weight: 600;
}

/* ========================================================
   ARENA DE COMBATE: CENÁRIO E ANIMAÇÕES ESPECIAIS
   ======================================================== */
.arena-stage {
  flex: 1;
  min-height: 0;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glow);
  border-radius: 22px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px 20px 14px;
}

/* Título de Zona */
.arena-top-zone {
  text-align: center;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.zone-title-text {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: #fde047;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.zone-wave-text {
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* Ticker de Log de Batalha Rápido */
.combat-ticker {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 5px 14px;
  font-size: 0.86rem;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #cbd5e1;
  position: relative;
  z-index: 2;
  margin: 4px 0;
  flex-shrink: 0;
}

/* Palco Central dos Lutadores */
.fighters-arena-row {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 40px;
  position: relative;
  min-height: 135px;
}

.fighter-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  width: 165px;
}

/* Avatar do Jogador (Com a foto recortada de Vitor) */
.player-photo-hero-box {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3.5px solid var(--gold);
  overflow: hidden;
  box-shadow: 0 0 22px rgba(251, 191, 36, 0.6);
  position: relative;
  animation: floatHero 3s ease-in-out infinite;
  background: #000;
}

.player-photo-hero-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes floatHero {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

/* Sprite do Inimigo */
.enemy-sprite-hero-box {
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4.6rem;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.6));
  animation: floatEnemy 2.8s ease-in-out infinite;
}

@keyframes floatEnemy {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(3deg); }
}

.fighter-shadow {
  width: 88px;
  height: 14px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  filter: blur(4px);
  margin-top: 4px;
}

.fighter-name-tag {
  font-family: var(--font-display);
  font-size: 0.94rem;
  font-weight: 800;
  color: #fff;
  margin-top: 5px;
  text-align: center;
  white-space: nowrap;
}

.fighter-hp-mini-track {
  width: 100%;
  height: 9px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  overflow: hidden;
  margin-top: 4px;
}

.fighter-hp-mini-fill {
  height: 100%;
  background: linear-gradient(90deg, #ef4444, #10b981);
  transition: width 0.3s ease;
}

/* ========================================================
   ANIMAÇÕES ÚNICAS PARA CADA CLASSE
   ======================================================== */
/* Guardião: Escudo de Luz Dourada */
.anim-guardian-shield {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 4px solid #fbbf24;
  box-shadow: 0 0 30px #f59e0b, inset 0 0 20px #fde047;
  animation: holyShieldAnim 0.7s ease-out forwards;
  pointer-events: none;
}
@keyframes holyShieldAnim {
  0% { transform: scale(0.5); opacity: 0; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); opacity: 0; }
}

/* Xamã: Vórtice Elemental Cósmico */
.anim-shaman-vortex {
  position: absolute;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px dashed #38bdf8;
  box-shadow: 0 0 35px #8b5cf6, inset 0 0 25px #06b6d4;
  animation: vortexSpin 0.8s linear forwards;
  pointer-events: none;
}
@keyframes vortexSpin {
  0% { transform: rotate(0deg) scale(0.3); opacity: 1; }
  100% { transform: rotate(360deg) scale(1.5); opacity: 0; }
}

/* Caçador: Projétil de Flecha de Cristal */
.anim-hunter-arrow {
  position: absolute;
  width: 45px;
  height: 6px;
  background: linear-gradient(90deg, transparent, #38bdf8, #fff);
  box-shadow: 0 0 15px #06b6d4;
  border-radius: 3px;
  animation: arrowFly 0.4s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
  pointer-events: none;
}
@keyframes arrowFly {
  0% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(180px); opacity: 0; }
}

/* Necromante: Dreno de Almas */
.anim-necro-drain {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.7), transparent 70%);
  filter: blur(4px);
  animation: soulDrainAnim 0.7s ease-in forwards;
  pointer-events: none;
}
@keyframes soulDrainAnim {
  0% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.2); opacity: 0; }
}

/* Mecânico: Explosão de Vapor e Engrenagens */
.anim-mech-steam {
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.8), rgba(239, 68, 68, 0.4), transparent 70%);
  animation: steamBurst 0.6s ease-out forwards;
  pointer-events: none;
}
@keyframes steamBurst {
  0% { transform: scale(0.4); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* Infiltrador: Corte de Sombra Cruzado */
.anim-ninja-slash {
  position: absolute;
  width: 110px;
  height: 4px;
  background: #f43f5e;
  box-shadow: 0 0 20px #e11d48, 0 0 35px #991b1b;
  transform: rotate(-35deg);
  animation: slashCross 0.35s ease-out forwards;
  pointer-events: none;
}
@keyframes slashCross {
  0% { transform: rotate(-35deg) scaleX(0.1); opacity: 1; }
  50% { transform: rotate(-35deg) scaleX(1.3); opacity: 1; }
  100% { transform: rotate(-35deg) scaleX(1); opacity: 0; }
}

/* Pirata: Salva de Pólvora e Centelha de Sabre */
.anim-pirate-shot {
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, #fbbf24 10%, #ea580c 50%, transparent 75%);
  box-shadow: 0 0 30px #f59e0b, 0 0 50px #ef4444;
  animation: pirateShotAnim 0.5s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
  pointer-events: none;
}
@keyframes pirateShotAnim {
  0% { transform: scale(0.3) rotate(0deg); opacity: 1; filter: brightness(2); }
  50% { transform: scale(1.4) rotate(45deg); opacity: 0.9; }
  100% { transform: scale(1.8) rotate(90deg); opacity: 0; }
}

/* Monge: Pulso Sagrado de Chi Concentrado */
.anim-monk-chi {
  position: absolute;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px solid #fef08a;
  box-shadow: 0 0 35px #eab308, inset 0 0 25px #ca8a04;
  animation: monkChiPulse 0.65s ease-out forwards;
  pointer-events: none;
}
@keyframes monkChiPulse {
  0% { transform: scale(0.2); opacity: 1; }
  60% { transform: scale(1.3); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* ========================================================
   ANIMAÇÕES ÚNICAS DOS INIMIGOS
   ======================================================== */
.anim-enemy-slam {
  animation: enemySlam 0.4s ease-in-out;
}
@keyframes enemySlam {
  0% { transform: translateY(0); }
  40% { transform: translateY(-20px) scale(1.2); }
  60% { transform: translateY(10px) scale(0.9); }
  100% { transform: translateY(0); }
}

.anim-enemy-fire {
  box-shadow: 0 0 40px #f97316, 0 0 70px #ef4444 !important;
}

/* Barreira de Defesa Sagrada */
.anim-defense-barrier {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 4px solid #38bdf8;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.25), transparent 70%);
  box-shadow: 0 0 30px #06b6d4, inset 0 0 20px #38bdf8;
  animation: defensePulse 0.6s infinite alternate;
  pointer-events: none;
  z-index: 10;
}

@keyframes defensePulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  100% { transform: scale(1.15); opacity: 1; filter: drop-shadow(0 0 15px #38bdf8); }
}

/* Partículas e Orbes de Cura */
.anim-heal-sparkles {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  pointer-events: none;
  z-index: 15;
  animation: healFloatUp 0.9s ease-out forwards;
}

.anim-heal-sparkles span {
  font-size: 1.4rem;
  filter: drop-shadow(0 0 8px #10b981);
}

@keyframes healFloatUp {
  0% { opacity: 0; transform: translateY(15px) scale(0.5); }
  40% { opacity: 1; transform: translateY(-10px) scale(1.2); }
  100% { opacity: 0; transform: translateY(-35px) scale(0.8); }
}

/* Efeitos de Dano & Flutuantes */
.floating-text {
  position: absolute;
  font-family: var(--font-display);
  font-weight: 900;
  pointer-events: none;
  z-index: 100;
  animation: floatDamage 1s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

.floating-dmg { color: #f87171; font-size: 1.55rem; text-shadow: 0 0 10px #ef4444, 0 2px 4px #000; }
.floating-crit { color: #fbbf24; font-size: 1.95rem; text-shadow: 0 0 16px #f59e0b, 0 2px 6px #000; }
.floating-heal { color: #34d399; font-size: 1.55rem; text-shadow: 0 0 12px #10b981, 0 2px 4px #000; }
.floating-mp { color: #38bdf8; font-size: 1.45rem; text-shadow: 0 0 12px #06b6d4, 0 2px 4px #000; }

@keyframes floatDamage {
  0% { opacity: 0; transform: translateY(10px) scale(0.6); }
  25% { opacity: 1; transform: translateY(-12px) scale(1.15); }
  75% { opacity: 0.9; transform: translateY(-34px) scale(1); }
  100% { opacity: 0; transform: translateY(-50px) scale(0.8); }
}

.shake-screen {
  animation: screenShake 0.35s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
@keyframes screenShake {
  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); }
}

/* ========================================================
   CONSOLE INFERIOR DE COMANDOS
   ======================================================== */
.battle-controls-bottom {
  background: rgba(13, 19, 33, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 10px 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Abas Rápidas */
.action-tabs-row {
  display: flex;
  gap: 6px;
}

.cat-tab-btn {
  flex: 1;
  background: rgba(30, 41, 59, 0.7);
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 8px 4px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.cat-tab-btn.active {
  background: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.5);
}

/* Grid de Botões de Ação */
.action-buttons-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.rpg-action-btn {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 14px;
  padding: 9px 14px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 58px;
  position: relative;
  transition: all 0.15s;
}

.rpg-action-btn:hover:not(:disabled) {
  background: rgba(245, 158, 11, 0.25);
  border-color: #fbbf24;
}

.rpg-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-top-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.94rem;
  font-weight: 800;
}

.btn-cost-tag {
  font-size: 0.76rem;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(6, 182, 212, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.4);
}

.btn-sub-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.3;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========================================================
   MODAIS: CLASSIFICAÇÃO, LOJA, MAPA, CONQUISTAS
   ======================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  z-index: 1000;
}

.modal-card {
  background: rgba(13, 19, 33, 0.98);
  border: 1px solid var(--border-glow);
  border-radius: 24px;
  padding: 22px;
  width: 100%;
  max-width: 760px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.modal-card-ranking {
  max-width: 860px;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 900;
  color: #fde047;
}

/* Indicador de Status do Banco de Dados */
.db-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 9999px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.db-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.db-status-online {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}
.db-status-online .db-status-dot {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.db-status-local {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}
.db-status-local .db-status-dot {
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}
.modal-close-btn:hover {
  color: #fff;
}

/* Métricas do Banco de Dados */
.db-stats-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.db-stat-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.db-stat-icon {
  font-size: 1.35rem;
}

.db-stat-info {
  display: flex;
  flex-direction: column;
}

.db-stat-label {
  font-size: 0.68rem;
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
}

.db-stat-val {
  font-family: var(--font-tech);
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
}

/* Barra de Filtros e Pesquisa */
.ranking-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 8px 12px;
  margin-bottom: 12px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.ranking-search-wrap {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 6px 10px;
}

.search-icon {
  font-size: 0.9rem;
  opacity: 0.7;
}

.ranking-search-input {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.84rem;
  font-weight: 600;
  width: 100%;
  outline: none;
}

.ranking-search-input::placeholder {
  color: var(--text-dim);
}

.search-clear-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.search-clear-btn:hover {
  color: #fff;
}

.ranking-controls-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ranking-select-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ranking-select-label {
  font-size: 0.74rem;
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
}

.ranking-select {
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 9px;
  padding: 5px 8px;
  font-size: 0.8rem;
  font-weight: 700;
  outline: none;
  cursor: pointer;
}

.ranking-select option {
  background: #0f172a;
  color: #fff;
}

/* Tabela de Ranking com Rolagem */
.ranking-table-scroll {
  max-height: 44vh;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex: 1;
  min-height: 160px;
}

.ranking-table-scroll::-webkit-scrollbar {
  width: 6px;
}
.ranking-table-scroll::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
}
.ranking-table-scroll::-webkit-scrollbar-thumb {
  background: rgba(251, 191, 36, 0.4);
  border-radius: 4px;
}

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

.ranking-table thead {
  position: sticky;
  top: 0;
  z-index: 5;
}

.ranking-table th {
  background: #1e293b;
  padding: 9px 12px;
  font-family: var(--font-display);
  font-size: 0.76rem;
  color: #94a3b8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.ranking-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.rank-gold { color: #fbbf24; font-weight: 900; }
.rank-silver { color: #e2e8f0; font-weight: 900; }
.rank-bronze { color: #d97706; font-weight: 900; }

.rank-player-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rank-thumb-mini {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 10px;
  border: 1.5px solid var(--gold);
  overflow: hidden;
}
.rank-thumb-mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rank-current-row td {
  background: rgba(245, 158, 11, 0.22) !important;
}

.rank-date-tag {
  font-size: 0.68rem;
  color: var(--text-dim);
  display: block;
}

.btn-del-record {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-del-record:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fff;
}

.ranking-empty-state {
  text-align: center;
  padding: 36px 16px;
  color: var(--text-muted);
}

/* Rodapé do Banco de Dados */
.ranking-db-footer {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 12px;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.db-actions-left, .db-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.db-btn-secondary {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.db-btn-secondary:hover {
  background: rgba(59, 130, 246, 0.3);
  border-color: rgba(59, 130, 246, 0.6);
  color: #fff;
}

.db-btn-danger {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.db-btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #fff;
}

/* Toast de Notificação do Banco de Dados */
.db-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(50px);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--gold);
  color: #fff;
  padding: 10px 22px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  gap: 8px;
}
.db-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Loja Items */
.shop-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 10px 16px;
  margin-bottom: 10px;
}

.shop-buy-btn {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 7px 16px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
}

/* ========================================================
   RESPONSIVIDADE INTELIGENTE
   ======================================================== */
@media (max-width: 768px) {
  .rpg-app {
    padding: 6px 8px;
  }

  .game-nav {
    height: 46px;
    min-height: 46px;
    padding: 0 10px;
  }

  .brand-title {
    font-size: 0.95rem;
  }

  .nav-btn span:last-child {
    display: none; /* Deixa apenas o ícone no mobile */
  }

  .nav-btn {
    padding: 6px 10px;
  }

  .battle-hud-compact {
    height: 46px;
    min-height: 46px;
    padding: 2px 10px;
    gap: 8px;
  }

  .hud-photo-thumb {
    width: 36px;
    height: 36px;
  }

  .hud-player-name {
    font-size: 0.88rem;
  }

  .hud-bars-wrap {
    max-width: 190px;
  }

  .fighters-arena-row {
    padding: 0 12px;
    min-height: 110px;
  }

  .player-photo-hero-box, .enemy-sprite-hero-box {
    width: 78px;
    height: 78px;
  }

  .enemy-sprite-hero-box {
    font-size: 3.4rem;
  }

  .action-buttons-grid {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .rpg-action-btn {
    min-height: 52px;
    padding: 7px 10px;
  }

  .class-selection-container {
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
  }

  .class-scroll-wrapper {
    max-height: 280px;
    flex: none;
  }

  .class-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .class-card {
    padding: 8px 10px;
    gap: 10px;
    border-radius: 12px;
  }

  .class-photo-wrapper {
    width: 62px;
    height: 62px;
    min-width: 62px;
    border-radius: 14px;
  }

  .class-name {
    font-size: 0.98rem;
  }

  .class-role {
    font-size: 0.72rem;
  }

  .class-tag-preview {
    display: none;
  }

  .class-details-panel {
    max-height: 240px;
    min-width: 0;
    padding: 10px 12px;
    flex: none;
  }

  .db-stats-summary {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .ranking-filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .ranking-controls-wrap {
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .ranking-select-wrap {
    flex: 1;
    min-width: 130px;
  }

  .ranking-select {
    width: 100%;
  }

  .ranking-db-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .db-actions-left, .db-actions-right {
    width: 100%;
    justify-content: space-between;
  }

  .db-btn-secondary, .db-btn-danger {
    flex: 1;
    justify-content: center;
  }
}

/* Telas com Altura Reduzida (ex: laptops 1366x768 ou janelas baixas) */
@media (max-height: 750px) {
  .rpg-app {
    padding: 4px 12px;
  }

  .game-nav {
    height: 44px;
    min-height: 44px;
  }

  .intro-header-block {
    margin-bottom: 2px;
  }

  .game-main-title {
    font-size: 1.35rem;
  }

  .game-subtitle {
    font-size: 0.82rem;
  }

  .class-photo-wrapper {
    width: 70px;
    height: 70px;
    min-width: 70px;
  }

  .class-card {
    padding: 8px 10px;
  }

  .battle-hud-compact {
    height: 46px;
    min-height: 46px;
  }

  .player-photo-hero-box, .enemy-sprite-hero-box {
    width: 82px;
    height: 82px;
  }

  .enemy-sprite-hero-box {
    font-size: 3.6rem;
  }

  .fighters-arena-row {
    min-height: 110px;
  }

  .rpg-action-btn {
    min-height: 50px;
    padding: 6px 10px;
  }
}