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

:root {
    --gold: #FFD700;
    --gold-dark: #B8860B;
    --purple-dark: #1a0a2e;
    --purple-deeper: #0d0514;
    --neon-pink: #FF00FF;
    --neon-cyan: #00FFFF;
    --chrome: linear-gradient(180deg, #f0f0f0 0%, #c0c0c0 50%, #808080 100%);
    --bronze: linear-gradient(180deg, #cd7f32 0%, #8b4513 50%, #654321 100%);
}

body {
    font-family: 'Orbitron', sans-serif;
    background: radial-gradient(ellipse at center, var(--purple-dark) 0%, var(--purple-deeper) 100%);
    min-height: 100vh;
    overflow-x: hidden;
    color: white;
}

.app-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    min-height: 100vh;
    position: relative;
}

/* Scanline effect */
.app-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.1) 2px,
        rgba(0, 0, 0, 0.1) 4px
    );
    pointer-events: none;
    z-index: 1000;
}

/* Slot Machine */
.slot-machine {
    position: relative;
    background: linear-gradient(180deg, #2a1a4a 0%, #1a0a2e 100%);
    border: 8px solid;
    border-image: var(--bronze) 1;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 
        0 0 50px rgba(255, 215, 0, 0.3),
        inset 0 0 30px rgba(0, 0, 0, 0.5);
    max-width: 900px;
    width: 100%;
    margin-bottom: 30px;
}

/* Chase Lights */
.chase-lights {
    position: absolute;
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
    pointer-events: none;
    z-index: 10;
}

.chase-light {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #333;
    box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.5);
    transition: all 0.1s ease;
}

.chase-light.active {
    background: var(--gold);
    box-shadow: 0 0 15px var(--gold), 0 0 30px var(--gold);
}

.chase-light:nth-child(1) { top: 0; left: 10%; }
.chase-light:nth-child(2) { top: 0; left: 25%; }
.chase-light:nth-child(3) { top: 0; left: 40%; }
.chase-light:nth-child(4) { top: 0; left: 55%; }
.chase-light:nth-child(5) { top: 0; left: 70%; }
.chase-light:nth-child(6) { top: 0; left: 85%; }
.chase-light:nth-child(7) { top: 10%; right: 0; }
.chase-light:nth-child(8) { top: 30%; right: 0; }
.chase-light:nth-child(9) { top: 50%; right: 0; }
.chase-light:nth-child(10) { top: 70%; right: 0; }
.chase-light:nth-child(11) { top: 90%; right: 0; }
.chase-light:nth-child(12) { bottom: 0; left: 85%; }
.chase-light:nth-child(13) { bottom: 0; left: 70%; }
.chase-light:nth-child(14) { bottom: 0; left: 55%; }
.chase-light:nth-child(15) { bottom: 0; left: 40%; }
.chase-light:nth-child(16) { bottom: 0; left: 25%; }
.chase-light:nth-child(17) { bottom: 0; left: 10%; }
.chase-light:nth-child(18) { top: 90%; left: 0; }
.chase-light:nth-child(19) { top: 70%; left: 0; }
.chase-light:nth-child(20) { top: 50%; left: 0; }
.chase-light:nth-child(21) { top: 30%; left: 0; }
.chase-light:nth-child(22) { top: 10%; left: 0; }
.chase-light:nth-child(23) { top: 0; left: 5%; }
.chase-light:nth-child(24) { top: 0; right: 5%; }

/* Marquee */
.machine-top {
    text-align: center;
    margin-bottom: 20px;
}

.marquee {
    display: inline-block;
    padding: 15px 40px;
    background: linear-gradient(180deg, #3a2a5a 0%, #2a1a4a 100%);
    border: 4px solid var(--gold);
    border-radius: 10px;
    box-shadow: 
        0 0 20px rgba(255, 215, 0, 0.5),
        inset 0 0 20px rgba(255, 215, 0, 0.1);
}

.marquee-text {
    font-family: 'Righteous', cursive;
    font-size: 2.5rem;
    background: linear-gradient(180deg, var(--gold) 0%, #FFA500 50%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px var(--gold);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { filter: brightness(1); }
    to { filter: brightness(1.3); }
}

/* LED Display */
.led-display {
    background: #1a0a0a;
    border: 3px solid #333;
    border-radius: 5px;
    padding: 10px 20px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
}

.led-text {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.9rem;
    color: #ff3300;
    text-shadow: 0 0 10px #ff3300, 0 0 20px #ff3300;
    animation: flicker 0.1s infinite alternate;
}

@keyframes flicker {
    from { opacity: 0.95; }
    to { opacity: 1; }
}

/* Reels Container */
.reels-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 15px 10px;
    background: linear-gradient(180deg, #1a1a1a 0%, #0a0a0a 100%);
    border: 4px solid;
    border-image: var(--chrome) 1;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8);
}

.reel-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.reel-label-top {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 5px var(--gold);
}

/* Reel */
.reel-container {
    width: 110px;
    height: 150px;
    background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 3px solid #444;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: 
        inset 0 10px 20px rgba(0, 0, 0, 0.5),
        inset 0 -10px 20px rgba(0, 0, 0, 0.5);
}

.reel-container.spinning .reel-window {
    animation: shake 0.05s infinite;
}

.reel-container.winner-glow {
    box-shadow: 
        0 0 20px var(--gold),
        inset 0 10px 20px rgba(0, 0, 0, 0.5),
        inset 0 -10px 20px rgba(0, 0, 0, 0.5);
    animation: pulse-glow 0.5s ease-in-out 3;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px var(--gold); }
    50% { box-shadow: 0 0 40px var(--gold), 0 0 60px var(--gold); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(2px); }
}

.reel-window {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.reel-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5px;
    transition: all 0.1s ease;
}

.reel-item-prev, .reel-item-next {
    opacity: 0.3;
    transform: scale(0.8);
}

.reel-item-current {
    background: linear-gradient(180deg, rgba(255, 215, 0, 0.1) 0%, transparent 100%);
}

.reel-icon {
    font-size: 2rem;
    line-height: 1;
}

.reel-label {
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 3px;
    text-align: center;
    color: #ccc;
}

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

.spin-button {
    font-family: 'Righteous', cursive;
    font-size: 1.5rem;
    padding: 15px 50px;
    background: linear-gradient(180deg, #ff4444 0%, #cc0000 50%, #aa0000 100%);
    border: 4px solid var(--gold);
    border-radius: 50px;
    color: white;
    cursor: pointer;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    box-shadow: 
        0 0 20px rgba(255, 0, 0, 0.5),
        0 5px 15px rgba(0, 0, 0, 0.3),
        inset 0 -5px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    animation: pulse-button 2s ease-in-out infinite;
}

@keyframes pulse-button {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 0, 0, 0.5), 0 5px 15px rgba(0, 0, 0, 0.3); }
    50% { box-shadow: 0 0 40px rgba(255, 0, 0, 0.8), 0 5px 15px rgba(0, 0, 0, 0.3); }
}

.spin-button:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 
        0 0 30px rgba(255, 0, 0, 0.8),
        0 8px 20px rgba(0, 0, 0, 0.4);
}

.spin-button:active:not(.disabled) {
    transform: translateY(2px);
}

.spin-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    animation: none;
}

.sound-toggle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    background: #2a1a4a;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sound-toggle:hover {
    background: #3a2a5a;
    box-shadow: 0 0 10px var(--gold);
}

/* Lever */
.lever-container {
    position: absolute;
    right: -60px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    z-index: 20;
}

.lever-track {
    width: 20px;
    height: 150px;
    background: var(--chrome);
    border-radius: 10px;
    position: relative;
    box-shadow: 
        inset -3px 0 5px rgba(0, 0, 0, 0.3),
        2px 0 5px rgba(0, 0, 0, 0.2);
}

.lever-arm {
    position: absolute;
    width: 8px;
    height: 80px;
    background: linear-gradient(90deg, #888 0%, #ccc 50%, #888 100%);
    left: 50%;
    transform: translateX(-50%);
    top: 10px;
    border-radius: 4px;
    transition: top 0.3s ease;
}

.lever-ball {
    width: 35px;
    height: 35px;
    background: radial-gradient(circle at 30% 30%, #ff6666, #cc0000, #880000);
    border-radius: 50%;
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 
        0 5px 15px rgba(0, 0, 0, 0.4),
        inset 0 -5px 10px rgba(0, 0, 0, 0.3),
        inset 5px 5px 10px rgba(255, 255, 255, 0.2);
}

.lever-container.pulled .lever-arm {
    top: 60px;
}

.lever-container.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Coin Tray */
.coin-tray {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    background: linear-gradient(180deg, #1a1a1a 0%, #0a0a0a 100%);
    border-top: 3px solid #333;
    border-radius: 0 0 10px 10px;
}

.coin {
    width: 30px;
    height: 30px;
    background: radial-gradient(circle at 30% 30%, var(--gold), var(--gold-dark));
    border-radius: 50%;
    box-shadow: 
        0 2px 5px rgba(0, 0, 0, 0.5),
        inset 0 -2px 5px rgba(0, 0, 0, 0.3);
}

/* Result Card */
.result-card {
    background: linear-gradient(180deg, #2a1a4a 0%, #1a0a2e 100%);
    border: 3px solid var(--neon-cyan);
    border-radius: 15px;
    padding: 25px;
    max-width: 600px;
    width: 100%;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
    margin-bottom: 30px;
    animation: slideIn 0.5s ease-out;
}

.result-card.jackpot {
    border-color: var(--gold);
    box-shadow: 
        0 0 50px rgba(255, 215, 0, 0.5),
        0 0 100px rgba(255, 215, 0, 0.3);
    animation: jackpot-pulse 0.5s ease-in-out infinite alternate;
}

@keyframes jackpot-pulse {
    from { box-shadow: 0 0 50px rgba(255, 215, 0, 0.5); }
    to { box-shadow: 0 0 80px rgba(255, 215, 0, 0.8), 0 0 120px rgba(255, 215, 0, 0.4); }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-icons {
    font-size: 2.5rem;
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.result-subtitle {
    font-size: 0.9rem;
    color: var(--neon-cyan);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.result-title {
    font-family: 'Righteous', cursive;
    font-size: 1.5rem;
    color: var(--gold);
    margin-bottom: 15px;
    text-shadow: 0 0 10px var(--gold);
}

.result-description {
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.spin-again {
    background: linear-gradient(180deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: #1a0a2e;
}

.spin-again:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.5);
}

.create-app {
    background: linear-gradient(180deg, #4CAF50 0%, #2E7D32 100%);
    color: white;
}

.create-app:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(76, 175, 80, 0.5);
}

/* Stats Panel */
.stats-panel {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
    padding: 15px 25px;
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid var(--gold);
    border-radius: 10px;
}

.stat-value {
    display: block;
    font-family: 'Righteous', cursive;
    font-size: 2rem;
    color: var(--gold);
    text-shadow: 0 0 10px var(--gold);
}

.stat-label {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
}

/* History Panel */
.history-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, #2a1a4a 0%, #1a0a2e 100%);
    border-top: 3px solid var(--neon-pink);
    max-height: 60px;
    transition: max-height 0.3s ease;
    z-index: 100;
}

.history-panel.expanded {
    max-height: 400px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    font-weight: 700;
}

.expand-icon {
    font-size: 0.8rem;
}

.history-content {
    padding: 0 20px 20px;
    max-height: 320px;
    overflow-y: auto;
}

.history-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.filter-btn {
    padding: 8px 16px;
    background: transparent;
    border: 2px solid #444;
    border-radius: 20px;
    color: #888;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.filter-btn.active {
    border-color: var(--neon-pink);
    color: var(--neon-pink);
    background: rgba(255, 0, 255, 0.1);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid #333;
}

.history-result {
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-title {
    font-size: 0.85rem;
    color: #ccc;
}

.favorite-btn {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.favorite-btn:hover {
    transform: scale(1.2);
}

.favorite-btn.active {
    animation: star-pop 0.3s ease;
}

@keyframes star-pop {
    50% { transform: scale(1.4); }
}

/* Confetti */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1001;
    overflow: hidden;
}

.confetti-particle {
    position: absolute;
    top: -20px;
    animation: fall linear forwards;
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    margin-bottom: 80px;
    color: #666;
    font-size: 0.85rem;
}

.footer a {
    color: var(--neon-cyan);
    text-decoration: none;
    display: inline-block;
    margin-top: 10px;
    padding: 8px 20px;
    border: 2px solid var(--neon-cyan);
    border-radius: 20px;
    transition: all 0.2s ease;
}

.footer a:hover {
    background: rgba(0, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .slot-machine {
        padding: 15px 10px;
    }
    
    .lever-container {
        display: none;
    }
    
    .marquee-text {
        font-size: 1.5rem;
    }
    
    .reels-container {
        gap: 5px;
        padding: 10px 5px;
        flex-wrap: wrap;
    }
    
    .reel-column {
        gap: 4px;
    }
    
    .reel-label-top {
        font-size: 0.5rem;
    }
    
    .reel-container {
        width: 60px;
        height: 100px;
    }
    
    .reel-icon {
        font-size: 1.3rem;
    }
    
    .reel-label {
        font-size: 0.4rem;
    }
    
    .result-icons {
        font-size: 1.8rem;
        gap: 10px;
    }
    
    .led-text {
        font-size: 0.7rem;
    }
    
    .spin-button {
        padding: 12px 35px;
        font-size: 1.2rem;
    }
    
    .stats-panel {
        gap: 15px;
    }
    
    .stat {
        padding: 10px 15px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .result-card {
        padding: 20px 15px;
    }
    
    .result-icons {
        font-size: 2rem;
    }
    
    .result-title {
        font-size: 1.2rem;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
    }
}

@media (max-width: 500px) {
    .reels-container {
        gap: 4px;
    }
    
    .reel-container {
        width: 55px;
        height: 90px;
    }
    
    .reel-icon {
        font-size: 1.2rem;
    }
    
    .reel-label {
        display: none;
    }
    
    .marquee-text {
        font-size: 1.2rem;
    }
    
    .marquee {
        padding: 8px 15px;
    }
    
    .result-icons {
        font-size: 1.5rem;
        gap: 8px;
    }
    
    .result-title {
        font-size: 1rem;
    }
    
    .result-subtitle {
        font-size: 0.7rem;
    }
}