/* ============================================================
   effects.css — raios, clarões e estados elétricos
   ============================================================ */

/* Camada dos raios: cobre a viewport inteira, nunca captura clique */
.fx-bolts {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 60;
  pointer-events: none;
}

.bolt-glow {
  fill: none;
  stroke: #a855f7;
  stroke-width: 13;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: blur(7px);
  opacity: .85;
}
.bolt-mid {
  fill: none;
  stroke: #d8b4fe;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: blur(2px);
}
.bolt-core {
  fill: none;
  stroke: #ffffff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bolt-branch { opacity: .7; }

/* Clarão de tela */
.fx-flash {
  position: fixed;
  inset: 0;
  z-index: 55;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(70% 50% at 50% 20%, rgba(216, 180, 254, .85), transparent 70%),
    rgba(168, 85, 247, .35);
}

/* Tremor curto quando o raio acerta o tabuleiro */
.shake { animation: shake .34s cubic-bezier(.36,.07,.19,.97); }
@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 1px, 0); }
  30%, 50%, 70% { transform: translate3d(-3px, -1px, 0); }
  40%, 60% { transform: translate3d(3px, 1px, 0); }
}

/* ---------------- Casa eletrificada ---------------- */

.cell.lucky {
  border-color: var(--gold-1);
  color: #fff;
  background: linear-gradient(180deg, #6b3ba8, #35145e);
  box-shadow:
    0 0 0 1px var(--gold-2),
    0 0 26px rgba(245, 196, 81, .6),
    inset 0 0 22px rgba(168, 85, 247, .7);
  animation: luckyCharge 1.8s ease-in-out infinite;
  z-index: 3;
}
@keyframes luckyCharge {
  0%, 100% { box-shadow: 0 0 0 1px var(--gold-2), 0 0 22px rgba(245,196,81,.45), inset 0 0 18px rgba(168,85,247,.6); }
  50%      { box-shadow: 0 0 0 1px var(--gold-1), 0 0 40px rgba(245,196,81,.85), inset 0 0 30px rgba(168,85,247,.9); }
}

/* Selo do multiplicador: fica dentro da casa (o número sobe via padding),
   assim nenhuma linha do tabuleiro é invadida nem reposicionada. */
.cell.lucky { padding-bottom: 15px; }

.mult {
  position: absolute;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  padding: 2px 9px;
  border-radius: 999px;
  font-family: var(--font-num);
  font-size: clamp(10px, 1.15vw, 13px);
  font-weight: 700;
  letter-spacing: .04em;
  color: #2a1a00;
  white-space: nowrap;
  background: linear-gradient(180deg, #fff7d2, var(--gold-2) 55%, var(--gold-3));
  box-shadow: 0 0 16px rgba(245, 196, 81, .9);
  animation: multPop .45s cubic-bezier(.2,.9,.3,1.6);
  z-index: 4;
}
@keyframes multPop {
  from { transform: translateX(-50%) scale(.2); opacity: 0; }
  60%  { transform: translateX(-50%) scale(1.25); opacity: 1; }
  to   { transform: translateX(-50%) scale(1); opacity: 1; }
}

/* Estouro branco no instante do impacto */
.cell.struck::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 10px;
  background: radial-gradient(50% 50% at 50% 50%, #fff, rgba(216,180,254,.6) 45%, transparent 72%);
  animation: strikeBurst .45s ease-out forwards;
  pointer-events: none;
}
@keyframes strikeBurst {
  from { opacity: 1; transform: scale(.6); }
  to   { opacity: 0; transform: scale(1.9); }
}

/* ---------------- Bolsão premiado na roda ---------------- */

#wheel #winGlow { opacity: 0; transition: opacity .25s ease; }
#wheel #winGlow.on { opacity: 1; animation: winPulse 1.15s ease-in-out infinite; }
@keyframes winPulse {
  0%, 100% { opacity: .6; }
  50%      { opacity: 1; }
}

#wheel .lucky-pocket { animation: pocketCharge 1.6s ease-in-out infinite; }
@keyframes pocketCharge {
  0%, 100% { opacity: .45; }
  50%      { opacity: .95; }
}

/* ---------------- Celebração do multiplicador ---------------- */

.mult-blast {
  position: fixed;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%);
  z-index: 70;
  pointer-events: none;
  text-align: center;
}
/* Escurece o fundo para o multiplicador não brigar com o painel */
.mult-blast::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(60% 45% at 50% 44%, rgba(8, 4, 18, .88), rgba(8, 4, 18, .5) 55%, transparent 80%);
  animation: scrimIn .35s ease-out;
}
@keyframes scrimIn { from { opacity: 0; } to { opacity: 1; } }
.mult-blast .mb-x {
  display: block;
  font-family: var(--font-num);
  font-size: clamp(80px, 17vw, 210px);
  font-weight: 800;
  line-height: .9;
  letter-spacing: .02em;
  background: linear-gradient(180deg, #fff 0%, var(--gold-1) 30%, var(--gold-2) 60%, var(--gold-3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter:
    drop-shadow(0 0 26px rgba(245, 196, 81, .95))
    drop-shadow(0 0 70px rgba(168, 85, 247, .8));
  animation: blastIn .6s cubic-bezier(.15,.9,.25,1.5);
}
.mult-blast .mb-cap {
  display: block;
  margin-top: 6px;
  font-size: clamp(11px, 1.5vw, 15px);
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--volt-1);
  text-shadow: 0 0 18px rgba(168,85,247,.9);
}
@keyframes blastIn {
  from { transform: scale(.3) rotate(-7deg); opacity: 0; }
  70%  { transform: scale(1.12) rotate(2deg); opacity: 1; }
  to   { transform: scale(1) rotate(0); opacity: 1; }
}
.mult-blast.out { animation: blastOut .5s ease-in forwards; }
@keyframes blastOut {
  to { opacity: 0; transform: translate(-50%, -62%) scale(1.15); }
}

/* ---------------- Preferência por menos movimento ---------------- */

@media (prefers-reduced-motion: reduce) {
  .studio-glow, .brand-bolt, .btn-main::after,
  .cell.lucky, .timer-bolt, #wheel .lucky-pocket { animation: none !important; }
  .shake { animation: none !important; }
}
