/* styles.css */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Rajdhani:wght@400;500;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Rajdhani', sans-serif;
    background: #0a0a0f;
    color: #e0e0e0;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

#render-container {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
}

#render-container canvas { width: 100% !important; height: 100% !important; }

.menu-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #0a0a0f 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

.menu-screen::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 107, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 150, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.menu-container {
    text-align: center;
    z-index: 101;
    max-width: 900px;
    padding: 2rem;
}

.game-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 3.5rem;
    font-weight: 900;
    background: linear-gradient(90deg, #ff6b00, #ff9500, #ff6b00);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
    text-shadow: 0 0 40px rgba(255, 107, 0, 0.5);
    margin-bottom: 0.5rem;
    letter-spacing: 0.15em;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.subtitle {
    font-size: 1rem;
    color: #888;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.engine-selector h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #ccc;
}

.engine-cards {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.engine-card {
    background: linear-gradient(145deg, #1a1a2e, #0f0f1a);
    border: 2px solid #333;
    border-radius: 12px;
    padding: 1.5rem;
    width: 260px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.engine-card::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;
}

.engine-card:hover::before { left: 100%; }
.engine-card:hover { transform: translateY(-4px); border-color: #555; }
.engine-card.selected { border-color: #ff6b00; box-shadow: 0 0 25px rgba(255, 107, 0, 0.3); }
#threejs-card.selected { border-color: #0096ff; box-shadow: 0 0 25px rgba(0, 150, 255, 0.3); }

.engine-icon { font-size: 2.5rem; margin-bottom: 0.8rem; }
.engine-card h3 { font-family: 'Orbitron', sans-serif; font-size: 1.3rem; margin-bottom: 0.8rem; }
#babylon-card h3 { color: #ff6b00; }
#threejs-card h3 { color: #0096ff; }

.engine-features { list-style: none; text-align: left; font-size: 0.85rem; }
.engine-features li { padding: 0.2rem 0; color: #aaa; }

.settings-panel {
    background: rgba(26, 26, 46, 0.8);
    border: 1px solid #333;
    border-radius: 10px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.settings-panel h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    color: #888;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid #222;
}

.setting-row:last-child { border-bottom: none; }
.setting-row label { color: #ccc; font-size: 0.9rem; }

.setting-row select {
    background: #1a1a2e;
    border: 1px solid #444;
    color: #fff;
    padding: 0.4rem 0.8rem;
    border-radius: 5px;
    font-family: 'Rajdhani', sans-serif;
    cursor: pointer;
}

.setting-row input[type="checkbox"] {
    width: 18px; height: 18px;
    cursor: pointer;
    accent-color: #ff6b00;
}

.start-btn {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    padding: 0.8rem 3rem;
    background: linear-gradient(135deg, #ff6b00, #ff9500);
    border: none;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1.5rem;
}

.start-btn:disabled { background: #333; color: #666; cursor: not-allowed; }
.start-btn:not(:disabled):hover { transform: scale(1.05); box-shadow: 0 0 25px rgba(255, 107, 0, 0.5); }

.controls-info { color: #666; font-size: 0.85rem; }
.controls-info h4 { margin-bottom: 0.4rem; color: #888; }
.controls-info p { margin: 0.2rem 0; }
.controls-info .highlight { color: #4a8; margin-top: 0.5rem; }

#game-ui {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 50;
    pointer-events: none;
}

.hidden { display: none !important; }

.hud { width: 100%; height: 100%; position: relative; }

.hud-left { position: absolute; bottom: 25px; left: 25px; }

.health-bar {
    width: 180px; height: 22px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #ff3333;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.health-fill {
    height: 100%; width: 100%;
    background: linear-gradient(90deg, #ff3333, #ff6666);
    transition: width 0.3s;
}

.health-bar span {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    text-shadow: 0 0 5px #000;
}

.hud-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }

.crosshair { width: 20px; height: 20px; position: relative; }
.crosshair::before, .crosshair::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.8);
}
.crosshair::before { width: 2px; height: 20px; left: 50%; transform: translateX(-50%); }
.crosshair::after { width: 20px; height: 2px; top: 50%; transform: translateY(-50%); }

.hud-right { position: absolute; bottom: 25px; right: 25px; }

.ammo-display {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

#ammo-current { color: #ffcc00; }

.hud-top { position: absolute; top: 15px; left: 15px; }

.stats-panel {
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 3px solid #ff6b00;
}

.stat {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    color: #ccc;
    padding: 1px 0;
}

.stat span { color: #fff; font-weight: 700; }
.stat span.low-fps { color: #ff4444; }

.pause-container {
    background: rgba(10, 10, 15, 0.95);
    padding: 2.5rem;
    border-radius: 12px;
    border: 2px solid #ff6b00;
    text-align: center;
}

.pause-container h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: #ff6b00;
}

.pause-container button {
    display: block;
    width: 100%;
    padding: 0.8rem;
    margin: 0.4rem 0;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.95rem;
    background: transparent;
    border: 2px solid #444;
    color: #ccc;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.pause-container button:hover {
    border-color: #ff6b00;
    color: #ff6b00;
    background: rgba(255, 107, 0, 0.1);
}

.muzzle-flash {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(circle at center, rgba(255, 200, 100, 0.3), transparent 50%);
    pointer-events: none;
    z-index: 45;
    animation: flash 0.05s ease-out;
}

@keyframes flash {
    0% { opacity: 1; }
    100% { opacity: 0; }
}