@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;700;800;900&family=Fredoka+One&display=swap');

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #0b1220;
  color: #fff;
  padding: 10px;
  overflow-x: hidden;
  line-height: 1.5;
  font-family: 'Nunito', Arial, sans-serif;
}

body.tremendo {
  animation: tremerTela 1.4s ease-in-out;
}

@keyframes tremerTela {
  0%   { transform: translate(0, 0) rotate(0deg); }
  8%   { transform: translate(-10px, 5px) rotate(-0.6deg); }
  16%  { transform: translate(10px, -5px) rotate(0.6deg); }
  24%  { transform: translate(-12px, 6px) rotate(-0.7deg); }
  32%  { transform: translate(12px, -6px) rotate(0.7deg); }
  40%  { transform: translate(-9px, 4px) rotate(-0.5deg); }
  48%  { transform: translate(9px, -4px) rotate(0.5deg); }
  56%  { transform: translate(-7px, 3px) rotate(-0.4deg); }
  64%  { transform: translate(7px, -3px) rotate(0.4deg); }
  72%  { transform: translate(-5px, 2px) rotate(-0.3deg); }
  80%  { transform: translate(5px, -2px) rotate(0.3deg); }
  88%  { transform: translate(-3px, 1px) rotate(-0.2deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

.container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

/* ── HEADER ── */
.hero {
  margin-bottom: 16px;
  position: relative;
}

.hero-top {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.logo-wrap {
  flex-shrink: 0;
}

.logo-wrap img {
  max-width: 200px;
  width: 100%;
  height: auto;
  display: block;
}

.hero-text {
  flex: 1;
  min-width: 0;
}

.subtitulo {
  margin: 0 0 10px;
  font-size: clamp(15px, 1.6vw, 18px);
  color: #cbd5e1;
}

.language-switcher {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
}

.language-switcher a {
  text-decoration: none;
  color: #fff;
  background: #1f2937;
  border: 1px solid #334155;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  transition: 0.15s;
  font-family: 'Nunito', Arial, sans-serif;
}

.language-switcher a:hover,
.language-switcher a:focus {
  background: #253347;
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.language-switcher a.active {
  background: #38bdf8;
  color: #0b1220;
  border-color: #38bdf8;
}

h1 {
  font-size: 42px;
  margin: 0 0 10px;
  letter-spacing: 1px;
  font-family: 'Fredoka One', Arial, sans-serif;
}

.subtitulo {
  max-width: 1000px;
  margin: 0 auto;
  font-size: 18px;
  color: #cbd5e1;
  text-align: center;
}

/* ── LAYOUT TOPO ── */
.topo {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 16px;
  align-items: stretch;
  margin: 18px 0 16px;
}

.card,
.tabela-area,
.painel-controles,
.seo-bloco,
.seo-panel-wrap,
.historico-completo-wrap {
  background: #111827;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

/* ── NÚMERO ATUAL ── */
.resultado {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  min-height: 220px;
}

.letra-atual {
  font-size: clamp(72px, 8vw, 120px);
  font-weight: 900;
  line-height: 1;
  color: #38bdf8;
  font-family: 'Fredoka One', Arial, sans-serif;
}

.numero-atual {
  width: clamp(140px, 18vw, 220px);
  height: clamp(140px, 18vw, 220px);
  border-radius: 50%;
  background: #facc15;
  color: #111827;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(54px, 6vw, 86px);
  font-weight: 900;
  box-shadow: inset 0 -10px 0 rgba(0,0,0,0.15);
  font-family: 'Fredoka One', Arial, sans-serif;
}

.numero-atual.animar {
  animation: popNumero 0.45s ease;
}

@keyframes popNumero {
  0%   { transform: scale(0.7); }
  50%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* ── HISTÓRICO ÚLTIMOS 3 ── */
.historico h2,
.tabela-area h2,
.seo-bloco h2 {
  text-align: center;
  margin: 0 0 14px;
  font-size: clamp(22px, 2.2vw, 30px);
  font-family: 'Fredoka One', Arial, sans-serif;
}

.ultimos-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  height: calc(100% - 46px);
  align-items: center;
}

.mini-bola {
  background: #1f2937;
  border: 3px solid #334155;
  border-radius: 16px;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.mini-bola .mini-letra {
  font-size: clamp(28px, 3vw, 46px);
  font-weight: 900;
  color: #38bdf8;
  line-height: 1;
  font-family: 'Fredoka One', Arial, sans-serif;
}

.mini-bola .mini-numero {
  font-size: clamp(34px, 3.5vw, 54px);
  font-weight: 900;
  line-height: 1.1;
  font-family: 'Fredoka One', Arial, sans-serif;
}

.mini-vazio {
  opacity: 0.35;
}

/* ── STATUS / INFO ── */
.status-auto {
  text-align: center;
  font-size: 20px;
  margin-bottom: 14px;
  color: #93c5fd;
  min-height: 24px;
}

/* ── BANNER FIM DE JOGO ── */
.banner-fim {
  display: none;
  text-align: center;
  background: #22c55e;
  color: #fff;
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 800;
  padding: 14px 24px;
  border-radius: 14px;
  margin-bottom: 16px;
  animation: fadeInDown 0.4s ease;
  font-family: 'Fredoka One', Arial, sans-serif;
}

.banner-fim.visivel {
  display: block;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.info {
  text-align: center;
  font-size: clamp(20px, 2.4vw, 28px);
  margin-bottom: 14px;
}

/* ── TABELA ── */
.tabela-area {
  padding: 12px;
  margin-bottom: 18px;
  width: 100%;
  overflow: hidden;
}

table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0.35vw;
}

td {
  text-align: center;
  padding: 0.9vw 0.3vw;
  border-radius: 0.7vw;
  font-size: clamp(12px, 1.65vw, 28px);
  font-weight: 800;
  line-height: 1;
  font-family: 'Fredoka One', Arial, sans-serif;
}

.letra-lateral {
  width: 4.5%;
  background: #1e293b;
  color: #38bdf8;
  font-size: clamp(18px, 2.2vw, 38px);
  font-weight: 900;
  white-space: nowrap;
}

.celula-numero {
  background: #1f2937;
  color: #fff;
  border: 2px solid transparent;
  transition: 0.15s;
  width: 6.36%;
}

.sorteado {
  background: #facc15;
  color: #111827;
  border-color: #fff;
  transform: scale(1.02);
}

/* ── CONTROLES ── */
.painel-controles {
  margin-bottom: 18px;
}

.controles {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 16px;
}

button {
  border: none;
  border-radius: 12px;
  padding: 14px 20px;
  font-size: clamp(16px, 1.5vw, 22px);
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s;
  font-family: 'Nunito', Arial, sans-serif;
}

button:hover {
  transform: translateY(-2px);
  opacity: 0.95;
}

button:focus {
  outline: 3px solid #38bdf8;
  outline-offset: 2px;
}

.btn-sortear  { background: #22c55e; color: #fff; }
.btn-auto     { background: #3b82f6; color: #fff; }
.btn-parar    { background: #ef4444; color: #fff; display: none; }
.btn-reiniciar{ background: #f97316; color: #fff; }
.btn-cheia    { background: #8b5cf6; color: #fff; }
.btn-tremer   { background: #eab308; color: #111827; }
.btn-toggle-seo { background: #334155; color: #fff; }

.controle-tempo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: clamp(16px, 1.5vw, 22px);
  font-weight: 700;
}

.controle-tempo input {
  width: 110px;
  padding: 10px 12px;
  font-size: clamp(16px, 1.5vw, 22px);
  border-radius: 10px;
  border: none;
  outline: none;
  text-align: center;
  font-family: 'Nunito', Arial, sans-serif;
}

.controle-tempo input:focus {
  outline: 3px solid #38bdf8;
}

.atalhos {
  text-align: center;
  margin-top: 14px;
  font-size: 16px;
  color: #cbd5e1;
}

/* ── HISTÓRICO COMPLETO ── */
.historico-completo-wrap {
  margin-bottom: 18px;
}

.historico-completo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.historico-completo-titulo {
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 800;
  margin: 0;
  font-family: 'Fredoka One', Arial, sans-serif;
}

.historico-counter {
  color: #94a3b8;
  font-size: 16px;
  font-weight: 700;
}

.btn-toggle-historico {
  background: #1f2937;
  color: #cbd5e1;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid #334155;
  cursor: pointer;
  transition: 0.15s;
  font-family: 'Nunito', Arial, sans-serif;
}

.btn-toggle-historico:hover {
  background: #253347;
  transform: none;
}

.historico-completo-panel {
  display: none;
  margin-top: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.historico-completo-panel.aberto {
  display: flex;
}

.historico-vazio {
  color: #64748b;
  font-size: 16px;
}

.historico-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: #1f2937;
  border: 2px solid #334155;
  border-radius: 10px;
  padding: 6px 10px;
  min-width: 48px;
  line-height: 1.1;
}

.historico-chip.chip-recente {
  border-color: #facc15;
  background: #292416;
}

.chip-letra {
  font-size: 12px;
  font-weight: 900;
  color: #38bdf8;
  font-family: 'Fredoka One', Arial, sans-serif;
}

.chip-num {
  font-size: 18px;
  font-weight: 900;
  font-family: 'Fredoka One', Arial, sans-serif;
}

/* ── SEO PANEL ── */
.seo-panel-wrap {
  margin-top: 18px;
  margin-bottom: 18px;
}

.toggle-seo-wrap {
  text-align: center;
}

.seo-panel {
  display: none;
  margin-top: 20px;
}

.seo-panel.aberto {
  display: block;
}

.seo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.seo-bloco p,
.seo-bloco li {
  color: #dbe4f0;
  font-size: 18px;
}

.seo-bloco ul,
.seo-bloco ol {
  padding-left: 22px;
  margin: 0;
}

.faq-item {
  margin-bottom: 18px;
}

.faq-item h3 {
  margin: 0 0 8px;
  font-size: 22px;
  color: #f8fafc;
  font-family: 'Fredoka One', Arial, sans-serif;
}

/* ── FOOTER ── */
footer {
  text-align: center;
  color: #94a3b8;
  font-size: 16px;
  padding: 8px 0 14px;
}

/* ── ACESSIBILIDADE ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ── RESPONSIVO ── */
@media (max-width: 1200px) {
  .topo,
  .seo-grid {
    grid-template-columns: 1fr;
  }

  .resultado {
    min-height: auto;
  }

  .tabela-area {
    padding: 10px;
  }

  table {
    border-spacing: 0.4vw;
  }

  td {
    padding: 1vw 0.2vw;
    font-size: clamp(11px, 1.8vw, 24px);
  }
}

@media (max-width: 768px) {
  body {
    padding: 8px;
  }

  /* Header: empilha verticalmente e centraliza no mobile */
  .hero-top {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }

  .hero-text {
    width: 100%;
  }

  .logo-wrap img {
    max-width: 160px;
  }

  .subtitulo {
    font-size: 15px;
    text-align: center;
  }

  .language-switcher {
    justify-content: center;
  }

  /* Mantém 3 colunas no mobile em vez de empilhar */
  .ultimos-3 {
    grid-template-columns: repeat(3, 1fr);
    height: auto;
  }

  .mini-bola {
    min-height: 90px;
  }

  button {
    font-size: 18px;
    padding: 12px 16px;
  }

  .controle-tempo {
    font-size: 18px;
  }

  .controle-tempo input {
    font-size: 18px;
  }

  h1 {
    font-size: 34px;
  }

  .tabela-area {
    padding: 8px;
  }

  table {
    border-spacing: 0.5vw;
  }

  td {
    padding: 1.2vw 0.1vw;
    border-radius: 0.5vw;
    font-size: clamp(9px, 2vw, 18px);
  }

  .letra-lateral {
    font-size: clamp(12px, 2.2vw, 20px);
  }
}
