@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --mc-sky: #78A7FF;
    --mc-grass: #5D9B41;
    --mc-dirt: #8B5A2B;
    --mc-stone: #7F7F7F;
    --mc-wood: #9C6B30;
    --mc-gold: #FCEE4B;
    --mc-diamond: #4AEDD9;
    --mc-red: #FF3B3B;
}

body {
    font-family: 'Press Start 2P', monospace;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    user-select: none;
    -webkit-user-select: none;
    image-rendering: pixelated;
    /* Minecraft landscape background */
    background:
        /* Clouds */
        radial-gradient(ellipse 80px 30px at 15% 8%, white 50%, transparent 50%),
        radial-gradient(ellipse 100px 35px at 45% 12%, white 50%, transparent 50%),
        radial-gradient(ellipse 70px 25px at 75% 6%, white 50%, transparent 50%),
        radial-gradient(ellipse 90px 30px at 90% 15%, white 50%, transparent 50%),
        /* Sun */
        radial-gradient(circle at 85% 10%, #FFFFA0 0%, #FFE44D 30%, transparent 50%),
        /* Sky gradient */
        linear-gradient(180deg,
            #4A90D9 0%,
            #78A7FF 20%,
            #87CEEB 35%,
            /* Grass layer */
            #5D9B41 35.5%,
            #4A8B31 37%,
            /* Dirt layer */
            #8B5A2B 37.5%,
            #7A4A1B 45%,
            /* Stone layer */
            #6B6B6B 50%,
            #5A5A5A 60%,
            #4A4A4A 75%,
            #2A2A2A 100%
        );
    background-attachment: fixed;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    max-width: 480px;
    margin: 0 auto;
    padding: 8px;
    gap: 6px;
}

/* === HEADER === */
#header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: linear-gradient(180deg, #C4A36E 0%, #A68B4B 50%, #8B7340 100%);
    border: 4px solid #5D4E37;
    border-top-color: #E8D4A8;
    border-left-color: #E8D4A8;
    box-shadow:
        inset 0 0 0 2px rgba(255,255,255,0.1),
        4px 4px 0 rgba(0,0,0,0.3);
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-label {
    color: #4A3D2A;
    font-size: 7px;
    text-shadow: 1px 1px 0 rgba(255,255,255,0.3);
}

.stat-value {
    font-size: 12px;
    color: #FFFFFF;
    text-shadow: 2px 2px 0 #2A2A2A, -1px -1px 0 #4A4A4A;
}

#balance-value { color: #55FF55; }
#win-value { color: #FFFF00; }
#mult-value { color: #4AEDD9; }

/* === GAME CONTAINER === */
#game-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
    position: relative;
}

/* === REELS === */
#reels-container {
    background: linear-gradient(180deg, #D4B896 0%, #C4A876 50%, #A48856 100%);
    border: 5px solid #6B5030;
    border-top-color: #F0DCC0;
    border-left-color: #F0DCC0;
    padding: 8px;
    box-shadow:
        inset 0 0 10px rgba(0,0,0,0.2),
        5px 5px 0 rgba(0,0,0,0.3);
}

#reels {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    height: 120px;
}

.reel {
    background: linear-gradient(180deg, #3A3A3A 0%, #2A2A2A 50%, #1A1A1A 100%);
    border: 3px solid #0A0A0A;
    border-top-color: #5A5A5A;
    border-left-color: #5A5A5A;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.8);
}

.reel-cell {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #4A4A4A 0%, #3A3A3A 50%, #2A2A2A 100%);
    border-bottom: 2px solid #1A1A1A;
    position: relative;
    transition: transform 0.1s;
}

.reel-cell:last-child { border-bottom: none; }

/* === MINECRAFT PIXEL ART SYMBOLS === */

/* Empty cell */
.reel-cell.symbol-empty {
    background: linear-gradient(180deg, #3A3A3A 0%, #2A2A2A 100%);
}

/* WOOD PICKAXE - Brown */
.reel-cell.symbol-wood::before {
    content: '';
    width: 28px;
    height: 28px;
    background: #8B6914;
    clip-path: polygon(
        /* Handle */
        45% 95%, 55% 95%, 55% 45%, 45% 45%,
        /* Head */
        20% 45%, 20% 25%, 35% 25%, 35% 35%, 65% 35%, 65% 25%, 80% 25%, 80% 45%
    );
    filter: drop-shadow(2px 2px 0 #5A4510);
}

/* STONE PICKAXE - Gray */
.reel-cell.symbol-stone::before {
    content: '';
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #9A9A9A 0%, #7A7A7A 50%, #6A6A6A 100%);
    clip-path: polygon(
        45% 95%, 55% 95%, 55% 45%, 45% 45%,
        20% 45%, 20% 25%, 35% 25%, 35% 35%, 65% 35%, 65% 25%, 80% 25%, 80% 45%
    );
    filter: drop-shadow(2px 2px 0 #4A4A4A);
}

/* IRON PICKAXE - Silver/White */
.reel-cell.symbol-iron::before {
    content: '';
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #EAEAEA 0%, #CACACA 50%, #AAAAAA 100%);
    clip-path: polygon(
        45% 95%, 55% 95%, 55% 45%, 45% 45%,
        20% 45%, 20% 25%, 35% 25%, 35% 35%, 65% 35%, 65% 25%, 80% 25%, 80% 45%
    );
    filter: drop-shadow(2px 2px 0 #6A6A6A);
}

/* GOLD PICKAXE - Yellow/Gold */
.reel-cell.symbol-gold {
    background: radial-gradient(circle, rgba(255,215,0,0.3) 0%, transparent 70%),
                linear-gradient(180deg, #4A4A4A 0%, #3A3A3A 50%, #2A2A2A 100%);
}
.reel-cell.symbol-gold::before {
    content: '';
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #FFE44D 0%, #FFD700 50%, #DAA520 100%);
    clip-path: polygon(
        45% 95%, 55% 95%, 55% 45%, 45% 45%,
        20% 45%, 20% 25%, 35% 25%, 35% 35%, 65% 35%, 65% 25%, 80% 25%, 80% 45%
    );
    filter: drop-shadow(2px 2px 0 #8B6914) drop-shadow(0 0 8px rgba(255,215,0,0.8));
    animation: goldShine 1.5s ease-in-out infinite;
}

/* DIAMOND PICKAXE - Cyan */
.reel-cell.symbol-diamond {
    background: radial-gradient(circle, rgba(74,237,217,0.4) 0%, transparent 70%),
                linear-gradient(180deg, #4A4A4A 0%, #3A3A3A 50%, #2A2A2A 100%);
}
.reel-cell.symbol-diamond::before {
    content: '';
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #7FFFD4 0%, #4AEDD9 50%, #20B2AA 100%);
    clip-path: polygon(
        45% 95%, 55% 95%, 55% 45%, 45% 45%,
        20% 45%, 20% 25%, 35% 25%, 35% 35%, 65% 35%, 65% 25%, 80% 25%, 80% 45%
    );
    filter: drop-shadow(2px 2px 0 #1A8A7A) drop-shadow(0 0 12px rgba(74,237,217,0.9));
    animation: diamondShine 1s ease-in-out infinite;
}

/* BOOK - Enchantment */
.reel-cell.symbol-book {
    background: radial-gradient(circle, rgba(148,0,211,0.3) 0%, transparent 70%),
                linear-gradient(180deg, #4A4A4A 0%, #3A3A3A 50%, #2A2A2A 100%);
}
.reel-cell.symbol-book::before {
    content: '';
    width: 24px;
    height: 28px;
    background: linear-gradient(90deg, #8B4513 0%, #8B4513 15%, #F5DEB3 15%, #F5DEB3 85%, #8B4513 85%);
    border-radius: 0 3px 3px 0;
    box-shadow:
        inset -2px 0 0 #DEB887,
        inset 2px 0 0 #654321,
        2px 2px 0 rgba(0,0,0,0.3);
    filter: drop-shadow(0 0 8px rgba(148,0,211,0.7));
    animation: bookGlow 2s ease-in-out infinite;
}
.reel-cell.symbol-book::after {
    content: '✦';
    position: absolute;
    color: #DA70D6;
    font-size: 10px;
    animation: sparkle 1s ease-in-out infinite;
}

/* TNT BLOCK */
.reel-cell.symbol-tnt {
    background: linear-gradient(180deg, #4A4A4A 0%, #3A3A3A 50%, #2A2A2A 100%);
}
.reel-cell.symbol-tnt::before {
    content: 'TNT';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background:
        linear-gradient(180deg,
            #CC0000 0%, #CC0000 30%,
            #FFFFFF 30%, #FFFFFF 45%,
            #CC0000 45%, #CC0000 100%
        );
    border: 2px solid #8B0000;
    border-top-color: #FF4444;
    border-left-color: #FF4444;
    font-size: 7px;
    font-weight: bold;
    color: #FFFFFF;
    text-shadow: 1px 1px 0 #000;
    box-shadow:
        inset 2px 2px 0 rgba(255,255,255,0.3),
        inset -2px -2px 0 rgba(0,0,0,0.3),
        3px 3px 0 rgba(0,0,0,0.4);
    animation: tntPulse 0.5s ease-in-out infinite;
}

/* Upgraded effect */
.reel-cell.upgraded {
    animation: upgradeFlash 0.5s ease-out;
}
.reel-cell.upgraded::after {
    content: '★';
    position: absolute;
    top: 2px;
    right: 2px;
    color: #4AEDD9;
    font-size: 8px;
    animation: starSpin 1s linear infinite;
}

/* === MINE SHAFT === */
#mine-shaft {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #5A5A5A 0%, #4A4A4A 20%, #3A3A3A 50%, #2A2A2A 100%);
    border: 4px solid #1A1A1A;
    border-top-color: #7A7A7A;
    border-left-color: #7A7A7A;
    overflow: hidden;
    position: relative;
    min-height: 200px;
    box-shadow:
        inset 0 0 40px rgba(0,0,0,0.6),
        4px 4px 0 rgba(0,0,0,0.3);
}

#mine-grid {
    flex: 1;
    padding: 6px;
}

#mine-canvas {
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* === CHESTS === */
#chests-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    padding: 8px;
    background: linear-gradient(180deg, #8B6914 0%, #6B4914 100%);
    border-top: 3px solid #A08030;
}

.chest {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Minecraft chest */
    background: linear-gradient(180deg,
        #B8860B 0%,
        #DAA520 20%,
        #B8860B 50%,
        #8B6914 100%
    );
    border: 3px solid #5D4E37;
    border-top-color: #E8C860;
    border-left-color: #E8C860;
    position: relative;
    box-shadow:
        inset 3px 3px 0 rgba(255,255,255,0.2),
        inset -3px -3px 0 rgba(0,0,0,0.3),
        3px 3px 0 rgba(0,0,0,0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

/* Golden lock */
.chest::before {
    content: '';
    position: absolute;
    width: 10px;
    height: 8px;
    background: linear-gradient(180deg, #FFE44D 0%, #FFD700 50%, #B8860B 100%);
    border: 2px solid #8B6914;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 1px 1px 0 rgba(0,0,0,0.5);
}

.chest::after {
    content: attr(data-mult);
    position: absolute;
    bottom: 3px;
    right: 3px;
    font-size: 8px;
    color: #FFFF00;
    text-shadow: 1px 1px 0 #000, -1px -1px 0 #000;
    font-weight: bold;
}

.chest.rare {
    box-shadow:
        inset 3px 3px 0 rgba(255,255,255,0.2),
        inset -3px -3px 0 rgba(0,0,0,0.3),
        0 0 15px rgba(0,191,255,0.8),
        3px 3px 0 rgba(0,0,0,0.4);
}

.chest.epic {
    box-shadow:
        inset 3px 3px 0 rgba(255,255,255,0.2),
        inset -3px -3px 0 rgba(0,0,0,0.3),
        0 0 20px rgba(148,0,211,0.9),
        3px 3px 0 rgba(0,0,0,0.4);
    animation: epicPulse 1.5s ease-in-out infinite;
}

.chest.legendary {
    box-shadow:
        inset 3px 3px 0 rgba(255,255,255,0.2),
        inset -3px -3px 0 rgba(0,0,0,0.3),
        0 0 25px rgba(255,215,0,1),
        3px 3px 0 rgba(0,0,0,0.4);
    animation: legendaryPulse 1s ease-in-out infinite;
}

.chest.opened {
    transform: scale(1.1);
    background: linear-gradient(180deg, #FFD700 0%, #FFA500 50%, #B8860B 100%);
    animation: chestBurst 0.6s ease-out;
}

.chest.opened::before {
    background: #FFFF00;
    box-shadow: 0 0 15px rgba(255,255,0,1);
}

/* === CONTROLS === */
#controls {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: linear-gradient(180deg, #9A9A9A 0%, #7A7A7A 50%, #5A5A5A 100%);
    border: 4px solid #3A3A3A;
    border-top-color: #BABABA;
    border-left-color: #BABABA;
    box-shadow:
        inset 2px 2px 0 rgba(255,255,255,0.3),
        inset -2px -2px 0 rgba(0,0,0,0.3),
        4px 4px 0 rgba(0,0,0,0.3);
}

#bet-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.btn {
    background: linear-gradient(180deg, #9A9A9A 0%, #7A7A7A 50%, #6A6A6A 100%);
    border: 3px solid #4A4A4A;
    border-top-color: #BABABA;
    border-left-color: #BABABA;
    color: #FFFFFF;
    font-family: 'Press Start 2P', monospace;
    cursor: pointer;
    text-shadow: 2px 2px 0 #2A2A2A;
    box-shadow:
        inset 1px 1px 0 rgba(255,255,255,0.4),
        inset -1px -1px 0 rgba(0,0,0,0.2);
    transition: all 0.1s;
}

.btn:active {
    background: linear-gradient(180deg, #6A6A6A 0%, #5A5A5A 50%, #4A4A4A 100%);
    border-top-color: #4A4A4A;
    border-left-color: #4A4A4A;
    border-bottom-color: #8A8A8A;
    border-right-color: #8A8A8A;
    transform: translateY(3px);
    box-shadow: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-control {
    width: 38px;
    height: 38px;
    font-size: 18px;
}

#bet-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-width: 70px;
}

#bet-display .label {
    font-size: 7px;
    color: #3A3A3A;
    text-shadow: 1px 1px 0 rgba(255,255,255,0.4);
}

#bet-value {
    font-size: 12px;
    color: #FFFFFF;
    text-shadow: 2px 2px 0 #2A2A2A;
}

/* SPIN BUTTON - Emerald Green */
#spin-btn {
    width: 100px;
    height: 50px;
    font-size: 12px;
    background: linear-gradient(180deg, #50C878 0%, #3CB371 50%, #2E8B57 100%);
    border: 4px solid #1A5A3A;
    border-top-color: #7CFC00;
    border-left-color: #7CFC00;
    color: #FFFFFF;
    text-shadow: 2px 2px 0 #1A4A2A, 0 0 10px rgba(80,200,120,0.5);
    box-shadow:
        inset 2px 2px 0 rgba(255,255,255,0.4),
        inset -2px -2px 0 rgba(0,0,0,0.2),
        0 5px 0 #1A4A2A,
        0 0 20px rgba(80,200,120,0.4);
}

#spin-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #60D888 0%, #4CC381 50%, #3E9B67 100%);
    box-shadow:
        inset 2px 2px 0 rgba(255,255,255,0.4),
        inset -2px -2px 0 rgba(0,0,0,0.2),
        0 5px 0 #1A4A2A,
        0 0 30px rgba(80,200,120,0.6);
}

#spin-btn:active:not(:disabled) {
    transform: translateY(5px);
    box-shadow:
        inset 2px 2px 0 rgba(255,255,255,0.4),
        inset -2px -2px 0 rgba(0,0,0,0.2);
}

#spin-btn:disabled {
    background: linear-gradient(180deg, #7A7A7A 0%, #6A6A6A 50%, #5A5A5A 100%);
    border-color: #4A4A4A;
    border-top-color: #8A8A8A;
    border-left-color: #8A8A8A;
    color: #AAAAAA;
    text-shadow: none;
    box-shadow: none;
}

/* === POPUPS === */
#win-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: linear-gradient(180deg, #4A4A4A 0%, #3A3A3A 50%, #2A2A2A 100%);
    border: 5px solid #1A1A1A;
    border-top-color: #6A6A6A;
    border-left-color: #6A6A6A;
    padding: 25px 50px;
    text-align: center;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow:
        inset 3px 3px 0 rgba(255,255,255,0.2),
        inset -3px -3px 0 rgba(0,0,0,0.3),
        0 0 50px rgba(255,215,0,0.7);
}

#win-popup.show {
    transform: translate(-50%, -50%) scale(1);
    animation: winBounce 0.5s ease-out;
}

#win-popup .win-label {
    color: #FFD700;
    font-size: 18px;
    margin-bottom: 10px;
    text-shadow: 3px 3px 0 #8B6914, 0 0 20px rgba(255,215,0,0.8);
    animation: winPulse 0.5s ease-in-out infinite alternate;
}

#win-popup .win-amount {
    color: #55FF55;
    font-size: 28px;
    text-shadow: 3px 3px 0 #1A5A1A, 0 0 15px rgba(85,255,85,0.6);
}

#win-popup .win-mult {
    color: #4AEDD9;
    font-size: 14px;
    margin-top: 10px;
    text-shadow: 2px 2px 0 #1A6A6A;
}

/* === BONUS BANNER === */
#bonus-banner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(180deg, #8B008B 0%, #6A006A 50%, #4A004A 100%);
    border: 5px solid #2A002A;
    border-top-color: #BA00BA;
    border-left-color: #BA00BA;
    padding: 25px 40px;
    text-align: center;
    z-index: 100;
    animation: bonusPulse 0.5s ease-in-out infinite alternate;
    box-shadow:
        inset 3px 3px 0 rgba(255,255,255,0.2),
        0 0 60px rgba(148,0,211,0.8);
}

.bonus-text {
    color: #FFD700;
    font-size: 18px;
    margin-bottom: 10px;
    text-shadow: 3px 3px 0 #4A4A00;
    animation: textGlow 1s ease-in-out infinite alternate;
}

#bonus-info {
    color: #DA70D6;
    font-size: 11px;
    text-shadow: 2px 2px 0 #2A002A;
}

/* === LOADING === */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #4A90D9 0%, #78A7FF 30%, #5D9B41 35%, #8B5A2B 40%, #3A3A3A 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 1000;
}

.loader {
    width: 50px;
    height: 50px;
    background: linear-gradient(180deg, #B8860B 0%, #DAA520 50%, #8B6914 100%);
    border: 4px solid #5D4E37;
    border-top-color: #E8C860;
    border-left-color: #E8C860;
    animation: blockSpin 0.8s ease-in-out infinite;
}

.loader-text {
    font-size: 12px;
    color: #FFFFFF;
    text-shadow: 3px 3px 0 #2A2A2A;
}

/* === ANIMATIONS === */
.hidden { display: none !important; }

@keyframes goldShine {
    0%, 100% { filter: drop-shadow(2px 2px 0 #8B6914) drop-shadow(0 0 8px rgba(255,215,0,0.6)); }
    50% { filter: drop-shadow(2px 2px 0 #8B6914) drop-shadow(0 0 15px rgba(255,215,0,1)); }
}

@keyframes diamondShine {
    0%, 100% { filter: drop-shadow(2px 2px 0 #1A8A7A) drop-shadow(0 0 10px rgba(74,237,217,0.7)); }
    50% { filter: drop-shadow(2px 2px 0 #1A8A7A) drop-shadow(0 0 20px rgba(74,237,217,1)); }
}

@keyframes bookGlow {
    0%, 100% { filter: drop-shadow(0 0 6px rgba(148,0,211,0.5)); }
    50% { filter: drop-shadow(0 0 15px rgba(148,0,211,0.9)); }
}

@keyframes tntPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); filter: brightness(1.2); }
}

@keyframes sparkle {
    0%, 100% { opacity: 0.5; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

@keyframes starSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes upgradeFlash {
    0% { background: rgba(74,237,217,0.8); }
    100% { background: transparent; }
}

@keyframes epicPulse {
    0%, 100% { box-shadow: inset 3px 3px 0 rgba(255,255,255,0.2), 0 0 15px rgba(148,0,211,0.7); }
    50% { box-shadow: inset 3px 3px 0 rgba(255,255,255,0.2), 0 0 30px rgba(148,0,211,1); }
}

@keyframes legendaryPulse {
    0%, 100% { box-shadow: inset 3px 3px 0 rgba(255,255,255,0.2), 0 0 20px rgba(255,215,0,0.7); }
    50% { box-shadow: inset 3px 3px 0 rgba(255,255,255,0.2), 0 0 40px rgba(255,215,0,1); }
}

@keyframes chestBurst {
    0% { transform: scale(1); }
    30% { transform: scale(1.3) rotate(-5deg); }
    60% { transform: scale(1.15) rotate(3deg); }
    100% { transform: scale(1.1); }
}

@keyframes blockSpin {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-25px) rotate(180deg); }
    100% { transform: translateY(0) rotate(360deg); }
}

@keyframes bonusPulse {
    from { transform: translate(-50%, -50%) scale(1); }
    to { transform: translate(-50%, -50%) scale(1.03); }
}

@keyframes textGlow {
    from { text-shadow: 3px 3px 0 #4A4A00, 0 0 10px rgba(255,215,0,0.5); }
    to { text-shadow: 3px 3px 0 #4A4A00, 0 0 25px rgba(255,215,0,1); }
}

@keyframes winBounce {
    0% { transform: translate(-50%, -50%) scale(0); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
    70% { transform: translate(-50%, -50%) scale(0.9); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes winPulse {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10% { transform: translateX(-8px) rotate(-2deg); }
    20% { transform: translateX(8px) rotate(2deg); }
    30% { transform: translateX(-6px) rotate(-1deg); }
    40% { transform: translateX(6px) rotate(1deg); }
    50% { transform: translateX(-4px); }
    60% { transform: translateX(4px); }
    70% { transform: translateX(-2px); }
    80% { transform: translateX(2px); }
}

.shake { animation: shake 0.5s ease-in-out; }

/* Reel spinning */
.reel.spinning .reel-cell {
    animation: reelSpin 0.08s linear infinite;
}

@keyframes reelSpin {
    0% { opacity: 1; transform: translateY(-2px); }
    50% { opacity: 0.7; transform: translateY(2px); }
    100% { opacity: 1; transform: translateY(-2px); }
}

/* Win counting */
.win-counting {
    animation: countBounce 0.15s ease-out;
    color: #77FF77 !important;
}

@keyframes countBounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* === RESPONSIVE === */
@media (max-height: 680px) {
    #reels { height: 100px; }
    #header { padding: 6px 10px; }
    .stat-value { font-size: 10px; }
    #controls { padding: 8px; }
    #spin-btn { height: 44px; width: 90px; font-size: 11px; }
    .btn-control { width: 34px; height: 34px; font-size: 16px; }
}

@media (max-width: 380px) {
    #app { padding: 5px; gap: 5px; }
    .btn-control { width: 32px; height: 32px; font-size: 14px; }
    #bet-display { min-width: 55px; }
    #spin-btn { width: 80px; }
}
