/* GENEL AYARLAR */
body {
    margin: 0; padding: 0;
    /* YENİ NEBULA ARKA PLAN */
    background-color: #050505;
    background: radial-gradient(circle at 50% 50%, #1a0b2e 0%, #000000 100%);
    color: #fff; 
    font-family: 'Press Start 2P', cursive;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: 100vh; overflow: hidden; user-select: none;
    touch-action: none;
}

/* ÇIKIŞ BUTONU - SOL ÜST */
.back-link {
    position: absolute; top: 20px; left: 20px;
    color: #555; text-decoration: none; font-family: 'Roboto', sans-serif; font-weight: bold;
    z-index: 100; transition: color 0.3s;
}
.back-link:hover { color: #00f3ff; }

/* SAĞ ÜST KONTROL BUTONLARI (PAUSE, MUTE, FULLSCREEN) */
.top-controls {
    position: absolute; top: 20px; right: 20px;
    display: flex; gap: 10px;
    z-index: 100; /* Overlay üzerinde görünmesi için yüksek z-index */
}

.control-btn {
    width: 40px; height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #aaa; cursor: pointer; transition: all 0.2s;
    font-size: 1rem;
}

.control-btn:hover {
    background: rgba(0, 243, 255, 0.2);
    border-color: #00f3ff;
    color: #fff;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
    transform: scale(1.05);
}

/* UI PANEL (SKOR, DALGA) - ÜST ORTA */
.ui-panel { 
    position: absolute; top: 20px; 
    display: flex; gap: 20px; font-size: 0.6rem; 
    text-shadow: 0 0 5px rgba(0, 243, 255, 0.5); 
    z-index: 20; pointer-events: none;
    background: rgba(0,0,0,0.5); padding: 10px 20px; border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
}

.lives-panel {
    position: absolute; top: 60px;
    display: flex; gap: 20px; font-size: 0.6rem;
    z-index: 20; pointer-events: none;
}

.ui-box span { color: #00f3ff; }
.p1-lives { color: #00f3ff; }
.p2-lives { color: #ff0055; }
.ui-box.gold { border-bottom: 2px solid #ffd700; padding-bottom: 2px; }
.ui-box.gold span { color: #ffd700; text-shadow: 0 0 10px #ffd700; }

canvas {
    border: 2px solid #333; 
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.9);
    background: rgba(0,0,0,0.3); /* Canvas arkası şeffaf olsun ki Nebula görünsün */
    max-width: 100vw; max-height: 80vh;
}

/* BOSS HUD */
#boss-hud {
    position: absolute; top: 100px; left: 50%; transform: translateX(-50%);
    width: 60%; max-width: 500px; z-index: 15; text-align: center;
    animation: pulseWarning 1s infinite alternate;
}
.boss-name { color: #ff0055; font-size: 0.7rem; margin-bottom: 5px; font-weight: bold; text-shadow: 0 0 10px #ff0055; letter-spacing: 2px; }
.health-bar-container { width: 100%; height: 10px; background: #333; border: 2px solid #ff0055; border-radius: 5px; overflow: hidden; box-shadow: 0 0 15px rgba(255, 0, 85, 0.4); }
#boss-health-fill { width: 100%; height: 100%; background: linear-gradient(90deg, #ff0055, #ff5500); transition: width 0.2s; }
@keyframes pulseWarning { from { opacity: 0.8; transform: translateX(-50%) scale(1); } to { opacity: 1; transform: translateX(-50%) scale(1.05); } }

/* PAUSE OVERLAY */
#pause-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    z-index: 90; backdrop-filter: blur(5px);
}
#pause-overlay h1 { color: #fff; letter-spacing: 5px; text-shadow: 0 0 20px #fff; font-size: 2rem; margin-bottom: 30px;}

/* MOBİL KONTROLLER */
.mobile-controls {
    display: none; width: 100%; max-width: 600px;
    margin-top: 15px; justify-content: space-between; align-items: center; padding: 0 20px;
}
.d-pad { display: flex; flex-direction: column; align-items: center; }
.d-row { display: flex; }
.d-btn {
    width: 50px; height: 50px; background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; color: #00f3ff; margin: 2px; border-radius: 8px;
}
.d-btn.empty { background: transparent; border: none; }
.d-btn:active { background: rgba(0,243,255,0.3); }
.center-deco { width: 50px; height: 50px; background: rgba(0,0,0,0.5); border-radius: 50%; border: 1px solid #333;}
.ctrl-btn.fire { 
    width: 80px; height: 80px; border: 3px solid #ff0055; 
    background: rgba(255,0,85,0.1); color: #ff0055; border-radius: 50%; 
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; box-shadow: 0 0 15px rgba(255, 0, 85, 0.3);
}
.ctrl-btn.fire:active { background: rgba(255,0,85,0.4); transform: scale(0.95); }

/* MENU OVERLAY */
#overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); display: flex; flex-direction: column;
    align-items: center; justify-content: center; z-index: 50; /* Butonlar bunun üstünde (100) kalacak */
}
h1.game-title { color: #ff0055; font-size: 2.2rem; text-shadow: 4px 4px 0px #330011; margin-bottom: 10px; text-align: center; line-height: 1.4; }
.sub-title { color: #888; font-size: 0.7rem; letter-spacing: 3px; margin-bottom: 20px; }
.btn-group { display: flex; gap: 20px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }
button {
    background: transparent; color: #00f3ff; border: 2px solid #00f3ff; 
    padding: 15px 25px; font-family: 'Press Start 2P', cursive; font-size: 0.8rem; cursor: pointer; transition: 0.2s;
    margin-bottom: 10px;
}
button:hover { background: #00f3ff; color: #000; box-shadow: 0 0 20px #00f3ff; }
button.coop { border-color: #ff0055; color: #ff0055; }
button.coop:hover { background: #ff0055; color: #fff; box-shadow: 0 0 20px #ff0055; }
.controls-hint { margin-top: 30px; font-size: 0.6rem; color: #666; font-family: 'Roboto', sans-serif; line-height: 1.8; text-align: center; max-width: 90%; }
.key { border: 1px solid #444; padding: 2px 5px; border-radius: 3px; color: #ccc; background: #222; font-family: monospace; }

@media (max-width: 768px) {
    .mobile-controls { display: flex; }
    canvas { height: 60vh; width: 100%; border: none; }
    h1.game-title { font-size: 1.5rem; }
    .ui-panel { top: 50px; flex-wrap: wrap; justify-content: center; width: 100%; background: transparent; border: none; padding: 0;}
    .lives-panel { top: 75px; }
}