::-webkit-scrollbar {
    display: none;
}
html, body {
    scrollbar-width: none;
    -ms-overflow-style: none;
    margin: 0;
    padding: 0;
    background-color: #000;
    font-family: var(--font-main);
    width: 100%;
    height: 100%;
    overflow: hidden; /* Trava geral */
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed; /* Fixa o corpo para evitar elastic scroll no iOS */
}

:root {
    --bg-color: #022c16;
    --reel-bg: #ecf0f1;
    --slot-height: 65px;
    --slot-width: 90px;
    --roulette-size: 85px;
    --font-main: 'Luckiest Guy', cursive;
    --font-cartoon: 'Titan One', cursive;
    --gold: #f1c40f;
    --gold-dark: #f39c12;
    --wood-light: #d35400;
    --wood-dark: #a04000;
    --money-green: #4cd137;
    --xmas-red: #c0392b;
    --xmas-green: #27ae60;
}

@media (max-height: 700px) {
    :root {
        --slot-height: 50px;
        --slot-width: 70px;
        --roulette-size: 60px;
    }
    .logo-container {
        height: 100px !important;
        margin-bottom: -40px !important;
    }
    #btn-spin {
        width: 90px !important;
        height: 90px !important;
    }
    .circle-btn {
        width: 45px !important;
        height: 45px !important;
        font-size: 20px !important;
    }
    .win-amount { font-size: 1.5rem !important; }
    .lobby-header { margin-top: 10px !important; }
}

@media (max-width: 380px) {
    :root {
        --slot-width: 65px;
    }
    .controls-panel { padding: 5px; }
    .slot-frame { padding: 10px; gap: 4px; }
}

* {
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

#desktop-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image: url('https://i.imgur.com/8jJgubv.png');
    background-size: cover;
    background-position: center;
    filter: blur(20px) brightness(0.6);
    z-index: 0;
    display: none;
}

@media (min-width: 450px) {
    #desktop-bg { display: block; }
}

#app-frame {
    width: 100%;
    max-width: 420px;
    height: 100vh; 
    height: 100dvh;
    background: #000;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    z-index: 10;
}

@media (min-width: 450px) {
    #app-frame {
        max-height: 100vh !important;
        height: 100vh !important;
        border-left: 2px solid #333;
        border-right: 2px solid #333;
        box-shadow: 0 0 50px rgba(0,0,0,0.8);
    }
}

#bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    pointer-events: none;
    filter: blur(4px) brightness(0.7);
}

.screen-layer, #game-screen, #lobby-screen, #auth-screen {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: none; 
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    z-index: 20;
    overflow: hidden; /* Impede rolagem interna */
    touch-action: none; /* Impede gestos de rolagem no mobile */
}

#game-screen {
    z-index: 20;
    justify-content: space-between;
}

#auth-screen {
    z-index: 30;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(3px);
    justify-content: center;
}

#lobby-screen {
    z-index: 20;
    padding: 20px;
    /* Garantir que o conteúdo caiba sem scroll */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

#app-frame::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 150px;
    background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 100%);
    z-index: 2;
    pointer-events: none;
}

.auth-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 80%;
    max-width: 300px;
    animation: popIn 0.5s;
}

.btn-large-cartoon {
    width: 100%;
    aspect-ratio: 370 / 140;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font-cartoon);
    font-size: 1.0rem;
    color: #fff;
    border: none;
    background-color: transparent;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: none;
    transition: transform 0.1s;
    text-shadow: 2px 2px 0 #000;
    padding: 0;
}
.btn-large-cartoon:active {
    transform: translateY(4px);
}

.lobby-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    background: rgba(2, 44, 22, 0.9); 
    padding: 8px 15px; 
    border-radius: 30px; 
    border: 2px solid var(--xmas-red); 
    box-shadow: 0 4px 0 rgba(0,0,0,0.5);
    z-index: 60;
    flex-shrink: 0; /* Não encolher */
}

.lobby-profile {
    width: 40px; 
    height: 40px;
    background: var(--xmas-red);
    border: 2px solid #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    box-shadow: 0 2px 0 #000;
    cursor: pointer;
    position: relative;
}
.lobby-profile::after {
    content: '❄️';
    position: absolute;
    top: -5px; right: -5px;
    font-size: 12px;
}

.lobby-balance-box {
    flex: 1;
    margin-left: 10px;
    text-align: right;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.lobby-label {
    display: block;
    font-size: 0.6rem; 
    color: var(--gold);
    font-family: var(--font-cartoon);
    letter-spacing: 1px;
}
.lobby-amount {
    display: block;
    font-size: 1.1rem; 
    color: #fff;
    font-family: var(--font-cartoon);
    text-shadow: 1px 1px 0 #000;
}

.lobby-center {
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative; /* Necessário para o ícone absoluto */
    width: 100%;
}
.lobby-center img.logo-main {
    width: 80%;
    max-width: 300px;
    animation: pulseSmooth 3s infinite ease-in-out;
    z-index: 10;
}

/* ESTILO DA MINA */
.mina-modal-wrapper { font-family: 'Roboto', sans-serif; }
.mina-custom-scrollbar::-webkit-scrollbar { width: 6px; }
.mina-custom-scrollbar::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); border-radius: 10px; }
.mina-custom-scrollbar::-webkit-scrollbar-thumb { background: #f59e0b; border-radius: 10px; }
.mina-custom-scrollbar::-webkit-scrollbar-thumb:hover { background: #d97706; }
@keyframes minaPulse { 0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(252, 211, 77, 0.7); } 50% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(252, 211, 77, 0); } }
.mina-animate-pulse { animation: minaPulse 2s infinite; }

/* ÍCONE DA MINA FLUTUANTE - AJUSTADO */
#mina-floating-icon { 
    position: absolute; 
    top: 50%; /* Centraliza verticalmente em relação ao pai (lobby-center) */
    right: 0; 
    transform: translateY(-50%); /* Ajuste fino do centro */
    width: 70px; 
    height: 70px; 
    cursor: pointer; 
    z-index: 100; /* Bem alto pra ficar na frente */
    transition: transform 0.2s; 
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.5));
}
#mina-floating-icon:hover { transform: translateY(-50%) scale(1.1); }

.lobby-banner-container {
    width: 90%;
    max-width: 380px;
    margin: 10px auto;
    display: flex;
    justify-content: center;
    z-index: 60;
    flex-shrink: 0;
}
.lobby-banner-container img {
    width: 100%;
    height: auto;
    max-height: 15vh; /* Limita altura em telas pequenas */
    border: none;
    border-radius: 0;
    box-shadow: none;
    display: block;
    object-fit: contain;
}

.lobby-footer {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 40px;
    z-index: 60;
    flex-shrink: 0;
}
.lobby-footer > button {
    width: 80% !important;
    margin: 0 auto !important;
}
.lobby-actions-row {
    display: flex;
    width: 100%;
    gap: 10px;
}

.header {
    position: relative;
    z-index: 2000 !important;
    text-align: center;
    flex-shrink: 0; 
    margin-bottom: -10px;
}

.logo-container {
    width: 80%;
    max-width: 280px;
    height: 160px;
    margin: 0 auto -50px;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.7));
    transition: transform 0.5s ease-in-out, filter 0.3s;
}
.logo-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.logo-container.tension-mode {
    transform: scale(1.15) translateY(-20px);
    filter: drop-shadow(0 0 30px #ff0000) brightness(1.2); 
    animation: shakeLogo 0.8s ease-in-out infinite alternate;
    z-index: 2001;
    position: relative;
}

@keyframes shakeLogo {
    0% { transform: scale(1.15) translateY(-20px) rotate(0deg); }
    25% { transform: scale(1.2) translateY(-20px) rotate(-3deg); }
    75% { transform: scale(1.2) translateY(-20px) rotate(3deg); }
    100% { transform: scale(1.15) translateY(-20px) rotate(0deg); }
}

.garland {
    position: absolute;
    top: -10px;
    left: 0;
    width: 100%;
    height: 30px;
    background: radial-gradient(circle, #27ae60 60%, transparent 70%);
    background-size: 20px 20px;
    opacity: 0.8;
    z-index: 1;
}

.slot-machine {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 0 10px;
    position: relative;
    z-index: 10;
    min-height: 0;
    transition: transform 4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-origin: center center;
    will-change: transform;
}

.slot-machine.tension-zoom {
    transform: scale(1.2) translateY(10px);
    z-index: 50; 
}

.slot-machine.tension-zoom::before {
    content: '';
    position: fixed; 
    top: -150%; left: -150%; width: 400%; height: 400%; 
    background: rgba(0, 0, 0, 0.85); 
    z-index: 90; 
    pointer-events: none;
    opacity: 0;
    animation: fadeInDark 1s ease forwards;
}

@keyframes fadeInDark {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slot-frame {
    background-color: transparent;
    border: none;
    box-shadow: none;
    background-image: url('https://i.imgur.com/ebxiS6b.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    padding: 15px 20px; 
    display: flex;
    justify-content: center;
    gap: 4px;
    position: relative;
    z-index: 10;
    transition: all 0.5s ease;
}

.slot-machine.tension-zoom .slot-frame {
    z-index: 100; 
    box-shadow: inset 0 0 60px 30px rgba(0, 0, 0, 0.95);
    filter: brightness(1.1);
}

#snow-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1; 
    -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
}

.slot-frame.gold-mode {
    filter: drop-shadow(0 0 20px var(--gold));
}
.slot-frame.gold-mode .reel-col {
    border-color: var(--gold-dark);
}

.reel-col {
    background: rgba(0, 0, 0, 0.5); 
    border-radius: 6px;
    width: var(--slot-width);
    height: calc(var(--slot-height) * 4); 
    max-height: 350px; 
    overflow: hidden;
    position: relative;
    border: 2px solid #555; 
    z-index: 2; 
    transition: z-index 0.1s;
}

.slot-machine.tension-zoom .reel-col {
    z-index: 150;
    position: relative;
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.4);
    background: rgba(0, 0, 0, 0.5);
    border-color: var(--gold);
}

.reel-strip {
    display: flex;
    flex-direction: column;
    will-change: transform;
    transform: translateY(0);
    transform: translate3d(0,0,0);
    backface-visibility: hidden;
}
.symbol {
    height: var(--slot-height);
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 36px;
    filter: drop-shadow(0 2px 0 rgba(0,0,0,0.2));
    flex-shrink: 0;
    cursor: pointer;
}
.symbol img, .symbol lottie-player {
    width: 90%;
    height: 90%;
    object-fit: contain;
    pointer-events: none;
}
.winner-symbol {
    animation: pulseWin 0.8s infinite alternate;
    position: relative;
    z-index: 2;
}
.winner-symbol::after {
    content: '';
    position: absolute;
    inset: -5px;
    border: 4px solid var(--gold);
    border-radius: 12px;
    box-shadow: 0 0 15px var(--gold), inset 0 0 10px var(--gold);
    z-index: -1;
}

#roulette-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    z-index: 12;
    height: auto;
    min-height: 70px;
    width: 100%;
    flex-shrink: 0;
    transition: transform 4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slot-machine.tension-zoom #roulette-wrapper {
    z-index: 150;
    position: relative;
    transform: translateY(-50px) scale(1.15); 
}

.roulette-fly-up {
    animation: flyUpAndAway 0.6s ease-in forwards !important;
}

@keyframes flyUpAndAway {
    0% { transform: translateY(-50px) scale(1.15); opacity: 1; }
    100% { transform: translateY(-200vh) scale(1.15); opacity: 0; }
}

.roulette-shell {
    width: var(--roulette-size);
    height: var(--roulette-size);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.roulette-shell.side-roulette {
    display: none;
    transform: scale(0.9);
}
.roulette-shell.drama-mode {
    transform: scale(1.15) rotate(-5deg);
    z-index: 100;
    transition: transform 2s cubic-bezier(0.1, 0.9, 0.2, 1.0);
}
.roulette-shell.reset-fast {
    transition: transform 0.5s ease-out !important;
    transform: scale(1) rotate(0deg);
}
.roulette-shell::before {
    display: none;
}

.roulette-cartoon {
    width: 85%; 
    height: 85%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 0;
    background: radial-gradient(
        circle at 30% 30%, 
        rgba(255, 239, 160, 1) 0%, 
        rgba(241, 196, 15, 1) 20%, 
        rgba(211, 84, 0, 1) 60%, 
        rgba(120, 40, 31, 1) 100%
    );
    border: 3px solid #f1c40f;
    box-shadow: 
        inset -5px -5px 15px rgba(0,0,0,0.5), 
        0 5px 10px rgba(0,0,0,0.4),
        0 0 10px rgba(241, 196, 15, 0.3);
    pointer-events: none;
    overflow: hidden;
}

.roulette-cartoon::after {
    content: '';
    position: absolute;
    top: 5%; left: 15%;
    width: 40%; height: 25%;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 100%);
    transform: rotate(-45deg);
    filter: blur(1px);
}

.roulette-window {
    width: 80%; 
    height: 50px; 
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    overflow: hidden;
    z-index: 5;
    background: transparent;
    border: none;
    border-radius: 10px;
}

.roulette-strip {
    display: flex;
    flex-direction: row;
    align-items: center;
    height: 100%;
    will-change: transform;
    gap: 4px;
    transform: translate3d(0,0,0);
    backface-visibility: hidden;
}
.roulette-item {
    width: 50px; 
    height: 50px;
    flex-shrink: 0;
    min-width: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    background: transparent;
}
.roulette-item img {
    width: 90%;
    height: 90%;
    object-fit: contain;
    filter: drop-shadow(0 2px 0 rgba(0,0,0,0.3));
    display: block;
}

.roulette-marker {
    position: absolute;
    top: 0px; 
    left: 50%;
    transform: translateX(-50%);
    width: 0; 
    height: 0; 
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 12px solid #c0392b;
    z-index: 10; 
    filter: drop-shadow(0 2px 1px rgba(0,0,0,0.5));
}

.crash-enter {
    animation: crashDown 0.4s cubic-bezier(0.6, -0.28, 0.735, 0.045) forwards !important; 
    display: flex !important;
}
.screen-shake {
    animation: shakeScreen 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

#spin-counter-container {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: none;
    width: 100%;
    text-align: center;
    background: rgba(0,0,0,0.7);
    border-radius: 20px;
    padding: 2px 10px;
    border: 1px solid var(--gold);
}
#spin-counter-number {
    font-size: 2rem;
    color: var(--gold);
    text-shadow: 1px 1px 0 #000;
    display: inline-block;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    line-height: 1;
}
#floating-win {
    position: absolute;
    font-size: 2.5rem;
    color: var(--gold);
    -webkit-text-stroke: 1px #fff;
    text-shadow: 3px 3px 0 #000;
    pointer-events: none;
    z-index: 100;
    display: none;
    font-weight: bold;
    white-space: nowrap;
}
.controls-panel {
    width: 100%;
    padding: 10px 15px 25px;
    padding-bottom: calc(25px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(0,0,0,0.5);
    border-top: 2px solid #2ecc71;
    position: relative;
    z-index: 15;
    flex-shrink: 0; 
}
.stats-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}
.wood-display {
    flex: 1;
    background-color: transparent;
    border: none;
    box-shadow: none;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    padding: 6px 2px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 50px;
    position: relative;
    overflow: hidden;
}

#wallet-box { background-image: url('https://i.imgur.com/yExrJnc.png'); }
#bet-box { background-image: url('https://i.imgur.com/RXcqkw2.png'); }
#win-box { background-image: url('https://i.imgur.com/TIvEGj7.png'); }

.label {
    font-size: 10px;
    color: #f1c40f;
    text-shadow: 2px 2px 0 #000; 
    text-transform: uppercase;
    display: block;
    margin-bottom: 1px;
    position: relative;
    z-index: 2;
    font-family: var(--font-cartoon);
}
.value {
    font-size: 13px;
    color: #fff;
    transition: transform 0.2s;
    font-family: var(--font-cartoon);
    text-shadow: 2px 2px 0 #000;
    position: relative;
    z-index: 2;
}

.actions-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 2px;
}

.circle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #000;
    background: #2ecc71;
    box-shadow: 0 5px 0 #000;
    color: #fff;
    font-size: 30px;
    font-family: var(--font-cartoon);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.1s;
    position: relative;
    -webkit-text-stroke: 1.5px #000;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
    z-index: 1;
}
.circle-btn:active {
    transform: translateY(5px);
    box-shadow: 0 0 0 #000;
}
.circle-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    filter: grayscale(0.8);
}
.circle-btn::after {
    content: '';
    position: absolute;
    top: 8px; left: 12px; width: 15px; height: 8px;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
    transform: rotate(-45deg);
    pointer-events: none;
}

#btn-spin {
    width: 120px;
    height: 120px;
    background: none;
    border: none;
    box-shadow: none;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
    transition: transform 0.1s;
}
#btn-spin:active {
    transform: scale(0.95);
}
#btn-spin:disabled {
    filter: grayscale(1);
    cursor: not-allowed;
    opacity: 0.7;
}
#btn-spin-bg {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.5));
}
#btn-spin-front {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 3;
    animation: spinButtonFront 4s linear infinite;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.5));
}
.fast-spin {
    animation: spinButtonFront 0.2s linear infinite !important;
}
#btn-spin::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    height: 90%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.6) 0%, rgba(255, 215, 0, 0) 70%);
    z-index: 1;
    animation: pulseGlow 2s infinite ease-in-out;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
}
.claim-card {
    width: 90%;
    max-width: 400px;
    aspect-ratio: 1/1;
    background-image: url('https://i.imgur.com/0wNcGLe.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.claim-value {
    font-size: 2.2rem; 
    color: var(--money-green);
    font-family: var(--font-cartoon);
    text-shadow: 3px 3px 0 #000;
    -webkit-text-stroke: 1.5px #000;
    margin-top: 25%;
    margin-bottom: 15px;
    letter-spacing: 2px;
    white-space: nowrap;
    width: 100%;
    text-align: center;
}
.btn-cartoon {
    background-color: #2ecc71;
    border: 2px solid #000; 
    border-radius: 12px;
    color: #fff;
    font-family: var(--font-main);
    font-size: 1.0rem;
    padding: 5px 20px;
    cursor: pointer;
    box-shadow: 3px 3px 0 #000;
    transition: transform 0.1s, box-shadow 0.1s;
    text-transform: uppercase;
    margin-top: 10px; 
}
.btn-cartoon:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 #000;
}

.bonus-flash {
    position: absolute; top:0; left:0; width:100%; height:100%;
    background: #fff;
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    animation: flashScreen 0.8s ease-out;
}
.bonus-layout {
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    z-index: 20;
    position: relative;
}

.bonus-brutal-container {
    width: 300px;
    height: 300px;
    background-image: url('https://i.imgur.com/k1A4AXo.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: relative;
    animation: brutalEntry 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards, 
               pulseIdle 2s ease-in-out 0.6s infinite;
    filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.8));
    z-index: 2;
}

.bonus-rays {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 700px; height: 700px;
    background: repeating-conic-gradient(
        from 0deg,
        rgba(255, 215, 0, 0.4) 0deg 15deg,
        transparent 15deg 30deg
    );
    -webkit-mask-image: radial-gradient(closest-side, black 40%, transparent 90%);
    mask-image: radial-gradient(closest-side, black 40%, transparent 90%);
    border-radius: 50%;
    animation: rotateRays 12s linear infinite;
    z-index: 1;
    pointer-events: none;
}

#symbol-info-popup {
    position: fixed;
    width: 180px;
    background: linear-gradient(180deg, #ffffff 0%, #f2f2f2 100%);
    border: 3px solid #000;
    border-radius: 15px;
    padding: 10px;
    z-index: 1000;
    box-shadow: 10px 10px 0 rgba(0,0,0,0.5);
    text-align: center;
    display: none;
    animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#symbol-info-popup img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 5px;
    filter: drop-shadow(2px 2px 0 rgba(0,0,0,0.2));
}
.info-label { font-size: 0.9rem; color: #555; font-weight: bold; margin-top: 5px; text-transform: uppercase; }
.info-value { font-size: 1.3rem; color: var(--money-green); font-family: var(--font-cartoon); -webkit-text-stroke: 0.5px #000; text-shadow: 1px 1px 0 #000; }
.info-req { font-size: 0.8rem; color: #e74c3c; margin-bottom: 2px; }

#impact-container {
    position: absolute;
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%);
    z-index: 150;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    width: 100%;
    height: 100%;
}
#impact-value {
    font-family: var(--font-cartoon); 
    font-size: 3rem;
    color: var(--money-green);
    -webkit-text-stroke: 2px #000;
    text-shadow: 0px 5px 0 #000, 0px 0px 20px rgba(76, 209, 55, 0.8);
    z-index: 1;
    position: relative;
    white-space: nowrap;
    text-align: center;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#impact-mult-img {
    width: 180px; 
    height: 180px; 
    object-fit: contain;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    display: none;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
}
.crash-anim { 
    animation: stoneCrash 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; 
    opacity: 1 !important;
}
.float-out-anim {
    animation: floatOut 0.4s ease-in forwards;
}
.text-pop-anim {
    animation: textPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.shake-anim { animation: shakeText 0.3s ease-in-out; }

.shatter-char {
    display: inline-block;
    transition: transform 0.5s ease-out, opacity 0.5s ease-out;
}

@keyframes stoneCrash {
    0% { 
        transform: translate(-50%, -300px) scale(4); 
        opacity: 0; 
    }
    60% { 
        transform: translate(-50%, -30px) scale(0.8); 
        opacity: 1; 
    }
    80% { 
        transform: translate(-50%, -60px) scale(1.1); 
    }
    100% { 
        transform: translate(-50%, -50%) scale(1); 
    }
}

@keyframes floatOut {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -100px) scale(1.5);
        opacity: 0;
    }
}

@keyframes textPop {
    0% { transform: scale(1); color: #fff; }
    50% { transform: scale(1.4); color: var(--gold); }
    100% { transform: scale(1); color: var(--money-green); }
}

@keyframes shakeText {
    0%, 100% { transform: translate(0,0); }
    25% { transform: translate(-5px, 5px); }
    50% { transform: translate(5px, -5px); }
    75% { transform: translate(-5px, 5px); }
}

@keyframes brutalEntry {
    0% { transform: scale(5) rotate(-20deg); opacity: 0; }
    50% { transform: scale(1) rotate(0deg); opacity: 1; }
    70% { transform: scale(0.9); }
    85% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes pulseIdle {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

@keyframes rotateRays {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes flashScreen {
    0% { opacity: 1; }
    100% { opacity: 0; }
}
@keyframes pulseButton {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
@keyframes spinButtonFront {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}
@keyframes pulseGlow {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.3; }
    50% { transform: translate(-50%, -50%) scale(1.4); opacity: 0.6; }
    100% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.3; }
}

.win-amount {
    font-size: 3rem;
    color: #fff;
    text-shadow: 2px 2px 0 #000;
    margin: 15px 0;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { transform: scale(0.5); } to { transform: scale(1); } }
@keyframes pulseWin { from { transform: scale(1); } to { transform: scale(1.15); } }

@keyframes crashDown {
    0% { transform: translateY(-800px) scale(1.5); opacity: 1; }
    70% { transform: translateY(20px) scale(1); }
    85% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}
@keyframes shakeScreen {
    0%, 100% { transform: translate3d(0, 0, 0); }
    10%, 30%, 50%, 70%, 90% { transform: translate3d(-10px, 0, 0); }
    20%, 40%, 60%, 80% { transform: translate3d(10px, 0, 0); }
}

#loading-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: #000;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #f1c40f;
    font-family: 'Titan One', cursive;
    transition: background-image 0.5s ease-in;
}
.loader {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #c0392b;
    border-radius: 50%;
    width: 60px; height: 60px;
    animation: spin 2s linear infinite;
    margin-bottom: 20px;
    box-shadow: 0 0 0 4px #000; 
}
#loading-text {
    font-size: 1.8rem;
    color: #f1c40f;
    text-shadow: 
        3px 3px 0 #000,
        -1px -1px 0 #000,  
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.loading-progress {
    margin-top: 10px;
    font-size: 1.5rem;
    color: #fff;
    text-shadow: 
        2px 2px 0 #000,
        -1px -1px 0 #000,  
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000;
    font-weight: bold;
}
.start-btn-container {
    margin-top: 20px;
    display: none;
    animation: popIn 0.5s;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#btn-help {
    position: absolute; 
    top: 15px; 
    right: 15px; 
    width: 32px; 
    height: 32px; 
    background: linear-gradient(180deg, #c0392b 0%, #922b21 100%); 
    border: 2px solid #fff; 
    border-radius: 50%; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    color: #fff; 
    font-family: 'Titan One', cursive; 
    font-size: 18px; 
    cursor: pointer; 
    box-shadow: 0 3px 0 #641e16, 0 5px 10px rgba(0,0,0,0.5); 
    z-index: 200; 
    transition: transform 0.1s; 
}
#btn-help:active {
    transform: translateY(3px); 
    box-shadow: 0 0 0 #641e16, inset 0 2px 5px rgba(0,0,0,0.3); 
}

#btn-back {
    position: absolute; 
    top: 15px; 
    left: 15px; 
    width: 32px; 
    height: 32px; 
    background: linear-gradient(180deg, #3498db 0%, #2980b9 100%); 
    border: 2px solid #fff; 
    border-radius: 50%; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    color: #fff; 
    font-size: 22px; 
    cursor: pointer; 
    box-shadow: 0 3px 0 #1a5276, 0 5px 10px rgba(0,0,0,0.5); 
    z-index: 200; 
    transition: transform 0.1s; 
    font-family: Arial, sans-serif; 
    text-shadow: 1px 1px 0 #000;
}
#btn-back:active {
    transform: translateY(3px); 
    box-shadow: 0 0 0 #1a5276, inset 0 2px 5px rgba(0,0,0,0.3); 
}

#btn-mute {
    position: absolute; 
    top: 55px; 
    right: 15px; 
    width: 32px; 
    height: 32px; 
    background: linear-gradient(180deg, #f39c12 0%, #d35400 100%); 
    border: 2px solid #fff; 
    border-radius: 50%; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    color: #fff; 
    font-size: 16px; 
    cursor: pointer; 
    box-shadow: 0 3px 0 #a04000, 0 5px 10px rgba(0,0,0,0.5); 
    z-index: 200; 
    transition: transform 0.1s; 
}
#btn-mute:active {
    transform: translateY(3px); 
    box-shadow: 0 0 0 #a04000, inset 0 2px 5px rgba(0,0,0,0.3); 
}

@keyframes pulseSmooth {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.winner-pill {
    margin-bottom: 5px;
    background: transparent;
    border: none;
    padding: 0;
    color: #fff;
    font-family: var(--font-cartoon);
    font-size: 0.8rem;
    display: none;
    box-shadow: none;
    text-align: center;
    width: 100%;
    white-space: nowrap;
    text-shadow: 2px 2px 0 #000;
    z-index: 65;
}

@media (min-width: 380px) {
    .winner-pill {
        font-size: 1rem;
    }
}

.winner-anim {
    animation: jumpZoom 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes jumpZoom {
    0% { transform: scale(0) translateZ(-100px); opacity: 0; }
    80% { transform: scale(1.1) translateZ(0); opacity: 1; }
    100% { transform: scale(1) translateZ(0); opacity: 1; }
}