/* =========================================
   ASTRO WARRIORS - STYLESHEET
   ========================================= */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: #050505;
    color: #fff;
    font-family: 'Press Start 2P', cursive;
    height: 100vh; overflow: hidden;
    user-select: none;
    display: flex; align-items: center; justify-content: center;
}

/* --- UI KATMANI --- */
#ui-layer {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 10;
    padding: 20px;
    display: flex; flex-direction: column; justify-content: space-between;
}

/* STANDART BUTONLAR (GRİ TASARIM) */
.back-link {
    position: absolute; top: 20px; left: 20px;
    color: #777; text-decoration: none; font-family: 'Roboto', sans-serif; 
    font-weight: bold; font-size: 0.8rem; z-index: 201; /* Menü üstünde */
    display: flex; align-items: center; gap: 8px; transition: color 0.3s;
}
.back-link:hover { color: #00ff88; }

.top-controls {
    position: absolute; top: 20px; right: 20px;
    display: flex; gap: 10px; z-index: 201; /* Menü üstünde */
}

.icon-btn {
    background: rgba(20, 20, 40, 0.8); border: 1px solid #334; color: #aaa;
    width: 40px; height: 40px; border-radius: 8px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; font-size: 1rem; backdrop-filter: blur(2px);
    pointer-events: auto;
}
.icon-btn:hover { 
    background: #223; border-color: #00ff88; color: #00ff88; 
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.4); 
}

/* HUD (Canlar ve Skor) */
.hud-top {
    position: relative;
    display: flex; justify-content: space-between; align-items: flex-start;
    width: 100%;
    margin-top: 40px;
}

.p1-hud, .p2-hud {
    display: flex; align-items: center; gap: 10px;
    background: rgba(0,0,0,0.7); padding: 15px;
    border: 2px solid #333; transform: skewX(-10deg);
    min-width: 150px;
}
.p1-hud { border-color: #00ff88; color: #00ff88; }
.p2-hud { border-color: #00eaff; color: #00eaff; }

.lives-box { font-size: 1.2rem; letter-spacing: 5px; text-shadow: 2px 2px 0 #000; }

.score-board {
    position: absolute; left: 50%; transform: translateX(-50%); top: -40px;
    text-align: center; color: #ffcc00; text-shadow: 2px 2px 0 #000;
    line-height: 1.5; background: rgba(0,0,0,0.6);
    padding: 10px 20px; border-radius: 0 0 10px 10px;
    border: 1px solid rgba(255, 255, 255, 0.1); border-top: none; font-size: 0.8rem;
}

/* BOSS BAR */
#boss-hud { align-self: center; width: 60%; margin-bottom: 40px; }
.boss-name { text-align: center; color: #ff0055; margin-bottom: 5px; font-size: 0.8rem; }
.boss-hp-box { width: 100%; height: 20px; background: #222; border: 2px solid #fff; }
#boss-hp-bar { height: 100%; background: linear-gradient(90deg, #ff0055, #ff5e00); transition: width 0.2s; }

/* CANVAS */
canvas { background: #0a0a0a; box-shadow: 0 0 50px rgba(0,0,0,0.5); display: block; }

/* MENÜ & OVERLAY */
#overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(5, 5, 10, 0.95);
    display: flex; align-items: center; justify-content: center;
    z-index: 20; pointer-events: auto;
}

.game-title {
    font-size: 3rem; color: #fff; text-shadow: 5px 5px 0 #ff0055;
    margin-bottom: 10px; letter-spacing: -2px; transform: skewY(-5deg); text-align: center;
}
.highlight { color: #ffcc00; }
.subtitle { color: #888; margin-bottom: 50px; font-family: 'Roboto', sans-serif; letter-spacing: 5px; font-weight: bold; text-align: center; font-size: 0.8rem; }

.menu-options { display: flex; gap: 20px; margin-bottom: 50px; justify-content: center; flex-wrap: wrap;}

.btn {
    background: transparent; color: #00ff88; pointer-events: auto;
    border: 4px solid #00ff88; padding: 20px 30px;
    font-family: 'Press Start 2P'; font-size: 0.9rem; cursor: pointer;
    transition: 0.2s; text-transform: uppercase;
}
.btn:hover { background: #00ff88; color: #000; box-shadow: 0 0 20px #00ff88; transform: translateY(-5px); }
.btn.secondary { color: #00eaff; border-color: #00eaff; }
.btn.secondary:hover { background: #00eaff; color: #000; box-shadow: 0 0 20px #00eaff; }

/* Continue Butonu */
#btn-continue { background: rgba(255, 204, 0, 0.1); border-color: #ffcc00; color: #ffcc00; }
#btn-continue:hover { background: #ffcc00; color: #000; box-shadow: 0 0 20px #ffcc00; }

.controls-hint { display: flex; gap: 30px; color: #666; font-size: 0.7rem; font-family: 'Roboto'; justify-content: center; flex-wrap: wrap;}
.key-badge { background: #333; color: #fff; padding: 2px 6px; border-radius: 4px; border: 1px solid #555; }

/* MOBİL KONTROLLER */
#mobile-controls {
    display: none; 
    position: absolute; bottom: 20px; left: 0; width: 100%; height: 150px;
    z-index: 40; pointer-events: none;
    justify-content: space-between; padding: 0 40px;
}

.d-pad {
    pointer-events: auto;
    display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.d-row { display: flex; gap: 5px; }

.d-btn {
    width: 50px; height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px; color: #fff; font-size: 1.2rem;
    display: flex; align-items: center; justify-content: center;
    touch-action: manipulation; 
}
.d-btn:active { background: rgba(0, 255, 136, 0.5); border-color: #00ff88; }

.action-buttons {
    pointer-events: auto;
    display: flex; gap: 20px; align-items: flex-end;
}

.act-btn {
    width: 70px; height: 70px; border-radius: 50%;
    font-family: 'Press Start 2P'; font-size: 1.2rem; color: #fff;
    border: 3px solid rgba(255, 255, 255, 0.3);
    display: flex; align-items: center; justify-content: center;
    touch-action: manipulation;
}

.fire-btn { background: rgba(255, 80, 80, 0.3); } 
.fire-btn:active { background: rgba(255, 80, 80, 0.8); border-color: #ff5050; }

.jump-btn { background: rgba(80, 200, 255, 0.3); } 
.jump-btn:active { background: rgba(80, 200, 255, 0.8); border-color: #50c8ff; }

/* MOBİL UYUMLULUK */
@media (max-width: 800px) {
    .game-title { font-size: 2rem; }
    .hud-top { flex-direction: column; gap: 10px; align-items: flex-start; margin-top: 60px;}
    .p2-hud { align-self: flex-end; }
    .score-board { position: relative; left: 0; transform: none; width: 100%; border-radius: 5px; top: 0; margin-bottom: 10px;}
    .control-panel { top: 10px; right: 10px; }
}

@media (max-width: 1024px) {
    #mobile-controls { display: flex; }
    .hud-top { margin-top: 60px; }
    .score-board { top: -50px; font-size: 0.8rem; }
}