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

body {
    font-family: 'Arial';
    background: green;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

.container {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    max-width: 500px;
    width: 90%;
    position: relative;
    overflow: hidden;
}

.container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    animation: shimmer 3s infinite;
    z-index: -1;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

h1 {
    color: #333;
    margin-bottom: 2rem;
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.speedometer {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 2rem auto;
    padding: 2rem;
    background: linear-gradient(135deg, #1a1a1a, #333);
    border-radius: 20px;
    box-shadow:
        0 0 30px rgba(0, 0, 0, 0.5),
        inset 0 0 30px rgba(255, 255, 255, 0.1);
    border: 4px solid #444;
}

.speedometer-inner {
    width: 100%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.number-display {
    position: relative;
    z-index: 10;
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.digit {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b6b, #ffd93d);
    color: #fff;
    width: 45px;
    height: 60px;
    line-height: 60px;
    margin: 0 3px;
    border-radius: 12px;
    font-size: 28px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.digit:hover {
    transform: scale(1.05);
}

.digit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.digit:hover::before {
    left: 100%;
}

.speedometer-marks {
    display: none;
}

.spin-button {
    background: green;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 32px;
    font-size: 20px;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(255,152,0,0.15);
    transition: background 0.2s, box-shadow 0.2s;
    margin-top: 24px;
    margin-bottom: 8px;
}

.spin-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(255, 107, 107, 0.4);
}

.spin-button:active {
    transform: translateY(-1px);
}

.spin-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.spin-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.spin-button:hover::before {
    left: 100%;
}

.spin-all-button {
    background: green;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 32px;
    font-size: 20px;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(255,152,0,0.15);
    transition: background 0.2s, box-shadow 0.2s;
    margin-top: 24px;
    margin-bottom: 8px;
}

.spin-all-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.result {
    margin-top: 2rem;
    padding: 1rem;
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    border-radius: 15px;
    color: white;
    font-size: 18px;
    font-weight: 600;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
    box-shadow: 0 8px 20px rgba(78, 205, 196, 0.3);
}

.result.show {
    opacity: 1;
    transform: translateY(0);
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: #ffd700;
    animation: confetti-fall 3s linear infinite;
    z-index: 1000;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.confetti:nth-child(odd) {
    background: #ff6b6b;
    animation-delay: -0.5s;
}

.confetti:nth-child(3n) {
    background: #4ecdc4;
    animation-delay: -1s;
}

.confetti:nth-child(4n) {
    background: #45b7d1;
    animation-delay: -1.5s;
}

.spinning {
    animation: spin-fast 0.1s linear infinite;
}

@keyframes spin-fast {
    0% { transform: translateY(0); }
    25% { transform: translateY(-5px); }
    50% { transform: translateY(0); }
    75% { transform: translateY(5px); }
    100% { transform: translateY(0); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
        margin: 1rem;
    }

    h1 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }

    .speedometer {
        padding: 1.5rem;
    }

    .digit {
        width: 38px;
        height: 50px;
        line-height: 50px;
        font-size: 22px;
        margin: 0 2px;
    }

    .spin-button {
        padding: 12px 30px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .speedometer {
        padding: 1rem;
    }

    .digit {
        width: 32px;
        height: 45px;
        line-height: 45px;
        font-size: 20px;
        margin: 0 1px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .number-display {
        gap: 4px;
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #ffd700;
    border-radius: 50%;
    animation: float 6s infinite ease-in-out;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0; }
    10%, 90% { opacity: 1; }
    50% { transform: translateY(-100px) rotate(180deg); }
}

/* Dynamic animations added by JavaScript */
@keyframes pulse-glow {
    0% { box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1); }
    50% { box-shadow: 0 25px 50px rgba(255, 107, 107, 0.3); }
    100% { box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1); }
}

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