/* === SLOT GAME OVERLAY === */
#slotGameOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(5px);
    z-index: 150;
    
    /* DEFAULT STATE: HIDDEN */
    display: none; 
    
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* ACTIVE STATE: VISIBLE */
#slotGameOverlay.open {
    display: flex;
    opacity: 1;
}

/* === GAME CONTAINER === */
.game-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 600px; /* Optimal mobile width */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #1a2a2a 0%, #000000 100%);
}

canvas#slotCanvas {
    width: 100%;
    height: auto;
    max-height: 65vh;
    object-fit: contain;
    box-shadow: 0 0 50px rgba(244, 198, 110, 0.1);
}

/* === UI OVERLAY (Controls & Stats) === */
.ui-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    padding-bottom: 40px; /* Safe area for mobile */
    background: linear-gradient(to top, #000 0%, rgba(0,0,0,0.9) 70%, transparent 100%);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 10;
}

/* Stats Panel */
.stats-panel {
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
}

.stat-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(244, 198, 110, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    min-width: 100px;
    text-align: center;
}

.stat-box .label {
    display: block;
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-box .value {
    display: block;
    font-size: 16px;
    font-weight: bold;
    color: #F4C66E;
}

/* === SPIN BUTTON === */
#spinButton {
    width: 80px;
    height: 80px;
    margin: -40px auto 0;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ffd700, #ff8c00);
    border: 4px solid #fff;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
    color: #4a0404;
    font-weight: 900;
    font-size: 16px;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s;
}

#spinButton:active { transform: scale(0.95); }
#spinButton:disabled { filter: grayscale(1); transform: scale(0.95); }

/* === CONTROLS === */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 10px;
}

.controls button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #333;
    border: 1px solid #555;
    color: white;
    font-size: 18px;
}

.controls span {
    font-size: 14px;
    color: #fff;
    font-weight: bold;
}

/* === TOAST === */
#toastContainer {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    width: 80%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.toast {
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.1);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.win { border-color: #F4C66E; color: #F4C66E; }
.toast.error { border-color: #ff4757; color: #ff4757; }