.wheel-modal-button {
  position: fixed;
  bottom: 60px;
  right: 60px;
  cursor: pointer;
  z-index: 5; /* z-index baixo para ficar atrás dos controles */
  text-decoration: none;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  
  /* Animação suave de aparecer/desaparecer */
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s;
}

.wheel-modal-button:hover {
  transform: translateY(-4px);
}

.wheel-modal-button:active {
  transform: translateY(-2px);
}

/* Estilo para a roleta minimal no botão flutuante */
.wheel-modal-button .wheel-container.minimal {
  width: 100px;
  height: 100px;
  background: transparent;
  /* Brilho amarelo MUITO intenso ao redor - indo bem longe */
  box-shadow: 
    0 0 60px rgba(var(--cor-secundaria-rgb, 250, 204, 21), 1),
    0 0 100px rgba(var(--cor-secundaria-rgb, 250, 204, 21), 0.9),
    0 0 140px rgba(var(--cor-secundaria-rgb, 250, 204, 21), 0.8),
    0 0 180px rgba(var(--cor-secundaria-rgb, 250, 204, 21), 0.6),
    0 0 220px rgba(var(--cor-secundaria-rgb, 250, 204, 21), 0.4),
    0 15px 40px rgba(0, 0, 0, 0.5);
  animation: buttonGlow 2s ease-in-out infinite;
}

@keyframes buttonGlow {
  0%, 100% {
    box-shadow: 
      0 0 60px rgba(var(--cor-secundaria-rgb, 250, 204, 21), 1),
      0 0 100px rgba(var(--cor-secundaria-rgb, 250, 204, 21), 0.9),
      0 0 140px rgba(var(--cor-secundaria-rgb, 250, 204, 21), 0.8),
      0 0 180px rgba(var(--cor-secundaria-rgb, 250, 204, 21), 0.6),
      0 0 220px rgba(var(--cor-secundaria-rgb, 250, 204, 21), 0.4),
      0 15px 40px rgba(0, 0, 0, 0.5);
  }
  50% {
    box-shadow: 
      0 0 80px rgba(var(--cor-secundaria-rgb, 250, 204, 21), 1),
      0 0 130px rgba(var(--cor-secundaria-rgb, 250, 204, 21), 1),
      0 0 180px rgba(var(--cor-secundaria-rgb, 250, 204, 21), 0.9),
      0 0 230px rgba(var(--cor-secundaria-rgb, 250, 204, 21), 0.7),
      0 0 280px rgba(var(--cor-secundaria-rgb, 250, 204, 21), 0.5),
      0 15px 40px rgba(0, 0, 0, 0.5);
  }
}

/* Remover todos os itens do botão flutuante */
.wheel-modal-button .wheel-item-container {
  display: none !important;
}

/* Manter o picker visível - 3x maior */
.wheel-modal-button .wheel-picker-container {
  width: 60px !important;
  height: 96px !important;
  top: -30px !important;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5))
          drop-shadow(0 0 20px rgba(var(--cor-secundaria-rgb, 250, 204, 21), 1))
          drop-shadow(0 0 30px rgba(var(--cor-secundaria-rgb, 250, 204, 21), 0.8));
}

/* Garantir que o .wheel ocupe todo o espaço */
.wheel-modal-button .wheel {
  width: 100% !important;
  height: 100% !important;
  padding: 0 !important;
  border: none !important;
  background: #ffffff !important;
}

/* Deixar apenas o gradiente visível */
.wheel-modal-button .wheel::before {
  display: block !important;
  opacity: 1 !important;
  z-index: 1 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

/* Centro menor e mais discreto no botão */
.wheel-modal-button .wheel-center {
  width: 16px !important;
  height: 16px !important;
  border-width: 2px !important;
  z-index: 10 !important;
}

/* Animação sutil de rotação para a roleta minimal */
.wheel-modal-button .wheel {
  animation: gentleRotate 20s linear infinite;
}

@keyframes gentleRotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Quando visível (após scroll) */
.wheel-modal-button.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Na página de jogo, garantir que fique atrás dos controles */
.prize-word-wrapper .wheel-modal-button {
  z-index: 1;
}

.wheel-modal-button > span {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #f8f17d 8.7%, #ba9f47 65.22%);
  color: #ffffff;
  font-weight: 800;
  font-size: 15px;
  padding: 7px 18px;
  border-radius: 24px;
  white-space: nowrap;
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(var(--cor-secundaria-rgb, 250, 204, 21), 0.6);
  text-shadow: 
    0 2px 6px rgba(0, 0, 0, 0.8),
    0 0 10px rgba(0, 0, 0, 0.5);
  letter-spacing: 0.5px;
}

.wheel-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 9997;
}

.wheel-modal-overlay.open {
  display: block;
}

/* ==========================================
   MODAL MODERNO - v3.0 REDESIGN COMPLETO
   ========================================== */

.wheel-modal-container {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  padding: 16px;

  /* Glassmorphism moderno */
  background: linear-gradient(135deg, 
    rgba(14, 16, 13, 0.95) 0%,
    rgba(20, 25, 30, 0.98) 100%
  );
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);

  /* Bordas e sombras vibrantes */
  border: 2px solid rgba(var(--cor-primaria-rgb, 38, 150, 255), 0.3);
  box-shadow: 
    0 0 60px rgba(var(--cor-primaria-rgb, 38, 150, 255), 0.4),
    0 0 120px rgba(var(--cor-secundaria-rgb, 250, 204, 21), 0.3),
    0 30px 80px rgba(0, 0, 0, 0.6),
    inset 0 0 80px rgba(var(--cor-primaria-rgb, 38, 150, 255), 0.05);
  border-radius: 24px;

  max-width: 720px;
  max-height: 90vh;

  z-index: 9998;
  
  /* Animação de entrada */
  animation: modalFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.wheel-modal-container.open {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.wheel-modal-header {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;

  width: 100%;

  border-radius: 16px;
}

.wheel-modal-close {
  background-color: transparent;
  color: #fff;
  font-weight: 700;
  font-size: 20px;
  cursor: pointer;
  border: none;
}

.wheel-modal-content {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  overflow-y: auto;
  
  /* Esconder scrollbar mas manter funcionalidade */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE e Edge */
}

/* Esconder scrollbar no Chrome, Safari e Opera */
.wheel-modal-content::-webkit-scrollbar {
  display: none;
}

.wheel-title {
  font-size: 36px;
  font-weight: 800;
  background: linear-gradient(135deg, 
    var(--cor-primaria, #2696ff) 0%,
    var(--cor-secundaria, #facc15) 50%,
    var(--cor-primaria, #2696ff) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 4px 20px rgba(var(--cor-primaria-rgb, 38, 150, 255), 0.3);
  letter-spacing: 1px;
}

.wheel-modal-content-header {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.wheel-modal-content-main {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 1;
}

.wheel-tickets-display {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 0 16px 0;
  flex-shrink: 0;
}

.wheel-tickets-display .tickets-container {
  display: flex;
  align-items: center;
  gap: 16px;
  font-weight: 800;
  font-size: 20px;
  padding: 16px 32px;
  
  /* Glassmorphism */
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.05) 100%
  );
  backdrop-filter: blur(10px);
  border-radius: 16px;
  border: 2px solid rgba(248, 241, 125, 0.4);
  
  /* Sombra e brilho */
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.2),
    0 0 40px rgba(248, 241, 125, 0.2),
    inset 0 0 20px rgba(255, 255, 255, 0.05);
}

.wheel-tickets-display .tickets-content {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #f8f17d;
  text-shadow: 0 2px 8px rgba(248, 241, 125, 0.5);
}

.wheel-tickets-display .tickets-content i {
  font-size: 24px;
  filter: drop-shadow(0 0 10px rgba(248, 241, 125, 0.6));
}

.wheel-modal-content-footer {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 16px;
  flex-shrink: 0;
  padding: 0;
}

.item {
  display: flex;
  justify-content: center;
  width: 100%;
}

.wheel-rules-container {
  width: 240px;
  display: flex;
  gap: 12px;
  border: 1px solid #373737;
  padding: 10px 14px;
  border-radius: 8px;
}

.wheel-rules-modal-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.3;
}

.wheel-rules-modal-content > span {
  font-size: 14px;
}

.wheel-rules-modal-content > span:last-child {
  font-weight: 300;
  opacity: 0.7;
}

.tickets-container {
  display: flex;
  align-items: center;
  gap: 8px;

  font-weight: 700;
  font-size: 16px;
}

.tickets-content {
  color: #f8f17d;
}

.spin-button {
  width: 120px;
  height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;

  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);

  font-size: 24px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;

  color: var(--cor-primaria, #1150f1);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);

  cursor: pointer;
  position: relative;
  
  /* Sombra interna */
  box-shadow: 
    inset 0 2px 8px rgba(255, 255, 255, 0.8),
    inset 0 -2px 8px rgba(0, 0, 0, 0.1);
  
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.spin-button::before {
  content: "";
  position: absolute;
  width: 140%;
  height: 140%;
  border-radius: 50%;
  z-index: -1;
  
  /* Gradiente dourado vibrante */
  background: linear-gradient(135deg, 
    #FFD700 0%, 
    var(--cor-secundaria, #facc15) 50%, 
    #FFA500 100%
  );
  
  /* Sombras dramáticas */
  box-shadow: 
    0 0 40px rgba(255, 215, 0, 0.6),
    0 0 80px rgba(var(--cor-secundaria-rgb, 250, 204, 21), 0.4),
    0 10px 40px rgba(0, 0, 0, 0.3);
  
  /* Animação de pulso */
  animation: buttonPulse 2s ease-in-out infinite;
}

@keyframes buttonPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 
      0 0 40px rgba(255, 215, 0, 0.6),
      0 0 80px rgba(var(--cor-secundaria-rgb, 250, 204, 21), 0.4),
      0 10px 40px rgba(0, 0, 0, 0.3);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 
      0 0 60px rgba(255, 215, 0, 0.8),
      0 0 120px rgba(var(--cor-secundaria-rgb, 250, 204, 21), 0.6),
      0 10px 40px rgba(0, 0, 0, 0.3);
  }
}

.spin-button:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 
    inset 0 2px 12px rgba(255, 255, 255, 1),
    inset 0 -2px 12px rgba(0, 0, 0, 0.15);
}

.spin-button:active:not(:disabled) {
  transform: scale(0.98);
}

.spin-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.spin-button:disabled::before {
  animation: none;
}

/* ==========================================
   RESPONSIVO MOBILE - MODAL
   ========================================== */

@media (max-width: 661px) {
  .wheel-modal-container {
    max-width: 95%;
    max-height: 95vh;
    padding: 12px;
    border-radius: 20px;
  }

  .wheel-modal-content {
    gap: 10px;
  }

  .wheel-title {
    font-size: 28px;
  }

  .wheel-modal-content-main {
    padding: 4px 0;
  }

  .wheel-tickets-display {
    padding: 6px 0;
  }

  .wheel-tickets-display .tickets-container {
    font-size: 16px;
    padding: 12px 20px;
    gap: 12px;
  }
  
  .wheel-tickets-display .tickets-content i {
    font-size: 20px;
  }

  .wheel-modal-content-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    align-items: center;
    gap: 12px;
  }

  .wheel-item-1 {
    grid-column: 1;
  }

  .wheel-item-3 {
    grid-column: 2;
  }

  .wheel-rules-container {
    width: 100%;
    gap: 8px;
    padding: 10px 12px;
  }

  .wheel-rules-modal-content > span {
    font-size: 11px;
  }

  .spin-button {
    width: 90px;
    height: 90px;
    font-size: 18px;
    gap: 6px;
  }

  .spin-button::before {
    width: 145%;
    height: 145%;
  }
}

/* Mensagem de erro quando serviço está indisponível */
.wheel-error-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px 24px;
  text-align: center;
  min-height: 400px;
}

.wheel-error-message i.fa-exclamation-circle {
  font-size: 64px;
  color: #ff6b6b;
  margin-bottom: 8px;
}

.wheel-error-message h3 {
  font-size: 24px;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.wheel-error-message p {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
  margin: 8px 0;
  max-width: 400px;
  line-height: 1.5;
}

.wheel-error-message .retry-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  margin-top: 16px;
  background: linear-gradient(180deg, #2696ff 0%, #1a6fcc 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.wheel-error-message .retry-button:hover {
  transform: translateY(-2px);
  box-shadow: 0px 4px 12px rgba(38, 150, 255, 0.4);
}

.wheel-error-message .retry-button:active {
  transform: translateY(0);
}

.wheel-error-message .retry-button i {
  font-size: 18px;
}

/* Ajustes responsivos para não sobrepor menu flutuante e footer */
@media (max-width: 991px) {
  .wheel-modal-button {
    bottom: 140px;
    right: 20px;
  }
  
  .wheel-modal-button .wheel-container.minimal {
    width: 80px;
    height: 80px;
  }
  
  .wheel-modal-button .wheel-center {
    width: 14px !important;
    height: 14px !important;
  }
  
  .wheel-modal-button .wheel-picker-container {
    width: 48px !important;
    height: 78px !important;
    top: -24px !important;
  }
  
  .wheel-modal-button > span {
    font-size: 12px;
    padding: 5px 12px;
  }
}

@media (max-width: 640px) {
  .wheel-modal-button {
    bottom: 120px;
    right: 15px;
  }
  
  .wheel-modal-button .wheel-container.minimal {
    width: 70px;
    height: 70px;
  }
  
  .wheel-modal-button .wheel-center {
    width: 12px !important;
    height: 12px !important;
  }
  
  .wheel-modal-button .wheel-picker-container {
    width: 42px !important;
    height: 66px !important;
    top: -20px !important;
  }
  
  .wheel-modal-button > span {
    font-size: 11px;
    padding: 4px 10px;
  }
}

@media (max-width: 480px) {
  .wheel-modal-button .wheel-container.minimal {
    width: 65px;
    height: 65px;
  }
  
  .wheel-modal-button .wheel-center {
    width: 11px !important;
    height: 11px !important;
  }
  
  .wheel-modal-button .wheel-picker-container {
    width: 39px !important;
    height: 60px !important;
    top: -18px !important;
  }
  
  .wheel-modal-button > span {
    font-size: 10px;
    padding: 4px 8px;
  }
}
