/* Local Fonts Initialization */
@font-face {font-display: swap; font-family: 'Inter'; font-style: normal; font-weight: 400; src: url('/fonts/inter-v20-latin-regular.woff2') format('woff2');}
@font-face {font-display: swap; font-family: 'Inter'; font-style: normal; font-weight: 600; src: url('/fonts/inter-v20-latin-600.woff2') format('woff2');}
@font-face {font-display: swap; font-family: 'Inter'; font-style: normal; font-weight: 700; src: url('/fonts/inter-v20-latin-700.woff2') format('woff2');}
@font-face {font-display: swap; font-family: 'Orbitron'; font-style: normal; font-weight: 400; src: url('/fonts/orbitron-v35-latin-regular.woff2') format('woff2');}
@font-face {font-display: swap; font-family: 'Orbitron'; font-style: normal; font-weight: 700; src: url('/fonts/orbitron-v35-latin-700.woff2') format('woff2');}

:root { 
    --menu-width: 200px; 
    --accent-color: #00C9FF; 
    --invader-color: #f43f5e; 
    --shield-color: #4ade80;
    --text-muted: #94a3b8; 
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
}

html, body { height: 100%; width: 100%; overflow-x: hidden; }
body { 
    font-family: 'Inter', sans-serif; 
    background-color: var(--bg-dark); 
    background-image: radial-gradient(circle at top center, rgba(0, 201, 255, 0.05) 0%, transparent 70%); 
    margin: 0; padding: 0; 
    color: #e2e8f0; 
    display: flex; flex-direction: row; 
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Sidebar Menu */
.left-menu { width: var(--menu-width); min-width: var(--menu-width); height: 100vh; position: fixed; top: 0; left: 0; background: rgba(10, 10, 10, 0.95); box-shadow: 2px 0 15px rgba(0, 0, 0, 0.5); padding: 0 20px; box-sizing: border-box; z-index: 1001; font-family: 'Orbitron', sans-serif; display: flex; flex-direction: column; justify-content: center; overflow-y: auto; }
.left-menu ul { list-style: none; padding: 0; margin: 0; } .left-menu li { margin-bottom: 20px; }
.left-menu a { font-size: 24px; font-weight: 600; color: var(--accent-color); text-decoration: none; text-shadow: 0 0 2px var(--accent-color); display: block; padding: 8px 0; transition: all 0.3s ease; }
.left-menu a:hover, .left-menu a:focus { color: #fff; text-shadow: 0 0 8px #fff, 0 0 12px rgba(255, 255, 255, 0.5); outline: none; transform: translateX(5px); }
.left-menu a.active-page-link { color: #fff; text-shadow: 0 0 8px #fff, 0 0 12px rgba(255, 255, 255, 0.7); background-color: rgba(0, 190, 255, 0.15); border-radius: 8px; padding-left: 15px; padding-right: 15px; }

/* Main Layout */
.mobile-header, .menu-overlay { display: none; }
.main-content-wrapper { flex-grow: 1; padding: 40px 20px; padding-left: calc(var(--menu-width) + 40px); display: flex; flex-direction: column; align-items: center; min-height: 100vh; box-sizing: border-box; width: 100%; }
.game-page-content { display: flex; flex-direction: column; align-items: center; gap: 20px; width: 100%; max-width: 900px; }

/* Breadcrumbs */
.breadcrumbs { width: 100%; margin-bottom: 10px; } 
.breadcrumbs ol { display: flex; list-style: none; padding: 0; margin: 0; font-size: 0.9rem; color: var(--text-muted); font-weight: 600;} 
.breadcrumbs li:not(:last-child)::after { content: '>'; margin: 0 0.75rem; } 
.breadcrumbs a { color: var(--text-muted); text-decoration: none; transition: color 0.2s;} 
.breadcrumbs a:hover { color: var(--accent-color); }

/* Game Container & HUD */
.game-container { background-color: var(--bg-card); border-radius: 1rem; padding: 1.5rem; box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), inset 0 0 15px rgba(0,201,255,0.05); border: 1px solid rgba(0,201,255,0.15); display: flex; flex-direction: column; align-items: center; width: 100%; box-sizing: border-box; position: relative;}

.game-hud { display: flex; justify-content: space-between; align-items: center; width: 100%; max-width: 800px; padding-bottom: 15px; border-bottom: 2px solid #334155; margin-bottom: 15px; }
.hud-item { text-align: center; font-family: 'Inter', sans-serif; font-size: 0.85rem; font-weight: 700; color: var(--text-muted); letter-spacing: 1px;}
.hud-item span { display: block; font-family: 'Orbitron', sans-serif; font-size: 1.8rem; color: #fff; text-shadow: 0 0 8px var(--accent-color); margin-top: 5px; }
#lives-container { display: flex; gap: 5px; color: #f43f5e; font-size: 1.5rem; text-shadow: 0 0 8px #f43f5e; align-items: flex-end; height: 100%; padding-bottom: 5px;}

/* Canvas & Overlays */
.canvas-wrapper { position: relative; width: 100%; max-width: 800px; aspect-ratio: 4/3; background-color: #000; border-radius: 8px; overflow: hidden; box-shadow: inset 0 0 20px rgba(0,0,0,1); }
#gameCanvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }

.game-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(5px); display: none; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 20px; box-sizing: border-box; z-index: 10; animation: fadeIn 0.3s ease; }
.game-overlay.show { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.game-overlay h2 { font-family: 'Orbitron', sans-serif; font-size: 3rem; color: var(--accent-color); text-shadow: 0 0 15px var(--accent-color); margin: 0 0 15px; }
.game-overlay p { font-size: 1.1rem; color: #e2e8f0; line-height: 1.5; margin-bottom: 25px; }

/* Buttons */
.btn-group { display: flex; gap: 15px; }
.action-btn { font-family: 'Orbitron', sans-serif; background: var(--accent-color); color: #000; font-weight: 700; font-size: 1.1rem; padding: 0.8rem 1.8rem; border: none; border-radius: 8px; cursor: pointer; transition: all 0.2s ease; box-shadow: 0 4px 15px rgba(0, 201, 255, 0.3); display: flex; align-items: center; gap: 8px;}
.action-btn:hover { background-color: #38bdf8; transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0, 201, 255, 0.5); }
.action-btn:active { transform: translateY(1px); }
.action-btn.secondary { background: #334155; color: #fff; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4); }
.action-btn.secondary:hover { background: #475569; }
.hidden { display: none !important; }

/* Instructions */
.game-instructions { background-color: var(--bg-card); border-radius: 1rem; padding: 2rem; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); border: 1px solid var(--border-color); width: 100%; box-sizing: border-box; margin-bottom: 40px;}
.game-instructions h2 { font-family: 'Orbitron', sans-serif; font-size: 1.5rem; color: var(--accent-color); margin-top: 0; margin-bottom: 15px; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; }
.game-instructions p, .game-instructions ul { font-size: 1rem; line-height: 1.7; color: #cbd5e0; margin-bottom: 10px; }
.game-instructions ul { list-style: none; padding-left: 0; }
.game-instructions ul li { margin-bottom: 10px; position: relative; padding-left: 20px; }
.game-instructions ul li::before { content: '▸'; color: var(--accent-color); position: absolute; left: 0; font-weight: bold; }

/* Shake Animation for Canvas when hit */
@keyframes screenShake {
    0% { transform: translate(0, 0); }
    20% { transform: translate(-5px, 5px); }
    40% { transform: translate(5px, -5px); }
    60% { transform: translate(-5px, -5px); }
    80% { transform: translate(5px, 5px); }
    100% { transform: translate(0, 0); }
}
.shake { animation: screenShake 0.3s ease; }

/* Mobile Adjustments */
@media (max-width: 992px) {
    :root { --menu-width: 250px; }
    body { flex-direction: column; padding: 0; } body.menu-open { overflow: hidden; }
    .main-content-wrapper { padding: 80px 15px 20px; margin-left: 0; width: 100%; }
    .mobile-header { display: flex; align-items: center; justify-content: space-between; padding: 0 20px; height: 60px; background-color: rgba(15, 23, 42, 0.95); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border-color); position: fixed; top: 0; left: 0; width: 100%; z-index: 1000; box-sizing: border-box; }
    .hamburger-btn { background: none; border: none; padding: 10px; cursor: pointer; } .hamburger-btn .line { display: block; width: 24px; height: 3px; background-color: #e2e8f0; margin: 5px 0; border-radius: 3px; transition: transform 0.3s ease, opacity 0.3s ease; }
    .mobile-title { font-family: 'Orbitron', sans-serif; font-size: 1.3rem; font-weight: 700; color: var(--accent-color); }
    .left-menu { transform: translateX(-100%); transition: transform 0.3s ease-in-out; height: 100vh; width: var(--menu-width); min-width: var(--menu-width); }
    .left-menu.menu-open { transform: translateX(0); }
    .menu-overlay { display: block; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); backdrop-filter: blur(2px); z-index: 1000; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; } .menu-overlay.menu-open { opacity: 1; pointer-events: auto; }
    
    .game-container { padding: 1rem; }
    .game-hud { padding-bottom: 10px; margin-bottom: 10px; }
    .hud-item { font-size: 0.7rem; }
    .hud-item span { font-size: 1.3rem; }
    .game-overlay h2 { font-size: 2rem; }
    .action-btn { padding: 0.7rem 1.2rem; font-size: 0.9rem; }
    .game-instructions { padding: 1.5rem; }
}