/* ============================================================
   layout.css — Estrutura geral da página
   ============================================================ */

/* ---------- HEADER ---------- */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--accent);
  letter-spacing: -0.5px;
}

.logo span {
  color: var(--gold);
}

/* ---------- NAV ---------- */
.nav {
  display: flex;
  gap: 6px;
}

.nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.nav-btn:hover {
  background: var(--surface2);
  color: var(--text);
}

.nav-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ---------- MAIN ---------- */
.main {
  max-width: 920px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* ---------- STATS BAR ---------- */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-md);
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
}

.stat-value.green  { color: var(--accent3); }
.stat-value.red    { color: var(--accent2); }
.stat-value.gold   { color: var(--gold);    }
.stat-value.purple { color: var(--accent);  }

/* ---------- SEÇÕES / ABAS ---------- */
.section {
  display: none;
}

.section.active {
  display: block;
}

/* ---------- GRADE DE NÚMEROS ---------- */
.numbers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 6px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.number-cell {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  user-select: none;
}

.number-cell.livre {
  background: var(--surface2);
  border-color: var(--border);
  color: var(--muted);
}

.number-cell.livre:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(124, 110, 240, 0.1);
}

.number-cell.vendido {
  background: rgba(224, 108, 117, 0.15);
  border-color: rgba(224, 108, 117, 0.4);
  color: var(--accent2);
}

.number-cell.sorteado {
  background: var(--gold);
  border-color: var(--gold);
  color: #2a1f00;
  animation: pulse-gold 1.5s ease infinite;
}

@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 0 0 0   rgba(240, 192, 96, 0.4); }
  50%       { box-shadow: 0 0 0 6px rgba(240, 192, 96, 0);   }
}

/* ---------- SORTEIO ---------- */
.sorteio-area {
  text-align: center;
  padding: 2rem 1rem;
}

.sorteio-hint {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 1rem;
}

.big-number {
  font-family: var(--font-display);
  font-size: 6rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
  margin: 1rem 0;
  text-shadow: 0 0 40px rgba(240, 192, 96, 0.3);
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.big-number.rolling {
  animation: roll 0.08s steps(1) infinite;
}

@keyframes roll {
  0%   { opacity: 1; }
  50%  { opacity: 0.5; }
  100% { opacity: 1; }
}

.winner-info {
  background: rgba(240, 192, 96, 0.08);
  border: 1px solid rgba(240, 192, 96, 0.3);
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
  margin-top: 1rem;
  display: none;
}

.winner-info.show {
  display: block;
}

.winner-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.winner-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
}

.winner-phone {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}

.sorteio-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* ---------- FORM ROWS ---------- */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

/* ---------- RESPONSIVO ---------- */
@media (max-width: 640px) {

  /* Header vira duas linhas no mobile */
  .header {
    height: auto;
    flex-direction: column;
    align-items: stretch;
    padding: 10px 1rem;
    gap: 8px;
  }

  .logo {
    font-size: 1.1rem;
  }

  /* Nav ocupa toda a largura e quebra em grid */
  .nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    width: 100%;
  }

  .nav-btn {
    padding: 7px 4px;
    font-size: 11px;
    text-align: center;
    justify-content: center;
  }

  /* Stats em 2 colunas */
  .stats-bar {
    grid-template-columns: 1fr 1fr;
  }

  .stat-value {
    font-size: 1.3rem;
  }

  /* Formulários em coluna única */
  .form-row {
    grid-template-columns: 1fr;
  }

  /* Número grande menor */
  .big-number {
    font-size: 4rem;
  }

  /* Grade de números menor */
  .numbers-grid {
    grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
    gap: 4px;
    max-height: 360px;
  }

  .number-cell {
    font-size: 11px;
    border-radius: 6px;
  }

  /* Main com menos padding */
  .main {
    padding: 1rem 0.75rem;
  }

  /* Card com menos padding */
  .card {
    padding: 1rem;
  }

  /* Sorteio */
  .sorteio-area {
    padding: 1rem 0.5rem;
  }

  .winner-name {
    font-size: 1.2rem;
  }

  /* Modal ocupa mais espaço */
  .modal {
    padding: 1.25rem;
  }

  .modal-num {
    font-size: 2.5rem;
  }

  /* Tabela — esconde coluna de telefone no mobile */
  .table .col-fone {
    display: none;
  }

  /* Toast menor */
  .toast-container {
    bottom: 1rem;
    right: 0.75rem;
    left: 0.75rem;
  }

  .toast {
    max-width: 100%;
  }
}
