/* ============================================
   ROLETA DA SORTE V2 - DESIGN PROFISSIONAL
   Kei Sushi & Petiscaria
   ✅ CORREÇÃO: Efeito de brilho sempre centralizado
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --vermelho: #C1272D;
    --dourado: #D4AF37;
    --laranja: #FF6B00;
    --amarelo: #FFD700;
    --preto: #000000;
    --branco: #FFFFFF;
    --cinza-escuro: #0a0a0a;
    --cinza-medio: #1a1a1a;
    
    /* Variáveis customizáveis do modal */
    --modal-bg-color: #FFFFFF;
    --modal-text-color: #C1272D;
    --modal-button-color: #D4AF37;
    --modal-button-text-color: #000000;
}

body {
    font-family: 'Poppins', sans-serif;
    /* Background vibrante estilo cassino com gradiente radial */
    background: radial-gradient(ellipse at center, #FFD700 0%, #FFA500 20%, #FF8C00 40%, #FF6B00 60%, #FF4500 80%, #DC143C 100%);
    color: var(--branco);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    /* Background alinhado no topo - duplica para os lados ou corta */
    background-size: auto; /* Tamanho original da imagem */
    background-position-x: center; /* Centralizado horizontal */
    background-position-y: 0; /* Topo sem margem */
    background-repeat: repeat; /* Duplica quando tela é maior */
    background-attachment: scroll; /* Acompanha o scroll */
}

/* Classe para quando houver background customizado */
body.custom-background {
    /* A imagem será aplicada via JavaScript inline */
}

/* Overlay escuro opcional para melhorar legibilidade com background customizado */
body.custom-background::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    pointer-events: none;
    z-index: 0;
}

/* Overlay animado com brilho (padrão) */
body:not(.custom-background)::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, var(--dourado) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, var(--vermelho) 0%, transparent 50%),
        radial-gradient(circle at 50% 10%, var(--dourado) 0%, transparent 40%),
        radial-gradient(circle at 50% 90%, var(--vermelho) 0%, transparent 40%);
    opacity: 0.4;
    pointer-events: none;
    z-index: 0;
    animation: pulseGlow 5s ease-in-out infinite;
}

/* ===== ✅ CORREÇÃO DO EFEITO DE BRILHO ROTATIVO ===== */
/* Efeito de brilho pulsante - SEMPRE CENTRALIZADO ATRÁS DO LOGO/ROLETA */
body::after {
    content: '';
    position: fixed;
    top: 50vh;
    left: 50vw;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 800px;
    max-width: 80vw;
    max-height: 80vw;
    background: radial-gradient(circle, var(--dourado) 0%, transparent 70%);
    opacity: 0.2;
    pointer-events: none;
    z-index: 0;
    animation: rotateBright 20s linear infinite;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.05); }
}

/* ✅ CORREÇÃO: Mantém centralização durante rotação */
@keyframes rotateBright {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ===== CONTAINER PRINCIPAL ===== */
.container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 100px;
}

/* ===== CABEÇALHO ELEGANTE ===== */
.header {
    position: relative;
    text-align: center;
    padding: 40px 20px 30px;
    margin-bottom: 30px;
}

.header-glow {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 100px;
    background: radial-gradient(ellipse, rgba(193, 39, 45, 0.3), transparent);
    filter: blur(40px);
}

.logo-container {
    position: relative;
    z-index: 2;
}

.logo-shine {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shine 3s infinite;
}

.logo-text {
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: 8px;
    margin-bottom: 10px;
    text-shadow: 
        0 0 20px rgba(212, 175, 55, 0.8),
        0 0 40px rgba(193, 39, 45, 0.6);
}

.logo-kei {
    color: var(--vermelho);
}

.logo-divider {
    color: var(--dourado);
    margin: 0 10px;
}

.logo-sushi {
    color: var(--dourado);
}

.logo-subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    color: var(--dourado);
    letter-spacing: 3px;
    margin-bottom: 10px;
}

.logo-location {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
    padding: 8px 16px;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

/* ===== TÍTULO ===== */
.title-section {
    text-align: center;
    margin: 40px 0;
    position: relative;
}

.title-decoration {
    height: 2px;
    width: 100px;
    background: linear-gradient(90deg, transparent, var(--dourado), transparent);
    margin: 20px auto;
}

.main-title {
    font-size: 3rem;
    font-weight: 900;
    color: var(--branco);
    text-shadow: 
        0 0 20px rgba(193, 39, 45, 0.8),
        0 0 40px rgba(212, 175, 55, 0.6);
    letter-spacing: 4px;
}

.title-icon {
    font-size: 2.5rem;
    animation: pulse 2s infinite;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--dourado);
    font-weight: 300;
    margin-top: 10px;
}

/* ===== WRAPPER DA ROLETA ===== */
.wheel-wrapper {
    position: relative;
    max-width: 650px;
    margin: 50px auto;
}

.wheel-ambient-light {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.15), transparent 70%);
    filter: blur(60px);
    pointer-events: none;
    animation: ambientPulse 4s infinite;
}

/* ===== FRAME DECORATIVO ===== */
.wheel-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% + 40px);
    height: calc(100% + 40px);
    border: 3px solid var(--dourado);
    border-radius: 50%;
    box-shadow: 
        0 0 20px rgba(212, 175, 55, 0.5),
        inset 0 0 20px rgba(212, 175, 55, 0.3);
    z-index: 1;
}

.frame-light {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(
        transparent 0deg,
        rgba(212, 175, 55, 0.3) 45deg,
        transparent 90deg,
        rgba(212, 175, 55, 0.3) 135deg,
        transparent 180deg,
        rgba(212, 175, 55, 0.3) 225deg,
        transparent 270deg,
        rgba(212, 175, 55, 0.3) 315deg,
        transparent 360deg
    );
    animation: rotateFrame 20s linear infinite;
}

/* ===== MARCADOR/SETA ===== */
.wheel-pointer {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    filter: drop-shadow(0 4px 10px rgba(212, 175, 55, 0.8));
    animation: pointerBounce 2s ease-in-out infinite;
}

/* Ponteiro PNG customizado */
.pointer-custom {
    max-width: 100px;
    max-height: 100px;
    object-fit: contain;
}

.pointer-custom.hidden {
    display: none;
}

/* ===== CONTAINER DA ROLETA ===== */
.wheel-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    z-index: 2;
}

.wheel-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 
        0 0 40px rgba(193, 39, 45, 0.5),
        0 20px 60px rgba(0, 0, 0, 0.8);
}

.wheel-image, #wheelCanvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: block;
}

#wheelCanvas {
    position: absolute;
    top: 0;
    left: 0;
}

/* ===== CENTRO DA ROLETA ===== */
.wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    z-index: 5;
}

.center-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--dourado) 0%, #B8860B 100%);
    border-radius: 50%;
    box-shadow: 
        0 0 0 4px var(--vermelho),
        0 0 30px rgba(212, 175, 55, 0.8),
        inset 0 5px 20px rgba(255, 255, 255, 0.3);
    animation: centerRotate 8s linear infinite;
}

.center-logo {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

/* Imagem customizada do centro */
.center-custom-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.center-custom-image.hidden {
    display: none;
}

/* Logo padrão quando não há imagem customizada */
.center-default-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.center-default-logo.hidden {
    display: none;
}

.center-text {
    font-weight: 900;
    font-size: 1.1rem;
    color: var(--preto);
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.5);
    line-height: 1.2;
}

.wheel-shine {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
    pointer-events: none;
}

/* ===== BASE DA ROLETA ===== */
.wheel-base {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 30px;
    background: linear-gradient(180deg, rgba(0,0,0,0.8), transparent);
    border-radius: 50%;
    filter: blur(15px);
}

/* ===== BOTÃO DE GIRAR ===== */
.button-wrapper {
    text-align: center;
    margin: 60px 0 40px;
}

.spin-button {
    position: relative;
    padding: 20px 60px;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    color: var(--branco);
    background: linear-gradient(135deg, var(--vermelho) 0%, #8B0000 100%);
    border: 3px solid var(--dourado);
    border-radius: 50px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 
        0 10px 30px rgba(193, 39, 45, 0.6),
        0 0 40px rgba(212, 175, 55, 0.4);
}

.spin-button:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 15px 40px rgba(193, 39, 45, 0.8),
        0 0 60px rgba(212, 175, 55, 0.6);
}

.spin-button:active {
    transform: translateY(0);
}

.spin-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.button-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: buttonShine 3s infinite;
}

.button-content {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 2;
}

.button-icon {
    animation: rotate 2s linear infinite;
}

.button-glow {
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 10px;
    background: var(--dourado);
    filter: blur(15px);
    opacity: 0.6;
}

/* ===== RESULTADO ===== */
.result-area {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.5s;
}

.result-area.hidden {
    display: none;
}

.result-spotlight {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.3), transparent);
    filter: blur(80px);
    animation: spotlightPulse 2s infinite;
}

.result-card {
    position: relative;
    max-width: 600px;
    width: 90%;
    background: var(--modal-bg-color, linear-gradient(135deg, var(--vermelho) 0%, #8B0000 100%));
    border: 4px solid var(--dourado);
    border-radius: 30px;
    padding: 40px;
    text-align: center;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.8),
        0 0 80px rgba(212, 175, 55, 0.6);
    animation: cardReveal 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.result-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--modal-text-color, var(--dourado));
    margin-bottom: 30px;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.8);
}

.result-prize-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: iconBounce 1s infinite;
}

.result-prize {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--modal-text-color, var(--branco));
    background: rgba(0, 0, 0, 0.4);
    padding: 25px;
    border-radius: 15px;
    margin: 20px 0;
    border-left: 5px solid var(--dourado);
}

.result-instruction {
    font-size: 1.1rem;
    color: var(--modal-text-color, rgba(255, 255, 255, 0.9));
    margin: 25px 0;
    line-height: 1.6;
}

.result-close {
    padding: 12px 40px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--modal-button-text-color, var(--preto));
    background: var(--modal-button-color, var(--dourado));
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 20px;
}

.result-close:hover {
    background: #FFD700;
    transform: scale(1.05);
}

/* ===== CONFETE ===== */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1001;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confettiFall 3s linear forwards;
}

/* ===== LINK ADMIN ===== */
.admin-link {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
}

.admin-link a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(212, 175, 55, 0.2);
    color: var(--dourado);
    text-decoration: none;
    border-radius: 25px;
    border: 1px solid var(--dourado);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.admin-link a:hover {
    background: var(--dourado);
    color: var(--preto);
}

/* ===== RODAPÉ ===== */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.9);
    border-top: 1px solid rgba(212, 175, 55, 0.3);
    padding: 15px;
    text-align: center;
    z-index: 99;
}

.footer-content p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 3px 0;
}

.footer-subtitle {
    font-size: 0.8rem;
    color: rgba(212, 175, 55, 0.8);
}

/* ===== ANIMAÇÕES ===== */
@keyframes shine {
    0% { left: -100%; }
    100% { left: 200%; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

@keyframes ambientPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes rotateFrame {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pointerBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-10px); }
}

@keyframes centerRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes buttonShine {
    0% { left: -100%; }
    100% { left: 200%; }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes spotlightPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

@keyframes cardReveal {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }
    60% {
        transform: scale(1.1) rotate(5deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes confettiFall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* ===== CONTROLES DE SOM ===== */
.sound-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.8);
    padding: 12px 20px;
    border-radius: 50px;
    backdrop-filter: blur(10px);
    border: 2px solid var(--dourado);
    box-shadow: 0 5px 20px rgba(212, 175, 55, 0.4);
    z-index: 100;
    transition: all 0.3s;
}

.sound-controls:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(212, 175, 55, 0.6);
}

.sound-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--dourado);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    padding: 5px;
}

.sound-toggle:hover {
    transform: scale(1.1);
    color: #FFD700;
}

.sound-icon {
    transition: all 0.3s;
}

.sound-icon.hidden {
    display: none;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.volume-slider {
    width: 100px;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--vermelho) 0%, var(--dourado) 100%);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--dourado);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.6);
    transition: all 0.3s;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.8);
}

.volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--dourado);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.6);
    transition: all 0.3s;
}

.volume-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.8);
}

.volume-label {
    color: var(--dourado);
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 40px;
    text-align: center;
}

/* Animação para quando o som é mutado */
.sound-controls.muted {
    border-color: #888;
}

.sound-controls.muted .sound-toggle,
.sound-controls.muted .volume-label {
    color: #888;
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 768px) {
    /* Logo mantém tamanho fixo - não redimensiona */
    .main-title { font-size: 2rem; }
    .wheel-center { width: 90px; height: 90px; }
    .center-text { font-size: 0.85rem; }
    .spin-button { padding: 15px 40px; font-size: 1.2rem; }
    .result-title { font-size: 2rem; }
    .result-prize { font-size: 1.3rem; }
    
    /* ✅ Brilho permanece no mesmo tamanho - não muda no mobile */
    
    /* Controles de som mobile */
    .sound-controls {
        top: 10px;
        right: 10px;
        padding: 10px 15px;
    }
    
    .volume-control {
        display: none; /* Ocultar slider no mobile */
    }
}

@media (max-width: 480px) {
    /* Logo mantém tamanho fixo - não redimensiona */
    .main-title { font-size: 1.5rem; }
    .wheel-center { width: 70px; height: 70px; }
    .center-text { font-size: 0.7rem; }
    .spin-button { padding: 12px 30px; font-size: 1rem; }
    
    /* ✅ Brilho permanece no mesmo tamanho - não muda em telas pequenas */
    
    /* Controles de som ainda menores */
    .sound-controls {
        padding: 8px 12px;
    }
}