/* Neon Theme Styles */
:root {
    --neon-cyan: #00ffff;
    --neon-pink: #ff00ff;
    --neon-yellow: #ffff00;
    --neon-green: #00ff00;
    --dark-bg: #0a0a0a;
    --dark-purple: #1a0033;
}

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

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--dark-purple) 100%);
    color: white;
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 1200px;
    max-height: 600px;
}

#gameCanvas {
    width: 100%;
    height: 100%;
    display: block;
    background: linear-gradient(to right, #0a0a0a, #1a1a2e);
    box-shadow: 0 0 50px rgba(0, 255, 255, 0.3);
    outline: none; /* Remove focus outline */
}

/* HUD Styles */
#hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px;
    z-index: 10;
    pointer-events: none;
}

#progress-container {
    position: relative;
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: inset 0 0 10px rgba(0, 255, 255, 0.2);
}

#progress-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-pink));
    transition: width 0.3s ease;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.8);
}

#progress-text {
    position: absolute;
    right: 10px;
    top: -20px;
    font-size: 12px;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

#stats {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: bold;
}

#stats div {
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
    text-shadow: 0 0 10px currentColor;
}

#score {
    color: var(--neon-yellow);
    border: 1px solid rgba(255, 255, 0, 0.3);
}

#difficulty {
    color: var(--neon-cyan);
    border: 1px solid rgba(0, 255, 255, 0.3);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 5px rgba(0, 255, 255, 0.3); }
    50% { box-shadow: 0 0 15px rgba(0, 255, 255, 0.6); }
}

#deaths {
    color: var(--neon-pink);
    border: 1px solid rgba(255, 0, 255, 0.3);
}

#best {
    color: var(--neon-green);
    border: 1px solid rgba(0, 255, 0, 0.3);
}

/* Screen Overlays */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(10, 10, 10, 0.95);
    z-index: 20;
    backdrop-filter: blur(5px);
}

.hidden {
    display: none !important;
}

.neon-text {
    font-size: 48px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 5px;
    background: linear-gradient(45deg, var(--neon-cyan), var(--neon-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
    animation: neon-pulse 2s ease-in-out infinite;
    margin-bottom: 20px;
}

@keyframes neon-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.subtitle {
    font-size: 18px;
    color: var(--neon-cyan);
    margin-bottom: 30px;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.neon-btn {
    padding: 15px 40px;
    font-size: 18px;
    font-weight: bold;
    text-transform: uppercase;
    background: transparent;
    color: var(--neon-cyan);
    border: 2px solid var(--neon-cyan);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

.neon-btn:hover {
    background: var(--neon-cyan);
    color: var(--dark-bg);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.8);
    transform: scale(1.05);
}

#tutorial-hint {
    margin: 20px 0;
    padding: 15px;
    background: rgba(0, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 10px;
}

#tutorial-hint p {
    margin: 5px 0;
    font-size: 14px;
    color: var(--neon-cyan);
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.3);
}

#high-score {
    margin-top: 20px;
    font-size: 16px;
    color: var(--neon-green);
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

#final-score, #attempt-count {
    font-size: 20px;
    margin: 10px;
    color: var(--neon-yellow);
    text-shadow: 0 0 10px rgba(255, 255, 0, 0.5);
}

#game-over .subtitle {
    animation: blink 1.5s ease-in-out infinite;
}

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

/* Control Buttons */
.control-btn {
    position: absolute;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid var(--neon-cyan);
    border-radius: 50%;
    color: var(--neon-cyan);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.8);
}

#music-toggle {
    bottom: 20px;
    right: 20px;
}

#install-btn {
    bottom: 20px;
    right: 70px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .neon-text {
        font-size: 36px;
        letter-spacing: 3px;
    }

    #stats {
        font-size: 12px;
    }

    .neon-btn {
        padding: 12px 30px;
        font-size: 16px;
    }

    .control-btn {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
}

/* Landscape Mode for Mobile */
@media (max-height: 500px) {
    #hud {
        padding: 10px;
    }

    #progress-container {
        height: 6px;
        margin-bottom: 10px;
    }

    .neon-text {
        font-size: 32px;
    }
}

/* Password Screen Styles */
#password-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin: 30px 0;
}

#password-input {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--neon-cyan);
    color: var(--neon-cyan);
    padding: 15px 20px;
    font-size: 18px;
    font-family: 'Courier New', monospace;
    border-radius: 10px;
    width: 300px;
    max-width: 80%;
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

#password-input:focus {
    border-color: var(--neon-pink);
    box-shadow: 0 0 30px rgba(255, 0, 255, 0.5);
    transform: scale(1.05);
}

#password-input::placeholder {
    color: rgba(0, 255, 255, 0.5);
}

.error-message {
    color: #ff3333;
    font-size: 16px;
    margin: 20px 0;
    padding: 10px 20px;
    background: rgba(255, 0, 0, 0.1);
    border: 2px solid #ff3333;
    border-radius: 10px;
    animation: shake 0.5s ease-in-out;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

#password-hint {
    margin-top: 30px;
    padding: 15px;
    background: rgba(255, 255, 0, 0.1);
    border: 1px solid rgba(255, 255, 0, 0.3);
    border-radius: 10px;
}

#password-hint p {
    color: var(--neon-yellow);
    font-size: 14px;
    text-shadow: 0 0 5px rgba(255, 255, 0, 0.3);
    margin: 0;
}

#password-submit {
    margin-top: 10px;
}

#password-input.shake {
    animation: shake 0.5s ease-in-out;
}

/* Lock icon animation */
#password-screen h1 {
    animation: pulse 2s ease-in-out infinite;
}

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