/* --- GENEL AYARLAR --- */
body {
    margin: 0; padding: 0;
    background-color: #050505;
    /* Yeni Cyberpunk Izgara ve Gradyan Arka Plan */
    background-image: 
        linear-gradient(rgba(0, 20, 40, 0.9), rgba(0, 0, 0, 1)),
        linear-gradient(0deg, transparent 24%, rgba(0, 255, 136, .05) 25%, rgba(0, 255, 136, .05) 26%, transparent 27%, transparent 74%, rgba(0, 255, 136, .05) 75%, rgba(0, 255, 136, .05) 76%, transparent 77%, transparent),
        linear-gradient(90deg, transparent 24%, rgba(0, 255, 136, .05) 25%, rgba(0, 255, 136, .05) 26%, transparent 27%, transparent 74%, rgba(0, 255, 136, .05) 75%, rgba(0, 255, 136, .05) 76%, transparent 77%, transparent);
    background-size: 100% 100%, 50px 50px, 50px 50px;
    color: #fff;
    font-family: 'Press Start 2P', cursive; /* Ana font değişti, Orbitron'a dönebilirsin istersen */
    font-family: 'Orbitron', sans-serif;
    overflow: hidden; touch-action: none; user-select: none;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    height: 100vh; width: 100vw;
}

canvas { display: block; width: 100%; height: 100%; }

.back-link {
    position: absolute; top: 20px; left: 20px;
    color: #00eaff; text-decoration: none; font-weight: bold; z-index: 100;
    text-shadow: 0 0 5px #00eaff; font-size: 0.9rem;
    background: rgba(0,0,0,0.6); padding: 8px 15px; border-radius: 5px;
    border: 1px solid #333;
}

/* OYUN KONTROLLERİ */
.game-controls {
    position: absolute; top: 20px; right: 20px; z-index: 100;
    display: flex; gap: 10px;
}
.game-controls button {
    background: rgba(0,0,0,0.6); border: 1px solid #00ff88; color: #00ff88;
    width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
    font-size: 1rem; transition: 0.2s; display: flex; align-items: center; justify-content: center;
}
.game-controls button:hover { background: #00ff88; color: #000; box-shadow: 0 0 10px #00ff88; }

/* ORTAK OVERLAY & MENÜ TASARIMI */
.overlay-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at center, rgba(10, 30, 50, 0.95) 0%, #000 90%);
    z-index: 50;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 30px;
}

.menu-buttons { display: flex; flex-direction: column; gap: 20px; align-items: center; }

.mode-btn {
    background: rgba(0, 0, 0, 0.5); color: #00ff88; border: 2px solid #00ff88;
    padding: 20px 40px; font-family: 'Press Start 2P'; cursor: pointer;
    font-size: 1.2rem; transition: 0.3s;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
    text-shadow: 0 0 5px #00ff88;
    position: relative; overflow: hidden; min-width: 300px;
}
.mode-btn::before {
    content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.5s;
}
.mode-btn:hover { background: #00ff88; color: #000; box-shadow: 0 0 30px #00ff88; transform: scale(1.05); }
.mode-btn:hover::before { left: 100%; }

/* INFO SCREEN (YENİ) */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px; width: 90%; max-width: 800px;
}
.info-card {
    background: rgba(255, 255, 255, 0.05); border: 1px solid #444;
    padding: 10px; border-radius: 8px; display: flex; align-items: center; gap: 15px;
    transition: 0.2s;
}
.info-card:hover { background: rgba(255, 255, 255, 0.1); border-color: #00ff88; }
.ic-icon { font-size: 1.5rem; width: 40px; text-align: center; }
.ic-text h4 { margin: 0 0 5px 0; font-size: 0.9rem; color: #00ff88; letter-spacing: 1px; }
.ic-text p { margin: 0; font-size: 0.7rem; color: #ccc; font-family: 'Roboto', sans-serif; line-height: 1.4; }

/* OYUN ALANI */
#game-container {
    display: flex; 
    align-items: center; justify-content: center;
    background: rgba(10, 10, 10, 0.85);
    padding: 20px; border-radius: 20px;
    border: 1px solid #333;
    box-shadow: 0 0 80px rgba(0, 234, 255, 0.1);
    backdrop-filter: blur(5px);
}

.player-area {
    position: relative;
    width: 600px; height: 600px;
    border: 4px solid #333;
    background: #0a0a0a;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.5);
}
.p1-border { border-color: #00eaff; box-shadow: 0 0 25px rgba(0, 234, 255, 0.15); }
.p2-border { border-color: #ff0055; box-shadow: 0 0 25px rgba(255, 0, 85, 0.15); }

/* --- ORTA UI --- */
#center-ui {
    width: 200px; height: 600px;
    background: #111; border: 1px solid #444;
    display: flex; flex-direction: column; align-items: center;
    padding: 10px; gap: 8px; margin: 0 15px;
    border-radius: 12px; position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    box-sizing: border-box;
}

.ui-panel-content {
    display: flex; flex-direction: column; gap: 6px; 
    width: 100%; flex-grow: 1;
    overflow-y: auto; justify-content: center;
}
.ui-panel-content::-webkit-scrollbar { width: 5px; }
.ui-panel-content::-webkit-scrollbar-thumb { background: #333; border-radius: 5px; }

.hidden { display: none !important; }

/* KULE KARTI */
.tower-card {
    width: 100%; background: #222; 
    border: 1px solid #444; padding: 8px 5px; cursor: pointer;
    display: flex; align-items: center; gap: 8px;
    transition: 0.2s; border-radius: 6px; min-height: 40px;
    box-sizing: border-box;
}
.tower-card:hover { background: #333; transform: translateX(3px); }
.tower-card.selected { border-color: #fff; background: #444; transform: scale(1.02); box-shadow: 0 0 10px rgba(255,255,255,0.1); }
.tower-card.disabled { opacity: 0.3; cursor: not-allowed; filter: grayscale(1); }

.t-icon { font-size: 1.1rem; width: 25px; text-align: center; }
.t-info h4 { font-size: 0.55rem; margin: 0 0 3px 0; color: #fff; letter-spacing: 1px; }
.t-cost { color: #ffd700; font-size: 0.55rem; font-family: 'Press Start 2P'; }

/* UPGRADE PANELİ */
#upgrade-panel {
    text-align: center; color: #fff; width: 100%; height: 100%;
    display: flex; flex-direction: column; gap: 10px; padding-top: 20px;
}
.upg-header { font-size: 0.9rem; color: #00eaff; margin-bottom: 5px; border-bottom: 1px solid #333; padding-bottom: 10px; font-weight: bold; }
.upg-stats { font-size: 0.7rem; color: #aaa; text-align: left; margin-bottom: 10px; line-height: 1.8; background: #1a1a1a; padding: 10px; border-radius: 5px; }
.upg-val { color: #00ff88; font-weight: bold; float: right; }

.upg-btn {
    width: 100%; padding: 15px; margin-bottom: 5px;
    border: 1px solid #00ff88; background: rgba(0, 255, 136, 0.1);
    color: #00ff88; cursor: pointer; font-family: 'Press Start 2P'; font-size: 0.7rem; transition: 0.2s;
}
.upg-btn:hover { background: #00ff88; color: #000; box-shadow: 0 0 15px rgba(0,255,136,0.3); }
.upg-btn:disabled { border-color: #555; color: #555; background: transparent; cursor: not-allowed; box-shadow: none; }

.sell-btn {
    width: 100%; padding: 15px;
    border: 1px solid #ff0055; background: rgba(255, 0, 85, 0.1);
    color: #ff0055; cursor: pointer; font-family: 'Press Start 2P'; font-size: 0.7rem; transition: 0.2s;
}
.sell-btn:hover { background: #ff0055; color: #fff; box-shadow: 0 0 15px rgba(255,0,85,0.3); }

.cancel-btn {
    margin-top: auto; width: 100%; padding: 15px;
    background: #442222; border: 1px solid #ff4444; color: #ff8888;
    font-family: 'Press Start 2P'; font-size: 0.65rem; cursor: pointer;
    transition: 0.3s; border-radius: 6px; min-height: 50px;
}
.cancel-btn:hover { background: #ff0000; color: #fff; }

#wave-btn {
    margin-top: auto; width: 100%; padding: 15px;
    background: #333; border: none; color: #888;
    font-family: 'Press Start 2P'; font-size: 0.65rem; cursor: pointer;
    transition: 0.3s; border-radius: 6px; min-height: 50px;
}
#wave-btn.ready { 
    background: #00ff88; color: #000; 
    box-shadow: 0 0 20px rgba(0,255,136,0.4); animation: pulse 1.5s infinite; 
}

h1 { font-size: 3rem; margin: 0; color: #fff; text-shadow: 0 0 20px #00eaff; letter-spacing: 5px; }

.overlay-info {
    position: absolute; top: 15px; left: 15px; 
    font-family: 'Roboto'; font-weight: bold; pointer-events: none;
    text-shadow: 2px 2px 4px black; font-size: 1.1rem;
    background: rgba(0,0,0,0.5); padding: 5px 10px; border-radius: 5px;
}
.p1-color { color: #00eaff; border-left: 3px solid #00eaff; }
.p2-color { color: #ff0055; border-left: 3px solid #ff0055; }

@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.03); } 100% { transform: scale(1); } }

@media (max-width: 1400px) {
    .player-area { width: 450px; height: 450px; }
    #center-ui { height: 470px; }
    #game-container { flex-direction: column; height: auto; overflow-y: auto; margin-top: 60px; }
    #center-ui { flex-direction: row; width: 95%; height: 100px; order: -1; margin-bottom: 20px; }
    .ui-panel-content { flex-direction: row; overflow-x: auto; padding-bottom: 5px; }
    .tower-card { flex-direction: column; justify-content: center; gap: 5px; text-align: center; min-width: 70px; padding: 5px;}
    .t-info h4 { display: none; }
    #upgrade-panel { flex-direction: row; align-items: center; gap: 10px; padding-top: 0; }
    .upg-stats { display: none; } 
    .upg-btn, .sell-btn { width: auto; height: 100%; padding: 0 20px; }
    .info-grid { grid-template-columns: 1fr; } /* Mobilde tek kolon */
}