/* Máquina do sorteio (sala e painel). Os tamanhos seguem a largura do bloco em volta
   (container queries), então a mesma roleta serve no player, em tela cheia e no telão. */

.roleta {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  justify-items: center;
  gap: clamp(8px, 2cqw, 28px);
  width: 100%;
  height: 100%;
  padding: clamp(14px, 3.4cqw, 56px) clamp(14px, 4cqw, 64px);
  overflow: hidden;
  color: #fff;
  text-align: center;
  font-family: var(--fonte, 'Figtree', system-ui, sans-serif);
}

.roleta-topo {
  display: grid;
  justify-items: center;
  gap: clamp(4px, 0.8cqw, 12px);
}

.roleta-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(251, 206, 0, 0.16);
  box-shadow: inset 0 0 0 1px rgba(251, 206, 0, 0.45);
  color: #ffe169;
  font-size: clamp(10px, 1.2cqw, 15px);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.roleta-chip svg {
  width: 1.3em;
  height: 1.3em;
}

.roleta h3.roleta-titulo {
  margin: 0;
  color: #fff;
  font-size: clamp(18px, 3.6cqw, 54px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.roleta-sub {
  margin: 0;
  font-size: clamp(11px, 1.4cqw, 18px);
  color: rgba(255, 255, 255, 0.7);
}

/* Janela e resultado ocupam o mesmo lugar: a fita para, some, e o ganhador aparece grande. */
.roleta-janela,
.roleta-vencedor {
  grid-row: 2;
  grid-column: 1;
  align-self: center;
}

.roleta-janela {
  --linha-roleta: clamp(40px, 7.4cqw, 104px);
  position: relative;
  width: min(100%, 860px);
  height: calc(var(--linha-roleta) * 3);
  overflow: hidden;
  border-radius: clamp(12px, 1.6cqw, 22px);
  background: rgba(0, 10, 40, 0.55);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 30px 60px -30px rgba(0, 0, 0, 0.9);
  -webkit-mask: linear-gradient(transparent, #000 28%, #000 72%, transparent);
  mask: linear-gradient(transparent, #000 28%, #000 72%, transparent);
  transition: opacity 0.5s 1.1s, transform 0.6s 1.1s var(--suave, ease);
}

.roleta-fita {
  margin: 0;
  padding: 0;
  list-style: none;
  will-change: transform;
}

.roleta-fita li {
  display: grid;
  place-items: center;
  height: var(--linha-roleta);
  padding: 0 16px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: clamp(16px, 3.4cqw, 50px);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.82);
}

.girando-fita .roleta-fita li {
  filter: blur(0.6px);
}

.roleta-mira {
  position: absolute;
  inset: calc(var(--linha-roleta)) 10px;
  border-radius: 14px;
  box-shadow:
    inset 0 0 0 2px #1fa6ea,
    0 0 40px rgba(31, 166, 234, 0.45);
  pointer-events: none;
}

.roleta.parou .roleta-janela {
  opacity: 0;
  transform: scale(0.94);
  pointer-events: none; /* invisível, mas por cima do ganhador: sem isto o "Estou aqui!" não recebe o clique */
}

.roleta-vencedor {
  display: grid;
  justify-items: center;
  gap: clamp(4px, 0.9cqw, 14px);
  opacity: 0;
  transform: translateY(18px) scale(0.92);
  pointer-events: none;
  transition:
    opacity 0.6s 1.3s,
    transform 0.8s 1.3s var(--mola, cubic-bezier(0.34, 1.56, 0.64, 1));
}

.roleta.parou .roleta-vencedor {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.roleta-vencedor small {
  font-size: clamp(11px, 1.5cqw, 20px);
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #ffe169;
}

.roleta-vencedor b {
  max-width: 100%;
  font-size: clamp(26px, 6.6cqw, 104px);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-wrap: balance;
  background: linear-gradient(180deg, #fff 30%, #b9e6ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.roleta-vencedor > span {
  font-size: clamp(13px, 2cqw, 28px);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
}

.roleta-eu {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-top: clamp(6px, 1.2cqw, 18px);
  padding: clamp(10px, 1.6cqw, 20px) clamp(14px, 2.4cqw, 30px);
  border-radius: 16px;
  background: rgba(251, 206, 0, 0.14);
  box-shadow: inset 0 0 0 1px rgba(251, 206, 0, 0.5);
  font-size: clamp(13px, 1.8cqw, 22px);
  font-weight: 700;
}

.roleta-eu p {
  margin: 0;
}

.roleta-confirmado {
  margin: 6px 0 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(46, 204, 113, 0.18);
  color: #8ff0b6;
  font-size: clamp(11px, 1.4cqw, 16px);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Confete */
.confete {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.confete i {
  position: absolute;
  top: -12px;
  left: var(--x);
  width: 9px;
  height: 14px;
  border-radius: 2px;
  background: var(--cor);
  opacity: 0;
  animation: cair var(--dur) cubic-bezier(0.25, 0.6, 0.4, 1) calc(1.2s + var(--atraso)) forwards;
}

@keyframes cair {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotate(0);
  }
  100% {
    opacity: 0.9;
    transform: translate3d(var(--deriva), 110cqh, 0) rotate(var(--giro));
  }
}

@supports not (height: 1cqh) {
  @keyframes cair {
    100% {
      opacity: 0;
      transform: translate3d(var(--deriva), 600px, 0) rotate(var(--giro));
    }
  }
}
