/* --- RESET E BASES --- */
* { margin: 0; padding: 0; box-sizing: border-box; user-select: none; -webkit-tap-highlight-color: transparent; }

:root {
    --red-primary: #B31217;
    --red-dark: #590508;
    --gold-light: #FFF8D6;
    --gold-main: #FFD700;
    --gold-dark: #B8860B;
    --jade-green: #00FFC2;
    --slot-bg: #F6E6C8;
    --neon-gold: #ffcc00;
}

body {
    font-family: 'Poppins', sans-serif;
    background: #000;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Fundo Atmosférico Cinematográfico */
body::before {
    content: '';
    position: absolute;
    width: 100%; height: 100%;
    background: radial-gradient(circle at 50% 40%, #4a0505 0%, #1a0000 60%, #000 100%);
    z-index: -1;
}

/* Partículas de ambiente (poeira dourada) */
body::after {
    content: '';
    position: absolute;
    width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.05'/%3E%3C/svg%3E");
    opacity: 0.4;
    z-index: -1;
    pointer-events: none;
}

/* --- CONTAINER PRINCIPAL (Luxo e Profundidade) --- */
.game-container {
    width: 380px; 
    height: 780px; 
    position: relative; 
    background: var(--red-primary);
    border: 3px solid #ffaa00;
    box-shadow: 
        0 0 80px rgba(255, 170, 0, 0.2), 
        inset 0 0 50px rgba(0,0,0,0.8);
    display: flex; 
    flex-direction: column; 
    border-radius: 35px; 
    overflow: hidden;
    z-index: 10;
}

/* Shaders de Borda Dourada */
.game-container::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 35px;
    border: 2px solid rgba(255, 215, 0, 0.5);
    pointer-events: none;
    z-index: 999;
}

/* --- HEADER --- */
.header-banner {
    height: 90px;
    background: linear-gradient(180deg, #8a0e12 0%, #5e0205 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 2px solid var(--gold-dark);
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    z-index: 20;
}

.main-logo {
    font-family: 'ZCOOL KuaiLe', sans-serif;
    color: var(--gold-main);
    font-size: 32px;
    text-transform: uppercase;
    text-shadow: 
        0 2px 0 #590508, 
        0 0 10px rgba(255, 215, 0, 0.6),
        0 0 20px rgba(255, 215, 0, 0.3);
    letter-spacing: 2px;
    animation: logo-pulse 4s infinite ease-in-out;
}

@keyframes logo-pulse {
    0%, 100% { filter: brightness(1); transform: scale(1); }
    50% { filter: brightness(1.2); transform: scale(1.02); }
}

/* --- ÁREA DO SLOT --- */
.slot-area { 
    flex: 1; 
    position: relative; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    padding: 0 20px;
    z-index: 5; /* Abaixo do overlay, acima do bg */
}

/* Tigre Fundo Estático */
.tiger-background { 
    position: absolute; 
    width: 100%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.6;
    z-index: 0;
    filter: blur(1px) sepia(0.3);
}

.machine-frame {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #d4af37 0%, #f9e295 50%, #aa771c 100%);
    border-radius: 18px;
    box-shadow: 
        0 15px 35px rgba(0,0,0,0.6),
        inset 0 0 10px rgba(255,255,255,0.4);
    z-index: 10;
    position: relative;
}

.inner-slot-box { 
    background: #2b0404; 
    border-radius: 10px; 
    height: 310px; 
    position: relative; 
    overflow: hidden; 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 4px; 
    border: 2px solid #590508;
    box-shadow: inset 0 0 20px #000;
}

/* Divisórias Premium */
.v-line { 
    position: absolute; 
    top: 5%; height: 90%; width: 1px;
    background: linear-gradient(to bottom, transparent, var(--gold-main), transparent); 
    z-index: 20; 
    opacity: 0.5;
}
.line-1 { left: 33.3%; }
.line-2 { left: 66.6%; }

/* --- ROLOS --- */
.slot-column { position: relative; height: 100%; overflow: hidden; background: rgba(246, 230, 200, 0.05); }

/* Flash branco ao parar */
.slot-column::after {
    content: ''; position: absolute; inset: 0;
    background: white; opacity: 0; pointer-events: none; z-index: 100;
    transition: opacity 0.1s;
}
.slot-column.reel-stop-flash::after { opacity: 0.3; }

.reel-track { 
    display: flex; flex-direction: column; width: 100%; 
    will-change: transform;
}
.slot-reel { height: 100px; display: flex; align-items: center; justify-content: center; perspective: 1000px; }
.slot-reel img { 
    width: 85%; 
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3)); 
    transform: translateZ(0);
    /* Respiração Forte (Idle) */
    animation: deep-breathe 3s ease-in-out infinite;
}

@keyframes deep-breathe {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.08); filter: brightness(1.15) drop-shadow(0 0 8px rgba(255,215,0,0.4)); }
}

/* Animação de Giro (Blur) */
@keyframes spinning { 0% { transform: translateY(-50px); } 100% { transform: translateY(0); } }
.spinning .reel-track { animation: spinning 0.3s linear infinite; } 
.spinning img { filter: blur(4px) brightness(1.2) !important; transform: scale(0.9) !important; animation: none !important; }

.turbo-spinning .reel-track { animation: spinning 0.1s linear infinite; }
.turbo-spinning img { filter: blur(8px) brightness(1.2) !important; transform: scale(0.85) !important; animation: none !important; }

.wild-spinning .reel-track { animation: spinning var(--speed, 1s) linear infinite; }

/* --- UI FOOTER --- */
.ui-footer {
    background: linear-gradient(to top, #360202, #8a0e12);
    padding: 15px 15px 35px 15px;
    border-top: 2px solid var(--gold-main);
    box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
    z-index: 30;
}

.balance-container {
    text-align: center;
    margin-bottom: 20px;
    background: rgba(0,0,0,0.4);
    border-radius: 12px;
    padding: 8px;
    border: 1px solid rgba(255,215,0,0.2);
}

.balance-container .label {
    color: #ffaa00;
    font-size: 11px;
    letter-spacing: 1px;
    font-weight: 700;
    text-transform: uppercase;
}

.value-box {
    font-family: 'Luckiest Guy', cursive;
    color: #fff;
    font-size: 28px;
    text-shadow: 0 2px 0 #000;
    transition: transform 0.1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Impacto no Saldo */
.balance-hit { animation: balance-shock 0.3s ease-out; color: #fff7cc; }
@keyframes balance-shock { 0% { transform: scale(1); } 50% { transform: scale(1.4); text-shadow: 0 0 20px #fff; } 100% { transform: scale(1); } }

/* Controles */
.action-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.side-btn-turbo {
    width: 60px; height: 60px;
    background: linear-gradient(145deg, #7a0a0e, #4a0505);
    border: 2px solid #b8860b;
    border-radius: 15px;
    color: #b8860b;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-size: 10px; font-weight: bold; cursor: pointer;
    box-shadow: 0 4px 0 #360202;
    transition: all 0.1s;
}
.side-btn-turbo:active { transform: translateY(4px); box-shadow: none; }
.side-btn-turbo.active {
    background: linear-gradient(145deg, #ffd700, #ffaa00);
    color: #590508;
    border-color: #fff;
    box-shadow: 0 0 15px #ffd700;
}

.bet-adjuster {
    flex: 1; display: flex; align-items: center;
    background: #2b0404;
    border-radius: 50px;
    border: 1px solid #590508;
    padding: 4px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
}

.bet-ctrl {
    width: 32px; height: 32px;
    background: linear-gradient(to bottom, #ffd700, #ffaa00);
    color: #590508;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; font-weight: bold; cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.4);
}
.bet-ctrl:active { transform: scale(0.9); }

.bet-info { flex: 1; text-align: center; }
.bet-label { font-size: 9px; color: #888; display: block; }
.bet-value { font-family: 'Luckiest Guy', cursive; color: #fff; font-size: 18px; }

/* Botão Spin Hollywood */
.spin-wrap { width: 95px; height: 95px; position: relative; z-index: 50; }
.spin-btn-container {
    width: 100%; height: 100%;
    background: radial-gradient(circle at 30% 30%, #4fffd3, #009e73, #004d38);
    border-radius: 50%;
    border: 4px solid #ffd700;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 0 #003322, 0 15px 25px rgba(0,0,0,0.6);
    position: relative; overflow: hidden;
    transition: transform 0.1s, box-shadow 0.1s;
}
.spin-btn-container:active { transform: translateY(6px); box-shadow: 0 2px 0 #003322; }

/* Brilho no botão Spin */
.spin-btn-container::before {
    content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.6), transparent);
    animation: sheen 3s infinite;
}
@keyframes sheen { 0% { transform: rotate(45deg) translate(-100%, -100%); } 20% { transform: rotate(45deg) translate(100%, 100%); } 100% { transform: rotate(45deg) translate(100%, 100%); } }

.spin-btn-icon { width: 60%; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)); }

/* --- VFX: MASCOTE CINEMATOGRÁFICO --- */
#cinematic-mascot-container {
    position: absolute;
    bottom: 0px; 
    left: 50%;
    transform: translateX(-50%);
    width: 380px;
    height: 400px;
    z-index: 100; /* Acima dos rolos, abaixo do overlay */
    pointer-events: none;
    display: flex; justify-content: center; align-items: flex-end;
    overflow: visible;
}

.tiger-hidden { 
    width: 320px; 
    transform: translateY(120%); 
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
}

.tiger-active {
    transform: translateY(20px) !important; /* Sobe dramaticamente */
    animation: tiger-celebrate 1s infinite alternate ease-in-out;
}

@keyframes tiger-celebrate {
    0% { transform: translateY(20px) rotate(-2deg) scale(1); }
    100% { transform: translateY(10px) rotate(2deg) scale(1.02); }
}

/* Aura de Deus (God Ray) */
.god-ray {
    position: absolute; width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(255,215,0,0.6) 0%, transparent 70%);
    bottom: -100px; opacity: 0;
    transition: opacity 0.5s;
    mix-blend-mode: screen;
}
.god-ray.active { opacity: 1; animation: ray-rotate 10s linear infinite; }
@keyframes ray-rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* --- VFX: SÍMBOLOS EM ÊXTASE --- */
/* Neutraliza animação antiga e cria a nova */
.symbol-win-effect {
    z-index: 100; /* Flutua sobre tudo */
    position: relative;
    animation: ecstasy-pulse 0.6s infinite alternate !important;
    filter: brightness(1.5) drop-shadow(0 0 15px gold) !important;
    transform: scale(1.2) !important;
}

@keyframes ecstasy-pulse {
    from { transform: scale(1.2); filter: brightness(1.3) drop-shadow(0 0 10px gold); }
    to { transform: scale(1.35); filter: brightness(1.8) drop-shadow(0 0 25px orange); }
}

/* --- OVERLAY DE VITÓRIA (ATUALIZADO) --- */
.win-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); /* Mais transparente para ver o mascote */
    z-index: 200; /* Acima do mascote */
    display: none;
    flex-direction: column; align-items: center; justify-content: flex-start; /* Move para cima */
    padding-top: 150px; /* Espaço para o tigre abaixo */
    backdrop-filter: blur(2px);
}

.win-glow-container {
    animation: pop-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
}

.win-multiplier {
    font-family: 'Luckiest Guy', cursive;
    font-size: 90px;
    background: linear-gradient(to bottom, #fff, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(255,165,0,0.8));
    animation: pulse-text 0.5s infinite alternate;
}

.win-amount {
    font-family: 'Luckiest Guy', cursive;
    font-size: 45px;
    color: #fff;
    text-shadow: 0 4px 0 #000;
    margin-top: 10px;
}

@keyframes pop-in { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes pulse-text { from { transform: scale(1); } to { transform: scale(1.1); } }

/* Linhas de Vitória */
#win-line-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 80; pointer-events: none; }
.winning-line {
    fill: none; stroke: #fff; stroke-width: 10;
    stroke-linecap: round;
    filter: drop-shadow(0 0 10px #ff0000) drop-shadow(0 0 5px #ffd700);
    animation: draw-line 0.5s forwards;
}

/* Modal Prêmios */
#prize-modal {
    position: absolute; inset: 0; background: rgba(0,0,0,0.95);
    z-index: 300; display: none; align-items: center; justify-content: center;
    animation: fade-in 0.3s;
}
.prize-img-large { width: 220px; animation: float-prize 2s infinite ease-in-out; }
@keyframes float-prize { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-20px); } }