/*
 * Audio Number Challenge Game - Styles
 * Copyright (c) 2024-${new Date().getFullYear()} Krishan. All rights reserved.
 * Licensed under MIT License - see LICENSE file for details
 */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57, #ff9ff3);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    overflow: hidden;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1), 0 5px 15px rgba(0,0,0,0.07);
    max-width: 450px;
    width: 95%;
    min-height: 400px;
    text-align: center;
    border: 2px solid rgba(255,255,255,0.3);
    position: relative;
    overflow: hidden;
}

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

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

h1 {
    font-size: 2em;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: titleBounce 2s ease-in-out infinite alternate;
}

@keyframes titleBounce {
    0% { transform: scale(1) rotate(-1deg); }
    100% { transform: scale(1.05) rotate(1deg); }
}

.level-selector {
    margin-bottom: 0px;
}

select {
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    border: 1px solid rgba(255,255,255,0.18);
    padding: 15px 25px;
    border-radius: 20px;
    color: white;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    backdrop-filter: blur(20px);
    box-shadow: 
        0 8px 32px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.2),
        inset 0 -1px 0 rgba(0,0,0,0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

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

select:hover {
    background: linear-gradient(135deg, rgba(255,255,255,0.15), rgba(255,255,255,0.08));
    border: 1px solid rgba(255,255,255,0.25);
    box-shadow: 
        0 12px 40px rgba(0,0,0,0.15),
        inset 0 1px 0 rgba(255,255,255,0.3),
        inset 0 -1px 0 rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

select:hover::before {
    left: 100%;
}

select:focus {
    outline: none;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0.1));
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 
        0 0 0 3px rgba(255,255,255,0.1),
        0 12px 40px rgba(0,0,0,0.15),
        inset 0 1px 0 rgba(255,255,255,0.3);
}

select option { 
    background: rgba(0,0,0,0.9) !important;
    background-color: rgba(0,0,0,0.9) !important;
    color: white !important;
    padding: 10px 15px;
    border: none;
    font-weight: 500;
}

select option:hover {
    background: rgba(255,255,255,0.15) !important;
    background-color: rgba(255,255,255,0.15) !important;
    color: white !important;
}

select option:checked,
select option:focus {
    background: rgba(100,200,255,0.3) !important;
    background-color: rgba(100,200,255,0.3) !important;
    color: white !important;
    font-weight: 600;
}

/* Additional browser-specific overrides */
select optgroup {
    background: rgba(0,0,0,0.9) !important;
    color: white !important;
}

select::-webkit-scrollbar {
    background: rgba(0,0,0,0.8);
}

select::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.8);
}

.game-area {
    margin: 5px 0;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    position: relative;
}

#status {
    font-size: 20px;
    margin-bottom: 30px;
    margin-top: -25px;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    animation: statusPulse 2s ease-in-out infinite alternate;
}

@keyframes statusPulse {
    0% { 
        transform: scale(1);
        text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    }
    100% { 
        transform: scale(1.02);
        text-shadow: 2px 2px 8px rgba(255,255,255,0.4);
    }
}

.buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 40px;
}

button {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    border: none;
    padding: 12px 20px;
    border-radius: 50px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    min-width: 80px;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

button:disabled {
    background: rgba(255,255,255,0.1);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    pointer-events: none;
}

#startBtn {
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
}

#continueBtn {
    background: linear-gradient(145deg, #ff4757 0%, #c44569 50%, #8b2635 100%);
    width: 110px;
    height: 110px;
    border-radius: 50%;
    font-size: 20px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 0 0 8px #b91828,
        0 0 0 12px #8b1538,
        0 15px 30px rgba(0, 0, 0, 0.4),
        inset 0 8px 16px rgba(255, 255, 255, 0.3),
        inset 0 -8px 16px rgba(0, 0, 0, 0.4);
    border: 8px solid #8b1538;
    position: absolute;
    top: 80%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    cursor: pointer;
    transition: all 0.15s ease;
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.7);
    font-weight: bold;
}

#continueBtn.game-active:hover {
    background: linear-gradient(145deg, #ff3742 0%, #b33951 50%, #7a1f2e 100%);
    transform: translate(-50%, -50%) translateY(-6px) scale(1.03);
    box-shadow: 
        0 0 0 8px #a01525,
        0 0 0 12px #7a1f2e,
        0 20px 40px rgba(0, 0, 0, 0.5),
        inset 0 8px 16px rgba(255, 255, 255, 0.4),
        inset 0 -8px 16px rgba(0, 0, 0, 0.5);
    animation: buzzer3DPulse 0.8s infinite alternate;
}

#continueBtn.game-active:active {
    transform: translate(-50%, -50%) translateY(2px) scale(0.97);
    box-shadow: 
        0 0 0 6px #8b1538,
        0 0 0 10px #6b1028,
        0 8px 20px rgba(0, 0, 0, 0.6),
        inset 0 4px 8px rgba(0, 0, 0, 0.6),
        inset 0 -4px 8px rgba(255, 255, 255, 0.1);
}

#continueBtn:disabled {
    background: rgba(255,255,255,0.1);
    border: 6px solid rgba(255,255,255,0.2);
    transform: translate(-50%, -50%);
    box-shadow: none;
    cursor: not-allowed;
    pointer-events: none;
}

#continueBtn.game-active {
    animation: buzzer3DGlow 2.5s ease-in-out infinite alternate;
}

@keyframes buzzer3DGlow {
    0% { 
        box-shadow: 
            0 0 0 8px #b91828,
            0 0 0 12px #8b1538,
            0 15px 30px rgba(0, 0, 0, 0.4),
            inset 0 8px 16px rgba(255, 255, 255, 0.3),
            inset 0 -8px 16px rgba(0, 0, 0, 0.4);
    }
    100% { 
        box-shadow: 
            0 0 0 10px #d41f2f,
            0 0 0 16px #a01525,
            0 20px 40px rgba(0, 0, 0, 0.5),
            inset 0 8px 16px rgba(255, 255, 255, 0.4),
            inset 0 -8px 16px rgba(0, 0, 0, 0.5);
    }
}

@keyframes buzzer3DPulse {
    0% { 
        box-shadow: 
            0 0 0 8px #a01525,
            0 0 0 12px #7a1f2e,
            0 20px 40px rgba(0, 0, 0, 0.5),
            inset 0 8px 16px rgba(255, 255, 255, 0.4),
            inset 0 -8px 16px rgba(0, 0, 0, 0.5);
    }
    100% { 
        box-shadow: 
            0 0 0 12px #d41f2f,
            0 0 0 18px #a01525,
            0 25px 50px rgba(0, 0, 0, 0.6),
            inset 0 8px 16px rgba(255, 255, 255, 0.5),
            inset 0 -8px 16px rgba(0, 0, 0, 0.6);
    }
}

#doneBtn {
    background: linear-gradient(45deg, #a8edea, #fed6e3);
    color: #333;
}

.correct {
    color: #00ff88 !important;
    animation: celebration 1s ease-in-out;
}

.wrong {
    color: #ff4757 !important;
    animation: explosion 0.8s ease-in-out;
}

@keyframes celebration {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.2) rotate(5deg); }
    50% { transform: scale(1.3) rotate(-5deg); }
    75% { transform: scale(1.1) rotate(3deg); }
    100% { transform: scale(1) rotate(0deg); }
}

@keyframes explosion {
    0% { transform: scale(1); }
    20% { transform: scale(1.1) rotate(2deg); }
    40% { transform: scale(0.9) rotate(-2deg); }
    60% { transform: scale(1.05) rotate(1deg); }
    80% { transform: scale(0.95) rotate(-1deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.score {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.2);
    padding: 10px 15px;
    border-radius: 15px;
    font-weight: bold;
}

.timer {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255,255,255,0.2);
    padding: 10px 15px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 16px;
    color: #ff6b6b;
}

.streak {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.2);
    padding: 8px 12px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 14px;
    color: #4ecdc4;
}

.version {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    font-weight: 500;
    z-index: 1000;
}

.timer-warning {
    animation: blink 0.5s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

.floating-emoji {
    position: fixed;
    font-size: 30px;
    pointer-events: none;
    z-index: 1000;
    animation: float 3s ease-out forwards;
}

@keyframes float {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(-200px) rotate(360deg); opacity: 0; }
}

.particle {
    position: fixed;
    width: 6px;
    height: 6px;
    background: #ffd700;
    border-radius: 50%;
    pointer-events: none;
    z-index: 999;
    animation: particle 2s ease-out forwards;
}

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