/* ===========================
   SORTEADOR - ESTILOS ÉPICOS
   =========================== */

.sorteador-body {
  overflow-x: hidden;
}

.sorteador-page {
  min-height: 100vh;
}

.sorteador-header {
  margin-bottom: 24px;
}

.sorteador-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===========================
   PAINEL DE CONTROLE
   =========================== */

.control-panel {
  margin-bottom: 32px;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.control-item label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.control-select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.control-select:hover {
  border-color: var(--accent-primary);
}

.control-select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.1);
}

.status-badge {
  display: inline-block;
  padding: 12px 20px;
  background: var(--gradient-success);
  color: white;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1rem;
}

.action-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.mega-btn {
  flex: 1;
  min-width: 250px;
  padding: 20px 40px;
  font-size: 1.4rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  position: relative;
  overflow: hidden;
}

.mega-btn:not(:disabled) {
  animation: pulse-glow 2s ease-in-out infinite;
}

.mega-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
  }
  50% {
    box-shadow: 0 0 40px rgba(251, 191, 36, 0.8), 0 0 60px rgba(251, 191, 36, 0.4);
  }
}

.secondary-btn {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
}

.control-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
}

/* ===========================
   TOGGLE SWITCH
   =========================== */

.toggle-switch {
  position: relative;
  display: inline-block;
}

.toggle-switch input {
  display: none;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 12px 20px;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.toggle-label::before {
  content: '';
  width: 50px;
  height: 26px;
  background: #cbd5e1;
  border-radius: 13px;
  position: relative;
  transition: all 0.3s ease;
}

.toggle-label::after {
  content: '';
  width: 22px;
  height: 22px;
  background: white;
  border-radius: 50%;
  position: absolute;
  left: 22px;
  top: 14px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .toggle-label::before {
  background: var(--gradient-success);
}

input:checked + .toggle-label::after {
  left: 44px;
}

.toggle-text {
  font-weight: 600;
  color: var(--text-primary);
}

/* ===========================
   ÁREA DO SORTEADOR
   =========================== */

.sorteador-container {
  margin-bottom: 32px;
}

.sorteador-stage {
  position: relative;
  min-height: 600px;
  background: var(--bg-card);
  border-radius: 24px;
  padding: 40px;
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--border-color);
  overflow: hidden;
}

.sorteador-stage::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--gradient-festive);
}

.sorteador-mode {
  display: none;
  justify-content: center;
  align-items: center;
  min-height: 500px;
}

.sorteador-mode.active {
  display: flex;
}

/* ===========================
   ROLETA 3D
   =========================== */

.roleta-wrapper {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

#roleta-canvas {
  width: 100%;
  height: auto;
  max-width: 600px;
  filter: drop-shadow(0 10px 40px rgba(251, 191, 36, 0.3));
  cursor: pointer;
  transition: transform 0.2s ease;
}

#roleta-canvas:hover {
  transform: scale(1.02);
}

.roleta-pointer {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 4rem;
  color: var(--accent-primary);
  filter: drop-shadow(0 4px 12px rgba(251, 191, 36, 0.6));
  animation: pointer-bounce 1s ease-in-out infinite;
  z-index: 10;
}

@keyframes pointer-bounce {
  0%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(10px);
  }
}

/* ===========================
   GLOBO DE BINGO
   =========================== */

.globo-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

.globo-container {
  width: 400px;
  height: 400px;
  perspective: 1000px;
}

.globo-sphere {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, 
    rgba(255, 255, 255, 0.3), 
    transparent 50%),
    linear-gradient(135deg, 
      rgba(251, 191, 36, 0.2) 0%, 
      rgba(236, 72, 153, 0.2) 100%);
  border: 4px solid var(--accent-primary);
  position: relative;
  box-shadow: 
    inset 0 0 50px rgba(251, 191, 36, 0.2),
    0 10px 50px rgba(251, 191, 36, 0.3);
  transform-style: preserve-3d;
}

.globo-ball {
  position: absolute;
  width: 40px;
  height: 40px;
  background: radial-gradient(circle at 30% 30%, #ffffff, var(--accent-primary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  color: var(--text-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.globo-tube {
  width: 80px;
  height: 120px;
  background: linear-gradient(to bottom, 
    rgba(251, 191, 36, 0.1), 
    rgba(251, 191, 36, 0.3));
  border: 3px solid var(--accent-primary);
  border-radius: 40px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.globo-ball-result {
  width: 60px;
  height: 60px;
  background: radial-gradient(circle at 30% 30%, #ffffff, var(--accent-primary));
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.8rem;
  color: var(--text-primary);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  animation: ball-appear 1s ease-out;
}

@keyframes ball-appear {
  0% {
    transform: translateY(-150px) scale(0.3);
    opacity: 0;
  }
  60% {
    transform: translateY(10px) scale(1.1);
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* ===========================
   SLOT MACHINE
   =========================== */

.slot-machine {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-radius: 24px;
  padding: 40px;
  border: 4px solid var(--accent-primary);
  box-shadow: 
    0 0 40px rgba(251, 191, 36, 0.4),
    inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.slot-display {
  display: flex;
  gap: 20px;
  background: #000;
  padding: 30px;
  border-radius: 16px;
  margin-bottom: 20px;
}

.slot-reel {
  width: 120px;
  height: 160px;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  border: 3px solid var(--accent-primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  font-weight: 800;
  color: var(--accent-primary);
  text-shadow: 0 0 20px rgba(251, 191, 36, 0.8);
  overflow: hidden;
  position: relative;
}

.slot-lights {
  display: flex;
  justify-content: space-around;
  padding: 0 20px;
}

.slot-light {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #475569;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
  animation: slot-light-blink 0.5s ease-in-out infinite;
}

.slot-light:nth-child(2) {
  animation-delay: 0.125s;
}

.slot-light:nth-child(3) {
  animation-delay: 0.25s;
}

.slot-light:nth-child(4) {
  animation-delay: 0.375s;
}

@keyframes slot-light-blink {
  0%, 100% {
    background: #475569;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
  }
  50% {
    background: var(--accent-primary);
    box-shadow: 0 0 20px var(--accent-primary);
  }
}

/* ===========================
   OVERLAY DE RESULTADO
   =========================== */

.result-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.result-overlay.active {
  display: flex;
  animation: result-fade-in 0.5s ease-out;
}

@keyframes result-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.result-content {
  text-align: center;
  animation: result-zoom-in 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes result-zoom-in {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.result-title {
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--gradient-festive);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 30px;
  animation: title-pulse 1s ease-in-out infinite;
}

@keyframes title-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.result-number {
  font-size: 10rem;
  font-weight: 900;
  color: var(--accent-primary);
  text-shadow: 
    0 0 30px rgba(251, 191, 36, 0.8),
    0 0 60px rgba(251, 191, 36, 0.6),
    0 0 90px rgba(251, 191, 36, 0.4);
  margin-bottom: 40px;
  animation: number-glow 1.5s ease-in-out infinite;
}

@keyframes number-glow {
  0%, 100% {
    text-shadow: 
      0 0 30px rgba(251, 191, 36, 0.8),
      0 0 60px rgba(251, 191, 36, 0.6),
      0 0 90px rgba(251, 191, 36, 0.4);
  }
  50% {
    text-shadow: 
      0 0 40px rgba(251, 191, 36, 1),
      0 0 80px rgba(251, 191, 36, 0.8),
      0 0 120px rgba(251, 191, 36, 0.6);
  }
}

.result-winner {
  margin-bottom: 32px;
}

.result-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.result-actions .btn {
  flex: 1;
  min-width: 180px;
  max-width: 250px;
}

.secondary-btn {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  border: none;
  padding: 16px 32px;
  border-radius: 16px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.secondary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.secondary-btn:active {
  transform: translateY(0);
}

.tertiary-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  padding: 16px 32px;
  border-radius: 16px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.tertiary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
}

.tertiary-btn:active {
  transform: translateY(0);
}

.winner-label {
  font-size: 1.3rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.winner-name {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-primary);
  margin: 0;
}

/* ===========================
   CONTAGEM REGRESSIVA
   =========================== */

.countdown-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.countdown-overlay.active {
  display: flex;
}

.countdown-number {
  font-size: 15rem;
  font-weight: 900;
  color: var(--accent-primary);
  text-shadow: 
    0 0 50px rgba(251, 191, 36, 1),
    0 0 100px rgba(251, 191, 36, 0.8);
  animation: countdown-scale 1s ease-out;
}

@keyframes countdown-scale {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ===========================
   INDICADORES
   =========================== */

.sorteador-indicators {
  display: flex;
  justify-content: center;
  margin-top: 30px;
}

.heartbeat-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 32px;
  background: var(--bg-card-alt);
  border-radius: 50px;
  border: 2px solid var(--border-color);
}

.heart {
  font-size: 2rem;
  animation: heartbeat 1s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% {
    transform: scale(1);
  }
  25% {
    transform: scale(1.3);
  }
  50% {
    transform: scale(1);
  }
  75% {
    transform: scale(1.2);
  }
}

.bpm {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1.1rem;
}

/* ===========================
   HISTÓRICO
   =========================== */

.history-card {
  max-height: 400px;
  overflow-y: auto;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-card-alt);
  border-radius: 12px;
  border-left: 4px solid var(--accent-primary);
}

.history-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-primary);
}

.history-info {
  flex: 1;
  margin-left: 20px;
}

.history-winner {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.history-time {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 40px;
  font-style: italic;
}

/* ===========================
   FULLSCREEN
   =========================== */

.sorteador-stage:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sorteador-stage:-moz-full-screen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sorteador-stage:fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
}

/* ===========================
   FOGOS DE ARTIFÍCIO
   =========================== */

#fireworks-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
}

.firework {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  animation: firework-explode 1s ease-out forwards;
}

@keyframes firework-explode {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(-200px) scale(0);
    opacity: 0;
  }
}

/* ===========================
   RESPONSIVE
   =========================== */

@media (max-width: 768px) {
  .mega-btn {
    font-size: 1.1rem;
    padding: 16px 24px;
  }
  
  .result-number {
    font-size: 6rem;
  }
  
  .result-title {
    font-size: 1.8rem;
  }
  
  .countdown-number {
    font-size: 8rem;
  }
  
  #roleta-canvas {
    max-width: 400px;
  }
  
  .globo-container {
    width: 300px;
    height: 300px;
  }
  
  .slot-reel {
    width: 80px;
    height: 120px;
    font-size: 2.5rem;
  }
  
  .slot-display {
    padding: 20px;
    gap: 10px;
  }
}