/* Reset Básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", sans-serif;
}

body {
  background-color: #111827; /* Fundo escuro */
  color: #e5e7eb; /* Texto claro */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Navbar */
.navbar {
  background-color: #1f2937;
  border-bottom: 2px solid #374151;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  font-size: 24px;
  font-weight: bold;
  color: #3b82f6;
  text-transform: uppercase;
}

.nav-links a {
  margin-left: 20px;
  color: #9ca3af;
  font-weight: 500;
  transition: 0.3s;
}

.nav-links a:hover {
  color: #fff;
}

.btn-login {
  background-color: #2563eb;
  padding: 8px 16px;
  border-radius: 4px;
  color: white !important;
}

.btn-register {
  border: 1px solid #4b5563;
  padding: 7px 15px;
  border-radius: 4px;
}

/* Conteúdo Principal */
.container {
  flex: 1; /* Empurra o footer para baixo */
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  width: 100%;
}

/* Footer */
footer {
  background-color: #0f1218;
  text-align: center;
  padding: 20px;
  border-top: 1px solid #1f2937;
  font-size: 14px;
  color: #6b7280;
}

/* --- Estilos de Formulário (Adicione ao final do style.css) --- */
.auth-box {
  background-color: #1f2937;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  max-width: 450px;
  margin: 40px auto; /* Centraliza na tela */
  border: 1px solid #374151;
}

.auth-box h2 {
  text-align: center;
  margin-bottom: 20px;
  color: #fff;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  color: #9ca3af;
  font-size: 14px;
}

.form-group input {
  width: 100%;
  padding: 10px;
  background-color: #374151;
  border: 1px solid #4b5563;
  border-radius: 4px;
  color: white;
  font-size: 16px;
}

.form-group input:focus {
  outline: none;
  border-color: #3b82f6;
}

.btn-submit {
  width: 100%;
  padding: 12px;
  background-color: #2563eb;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  font-weight: bold;
  margin-top: 10px;
}

.btn-submit:hover {
  background-color: #1d4ed8;
}

.error-msg {
  background-color: #7f1d1d;
  color: #fca5a5;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 15px;
  font-size: 14px;
  text-align: center;
}

.success-msg {
  background-color: #064e3b;
  color: #6ee7b7;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 15px;
  font-size: 14px;
  text-align: center;
}

/* --- Dashboard / Painel --- */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #374151;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  background-color: #1f2937;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #374151;
  display: flex;
  flex-direction: column;
}

.stat-label {
  color: #9ca3af;
  font-size: 14px;
  margin-bottom: 5px;
}
.stat-value {
  font-size: 24px;
  font-weight: bold;
  color: #fff;
}
.stat-value.gold {
  color: #fbbf24;
} /* Amarelo Ouro */
.stat-value.level {
  color: #3b82f6;
} /* Azul Level */

.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  background-color: #374151;
  border-radius: 8px;
  transition: 0.3s;
  text-align: center;
  border: 2px solid transparent;
}

.action-btn:hover {
  background-color: #4b5563;
  border-color: #3b82f6;
  transform: translateY(-2px);
}

.action-icon {
  font-size: 30px;
  margin-bottom: 10px;
}
.action-title {
  font-weight: bold;
  color: white;
}

/** AQUI É A TELA DE CRIAÇÃO DO PERSONAGEM

/* --- Seleção de Personagens --- */

/* O Container que segura os cartões */
.char-grid {
  display: flex; /* Ativa o modo flexível */
  justify-content: center; /* Centraliza tudo no meio da tela horizontalmente */
  align-items: flex-start; /* Alinha no topo */
  gap: 30px; /* Espaço entre os retângulos */
  flex-wrap: wrap; /* Se a tela for pequena, joga pra baixo */
  max-width: 1200px; /* Largura máxima para não esticar demais */
  margin: 50px auto; /* Margem em cima e centraliza o bloco na página */
  padding: 0 20px;
}

/* A caixa do personagem (Base para cheios e vazios) */
.char-slot {
  width: 220px; /* Largura fixa do retângulo */
  height: 320px; /* Altura fixa do retângulo */
  border-radius: 12px; /* Bordas arredondadas */
  transition: all 0.3s ease; /* Animação suave */
  position: relative;
  text-decoration: none; /* Tira o sublinhado do link */
  box-sizing: border-box;
}

/* Estilo específico para o SLOT VAZIO (+) */
.slot-empty {
  background-color: rgba(31, 41, 55, 0.4); /* Fundo escuro transparente */
  border: 3px dashed #4b5563; /* Borda tracejada cinza */
  display: flex; /* Flex para centralizar o conteúdo DO CARTÃO */
  flex-direction: column; /* Um item embaixo do outro (+ e texto) */
  align-items: center; /* Centraliza horizontalmente dentro do cartão */
  justify-content: center; /* Centraliza verticalmente dentro do cartão */
  color: #9ca3af;
}

/* Efeito ao passar o mouse no slot vazio */
.slot-empty:hover {
  border-color: #3b82f6; /* Borda fica azul */
  color: #3b82f6; /* Texto fica azul */
  background-color: rgba(59, 130, 246, 0.1); /* Fundo levemente azul */
  transform: translateY(-5px); /* Sobe um pouquinho */
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); /* Sombra */
}

/* O símbolo de + */
.plus-icon {
  font-size: 60px; /* Tamanho grande */
  font-weight: bold;
  line-height: 1;
  margin-bottom: 15px;
}

/* Texto "Novo Personagem" */
.slot-text {
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Texto pequeno "Slot Livre" */
.slot-subtext {
  font-size: 12px;
  margin-top: 5px;
  opacity: 0.7;
}

/* --- Estilo para Slot OCUPADO (Prevenção para quando criar) --- */
.slot-filled {
  border: 2px solid #374151;
  background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  color: white;
}

.slot-filled:hover {
  border-color: #10b981; /* Verde */
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

/* --- Seleção de Sprite na Criação --- */
.sprite-selection {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
}

.sprite-option {
  cursor: pointer;
  border: 2px solid #374151;
  border-radius: 8px;
  padding: 10px;
  background: #111827;
  transition: 0.2s;
  text-align: center;
}

/* Esconde a bolinha do Radio Button original */
.sprite-option input[type="radio"] {
  display: none;
}

.sprite-option img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* Quando selecionado */
.sprite-option input[type="radio"]:checked + img {
  filter: drop-shadow(0 0 5px #3b82f6);
}

.sprite-option:has(input:checked) {
  border-color: #3b82f6;
  background-color: rgba(59, 130, 246, 0.1);
}

/* --- Criação de Personagem (Estilo Novo) --- */
.creation-container {
  display: flex;
  gap: 30px;
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
}

/* Coluna da Esquerda (Preview e Formulário) */
.creation-sidebar {
  width: 350px;
  background: #1f2937;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #374151;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: fit-content;
  position: sticky;
  top: 20px;
}

.char-preview-box {
  width: 100%;
  height: 350px; /* Altura da caixa de preview */
  background: url("../images/bg_preview.jpg") no-repeat center center; /* Fundo opcional */
  background-size: cover;
  background-color: #111827;
  border: 2px solid #374151;
  border-radius: 8px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-end; /* Personagem no chão */
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.char-preview-img {
  height: 80%; /* Personagem ocupa 80% da altura da caixa */
  width: auto;
  image-rendering: pixelated; /* Mantém pixel art nítida */
  transition: 0.3s;
}

/* Coluna da Direita (Seleção) */
.creation-main {
  flex: 1;
}

.section-title {
  color: #fbbf24; /* Amarelo dourado */
  font-size: 18px;
  font-weight: bold;
  text-transform: uppercase;
  margin-bottom: 15px;
  border-bottom: 2px solid #374151;
  padding-bottom: 10px;
}

/* Grid de Animes */
.anime-grid {
  display: flex;
  gap: 15px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.anime-option {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  border: 2px solid #374151;
  cursor: pointer;
  background-color: #000;
  transition: 0.2s;
  opacity: 0.6;
}

.anime-option:hover,
.anime-option.active {
  border-color: #3b82f6;
  opacity: 1;
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.anime-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

/* Grid de Personagens */
.selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 15px;
}

.char-option {
  background: #111827;
  border: 2px solid #374151;
  border-radius: 8px;
  cursor: pointer;
  aspect-ratio: 1/1; /* Quadrado perfeito */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
  position: relative;
  overflow: hidden;
}

.char-option:hover,
.char-option.active {
  border-color: #10b981; /* Verde */
  background-color: rgba(16, 185, 129, 0.1);
}

.char-option img {
  width: 80%;
  height: 80%;
  object-fit: contain;
  image-rendering: pixelated;
}

/* Seletor de Facção */
.faction-grid {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 10px;
  width: 100%;
}

.faction-option {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid #374151;
  cursor: pointer;
  overflow: hidden;
  transition: 0.3s;
  background: #000;
}

.faction-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.faction-option:hover,
.faction-option.active {
  border-color: #fbbf24;
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(251, 191, 36, 0.5);
}

/* --- UI STATUS / GAME --- */
.game-layout {
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  gap: 20px;
  max-width: 1200px;
  margin: 30px auto;
  align-items: start;
}

/* Coluna do Personagem */
.char-card {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}

.char-anim-box {
  height: 300px;
  background: radial-gradient(circle, #374151 0%, #111827 100%);
  border: 1px solid #4b5563;
  border-radius: 6px;
  display: flex;
  align-items: center; /* Centraliza verticalmente */
  justify-content: center; /* Centraliza horizontalmente */
  overflow: hidden;
  margin-bottom: 10px;
}

.char-anim-box img {
  height: 80%; /* Ajuste o tamanho do boneco aqui */
  width: auto;
  image-rendering: pixelated; /* Importante para pixel art não borrar */
}

/* Barras de Status e Painéis */
.panel-game {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
}

.panel-title {
  color: #fbbf24;
  font-weight: bold;
  border-bottom: 1px solid #374151;
  padding-bottom: 10px;
  margin-bottom: 15px;
  text-transform: uppercase;
  font-size: 14px;
}

.stat-row {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
}
.stat-label {
  width: 90px;
  color: #9ca3af;
  font-weight: bold;
}
.stat-val {
  width: 40px;
  text-align: center;
  background: #111827;
  border: 1px solid #374151;
  color: white;
  border-radius: 4px;
  margin-right: 10px;
}
.stat-bar-bg {
  flex: 1;
  height: 10px;
  background: #111827;
  border-radius: 5px;
  overflow: hidden;
}
.stat-bar-fill {
  height: 100%;
}

.fill-green {
  background: #10b981;
}
.fill-blue {
  background: #3b82f6;
}
.fill-purple {
  background: #8b5cf6;
}

/* Menu Interno do Jogo (Abaixo da Navbar principal) */
.game-menu {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 20px 0;
  flex-wrap: wrap;
}
.game-btn {
  background: #1f2937;
  color: #9ca3af;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  border: 1px solid #374151;
  transition: 0.2s;
}
.game-btn:hover,
.game-btn.active {
  background: #2563eb;
  color: white;
  border-color: #60a5fa;
}

/* Responsivo */
@media (max-width: 900px) {
  .game-layout {
    grid-template-columns: 1fr;
  }
}

/* --- TELA DE BATALHA (VS) --- */

/* Abas Superiores */
.battle-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  background: #0f1218;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #1f2937;
}

.battle-tab {
  flex: 1;
  text-align: center;
  padding: 12px;
  background: #1f2937;
  color: #9ca3af;
  text-decoration: none;
  border-radius: 6px;
  font-weight: bold;
  font-size: 13px;
  border: 1px solid #374151;
  transition: 0.2s;
}
.battle-tab:hover,
.battle-tab.active {
  background: #111827;
  color: #3b82f6; /* Azul destaque */
  border-color: #2563eb;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.2);
}

/* Banner de Limite */
.battle-banner {
  background: linear-gradient(90deg, #1e3a8a 0%, #111827 100%);
  border: 1px solid #1e40af;
  border-radius: 8px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
  position: relative;
  overflow: hidden;
}

.banner-text h3 {
  color: #fbbf24;
  margin-bottom: 5px;
  text-transform: uppercase;
  font-size: 16px;
}
.banner-text p {
  color: #9ca3af;
  font-size: 12px;
}

/* Grid VS */
.vs-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

/* Card de Lutador (Reaproveitado mas específico pra batalha) */
.fighter-card {
  width: 280px;
  background: #111827;
  border: 2px solid #374151;
  border-radius: 12px;
  padding: 15px;
  text-align: center;
  position: relative;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s;
}
.fighter-card:hover {
  transform: translateY(-5px);
  border-color: #fbbf24;
}
.fighter-card.enemy:hover {
  border-color: #ef4444;
} /* Inimigo fica vermelho */

.fighter-anim-box {
  height: 250px;
  background: radial-gradient(circle, #374151 0%, #000 100%);
  border: 1px solid #4b5563;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
  overflow: hidden;
}
.fighter-anim-box img {
  height: 80%;
  width: auto;
  image-rendering: pixelated;
}

/* Texto VS no Meio */
.vs-logo {
  font-size: 80px;
  font-weight: 900;
  font-style: italic;
  color: #fbbf24;
  text-shadow: 4px 4px 0px #b45309, 0 0 20px rgba(251, 191, 36, 0.5);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

/* Botões de Ação */
.battle-actions {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.btn-battle {
  padding: 15px 40px;
  font-size: 18px;
  font-weight: bold;
  text-transform: uppercase;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  width: 300px;
  transition: 0.2s;
}

.btn-accept {
  background: linear-gradient(to bottom, #2563eb, #1d4ed8);
  color: white;
  border: 1px solid #3b82f6;
  box-shadow: 0 4px 0 #1e40af;
}
.btn-accept:hover {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #1e40af;
}

.btn-change {
  background: #374151;
  color: #d1d5db;
  font-size: 14px;
  padding: 10px 20px;
  width: auto;
  border: 1px solid #4b5563;
}
.btn-change:hover {
  background: #4b5563;
  color: white;
}

/* Responsivo */
@media (max-width: 800px) {
  .vs-container {
    flex-direction: column;
  }
  .vs-logo {
    margin: 20px 0;
    transform: rotate(90deg);
  }
}

/* --- BARRA DE EXPERIÊNCIA SUPERIOR --- */
.exp-bar-container {
  background-color: #111827; /* Fundo escuro */
  border-bottom: 1px solid #374151;
  padding: 10px 0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 90; /* Abaixo da navbar, acima do conteúdo */
}

.exp-bar-wrapper {
  max-width: 800px; /* Largura máxima para não ficar esticada em monitores 4k */
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
}

.exp-bar-track {
  width: 100%;
  height: 18px;
  background-color: #374151; /* Cor do fundo da barra vazia */
  border-radius: 9px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.exp-bar-fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    #fbbf24,
    #d97706
  ); /* Gradiente Dourado/Laranja */
  width: 0%; /* O PHP vai preencher isso */
  border-radius: 9px;
  transition: width 0.5s ease-out;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.5); /* Brilho */
}

.exp-bar-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #ffffff;
  font-size: 11px;
  font-weight: bold;
  text-shadow: 1px 1px 2px #000, 0 0 5px #000; /* Contorno preto para leitura */
  white-space: nowrap;
  z-index: 2;
}

.exp-level-badge {
  position: absolute;
  left: -10px;
  top: -4px;
  background: #2563eb;
  color: white;
  font-size: 10px;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 12px;
  border: 2px solid #1e40af;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
  z-index: 3;
}

/* Container do Modal (Fundo escuro) */
.custom-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none; /* Escondido por padrão */
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* Caixa do Modal */
.custom-modal {
  background: #1f2937;
  border: 2px solid #3b82f6;
  padding: 30px;
  border-radius: 12px;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
  animation: modalScale 0.2s ease-out;
}

@keyframes modalScale {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.custom-modal h3 {
  color: #ef4444;
  margin-bottom: 15px;
  text-transform: uppercase;
}
.custom-modal p {
  color: #d1d5db;
  margin-bottom: 20px;
  line-height: 1.5;
}

.custom-modal .btn-close-modal {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 10px 30px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  text-transform: uppercase;
}
