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

body {
    font-family: 'Tilt Neon', sans-serif;
    background: #1a1a1a;
    /* Casino carpet pattern background */
    background-image: url('https://images.unsplash.com/photo-1601662528567-526cd06f6582?q=80&w=1920');
    background-size: cover;
    background-attachment: fixed;
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    max-width: 1200px;
    width: 100%;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* Add overlay to make text more readable */
.container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: -1;
}

header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

/* Casino-style title */
h1 {
    font-family: 'Rubik Vinyl', cursive;
    font-size: 4rem;
    margin-bottom: 1rem;
    text-shadow: 
        0 0 10px #fff,
        0 0 20px #fff,
        0 0 30px #e60073,
        0 0 40px #e60073,
        0 0 50px #e60073,
        0 0 60px #e60073,
        0 0 70px #e60073;
    animation: neon 1.5s ease-in-out infinite alternate;
}

/* Neon animation for title */
@keyframes neon {
    from {
        text-shadow: 
            0 0 10px #fff,
            0 0 20px #fff,
            0 0 30px #e60073,
            0 0 40px #e60073,
            0 0 50px #e60073;
    }
    to {
        text-shadow: 
            0 0 20px #fff,
            0 0 30px #ff4da6,
            0 0 40px #ff4da6,
            0 0 50px #ff4da6,
            0 0 60px #ff4da6;
    }
}

/* Theme selector styles */
.theme-selector {
    margin-bottom: 2rem;
}

.theme-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.theme-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    background: linear-gradient(145deg, #1a1a1a, #4a4a4a);
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 
        0 5px 15px rgba(0, 0, 0, 0.3),
        inset 0 -2px 5px rgba(0, 0, 0, 0.3);
    text-decoration: none;
    display: inline-block;
}

.theme-btn:hover {
    transform: scale(1.05);
    background: linear-gradient(145deg, #4a4a4a, #1a1a1a);
}

/* Game container with glass morphism effect */
.game-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.balance {
    font-size: 1.5rem;
    font-weight: bold;
}

.bet-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bet-controls button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    background: #4a4a4a;
    color: white;
}

#bet-amount {
    width: 80px;
    padding: 0.5rem;
    text-align: center;
    border: none;
    border-radius: 5px;
    background: #4a4a4a;
    color: white;
}

/* Pull tabs with metallic texture */
.pull-tabs-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
}

.pull-tab {
    width: 120px;
    height: 200px;
    position: relative;
    perspective: 1000px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.tab-front, .tab-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    transition: transform 0.6s;
}

.tab-front {
    background: linear-gradient(45deg, #ff6b6b, #ff8e8e);
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    /* Casino pattern background */
    background-image: url('https://images.unsplash.com/photo-1595758605214-909d1f5a8f1c?q=80&w=500');
    background-size: cover;
}

.tab-back {
    background: #4a4a4a;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transform: rotateY(180deg); /* Start rotated so it's hidden initially */
}

.pull-tab.revealed .tab-front {
    transform: rotateY(180deg);
}

.pull-tab.revealed .tab-back {
    transform: rotateY(0deg);
}

/* Game controls */
.game-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.play-button, .cashout-button {
    padding: 1rem 2rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
    box-shadow: 
        0 5px 15px rgba(0, 0, 0, 0.3),
        inset 0 -2px 5px rgba(0, 0, 0, 0.3);
}

.play-button {
    background: linear-gradient(145deg, #4CAF50, #45a049);
    color: white;
}

.cashout-button {
    background: linear-gradient(145deg, #f44336, #e53935);
    color: white;
}

.play-button:hover, .cashout-button:hover {
    transform: scale(1.05);
}

/* Win display with enhanced visibility */
.win-display {
    text-align: center;
    margin-top: 1rem;
}

.win-amount {
    font-family: 'Rubik Vinyl', cursive;
    font-size: 3rem;
    text-shadow: 
        0 0 10px #4CAF50,
        0 0 20px #4CAF50,
        0 0 30px #4CAF50;
}

.win-message {
    font-size: 1.2rem;
    margin-top: 0.5rem;
}

/* Theme variations with texture */
.theme-wild-west .tab-front {
    background: linear-gradient(45deg, #8B4513, #DEB887);
    background-image: url('https://images.unsplash.com/photo-1516796181074-bf453fbfa3e6?q=80&w=500');
    background-size: cover;
}

.theme-volcano .tab-front {
    background: linear-gradient(45deg, #FF4500, #FF6347);
    background-image: url('https://images.unsplash.com/photo-1554232682-b9ef9c92f8de?q=80&w=500');
    background-size: cover;
}

.theme-gold-rush .tab-front {
    background: linear-gradient(45deg, #FFD700, #DAA520);
    background-image: url('https://images.unsplash.com/photo-1610375461246-83df859d849d?q=80&w=500');
    background-size: cover;
}

.theme-jekyll .tab-front {
    background: linear-gradient(45deg, #4B0082, #800080);
    background-image: url('https://images.unsplash.com/photo-1518544801976-3e159e50e5bb?q=80&w=500');
    background-size: cover;
}

/* Stats container with glass effect */
.stats-container {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    border-radius: 10px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-item {
    padding: 0.8rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
    transition: transform 0.2s;
}

.stat-item:hover {
    transform: scale(1.02);
}

.stat-item span {
    color: #4CAF50;
    margin-left: 0.5rem;
}

/* Auto-play controls styles */
.auto-play-controls {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.auto-play-button {
    background: linear-gradient(145deg, #2196F3, #1976D2);
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
    box-shadow: 
        0 5px 15px rgba(0, 0, 0, 0.3),
        inset 0 -2px 5px rgba(0, 0, 0, 0.3);
}

.auto-play-button:hover {
    transform: scale(1.05);
    background: linear-gradient(145deg, #1976D2, #2196F3);
}

.auto-play-button:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
}

.stop-button {
    background: linear-gradient(145deg, #f44336, #e53935);
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
    box-shadow: 
        0 5px 15px rgba(0, 0, 0, 0.3),
        inset 0 -2px 5px rgba(0, 0, 0, 0.3);
}

.stop-button:hover {
    transform: scale(1.05);
    background: linear-gradient(145deg, #e53935, #f44336);
}

.stop-button:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
}

#auto-play-rounds {
    width: 70px;
    padding: 0.8rem;
    text-align: center;
    border: none;
    border-radius: 5px;
    background: #4a4a4a;
    color: white;
    font-weight: bold;
}

/* Animation keyframes */
@keyframes dust {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes lava {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes sparkle {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

@keyframes mist {
    0% { filter: blur(0px); }
    50% { filter: blur(2px); }
    100% { filter: blur(0px); }
}

/* Animation classes */
.animation-dust { animation: dust 1s ease-in-out; }
.animation-lava { animation: lava 1s ease-in-out; }
.animation-sparkle { animation: sparkle 0.5s ease-in-out 3; }
.animation-mist { animation: mist 1s ease-in-out; }

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .pull-tab {
        width: 100px;
        height: 160px;
    }

    .theme-buttons {
        flex-direction: column;
    }

    .game-info {
        flex-direction: column;
        gap: 1rem;
    }

    .stats-container {
        grid-template-columns: 1fr;
        gap: 0.8rem;
        padding: 1rem;
    }

    .auto-play-controls {
        flex-direction: column;
        gap: 0.8rem;
    }

    .stat-item {
        padding: 0.6rem;
        font-size: 0.9rem;
    }

    .auto-play-button,
    .stop-button {
        width: 100%;
        padding: 0.6rem 1rem;
    }

    #auto-play-rounds {
        width: 100%;
        padding: 0.6rem;
    }
}
