/* ===== GLOBAL STYLES ===== */
:root {
    --gold: #ffd700;
    --gold-dark: #b8860b;
    --gold-light: #fff4b3;
    --green-dark: #1a3a1a;
    --green-jungle: #2d5a2d;
    --purple-dark: #2a1a4a;
    --bg-gradient: linear-gradient(180deg, #1a3a1a 0%, #0d1f0d 100%);
    --panel-bg: rgba(0, 0, 0, 0.7);
    --text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    --glow-gold: 0 0 20px rgba(255, 215, 0, 0.6);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    overflow: hidden;
    color: #fff;
}

/* ===== GAME CONTAINER ===== */
#game-container {
    width: 100vw;
    height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    background: url('../assets/images/game_background_1769684987123.png') center/cover no-repeat;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
}

/* ===== LOGO ===== */
#logo-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 5px;
}

#game-logo {
    height: 80px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

/* ===== COMBO METER ===== */
#combo-meter {
    position: absolute;
    top: 100px;
    right: 20px;
    background: var(--panel-bg);
    border: 2px solid var(--gold);
    border-radius: 15px;
    padding: 10px 15px;
    text-align: center;
    box-shadow: var(--glow-gold);
}

.combo-label {
    font-size: 12px;
    color: var(--gold);
    font-weight: 700;
    letter-spacing: 2px;
}

.combo-diamonds {
    display: flex;
    gap: 5px;
    margin: 8px 0;
}

.diamond {
    font-size: 18px;
    opacity: 0.3;
    transition: all 0.3s ease;
}

.diamond.active {
    opacity: 1;
    transform: scale(1.2);
    filter: drop-shadow(0 0 8px #00ffff);
}

.combo-count {
    font-size: 24px;
    font-weight: 800;
    color: var(--gold);
    text-shadow: var(--text-shadow);
}

/* ===== WAYS COUNTER ===== */
#ways-counter {
    position: absolute;
    top: 100px;
    left: 20px;
    background: var(--panel-bg);
    border: 2px solid var(--gold);
    border-radius: 15px;
    padding: 10px 20px;
    text-align: center;
    box-shadow: var(--glow-gold);
}

#ways-number {
    display: block;
    font-size: 32px;
    font-weight: 800;
    color: var(--gold);
    text-shadow: var(--text-shadow);
}

.ways-label {
    font-size: 12px;
    color: var(--gold-light);
    letter-spacing: 2px;
}

/* ===== REELS CONTAINER ===== */
#reels-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 900px;
}

#reels-frame {
    background: linear-gradient(180deg, rgba(139, 90, 43, 0.9) 0%, rgba(101, 67, 33, 0.9) 100%);
    border: 4px solid var(--gold);
    border-radius: 20px;
    padding: 15px;
    box-shadow: 
        inset 0 0 30px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(255, 215, 0, 0.3),
        0 10px 40px rgba(0, 0, 0, 0.5);
}

#reels {
    display: flex;
    gap: 8px;
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
    padding: 10px;
    border-radius: 12px;
    border: 2px solid #3a3a5a;
}

.reel {
    width: 120px;
    height: 360px;
    background: linear-gradient(180deg, #0a0a15 0%, #151525 50%, #0a0a15 100%);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    border: 1px solid #2a2a4a;
}

.reel::before,
.reel::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 40px;
    z-index: 10;
    pointer-events: none;
}

.reel::before {
    top: 0;
    background: linear-gradient(180deg, rgba(10, 10, 21, 0.9) 0%, transparent 100%);
}

.reel::after {
    bottom: 0;
    background: linear-gradient(0deg, rgba(10, 10, 21, 0.9) 0%, transparent 100%);
}

.reel-strip {
    display: flex;
    flex-direction: column;
    transition: transform 0.1s linear;
}

.symbol {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.symbol img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    transition: all 0.3s ease;
}

.symbol.winning img {
    animation: symbolWin 0.5s ease-in-out infinite;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.8));
}

.symbol.cascading {
    animation: symbolCascade 0.3s ease-out forwards;
}

@keyframes symbolWin {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

@keyframes symbolCascade {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.5); }
}

/* ===== WIN DISPLAY ===== */
#win-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(ellipse, rgba(255, 215, 0, 0.9) 0%, rgba(184, 134, 11, 0.9) 100%);
    padding: 30px 60px;
    border-radius: 20px;
    text-align: center;
    z-index: 100;
    animation: winPopup 0.5s ease-out;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.8);
}

#win-display.hidden {
    display: none;
}

.win-text {
    font-size: 24px;
    font-weight: 700;
    color: #8b4513;
    text-transform: uppercase;
    letter-spacing: 4px;
}

.win-amount {
    font-size: 56px;
    font-weight: 800;
    color: #fff;
    text-shadow: 
        2px 2px 0 #8b4513,
        4px 4px 0 rgba(0, 0, 0, 0.3);
}

@keyframes winPopup {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.1); }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* ===== CONTROL PANEL ===== */
#control-panel {
    width: 100%;
    max-width: 900px;
    background: var(--panel-bg);
    border: 2px solid var(--gold);
    border-radius: 20px;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    backdrop-filter: blur(10px);
}

.control-left,
.control-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.control-center {
    display: flex;
    align-items: center;
    gap: 30px;
}

.control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    background: linear-gradient(180deg, #3a3a3a 0%, #1a1a1a 100%);
    color: var(--gold);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: linear-gradient(180deg, #4a4a4a 0%, #2a2a2a 100%);
    box-shadow: var(--glow-gold);
}

.control-btn.active {
    background: linear-gradient(180deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: #1a1a1a;
}

.balance-display,
.win-panel {
    text-align: center;
}

.balance-display .label,
.win-panel .label,
.bet-display .label {
    display: block;
    font-size: 10px;
    color: var(--gold-light);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.balance-display .value,
.win-panel .value,
.bet-display .value {
    font-size: 24px;
    font-weight: 700;
    color: var(--gold);
}

/* Bet Controls */
.bet-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bet-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    background: linear-gradient(180deg, #3a3a3a 0%, #1a1a1a 100%);
    color: var(--gold);
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bet-btn:hover {
    background: linear-gradient(180deg, #4a4a4a 0%, #2a2a2a 100%);
    box-shadow: var(--glow-gold);
}

.bet-display {
    text-align: center;
    min-width: 80px;
}

/* Spin Button */
#spin-btn {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid var(--gold);
    background: linear-gradient(180deg, #2a2a2a 0%, #0a0a0a 100%);
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    box-shadow: 
        0 0 20px rgba(255, 215, 0, 0.4),
        inset 0 0 20px rgba(0, 0, 0, 0.5);
}

#spin-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#spin-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
}

#spin-btn:active {
    transform: scale(0.95);
}

#spin-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

#spin-btn.spinning img {
    animation: spinRotate 0.5s linear infinite;
}

@keyframes spinRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== FREE SPINS COUNTER ===== */
#free-spins-counter {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(180deg, #6b2fb5 0%, #4a1f7a 100%);
    border: 3px solid var(--gold);
    border-radius: 30px;
    padding: 8px 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 50;
    box-shadow: 0 0 20px rgba(107, 47, 181, 0.6);
}

#free-spins-counter.hidden {
    display: none;
}

.fs-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 2px;
}

.fs-count {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    text-shadow: var(--text-shadow);
}

/* ===== OVERLAYS ===== */
#free-spins-overlay,
#bonus-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    animation: fadeIn 0.3s ease;
}

#free-spins-overlay.hidden,
#bonus-overlay.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.free-spins-content,
.bonus-content {
    background: linear-gradient(180deg, #2d1b4e 0%, #1a0f2e 100%);
    border: 4px solid var(--gold);
    border-radius: 30px;
    padding: 40px 60px;
    text-align: center;
    box-shadow: 
        0 0 50px rgba(255, 215, 0, 0.4),
        inset 0 0 30px rgba(107, 47, 181, 0.3);
    animation: overlayPopup 0.5s ease-out;
}

@keyframes overlayPopup {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.free-spins-content h2,
.bonus-content h2 {
    font-size: 36px;
    color: var(--gold);
    margin-bottom: 20px;
    text-shadow: var(--text-shadow);
}

.free-spins-count {
    font-size: 80px;
    font-weight: 800;
    color: #fff;
    text-shadow: 
        0 0 20px rgba(255, 215, 0, 0.8),
        2px 2px 0 var(--gold-dark);
    margin-bottom: 30px;
}

#start-free-spins,
#collect-bonus {
    background: linear-gradient(180deg, var(--gold) 0%, var(--gold-dark) 100%);
    border: none;
    border-radius: 30px;
    padding: 15px 50px;
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#start-free-spins:hover,
#collect-bonus:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
}

/* Bonus Game */
.bonus-stage {
    margin-bottom: 30px;
}

.gorilla-image {
    font-size: 100px;
    margin-bottom: 15px;
    animation: gorillaIdle 1s ease-in-out infinite;
}

@keyframes gorillaIdle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.bonus-stage p {
    font-size: 20px;
    color: var(--gold-light);
}

.bonus-choices {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 20px;
}

.bonus-choice {
    background: linear-gradient(180deg, #4a3a6a 0%, #2a1a4a 100%);
    border: 3px solid var(--gold);
    border-radius: 15px;
    padding: 20px 30px;
    font-size: 18px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bonus-choice:hover {
    background: linear-gradient(180deg, #5a4a7a 0%, #3a2a5a 100%);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
}

.bonus-result {
    margin-top: 30px;
}

.bonus-result.hidden {
    display: none;
}

.result-multiplier {
    font-size: 72px;
    font-weight: 800;
    color: var(--gold);
    text-shadow: 
        0 0 20px rgba(255, 215, 0, 0.8),
        2px 2px 0 rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
    animation: multiplierPulse 0.5s ease-in-out infinite;
}

@keyframes multiplierPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ===== UTILITIES ===== */
.hidden {
    display: none !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    #game-logo {
        height: 60px;
    }

    .reel {
        width: 80px;
        height: 240px;
    }

    .symbol {
        width: 80px;
        height: 80px;
    }

    .symbol img {
        width: 70px;
        height: 70px;
    }

    #spin-btn {
        width: 80px;
        height: 80px;
    }

    #combo-meter,
    #ways-counter {
        display: none;
    }

    .balance-display .value,
    .win-panel .value,
    .bet-display .value {
        font-size: 18px;
    }

    .bonus-choice {
        padding: 15px 20px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    #reels-frame {
        padding: 8px;
    }

    #reels {
        gap: 4px;
        padding: 6px;
    }

    .reel {
        width: 60px;
        height: 180px;
    }

    .symbol {
        width: 60px;
        height: 60px;
    }

    .symbol img {
        width: 50px;
        height: 50px;
    }

    #control-panel {
        padding: 10px 15px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .control-left,
    .control-right {
        flex: 1;
        justify-content: center;
    }

    .control-center {
        width: 100%;
        order: -1;
        justify-content: center;
    }
}
