/* --- MB EĞİTSEL OYUNLAR UI (V7.0 - VITAMIN COLORS) --- */
@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400;600;700;800&family=Nunito:wght@400;600;700;800&display=swap');

:root {
    --primary: #FF9F43;
    --secondary: #5f27cd;
    --success: #2e86de;
    --info: #0abde3;
    --warning: #feca57;
    --danger: #ff6b6b;
    
    --grade-1: #1dd1a1;
    --grade-2: #ff9f43;
    --grade-3: #54a0ff;
    --grade-4: #5f27cd;
    --grade-zeka: #e1b12c;
	--grade-ritim: #e056fd; /* YENİ EKLENEN RİTİM RENGİ (Neon Mor) */

    --bg-body: #f7f9fc;
    --text-main: #222f3e;
    --top-bar-bg: #222f3e;
    
    --radius-xl: 20px;
}

/* STICKY FOOTER İÇİN BODY AYARI */
body {
    background-color: var(--bg-body);
    font-family: 'Nunito', sans-serif;
    color: var(--text-main);
    margin: 0;
    /* Footer'ı aşağı itmek için Flex yapısı */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Ana içerik alanının kalan boşluğu doldurması */
.page-wrapper {
    flex: 1; /* Sayfayı doldur */
    width: 100%;
    /* İçerik bitince Footer ile arasına 60px (yaklaşık 2 parmak) boşluk koy */
    padding-bottom: 60px !important; 
}

/* Fredoka yerine artık Baloo 2 kullanıyoruz (Türkçe için) */
.font-fredoka, h1, h2, h3, h4, h5, .brand-logo, .nav-link, .btn { 
    font-family: 'Baloo 2', cursive; 
}

/* --- 1. TOP BAR (ÜST KATMAN) --- */
.top-bar {
    background: var(--top-bar-bg);
    color: #c8d6e5;
    padding: 8px 0;
    font-size: 0.85rem;
    font-weight: 600;
}
.top-bar a { color: #fff; text-decoration: none; transition: 0.2s; }
.top-bar a:hover { color: var(--warning); }
.top-divider { border-right: 1px solid rgba(255,255,255,0.2); height: 12px; margin: 0 15px; display: inline-block; vertical-align: middle; }

/* --- 2. MAIN HEADER (ALT KATMAN) --- */
.main-header {
    background: #fff;
    padding: 15px 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 999;
}

.brand-logo {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary);
    display: flex; align-items: center; gap: 10px;
    text-decoration: none;
}
.brand-icon {
    width: 45px; height: 45px;
    background: linear-gradient(135deg, var(--primary), #ff6b6b);
    color: #fff;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 4px 10px rgba(255, 159, 67, 0.4);
}

/* Navigasyon Linkleri (Sadece Yönlendirme) */
.nav-link {
    font-weight: 700; color: #576574 !important; font-family: 'Fredoka', sans-serif;
    padding: 8px 15px !important; transition: 0.2s; border-radius: 8px;
}
.nav-link:hover { background: #f1f2f6; color: var(--secondary) !important; transform: translateY(-2px); }

/* BİLDİRİM ZİLİ */
.bell-btn {
    position: relative;
    width: 45px; height: 45px;
    background: #f1f2f6;
    border-radius: 50%;
    border: none;
    color: #576574;
    font-size: 1.2rem;
    transition: 0.3s;
    display: flex; align-items: center; justify-content: center;
}
.bell-btn:hover { background: var(--secondary); color: #fff; transform: rotate(15deg); }
.bell-badge {
    position: absolute; top: -2px; right: -2px;
    background: var(--danger); color: #fff;
    width: 20px; height: 20px;
    border-radius: 50%;
    font-size: 0.7rem; font-weight: 800;
    border: 2px solid #fff;
    display: flex; align-items: center; justify-content: center;
    animation: bounce 2s infinite;
}
@keyframes bounce { 0%, 20%, 50%, 80%, 100% {transform: translateY(0);} 40% {transform: translateY(-5px);} 60% {transform: translateY(-3px);} }

/* --- 3. ANASAYFA İÇİ FİLTRE BUTONLARI --- */
.home-filters {
    display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 30px;
}
.filter-btn {
    border: none; padding: 12px 25px; border-radius: 50px;
    font-family: 'Fredoka', sans-serif; font-weight: 600;
    background: #fff; color: #8395a7;
    box-shadow: 0 4px 0 #e0e0e0;
    transition: all 0.2s;
    display: flex; align-items: center; gap: 8px; cursor: pointer;
}
.filter-btn:active { transform: translateY(4px); box-shadow: none; }
.filter-btn i { font-size: 1.1rem; }

/* Aktif Buton Renkleri */
.filter-btn.active.all { background: #222f3e; color: #fff; box-shadow: 0 4px 0 #000; }
.filter-btn.active.g1 { background: var(--grade-1); color: #fff; box-shadow: 0 4px 0 #10ac84; }
.filter-btn.active.g2 { background: var(--grade-2); color: #fff; box-shadow: 0 4px 0 #e67e22; }
.filter-btn.active.g3 { background: var(--grade-3); color: #fff; box-shadow: 0 4px 0 #2e86de; }
.filter-btn.active.g4 { background: var(--grade-4); color: #fff; box-shadow: 0 4px 0 #341f97; }
.filter-btn.active.gz { background: var(--grade-zeka); color: #fff; box-shadow: 0 4px 0 #bfa020; }
.filter-btn.active.gr { background: var(--grade-ritim); color: #fff; box-shadow: 0 4px 0 #be2edd; }

/* --- 4. OYUN KARTLARI (Update) --- */
.game-card {
    background: #fff;
    border-radius: var(--radius-xl);
    overflow: hidden;
    position: relative;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Yumuşak yaylanma */
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.05);
    /* Kartın içindeki her şeyin hizası için */
    display: flex;
    flex-direction: column;
}
.game-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    z-index: 10;
}

/* RESİM ALANI & EFEKTLER */
.card-image-wrapper {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.game-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, filter 0.3s ease;
}

/* Hover olunca resim bulanıklaşsın ve kararsın */
.game-card:hover .game-thumb {
    transform: scale(1.1);
    filter: blur(3px) brightness(0.6);
}

/* ORTADAKİ PLAY BUTONU (Gizli başlar) */
.play-overlay-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 5;
    
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(5px);
    border-radius: 50%;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

/* Hover olunca Play butonu ortaya çıksın */
.game-card:hover .play-overlay-btn {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    animation: pulseBtn 1.5s infinite;
}

@keyframes pulseBtn {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}
/* YÜZEN İKONLAR (Tags) */
.floating-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 4;
}

.f-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.f-badge:hover { transform: scale(1.2); }

.game-info {
    padding: 15px;
    background: rgba(255, 255, 255, 0.8); /* Hafif şeffaf */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0 0 5px 0;
    color: var(--text-main);
    line-height: 1.3;
}

.card-cat {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
    opacity: 0.6;
}

/* POPÜLERLİK ÇUBUĞU */
.popularity-wrapper {
    margin-top: 15px;
}

.pop-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    font-weight: 700;
    color: #b2bec3;
    margin-bottom: 4px;
}

.pop-bar-bg {
    width: 100%;
    height: 6px;
    background: #f1f2f6;
    border-radius: 10px;
    overflow: hidden;
}

.pop-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #ff6b6b);
    border-radius: 10px;
    width: 0%; /* JS ile dolacak */
    transition: width 1s ease-out;
}


/* --- GÜNCELLENEN SINIF ROZETİ (DAHA BÜYÜK) --- */
.badge-grade-corner {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 8px 18px;          /* İç boşluk artırıldı */
    border-radius: 30px;        /* Daha yuvarlak */
    font-weight: 900;           /* Daha kalın yazı */
    font-size: 1rem;            /* Yazı boyutu büyüdü (Eskisi 0.7rem idi) */
    letter-spacing: 0.5px;
    color: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3); /* Gölge belirginleşti */
    z-index: 4;
    text-transform: uppercase;
    border: 2px solid rgba(255,255,255,0.3); /* Etrafına hafif beyaz çizgi */
}
/* --- YENİ (NEW) METİN ETİKETİ --- */
.badge-new-text {
    background: linear-gradient(135deg, #2ecc71, #26de81); /* Canlı Yeşil */
    color: #fff;
    font-size: 0.7rem;
    font-weight: 900;
    padding: 6px 10px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(46, 204, 113, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.4);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* --- DİĞER BİLEŞENLER --- */
.hero-box {
    background: linear-gradient(120deg, var(--secondary) 0%, #a55eea 100%);
    border-radius: 25px; padding: 40px; color: #fff;
    box-shadow: 0 10px 30px rgba(95, 39, 205, 0.3);
    position: relative; overflow: hidden;
	/* Eski padding'i override ediyoruz çünkü grid kullandık */
    padding: 0 !important;
}

.backdrop-blur {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Tab Butonları */
.grade-tabs .grade-tab {
    flex: 1;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    border-radius: 8px;
    padding: 6px 0;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Baloo 2', cursive;
}

.grade-tabs .grade-tab:hover {
    background: rgba(255, 255, 255, 0.4);
}

.grade-tabs .grade-tab.active {
    background: #fff;
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Kart İçeriği */
.daily-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.daily-game-item:hover .daily-card-img {
    transform: scale(1.05);
}
.daily-info-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    position: absolute;
    bottom: 0; left: 0; width: 100%;
    padding: 15px;
    color: #fff;
}
.badge-grade { position: absolute; top: 15px; right: 15px; padding: 5px 12px; border-radius: 20px; font-weight: 800; font-size: 0.75rem; color: #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }

/* --- 5. OYUN OYNAMA PENCERESİ (FULL SCREEN POPUP FIX) --- */
#game-overlay {
    position: fixed; /* Sayfadan bağımsız hale getirir */
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000;
    z-index: 10000; /* Her şeyin üstünde olsun */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none; /* Kapalıyken tıklanmasın */
    transition: opacity 0.3s ease;
}

#game-overlay.active {
    opacity: 1;
    pointer-events: all; /* Açılınca tıklanabilsin */
}

/* Arkaplan Blur Efekti */
#shell-backdrop {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(30px) brightness(0.4);
    z-index: 0;
}

/* Üst Kontrol Barı */
#shell-toolbar {
    position: absolute;
    top: 0; left: 0; width: 100%;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 20;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, transparent 100%);
}

.shell-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 45px; height: 45px;
    border-radius: 12px;
    font-size: 1.2rem;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.shell-btn:hover { background: #fff; color: #000; transform: scale(1.1); }

/* Oyun Sahnesi */
#game-container-wrapper {
    position: relative;
    z-index: 10;
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
    border-radius: 16px;
}

#game-stage {
    background: #000;
    border-radius: 16px;
    overflow: hidden;
}

/* Responsive Boyutlandırma */
.aspect-16-9 { width: 90vw; height: 50.625vw; max-height: 85vh; max-width: 151vh; }
.aspect-portrait { height: 85vh; width: 47.8vh; max-width: 90vw; }

/* Splash Screen (Yükleniyor) */
#game-splash-screen {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: #0b0b15;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    z-index: 50;
    transition: opacity 0.5s ease;
    border-radius: 16px;
}

/* --- 6. SKOR MODALI (POPUP FIX) --- */
#score-modal {
    position: fixed; /* Sabitleme */
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 11000; /* Oyunun da üstünde */
    display: none; /* JS ile flex yapılacak */
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
}

.score-modal-content {
    background: #fff;
    padding: 40px;
    border-radius: 30px;
    text-align: center;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: popUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popUp { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.score-trophy { font-size: 5rem; animation: bounce 2s infinite; }
.score-value { font-size: 3.5rem; font-weight: 800; color: var(--primary); font-family: 'Fredoka', sans-serif; }

/* --- KAPATMA BUTONU ÖZEL STİLİ (RED STYLE) --- */
.btn-close-game {
    background-color: rgba(255, 71, 87, 0.15) !important; /* Hafif transparan kırmızı */
    border: 1px solid rgba(255, 71, 87, 0.3) !important;
    color: #ff4757 !important; /* Yazı/İkon rengi */
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.btn-close-game:hover {
    background-color: #ff4757 !important; /* Canlı Kırmızı */
    color: #fff !important; /* Beyaz İkon */
    border-color: #ff4757 !important;
    transform: scale(1.1) rotate(90deg) !important; /* Hafif dönme efekti */
    box-shadow: 0 0 20px rgba(255, 71, 87, 0.6) !important; /* Kırmızı ışık saçma */
}

/* --- FOOTER (DARALTILMIŞ & SABİTLENMİŞ) --- */
.main-footer {
    background-color: var(--top-bar-bg);
    color: #c8d6e5;
    padding: 20px 0;
    margin-top: auto; /* İçerik kısaysa en alta yapışır */
    border-top: 4px solid var(--primary);
    font-size: 0.9rem;
    position: relative;
    z-index: 10;
}

.footer-brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}

.footer-nav {
    list-style: none;
    padding: 0; margin: 0;
    display: flex; justify-content: flex-end; gap: 15px;
}

.footer-nav li a {
    color: #8395a7; text-decoration: none; font-weight: 600;
    font-family: 'Baloo 2', cursive; transition: 0.2s;
}

.footer-nav li a:hover { color: var(--warning); }

* --- DİĞER STİLLER (AYNI KALDI) --- */
.top-bar { background: var(--top-bar-bg); color: #c8d6e5; padding: 6px 0; font-size: 0.8rem; font-weight: 600; }
.top-bar a { color: #fff; text-decoration: none; }
.main-header { background: #fff; padding: 10px 0; box-shadow: 0 4px 20px rgba(0,0,0,0.05); }

.brand-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--primary), #ff6b6b);
    color: #fff; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; margin-right: 10px;
}
.brand-logo { color: var(--secondary); text-decoration: none; display: flex; align-items: center; font-weight: 800; font-size: 1.4rem; line-height: 1.1; }

.nav-link { color: #576574 !important; font-weight: 700; padding: 8px 12px !important; }
.nav-link:hover { color: var(--secondary) !important; background: #f1f2f6; border-radius: 8px; }



/* Popup Fix (Zaten eklemiştik, burada dursun) */
#game-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 10000; background: #000; display: flex; justify-content: center; align-items: center; opacity: 0; pointer-events: none; transition: 0.3s; }
#game-overlay.active { opacity: 1; pointer-events: all; }

/* MOBİL UYUM */
@media (max-width: 768px) {
    .footer-nav {
        justify-content: center; /* Mobilde ortala */
        flex-direction: column;
        gap: 10px;
    }
    
    .main-footer {
        text-align: center;
        padding: 30px 0;
    }
}

/* --- USER HEADER STYLES --- */
.user-pill {
    background: #fff;
    padding: 5px 15px 5px 5px;
    border-radius: 50px;
    border: 1px solid #eef2f6;
    transition: all 0.2s;
}
.user-pill:hover, .show > .user-pill {
    background: #f8f9fa;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.bg-light-hover:hover {
    background-color: #f1f3f5 !important;
    transform: translateX(5px);
}

.transition-all {
    transition: all 0.2s ease;
}

/* --- QR SCAN ANIMATION --- */
.scan-anim-box {
    overflow: hidden;
}
.scan-line {
    position: absolute;
    width: 100%;
    height: 4px;
    background: #ff4757;
    box-shadow: 0 0 10px #ff4757;
    top: 0;
    left: 0;
    animation: scanMove 2s infinite linear;
}

@keyframes scanMove {
    0% { top: 0; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* MODAL BUTON DÜZELTMESİ */
.score-modal-content .score-btn-primary {
    background: #4361ee !important; /* Mavi Arkaplan */
    color: #ffffff !important;      /* Beyaz Yazı */
    border: 1px solid #3f51b5 !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    margin-bottom: 10px;
}

.score-modal-content .score-btn-primary:hover {
    background: #304ffe !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.4);
}

.score-input-group input {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #ddd;
}
.score-input-group input:focus {
    border-color: #4361ee;
    background: #fff;
}