:root {
    --reel-bg: #000000;
    --reel-border: #ffd700;
    --primary-color: #ff00ff;
    --secondary-color: #00ffff;
    --danger-color: #ff0000;
    --safe-color: #00ff00;
    --symbol-size: 150px;
    --visible-rows: 1;
    /* Only show 1 middle row effectively, but we render 3 for context */
}

body {
    margin: 0;
    padding: 0;
    background-color: #1a0b2e;
    font-family: 'Roboto', sans-serif;
    color: white;
    overflow: hidden;
    /* Prevent scrolling on TV */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.party-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/bg.png');
    background-size: cover;
    background-position: center;
    opacity: 0.6;
    z-index: -1;
}

.main-container {
    text-align: center;
    width: 90%;
    max-width: 1200px;
    position: relative;
    z-index: 1;
}

h1 {
    font-family: 'Bungee Spice', cursive;
    font-size: 4rem;
    margin-bottom: 2rem;
    text-shadow: 4px 4px 0px #000;
}

.slot-machine {
    background: linear-gradient(135deg, #2a2a2a 0%, #000000 100%);
    padding: 40px;
    border-radius: 30px;
    border: 8px solid var(--reel-border);
    box-shadow: 0 0 50px rgba(255, 0, 255, 0.5);
    display: inline-block;
}

.reels-container {
    display: flex;
    gap: 20px;
    background-color: #000;
    padding: 20px;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    height: var(--symbol-size);
    /* Show one symbol height */
}

.reel {
    width: var(--symbol-size);
    height: var(--symbol-size);
    background-color: #fff;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.reel-strip {
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    /* Will translate this for animation */
}

.symbol {
    width: var(--symbol-size);
    height: var(--symbol-size);
    display: flex;
    justify-content: center;
    align-items: center;
}

.symbol img {
    width: 80%;
    height: 80%;
    object-fit: contain;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));
}

.payline {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: rgba(255, 0, 0, 0.5);
    transform: translateY(-50%);
    z-index: 10;
    pointer-events: none;
    display: none;
    /* Hide default payline, we want it clean */
}

.controls {
    margin-top: 40px;
}

.spin-button {
    font-family: 'Bungee Spice', cursive;
    font-size: 3rem;
    padding: 20px 60px;
    background: linear-gradient(to bottom, #ff00ff, #aa00aa);
    border: none;
    border-radius: 50px;
    color: white;
    cursor: pointer;
    box-shadow: 0 10px 0 #660066, 0 20px 20px rgba(0, 0, 0, 0.5);
    transition: all 0.1s;
    text-shadow: 2px 2px 0 #000;
}

.spin-button:active {
    transform: translateY(10px);
    box-shadow: 0 0 0 #660066, 0 0px 5px rgba(0, 0, 0, 0.5);
}

.spin-button:disabled {
    filter: grayscale(1);
    cursor: not-allowed;
    transform: translateY(10px);
    box-shadow: none;
}

/* Overlay Styles */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.5s;
    backdrop-filter: blur(10px);
}

.hidden {
    opacity: 0;
    pointer-events: none;
    display: none;
    /* Needed to fully hide interaction */
}

.overlay-content {
    text-align: center;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#overlay-title {
    font-family: 'Bungee Spice', cursive;
    font-size: 6rem;
    margin: 0;
    margin-bottom: 20px;
}

.eliminated-mode #overlay-title {
    color: var(--danger-color);
    text-shadow: 0 0 20px var(--danger-color);
    animation: shake 0.5s infinite;
}

.safe-mode #overlay-title {
    color: var(--safe-color);
    text-shadow: 0 0 20px var(--safe-color);
}

#reset-btn {
    font-size: 2rem;
    padding: 15px 40px;
    background-color: white;
    color: black;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
}

/* Animations */
@keyframes spin {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-1000%);
    }

    /* Placeholder, controlled by JS */
}

@keyframes popIn {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

@keyframes shake {
    0% {
        transform: translate(1px, 1px) rotate(0deg);
    }

    10% {
        transform: translate(-1px, -2px) rotate(-1deg);
    }

    20% {
        transform: translate(-3px, 0px) rotate(1deg);
    }

    30% {
        transform: translate(3px, 2px) rotate(0deg);
    }

    40% {
        transform: translate(1px, -1px) rotate(1deg);
    }

    50% {
        transform: translate(-1px, 2px) rotate(-1deg);
    }

    60% {
        transform: translate(-3px, 1px) rotate(0deg);
    }

    70% {
        transform: translate(3px, 1px) rotate(-1deg);
    }

    80% {
        transform: translate(-1px, -1px) rotate(1deg);
    }

    90% {
        transform: translate(1px, 2px) rotate(0deg);
    }

    100% {
        transform: translate(1px, -2px) rotate(-1deg);
    }
}

/* TV Optimization Media Query */
@media (min-width: 1920px) {
    :root {
        --symbol-size: 250px;
    }

    h1 {
        font-size: 6rem;
    }

    .spin-button {
        font-size: 4rem;
    }
}

.back-link {
    display: block;
    margin-top: 50px;
    color: rgba(255, 255, 255, 0.3);
    text-decoration: none;
    font-family: 'Roboto', sans-serif;
    font-size: 0.9rem;
    padding: 10px;
    transition: all 0.3s ease;
    border: none;
    background: none;
}

.back-link:hover {
    color: rgba(255, 255, 255, 0.8);
    background: none;
    box-shadow: none;
    text-decoration: underline;
}
/* Version Switcher Button - Matched to Reference */
.version-link {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
}

.version-link a {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(145deg, #9b59b6, #8e44ad);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1rem;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.4);
    transition: 0.3s;
    border: none;
}

.version-link a:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(155, 89, 182, 0.6);
    color: white;
    text-decoration: none;
}
