html {
    height: 100svh;
    overflow: hidden;
}
/* Grupo de imagens de morcegos animados (substitui os divs .bat) */
.bats {
        position: fixed;
        height: auto;
        z-index: 2;
        pointer-events: none;
        opacity: 0.9;
        will-change: transform;
}
/* Posições base dentro da faixa central */
.bats1 { top: 10%; left: calc(50% - (var(--app-max-width) / 2) + 10px); }
.bats2 { top: 20%; left: calc(50% - (var(--app-max-width) / 2) + 380px); }
.bats3 { top: 60%; left: calc(50% - (var(--app-max-width) / 2) + 60px); }
.bats4 { top: 70%; left: calc(50% - (var(--app-max-width) / 2) + 340px); }
.bats5 { top: 40%; left: calc(50% - (var(--app-max-width) / 2) + 200px); }

/* Tamanhos distintos (todos < 60px) e animações únicas, sem delay */
.bats1 { width: 58px; animation: flyA 14s linear infinite; }
.bats2 { width: 52px; animation: flyB 12s ease-in-out infinite; }
.bats3 { width: 46px; animation: flyC 16s linear infinite; }
.bats4 { width: 40px; animation: flyD 11s ease-in-out infinite; }
.bats5 { width: 34px; animation: flyE 15s linear infinite; }

@keyframes flyA {
    0% { transform: translate(0, 0) rotate(0deg) scale(1); }
    25% { transform: translate(80px, -40px) rotate(-5deg) scale(0.95); }
    50% { transform: translate(160px, 10px) rotate(3deg) scale(1.05); }
    75% { transform: translate(80px, 40px) rotate(-2deg) scale(0.98); }
    100% { transform: translate(0, 0) rotate(0deg) scale(1); }
}
@keyframes flyB {
    0% { transform: translate(0, 0) rotate(0deg) scale(1); }
    20% { transform: translate(60px, -30px) rotate(6deg) scale(0.92); }
    50% { transform: translate(140px, -10px) rotate(-4deg) scale(1.04); }
    80% { transform: translate(90px, 35px) rotate(2deg) scale(0.96); }
    100% { transform: translate(0, 0) rotate(0deg) scale(1); }
}
@keyframes flyC {
    0% { transform: translate(0, 0) rotate(0deg) scale(1); }
    33% { transform: translate(70px, 20px) rotate(-6deg) scale(1.02); }
    66% { transform: translate(140px, -30px) rotate(5deg) scale(0.94); }
    100% { transform: translate(0, 0) rotate(0deg) scale(1); }
}
@keyframes flyD {
    0% { transform: translate(0, 0) rotate(0deg) scale(1); }
    30% { transform: translate(100px, -20px) rotate(8deg) scale(0.9); }
    60% { transform: translate(150px, 30px) rotate(-6deg) scale(1.06); }
    100% { transform: translate(0, 0) rotate(0deg) scale(1); }
}
@keyframes flyE {
    0% { transform: translate(0, 0) rotate(0deg) scale(1); }
    25% { transform: translate(50px, 10px) rotate(-4deg) scale(1.02); }
    50% { transform: translate(120px, -40px) rotate(7deg) scale(0.93); }
    75% { transform: translate(60px, 30px) rotate(-3deg) scale(1.04); }
    100% { transform: translate(0, 0) rotate(0deg) scale(1); }
}
/* ========================================
   CONFIGURAÇÃO DE IMAGENS - INSTRUÇÕES
   ======================================== */

/*
SÍMBOLOS DOS SLOTS (5 imagens):
- Tamanho recomendado: 200x200px (quadrado)
- Formato: PNG com fundo transparente
- Temas sugeridos: abóbora, bruxa, caldeirão, morcego, pote de prêmio

Para configurar, edite o arquivo script.js e substitua as URLs no array 'symbols':
const symbols = [
    'URL_DA_IMAGEM_1',  // Símbolo 1 (ex: abóbora)
    'URL_DA_IMAGEM_2',  // Símbolo 2 (ex: bruxa)
    'URL_DA_IMAGEM_3',  // Símbolo 3 (ex: caldeirão)
    'URL_DA_IMAGEM_4',  // Símbolo 4 (ex: morcego)
    'URL_DA_IMAGEM_5'   // Símbolo 5 (ex: pote de prêmio)
];

BANNER DE PRÊMIO:
- Tamanho recomendado: 600x300px (proporção 2:1)
- Formato: PNG com fundo transparente ou JPG
- Deve conter a mensagem do prêmio ganho

Para configurar, edite o arquivo HTML (index.html) na linha do prizeBannerImg:
<img src="URL_DO_BANNER_DE_PREMIO" alt="Banner de Prêmio" id="prizeBannerImg">
*/

/* ========================================
   RESET E CONFIGURAÇÕES GLOBAIS
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial Black', 'Arial Bold', sans-serif;
    background: linear-gradient(180deg, #1a0033 0%, #2d1b4e 50%, #1a0033 100%);
    min-height: 100svh; /* usa small viewport height p/ mobile */
    height: 100svh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* impede rolar para baixo ou lados */
    position: relative;
    color: #fff;
    overscroll-behavior: none; /* evita overscroll em mobile */
    touch-action: none; /* impede arrastar/rolar por gesto */
    user-select: none; /* evita seleção acidental */
}
:root { --app-max-width: 500px; }

/* ========================================
   ELEMENTOS DE FUNDO E DECORAÇÃO
   ======================================== */

/* Lua */
.moon {
    position: fixed;
    top: 24px;
    left: calc(50% - (var(--app-max-width) / 2) + 70%);
    width: 100px;
    height: 100px;
    background: radial-gradient(circle at 30% 30%, #ffd89b 0%, #f4a460 100%);
    border-radius: 50%;
    box-shadow: 0 0 60px rgba(255, 216, 155, 0.6);
    z-index: 1;
}

/* Morcegos animados */
.bat {
    position: fixed;
    width: 40px;
    height: 30px;
    background-color: #000;
    clip-path: polygon(50% 0%, 0% 40%, 20% 100%, 40% 40%, 50% 50%, 60% 40%, 80% 100%, 100% 40%);
    z-index: 2;
    animation: fly 15s infinite ease-in-out;
    opacity: 0.8;
}

.bat1 { top: 10%; left: calc(50% - (var(--app-max-width) / 2) + 20px); animation-delay: 0s; }

.bat2 { top: 20%; left: calc(50% - (var(--app-max-width) / 2) + 420px); animation-delay: 3s; }

.bat3 { top: 60%; left: calc(50% - (var(--app-max-width) / 2) + 80px); animation-delay: 6s; }

.bat4 { top: 70%; left: calc(50% - (var(--app-max-width) / 2) + 360px); animation-delay: 9s; }

.bat5 { top: 40%; left: calc(50% - (var(--app-max-width) / 2) + 220px); animation-delay: 12s; }

@keyframes fly {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(100px, -50px) scale(0.9);
    }
    50% {
        transform: translate(200px, 20px) scale(1.1);
    }
    75% {
        transform: translate(100px, 50px) scale(0.95);
    }
}

/* ========================================
   CONTAINER PRINCIPAL
   ======================================== */

.container {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 16px;
    max-width: var(--app-max-width);
    width: 100%;
    margin: 0 auto;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ========================================
   CABEÇALHO DA SLOT MACHINE
   ======================================== */

.slot-header {
    background: none;
    border: none;
    border-radius: 0;
    padding: 0px 0 4px; /* menos espaço acima */
    box-shadow: none;
    position: relative;
    margin-bottom: 6px;
    margin-top: 5px !important;
}

.title {
    font-size: 3.5em;
    color: #ffa500;
    text-shadow: 
        3px 3px 0 #ff6600,
        6px 6px 0 #cc5200,
        9px 9px 20px rgba(0, 0, 0, 0.8);
    line-height: 0.9;
    letter-spacing: 2px;
}

.or {
    font-size: 0.5em;
    color: #ffcc66;
}

/* Cabeçalho de imagem */
.title-image {
    display: block;
    max-width: 120%;
    height: auto;
    margin: 0 auto;
    filter: drop-shadow(0 6px 14px rgba(0,0,0,0.6));
    max-height: clamp(88px, 16svh, 140px); /* título maior */
}

/* ========================================
   CONTADOR DE TENTATIVAS
   ======================================== */

.attempts-counter {
    background: rgba(139, 69, 19, 0.8);
    border: 3px solid #ff8c00;
    border-radius: 15px;
    padding: 10px 18px;
    margin: 12px auto 8px;
    max-width: 300px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.attempts-counter p {
    font-size: 1.2em;
    color: #ffa500;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.attempts-counter span {
    font-size: 1.5em;
    color: #ffff00;
    font-weight: bold;
}

/* ========================================
   SLOT MACHINE
   ======================================== */

.slot-machine {
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    position: relative;
}

.slot-frame {
    background-image: url('assets/slot-frame.png');
    background-size: 90% 90%;
    background-repeat: no-repeat;
    background-position: center calc(50% - 5px); /* sobe a moldura 5px */
    position: relative;
    width: 416px;
    height: 416px;
    margin: 0px auto 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translateX(15px); /* move todo o slot 20px para a esquerda */
}

.reels-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    gap: 0;
    overflow: visible; /* container allows positioning */
    position: static;
    z-index: 1; /* under the frame overlay */
    padding-top: 80px;
    padding-right: 35px;

}

/* Viewport to clip the spinning reel inside the frame window */
.reel-viewport {
    position: relative;
    width: 264px; /* tamanho fixo para desktop e mobile */
    aspect-ratio: 1 / 1; /* janela 1:1 */
    overflow: hidden; /* clip spinning content */
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: -30px; /* desloca o slot 10px para a direita sem mover a moldura */
}

.reel-canvas {
    width: 100%;
    height: 100%;
    display: block;
    background: rgba(45, 27, 78, 0.85);
    border: 3px solid #8b4513;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.7), 0 0 30px rgba(0,0,0,0.5);
}

.reel {
    width: 100%;
    height: 500%; /* 5 símbolos => 5x a altura do viewport */
    background: rgba(45, 27, 78, 0.85);
    border: 3px solid #8b4513;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.7);
    will-change: transform;
    display: none; /* oculto, canvas substitui */
}

.symbol {
    width: 100%;
    height: 20%; /* cada símbolo ocupa exatamente a janela (1/5 do reel) */
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 4em;
}

.symbol-img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

/* As imagens também giram durante o spin para dar o efeito desejado */
.symbol-img.spinning {
    animation: imgSpin 0.6s linear infinite;
}
@keyframes imgSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Animação de rotação do próprio símbolo (opcional, melhora feedback visual em mobile) */
/* Removida rotação do símbolo individual; a bobina inteira gira */

/* Animação de giro */
.reel.spinning {
    animation: spin 0.12s linear infinite;
}
@keyframes spin {
    0% { transform: translateY(0); }
    100% { transform: translateY(-100%); }
}

@media (max-width: 480px) {
    .title-image { max-width: 98%; }
    .slot-header { padding: 6px 0 2px; margin-bottom: 4px; }

    .attempts-counter {
        padding: 8px 14px;
        margin: 10px auto;
    }
    .attempts-counter p { font-size: 1em; }
    .attempts-counter span { font-size: 1.2em; }

    .slot-frame {
        width: clamp(300px, 78vw, 380px);
        height: clamp(300px, 78vw, 380px);
        background-size: 92% 92%;
    }
    .reels-container {
        padding-top: 12%;
        padding-right: 6.5%;
    }
    .reel-viewport {
        width: 68%;
        margin-left: -6%;
    }

    .spin-button {
        padding: 10px 26px;
        font-size: 1.1em;
        margin: 12px auto 6px;
    }

    /* incentivo removido */

    .rules-link a { font-size: 0.85em; }
}

/* Esconde decorações se a tela for muito estreita/baixa para manter tudo encaixado */
@media (max-width: 360px), (max-height: 560px) {
    .bats, .moon { display: none !important; }
}

/* Ajuste extra para telas muito baixas */
@media (max-height: 640px) {
    .slot-frame {
        width: clamp(260px, 62vw, 320px);
        height: clamp(260px, 62vw, 320px);
        background-size: 86% 86%;
    }
    .reels-container { padding-top: 13%; padding-right: 7%; }
    .reel-viewport { width: 62%; margin-left: -6%; }
    .spin-button { padding: 10px 28px; font-size: 1.15em; margin: 4px auto 8px; top: -14px; }
    .attempts-counter { margin: 6px auto; padding: 6px 12px; }
    /* incentivo removido */
}

/* Ensure the frame overlays reels visually */
.slot-frame {
    position: relative;
    z-index: 2;
}
.slot-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: inherit; /* reuse same frame image */
    background-size: inherit;
    background-repeat: inherit;
    background-position: inherit;
    pointer-events: none;
    z-index: 3; /* top-most overlay */
}

/* ========================================
   BOTÃO DE GIRAR
   ======================================== */

.spin-button {
    background: linear-gradient(180deg, #ffa500 0%, #ff8c00 50%, #ff6600 100%);
    border: 6px solid #8b4513;
    border-radius: 50px;
    padding: 16px 48px;
    font-size: 1.6em;
    font-weight: bold;
    color: #4a2408;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.5);
    cursor: pointer;
    margin: 2px auto 12px; /* bem próximo do slot */
    top: -18px; /* afasta das regras (fixas no rodapé) e aproxima do slot */
    display: block;
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.5),
        inset 0 -4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.spin-button:hover {
    transform: scale(1.05);
    box-shadow: 
        0 10px 30px rgba(255, 140, 0, 0.8),
        inset 0 -4px 10px rgba(0, 0, 0, 0.3);
}

.spin-button:active {
    transform: scale(0.95);
    box-shadow: 
        0 4px 10px rgba(0, 0, 0, 0.5),
        inset 0 4px 10px rgba(0, 0, 0, 0.5);
}

.spin-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: scale(1);
}

.spin-button::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        left: -50%;
    }
    50%, 100% {
        left: 150%;
    }
}

/* ========================================
   ALAVANCA DECORATIVA
   ======================================== */

.lever {
    position: absolute;
    right: -40px;
    top: 50%;
    transform: translateY(-50%);
    width: 280px;
    height: 280px;
    background: rgba(45, 27, 78, 0.85);
    border: 3px solid #8b4513;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.lever::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, #ff0000 0%, #cc0000 100%);
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

/* Mensagem de incentivo removida */

/* ========================================
   DECORAÇÕES DE HALLOWEEN
   ======================================== */

.decorations {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: var(--app-max-width);
    height: 200px;
    z-index: 5;
    pointer-events: none;
}

.pumpkin {
    display: none !important;
}

.pumpkin {
    position: absolute;
    bottom: 20px;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, #ff8c00 0%, #ff6600 100%);
    border-radius: 50% 50% 45% 45%;
    box-shadow: 
        inset -10px -10px 20px rgba(0, 0, 0, 0.3),
        0 8px 20px rgba(0, 0, 0, 0.5);
}

.pumpkin::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: #4a7c2e;
    border-radius: 50% 50% 0 0;
}

.pumpkin::after {
    content: '👻';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2em;
}

.pumpkin-left {
    left: 50px;
}

.pumpkin-right {
    right: 50px;
}

.cauldron {
    display: none !important;
}

.cauldron {
    position: absolute;
    bottom: 20px;
    left: 150px;
    width: 80px;
    height: 60px;
    background: linear-gradient(180deg, #2d2d2d 0%, #1a1a1a 100%);
    border-radius: 0 0 40px 40px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.cauldron::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 20px;
    background: #ff8c00;
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(255, 140, 0, 0.8);
    animation: bubble 2s infinite;
}

@keyframes bubble {
    0%, 100% {
        opacity: 0.6;
        transform: translateX(-50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateX(-50%) scale(1.1);
    }
}

.witch-hat {
    display: none !important;
}

.witch-hat {
    position: absolute;
    bottom: 20px;
    right: 150px;
    width: 0;
    height: 0;
    border-left: 40px solid transparent;
    border-right: 40px solid transparent;
    border-bottom: 60px solid #1a1a1a;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.5));
}

.witch-hat::after {
    content: '';
    position: absolute;
    bottom: -70px;
    left: -60px;
    width: 120px;
    height: 15px;
    background: #1a1a1a;
    border-radius: 50%;
}

/* ========================================
   MODAL DE PRÊMIO
   ======================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: linear-gradient(180deg, #2d1b4e 0%, #1a0033 100%);
    border: 6px solid #ff8c00;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 90%;
    max-height: min(90svh, 90vh);
    overflow: auto; /* permite ler sem rolar a página */
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.9);
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.prize-banner {
    margin-bottom: 30px;
}

.prize-banner img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.modal-button {
    background: linear-gradient(180deg, #ffa500 0%, #ff8c00 50%, #ff6600 100%);
    border: 4px solid #8b4513;
    border-radius: 30px;
    padding: 15px 40px;
    font-size: 1.5em;
    font-weight: bold;
    color: #4a2408;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.modal-button:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(255, 140, 0, 0.8);
}

.modal-button:active {
    transform: scale(0.95);
}

/* ========================================
   MODAL DE REGRAS
   ======================================== */

.rules-content {
    max-width: 500px;
}

.rules-content h2 {
    color: #ffa500;
    font-size: 2em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.rules-content p {
    color: #ffcc66;
    font-size: 1.1em;
    margin: 15px 0;
    line-height: 1.6;
    text-align: left;
}

/* ========================================
   LINK DE REGRAS
   ======================================== */

.rules-link {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
}

.rules-link a {
    color: #ffa500;
    text-decoration: none;
    font-size: 0.9em;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.rules-link a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ========================================
   RESPONSIVIDADE MOBILE
   ======================================== */

/* Layout unificado: sem media queries que alterem tamanho entre desktop e mobile */

