@import url('https://fonts.googleapis.com/css2?family=Anton&family=Montserrat:wght@400;600;700;800;900&display=swap');

/* ============================================================
   TEMA "COPA DO MUNDO" — escuro premium + dourado
   ============================================================ */
:root {
  --azul-fundo: #0A1033;
  --azul-2: #0E1746;
  --azul-3: #16205e;
  --card: rgba(255, 255, 255, 0.045);
  --card-borda: rgba(255, 255, 255, 0.10);
  --ouro: #F4C430;
  --ouro-claro: #FFE9A8;
  --ouro-grad: linear-gradient(135deg, #FFE07A 0%, #F4C430 45%, #D69A1E 100%);
  --verde: #3DDC84;
  --vermelho: #FF5A5A;
  --laranja: #FF7A3D;
  --texto: #EDEFF7;
  --texto-suave: rgba(237, 239, 247, 0.62);
  --raio: 16px;
  --sombra: 0 18px 40px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

body {
  font-family: 'Montserrat', sans-serif;
  margin: 0;
  color: var(--texto);
  background-color: var(--azul-fundo);
  background-image:
    radial-gradient(1100px 600px at 15% -5%, rgba(244, 196, 48, 0.14), transparent 60%),
    radial-gradient(1000px 700px at 100% 0%, rgba(59, 90, 220, 0.30), transparent 55%),
    radial-gradient(circle, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: auto, auto, 22px 22px;
  background-attachment: fixed;
}

h1, h2 {
  font-family: 'Anton', sans-serif;
  text-align: center;
  color: var(--texto);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

/* ---------- NAVBAR ---------- */
nav {
  background: rgba(9, 14, 45, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(244, 196, 48, 0.25);
  padding: 14px 12px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
}
nav a {
  color: var(--texto);
  text-decoration: none;
  font-size: 14px;
  margin: 4px 5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 9px 16px;
  border-radius: 30px;
  transition: all 0.25s ease;
  display: inline-block;
}
nav a:hover { background: rgba(255, 255, 255, 0.08); }
nav a.ativo {
  background: var(--ouro-grad);
  color: #2a1c00;
  box-shadow: 0 6px 16px rgba(244, 196, 48, 0.35);
}

main { min-height: 60vh; padding-bottom: 40px; }

/* ---------- HERO ---------- */
.hero {
  text-align: center;
  padding: 60px 20px 70px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 300px at 50% 0%, rgba(244, 196, 48, 0.20), transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--ouro), var(--laranja), var(--verde), var(--ouro));
  background-size: 200% 100%;
  animation: desliza 6s linear infinite;
}
@keyframes desliza { to { background-position: 200% 0; } }
.hero-com-logo { padding: 40px 20px 56px; }
.hero-logo {
  display: block;
  width: min(230px, 58%);
  height: auto;
  margin: 0 auto 10px;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.5));
  animation: flutua 4s ease-in-out infinite;
}
.hero-com-logo .hero-titulo { margin: 4px 0 6px; }
.hero-trofeu {
  font-size: 76px;
  line-height: 1;
  filter: drop-shadow(0 6px 20px rgba(244, 196, 48, 0.55));
  animation: flutua 3s ease-in-out infinite;
}
@keyframes flutua { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.hero-titulo {
  font-family: 'Anton', sans-serif;
  font-weight: 400;
  font-size: clamp(38px, 9vw, 78px);
  line-height: 0.95;
  margin: 14px 0 8px;
  letter-spacing: 2px;
  background: var(--ouro-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 30px rgba(244, 196, 48, 0.25);
}
.hero-sub {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--texto-suave);
  margin: 0 0 20px;
}
.hero-badge {
  display: inline-block;
  background: var(--ouro-grad);
  color: #2a1c00;
  font-weight: 900;
  padding: 9px 26px;
  border-radius: 30px;
  font-size: 15px;
  letter-spacing: 1px;
  box-shadow: 0 8px 20px rgba(244, 196, 48, 0.35);
}

/* ---------- STATS ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 900px;
  margin: -36px auto 44px;
  padding: 0 20px;
  position: relative;
  z-index: 2;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--card-borda);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  padding: 22px 10px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(6px);
}
.stat-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--ouro-grad);
}
.stat-icone { font-size: 26px; }
.stat-valor { font-family: 'Anton', sans-serif; font-size: 40px; color: var(--ouro); line-height: 1.05; }
.stat-rotulo { font-size: 11px; text-transform: uppercase; color: var(--texto-suave); font-weight: 800; letter-spacing: 1px; }

/* ---------- BLOCO INFO ---------- */
.bloco-info {
  max-width: 840px;
  margin: 0 auto;
  padding: 34px 30px;
  background: var(--card);
  border: 1px solid var(--card-borda);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  backdrop-filter: blur(6px);
}
.bloco-info h2 { margin: 0 0 6px; font-size: 26px; color: var(--ouro-claro); }
.bloco-info p { font-size: 16px; line-height: 1.75; color: var(--texto-suave); text-align: center; }
.bloco-info strong { color: var(--texto); }

/* ---------- SELEÇÕES (chips) ---------- */
.times-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 8px; }
.time-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-borda);
  border-radius: 12px;
  padding: 12px 20px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.time-chip:hover { transform: translateY(-4px); border-color: rgba(244, 196, 48, 0.5); }
.time-nome { font-size: 18px; font-weight: 800; color: var(--texto); }

/* ---------- BANDEIRAS SVG ---------- */
.flag {
  display: inline-block;
  width: 1.4em;
  height: 0.95em;
  border-radius: 2px;
  vertical-align: -0.12em;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
  overflow: hidden;
  line-height: 0;
}
.flag svg { display: block; width: 100%; height: 100%; }
.flag-lg { width: 36px; height: 24px; border-radius: 4px; box-shadow: 0 2px 6px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.2); }

/* ---------- BANNER CAMPEÃO ---------- */
.banner-campeao {
  background: var(--ouro-grad);
  color: #2a1c00;
  padding: 26px 20px;
  border-radius: var(--raio);
  margin: 30px auto;
  max-width: 840px;
  box-shadow: 0 14px 40px rgba(244, 196, 48, 0.4);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.banner-campeao::after {
  content: "";
  position: absolute;
  top: -50%; left: -60%;
  width: 40%; height: 200%;
  background: rgba(255, 255, 255, 0.35);
  transform: rotate(25deg);
  animation: brilho 3.5s ease-in-out infinite;
}
@keyframes brilho { 0% { left: -60%; } 60%, 100% { left: 140%; } }
.banner-conteudo { display: flex; align-items: center; justify-content: center; gap: 24px; flex-wrap: wrap; position: relative; z-index: 1; }
.icone-trofeu { font-size: 60px; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3)); }
.texto-campeao h2 { margin: 0; color: #2a1c00; font-size: 30px; }
.texto-campeao p { margin: 4px 0 0; font-size: 22px; font-weight: 900; color: #2a1c00; }

/* ---------- CARDS / TABELAS ---------- */
.grupo-box {
  max-width: 880px;
  margin: 0 auto 30px;
  background: var(--card);
  border: 1px solid var(--card-borda);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  overflow: hidden;
  backdrop-filter: blur(6px);
}
.titulo-rodada {
  font-family: 'Anton', sans-serif;
  background: linear-gradient(90deg, var(--azul-3), var(--azul-2));
  color: var(--ouro-claro);
  padding: 15px;
  font-size: 20px;
  font-weight: 400;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 2px;
  border-bottom: 2px solid rgba(244, 196, 48, 0.35);
}
.tabela-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: center; }
th {
  background: rgba(255, 255, 255, 0.05);
  color: var(--ouro-claro);
  padding: 13px 6px;
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.5px;
  white-space: nowrap;
  border-bottom: 1px solid var(--card-borda);
}
th.th-time { text-align: left; padding-left: 18px; }
td { padding: 13px 6px; border-bottom: 1px solid rgba(255,255,255,0.06); font-size: 15px; font-weight: 700; color: var(--texto); }
td.td-time { text-align: left; padding-left: 18px; font-weight: 800; }
td.pos { color: var(--texto-suave); font-family: 'Anton', sans-serif; font-size: 17px; }
td.destaque { color: var(--ouro); font-weight: 900; font-size: 17px; }
td.pa { font-weight: 800; color: var(--ouro-claro); }
tbody tr { transition: background 0.2s ease; }
tbody tr:hover { background: rgba(255, 255, 255, 0.04); }
.zona-classificacao td:first-child { border-left: 4px solid var(--verde); }
.zona-eliminacao td:first-child { border-left: 4px solid var(--vermelho); }
.legenda { font-size: 12px; color: var(--texto-suave); text-align: center; padding: 12px 18px 16px; margin: 0; font-weight: 600; }

/* ---------- JOGOS ---------- */
.lista-jogos-grupo { padding: 8px 16px 16px; }
.jogo-linha {
  display: grid;
  grid-template-columns: 56px 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 13px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.jogo-linha:last-child { border-bottom: none; }
.jogo-data { font-size: 12px; color: var(--texto-suave); font-weight: 700; }
.jogo-time { font-weight: 700; font-size: 15px; color: var(--texto); }
.jogo-time.casa { text-align: right; }
.jogo-time.fora { text-align: left; }
.jogo-time.venc { color: var(--verde); font-weight: 900; }
.placar-jogo {
  background: var(--ouro-grad);
  color: #2a1c00;
  font-weight: 900;
  padding: 5px 13px;
  border-radius: 8px;
  font-size: 15px;
  white-space: nowrap;
}
.placar-jogo .x { opacity: 0.55; font-weight: 700; }
.placar-pendente-jogo {
  color: var(--texto-suave);
  font-weight: 700;
  font-size: 13px;
  background: rgba(255,255,255,0.06);
  padding: 5px 13px;
  border-radius: 8px;
  white-space: nowrap;
}

/* ---------- FASE FINAL ---------- */
.lista-finais {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  padding: 18px;
}
.card-final {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-borda);
  border-left: 4px solid var(--ouro);
  border-radius: 12px;
  padding: 15px 16px;
}
.card-final-grande {
  border: 1px solid rgba(244, 196, 48, 0.5);
  border-left: 4px solid var(--ouro);
  background: linear-gradient(135deg, rgba(244,196,48,0.12), rgba(244,196,48,0.03));
  box-shadow: 0 10px 30px rgba(244, 196, 48, 0.15);
}
.cf-rotulo {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ouro-claro);
  font-weight: 800;
  margin-bottom: 12px;
}
.cf-confronto { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.cf-time { font-size: 16px; font-weight: 700; color: var(--texto); }
.cf-time:first-child { text-align: right; }
.cf-time:last-child { text-align: left; }
.cf-time.venc { color: var(--verde); font-weight: 900; }
.mm-placar {
  background: var(--ouro-grad);
  color: #2a1c00;
  font-weight: 900;
  padding: 5px 12px;
  border-radius: 8px;
  white-space: nowrap;
  font-size: 15px;
}
.mm-placar.vazio-p { background: rgba(255,255,255,0.10); color: var(--texto-suave); font-weight: 700; }
.detalhes-sets {
  margin-top: 12px;
  text-align: center;
  font-size: 13px;
  color: var(--texto);
  background: rgba(255,255,255,0.06);
  padding: 5px 12px;
  border-radius: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.detalhes-sets.pendente { background: transparent; color: var(--texto-suave); font-style: italic; font-weight: 600; }

/* ---------- DESAFIO / LOGIN ---------- */
.desafio-wrap { max-width: 460px; margin: 0 auto; padding: 30px 16px 10px; }
.desafio-carregando {
  text-align: center;
  color: var(--texto-suave);
  font-weight: 700;
  padding: 60px 0;
}
.auth-card {
  background: var(--card);
  border: 1px solid var(--card-borda);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  backdrop-filter: blur(6px);
  padding: 32px 26px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.auth-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--ouro-grad);
}
.auth-cadeado { font-size: 40px; line-height: 1; margin-bottom: 8px; }
.auth-titulo { font-size: 26px; margin: 0 0 6px; color: var(--ouro-claro); }
.auth-sub { font-size: 14px; color: var(--texto-suave); margin: 0 0 22px; line-height: 1.6; }
.auth-sub strong { color: var(--texto); }
.auth-form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.auth-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--texto-suave);
}
.auth-label input {
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--texto);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-borda);
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.auth-label input:focus {
  outline: none;
  border-color: var(--ouro);
  background: rgba(255, 255, 255, 0.09);
}
.auth-label input::placeholder { color: rgba(237, 239, 247, 0.35); }
.auth-erro {
  background: rgba(255, 90, 90, 0.12);
  border: 1px solid rgba(255, 90, 90, 0.4);
  color: #ffc9c9;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 10px;
  text-align: center;
}
.auth-btn {
  font-family: 'Montserrat', sans-serif;
  margin-top: 4px;
  background: var(--ouro-grad);
  color: #2a1c00;
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border: none;
  border-radius: 30px;
  padding: 13px 20px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(244, 196, 48, 0.3);
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.auth-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(244, 196, 48, 0.42); }
.auth-btn:disabled { opacity: 0.6; cursor: default; }
.auth-troca { font-size: 13px; color: var(--texto-suave); margin: 16px 0 0; font-weight: 600; }
.auth-troca a { color: var(--ouro); text-decoration: none; font-weight: 800; }
.auth-troca a:hover { text-decoration: underline; }

/* Barra do usuário logado */
.desafio-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.desafio-user {
  font-size: 13px;
  font-weight: 700;
  color: var(--texto-suave);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-sair {
  flex-shrink: 0;
  font-family: 'Montserrat', sans-serif;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-borda);
  color: var(--texto);
  font-weight: 800;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-sair:hover { background: rgba(255, 90, 90, 0.15); border-color: rgba(255, 90, 90, 0.4); }

/* Indicador de logado no menu */
nav a[data-aba="desafio"].logado::after {
  content: "●";
  color: var(--verde);
  font-size: 9px;
  vertical-align: middle;
  margin-left: 5px;
}

/* ---------- FOOTER ---------- */
footer {
  border-top: 1px solid rgba(244, 196, 48, 0.2);
  color: var(--texto-suave);
  text-align: center;
  padding: 26px 20px;
  font-size: 14px;
  font-weight: 600;
}
footer a { color: var(--ouro); text-decoration: none; font-weight: 800; }

/* ---------- RESPONSIVO ---------- */
@media (max-width: 620px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .jogo-time { font-size: 13px; }
  .cf-time { font-size: 14px; }
  nav a { font-size: 12px; padding: 8px 12px; margin: 3px; }
  .hero { padding: 44px 16px 56px; }
}
