body { 
    margin: 0; 
    overflow: hidden; 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white; 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
}

.nav-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    z-index: 1000;
}

.home-btn {
    color: white;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.home-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    text-decoration: none;
    transform: scale(1.05);
}

.game-title {
    margin: 0;
    font-size: 1.5em;
    font-weight: 700;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}
#gameCanvas { 
    display: block; 
    margin: 0 auto; 
    margin-top: 8em;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 100%;
    height: auto;
}

#answerInput {
    position: fixed; 
    bottom: 30px; 
    left: 50%; 
    transform: translateX(-50%);
    font-size: 24px; 
    padding: 18px 30px;
    border: none;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    font-weight: 600;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(255, 255, 255, 0.1);
    outline: none;
    transition: all 0.3s ease;
    min-width: 280px;
    max-width: 90vw;
    text-align: center;
    border: 2px solid transparent;
    -webkit-appearance: none;
    appearance: none;
}
#answerInput:focus {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4), 0 0 0 4px rgba(102, 126, 234, 0.3);
    transform: translateX(-50%) translateY(-4px) scale(1.05);
    border: 2px solid #667eea;
}
#answerInput::placeholder {
    color: #666;
    font-weight: 500;
    font-size: 20px;
}

/* Remove old individual positioning - now handled by .game-stats container */

#level {
    position: fixed; 
    top: 70px; 
    left: 20px; 
    font-size: 18px;
    font-weight: 600;
    background: rgba(102, 126, 234, 0.8);
    color: #FFD700;
    padding: 8px 16px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 215, 0, 0.6);
    z-index: 1000;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .nav-header {
        padding: 12px 15px;
    }
    
    .home-btn {
        padding: 6px 12px;
        font-size: 0.9em;
    }
    
    .game-title {
        font-size: 1.3em;
    }
    
    #gameCanvas {
        width: 95vw;
        height: auto;
        margin-top: 6em;
    }
    
    #answerInput {
        font-size: 20px;
        padding: 15px 25px;
        bottom: 20px;
        min-width: 200px;
    }
}

@media (max-width: 480px) {
    .nav-header {
        padding: 10px 12px;
    }
    
    .home-btn {
        padding: 5px 10px;
        font-size: 0.8em;
    }
    
    .game-title {
        font-size: 1.1em;
    }
    
    #gameCanvas {
        width: 98vw;
        margin-top: 5em;
    }
    
    #answerInput {
        font-size: 18px;
        padding: 12px 20px;
        bottom: 15px;
        min-width: 150px;
    }
}

/* Game Stats Container */
.game-stats {
    position: fixed;
    top: 80px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
}

.game-stats > div {
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 18px;
    font-weight: 600;
    color: white;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* Speed Control Styles */
.speed-control {
    position: fixed;
    top: 80px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    padding: 15px 20px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 200px;
    z-index: 100;
}

.speed-control label {
    color: white;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 5px;
}

.speed-slider {
    width: 150px;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.3);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF6B6B 0%, #FF5252 100%);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.speed-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF6B6B 0%, #FF5252 100%);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

#speedDisplay {
    color: #FFD700;
    font-weight: bold;
    font-size: 18px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.reset-speed-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.reset-speed-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
}

.reset-speed-btn:active {
    transform: translateY(0);
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .game-stats {
        top: 60px;
        left: 10px;
        gap: 8px;
    }
    
    .game-stats > div {
        font-size: 16px;
        padding: 6px 12px;
    }
    
    .speed-control {
        top: 60px;
        right: 10px;
        padding: 12px 15px;
        min-width: 180px;
    }
    
    .speed-control label {
        font-size: 14px;
    }
    
    .speed-slider {
        width: 120px;
    }
    
    #speedDisplay {
        font-size: 16px;
    }
    
    .reset-speed-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .speed-control {
        position: relative;
        top: auto;
        right: auto;
        margin: 10px auto;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        min-width: auto;
        max-width: 90%;
    }
    
    .game-stats {
        flex-direction: row;
        flex-wrap: wrap;
        top: 70px;
        left: 50%;
        transform: translateX(-50%);
        gap: 5px;
    }
    
    .game-stats > div {
        font-size: 14px;
        padding: 5px 10px;
    }
}