/* ============================================================
   SORTEADOR PRO - Estilos Globais
   Versão: 2.0 (Otimizado para Firebase + Monetização)
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  min-height: 100dvh; /* mobile viewport */
  margin: 0;
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: radial-gradient(circle at 50% 0%, #1e1b4b 0%, #0a0b10 50%, #030408 100%);
  font-family: 'Inter', sans-serif;
  display: flex;
  flex-direction: column;
}

/* --- Glass Panel --- */
.glass-panel {
  background: rgba(18, 19, 32, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 1.5rem;
  box-sizing: border-box;
  transition: all 0.3s ease;
}

/* --- Winners List (old placeholder - actual styles below) --- */
#presentation-modal {
  min-height: 100vh;
  justify-content: center;
}

.modal-number-frame {
  max-height: 55vh;
  min-height: 20rem;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(8, 10, 20, 0.88);
  backdrop-filter: blur(18px);
  border-radius: 2.5rem;
  padding: 2rem 1.75rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.modal-number-frame h2 {
  word-break: break-word;
  white-space: pre-wrap;
  color: #ecfdf5;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

#modal-icon-container {
  width: 4.75rem;
  height: 4.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

#modal-icon-container i {
  color: #fbbf24;
}

/* --- Shuffle Text (Modal) --- */
#modal-shuffle-text {
  font-size: clamp(2rem, 7vw, 5.5rem);
  word-break: normal;
  overflow-wrap: break-word;
  white-space: normal;
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  transition: all 0.15s ease;
  line-height: 1.05;
}

/* --- Scrollbar verde para Mega-Sena (aplicada via JS inline) --- */
#modal-shuffle-text.mega-scroll::-webkit-scrollbar { width: 6px; }
#modal-shuffle-text.mega-scroll::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); border-radius: 4px; }
#modal-shuffle-text.mega-scroll::-webkit-scrollbar-thumb { background: rgba(0, 166, 81, 0.5); border-radius: 4px; }
#modal-shuffle-text.mega-scroll::-webkit-scrollbar-thumb:hover { background: rgba(0, 166, 81, 0.7); }
#modal-shuffle-text.mega-scroll { scrollbar-width: thin; scrollbar-color: rgba(0,166,81,0.5) rgba(255,255,255,0.05); }

.modal-result-name {
  display: inline-flex;
  white-space: nowrap;
}

/* ============================================================
   ANIMAÇÕES DO SORTEIO (Nível Profissional)
   ============================================================ */

/* --- Winner Glow (pulsação dourada) --- */
@keyframes winner-glow {
  0% {
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.3);
    border-color: rgba(251, 191, 36, 0.3);
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(251, 191, 36, 0.7);
    border-color: rgba(251, 191, 36, 0.9);
    text-shadow: 0 0 25px rgba(251, 191, 36, 0.6);
  }
  100% {
    box-shadow: 0 0 25px rgba(251, 191, 36, 0.5);
    border-color: rgba(251, 191, 36, 0.6);
    text-shadow: 0 0 15px rgba(251, 191, 36, 0.4);
  }
}
.animate-winner {
  animation: winner-glow 1.2s infinite alternate ease-in-out;
}

/* --- Shuffle Blur (roleta) --- */
.roulette-blur {
  filter: blur(3px);
  transform: scale(0.92);
  opacity: 0.5;
  transition: all 0.08s ease-in-out;
}

/* --- Shuffle Intenso (variação rápida) --- */
@keyframes shuffle-intensity {
  0% { transform: scale(0.9) rotate(-1deg); filter: blur(4px); opacity: 0.4; }
  25% { transform: scale(1.05) rotate(0.5deg); filter: blur(2px); opacity: 0.7; }
  50% { transform: scale(0.95) rotate(-0.5deg); filter: blur(3px); opacity: 0.5; }
  75% { transform: scale(1.02) rotate(0.3deg); filter: blur(1px); opacity: 0.8; }
  100% { transform: scale(0.9) rotate(-1deg); filter: blur(4px); opacity: 0.4; }
}
.shuffle-intense {
  animation: shuffle-intensity 0.3s infinite alternate ease-in-out;
}

/* --- Slowdown (desaceleração) --- */
@keyframes shuffle-slowdown {
  0% { transform: scale(0.95) rotate(-0.3deg); filter: blur(2px); opacity: 0.6; }
  100% { transform: scale(1) rotate(0deg); filter: blur(0px); opacity: 1; }
}
.shuffle-slowdown {
  animation: shuffle-slowdown 0.8s ease-out forwards;
}

/* --- Flash de Luz (no momento do resultado) --- */
@keyframes result-flash {
  0% { background-color: rgba(251, 191, 36, 0); }
  30% { background-color: rgba(251, 191, 36, 0.15); }
  60% { background-color: rgba(139, 92, 246, 0.1); }
  100% { background-color: transparent; }
}
.result-flash {
  animation: result-flash 0.8s ease-out;
}

/* --- Pulse do Background do Modal --- */
@keyframes modal-bg-pulse {
  0% { opacity: 0.15; transform: scale(1); }
  50% { opacity: 0.25; transform: scale(1.1); }
  100% { opacity: 0.15; transform: scale(1); }
}
.modal-bg-pulse {
  animation: modal-bg-pulse 2s ease-in-out infinite;
}

/* --- Countdown Pulse --- */
@keyframes countdown-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.8; }
}
.countdown-pulse {
  animation: countdown-pulse 0.5s ease-in-out;
}

/* --- Fade In para elementos do resultado --- */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in-up {
  animation: fade-in-up 0.5s ease-out forwards;
}

/* --- Bounce suave para botão --- */
@keyframes gentle-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
.gentle-bounce {
  animation: gentle-bounce 1s ease-in-out infinite;
}

/* --- Scale reveal para o hash --- */
@keyframes scale-reveal {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.scale-reveal {
  animation: scale-reveal 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* --- Winner Card Individual --- */
@keyframes winner-card-enter {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.winner-card-enter {
  animation: winner-card-enter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* --- Advertising --- */
.ads-container {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.25);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: all 0.3s ease;
  position: relative;
  padding: 0.5rem 1rem;
}
.ads-container::before { content: 'Publicidade'; font-weight: 500; }
.drag-active { border-color: #8b5cf6 !important; background-color: rgba(139, 92, 246, 0.08) !important; }

/* --- Aba Personalizada --- */
.tab-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  width: 100%;
  min-width: 5rem;
  padding: 1rem 0.9rem;
  border-radius: 1.75rem;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(12, 14, 25, 0.92);
  color: #e2e8f0;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
  text-align: center;
  min-height: 8rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 18px 35px rgba(0,0,0,0.22);
  position: relative;
}

.tab-option:hover {
  transform: translateY(-1px);
  border-color: rgba(139, 92, 246, 0.65);
  background: rgba(255, 255, 255, 0.08);
}

.tab-option.tab-option-active {
  background: linear-gradient(180deg, rgba(94, 34, 195, 0.22), rgba(142, 69, 252, 0.16));
  border-color: rgba(139, 92, 246, 0.6);
  color: #ffffff;
  box-shadow: 0 20px 35px rgba(58, 7, 134, 0.18);
}

/* Tema Mega-Sena (Verde oficial) quando a tab está ativa */
.tab-option.tab-option-active.tab-theme-mega {
  background: linear-gradient(180deg, rgba(0, 154, 68, 0.30), rgba(0, 166, 81, 0.20));
  border-color: rgba(0, 166, 81, 0.65);
  color: #ffffff;
  box-shadow: 0 20px 35px rgba(0, 100, 40, 0.22);
}

.tab-option.tab-theme-mega:hover {
  border-color: rgba(0, 166, 81, 0.55);
  background: rgba(0, 166, 81, 0.1);
}

.tab-option.tab-option-active::after {
  content: '';
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.95);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.55);
}

.tab-option-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.tab-option.tab-option-active::after {
  content: '';
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.9);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.7);
}

.tab-option-icon-card {
  width: 4.2rem;
  height: 4.2rem;
  min-width: 4.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 2px 8px rgba(255,255,255,0.08), 0 18px 40px rgba(0,0,0,0.18);
}

.tab-option-icon-bg {
  width: 100%;
  height: 100%;
  border-radius: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: none;
  padding: 0.35rem;
}

.tab-option-icon-bg::before,
.tab-option-icon-bg::after {
  display: none;
}

.tab-option-icon-bg-numbers {
  background: radial-gradient(circle at top left, rgba(167, 139, 250, 0.8), rgba(79, 70, 229, 0.95)) !important;
}

.tab-option-icon-bg-list {
  background: radial-gradient(circle at top left, rgba(252, 211, 77, 0.9), rgba(234, 88, 12, 0.95)) !important;
}

.tab-option-icon-bg-mega {
  background: radial-gradient(circle at top left, #009a44, #00a651) !important;
}

.tab-option-icon-bg svg,
.tab-option-icon-bg .tab-option-svg {
  width: 2.6rem;
  height: 2.6rem;
  display: block;
  color: #ffffff;
}

.tab-option-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.tab-option-desc {
  font-size: 0.95rem;
  color: rgba(226, 232, 240, 0.78);
  margin-top: 0.35rem;
  line-height: 1.5;
  max-width: 16rem;
}

.tab-option.tab-option-active .tab-option-desc {
  color: rgba(255, 255, 255, 0.8);
}

/* --- Scrollbar Customizada --- */
.custom-scrollbar::-webkit-scrollbar { width: 6px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 3px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.25); }
.custom-scrollbar { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.15) transparent; }

/* --- Notification Bar --- */
.notification-bar {
  min-height: 3rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.85rem 1rem;
  margin: 0 auto 1rem;
  border-radius: 999px;
  font-size: 0.95rem;
  text-align: center;
  color: #e5e7eb;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease, transform 0.3s ease, max-height 0.3s ease, margin 0.3s ease;
  max-height: 100px;
  overflow: hidden;
}

.notification-bar.hidden {
  opacity: 0;
  transform: translateY(-10px);
  max-height: 0;
  margin: 0;
  padding: 0 1rem;
  pointer-events: none;
}

.notification-success {
  color: #d9f99d;
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.25);
}

.notification-error {
  color: #fecaca;
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.25);
}

/* --- Info Modal --- */
#info-modal {
  z-index: 62;
}

#info-modal .glass-panel {
  background: rgba(10, 11, 16, 0.92);
  border: 1px solid rgba(139, 92, 246, 0.18);
}

#info-modal-message {
  line-height: 1.6;
}

/* --- Winner Card no Modal --- */
.winner-card-modal {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 16px;
  padding: 1.5rem 2rem;
  box-shadow: 0 0 30px rgba(251, 191, 36, 0.15);
}

/* --- Responsividade do Modal --- */
@media (max-width: 640px) {
  #modal-shuffle-text {
    font-size: clamp(2rem, 12vw, 3.5rem);
  }
  .glass-panel {
    padding: 1rem;
    border-radius: 12px;
  }
}

/* --- Winner Card no Resultado --- */
.winner-result-card {
  width: 100% !important;
  min-width: 0;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  transition: all 0.3s ease;
}
.winner-result-card:hover {
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(0, 0, 0, 0.5);
}

/* --- Vencedores Container: Strict Vertical Stacking --- */
#vencedores-container {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  max-height: 400px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}
#vencedores-container > * {
  width: 100% !important;
  flex-shrink: 0;
}

/* --- Confetti Canvas Overlay --- */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
}
