* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: #0c0a1a;
    /* Koyu gece arka planı */
    color: white;
    height: 100vh;
    overflow: hidden;
    position: relative;
    user-select: none;
}

/* Arkaplanı iptal ettik ki Lottie doğa animasyonu arkadan görünsün */
body::before {
    display: none;
}

/* Arka Plan Manzara Katmanı */
#bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    /* En altta */
    pointer-events: none;
    overflow: hidden;
}

/* Manzara SVG'si tüm ekranı kaplasın */
#bg-layer svg {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    /* Ekran oranına göre kessin ama sığsın */
}

/* Bulut Katmanı (Kuşların ÖNÜNDE) */
#clouds-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 25;
    /* Kuşların (20) üstünde, UI'ın (50) altında */
    pointer-events: none;
    overflow: hidden;
}

#clouds-layer svg {
    width: 100% !important;
    height: 100% !important;
}

.video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10;
    pointer-events: none;
    /* Mouse tıklamalarını engellemesin */
}

/* Oyun Canvası */
.output_canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Kuşların bulunduğu katman */
#bird-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 20;
    pointer-events: none;
    overflow: hidden;
}

/* Kuş elementi stili */
.bird-container {
    position: absolute;
    transform-origin: center;
    pointer-events: none;
    will-change: transform;
}

/* UI Katmanı */
.ui-layer {
    position: relative;
    z-index: 50;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 2rem 3rem;
    position: relative;
    /* timer absolute pozisyonu için */
}

/* Sol Panel: Badge'ler bağımsız genişlikte (align-items: flex-start) */
.left-panel {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
    /* Her badge kendi içeriğine göre genişler */
}

/* Sol paneldeki durum göstergesi (küçük) */
.left-panel .status-panel {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.glass-panel {
    background: rgba(0, 0, 0, 0.4);
    /* Aydınlık manzaraya karşı okunabilir olması için koyulaştırıldı */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 1rem 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

.score-panel {
    text-align: center;
    min-width: 150px;
}

.score-panel .label {
    font-size: 0.8rem;
    letter-spacing: 2px;
    color: #a78bfa;
    margin-bottom: 0.5rem;
}

.score-panel .value {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    text-shadow: 0 0 20px rgba(167, 139, 250, 0.5);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.score-panel .value.bump {
    transform: scale(1.3);
    color: #34d399;
}

.speed-panel {
    text-align: center;
    min-width: 120px;
}

.speed-panel .label {
    font-size: 0.8rem;
    letter-spacing: 2px;
    color: #f472b6;
    margin-bottom: 0.5rem;
}

.speed-panel .value {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 0 15px rgba(244, 114, 182, 0.5);
}

.status-panel {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1.5rem;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ef4444;
    box-shadow: 0 0 10px #ef4444;
    transition: all 0.3s ease;
}

.status-indicator.active {
    background-color: #22c55e;
    box-shadow: 0 0 15px #22c55e, 0 0 30px #22c55e;
}

#statusText {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Nişangah Stili */
#crosshair {
    position: fixed;
    width: 60px;
    height: 60px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    display: none;
    pointer-events: none;
    z-index: 100;
    transition: width 0.1s, height 0.1s, border-color 0.1s;
}

#crosshair .dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: #38bdf8;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px #38bdf8;
    transition: background 0.1s, box-shadow 0.1s;
}

#crosshair .ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 1px solid rgba(56, 189, 248, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

#crosshair::before,
#crosshair::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.5);
}

/* Yatay ve dikey çizgiler */
#crosshair::before {
    top: 50%;
    left: -10px;
    width: 80px;
    height: 1px;
    transform: translateY(-50%);
}

#crosshair::after {
    left: 50%;
    top: -10px;
    height: 80px;
    width: 1px;
    transform: translateX(-50%);
}

/* Ateş Etme Efekti */
#crosshair.firing {
    width: 40px;
    height: 40px;
    border-color: #fca5a5;
}

#crosshair.firing .dot {
    background: #ef4444;
    box-shadow: 0 0 20px #ef4444;
    transform: translate(-50%, -50%) scale(1.5);
}

/* Vurulan Kuş Skoru Popup */
.floating-score {
    position: absolute;
    color: #34d399;
    /* Green for positive */
    font-weight: 800;
    font-size: 24px;
    pointer-events: none;
    z-index: 60;
    animation: floatUpAndFade 1s ease-out forwards;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

@keyframes floatUpAndFade {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-30px) scale(1.2);
    }

    100% {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
}

/* Ekran Sarsıntısı (Kaçırılan veya ceza durumu) */
@keyframes screenShake {
    0% {
        transform: translate(0, 0);
    }

    20% {
        transform: translate(-10px, 5px);
    }

    40% {
        transform: translate(10px, -5px);
    }

    60% {
        transform: translate(-10px, -5px);
    }

    80% {
        transform: translate(10px, 5px);
    }

    100% {
        transform: translate(0, 0);
    }
}

.shake {
    animation: screenShake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* ==========================================
   MODAL STILLERI
   ========================================== */
.game-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    /* backdrop-filter kaldırıldı: Lottie animasyonlarıyla birlikte olunca GPU'yu çok yoruyor */
    background: rgba(5, 4, 20, 0.88);
    transition: opacity 0.4s ease;
}

.game-modal.hidden {
    display: none;
}

.modal-content {
    text-align: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    padding: 3rem 4rem;
    max-width: 520px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalFadeIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    animation: iconBounce 2s ease-in-out infinite;
}

@keyframes iconBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.modal-title {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: 4px;
    background: linear-gradient(135deg, #fff 30%, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.modal-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 1.8rem;
    line-height: 1.5;
}

/* Skor Kuralları */
.score-rules {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 2rem;
    text-align: left;
}

.rule-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 0.6rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.rule-icon {
    font-size: 1.1rem;
}

.rule-text {
    flex: 1;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
}

.rule-points {
    font-weight: 800;
    font-size: 1rem;
}

.rule-item.hit .rule-points {
    color: #34d399;
}

.rule-item.miss .rule-points {
    color: #f87171;
}

.rule-item.escape .rule-points {
    color: #fbbf24;
}

.rule-item.time .rule-points {
    color: #60a5fa;
}

/* Aksiyon Butonu */
.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    width: 100%;
    padding: 1.1rem 2rem;
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    border: none;
    border-radius: 14px;
    color: white;
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 3px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.5);
}

.action-btn.hovered {
    transform: scale(1.05);
    filter: brightness(1.3);
    box-shadow: 0 0 30px rgba(124, 58, 237, 0.9), 0 0 60px rgba(124, 58, 237, 0.4);
}

.btn-crosshair {
    font-size: 1.4rem;
    opacity: 0.8;
}

.btn-hint {
    margin-top: 0.7rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 1px;
}

.privacy-notice {
    margin-top: 1.2rem;
    padding: 0.6rem 0.9rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    border-left: 2px solid rgba(255, 255, 255, 0.12);
    text-align: left;
    line-height: 1.5;
    letter-spacing: 0.3px;
}

/* Final Skor Kutusu */
.final-score-box {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.final-score-label {
    font-size: 0.8rem;
    letter-spacing: 3px;
    color: #a78bfa;
    margin-bottom: 0.5rem;
}

.final-score-value {
    font-size: 4rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 0 30px rgba(167, 139, 250, 0.7);
}

/* ==========================================
   TIMER STİLİ
   ========================================== */
.timer-panel {
    text-align: center;
    min-width: 130px;
}

.timer-value {
    font-size: 3rem;
    font-weight: 800;
    color: #fff;
    transition: color 0.3s, text-shadow 0.3s;
    display: block;
}

.timer-value.urgent {
    color: #f87171;
    text-shadow: 0 0 24px rgba(248, 113, 113, 0.9);
    animation: heartbeat 0.75s ease-in-out infinite;
}

/* Kalp atışı efekti: çift zıplama */
@keyframes heartbeat {
    0% {
        transform: scale(1);
    }

    14% {
        transform: scale(1.15);
    }

    28% {
        transform: scale(1);
    }

    42% {
        transform: scale(1.1);
    }

    70% {
        transform: scale(1);
    }

    100% {
        transform: scale(1);
    }
}

/* ==========================================
   MOBİL (RESPONSIVE) HUD AYARLARI
   ========================================== */
@media (max-width: 768px) {
    header {
        padding: 3.5rem 0.5rem 0.5rem 0.5rem; /* Notch/Status Bar (Çentik) altı güvenli alan */
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0.4rem;
        align-items: stretch;
        justify-content: space-between;
    }

    .left-panel {
        display: contents; 
    }

    .glass-panel {
        padding: 0.4rem 0.2rem;
        border-radius: 12px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        min-width: 0; 
        flex: 1; 
    }

    .score-panel { order: 1; }
    .timer-panel { margin: 0; order: 2; padding: 0.4rem 0.2rem; flex: 1; }
    .speed-panel { padding: 0.4rem 0.2rem; order: 3; flex: 1; }
    
    .status-panel { 
        order: 4; 
        flex: 1.5; 
        flex-direction: column;
        justify-content: center;
        gap: 0.3rem;
        padding: 0.4rem 0.2rem;
    }

    .score-panel .label, .speed-panel .label, .timer-panel .label {
        font-size: 0.55rem;
        font-weight: 800;
        margin-bottom: 0.15rem;
        letter-spacing: 0.5px;
        text-align: center;
    }

    .score-panel .value, .timer-value, .speed-panel .value {
        font-size: 1.6rem;
        font-weight: 900;
        line-height: 1;
        text-align: center;
    }

    #statusText {
        font-size: 0.55rem;
        font-weight: 800;
        text-align: center;
        line-height: 1.1;
    }
    
    .status-indicator {
        width: 10px; height: 10px;
        margin-bottom: 0.1rem;
    }

    .modal-content {
        padding: 1.5rem;
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
        border-radius: 16px;
    }

    .modal-title {
        font-size: 1.8rem;
        letter-spacing: 2px;
    }

    .modal-subtitle {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }

    .rule-item {
        padding: 0.4rem 0.6rem;
        gap: 0.5rem;
    }

    .rule-text, .rule-points {
        font-size: 0.75rem;
    }

    .action-btn {
        padding: 0.8rem 1rem;
        font-size: 1rem;
        letter-spacing: 1px;
    }
}