﻿.roulette-arena {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    overflow: hidden;
    position: relative;
    background: radial-gradient(circle at center, var(--bg-surface), var(--bg-base) 80%);
}

/* Winner Banner Overlay */
.winner-banner {
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translateX(-50%) scale(1);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: 2px solid var(--accent);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.5);
    padding: 15px 40px;
    border-radius: 50px;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
}

    .winner-banner.hidden {
        transform: translateX(-50%) scale(0.5);
        opacity: 0;
        pointer-events: none;
    }

#winnerText {
    margin: 0;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1px;
}

/* Circular Table Layout */
.table-container {
    position: relative;
    width: 90vmin;
    height: 90vmin;
    max-width: 600px;
    max-height: 600px;
    border-radius: 50%;
}

.player-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

/* Player "Chips" */
.player-chip {
    position: absolute;
    width: 15vmin;
    height: 15vmin;
    max-width: 90px;
    max-height: 90px;
    /* Formula perfectly places items around a circle based on JS variables */
    left: calc(50% + (var(--x) * 40%));
    top: calc(50% + (var(--y) * 40%));
    transform: translate(-50%, -50%);
    background: var(--bg-surface);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    transition: all 0.15s ease-out;
    z-index: 10;
}

    .player-chip.is-ready {
        border-color: #22c55e;
        box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
    }

    .player-chip .chip-name {
        position: absolute;
        bottom: -25px;
        font-size: 0.8rem;
        white-space: nowrap;
        color: var(--text-muted);
        font-weight: 600;
        background: var(--bg-base);
        padding: 2px 8px;
        border-radius: 12px;
    }

    .player-chip .chip-initials {
        font-size: 1.5rem;
        font-weight: bold;
        color: var(--text-main);
    }

    .player-chip.is-me .chip-initials {
        color: var(--accent);
    }

    /* Roulette Highlight Animation */
    .player-chip.highlight {
        background: var(--accent);
        border-color: #fff;
        transform: translate(-50%, -50%) scale(1.3);
        box-shadow: 0 0 30px var(--accent), inset 0 0 10px rgba(255,255,255,0.5);
        z-index: 20;
    }

        .player-chip.highlight .chip-initials {
            color: #fff;
        }

    /* Winner Celebration Animation */
    .player-chip.winner {
        background: #22c55e;
        border-color: #fff;
        transform: translate(-50%, -50%) scale(1.4);
        box-shadow: 0 0 40px #22c55e, inset 0 0 15px rgba(255,255,255,0.6);
        z-index: 30;
        animation: winnerPulse 1s infinite alternate;
    }

        .player-chip.winner .chip-initials {
            color: #fff;
        }

@keyframes winnerPulse {
    0% {
        transform: translate(-50%, -50%) scale(1.4);
        box-shadow: 0 0 30px #22c55e;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.6);
        box-shadow: 0 0 60px #22c55e;
    }
}

/* Central Arcade Button */
.center-console {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 35vmin;
    height: 35vmin;
    max-width: 220px;
    max-height: 220px;
    border-radius: 50%;
    background: #111; /* Dark rim */
    padding: 10px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.8), inset 0 2px 5px rgba(255,255,255,0.1);
    z-index: 5;
}

.btn-arcade {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: none;
    background: radial-gradient(circle at 50% 20%, #3b82f6, #1e3a8a);
    box-shadow: 0 12px 0 #172554, 0 15px 20px rgba(0,0,0,0.6), inset 0 5px 10px rgba(255,255,255,0.4);
    cursor: pointer;
    outline: none;
    padding: 0;
    transition: all 0.1s ease;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none; /* Prevents scroll/zoom when holding */
}

.btn-arcade-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    pointer-events: none;
}

.btn-title {
    font-size: 2rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    letter-spacing: 2px;
}

.btn-subtitle {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    margin-top: 5px;
}

.btn-arcade:disabled {
    background: radial-gradient(circle at 50% 20%, #475569, #1e293b);
    box-shadow: 0 12px 0 #0f172a, 0 15px 20px rgba(0,0,0,0.6);
    cursor: not-allowed;
}

/* Active / Pressed State */
.btn-arcade:not(:disabled):active, .btn-arcade.is-holding {
    transform: translateY(12px);
    box-shadow: 0 0px 0 #172554, 0 5px 10px rgba(0,0,0,0.5), inset 0 5px 20px rgba(0,0,0,0.6);
    background: radial-gradient(circle at 50% 20%, #22c55e, #14532d);
}

    .btn-arcade.is-holding .btn-title {
        text-shadow: 0 0 10px rgba(255,255,255,0.8);
    }
