/* ═══════════════════════════════════════════════════
   BLOB.io — Modern Arayüz Stili
   ═══════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --accent:   #7c3aed;
    --accent2:  #06b6d4;
    --accent3:  #f59e0b;
    --danger:   #ef4444;
    --bg:       #06090f;
    --panel:    rgba(13, 17, 26, 0.92);
    --border:   rgba(255, 255, 255, 0.08);
    --text:     #e8eaf6;
    --muted:    #64748b;
}

html, body {
    margin: 0; padding: 0;
    width: 100%; height: 100%;
    overflow: hidden;
    background: var(--bg);
    font-family: 'Exo 2', sans-serif;
    color: var(--text);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

canvas { display: block; }

/* ── GİRİŞ EKRANI ──────────────────────────────── */
#overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

#overlay.hidden { display: none; }

.overlay-bg {
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 50% 50%,
        rgba(124,58,237,0.12) 0%, transparent 70%),
        radial-gradient(ellipse at 80% 20%,
        rgba(6,182,212,0.08) 0%, transparent 60%);
}

/* Floating orb arka plan */
.overlay-orbs { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    animation: orbFloat 8s ease-in-out infinite;
}
.orb1 {
    width: 400px; height: 400px;
    background: rgba(124,58,237,0.18);
    top: -10%; left: -5%;
    animation-delay: 0s;
}
.orb2 {
    width: 300px; height: 300px;
    background: rgba(6,182,212,0.14);
    top: 60%; right: -5%;
    animation-delay: -3s;
}
.orb3 {
    width: 250px; height: 250px;
    background: rgba(245,158,11,0.1);
    bottom: 10%; left: 40%;
    animation-delay: -5.5s;
}

@keyframes orbFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50%       { transform: translateY(-30px) scale(1.05); }
}

/* Panel */
.panel {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px 36px 32px;
    width: min(420px, 92vw);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    backdrop-filter: blur(24px);
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.04),
        0 24px 60px rgba(0,0,0,0.7),
        inset 0 1px 0 rgba(255,255,255,0.07);
    animation: panelIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes panelIn {
    from { opacity: 0; transform: scale(0.88) translateY(24px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-blob {
    font-size: 38px;
    animation: blobPulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 14px var(--accent));
    color: var(--accent);
}

@keyframes blobPulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.15); }
}

.logo-text {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 38px;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #a78bfa, #67e8f9, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-io {
    font-weight: 400;
    opacity: 0.7;
}

.tagline {
    color: var(--muted);
    font-size: 13px;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: -8px;
}

/* Input */
.form-group { width: 100%; }

#nameInput {
    width: 100%;
    padding: 14px 20px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: #fff;
    font-family: 'Exo 2', sans-serif;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#nameInput::placeholder { color: var(--muted); }

#nameInput:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(124,58,237,0.25);
}

/* Skin label */
.skin-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    letter-spacing: 3px;
    color: var(--muted);
    align-self: flex-start;
    margin-bottom: -8px;
}

/* Skin grid */
.skin-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    width: 100%;
}

.skin-btn {
    aspect-ratio: 1;
    font-size: 22px;
    background: rgba(255,255,255,0.04);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
}

.skin-btn:hover {
    background: rgba(255,255,255,0.1);
    transform: scale(1.08);
}

.skin-btn.active {
    border-color: var(--accent);
    background: rgba(124,58,237,0.2);
    box-shadow: 0 0 12px rgba(124,58,237,0.4);
    transform: scale(1.1);
}

/* Start button */
#startBtn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--accent), #9333ea);
    border: none;
    border-radius: 14px;
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(124,58,237,0.45);
}

#startBtn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
    opacity: 0;
    transition: opacity 0.2s;
}

#startBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(124,58,237,0.6);
}
#startBtn:hover::after { opacity: 1; }
#startBtn:active { transform: translateY(0) scale(0.98); }

/* Tips */
.tips {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.5px;
    margin-top: -4px;
}

.tips span::before {
    content: '';
    display: inline-block;
    width: 3px; height: 3px;
    background: var(--muted);
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

/* ── ÖLÜM EKRANI ────────────────────────────────── */
#deathScreen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(12px);
    z-index: 200;
    animation: fadeIn 0.3s ease both;
}

#deathScreen.hidden { display: none; }

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

.death-content {
    background: var(--panel);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 20px;
    padding: 44px 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    box-shadow: 0 0 60px rgba(239,68,68,0.2),
                0 24px 60px rgba(0,0,0,0.7);
    animation: panelIn 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}

.death-icon {
    font-size: 56px;
    animation: shakeOnce 0.4s ease 0.1s both;
}

@keyframes shakeOnce {
    0%, 100% { transform: rotate(0); }
    25%       { transform: rotate(-10deg) scale(1.1); }
    75%       { transform: rotate(10deg) scale(1.1); }
}

.death-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 32px;
    font-weight: 900;
    color: var(--danger);
    letter-spacing: 4px;
    text-shadow: 0 0 24px rgba(239,68,68,0.7);
}

.death-by {
    color: var(--muted);
    font-size: 14px;
}

.death-by strong {
    color: #f97316;
}

.death-score {
    font-family: 'Orbitron', sans-serif;
    font-size: 22px;
    color: var(--accent3);
}

#respawnBtn {
    margin-top: 8px;
    padding: 14px 40px;
    background: linear-gradient(135deg, var(--danger), #b91c1c);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(239,68,68,0.4);
    transition: all 0.2s;
}

#respawnBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(239,68,68,0.6);
}

/* ── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 480px) {
    .panel { padding: 30px 20px 24px; gap: 14px; }
    .logo-text { font-size: 30px; }
    .skin-grid { grid-template-columns: repeat(4, 1fr); }
    .tips { font-size: 10px; gap: 8px; }
}
