/* ==========================================
   RESET & TEMEL AYARLAR
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    overflow: hidden;
    background: radial-gradient(circle at center, #2d3748 0%, #1a202c 100%);
    color: #fff;
    width: 100vw;
    height: 100vh;
}

.video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10;
    pointer-events: none;
}

/* Kılıç izinin çizileceği yer */
.output_canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 60;
    /* Meyvelerin üstünde, UI'ın altında */
    position: relative;
    pointer-events: none;
}

/* Meyvelerin bulunduğu katman */
#fruit-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 20;
    pointer-events: none;
    overflow: hidden;
}

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

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

header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 2rem 3rem;
    position: relative;
}

/* Sol Panel: Skor + Durum üst üste */
.left-panel {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
}

/* 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);
    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 {
    min-width: 140px;
    text-align: center;
}

.label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #9ca3af;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.value {
    font-size: 3rem;
    font-weight: 800;
    color: #fca5a5;
    text-shadow: 0 0 15px rgba(252, 165, 165, 0.5);
    transition: transform 0.1s;
}

.value.bump {
    transform: scale(1.2);
    color: #ef4444;
}

/* Multiplier Paneli (Sağda) */
.speed-panel {
    min-width: 120px;
    text-align: center;
}

/* Oyun Durumu Göstergesi */
.status-panel {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.5rem;
}

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

.status-indicator.active {
    background: #22c55e;
    box-shadow: 0 0 10px #22c55e;
}

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

/* Floating Score (Kesik Meyve Puanı) */
.floating-score {
    position: absolute;
    color: #fca5a5;
    font-size: 2.5rem;
    font-weight: 800;
    text-shadow: 0 0 10px rgba(252, 165, 165, 0.8);
    pointer-events: none;
    z-index: 100;
    animation: floatUp 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes floatUp {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }

    20% {
        transform: translate(-50%, -100%) scale(1.2);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -200%) scale(1);
        opacity: 0;
    }
}

/* Modal Stilleri */
.game-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.88);
    transition: opacity 0.4s ease;
}

.game-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    text-align: center;
    max-width: 600px;
    width: 90%;
    padding: 3rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    background: rgba(15, 23, 42, 0.6);
}

.game-title {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
    color: #fff;
}

.highlight {
    color: #fca5a5;
    text-shadow: 0 0 20px rgba(252, 165, 165, 0.4);
}

.subtitle {
    font-size: 1.2rem;
    color: #94a3b8;
    margin-bottom: 2rem;
    letter-spacing: 2px;
}

.instruction-box {
    text-align: left;
    background: rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.rule-item {
    margin-bottom: 0.75rem;
    font-size: 1rem;
    color: #cbd5e1;
    line-height: 1.4;
}

.rule-item:last-child {
    margin-bottom: 0;
}

.rule-item strong {
    color: #fff;
    font-weight: 600;
}

.action-btn {
    appearance: none;
    border: none;
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    color: white;
    font-size: 1.5rem;
    font-weight: 800;
    padding: 1rem 3rem;
    border-radius: 50px;
    cursor: default;
    /* Elden algılanıyor */
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.4);
    transition: all 0.2s;
    letter-spacing: 2px;
}

.action-btn.hovered {
    transform: scale(1.05);
    box-shadow: 0 15px 35px rgba(239, 68, 68, 0.6);
    background: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
}

.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-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.final-score-box .label {
    color: #fca5a5;
    margin-bottom: 0.5rem;
}

.final-score-value {
    font-size: 4rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 0 30px rgba(252, 165, 165, 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: #ef4444;
    text-shadow: 0 0 24px rgba(239, 68, 68, 0.9);
    animation: heartbeat 0.75s ease-in-out infinite;
}

@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);
    }
}

.rank-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
    font-size: 1.5rem;
    color: #cbd5e1;
    font-weight: 600;
}

.rank-icon {
    font-size: 2.5rem;
}