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

body {
    font-family: 'Arial', sans-serif;
    overflow: hidden;
    background: #1a1a1a;
    color: #fff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
}

/* Overlays */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10;
    transition: opacity 0.3s ease;
}

.overlay.hidden {
    display: none;
    opacity: 0;
}

/* Start Screen */
#startScreen h1 {
    font-size: 4rem;
    font-weight: bold;
    margin-bottom: 1rem;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
    color: #FFD700;
}

#startScreen .subtitle {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
    padding: 0 2rem;
    color: #e0e0e0;
}

.difficulty-selector {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    color: #e0e0e0;
    cursor: pointer;
    user-select: none;
}

.radio-label input[type="radio"] {
    appearance: none;
    width: 1.2rem;
    height: 1.2rem;
    border: 2px solid #FFD700;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    position: relative;
}

.radio-label input[type="radio"]:checked {
    background: #FFD700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Game Over Screen */
#gameOverScreen h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #ff4444;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#gameOverScreen #finalScore {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: #e0e0e0;
}

/* Buttons */
.btn {
    padding: 1rem 3rem;
    font-size: 1.5rem;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.4);
}

/* HUD */
#hud {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
}

#hud.hidden {
    display: none;
}

#score {
    font-size: 3rem;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    border: 3px solid #FFD700;
}

/* System Config */
#sysConfig h2 {
    color: #00ff00;
    font-family: 'Courier New', monospace;
    margin-bottom: 2rem;
}

.sys-params {
    background: rgba(0, 0, 0, 0.8);
    padding: 2rem;
    border-radius: 10px;
    border: 1px solid #00ff00;
    width: 80%;
    max-width: 400px;
}

.param-row {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.param-row label {
    color: #00ff00;
    font-family: 'Courier New', monospace;
    display: flex;
    justify-content: space-between;
}

.param-row input[type="range"] {
    width: 100%;
    cursor: pointer;
}

.sys-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    #startScreen h1 {
        font-size: 2.5rem;
    }

    #startScreen .subtitle {
        font-size: 1.2rem;
    }

    #gameOverScreen h2 {
        font-size: 2rem;
    }

    #gameOverScreen #finalScore {
        font-size: 1.2rem;
    }

    .btn {
        padding: 0.8rem 2rem;
        font-size: 1.2rem;
    }

    #score {
        font-size: 2rem;
        padding: 8px 16px;
    }
}

@media (max-width: 480px) {
    #startScreen h1 {
        font-size: 2rem;
    }

    #startScreen .subtitle {
        font-size: 1rem;
        padding: 0 1rem;
    }

    #gameOverScreen h2 {
        font-size: 1.5rem;
    }

    #gameOverScreen #finalScore {
        font-size: 1rem;
    }

    .btn {
        padding: 0.7rem 1.5rem;
        font-size: 1rem;
    }

    #score {
        font-size: 1.5rem;
        padding: 6px 12px;
        border-width: 2px;
    }
}

/* Landscape mode adjustments */
@media (orientation: landscape) and (max-height: 500px) {
    #startScreen h1 {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }

    #startScreen .subtitle {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .btn {
        padding: 0.6rem 1.5rem;
        font-size: 1rem;
    }

    #score {
        font-size: 1.5rem;
        top: 10px;
    }
}
