/* ============================================
   SLITHER.IO - Premium Neon Dark Tema
   Glassmorphism + Neon Glow Efektleri
   ============================================ */

/* --- Temel Stil Ayarları --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    overflow: hidden;
    background: #0a0a1a;
    font-family: 'Orbitron', monospace, sans-serif;
    color: #ffffff;
    /* Metin seçimini engelle */
    user-select: none;
    -webkit-user-select: none;
}

/* --- Oyun Canvas --- */
canvas#gameCanvas {
    display: block;
    width: 100vw;
    height: 100vh;
    cursor: none; /* Oyun içinde özel imleç kullanacağız */
}

/* --- Overlay (Menü ve Ölüm ekranı için ortak) --- */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    /* Arka plan bulanıklık efekti */
    background: rgba(5, 5, 15, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: overlayFadeIn 0.4s ease-out;
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- Overlay İçerik Kutusu (Glassmorphism) --- */
.overlay-content {
    padding: 50px 60px;
    border-radius: 24px;
    text-align: center;
    animation: boxSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

/* Glassmorphism arka plan efekti */
.menu-box {
    background: linear-gradient(
        135deg,
        rgba(10, 10, 40, 0.9) 0%,
        rgba(15, 15, 50, 0.85) 50%,
        rgba(10, 10, 40, 0.9) 100%
    );
    border: 1px solid rgba(0, 255, 136, 0.25);
    box-shadow:
        0 0 30px rgba(0, 255, 136, 0.15),
        0 0 60px rgba(0, 255, 136, 0.05),
        inset 0 0 60px rgba(0, 255, 136, 0.03),
        0 25px 60px rgba(0, 0, 0, 0.5);
}

.death-box {
    background: linear-gradient(
        135deg,
        rgba(40, 10, 10, 0.9) 0%,
        rgba(50, 15, 15, 0.85) 50%,
        rgba(40, 10, 10, 0.9) 100%
    );
    border: 1px solid rgba(255, 50, 50, 0.3);
    box-shadow:
        0 0 30px rgba(255, 50, 50, 0.2),
        0 0 60px rgba(255, 50, 50, 0.08),
        inset 0 0 60px rgba(255, 50, 50, 0.03),
        0 25px 60px rgba(0, 0, 0, 0.5);
}

@keyframes boxSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* --- Oyun Başlığı (Neon Glow) --- */
.game-title {
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: 6px;
    color: #00ff88;
    text-shadow:
        0 0 10px rgba(0, 255, 136, 0.8),
        0 0 20px rgba(0, 255, 136, 0.6),
        0 0 40px rgba(0, 255, 136, 0.4),
        0 0 80px rgba(0, 255, 136, 0.2);
    margin-bottom: 8px;
    animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% {
        text-shadow:
            0 0 10px rgba(0, 255, 136, 0.8),
            0 0 20px rgba(0, 255, 136, 0.6),
            0 0 40px rgba(0, 255, 136, 0.4),
            0 0 80px rgba(0, 255, 136, 0.2);
        filter: brightness(1);
    }
    50% {
        text-shadow:
            0 0 15px rgba(0, 255, 136, 1),
            0 0 30px rgba(0, 255, 136, 0.8),
            0 0 60px rgba(0, 255, 136, 0.5),
            0 0 100px rgba(0, 255, 136, 0.3);
        filter: brightness(1.1);
    }
}

.subtitle {
    font-size: 0.85rem;
    font-weight: 400;
    color: rgba(0, 255, 136, 0.5);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 40px;
}

/* --- İsim Giriş Alanı --- */
.input-group {
    margin-bottom: 28px;
}

#nameInput {
    width: 320px;
    padding: 16px 24px;
    font-family: 'Orbitron', monospace, sans-serif;
    font-size: 1rem;
    font-weight: 500;
    color: #ffffff;
    letter-spacing: 2px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(0, 255, 136, 0.3);
    border-radius: 12px;
    outline: none;
    text-align: center;
    transition: all 0.3s ease;
}

#nameInput::placeholder {
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 2px;
}

/* Focus durumunda neon parıldama */
#nameInput:focus {
    border-color: rgba(0, 255, 136, 0.8);
    box-shadow:
        0 0 15px rgba(0, 255, 136, 0.3),
        0 0 30px rgba(0, 255, 136, 0.1),
        inset 0 0 15px rgba(0, 255, 136, 0.05);
    background: rgba(0, 0, 0, 0.6);
}

/* --- Neon Butonlar --- */
.neon-button {
    display: inline-block;
    padding: 16px 64px;
    font-family: 'Orbitron', monospace, sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 4px;
    color: #ffffff;
    background: linear-gradient(135deg, #00cc6a, #00ff88, #00cc6a);
    background-size: 200% 200%;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:
        0 0 15px rgba(0, 255, 136, 0.4),
        0 0 30px rgba(0, 255, 136, 0.15);
    position: relative;
    overflow: hidden;
}

.neon-button:hover {
    transform: scale(1.05);
    box-shadow:
        0 0 25px rgba(0, 255, 136, 0.6),
        0 0 50px rgba(0, 255, 136, 0.3),
        0 0 80px rgba(0, 255, 136, 0.1);
    background-position: 100% 50%;
}

.neon-button:active {
    transform: scale(0.98);
    box-shadow:
        0 0 10px rgba(0, 255, 136, 0.5),
        0 0 20px rgba(0, 255, 136, 0.2);
}

/* Buton üzerine parlama animasyonu */
.neon-button::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 40%;
    height: 200%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.15),
        transparent
    );
    transform: skewX(-20deg);
    transition: left 0.6s ease;
}

.neon-button:hover::after {
    left: 120%;
}

/* Tekrar oyna butonu - kırmızı tema */
.retry-button {
    background: linear-gradient(135deg, #cc3333, #ff4444, #cc3333);
    background-size: 200% 200%;
    box-shadow:
        0 0 15px rgba(255, 50, 50, 0.4),
        0 0 30px rgba(255, 50, 50, 0.15);
}

.retry-button:hover {
    box-shadow:
        0 0 25px rgba(255, 50, 50, 0.6),
        0 0 50px rgba(255, 50, 50, 0.3),
        0 0 80px rgba(255, 50, 50, 0.1);
}

/* --- Kontrol Bilgileri --- */
.controls-info {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.controls-info p {
    font-size: 0.7rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 1px;
    margin: 6px 0;
}

/* --- Ölüm Ekranı --- */
.death-title {
    font-size: 3.5rem;
    font-weight: 900;
    letter-spacing: 6px;
    color: #ff4444;
    text-shadow:
        0 0 10px rgba(255, 50, 50, 0.8),
        0 0 20px rgba(255, 50, 50, 0.6),
        0 0 40px rgba(255, 50, 50, 0.4),
        0 0 80px rgba(255, 50, 50, 0.2);
    margin-bottom: 12px;
    animation: deathPulse 1.5s ease-in-out infinite;
}

@keyframes deathPulse {
    0%, 100% {
        text-shadow:
            0 0 10px rgba(255, 50, 50, 0.8),
            0 0 20px rgba(255, 50, 50, 0.6),
            0 0 40px rgba(255, 50, 50, 0.4);
    }
    50% {
        text-shadow:
            0 0 20px rgba(255, 50, 50, 1),
            0 0 40px rgba(255, 50, 50, 0.7),
            0 0 60px rgba(255, 50, 50, 0.4),
            0 0 100px rgba(255, 50, 50, 0.2);
    }
}

.death-killer {
    font-size: 0.9rem;
    font-weight: 400;
    color: rgba(255, 100, 100, 0.7);
    letter-spacing: 2px;
    margin-bottom: 28px;
}

.death-score-container {
    margin-bottom: 36px;
}

.death-score-label {
    font-size: 0.75rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 4px;
    margin-bottom: 8px;
}

.death-score {
    font-size: 3rem;
    font-weight: 900;
    color: #ffaa00;
    text-shadow:
        0 0 10px rgba(255, 170, 0, 0.7),
        0 0 25px rgba(255, 170, 0, 0.4);
    letter-spacing: 4px;
}

/* --- Neon Glow Animasyonu (Genel kullanım) --- */
@keyframes neonGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 255, 136, 0.6);
    }
}

/* --- Responsive Düzenlemeler --- */
@media (max-width: 600px) {
    .overlay-content {
        padding: 30px 24px;
        margin: 16px;
    }
    .game-title {
        font-size: 2.2rem;
        letter-spacing: 3px;
    }
    .death-title {
        font-size: 2rem;
    }
    #nameInput {
        width: 260px;
        padding: 12px 16px;
        font-size: 0.85rem;
    }
    .neon-button {
        padding: 14px 40px;
        font-size: 1rem;
    }
    .death-score {
        font-size: 2rem;
    }
}
