/* === Estilo Geral === */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #121212;
  color: #ffffff;
  margin: 0;
  padding: 2rem;
  text-align: center;
  zoom: 0.75;
}

h1, h2, h3 {
  color: #FFD700;
}

/* === Botões e Links === */
button, .button-link, .buttons {
  padding: 10px 20px;
  margin: 10px;
  background: #222;
  border: 1px solid #555;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s;
  text-decoration: none;
  display: inline-block;
}

button:hover, .button-link:hover {
  background: #333;
}

/* === Inputs e Selects === */
input, select {
  padding: 6px;
  margin: 5px;
  border-radius: 6px;
  border: 1px solid #555;
  background: #1a1a1a;
  color: #fff;
}

/* === Tabelas === */
table {
  width: 100%;
  margin-top: 30px;
  border-collapse: collapse;
}

th, td {
  padding: 10px;
  border: 1px solid #333;
}

th {
  background: #222;
}

/* === Index === */
.nav-buttons {
  display: flex;
  flex-direction: row; /* muda de coluna para linha */
  justify-content: center;
  gap: 20px;
  margin-top: 40px;
  flex-wrap: wrap; /* permite quebrar linha em telas menores */
}

.nav-buttons a {
  background-color: #222;
  color: #fff;
  padding: 12px 24px;
  border: 1px solid #555;
  border-radius: 10px;
  text-decoration: none;
  font-size: 1.1rem;
  transition: background-color 0.3s ease;
  min-width: 200px;
  text-align: center;
}

.nav-buttons a:hover {
  background-color: #333;
}



/* === Scoreboard === */
.scoreboard {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2rem;
}

.player-box {
  background: #1e1e1e;
  border: 2px solid #f9d342;
  padding: 1rem;
  border-radius: 10px;
  width: 200px;
  box-shadow: 0 0 8px #000;
  text-align: center;
}

.title-score {
  color: #ffffff;
  font-size: 22px;
  text-transform: uppercase;
}

/* === Modais === */
.modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #222;
  padding: 20px;
  border-radius: 10px;
  z-index: 10;
}

.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 9;
}

/* === Sidebar === */
.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  height: 100%;
  background-color: rgba(24, 24, 24, 0.96);
  color: white;
  padding: 1rem;
  transition: transform 0.3s ease;
  transform: translateX(100%);
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.5);
  z-index: 999;
  overflow-y: auto;
}

.sidebar.open {
  transform: translateX(0);
}

.abrir-button {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: #f9d342;
  color: black;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 24px;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 0 8px #000;
}

.toggle-button {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: #f9d342;
  color: black;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 0 8px #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.perfil-img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 50%;
  margin: 1rem auto;
  display: block;
  background-color: #ffffff;
  border: 3px solid #f9d342;
}

.info-bloco {
  text-align: center;
  margin-bottom: 1.5rem;
}

.info-bloco span {
  display: block;
  font-weight: bold;
  margin-top: 5px;
}

.sidebar a {
  display: block;
  color: white;
  padding: 0.7rem;
  margin: 0.5rem 0;
  text-decoration: none;
  border-bottom: 1px solid #444;
  font-weight: 600;
}

.sidebar a:hover {
  background-color: #444;
}

.lotus-coins {
  color: gold;
  font-weight: bold;
}

.moeda {
  margin-right: 5px;
}

/* === Cartas Relíquias (Gerador) === */
.relic-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.relic {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 350px;
  box-sizing: border-box;
}

.relic img {
  width: 350px;
  height: 486px;
  border-radius: 10px;
  box-shadow: 0 0 15px gold;
}

/* ✅ A carta individual */
.card-container {
  width: 300px;
  height: 420px;
  position: relative;
  perspective: 1000px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

/* 🔁 Ajuste do container de cartas para flexível e organizado */
.booster-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
}

/* ✅ Cada carta (com nome e botão) fica empacotada aqui */
.box-booster {
  background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
  border: 2px solid #FFD700;
  border-radius: 12px;
  padding: 0.5rem;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
  width: 315px;  /* ligeiramente maior que a carta */
  text-align: center;
  margin-bottom: 1rem;
}
/* ✅ A imagem da carta (já deve ter booster-card) */
.booster-card {
  width: 300px !important;
  height: 420px !important; 
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 0 10px gold;
  transition: transform 0.2s ease;
}
/* Imagem da carta */
.box-booster img {
  width: 300px;
  height: 420px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
}

.booster-card:hover {
  transform: scale(1.05);
}

.card-face {
  width: 100%;
  height: 100%;
  position: absolute;
  border-radius: 10px;
  backface-visibility: hidden;
  box-shadow: 0 0 15px gold;
  transition: transform 0.6s ease-in-out;
}

.card-face.front {
  transform: rotateY(0deg);
  z-index: 2;
}

.card-face.back {
  transform: rotateY(180deg);
}

.card-container.flipped .front {
  transform: rotateY(180deg);
}

.card-container.flipped .back {
  transform: rotateY(360deg);
}

.flip-btn {
  margin-top: 8px;
  background: #333;
  color: #ffd700;
  border: 1px solid #888;
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.flip-btn:hover {
  background: #555;
}

.players-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2rem;
}

.player-card {
  background: #1e1e1e;
  padding: 1rem;
  width: 180px;
  text-align: center;
  border-radius: 12px;
  box-shadow: 0 0 8px #000;
  border: 2px solid #f9d342;
  text-decoration: none;
  color: #fff;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.player-card:hover {
  transform: scale(1.05);
  box-shadow: 0 0 12px #f9d342;
}

.player-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 0.5rem;
  border: 2px solid #fff;
  background-color: #ffffff;
}

.player-nome {
  display: block;
  font-weight: bold;
  font-size: 1.1rem;
  color: #ffd700;
}

.relic-grid {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: auto;
}

.relic img {
  width: 100%;
  border-radius: 8px;
}

.relic-name {
  margin-top: 0.5rem;
  font-weight: bold;
  font-size: 1rem;
  color: #fff;
}

/* === Pagina Inicial === */
.home-header {
  padding: 3rem 1rem 1rem;
  text-align: center;
  background-color: #1a1a1a;
  box-shadow: 0 4px 8px #000;
}

.home-header h1 {
  font-size: 5rem;
  color: #f9d342;
  text-shadow: 2px 2px #000;
  margin-bottom: 1rem;
  text-transform: uppercase;
  font-family: 'Crimson Pro', serif;
}

.logo-image {
  width: 260px;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 0 25px rgba(249, 211, 66, 0.7);
}

.welcome {
  font-size: 1.3rem;
  margin-top: 2rem;
  text-align: center;
}

/* === Historico === */
.historico-header {
  background-color: #1e1e1e;
  padding: 1rem 0;
  text-align: center;
  font-size: 2rem;
  font-weight: bold;
  color: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.7);
  position: sticky;
  top: 0;
  z-index: 100;
}

.historico-main {
  max-width: 960px;
  margin: 1rem auto 3rem auto;
  padding: 0 1rem;
}

.registro {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  background: #222;
  border-radius: 10px;
  padding: 1rem;
  align-items: flex-start;
}

.imagem-carta {
  flex-shrink: 0;
  text-align: center;
}

.imagem-carta img {
  width: 216px;
  height: 300px;
  border-radius: 8px;
  object-fit: cover;
}

.nome-carta {
  margin-top: 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
}

.info-direita {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.tipo-booster {
  color: #FFD700;
  font-weight: 700;
  font-size: 1.6rem;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

.data {
  color: #bbb;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.cartas-booster {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
}

.cartas-booster span {
  background-color: #000;
  border: 1px solid #444;
  border-radius: 12px;
  padding: 0.3rem 0.9rem;
  font-size: 0.9rem;
  color: #ccc;
  white-space: nowrap;
}

.botao-voltar-container {
  max-width: 960px;
  margin: 1rem auto;
  padding: 0 1rem;
  text-align: left;
}

.botao-voltar {
  display: inline-block;
  background-color: #1f1f1f;
  color: #fff;
  border: 1px solid #444;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.botao-voltar:hover {
  background-color: #333;
}

/* === Decklist === */
.header-top {
  background-color: #1e1e1e;
  padding: 1rem 0;
  text-align: center;
  font-size: 2rem;
  font-weight: bold;
  color: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.7);
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-nav {
  max-width: 960px;
  margin: 1rem auto;
  padding: 0 1rem;
}

.top-nav a {
  color: #eee;
  text-decoration: none;
  font-weight: bold;
  background-color: #1f1f1f;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 1px solid #444;
  transition: background-color 0.3s ease;
}

.top-nav a:hover {
  background-color: #333;
}

.deck-section {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #FFD700;
  padding-bottom: 0.3rem;
  color: #FFD700;
  text-align: center;
}

.deck-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: flex-start;
}

.card {
  background: #222;
  border-radius: 10px;
  padding: 0.5rem;
  width: 212px;
  cursor: default;
  text-align: center;
  box-shadow: 0 0 8px rgba(0,0,0,0.8);
}

.card img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  object-fit: contain;
}

.card p {
  margin-top: 0.5rem;
  font-size: 1rem;
  color: #fff;
  word-wrap: break-word;
}

/* === Perfil de Jogador === */
.subtitle {
  font-size: 1.1rem;
  color: #ffcc00;
  margin-bottom: 2rem;
  text-align: center;
}

.main-content {
  display: flex;
  flex-direction: row;
  justify-content: center;  /* agrupa tudo ao centro */
  align-items: flex-start;
  gap: 2rem;
  margin-top: 2rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.column {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.column img { /* Imagens dos comandantes */
  width: 100%;
  max-width: 300px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 0 10px #000;
}

.column.buttons { /* Coluna de botões com largura limitada */
  max-width: 300px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.column.buttons a,
.column.buttons button {
  background-color: #1e1e1e;
  border: 2px solid #555;
  padding: 0.8rem 1.5rem;
  border-radius: 10px;
  text-decoration: none;
  color: #f0e6d2;
  font-weight: bold;
  transition: 0.3s ease;
  cursor: pointer;
  text-align: center;
  min-width: 200px;
}

.column.buttons a:hover,
.column.buttons button:hover {
  background-color: #f0e6d2;
  color: #121212;
}

#cid-modal,
#escolher-jogador-modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #1e1e1e;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 0 20px black;
  z-index: 999;
  max-width: 180vw;
  color: white;
}

#cid-modal h3 {
  color: #ffd700;
  margin-bottom: 1rem;
}

.booster-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}


.card-face.front {
  z-index: 2;
  transform: rotateY(0deg);
}

.card-face.back {
  transform: rotateY(180deg);
}

.flip-btn:hover {
  background: #555;
}

.bottom-nav {
  margin-top: 2rem;
  text-align: center;
}

.bottom-nav a {
  background-color: #222;
  border: 1px solid #555;
  border-radius: 8px;
  padding: 0.5rem 1.5rem;
  color: #f0e6d2;
  text-decoration: none;
  font-size: 1rem;
  transition: background 0.3s;
}

.bottom-nav a:hover {
  background-color: #f0e6d2;
  color: #121212;
}

/* === Mobile (até 600px) === */
@media (max-width: 600px) {
  /* Sidebar retrátil para ocupar a tela toda */
  .sidebar {
    width: 100%;
    right: -100%;
  }

  .sidebar.open {
    right: 0;
  }

  /* Imagens grandes como cartas */
  .imagem-carta img {
    width: 90vw;
    height: auto;
  }

  /* Ajusta layout principal em colunas para empilhar verticalmente */
  .main-content {
    flex-direction: column;
    align-items: center;
  }

  .column {
    width: 100%;
  }

  /* Registros de partida e decks adaptados */
  .registro {
    flex-direction: column;
    align-items: center;
  }

  .info-direita {
    width: 100%;
    margin-top: 1rem;
    text-align: center;
    align-items: center;
  }

  .tipo-booster {
    font-size: 1.3rem;
  }

  .cartas-booster {
    justify-content: center;
  }

  .deck-container {
    justify-content: center;
  }

  .card {
    width: 180px;
    padding: 0.4rem;
  }

  .card p {
    font-size: 0.85rem;
  }
}

/* === CID CARDS === */
.cid-booster-grid {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem;
  overflow-x: auto;
}
.cid-card-wrapper {
  width: 300px;
  flex: 0 0 auto;
  text-align: center;
}
.cid-card-wrapper img {
  width: 300px;
  height: 420px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
}
.cid-card-wrapper p {
  margin-top: 0.5rem;
  color: #fff;
  text-align: center;
}

/* === CID Perfil === */
#cid-modal {
  max-width: 1000px;
  margin: auto;
  background: #111;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}
#cid-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

#cid-cards .box-booster {
  flex: 1 1 calc(33.33% - 2rem); /* 3 por linha com gap */
  max-width: 300px;
  min-width: 200px;
  box-sizing: border-box;
  text-align: center;
}

#cid-cards img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

/* Garantir que o modal acomode tudo direitinho */
#modal-cid-booster .modal-content {
  max-width: 1000px;
  width: 90%;
}

#resultado-cid-perfil {
  display: flex;
  justify-content: center;
  gap: 10px;
  overflow-x: auto;
}

#resultado-cid-perfil .cid-card-wrapper {
  flex: 1 1 30%;
  max-width: 30%;
}