:root {
    --bg-color: #050510;
    --primary: #ff00ff; /* Neon Pink */
    --secondary: #00ffff; /* Neon Cyan */
    --accent: #39ff14; /* Neon Green */
    --warn: #ff3300; /* Neon Red */
    --gold: #ffd700;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --glass-bg: rgba(10, 10, 20, 0.85);
    --header-h-desktop: 60px;
    --header-h-mobile: 52px;
    --stats-h-desktop: 40px;
    --stats-h-mobile: 36px;
    --bottom-h-desktop: 56px;
    --bottom-h-mobile: 52px;
}

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

body, html {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    touch-action: none;
}

/* ==================== TOP HUD BAR ==================== */
.header {
    height: var(--header-h-desktop);
    background: rgba(0, 0, 0, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    padding: 0 16px;
    z-index: 100;
    flex-shrink: 0;
}

.nav-left { display: flex; align-items: center; min-width: 120px; }
.home-btn {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 6px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
    cursor: pointer;
}
.home-btn:hover { color: #fff; border-color: var(--primary); }

.header-center { display: flex; justify-content: center; overflow: hidden; }
.game-title {
    font-size: 1.1rem;
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.header-right { display: flex; justify-content: flex-end; min-width: 120px; }
.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s;
}
.icon-btn:hover { border-color: var(--primary); background: rgba(255, 255, 255, 0.1); }

/* ==================== STATS BAR ==================== */
.stats-bar {
    height: var(--stats-h-desktop);
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(0, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    flex-shrink: 0;
    z-index: 90;
}
.stat-item {
    font-size: 14px;
    font-weight: 700;
    color: var(--secondary);
    text-shadow: 0 0 8px var(--secondary);
    text-transform: uppercase;
}
#ui-time {
    color: #fff;
    text-shadow: 0 0 10px #fff;
    font-size: 1.2rem;
}
#ui-time.time-warning {
    color: var(--warn);
    text-shadow: 0 0 15px var(--warn);
    animation: pulse 0.5s infinite alternate;
}

/* ==================== GAME AREA ==================== */
.game-wrapper {
    flex-grow: 1;
    position: relative;
    width: 100%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* User request: Add padding-bottom equal to bottom bar height */
    padding-bottom: var(--bottom-h-desktop);
}
#gameCanvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
#gameCanvas.playing { cursor: none; }

.combo-container {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--gold);
    text-shadow: 0 0 15px var(--gold);
    opacity: 0;
    transition: all 0.2s ease;
    pointer-events: none;
}
.combo-container.active { opacity: 1; transform: translateX(-50%) scale(1); }

/* ==================== BOTTOM BAR ==================== */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-h-desktop);
    background: rgba(0, 0, 0, 0.95);
    border-top: 1px solid rgba(0, 229, 200, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 100;
}
.ammo-container {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent);
    min-width: 80px;
}
.ammo-empty {
    color: var(--warn);
    animation: flash 0.5s infinite;
}

.action-btn {
    padding: 8px 24px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid var(--primary);
    color: var(--primary);
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    font-size: 0.9rem;
}
.action-btn:hover { background: var(--primary); color: #000; box-shadow: 0 0 20px var(--primary); }

.icon-btn-square {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}
.icon-btn-square:hover { border-color: var(--primary); background: rgba(255, 255, 255, 0.1); }

/* ==================== MENUS & OVERLAYS ==================== */
.menu-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 20, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 200;
    backdrop-filter: blur(15px);
    padding: 20px;
}
.hidden { display: none !important; }
.menu-overlay h2 { font-size: 2rem; color: var(--secondary); margin-bottom: 25px; text-transform: uppercase; }

.mode-buttons { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 360px; }
.mode-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px;
    text-align: left;
    cursor: pointer;
    transition: 0.2s;
}
.mode-btn:hover { border-color: var(--primary); transform: translateY(-2px); background: rgba(255, 255, 255, 0.06); }
.mode-btn h3 { color: var(--primary); margin-bottom: 2px; font-size: 1.1rem; }
.mode-btn p { font-size: 0.8rem; color: var(--text-secondary); }

.play-btn {
    background: var(--primary);
    color: #000;
    padding: 12px 36px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    margin-bottom: 12px;
}
.secondary-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--text-secondary);
    padding: 10px 30px;
    border-radius: 30px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.9rem;
}

/* ==================== MOBILE ==================== */
@media (max-width: 600px) {
    .header { height: var(--header-h-mobile); padding: 0 10px; }
    .nav-left, .header-right { min-width: 80px; }
    .home-btn { padding: 6px 10px; font-size: 0.75rem; }
    .game-title { font-size: 0.9rem; }
    
    .stats-bar { height: var(--stats-h-mobile); padding: 0 12px; }
    
    .game-wrapper { padding-bottom: var(--bottom-h-mobile); }
    .bottom-bar { height: var(--bottom-h-mobile); padding: 0 12px; }
    .ammo-container { font-size: 13px; min-width: 70px; }
    .action-btn { padding: 6px 16px; font-size: 0.75rem; }
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.1); opacity: 0.8; }
}
@keyframes flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}
