@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;800&display=swap');

:root {
    --bg-color: #e0e5ec;
    --text-color: #333;
    --primary: #4a90e2;
    --glass-bg: rgba(255, 255, 255, 0.4);
    --glass-border: rgba(255, 255, 255, 0.6);
    --neo-shadow: 9px 9px 16px rgb(163,177,198,0.6), -9px -9px 16px rgba(255,255,255, 0.5);
    --neo-shadow-inset: inset 6px 6px 10px 0 rgba(163,177,198, 0.7), inset -6px -6px 10px 0 rgba(255,255,255, 0.8);
}

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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #e0e5ec 0%, #f0f4f8 100%);
    color: var(--text-color);
    overflow-x: hidden;
    overflow-y: auto; 
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Üst Menü */
header {
    position: fixed; top: 0; left: 0; width: 100%;
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 30px;
    z-index: 1000;
    background: rgba(224, 229, 236, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
}

.logo-container img { height: 40px; }
.menu-buttons { display: flex; gap: 10px; }

/* Butonlar (Neumorphism) */
.neo-btn {
    border: none; outline: none;
    padding: 10px 20px;
    border-radius: 12px;
    background: var(--bg-color);
    box-shadow: var(--neo-shadow);
    color: var(--text-color);
    font-weight: 600; font-family: inherit;
    cursor: pointer; transition: all 0.2s ease;
}
.neo-btn:active { box-shadow: var(--neo-shadow-inset); }
.neo-btn.active { box-shadow: var(--neo-shadow-inset); color: var(--primary); }
.neo-btn.primary { background: var(--primary); color: white; margin-top: 15px; padding: 15px 30px; font-size: 1.1rem;}

/* Glassmorphism Paneller */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

/* Ekran Yönetimi */
.screen {
    display: none; width: 100%; min-height: 100dvh;
    flex-direction: column; align-items: center; justify-content: flex-start;
}
.screen.active {
    display: flex; animation: fadeIn 0.4s ease forwards;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Giriş ve Sonuç Ekranları (Üste binme sorunu burada çözüldü) */
#introScreen, #resultScreen {
    margin: 110px auto 40px auto; /* Üstten 110px, Sağ/Sol ortalı, Alttan 40px */
    padding: 40px;
    width: 90%; 
    max-width: 500px; 
    height: auto;
}

/* Oyun Ekranı */
#gameScreen.active {
    position: fixed; top: 0; left: 0; width: 100%; height: 100dvh;
    padding-top: 80px; /* Üst menü boşluğu */
    padding-bottom: 60px; /* Alt bar boşluğu */
    overflow: hidden; justify-content: flex-start;
}

/* Oyun İçi Alt Şerit */
.game-bottom-bar {
    position: absolute; bottom: 0; left: 0; width: 100%; height: 60px;
    background: rgba(224, 229, 236, 0.9);
    border-top: 1px solid var(--glass-border);
    display: flex; justify-content: center; align-items: center; gap: 20px;
    z-index: 100;
}
.game-bottom-bar .neo-btn {
    padding: 8px 16px; font-size: 0.95rem; margin: 0;
}

/* Oyun Bitti Ekranı */
#gameOverScreen.active {
    position: fixed; top: 0; left: 0; width: 100%; height: 100dvh;
    justify-content: center; z-index: 200; align-items: center;
    background: rgba(224, 229, 236, 0.95);
}

h1, h2 { text-align: center; margin-bottom: 20px; color: #2c3e50; }
.input-group { width: 100%; margin-bottom: 20px; text-align: center; }
.input-group label { display: block; margin-bottom: 10px; font-weight: 600; }
input[type="text"] {
    width: 100%; padding: 12px; border-radius: 12px; border: none;
    background: var(--bg-color); box-shadow: var(--neo-shadow-inset);
    font-family: inherit; text-align: center; outline: none;
}
.emoji-selector { display: flex; justify-content: center; gap: 15px; font-size: 1.5rem; }
.emoji { cursor: pointer; padding: 10px; border-radius: 50%; transition: transform 0.2s; }
.emoji.selected { background: var(--glass-border); transform: scale(1.2); }
input[type="range"] { width: 100%; cursor: pointer; }
.scoring-info { font-size: 0.85rem; color: #666; margin-top: 5px; }
.hidden { display: none !important; }

/* Oyun Ekranı (HUD & Area) */
.game-hud {
    display: flex; justify-content: space-around; width: 100%; padding: 10px; z-index: 10;
}
.hud-item { padding: 10px 20px; font-weight: bold; font-size: 1.1rem; }
#gameArea { position: relative; width: 100%; flex-grow: 1; overflow: hidden; }

/* Balonlar */
.balloon {
    position: absolute; width: 60px; height: 75px;
    border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: bold; font-size: 0.8rem; text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    cursor: pointer; text-align: center; line-height: 1;
    box-shadow: inset -5px -5px 15px rgba(0,0,0,0.2), inset 5px 5px 15px rgba(255,255,255,0.4), 0 5px 10px rgba(0,0,0,0.1);
}
.balloon::after {
    content: ''; position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%);
    width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 10px solid inherit;
}
.time-balloon { border: 3px solid gold; animation: pulse 1s infinite; }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.1); } 100% { transform: scale(1); } }

/* Patlama Efekti */
.particle { position: absolute; border-radius: 50%; pointer-events: none; }

/* Liderlik Tablosu */
.final-score-box { font-size: 1.5rem; font-weight: bold; text-align: center; margin-bottom: 20px; }
.leaderboard { list-style: none; padding: 0; margin-bottom: 20px; width: 100%; }
.leaderboard li {
    display: flex; justify-content: space-between; padding: 10px;
    border-bottom: 1px solid rgba(0,0,0,0.1); align-items: center;
}
.leaderboard li.player { background: rgba(74, 144, 226, 0.2); font-weight: bold; border-radius: 8px; }

/* Modal */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.4); z-index: 1000;
    display: flex; align-items: center; justify-content: center;
}
.modal-box { padding: 30px; max-width: 400px; width: 90%; text-align: center; }
#modalContent { margin: 20px 0; font-size: 0.95rem; line-height: 1.5; }

/* Sonuç Ekranı Animasyonu */
.slide-up-anim { animation: slideUp 0.6s ease-out forwards; }
@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Mobil Cihaz Optimizasyonları */
@media (max-width: 768px) {
    .hide-mobile { display: none; }
    header { padding: 10px; }
    .logo-container img { height: 30px; }
    .neo-btn { padding: 8px 12px; font-size: 1rem; }
    
    #introScreen, #resultScreen { margin-top: 80px; padding: 20px; }
    #gameScreen.active { padding-top: 60px; padding-bottom: 60px; }
    
    .game-hud { padding: 5px; gap: 5px; flex-wrap: wrap; }
    .hud-item { padding: 5px 10px; font-size: 0.9rem; margin-bottom: 5px;}
    .game-bottom-bar { gap: 10px; }
    .game-bottom-bar .neo-btn { font-size: 0.85rem; padding: 6px 12px; }
}