/* ============================================================
   BASE — estrutura comum a todos os temas e estados da TV.
   Canvas de projeto fixo em 1920x1080 (16:9), escalado via
   transform para caber em qualquer tela (TV Android, monitor,
   celular em modo teste). Isso reproduz o comportamento real
   de telas de bingo: layout fixo, nunca responsivo de verdade.
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: 'Anton', 'Arial Narrow', sans-serif;
}

@font-face {
  font-family: 'Anton';
  src: local('Anton');
  font-display: swap;
}
@font-face {
  font-family: 'Solway';
  src: local('Solway');
  font-display: swap;
}

.stage {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1920px;
  height: 1080px;
  transform-origin: center center;
  transform: translate(-50%, -50%) scale(var(--escala, 1));
}

.tela {
  position: absolute;
  inset: 0;
  width: 1920px;
  height: 1080px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .5s ease;
}
.tela.ativa {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.bg-fundo {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.bg-fundo.escura { filter: brightness(.85); }

/* ---------- TELA 1: sorteio ao vivo ---------- */

.topo {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 56px;
  display: flex;
  align-items: center;
}
.valendo-bar {
  margin-left: 8px;
  padding: 8px 28px;
  font-size: 26px;
  letter-spacing: 1px;
  border-radius: 4px;
}
.versao {
  position: absolute;
  top: 6px; left: 6px;
  font-size: 12px;
  opacity: .6;
}

.ranking {
  position: absolute;
  top: 64px; left: 0;
  width: 560px;
  height: 1000px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.ranking-linha {
  display: grid;
  grid-template-columns: 1fr 90px 40px 40px 40px 40px;
  align-items: center;
  height: 34px;
  padding: 0 8px;
  font-size: 18px;
}
.ranking-linha span.num { text-align: center; }

.painel-central {
  position: absolute;
  top: 64px; left: 580px;
  width: 900px;
  height: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.bola-wrap {
  position: relative;
  width: 260px; height: 260px;
  margin-top: 20px;
}
.bola-img { width: 100%; height: 100%; object-fit: contain; }
.bola-numero {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 96px;
  color: #111;
}
.acumulado-box {
  margin-top: 18px;
  text-align: center;
}
.acumulado-label { font-size: 22px; letter-spacing: 2px; }
.acumulado-linha {
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: center;
  margin-top: 6px;
}
.bola-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px; height: 56px;
  font-size: 30px;
  border-radius: 6px;
}
.acumulado-valor { font-size: 54px; }
.sorteio-id { display: block; font-size: 16px; margin-top: 4px; opacity: .85; }
.logo-marca {
  width: 220px; height: 90px;
  margin-top: 10px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.historico-bolas {
  list-style: none;
  display: flex;
  gap: 14px;
  margin-top: 18px;
}
.historico-bolas li {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}
.historico-bolas li:first-child {
  width: 78px; height: 78px;
  font-size: 34px;
}

.premios-atual {
  display: flex;
  gap: 16px;
  margin-top: 22px;
}
.premio-chip {
  min-width: 190px;
  text-align: center;
  padding: 10px 18px;
  border-radius: 6px;
}
.premio-chip .premio-nome { display: block; font-size: 16px; letter-spacing: 1px; }
.premio-chip .premio-valor { display: block; font-size: 30px; margin-top: 4px; }

.grade-90 {
  position: absolute;
  top: 660px; left: 580px;
  width: 900px; height: 340px;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-auto-rows: 34px;
  gap: 2px;
  font-size: 18px;
  padding: 12px;
  border-radius: 6px;
}
.grade-90 span {
  display: flex;
  align-items: center;
  justify-content: center;
}
.grade-90 span.marcado { font-weight: bold; }

.cartelas-destaque {
  position: absolute;
  top: 64px; right: 0;
  width: 480px; height: 1000px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}
.cartela-card {
  border-radius: 6px;
  overflow: hidden;
}
.cartela-card-header {
  display: flex;
  justify-content: space-between;
  padding: 6px 12px;
  font-size: 18px;
}
.cartela-card-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 6px;
}
.cartela-card-grid span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  font-size: 20px;
}
.cartela-card-valor {
  text-align: center;
  font-size: 22px;
  padding: 6px;
}

/* ---------- TELA 2: próximos sorteios ---------- */

.contagem-box {
  position: absolute;
  top: 30px; right: 30px;
  width: 420px;
  padding: 20px;
  text-align: center;
  border-radius: 6px;
}
.contagem-label { display: block; font-size: 24px; }
.contagem-numero { display: block; font-size: 90px; line-height: 1; margin: 6px 0; }
.contagem-unidade { display: block; font-size: 26px; }

.sorteio-doacao-row {
  position: absolute;
  top: 260px; right: 30px;
  width: 420px;
  display: flex;
  gap: 4px;
}
.info-chip {
  flex: 1;
  text-align: center;
  padding: 10px;
  font-size: 16px;
}
.info-chip strong { display: block; font-size: 26px; margin-top: 4px; }

.titulo-proximos {
  position: absolute;
  top: 340px; left: 30px;
  font-size: 44px;
}
.tabela-proximos {
  position: absolute;
  top: 420px; left: 30px;
  width: 1450px;
  border-collapse: collapse;
  font-size: 22px;
}
.tabela-proximos th { text-align: left; padding: 6px 14px; font-size: 18px; }
.tabela-proximos td { padding: 10px 14px; }

/* ---------- TELA 3: ganhou ---------- */

.ganhou-box {
  position: absolute;
  top: 40px; left: 40px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ganhou-label { font-size: 54px; }
.ganhou-valor { font-size: 64px; }
.ganhou-sorteio { font-size: 26px; opacity: .8; }
.ganhou-nome { font-size: 48px; margin-top: 10px; }

/* ---------- TELA 4: posição do prêmio (card cheio) ---------- */

.posicao-card {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 220px;
  flex-wrap: wrap;
}
.posicao-sufixo { font-size: 90px; align-self: flex-start; margin-top: 30px; }
.posicao-texto { font-size: 140px; width: 100%; text-align: center; }

/* ---------- TELA 5: cartela vencedora ---------- */

.ganhadores-titulo {
  position: absolute;
  top: 30px; left: 0; right: 0;
  text-align: center;
  font-size: 46px;
}
.premio-cartela-header {
  position: absolute;
  top: 130px; left: 300px;
  display: flex;
  gap: 30px;
  font-size: 40px;
}
.cartela-vencedora {
  position: absolute;
  top: 220px; left: 460px;
  width: 1000px;
  border-radius: 6px;
  overflow: hidden;
  border: 6px solid;
}
.cartela-vencedora-topo {
  text-align: center;
  padding: 14px;
  font-size: 46px;
}
.cartela-vencedora-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
}
.cartela-vencedora-grid span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100px;
  font-size: 52px;
}
.cartela-vencedora-bar {
  position: absolute;
  top: 620px; left: 0; right: 0;
  text-align: center;
  font-size: 50px;
}

/* ---------- popup de cartela individual ---------- */

.popup-cartela {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  background: rgba(0,0,0,.55);
  transition: opacity .3s ease;
}
.popup-cartela.oculto { opacity: 0; visibility: hidden; pointer-events: none; }
.popup-cartela-caixa {
  width: 720px;
  border-radius: 10px;
  overflow: hidden;
  text-align: center;
}
.popup-cartela-selo { font-size: 60px; padding: 20px 0 6px; }
.popup-cartela-info {
  display: flex;
  justify-content: space-between;
  padding: 10px 24px;
  font-size: 24px;
}
.popup-cartela-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 0 20px;
}
.popup-cartela-grid span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 68px;
  font-size: 30px;
}
.popup-cartela-valor { font-size: 34px; padding: 16px; }

/* ---------- banner promocional ---------- */
.promo-conteudo {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
