/* ── Variáveis e Reset ─────────────────────────────────── */
:root {
  --verde: #3AAA35;
  --verde-escuro: #2d8429;
  --azul: #1B2F7A;
  --ouro: #F5C518;
  --bg-dark: #060d06;
  --card-dark: #0e1f0e;
  --card-border: #1a3a1a;
}

* { box-sizing: border-box; }

/* ── Fundos ────────────────────────────────────────────── */
.hero-bg {
  background: radial-gradient(ellipse at 20% 50%, #0d2d0d 0%, #060d06 60%),
              radial-gradient(ellipse at 80% 20%, #0a1f0a 0%, transparent 50%);
}

.cta-bg {
  background: radial-gradient(ellipse at center, #0d2d0d 0%, #060d06 70%);
}

/* ── Tipografia ────────────────────────────────────────── */
.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.5rem;
  color: white;
  letter-spacing: 0.05em;
  line-height: 1;
}

.section-title span { color: var(--verde); }

/* ── Glow ──────────────────────────────────────────────── */
.glow-verde {
  text-shadow: 0 0 30px rgba(58, 170, 53, 0.5),
               0 0 60px rgba(58, 170, 53, 0.2);
}

/* ── Botões ────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--verde);
  color: #fff;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.5rem 1.25rem;
  border-radius: 0.5rem;
  transition: all 0.2s;
  border: 2px solid var(--verde);
  text-decoration: none;
  cursor: pointer;
}
.btn-primary:hover {
  background: var(--verde-escuro);
  border-color: var(--verde-escuro);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(58, 170, 53, 0.35);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--verde);
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.5rem 1.25rem;
  border-radius: 0.5rem;
  border: 2px solid var(--verde);
  transition: all 0.2s;
  text-decoration: none;
  cursor: pointer;
}
.btn-outline:hover {
  background: rgba(58, 170, 53, 0.1);
  transform: translateY(-1px);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #dc2626;
  color: #fff;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  padding: 0.4rem 1rem;
  border-radius: 0.5rem;
  border: 2px solid #dc2626;
  transition: all 0.2s;
  text-decoration: none;
  cursor: pointer;
}
.btn-danger:hover { background: #b91c1c; }

.btn-sm {
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
}

/* ── Navbar ────────────────────────────────────────────── */
.nav-link {
  color: #9ca3af;
  font-family: 'Oswald', sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  transition: color 0.2s;
  text-decoration: none;
}
.nav-link:hover, .nav-link.active {
  color: var(--verde);
}

/* ── Cards ─────────────────────────────────────────────── */
.card-dark {
  background: var(--card-dark);
  border: 1px solid var(--card-border);
  border-radius: 0.75rem;
  padding: 1.25rem;
}

.card-jogo {
  background: #0a190a;
  border: 1px solid var(--card-border);
  border-radius: 0.75rem;
  padding: 0.875rem 1rem;
  transition: border-color 0.2s;
}
.card-jogo:hover { border-color: rgba(58, 170, 53, 0.4); }

.card-feature {
  background: var(--card-dark);
  border: 1px solid var(--card-border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.2s;
}
.card-feature:hover {
  border-color: var(--verde);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(58, 170, 53, 0.12);
}

.feature-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--verde);
  color: #fff;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

/* ── Pontuação ─────────────────────────────────────────── */
.pontuacao-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0a190a;
  border: 1px solid var(--card-border);
  border-radius: 0.625rem;
  padding: 0.875rem 1rem;
}

.pts-badge {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

/* ── Ranking ───────────────────────────────────────────── */
.ranking-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: #0a190a;
  border: 1px solid var(--card-border);
  border-radius: 0.625rem;
  transition: border-color 0.2s;
}
.ranking-row:hover { border-color: rgba(58, 170, 53, 0.3); }
.ranking-row.destaque {
  border-color: var(--verde);
  background: rgba(58, 170, 53, 0.06);
}
.ranking-pos {
  font-family: 'Oswald', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #6b7280;
  min-width: 2rem;
  text-align: center;
}
.ranking-pos.top1 { color: var(--ouro); }
.ranking-pos.top2 { color: #9ca3af; }
.ranking-pos.top3 { color: #cd7f32; }

/* ── Flash Messages ────────────────────────────────────── */
.flash-success { background: rgba(34, 197, 94, 0.15); border: 1px solid rgba(34, 197, 94, 0.4); color: #86efac; }
.flash-danger  { background: rgba(239, 68, 68, 0.15);  border: 1px solid rgba(239, 68, 68, 0.4);  color: #fca5a5; }
.flash-warning { background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.4); color: #fcd34d; }
.flash-info    { background: rgba(59, 130, 246, 0.15); border: 1px solid rgba(59, 130, 246, 0.4); color: #93c5fd; }

/* ── Formulários ───────────────────────────────────────── */
.form-input {
  width: 100%;
  background: #0a190a;
  border: 1px solid var(--card-border);
  border-radius: 0.5rem;
  padding: 0.625rem 0.875rem;
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  transition: border-color 0.2s;
  outline: none;
}
.form-input:focus { border-color: var(--verde); box-shadow: 0 0 0 3px rgba(58, 170, 53, 0.1); }
.form-input::placeholder { color: #4b5563; }

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #9ca3af;
  margin-bottom: 0.375rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Placar palpite ────────────────────────────────────── */
.placar-input {
  width: 3.5rem;
  text-align: center;
  font-family: 'Oswald', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  background: #060d06;
  border: 2px solid var(--card-border);
  border-radius: 0.5rem;
  color: white;
  padding: 0.25rem;
  transition: border-color 0.2s;
  outline: none;
}
.placar-input:focus { border-color: var(--verde); }

/* ── Badges de status ──────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.badge-verde   { background: rgba(58, 170, 53, 0.2); color: #4ade80; border: 1px solid rgba(58, 170, 53, 0.4); }
.badge-amarelo { background: rgba(245, 197, 24, 0.2); color: var(--ouro); border: 1px solid rgba(245, 197, 24, 0.4); }
.badge-vermelho { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); }
.badge-cinza   { background: rgba(107, 114, 128, 0.2); color: #9ca3af; border: 1px solid rgba(107, 114, 128, 0.4); }
.badge-azul    { background: rgba(27, 47, 122, 0.4); color: #93c5fd; border: 1px solid rgba(93, 131, 249, 0.4); }

/* ── Tabela Admin ──────────────────────────────────────── */
.admin-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table th {
  font-family: 'Oswald', sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7280;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--card-border);
}
.admin-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(26, 58, 26, 0.5);
  font-size: 0.875rem;
  color: #d1d5db;
}
.admin-table tr:hover td { background: rgba(58, 170, 53, 0.03); }

/* ── Sidebar Admin ─────────────────────────────────────── */
.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  border-radius: 0.5rem;
  color: #9ca3af;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
}
.admin-nav-item:hover, .admin-nav-item.active {
  background: rgba(58, 170, 53, 0.1);
  color: var(--verde);
}

/* ── Palpite card ──────────────────────────────────────── */
.palpite-card {
  background: var(--card-dark);
  border: 1px solid var(--card-border);
  border-radius: 1rem;
  padding: 1.25rem;
  transition: all 0.2s;
}
.palpite-card:hover { border-color: rgba(58, 170, 53, 0.4); }
.palpite-card.salvo { border-color: var(--verde); }
.palpite-card.bloqueado { opacity: 0.6; }

/* ── Scroll suave ──────────────────────────────────────── */
html { scroll-behavior: smooth; }

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #060d06; }
::-webkit-scrollbar-thumb { background: #1a3a1a; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--verde); }

/* ── Animações ─────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.3s ease forwards; }

@keyframes pulse-verde {
  0%, 100% { box-shadow: 0 0 0 0 rgba(58, 170, 53, 0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(58, 170, 53, 0); }
}
.pulse-verde { animation: pulse-verde 2s infinite; }

/* ── Mapa de jogos ─────────────────────────────────────── */
.fase-header {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem;
  color: var(--ouro);
  letter-spacing: 0.05em;
  border-bottom: 2px solid rgba(245, 197, 24, 0.2);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

/* ── PWA Safe Areas (iOS notch / home indicator) ───────────────────────── */
.safe-top    { padding-top:    env(safe-area-inset-top,    0px); }
.safe-bottom { padding-bottom: env(safe-area-inset-bottom, 0px); }

/* ── Bottom Navigation Mobile ──────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(4rem + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(6, 13, 6, 0.97);
  border-top: 1px solid var(--card-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: flex-start;
  justify-content: space-around;
  z-index: 40;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.6rem 0.5rem 0.4rem;
  color: #6b7280;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.15s;
  flex: 1;
  min-width: 0;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav-item:hover,
.bottom-nav-item.active {
  color: var(--verde);
}
.bottom-nav-item.active svg {
  filter: drop-shadow(0 0 4px rgba(58,170,53,0.6));
}

/* Empurra conteúdo acima da bottom nav no mobile */
@media (max-width: 639px) {
  .pb-bottom-nav { padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px)); }
}

/* ── Flag code badge (fallback quando SVG não existe) ──────────────────── */
.flag-code-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 58, 26, 0.6);
  border: 1px solid var(--card-border);
  border-radius: 0.25rem;
  color: #9ca3af;
  font-family: 'Oswald', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.1rem 0.35rem;
  flex-shrink: 0;
}

/* ── PWA Standalone mode tweaks ────────────────────────────────────────── */
@media (display-mode: standalone) {
  body { overscroll-behavior-y: none; }
  nav.sticky { padding-top: env(safe-area-inset-top, 0px); }
}

/* ── Touch targets maiores no mobile ───────────────────────────────────── */
@media (max-width: 639px) {
  .btn-primary, .btn-outline {
    min-height: 44px;
  }
  .form-input, select.form-input {
    min-height: 44px;
    font-size: 1rem; /* evita zoom automático no iOS */
  }
  .placar-input {
    width: 3.75rem;
    min-height: 52px;
    font-size: 1.75rem;
  }
}

/* ── Palpite card mobile melhorias ─────────────────────────────────────── */
@media (max-width: 639px) {
  .palpite-card {
    padding: 1rem;
  }
  .card-dark {
    padding: 1rem;
  }
}

/* ═══════════════════════════════════════════════════════════
   CARROSSEL DE PREMIAÇÕES
   ═══════════════════════════════════════════════════════════ */

/* Setas de navegação */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(58, 170, 53, 0.12);
  border: 1px solid rgba(58, 170, 53, 0.35);
  color: #3AAA35;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  font-size: 1.6rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
  user-select: none;
}
.carousel-arrow:hover  { background: rgba(58, 170, 53, 0.28); }
.carousel-arrow-left  { left: 0; }
.carousel-arrow-right { right: 0; }

/* Card do sorteio dentro do carrossel */
.sorteio-carousel-card {
  background: #0e1f0e;
  border: 1px solid #1a3a1a;
  border-radius: 1rem;
  padding: 1.5rem;
}

/* Grid dos prêmios dentro do carrossel */
.premios-carousel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

/* Card individual de prêmio */
.premio-carousel-card {
  background: #0a190a;
  border: 1px solid #1a3a1a;
  border-radius: 0.875rem;
  padding: 0.875rem;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s;
}
.premio-carousel-card:hover { transform: translateY(-3px); }

.premio-ouro  { border-color: rgba(245, 197, 24, 0.45); box-shadow: 0 0 16px rgba(245,197,24,0.08); }
.premio-prata { border-color: rgba(148, 163, 184, 0.35); }
.premio-bronze{ border-color: rgba(180, 100, 40, 0.35); }

/* Wrapper da moldura da imagem */
.premio-frame-wrapper {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 0 auto 0.625rem;
}

/* Imagem do prêmio */
.premio-frame-img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 0.625rem;
  border: 2px solid #1a3a1a;
}
.premio-ouro  .premio-frame-img { border-color: #F5C518; box-shadow: 0 0 14px rgba(245,197,24,0.35); }
.premio-prata .premio-frame-img { border-color: #94a3b8; }
.premio-bronze .premio-frame-img { border-color: #b46428; }

/* Placeholder quando sem imagem */
.premio-frame-placeholder {
  width: 88px;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.75rem;
  background: #1a3a1a;
  border-radius: 0.625rem;
  border: 2px solid #243a24;
}

/* Badge de posição (canto inferior direito) */
.pos-badge {
  position: absolute;
  bottom: -7px;
  right: -7px;
  font-family: 'Oswald', sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0e1f0e;
  border: 1px solid #1a3a1a;
}
.pos-badge-ouro   { color: #F5C518; border-color: rgba(245,197,24,0.5); }
.pos-badge-prata  { color: #94a3b8; }
.pos-badge-bronze { color: #b46428; }

/* Informações do prêmio */
.premio-card-info { padding-top: 0.375rem; }

/* Dots de paginação */
.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1a3a1a;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  padding: 0;
}
.carousel-dot:hover         { background: #2d5a2d; }
.carousel-dot-active        { background: #3AAA35; transform: scale(1.3); }

/* Responsivo mobile */
@media (max-width: 639px) {
  .premios-carousel-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
  }
  .premio-frame-wrapper,
  .premio-frame-img,
  .premio-frame-placeholder {
    width: 72px;
    height: 72px;
  }
  .sorteio-carousel-card { padding: 1rem; }
}

/* ═══════════════════════════════════════════════════════════
   ADMIN — RESPONSIVIDADE MOBILE
   ═══════════════════════════════════════════════════════════ */

/* Impede scroll horizontal a nível de página */
@media (max-width: 639px) {
  /* overflow-x: hidden só no body — no html bloqueia scroll vertical no iOS */
  html { max-width: 100vw; }
  body { overflow-x: hidden; max-width: 100vw; }

  /* Content area admin */
  #admin-main { max-width: 100vw; overflow-x: hidden; }

  /* Todos os containers admin limitados à largura da tela */
  .max-w-5xl.mx-auto, .max-w-7xl.mx-auto,
  .max-w-6xl.mx-auto, .max-w-4xl.mx-auto {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
    max-width: 100vw !important;
  }

  /* Tabelas: NÃO forçam scroll horizontal — texto pode quebrar normalmente */
  table { width: 100%; max-width: 100%; table-layout: auto; }
  table th { padding: 0.5rem 0.5rem !important; font-size: 0.7rem !important; }
  table td { padding: 0.5rem 0.5rem !important; font-size: 0.75rem !important; word-break: break-word; }

  /* Containers de tabela: scroll interno (não propaga para a página) */
  .overflow-x-auto {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  /* Cards admin: padding reduzido */
  .card-dark { padding: 0.75rem; }

  /* Grids: 3/4 cols → 2 cols no mobile */
  .grid-cols-3, .grid-cols-4 { grid-template-columns: repeat(2, 1fr) !important; }

  /* KPI cards menores no mobile */
  .card-dark .text-3xl.font-bebas { font-size: 1.75rem; }

  /* Modais/overlays: largura máxima no mobile */
  .fixed.inset-0 > div[class*="max-w"] {
    max-width: calc(100vw - 1rem) !important;
    margin: auto;
  }

  /* Formulários de filtro: empilha em coluna */
  .card-dark form.flex.flex-wrap { flex-direction: column; gap: 0.5rem; }
  .card-dark form.flex.flex-wrap .form-input,
  .card-dark form.flex.flex-wrap input,
  .card-dark form.flex.flex-wrap select { max-width: 100% !important; width: 100% !important; }

  /* Botões de ação: texto menor */
  .btn-sm { padding: 0.2rem 0.5rem; font-size: 0.7rem; }

  /* Oculta colunas secundárias de tabela no mobile */
  .col-hide-mobile { display: none !important; }

  /* Células que DEVEM ter nowrap no mobile (datas curtas, badges) */
  .nowrap-mobile { white-space: nowrap !important; }
}

/* Utilitários de visibilidade de coluna (fora do media query para clareza) */
@media (max-width: 639px)  { .col-hide-mobile      { display: none !important; } }
@media (min-width: 640px)  { .col-show-mobile-only  { display: none !important; } }

/* Scroll horizontal suave em todas as larguras */
.overflow-x-auto {
  scrollbar-width: thin;
  scrollbar-color: #1a3a1a transparent;
}
.overflow-x-auto::-webkit-scrollbar { height: 4px; }
.overflow-x-auto::-webkit-scrollbar-thumb { background: #1a3a1a; border-radius: 2px; }
