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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a0a2e 0%, #16213e 50%, #0f0f23 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.game-container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
    text-align: center;
}

.game-header h1 {
    font-size: 2.5rem;
    color: #ffd700;
    text-shadow: 
        0 0 10px #ffd700,
        0 0 20px #ffa500,
        0 0 30px #ff6600;
    margin-bottom: 5px;
    animation: glow 2s ease-in-out infinite alternate;
}

.game-header .subtitle {
    font-size: 1rem;
    color: #ff6b9d;
    text-transform: uppercase;
    letter-spacing: 8px;
    text-shadow: 0 0 10px #ff6b9d;
}

@keyframes glow {
    from {
        text-shadow: 
            0 0 10px #ffd700,
            0 0 20px #ffa500,
            0 0 30px #ff6600;
    }
    to {
        text-shadow: 
            0 0 20px #ffd700,
            0 0 30px #ffa500,
            0 0 40px #ff6600,
            0 0 50px #ff3300;
    }
}

.screen {
    margin-top: 20px;
}

.screen.hidden {
    display: none;
}

/* Start Screen */
.welcome-box {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid #ffd700;
    border-radius: 20px;
    padding: 30px 20px;
    box-shadow: 
        0 0 20px rgba(255, 215, 0, 0.3),
        inset 0 0 30px rgba(255, 215, 0, 0.1);
}

.welcome-box h2 {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.welcome-text {
    color: #aaa;
    margin-bottom: 20px;
}

.starting-coins {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.2rem;
    color: #ffd700;
    margin-bottom: 25px;
}

.coin-icon {
    font-size: 1.5rem;
    animation: bounce 1s ease-in-out infinite;
}

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

.paytable {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 25px;
}

.paytable h3 {
    color: #ff6b9d;
    font-size: 1rem;
    margin-bottom: 15px;
    text-shadow: 0 0 10px #ff6b9d;
}

.paytable-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.1rem;
}

.paytable-row:last-child {
    border-bottom: none;
}

.paytable-row.jackpot {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.2), rgba(255, 107, 157, 0.2));
    border-radius: 10px;
    animation: jackpotGlow 2s ease-in-out infinite alternate;
}

@keyframes jackpotGlow {
    from { box-shadow: 0 0 5px rgba(255, 215, 0, 0.3); }
    to { box-shadow: 0 0 20px rgba(255, 215, 0, 0.6); }
}

.paytable-row.small {
    font-size: 0.9rem;
    color: #aaa;
}

.multiplier {
    color: #4ade80;
    font-weight: bold;
}

.paytable-row.jackpot .multiplier {
    color: #ffd700;
    text-shadow: 0 0 10px #ffd700;
}

.start-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 18px 30px;
    font-size: 1.3rem;
    font-weight: bold;
    color: #1a0a2e;
    background: linear-gradient(180deg, #ffd700, #ffa500);
    border: none;
    border-radius: 15px;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 
        0 5px 0 #cc8800,
        0 10px 20px rgba(255, 165, 0, 0.4);
    transition: all 0.2s;
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 7px 0 #cc8800,
        0 15px 30px rgba(255, 165, 0, 0.5);
}

.start-btn:active {
    transform: translateY(3px);
    box-shadow: 
        0 2px 0 #cc8800,
        0 5px 10px rgba(255, 165, 0, 0.3);
}

.btn-icon {
    font-size: 1.5rem;
}

/* Game Area */
.game-stats {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 20px;
}

.stat-box {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 12px 10px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.stat-box.coins {
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.stat-box.high-score {
    border-color: #ff6b9d;
    box-shadow: 0 0 15px rgba(255, 107, 157, 0.3);
}

.stat-label {
    display: block;
    font-size: 0.7rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
}

.stat-box.coins .stat-value {
    color: #ffd700;
}

.stat-box.high-score .stat-value {
    color: #ff6b9d;
}

/* Slot Machine */
.slot-machine {
    perspective: 1000px;
}

.machine-frame {
    background: linear-gradient(180deg, #2a1a4a, #1a0a2e);
    border: 4px solid #ffd700;
    border-radius: 25px;
    padding: 20px;
    box-shadow: 
        0 0 30px rgba(255, 215, 0, 0.3),
        inset 0 0 50px rgba(255, 215, 0, 0.1);
    position: relative;
}

.machine-top {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.jackpot-light {
    width: 15px;
    height: 15px;
    background: #ff3366;
    border-radius: 50%;
    box-shadow: 0 0 10px #ff3366;
    animation: blink 0.5s ease-in-out infinite alternate;
}

@keyframes blink {
    from { opacity: 0.5; box-shadow: 0 0 5px #ff3366; }
    to { opacity: 1; box-shadow: 0 0 20px #ff3366; }
}

.jackpot-text {
    color: #ffd700;
    font-size: 1.2rem;
    font-weight: bold;
    text-shadow: 0 0 10px #ffd700;
    animation: pulse 1s ease-in-out infinite;
}

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

.reels-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    background: #0a0a1a;
    border-radius: 15px;
    padding: 15px;
    border: 3px solid #333;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8);
}

.reel {
    width: 80px;
    height: 100px;
    background: linear-gradient(180deg, #1a1a2e, #0a0a1a, #1a1a2e);
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #444;
    position: relative;
}

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

.reel::before {
    top: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.8), transparent);
}

.reel::after {
    bottom: 0;
    background: linear-gradient(0deg, rgba(0,0,0,0.8), transparent);
}

.reel-strip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    transition: transform 0.1s ease-out;
}

.symbol {
    font-size: 3rem;
    line-height: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reel.spinning .reel-strip {
    animation: spinReel 0.1s linear infinite;
}

@keyframes spinReel {
    0% { transform: translateY(0); }
    100% { transform: translateY(-100px); }
}

.win-line {
    position: absolute;
    left: 10px;
    right: 10px;
    top: 50%;
    height: 4px;
    background: transparent;
    border-radius: 2px;
    z-index: 5;
    pointer-events: none;
}

.win-line.active {
    background: #ffd700;
    box-shadow: 0 0 20px #ffd700, 0 0 40px #ff6600;
    animation: winPulse 0.3s ease-in-out infinite;
}

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

.result-display {
    margin-top: 15px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    min-height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#resultText {
    color: #aaa;
    font-size: 1rem;
    transition: all 0.3s;
}

#resultText.win {
    color: #4ade80;
    font-weight: bold;
    text-shadow: 0 0 10px #4ade80;
    animation: winText 0.5s ease-in-out;
}

#resultText.jackpot {
    color: #ffd700;
    font-weight: bold;
    font-size: 1.3rem;
    text-shadow: 0 0 20px #ffd700;
    animation: jackpotText 0.3s ease-in-out infinite;
}

#resultText.lose {
    color: #f87171;
}

@keyframes winText {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

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

.bet-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.bet-label {
    color: #aaa;
    font-size: 0.9rem;
}

.bet-buttons {
    display: flex;
    gap: 8px;
}

.bet-btn {
    width: 50px;
    height: 40px;
    font-size: 1rem;
    font-weight: bold;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.bet-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #ffd700;
}

.bet-btn.active {
    background: linear-gradient(180deg, #ffd700, #ffa500);
    color: #1a0a2e;
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.bet-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.spin-btn {
    width: 100%;
    margin-top: 20px;
    padding: 20px;
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(180deg, #e74c3c, #c0392b);
    border: none;
    border-radius: 15px;
    cursor: pointer;
    box-shadow: 
        0 6px 0 #8e2a1e,
        0 10px 20px rgba(231, 76, 60, 0.4);
    transition: all 0.2s;
    text-transform: uppercase;
}

.spin-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 0 #8e2a1e,
        0 15px 30px rgba(231, 76, 60, 0.5);
}

.spin-btn:active:not(:disabled) {
    transform: translateY(4px);
    box-shadow: 
        0 2px 0 #8e2a1e,
        0 5px 10px rgba(231, 76, 60, 0.3);
}

.spin-btn:disabled {
    background: linear-gradient(180deg, #666, #444);
    box-shadow: 0 4px 0 #333;
    cursor: not-allowed;
}

.spin-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.game-controls {
    margin-top: 15px;
}

.control-btn {
    padding: 10px 25px;
    font-size: 0.9rem;
    color: #aaa;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.control-btn:hover {
    color: #fff;
    border-color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* Game Over Screen */
.game-over-title {
    font-size: 2.5rem;
    color: #f87171;
    text-shadow: 0 0 20px #f87171;
    margin-bottom: 20px;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.game-over-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    animation: fall 1s ease-in-out;
}

@keyframes fall {
    0% { transform: translateY(-50px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.game-over-text {
    color: #aaa;
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.final-stats {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
}

.final-stat {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.final-label {
    color: #aaa;
    font-size: 0.9rem;
}

.final-value {
    color: #ffd700;
    font-size: 2.5rem;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.game-over-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.restart-btn {
    width: 100%;
    padding: 18px;
    font-size: 1.2rem;
    font-weight: bold;
    color: #1a0a2e;
    background: linear-gradient(180deg, #4ade80, #22c55e);
    border: none;
    border-radius: 15px;
    cursor: pointer;
    box-shadow: 
        0 5px 0 #16a34a,
        0 10px 20px rgba(74, 222, 128, 0.3);
    transition: all 0.2s;
}

.restart-btn:hover {
    transform: translateY(-2px);
}

.restart-btn:active {
    transform: translateY(3px);
    box-shadow: 
        0 2px 0 #16a34a,
        0 5px 10px rgba(74, 222, 128, 0.2);
}

.menu-btn {
    width: 100%;
    padding: 15px;
    font-size: 1rem;
    color: #aaa;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.menu-btn:hover {
    color: #fff;
    border-color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* Win Animation */
.machine-frame.winning {
    animation: machineWin 0.3s ease-in-out;
    border-color: #4ade80;
    box-shadow: 
        0 0 50px rgba(74, 222, 128, 0.5),
        inset 0 0 50px rgba(74, 222, 128, 0.2);
}

.machine-frame.jackpot-win {
    animation: machineJackpot 0.2s ease-in-out infinite;
    border-color: #ffd700;
    box-shadow: 
        0 0 80px rgba(255, 215, 0, 0.8),
        inset 0 0 60px rgba(255, 215, 0, 0.3);
}

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

@keyframes machineJackpot {
    0%, 100% { transform: scale(1) rotate(-1deg); }
    50% { transform: scale(1.03) rotate(1deg); }
}

/* Responsive */
@media (max-width: 400px) {
    .game-container {
        padding: 10px;
    }
    
    .game-header h1 {
        font-size: 2rem;
    }
    
    .reel {
        width: 65px;
        height: 85px;
    }
    
    .symbol {
        font-size: 2.5rem;
        line-height: 85px;
        height: 85px;
    }
    
    .paytable-row {
        font-size: 0.95rem;
        padding: 6px 10px;
    }
}
