/* ========================================= */
/* --- 1. TEMEL AYARLAR --- */
/* ========================================= */

@keyframes neonPulse {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

:root {
    /* Varsayılan Tema */
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --kart-bg: rgba(255, 255, 255, 0.90);
    --kart-border: rgba(255, 255, 255, 1);
    --kart-golge: 0 20px 60px rgba(0, 0, 0, 0.08);
    --yazi-renk: #2d3436; 
    
    /* Butonlar */
    --btn-basla: linear-gradient(135deg, #00b09b 0%, #96c93d 100%);
    --btn-market: linear-gradient(135deg, #f09819 0%, #edde5d 100%);
    --btn-tema: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    --btn-veri: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    
    /* AYARLAR BUTONU */
    --btn-ayar: linear-gradient(135deg, #434343 0%, #000000 100%); 
    
    /* Zorluk */
    --diff-kolay: linear-gradient(135deg, #a8e063 0%, #56ab2f 100%);
    --diff-orta: linear-gradient(135deg, #FFC796 0%, #FF6B95 100%);
    --diff-zor: linear-gradient(135deg, #ff9966 0%, #ff5e62 100%);
    --diff-uzman: linear-gradient(135deg, #8360c3 0%, #2ebf91 100%);
    
    /* Kayıt Butonu */
    --btn-kayit-bg: linear-gradient(135deg, #8e44ad 0%, #c0392b 100%);

    /* Oyun İçi */
    --cizgi-renk: #34495e;
    --kalin-cizgi: #1a252f;
    --secili-hucre: #81d4fa;
    --ayni-sayi: #81d4fa;
    --rehber-renk: #e1f5fe;
    --hata-renk: #e74c3c;
    --mavi-yazi: #2c3e50;
    --hucre-bg: #ffffff;
    --liste-eleman-bg: rgba(255, 255, 255, 0.6);
    --not-renk: #555555;
    
    /* Başarım Renkleri */
    --ach-claimable: #f39c12;
    --ach-claimed: #2ecc71;
    --ach-locked: #bdc3c7;
}

body {
    margin: 0; padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-gradient);
    color: var(--yazi-renk);
    
    width: 100%;
    height: 100dvh; 
    display: flex; 
    justify-content: center; 
    align-items: center;   
    
    overflow: hidden; 
    touch-action: manipulation; 
    
    /* 🔥 KOPYALAMA ENGELLEME (GÜÇLENDİRİLMİŞ) 🔥 */
    -webkit-user-select: none; /* Safari ve Chrome (Mobil) için ŞART */
    -moz-user-select: none;    /* Firefox için */
    -ms-user-select: none;     /* Internet Explorer/Edge için */
    user-select: none;         /* Standart */
    
    /* 🔥 MOBİL ÖZEL AYARLAR 🔥 */
    -webkit-touch-callout: none; /* iOS'ta uzun basınca çıkan menüyü engeller */
    -webkit-tap-highlight-color: transparent; /* Tıklayınca çıkan mavi parlama kutusunu yok eder */
    
    transition: background 0.5s ease; 
}

/* --- MENÜ KARTLARI --- */
.menu-card {
    background: var(--kart-bg);
    backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
    border: 2px solid var(--kart-border);
    border-radius: 30px; 
    padding: 30px 25px; 
    
    width: 85%; 
    max-width: 340px; /* Genişliği sabitledik */
    
    /* Yükseklik ayarı: İçerik kadar uzasın ama ekranı taşmasın */
    max-height: 85dvh; 
    
    text-align: center; 
    box-shadow: var(--kart-golge);
    
    display: flex; 
    flex-direction: column; 
    
    /* --- DÜZELTME BURADA --- */
    justify-content: center; /* İçerikleri dikeyde ortala */
    gap: 12px; /* Butonlar arası boşluğu biraz açtık, daha ferah olsun */
    /* ----------------------- */

    animation: slideUp 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    overflow-y: auto; 
    position: relative; 
    
    /* Sayfa içinde tam merkeze oturması için garanti margin */
    margin: auto;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(40px) scale(0.95); } to { transform: translateY(0) scale(1); } }

h1, h2 { margin: 0 0 15px 0; font-weight: 800; color: var(--yazi-renk); text-align: center; }
h1 { font-size: 2.5rem; letter-spacing: 1px; }
h2 { font-size: 1.6rem; margin-bottom: 15px; }

.animated-bg {
    background-size: 400% 400% !important;
    animation: neonPulse 15s ease infinite;
}

.menu-card-footer {
    position: sticky;
    bottom: -30px; 
    width: 100%; 
    margin: 10px 0px -30px 0px; 
    padding: 15px 25px 30px 25px; 
    box-sizing: border-box;
    background: var(--kart-bg); 
    
    /* 🔥 YENİ EKLENEN: Footer'ı içerikten ayıran çizgi */
    border-top: 1px solid var(--kart-border);
    
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    z-index: 20;
    
    /* 🔥 YENİ EKLENEN: Daha belirgin gölge (karanlık mod için) */
    box-shadow: 0 -10px 25px rgba(0,0,0,0.2); 
    
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}
.menu-card-footer .btn-back {
    margin: 0; 
    width: 100%;
    font-size: 1rem;
}

.btn {
    border: none; color: white; padding: 18px 20px; border-radius: 18px;
    font-size: 1.1rem; font-weight: 700; cursor: pointer;
    transition: all 0.2s ease; 
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 15px rgba(0,0,0,0.05); width: 100%; box-sizing: border-box;
}
.btn span { margin-right: 10px; font-size: 1.3rem; }
.btn:active { transform: scale(0.97); }

.btn-start { background: var(--btn-basla); }
.btn-market { background: var(--btn-market); }
.btn-theme { background: var(--btn-tema); box-shadow: 0 8px 15px rgba(155, 89, 182, 0.3); }
.btn-data { background: var(--btn-veri); }

.btn-settings { 
    background: var(--btn-ayar); 
    color: white !important; 
    border: 1px solid rgba(255,255,255,0.3) !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-saved-menu { background: var(--btn-kayit-bg); margin-top: 15px; box-shadow: 0 10px 20px rgba(0,0,0,0.15); border: 1px solid rgba(255,255,255,0.2); }

.btn-diff-easy { background: var(--diff-kolay); }
.btn-diff-medium { background: var(--diff-orta); }
.btn-diff-hard { background: var(--diff-zor); }
.btn-diff-expert { background: var(--diff-uzman); }

.btn-back { background: #ff7675; justify-content: center; color: white; margin-top: 5px; }
.btn-reset { background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%); margin-top: 20px; }
.btn-resume { background: #2ecc71; color: white; }
.btn-exit { background: #e74c3c; color: white; }

.stat-row, .save-slot, .market-item, .achievement-item, .theme-item {
    background: var(--liste-eleman-bg); border-radius: 15px; padding: 12px; margin-bottom: 8px;
    border: 1px solid rgba(0,0,0,0.05); color: var(--yazi-renk); box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.stat-card-header {
    font-weight: bold; font-size: 1.1rem; margin-bottom: 5px; padding-bottom: 5px;
    border-bottom: 1px solid rgba(0,0,0,0.1); text-align: left;
}
.stat-details { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 5px; }
.stat-item { font-size: 0.9rem; text-align: left; opacity: 0.9; }
.stat-val-highlight { color: var(--mavi-yazi); font-weight: bold; opacity: 1; }
.stat-reset-container { margin-top: 15px; padding-bottom: 5px; } 
.btn-reset-stats {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white; padding: 8px 15px; border-radius: 10px; font-size: 0.9rem;
    font-weight: 700; margin-top: 15px; cursor: pointer; border: none;
}

.market-tabs { display: flex; background: rgba(0,0,0,0.05); border-radius: 15px; margin-bottom: 15px; padding: 5px; }
.tab-btn { flex: 1; padding: 10px; border: none; border-radius: 10px; background: transparent; color: var(--yazi-renk); font-weight: bold; cursor: pointer; transition: background 0.2s; font-size: 1rem; }
/* --- GÜNCELLENMİŞ SEKME STİLİ --- */
.tab-btn.active { 
    background: var(--tab-aktif-bg) !important; /* Yeni değişken */
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); 
    border: 1px solid var(--yazi-renk); /* Temanın yazı renginde çerçeve */
    transform: scale(1.02); /* Hafif büyütme efekti */
}
.market-content-section { display: none; flex-direction: row; }
.market-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 10px; margin-bottom: 20px; text-align: center; width: 100%; }
.market-item-grid { background: var(--liste-eleman-bg); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; min-height: 120px; box-shadow: 0 4px 8px rgba(0,0,0,0.05); border: 1px solid rgba(0,0,0,0.05); }
.grid-icon { font-size: 2rem; color: var(--ach-claimable); margin-bottom: 5px; }
.grid-item-name { font-weight: bold; font-size: 0.9rem; margin-bottom: 5px; color: var(--yazi-renk); }
.grid-item-action { margin-top: 5px; width: 100%; }
.btn-grid-action { padding: 6px 12px; border-radius: 8px; border: none; font-weight: bold; font-size: 0.8rem; cursor: pointer; width: 100%; }
.btn-grid-action.buy { background: #2ecc71; color: white; }
.btn-grid-action.owned { background: #3498db; color: white; }
.btn-grid-action.equipped { background: #95a5a6; color: white; }
.btn-grid-action:disabled { opacity: 0.5; }

.theme-item { display: flex; justify-content: space-between; align-items: center; padding: 12px; background: var(--liste-eleman-bg); border-radius: 15px; margin-bottom: 8px; transition: all 0.2s ease; }
.theme-item.theme-selected { border: 2px solid var(--mavi-yazi); background: rgba(41, 128, 185, 0.1); box-shadow: 0 0 10px rgba(41, 128, 185, 0.5); padding: 10px 12px; }
.theme-name { font-weight: bold; font-size: 1rem; flex-grow: 1; }
.btn-select { padding: 8px 16px; border-radius: 10px; border: none; font-weight: bold; font-size: 0.85rem; cursor: pointer; background: #3498db; color: white; min-width: 80px; }
.btn-select.active { background: var(--ach-claimed); cursor: default; }

.achievement-item { display: flex; justify-content: space-between; align-items: center; padding: 12px; }
.ach-info-box { display: flex; align-items: center; flex-grow: 1; }
.ach-icon { font-size: 1.5rem; margin-right: 15px; flex-shrink: 0; color: var(--ach-locked); }
.ach-text-details { display: flex; flex-direction: column; justify-content: center; text-align: left; }
.ach-desc { font-size: 0.75rem; color: var(--yazi-renk); opacity: 0.7; }
.ach-actions { flex-shrink: 0; }
.btn-claim { padding: 6px 12px; border-radius: 8px; border: none; font-weight: bold; font-size: 0.8rem; cursor: pointer; background: var(--ach-claimable); color: white; }
.ach-claimed-icon { color: var(--ach-claimed); font-weight: bold; font-size: 1.2rem; margin-right: 5px; }

.save-slot { flex-direction: column; gap: 5px; align-items: stretch; }
.slot-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(0,0,0,0.1); padding-bottom: 5px; margin-bottom: 5px; }
.slot-actions { display: flex; gap: 5px; justify-content: flex-end; }
.slot-btn { padding: 6px 12px; border-radius: 8px; border: none; cursor: pointer; font-size: 0.8rem; font-weight: bold; color: white; }
.slot-btn-play { background: #2ecc71; flex-grow: 1; } .slot-btn-edit { background: #f39c12; } .slot-btn-del { background: #e74c3c; }
.slot-info { font-size: 0.75rem; color: var(--yazi-renk); opacity: 0.7; }
.slot-empty { background: none; border: 2px dashed #bdc3c7; opacity: 0.6; justify-content: center; align-items: center; height: 60px; color: var(--yazi-renk); display: flex; }

.market-header { 
    display: flex; 
    justify-content: center; /* ESKİSİ: space-between | YENİSİ: center */
    align-items: center; 
    background: rgba(0,0,0,0.05); 
    padding: 10px 15px; 
    border-radius: 15px; 
    margin-bottom: 10px; 
}
.coin-display { font-weight: bold; color: #f39c12; font-size: 1.1rem; display: flex; align-items: center; gap: 5px; cursor: pointer; }
.market-section-title { text-align: left; font-size: 0.9rem; color: var(--yazi-renk); opacity: 0.7; margin: 10px 0 5px 5px; font-weight: 700; text-transform: uppercase; }

.setting-row {
    /* 1. Sabit Buton Görünümü */
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    
    /* 2. Boyutlar */
    flex: 1 !important; /* Hepsi eşit yükseklikte olsun */
    max-height: 60px !important; /* Çok uzamasınlar */
    min-height: 50px !important;
    
    margin: 0 !important; /* Dış boşluğu wrapper'daki gap hallediyor */
    padding: 0 15px !important;
    
    /* 3. Görsel Stil */
    background: var(--kart-bg) !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05) !important;
    border-left: 5px solid var(--mavi-yazi) !important; /* Sol çizgi */
    
    /* 4. Yazı */
    font-weight: 700 !important;
    font-size: 1rem !important;
}
.switch { position: relative; display: inline-block; width: 46px; height: 26px; } .switch input { opacity: 0; width: 0; height: 0; } .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #d1d8e0; transition: .4s; border-radius: 34px; } .slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.2); } input:checked + .slider { background-color: #2ecc71; } input:checked + .slider:before { transform: translateX(20px); }

/* --- OYUN EKRANI --- */
#game-screen { 
    width: 100%; 
    height: 100dvh; /* Ekranın tamamı */
    display: none; 
    flex-direction: column; 
    
    /* --- DÜZELTME BURADA --- */
    justify-content: center; /* Her şeyi dikeyde ortala */
    align-items: center;     /* Yatayda ortala */
    gap: 3vh; /* Elemanlar arasına ekran boyunun %3'ü kadar boşluk koy (Dinamik) */
    /* ----------------------- */
    
    padding: 10px; /* Kenarlardan güvenli boşluk */
    box-sizing: border-box; 
    max-width: 500px; 
    margin: 0 auto; 
}
.game-header { width: 90%; max-width: 380px; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0; }
.btn-game-back { background: white; border: none; width: 42px; height: 42px; border-radius: 12px; cursor: pointer; box-shadow: 0 4px 0 rgba(0,0,0,0.05); color: #2c3e50; display: flex; justify-content: center; align-items: center; }
.menu-icon { width: 22px; height: 22px; fill: #2c3e50; }
.info-bar { flex-grow: 1; background: rgba(255, 255, 255, 0.6); backdrop-filter: blur(10px); border-radius: 12px; padding: 0 15px; display: flex; justify-content: space-between; align-items: center; height: 42px; box-shadow: 0 4px 0 rgba(0,0,0,0.05); border: 1px solid rgba(255,255,255,0.8); }
.info-item { display: flex; align-items: center; gap: 4px; font-size: 0.85rem; font-weight: 700; color: #2c3e50; }
.divider { width: 1px; height: 18px; background: rgba(0,0,0,0.1); }

/* ========================================= */
/* --- OYUN TAHTASI VE ÇİZGİLER (DÜZELTİLDİ) --- */
/* ========================================= */

#sudoku-board {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(9, 1fr);

    width: 96%;
    max-width: 450px;

    /* ESKİ DOSYADAKİ ÇİZGİ MANTIĞI GERİ GELDİ */
    background-color: var(--cizgi-renk); /* İnce çizgiler bu renkten oluşur */
    gap: 1px; /* Hücreler arasındaki 1px boşluk ince çizgiyi oluşturur */
    border: 2px solid var(--kalin-cizgi); /* En dış çerçeve */

    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin: 0;
}

.cell {
    background-color: var(--hucre-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 600; /* Sayılar biraz daha net olsun */
    color: var(--yazi-renk);
    cursor: pointer;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    position: relative;
    
    /* Eski border ayarlarını sıfırla ki çakışma olmasın */
    border: none; 
}

/* --- 3x3 KALIN ÇİZGİLER (ESKİ DOSYADAN) --- */
/* Bu sınıfları JavaScript ekliyor, CSS ile kalınlaştırıyoruz */
/* --- 3x3 KALIN ÇİZGİLER (GÜÇLENDİRİLMİŞ) --- */

.cell.border-right {
    /* Kalın çizgi her zaman en üstte kalsın */
    border-right: 2px solid var(--kalin-cizgi) !important;
    z-index: 5; 
}

.cell.border-bottom {
    /* Kalın çizgi her zaman en üstte kalsın */
    border-bottom: 2px solid var(--kalin-cizgi) !important;
    z-index: 5;
}
.note-grid { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); pointer-events: none; z-index: 2; } 
.note-num { font-size: 0.5rem; color: var(--not-renk); font-weight: 700; display: flex; justify-content: center; align-items: center; line-height: 1; width: 100%; height: 100%; }
/* --- REHBER ÇİZGİLER (SATIR/SÜTUN/KUTU) --- */
.cell.guide-highlight {
    /* Resimdeki gibi sadece açık mavi zemin */
    background-color: var(--rehber-renk) !important;
    
    /* Tüm süslemeleri kaldır */
    box-shadow: none !important;
    transform: none !important;
    border: none !important; 
    /* (Not: Hücrenin kendi border'ı grid yapısından gelir, ona dokunmuyoruz) */
}
.fixed { font-weight: bold; color: var(--yazi-renk); }

.controls { 
    width: 96%; /* Tahtayla aynı genişlikte olsun */
    max-width: 450px; 
    display: flex; 
    flex-direction: column; 
    gap: 8px; /* Boşluğu biraz kıstık */
    margin-bottom: 10px; /* En alttan biraz yukarıda dursun */
}
.tools-row { display: flex; justify-content: space-between; background: rgba(255,255,255,0.4); border-radius: 15px; padding: 8px 5px; gap: 2px; }
.tool-btn { background: none; border: none; display: flex; flex-direction: column; align-items: center; color: #576574; font-size: 0.7rem; font-weight: 700; cursor: pointer; gap: 2px; transition: all 0.2s; position: relative; flex: 1; white-space: nowrap; padding: 2px; }
.tool-icon { font-size: 1.1rem; }
.tool-btn:disabled { opacity: 0.4; filter: grayscale(1); cursor: not-allowed; }
.tool-btn.active { color: var(--mavi-yazi); } .tool-btn.active .tool-icon { background: var(--mavi-yazi); color: white; border-radius: 50%; padding: 2px; }
.hint-badge { font-size: 0.6rem; color: var(--mavi-yazi); font-weight: 800; background: #ecf0f1; padding: 1px 4px; border-radius: 6px; margin-top: 1px; }
.save-btn-color { color: #16a085; } .reset-btn-color { color: #e67e22; }

.numpad { display: flex; justify-content: space-between; } 

.numpad .num-btn:disabled { 
    background-color: #dfe6e9 !important; 
    color: #b2bec3 !important; 
    box-shadow: none !important; 
    transform: none !important; 
    cursor: default !important;
    opacity: 0.5 !important;
}

.num-btn { width: 10%; aspect-ratio: 1 / 1.3; border: none; background: white; color: var(--mavi-yazi); font-size: 1.5rem; font-weight: 600; border-radius: 12px; box-shadow: 0 4px 0 rgba(0,0,0,0.08); cursor: pointer; transition: transform 0.1s; } .num-btn:active { transform: translateY(4px); box-shadow: none; background: #ecf0f1; }

#custom-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); backdrop-filter: blur(5px); z-index: 999; display: none; justify-content: center; align-items: center; }
.modal-box { background: rgba(255, 255, 255, 0.95); border-radius: 25px; padding: 25px; width: 80%; max-width: 320px; text-align: center; box-shadow: 0 15px 40px rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,1); animation: popIn 0.3s; }
@keyframes popIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-title { font-size: 1.4rem; font-weight: 800; margin-bottom: 10px; color: #2c3e50; } .modal-msg { font-size: 1rem; color: #555; margin-bottom: 25px; line-height: 1.5; } .modal-buttons { display: flex; gap: 10px; justify-content: center; } .modal-btn { padding: 12px 20px; border: none; border-radius: 12px; font-weight: bold; font-size: 1rem; cursor: pointer; flex: 1; } .btn-ok { background: #2ecc71; color: white; } .btn-cancel { background: #95a5a6; color: white; } .btn-danger { background: #e74c3c; color: white; }
.btn-revive { background: linear-gradient(135deg, #f1c40f 0%, #f39c12 100%); color: white; box-shadow: 0 4px 0 #d35400; }

/* ROZET VE NOT SİSTEMİ */
.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; padding: 5px; box-sizing: border-box; }
.badge-item { background: var(--liste-eleman-bg); border-radius: 12px; padding: 10px 5px; display: flex; flex-direction: column; align-items: center; text-align: center; border: 1px solid rgba(0,0,0,0.05); transition: transform 0.2s; position: relative; }
.badge-icon { font-size: 2.2rem; margin-bottom: 5px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)); }
.badge-name { font-size: 0.7rem; font-weight: 700; color: var(--yazi-renk); line-height: 1.2; }
.badge-locked { opacity: 0.5; filter: grayscale(100%); background: rgba(0,0,0,0.02); }
.badge-locked .badge-icon { filter: none; }
.note-highlight { background-color: var(--mavi-yazi); color: #fff !important; font-weight: 900; border-radius: 2px; }
/* ROZET VE NOT SİSTEMİ */
.badge-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 10px; 
    width: 100%; 
    padding: 5px; 
    box-sizing: border-box;
}

.badge-item { 
    background: var(--liste-eleman-bg); 
    border-radius: 12px; 
    padding: 10px 5px; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    text-align: center; 
    border: 1px solid rgba(0,0,0,0.05); 
    transition: transform 0.2s; 
    position: relative; 
    cursor: pointer; /* Tıklanabilir olduğunu gösterir */
}

.badge-item:active { transform: scale(0.95); } /* Tıklama efekti */

.badge-icon { font-size: 2.2rem; margin-bottom: 5px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)); }
.badge-name { font-size: 0.7rem; font-weight: 700; color: var(--yazi-renk); line-height: 1.2; }
.badge-locked { opacity: 0.5; filter: grayscale(100%); background: rgba(0,0,0,0.02); }
.badge-locked .badge-icon { filter: none; }
.note-highlight { background-color: var(--mavi-yazi); color: #fff !important; font-weight: 900; border-radius: 2px; }
/* --- GÜNLÜK ÖDÜL SİSTEMİ --- */
.daily-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* İlk 4 gün */
    gap: 8px;
    margin-top: 15px;
    width: 100%;
}

/* 5, 6 ve 7. günler alt satıra */
.daily-grid .day-item:nth-child(n+5) {
    grid-column: span 1; 
}
/* 7. Gün (Büyük Ödül) Geniş olsun */
.daily-grid .day-item:last-child {
    grid-column: span 2; /* 2 birim yer kaplasın */
    background: linear-gradient(135deg, #f1c40f 0%, #f39c12 100%);
    border: 2px solid #fff;
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.5);
    color: white !important;
}

.day-item {
    background: rgba(0,0,0,0.05);
    border-radius: 10px;
    padding: 8px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--yazi-renk);
    border: 1px solid rgba(0,0,0,0.1);
    opacity: 0.6;
    position: relative;
}

.day-title { font-weight: bold; font-size: 0.7rem; margin-bottom: 2px; }
.day-icon { font-size: 1.5rem; margin-bottom: 2px; }
.day-reward { font-weight: 800; font-size: 0.75rem; color: #27ae60; }

/* Bugünün Ödülü (Aktif) */
.day-active {
    opacity: 1;
    transform: scale(1.05);
    background: white;
    border: 2px solid var(--mavi-yazi);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    z-index: 2;
}
.day-active .day-reward { color: var(--mavi-yazi); }

/* Alınmış Ödül */
.day-claimed {
    opacity: 1;
    background: #2ecc71;
    color: white !important;
    border: none;
}
.day-claimed .day-reward { color: white; }
.day-claimed::after {
    content: '✔️';
    position: absolute;
    font-size: 1.5rem;
    opacity: 0.8;
}

/* 7. Gün Özel Stili */
.daily-grid .day-item:last-child .day-reward { color: white; }
/* --- İSTATİSTİK GRAFİKLERİ --- */
.stats-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

/* Pasta Grafik Alanı */
.chart-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--liste-eleman-bg);
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.pie-chart {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(
        var(--diff-kolay) 0% 25%, 
        var(--diff-orta) 25% 50%, 
        var(--diff-zor) 50% 75%, 
        var(--diff-uzman) 75% 100%
    );
    margin-bottom: 10px;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.2);
}

/* Ortadaki boşluk (Donut Chart efekti için) */
.pie-chart::after {
    content: "";
    position: absolute;
    width: 70%;
    height: 70%;
    background: var(--kart-bg);
    border-radius: 50%;
    top: 15%;
    left: 15%;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.legend-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 5px;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--yazi-renk);
}

.legend-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}

/* Bar Grafikleri */
.bar-chart-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-bar-row {
    background: var(--liste-eleman-bg);
    padding: 10px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.bar-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--yazi-renk);
}

.progress-bg {
    width: 100%;
    height: 10px;
    background: rgba(0,0,0,0.1);
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 5px;
    width: 0%; /* JS ile doldurulacak */
    transition: width 1s ease-out;
}

.stat-mini-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 2px;
}
/* --- REHBER (TUTORIAL) PENCERESİ --- */
#tutorial-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8); backdrop-filter: blur(8px);
    z-index: 1000;
    display: none; justify-content: center; align-items: center;
    animation: fadeIn 0.3s;
}

.tutorial-box {
    background: white;
    width: 85%; max-width: 350px;
    border-radius: 25px;
    padding: 30px 25px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    border: 3px solid #f1c40f;
    position: relative;
    animation: slideUp 0.4s;
}

.tutorial-header {
    font-size: 1.5rem;
    font-weight: 800;
    color: #2c3e50;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.tutorial-step {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 15px;
    border: 1px solid #eee;
    text-align: left;
}

.step-icon {
    font-size: 1.8rem;
    margin-right: 15px;
    width: 40px;
    text-align: center;
}

.step-text {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.4;
    font-weight: 500;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
/* --- AÇILIŞ EKRANI (SPLASH SCREEN) --- */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-gradient); /* Tema ile uyumlu */
    z-index: 9999; /* En üstte */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out;
}

.splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    animation: fadeIn 0.5s ease-out;
}

.splash-logo {
    width: 100px;
    height: 100px;
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    animation: pulse 2s infinite;
}

.splash-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--yazi-renk);
    letter-spacing: 2px;
}

.splash-subtitle {
    font-size: 1rem;
    font-weight: 300;
    color: var(--yazi-renk);
    letter-spacing: 8px;
    opacity: 0.8;
    margin-top: -5px;
}

.loading-bar {
    width: 150px;
    height: 4px;
    background: rgba(0,0,0,0.1);
    border-radius: 2px;
    margin-top: 20px;
    overflow: hidden;
}

.loading-fill {
    height: 100%;
    width: 0%;
    background: var(--btn-market);
    border-radius: 2px;
    animation: loading 1.5s ease-in-out forwards;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes loading {
    0% { width: 0%; }
    100% { width: 100%; }
}

.fade-out {
    opacity: 0;
    pointer-events: none;
}
/* ========================================= */
/* --- İPUCU SİHİRBAZI (PREMIUM TASARIM) --- */
/* ========================================= */

/* Arka planı karartma (Daha yumuşak geçiş) */
/* Arka planı karartma (Bulanıklık Kaldırıldı) */
.hint-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    
    /* 1. Bulanıklığı (blur) kaldırdık, tahta net görünsün */
    /* backdrop-filter: blur(2px);  <-- BU SATIRI SİLDİK/KALDIRDIK */
    
    /* 2. Siyahlığı azalttık (0.2'den 0.05'e çektik) böylece renkler solmaz */
    background: rgba(0,0,0,0.05); 
    
    z-index: 2000;
    opacity: 0; pointer-events: none; transition: all 0.4s ease;
}

.hint-overlay.active { opacity: 1; pointer-events: all; }
.hint-sheet {
    position: fixed; 
    bottom: -120%; /* Başlangıçta ekran dışında */
    
    /* --- ORTALAMA SİHİRBAZLIĞI (DÜZELTME BURADA) --- */
    left: 50%; /* Sol kenarı ekranın tam ortasına getir */
    transform: translateX(-50%); /* Kendi genişliğinin yarısı kadar geri çek (Tam ortalama) */
    width: 92%; /* Mobilde ekranı doldursun */
    max-width: 380px; /* DİKKAT: Oyun tahtasının genişliğini geçmesin (Masaüstü için sınır) */
    /* ----------------------------------------------- */

    /* OYUN TEMASIYLA ENTEGRASYON */
    background: var(--kart-bg); 
    color: var(--yazi-renk);    
    border: 1px solid rgba(255,255,255,0.3); 
    
    border-radius: 25px; 
    padding: 20px; 
    box-shadow: 0 20px 60px rgba(0,0,0,0.3); 
    z-index: 2001; 
    
    /* Hareket Animasyonu */
    transition: bottom 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-sizing: border-box; 
    display: flex; flex-direction: column; gap: 15px;
    
    /* Buzlu Cam Efekti */
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}

/* Kart aktif olduğunda */
.hint-sheet.active { 
    bottom: 25px; /* Alttan biraz yukarıda süzülsün */
    /* transform özelliğini burada TEKRAR YAZMA, yukarıdaki translateX geçerli kalsın */
}

/* Başlık Alanı */
.hint-header { 
    display: flex; align-items: center; gap: 15px; 
    border-bottom: 1px solid rgba(0,0,0,0.1); 
    padding-bottom: 15px; 
}

/* İpucu İkonu (Ampul) */
.hint-icon { 
    font-size: 1.8rem; 
    background: linear-gradient(135deg, #f1c40f 0%, #f39c12 100%); /* Altın Gradyan */
    color: white;
    width: 45px; height: 45px; 
    display: flex; justify-content: center; align-items: center; 
    border-radius: 12px; /* Karemsi yuvarlak */
    box-shadow: 0 4px 10px rgba(243, 156, 18, 0.4);
}

.hint-title-group { flex-grow: 1; text-align: left; }
.hint-title { 
    font-weight: 800; font-size: 1.2rem; 
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.hint-step-indicator { 
    font-size: 0.75rem; opacity: 0.7; font-weight: 600; 
    background: rgba(0,0,0,0.05); padding: 2px 8px; border-radius: 6px;
    display: inline-block; margin-top: 3px;
}

/* Kapatma Butonu (X) */
.btn-close-hint { 
    background: rgba(0,0,0,0.05); 
    border: none; width: 32px; height: 32px; border-radius: 50%;
    font-size: 1.1rem; color: var(--yazi-renk); cursor: pointer; 
    display: flex; justify-content: center; align-items: center;
    transition: background 0.2s;
}
.btn-close-hint:hover { background: rgba(231, 76, 60, 0.2); color: #e74c3c; }

/* Açıklama Metni */
.hint-text { 
    text-align: left; font-size: 1rem; line-height: 1.5; 
    min-height: 50px; font-weight: 500; opacity: 0.9;
}

/* Aksiyon Alanı */
.hint-actions { display: flex; justify-content: flex-end; }

/* Devam Et Butonu */
/* Devam Et Butonu */
.btn-hint-action {
    background: var(--btn-market); 
    color: white; border: none; padding: 12px 25px; border-radius: 15px;
    font-weight: 800; font-size: 0.9rem; cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15); 
    
    display: flex; 
    align-items: center; 
    gap: 8px;
    
    /* --- EKLENEN KISIM (ORTALAMA) --- */
    justify-content: center; /* Yazıyı ve ikonu butonun ortasına çeker */
    width: 100%; /* Butonu kartın genişliğine yayar */
    /* -------------------------------- */

    transition: transform 0.2s, box-shadow 0.2s;
}
.btn-hint-action:active { transform: scale(0.96); }

/* Son Adım Butonu (Yeşil) */
.btn-hint-action.finish { 
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%); 
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.4);
}

/* --- TAHTA VURGULARI (Görsel İyileştirmeler) --- */

/* 1. Mavi Çerçeve (Blue Box - Scope) */
.hint-scope-border { position: relative; z-index: 10; }
.hint-scope-border::after {
    content: ''; position: absolute; top: -2px; left: -2px; right: -2px; bottom: -2px;
    border: 3px solid #3498db; 
    border-radius: 4px;
    pointer-events: none;
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.5); /* Neon parlama */
    animation: pulseBorder 1.5s infinite;
}

/* 2. Yeşil Vurgu (Helper Cells) */
.hint-helper-cell {
    background-color: #2ecc71 !important; 
    color: white !important; 
    font-weight: 900 !important;
    transform: scale(1.05);
    z-index: 11;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.5);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 3. Hedef Vurgusu (Final) */
.hint-target-cell-final {
    background-color: #f1c40f !important;
    color: #fff !important;
    font-weight: bold;
    transform: scale(1.1);
    z-index: 12;
    border-radius: 8px;
    box-shadow: 0 0 20px #f1c40f;
}

/* Animasyonlar */
@keyframes pulseBorder {
    0% { opacity: 1; } 50% { opacity: 0.6; } 100% { opacity: 1; }
}
/* --- FENER MODU (FOG OF WAR) --- */

/* Sisli Hücre (Görünmez) */
.cell.fog-active {
    background-color: #2c3e50 !important; /* Koyu Lacivert/Siyah Zemin */
    color: transparent !important; /* Sayıları Gizle */
    transition: all 0.2s ease;
}

/* Sisli hücredeki notlar da gizlenmeli */
.cell.fog-active .note-grid {
    opacity: 0;
}

/* Fener tutulan (Aydınlık) bölge için hafif bir parlama efekti */
.cell:not(.fog-active) {
    transition: background-color 0.3s ease;
}
/* --- FENER MODU: ÇİZGİ DÜZELTMESİ --- */

/* Fener modu açıkken sağdaki kalın çizgiyi açık gri yap */
.cell.fog-active.border-right {
    border-right: 2px solid #95a5a6 !important; /* Açık Gri */
}

/* Fener modu açıkken alttaki kalın çizgiyi açık gri yap */
.cell.fog-active.border-bottom {
    border-bottom: 2px solid #95a5a6 !important; /* Açık Gri */
}
/* --- BİLDİRİM IŞIĞI (NOTIFICATION DOT) --- */
.notification-dot {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c; /* Parlak Kırmızı */
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 900;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.8);
    border: 2px solid white; /* Karttan ayrışması için beyaz çerçeve */
    animation: pulseDot 1.2s infinite ease-in-out;
    z-index: 10;
}

@keyframes pulseDot {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(231, 76, 60, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}
/* ============================================== */
/* --- GERİ DÖN BUTONU SABİTLEME (GÜVENLİ) --- */
/* ============================================== */

/* 1. Sadece uzun menülerin hizalamasını değiştir */
/* Ana menüye dokunmuyoruz, o ortada kalsın. */
#achievements-menu, #market-menu, #stats-menu, #saves-menu {
    justify-content: flex-start !important; /* İçerik yukarıdan başlasın */
    padding-top: 40px; /* Çok tepeye yapışmasın */
}

/* 2. Footer (Başarımlar menüsü için) */
.menu-card-footer {
    position: sticky; /* Sabit değil, yapışkan */
    bottom: -30px; /* Kartın en altına yapış */
    
    background: var(--kart-bg); /* Arka planı kart rengiyle aynı olsun */
    backdrop-filter: blur(10px); /* Hafif bulanıklık */
    
    margin-top: auto; /* İçerik kısaysa bile en alta it */
    z-index: 100; /* Her şeyin üstünde dursun */
    
    /* Görsel Düzeltmeler */
    width: calc(100% + 50px); /* Kartın padding'ini taşır */
    margin-left: -25px; 
    padding: 15px 25px 25px 25px;
    border-top: 1px solid rgba(255,255,255,0.2); /* Ayrım çizgisi */
    box-shadow: 0 -5px 15px rgba(0,0,0,0.05); /* Yukarı gölge */
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
}

/* 3. Market ve Kayıtlar menüsündeki butonlar için özel ayar */
/* (Çünkü onların HTML yapısında .menu-card-footer sınıfı yok) */
#market-menu .btn-back, 
#saves-menu .btn-back {
    position: sticky;
    bottom: -10px;
    z-index: 100;
    margin-top: 20px;
    box-shadow: 0 -10px 20px rgba(0,0,0,0.1);
}
/* ========================================= */
/* --- YATAY KAYDIRMAYI ENGELLEME (FİX) --- */
/* ========================================= */

/* 1. Tüm kartların yatay taşmasını engelle */
.menu-card {
    overflow-x: hidden !important; /* Sağa sola kaymayı kapat */
    width: 90% !important; /* Mobilde kenarlarda hafif boşluk kalsın */
    max-width: 400px !important; /* Tabletlerde çok genişlemesin */
    box-sizing: border-box !important; /* Padding'i genişliğe dahil et */
}

/* 2. Footer'ın genişliğini güvenli hale getir */
.menu-card-footer {
    width: 100% !important; /* Taşma yapmaması için %100'e çek */
    margin-left: 0 !important; /* Negatif margin'i sıfırla */
    padding: 15px 0 !important; /* Kenar boşluklarını düzenle */
    left: 0 !important;
    border-radius: 0 !important; /* Köşeleri düzleştir (daha temiz görünür) */
    
    /* Butonu ortalamak için */
    display: flex;
    justify-content: center;
}

/* 3. Footer içindeki butonun genişliğini ayarla */
.menu-card-footer .btn-back {
    width: 90% !important; /* Kartın içinde biraz boşluklu dursun */
    margin: 0 auto !important; /* Ortala */
}

/* 4. Uzun menülerdeki listelerin genişliğini sınırla */
#achievements-list, #powerups-list, #themes-list, #stats-list {
    width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
}
/* ========================================= */
/* --- AYARLAR MENÜSÜ DÜZELTMESİ (FINAL) --- */
/* ========================================= */

#settings-menu {
    /* 1. ÖNEMLİ: İçeriği ortalama, en tepeden başlat! (Sorunun çözümü) */
    justify-content: flex-start !important; 
    
    /* 2. Yükseklik ayarı: İçerik kadar uza ama ekranı taşma */
    height: auto !important; 
    max-height: 80dvh !important; /* Ekranın %80'ini geçmesin */
    
    /* 3. Kaydırma çubuğunu aç (İçerik sığmazsa aşağı kaysın) */
    overflow-y: auto !important;
    
    /* 4. Kartın kendisini sayfanın tam ortasında tut */
    margin: auto !important; 
    
    /* 5. İç boşluklar */
    padding: 30px 25px !important;
}

/* Ayarlar menüsünün içindeki başlık (h2) yukarı yapışmasın */
#settings-menu h2 {
    margin-top: 0 !important;
    margin-bottom: 20px !important;
    flex-shrink: 0; /* Başlık asla ezilmesin */
}

/* Satır araları */
#settings-menu .setting-row {
    margin-bottom: 12px;
    flex-shrink: 0; /* Satırlar ezilmesin */
}

/* Sıfırlama butonu */
#settings-menu .btn-reset {
    margin-top: 20px;
    margin-bottom: 10px;
    flex-shrink: 0;
}
/* --- PROFİL VE MODLAR MENÜSÜ --- */

/* Profil Kartı (Üst Kısım) */
.profile-header-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
    box-shadow: 0 10px 20px rgba(118, 75, 162, 0.3);
    text-align: left;
}

.profile-avatar {
    font-size: 3rem;
    background: rgba(255,255,255,0.2);
    width: 70px; height: 70px;
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    border: 2px solid rgba(255,255,255,0.5);
}

.profile-info { flex-grow: 1; }

.profile-rank {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.profile-stats {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* Mod Kartları */
.mode-card {
    background: var(--liste-eleman-bg);
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid rgba(0,0,0,0.05);
}

.mode-icon { font-size: 1.8rem; }

.mode-details {
    flex-grow: 1;
    text-align: left;
}

.mode-title {
    font-weight: bold;
    font-size: 1rem;
    color: var(--yazi-renk);
}

.mode-desc {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 2px;
}
/* --- PROFİL KARTI GÜNCELLEMESİ --- */

/* --- PROFİL KARTI (KESİN ÇÖZÜM) --- */

.profile-header-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 15px;
    
    display: flex;
    justify-content: space-between; /* İki uca yasla */
    align-items: center;
    gap: 10px; /* Elemanlar arası boşluk */
    
    color: white;
    box-shadow: 0 10px 20px rgba(118, 75, 162, 0.3);
    overflow: hidden; 
}

/* Sol taraf (Avatar + İsim) */
.profile-left {
    display: flex;
    align-items: center;
    gap: 10px;
    
    /* BU KISIM KRİTİK: */
    flex: 1; /* Mevcut tüm boşluğu kapla */
    min-width: 0; /* İçindeki metin taşarsa kutuyu zorlama, metni kes */
}

.profile-avatar {
    /* Avatar boyutu sabit kalsın, ezilmesin */
    width: 60px; 
    height: 60px;
    font-size: 2.5rem;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    border: 2px solid rgba(255,255,255,0.5);
    flex-shrink: 0; /* Avatar asla küçülmesin */
}

.profile-names {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0; /* Flexbox hatasını önler */
}

.username-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
}

.profile-username {
    font-size: 1.1rem;
    font-weight: 800;
    color: white;
    
    /* --- İSMİ KESME AYARLARI --- */
    white-space: nowrap; /* Alt satıra inme */
    overflow: hidden; /* Taşanı gizle */
    text-overflow: ellipsis; /* Sığmazsa ... koy */
    
    display: block;
    max-width: 110px; /* İsim bu genişliği geçerse ... olur */
    /* --------------------------- */
}

/* Sağ taraf (Rozet Kutusu) */
.profile-badge-slot {
    background: rgba(0, 0, 0, 0.2);
    border: 2px dashed rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    
    width: 55px; /* Biraz daha daralttık */
    height: 65px;
    
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    
    flex-shrink: 0; /* ASLA KÜÇÜLME */
    margin-left: auto;
}

.profile-badge-slot:active { transform: scale(0.95); background: rgba(0,0,0,0.4); }

.slot-icon { font-size: 1.8rem; margin-bottom: 2px; }
/* ========================================= */
/* --- ROZET İSMİ DÜZELTMESİ (ORTALAMA) --- */
/* ========================================= */

.slot-label {
    /* 1. Metin Hizalama (Sorunun Çözümü) */
    text-align: center !important; 
    width: 100%; /* Kutunun tamamını kapla ki ortalayabilsin */
    display: flex;
    justify-content: center;
    align-items: center;

    /* 2. Yazı Boyutu ve Okunabilirlik */
    font-size: 0.55rem !important; /* Uzun isimler sığsın diye çok az küçülttük */
    font-weight: 800 !important;   /* Daha kalın ve net olsun */
    opacity: 1 !important;         /* Solukluğu kaldırdık, net görünsün */
    color: white;

    /* 3. Satır Ayarları (Alt alta gelen isimler kopmasın) */
    line-height: 1.1 !important; 
    margin-top: 2px;
    
    /* 4. Uzun kelimeleri yönet */
    white-space: normal; /* Alt satıra inmeye izin ver */
    word-break: break-word; /* Gerekirse kelimeyi böl */
}

/* Rozet Seçim Ekranındaki Grid */
.badge-select-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding: 5px;
}

.select-badge-item {
    background: #ecf0f1;
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    border: 2px solid transparent;
}
.select-badge-item.selected {
    border-color: #2ecc71;
    background: #d5f5e3;
}
/* --- KULLANICI ADI STİLLERİ --- */

.username-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.profile-username {
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: capitalize; /* Baş harfi büyük yap */
    color: white;
    letter-spacing: 0.5px;
    max-width: 150px; /* Çok uzun isimler taşmasın */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Sığmazsa ... koy */
}

.btn-edit-name {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}

.btn-edit-name:active { transform: scale(0.9); background: rgba(255,255,255,0.4); }

/* İsim kilitlendiğinde butonu gizlemek için class */
.btn-edit-name.locked {
    display: none !important;
}
/* --- PROFİL BUTONU DÜZELTMESİ (HASSAS AYAR) --- */

/* Yazıları taşıyan kutu */
.btn-text-stack {
    display: flex;
    flex-direction: column; /* Alt alta diz */
    align-items: flex-start; /* Yazıları sola yasla */
    justify-content: center;
    line-height: 1; /* Satırları birbirine yaklaştır */
    text-align: left;
    margin-left: 0; /* İkonun margin'i zaten var */
}

/* Ana Başlık (Diğer butonlarla aynı boyutta görünsün) */
.main-text {
    font-size: 1rem !important; /* Standart buton yazı boyutu */
    font-weight: 800;
    line-height: 1.1;
}

/* Alt Açıklama (Çok küçük ve ince) */
.sub-text {
    font-size: 0.6rem !important; /* ÇOK KÜÇÜK YAPTIK */
    font-weight: 500;
    opacity: 0.8;
    margin-top: 2px; /* Başlıkla arasına minik mesafe */
    letter-spacing: 0.5px;
    text-transform: uppercase; /* Daha düzenli dursun diye hepsi büyük harf */
}

/* İkon Ayarı (Hizayı bozmaması için) */
.btn-icon {
    font-size: 1.4rem !important; /* İkonu biraz küçült ki buton şişmesin */
    margin-right: 12px !important; /* Yazıyla arasına mesafe */
    display: flex;
    align-items: center;
}
/* ========================================= */
/* --- SAYI TAMAMLAMA EFEKTLERİ (YENİ) --- */
/* ========================================= */

/* 1. Kutucuk Animasyonu (Parlama ve Büyüme) */
@keyframes numberSuccessPop {
    0% { transform: scale(1); background-color: var(--hucre-bg); }
    50% { transform: scale(1.15); background-color: #d5f5e3; color: #27ae60; box-shadow: 0 0 15px rgba(46, 204, 113, 0.6); z-index: 10; border-radius: 8px;}
    100% { transform: scale(1); background-color: var(--hucre-bg); }
}

.cell.completed-animation {
    animation: numberSuccessPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 2. Numpad Tuşunun Yeşil Olması */
/* Disabled (devre dışı) olsa bile yeşil ve parlak görünsün */
.numpad .num-btn.completed-btn {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%) !important;
    color: white !important;
    border: none !important;
    opacity: 1 !important; /* Disabled opaklığını ezmek için */
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.4) !important;
    transform: scale(0.95);
}
/* ========================================= */
/* --- APPLE İÇİN GÖRSEL TİTREŞİM (SHAKE) --- */
/* ========================================= */

@keyframes shakeBoard {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

.shake-effect {
    animation: shakeBoard 0.5s; /* 0.5 saniye sallasın */
    border: 2px solid #e74c3c !important; /* Çerçeve geçici olarak kırmızı olsun */
}
/* ========================================= */
/* --- DAHA BELİRGİN SWITCH BUTONLARI --- */
/* ========================================= */

/* 1. Kapsayıcı Ayarı */
.switch {
    position: relative;
    display: inline-block;
    width: 54px;  /* Biraz genişlettik */
    height: 30px; /* Biraz yükselttik */
    margin-left: 10px;
}

/* 2. Arka Plan (Kapalı Durum) */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    
    /* Daha belirgin gri ve çerçeve */
    background-color: #95a5a6; 
    border: 2px solid #7f8c8d; 
    
    transition: .4s;
    border-radius: 34px;
    
    /* İçeri göçük hissi için gölge */
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.2); 
}

/* 3. Yuvarlak Düğme (Top) */
.slider:before {
    position: absolute;
    content: "";
    height: 22px; /* Boyutu ayarladık */
    width: 22px;
    left: 2px; /* Hizalama */
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    
    /* Topun havada durması için gölge */
    box-shadow: 0 2px 5px rgba(0,0,0,0.3); 
}

/* 4. Açık Durum (Aktif) */
input:checked + .slider {
    background-color: #2ecc71; /* Canlı Yeşil */
    border-color: #27ae60; /* Çerçevesi de yeşil olsun */
    
    /* Hafif yeşil parlama efekti */
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.5); 
}

/* 5. Topun Hareketi (Sağa Kayma) */
input:checked + .slider:before {
    transform: translateX(24px); /* Genişliğe göre hesaplandı */
}
/* ========================================= */
/* --- AYAR KUTULARINI BELİRGİNLEŞTİRME --- */
/* ========================================= */

.setting-row {
    /* 1. Hizalama */
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    
    /* 2. İdeal Boyutlar (Düzeltildi) */
    flex: 0 0 auto !important;
    height: 48px !important;   /* 40px çok dardı, 48px ideal dokunma boyutu */
    min-height: 48px !important;
    
    margin: 0 !important;
    padding: 0 15px !important; /* Kenar boşluğunu biraz açtık, ferahlasın */
    
    /* 3. Görsel Stil */
    background: var(--kart-bg) !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
    border-radius: 12px !important; /* Köşeleri yumuşattık */
    box-shadow: 0 2px 5px rgba(0,0,0,0.03) !important;
    border-left: 4px solid var(--mavi-yazi) !important;
    
    /* 4. Yazı */
    font-weight: 700 !important;
    font-size: 1rem !important; /* Yazıyı tekrar standart boyuta çektik */
    letter-spacing: 0.5px;      /* Harfleri biraz açtık, sıkışık durmasın */
}

/* Karanlık Modda Çerçeve Rengi Uyumu */
@media (prefers-color-scheme: dark) {
    .setting-row {
        border-color: rgba(255, 255, 255, 0.2) !important;
    }
}
/* ========================================= */
/* --- AVATAR SEÇİM EKRANI --- */
/* ========================================= */

.avatar-grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 Yan Yana */
    gap: 15px;
    padding: 10px;
}

.avatar-option {
    background: #f1f2f6;
    border: 2px solid transparent;
    border-radius: 50%;
    width: 70px;
    height: 70px;
    font-size: 2.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0 auto; /* Ortala */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.avatar-option:active {
    transform: scale(0.9);
}

/* Seçili olan avatar belli olsun */
.avatar-option.selected-avatar {
    border-color: #2ecc71;
    background: #d5f5e3;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.4);
}

/* Profil resminin üzerine gelince tıklanabilir olduğunu göster */
.profile-avatar {
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
}
.profile-avatar:active {
    transform: scale(0.95);
}
/* Düzenle ikonu ekleyelim */
.profile-avatar::after {
    content: '✏️';
    position: absolute;
    bottom: -5px;
    right: -5px;
    font-size: 1.2rem;
    background: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid #ddd;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
/* ========================================= */
/* --- PROFİL MENÜSÜ: HİZALAMA VE KAYDIRMA DÜZELTMESİ --- */
/* ========================================= */

#profile-modes-menu {
    /* 1. JS tarafından "display: flex" yapıldığında yönü dikey olsun */
    flex-direction: column !important;
    
    /* 2. Dikeyde en tepeden başla (Ortalama iptal) */
    justify-content: flex-start !important;

    /* 🛑 KRİTİK DÜZELTME: Yatayda ortalama YAPMA, tam genişliğe yay (Sola/Sağa kaymayı önler) */
    align-items: stretch !important;
    
    /* 3. Kartın sınırları */
    overflow: hidden !important; 
    padding: 20px 25px !important;
}

/* Üst Kısım: Profil Kartı ve Sekmeler */
.profile-header-card, .market-tabs {
    flex-shrink: 0 !important; /* Asla ezilmesin */
    width: 100% !important;    /* Tam genişlik */
    max-width: 100% !important;
    box-sizing: border-box !important; /* Padding'i genişliğe dahil et */
    margin-left: 0 !important; /* Sağa kaymayı sıfırla */
    margin-right: 0 !important;
}

/* Orta Kısım: Listeler (SADECE BURASI KAYSIN) */
.profile-tab-content {
    flex-grow: 1; /* Kalan boşluğu doldur */
    overflow-y: auto; /* İçerik taşarsa kaydır */
    min-height: 0; 
    
    width: 100% !important;
    margin-top: 10px;
    padding-bottom: 10px;
    
    scrollbar-width: thin; 
    scrollbar-color: var(--mavi-yazi) transparent;
}

/* Alt Kısım: Geri Dön Butonu (Sabit) */
#profile-modes-menu .btn-back {
    flex-shrink: 0 !important; 
    margin-top: 15px !important;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.1); 
    z-index: 10;
    position: relative;
    width: 100% !important; /* Tam genişlik */
}
/* ========================================= */
/* --- BAŞARIMLAR MENÜSÜ: MOBİL SABİTLEME --- */
/* ========================================= */

#achievements-menu {
    /* 1. Dikey Hizalama */
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    
    /* 2. Kartın dış sınırları */
    overflow: hidden !important; 
    
    /* 🛑 DÜZELTME BURADA: Alt kısımdan (bottom) ekstra boşluk bıraktık */
    /* 25px standart boşluk + Telefona göre değişen güvenli alan boşluğu */
    padding: 25px 25px calc(25px + env(safe-area-inset-bottom)) 25px !important;
}

/* Üst Kısım: Başlık ve Sekmeler */
#achievements-menu h2,
#achievements-menu .market-tabs {
    flex-shrink: 0 !important;
    width: 100% !important;
    margin-bottom: 10px;
}

/* Orta Kısım: Liste Alanı (Kayan Kısım) */
#achievements-menu .market-content-section {
    flex-grow: 1 !important; 
    overflow-y: auto !important;
    min-height: 0; 
    
    width: 100% !important;
    padding-bottom: 15px; /* Listenin butona yapışmasını engeller */
    
    scrollbar-width: thin; 
    scrollbar-color: var(--mavi-yazi) transparent;
    
    display: none; 
}

#achievements-menu .market-content-active {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
}

/* Alt Kısım: Footer ve Buton (Başarımlar Menüsü) */
#achievements-menu .menu-card-footer {
    flex-shrink: 0 !important; 
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    
    margin-top: 15px !important; /* Listeden biraz uzaklaşsın */
    
    /* 🔥 DÜZELTME BURADA: Alt kısımdan 30px boşluk bıraktık 🔥 */
    padding-bottom: 30px !important; 
    padding-top: 5px !important;
    
    width: 100% !important;
    
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    
    /* Butonun kesilmemesi için ekstra güvenlik */
    min-height: 60px !important;
    display: flex !important;
    align-items: flex-start !important; 
    justify-content: center !important; /* Butonu ortala */
}

/* Geri Dön Butonu */
#achievements-menu .menu-card-footer .btn-back {
    width: 100% !important;
    margin: 0 !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
/* ========================================= */
/* --- MARKET MENÜSÜ: SABİT ALT BUTON --- */
/* ========================================= */

#market-menu {
    /* 1. Dikey Hizalama ve Sabitleme */
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    
    /* 2. Kartın dış sınırları */
    overflow: hidden !important;
    
    /* 3. Mobil güvenli alan boşluğu */
    padding: 25px 25px calc(25px + env(safe-area-inset-bottom)) 25px !important;
}

/* Üst Kısım: Başlık, Para Kutusu ve Sekmeler (Sabit) */
#market-menu h2,
#market-menu .market-header,
#market-menu .market-tabs {
    flex-shrink: 0 !important; /* Asla ezilmesin */
    width: 100% !important;
}

/* Orta Kısım: Liste Taşıyıcısı (KAYAN KISIM) */
#market-content-wrapper {
    flex-grow: 1 !important; /* Kalan tüm boşluğu kapla */
    overflow-y: auto !important; /* İçerik taşarsa kaydır */
    min-height: 0; /* Flexbox taşma hatasını önle */
    
    width: 100% !important;
    margin-top: 5px;
    padding-bottom: 10px;
    
    /* Scrollbar Güzelleştirme */
    scrollbar-width: thin;
    scrollbar-color: var(--mavi-yazi) transparent;
}

/* Alt Kısım: Geri Dön Butonu (Sabit) */
#market-menu .btn-back {
    flex-shrink: 0 !important; /* Asla ezilmesin */
    margin-top: 10px !important;
    width: 100% !important;
    
    /* Hafif gölge ve öne çıkarma */
    box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
    z-index: 10;
    position: relative;
}
/* ========================================= */
/* --- İSTATİSTİK MENÜSÜ: SABİT ALT BUTON --- */
/* ========================================= */

#stats-menu {
    /* 1. Dikey Hizalama ve Sabitleme */
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    
    /* 2. Kartın dış sınırları */
    overflow: hidden !important;
    
    /* 3. Mobil güvenli alan boşluğu */
    padding: 25px 25px calc(25px + env(safe-area-inset-bottom)) 25px !important;
}

/* Üst Kısım: Başlık (Sabit) */
#stats-menu h2 {
    flex-shrink: 0 !important; /* Asla ezilmesin */
    width: 100% !important;
    margin-bottom: 15px !important;
}

/* Orta Kısım: Grafik ve Liste (KAYAN KISIM) */
#stats-list {
    flex-grow: 1 !important; /* Kalan tüm boşluğu kapla */
    overflow-y: auto !important; /* İçerik taşarsa kaydır */
    min-height: 0; /* Flexbox taşma hatasını önle */
    
    width: 100% !important;
    padding-bottom: 10px;
    
    /* Scrollbar Güzelleştirme */
    scrollbar-width: thin;
    scrollbar-color: var(--mavi-yazi) transparent;
}

/* Alt Kısım 1: Sıfırlama Butonu Alanı (Sabit) */
/* Bunu listenin hemen altına, geri butonunun üstüne sabitledik */
.stat-reset-container {
    flex-shrink: 0 !important;
    width: 100% !important;
    margin-top: 10px !important;
    margin-bottom: 5px !important;
}

/* Alt Kısım 2: Footer (Geri Dön Butonu Çerçevesi) */
#stats-menu .menu-card-footer {
    flex-shrink: 0 !important;
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    
    margin-top: 5px !important;
    
    /* 🔥 DÜZELTME BURADA: Padding'i 0 yerine 30px yaptık 🔥 */
    padding-bottom: 30px !important; /* Butonu yukarı iter */
    padding-top: 10px !important;    /* Reset butonuyla arasına mesafe koyar */
    
    width: 100% !important;
    
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    
    /* Hizalama */
    display: flex !important;
    justify-content: center !important;
}

/* Geri Dön Butonu */
#stats-menu .menu-card-footer .btn-back {
    width: 100% !important;
    margin: 0 !important;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
    z-index: 10;
}
/* ========================================= */
/* --- MARKET MENÜSÜ: HİZALAMA DÜZELTMESİ --- */
/* ========================================= */

/* Başlık, Altın Kutusu ve Sekmelerin Hizası */
#market-menu h2,
#market-menu .market-header,
#market-menu .market-tabs {
    flex-shrink: 0 !important; /* Asla ezilmesin */
    
    /* Genişlik Ayarları */
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important; /* İç boşluğu (padding) genişliğe dahil et */
    
    /* Kaymayı Önleyen Kritik Ayar */
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Altın Kutusunun İçindeki Yazıyı Ortala */
#market-menu .market-header {
    display: flex !important;
    justify-content: center !important; /* İçerik tam ortada dursun */
    align-items: center !important;
}
/* ========================================= */
/* --- KAYITLI OYUNLAR MENÜSÜ: SABİT ALT BUTON --- */
/* ========================================= */

#saves-menu {
    /* 1. Dikey Hizalama ve Sabitleme */
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: stretch !important; /* Sağa sola kaymayı önler */
    
    /* 2. Kartın dış sınırları */
    overflow: hidden !important;
    
    /* 3. Mobil güvenli alan boşluğu */
    padding: 25px 25px calc(25px + env(safe-area-inset-bottom)) 25px !important;
}

/* Üst Kısım: Başlık (Sabit) */
#saves-menu h2 {
    flex-shrink: 0 !important; /* Asla ezilmesin */
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 15px !important;
    margin-left: 0 !important;
}

/* Orta Kısım: Kayıt Listesi (KAYAN KISIM) */
#slots-container {
    flex-grow: 1 !important; /* Kalan tüm boşluğu kapla */
    overflow-y: auto !important; /* İçerik taşarsa kaydır */
    min-height: 0; /* Flexbox taşma hatasını önle */
    
    width: 100% !important;
    padding-bottom: 10px;
    
    /* Scrollbar Güzelleştirme */
    scrollbar-width: thin;
    scrollbar-color: var(--mavi-yazi) transparent;
    
    /* Slotlar arası boşluğu koru */
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Alt Kısım: Geri Dön Butonu (Sabit) */
#saves-menu .btn-back {
    flex-shrink: 0 !important; /* Asla ezilmesin */
    margin-top: 10px !important;
    width: 100% !important;
    
    /* Hafif gölge ve öne çıkarma */
    box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
    z-index: 10;
    position: relative;
}
/* ========================================= */
/* --- SIFIRLAMA BUTONU VE MODAL DÜZELTMESİ --- */
/* ========================================= */

/* 1. Sıfırlama Butonunu Korumaya Al */
.stat-reset-container {
    flex-shrink: 0 !important; /* Asla ezilme */
    min-height: 50px !important; /* Minimum yükseklik garantisi */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-top: 15px !important;
    z-index: 100 !important; /* Diğer elementlerin üstünde dur */
}

/* 2. Onay Penceresini (Modal) En Üste Taşı */
#custom-modal-overlay {
    z-index: 99999 !important; /* Tüm menülerin üstüne çık */
    background: rgba(0, 0, 0, 0.85) !important; /* Arka planı daha koyu yap */
}

/* 3. Modal Kutusunu Öne Çıkar */
.modal-box {
    z-index: 100000 !important;
    position: relative !important;
}

/* --- BAŞARIM BİLDİRİMİ (DÜZELTİLDİ) --- */
.achievement-notification {
    position: fixed;
    top: -100px; 
    left: 50%;
    transform: translateX(-50%);
    
    background: rgba(46, 204, 113, 0.95);
    color: white;
    
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    
    /* 🔥 DÜZELTME 1: Modal'ın (99999) üstünde olması için çok yüksek değer verdik */
    z-index: 1000000 !important; 
    
    /* 🔥 DÜZELTME 2: Tıklanabilir olduğunu göster */
    cursor: pointer; 
    
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    min-width: 280px;
    backdrop-filter: blur(5px);
    border: 2px solid rgba(255,255,255,0.2);
}

.achievement-notification.show {
    top: 30px;
    opacity: 1;
}

/* Diğer css kodları (notif-icon, notif-title vb.) aynı kalabilir */

/* JS ile bu sınıf eklendiğinde aşağı iner */
.achievement-notification.show {
    top: 30px;
    opacity: 1;
}

.notif-icon {
    font-size: 2.2rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    animation: bounce 1s infinite;
}

.notif-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.notif-title {
    font-size: 0.7rem;
    font-weight: 800;
    opacity: 0.9;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.notif-name {
    font-size: 1.1rem;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* İkon zıplama animasyonu */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}
/* --- ALINABİLİR ROZET STİLİ (YENİ) --- */
.badge-claimable {
    background: linear-gradient(135deg, #f1c40f 0%, #f39c12 100%); /* Altın Sarısı */
    border: 2px solid #fff;
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.6);
    cursor: pointer;
    animation: badgePulse 1.5s infinite;
    opacity: 1 !important;
    filter: none !important;
}

.badge-claimable .badge-icon {
    font-size: 2.5rem; /* İkon biraz büyüsün */
}


@keyframes badgePulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(241, 196, 15, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(241, 196, 15, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(241, 196, 15, 0); }
}
/* --- PROFİL İSTATİSTİK DÜZELTMESİ --- */

/* İstatistik kutusunun genel ayarı */
/* --- PROFİL İSTATİSTİK DÜZENİ (3'LÜ GÖRÜNÜM) --- */
.profile-stats-text {
    font-size: 0.8rem; /* 3 tane sığsın diye biraz küçülttük */
    opacity: 0.95;
    margin-top: 4px;
    
    display: flex;
    align-items: center;
    gap: 0; /* Boşluğu biz ayarlayacağız */
    
    /* Taşarsa yana kaydır ama sığdırmaya çalış */
    white-space: nowrap;
    overflow-x: auto; 
    overflow-y: hidden;
    
    /* Kaydırma çubuğunu gizle (Estetik) */
    scrollbar-width: none; 
}
.profile-stats-text::-webkit-scrollbar { display: none; }

/* Her bir istatistik grubu */
.profile-stats-text span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 0 6px; /* Yanlardan boşluk */
    
    /* Aralarına Çizgi Çekme Mantığı */
    border-right: 1px solid rgba(255, 255, 255, 0.3);
}

/* En sondaki elemanın (Rozet) çizgisini kaldır */
.profile-stats-text span:last-child {
    border-right: none;
    padding-right: 0;
}

/* En baştaki elemanın sol boşluğunu kaldır */
.profile-stats-text span:first-child {
    padding-left: 0;
}

/* İkon ve Sayıyı birbirine "Zımbalıyoruz" */
.profile-stats-text span {
    white-space: nowrap !important; /* KRİTİK KOD: İkon ve sayı asla ayrılmaz */
    display: inline-flex;
    align-items: center;
    gap: 2px; /* İkon ile sayı arasındaki minik boşluk */
}

/* ========================================= */
/* --- AYARLAR MENÜSÜ SABİT ÇERÇEVE MODU (DÜZELTİLDİ) --- */
/* ========================================= */

/* ========================================= */
/* --- AYARLAR MENÜSÜ: KESİN ÇÖZÜM (SABİT BOY) --- */
/* ========================================= */

/* ========================================= */
/* --- AYARLAR MENÜSÜ: KOMPAKT & SABİT --- */
/* ========================================= */

/* ========================================= */
/* --- AYARLAR MENÜSÜ: KOMPAKT & SABİT --- */
/* ========================================= */

/* ========================================= */
/* --- AYARLAR MENÜSÜ: DÜZELTİLMİŞ HALİ --- */
/* ========================================= */

#settings-menu {
    /* 🛑 DÜZELTME: 'display: flex !important' satırını SİLDİK. */
    /* Artık açma kapama işini JavaScript yapacak. */
    
    /* 1. Yerleşim Düzeni */
    flex-direction: column !important;
    justify-content: space-between !important; 
    
    /* 2. Boyutlandırma */
    width: 90% !important;
    max-width: 400px !important;
    height: auto !important;
    min-height: 400px !important;
    max-height: 85dvh !important;
    
    /* 3. Diğer Ayarlar */
    overflow: hidden !important; 
    margin: auto !important;
    padding: 20px !important;
    box-sizing: border-box !important;
}

#settings-menu h2 {
    margin: 0 0 15px 0 !important;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding-bottom: 10px;
}

#settings-content-wrapper {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    flex-grow: 1 !important;
    overflow-y: auto !important;
    
    width: 100% !important;
    
    /* 🔥 DÜZELTME: Boşluk 8px. Hem ayrık durur hem çok yer kaplamaz */
    gap: 8px !important; 
    
    padding: 5px 2px !important;
    scrollbar-width: none; 
}

#settings-content-wrapper::-webkit-scrollbar { 
    display: none; 
}

/* Alt Kısım: Geri Dön Butonu */
#settings-menu .btn-back {
    flex-shrink: 0 !important; /* Asla ezilmesin */
    margin-top: 15px !important; 
    width: 100% !important;
    
    /* En altta durması için garanti */
    position: relative;
    z-index: 10;
}

/* Sıfırlama Butonu (Sarı/Kırmızı Olan) */
#settings-menu .btn-reset {
    /* 🔥 DÜZELTME: Asla küçülme/ezilme! */
    flex-shrink: 0 !important; 
    
    margin-top: auto !important; /* Mümkünse en alta it */
    margin-bottom: 5px !important;
    
    height: 50px !important; /* Sabit yükseklik verelim, garanti olsun */
    min-height: 50px !important;
    
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem !important;
}

/* ========================================= */
/* --- ORJİNAL GOOGLE BUTON TASARIMI --- */
/* ========================================= */

/* style.css dosyasında en alttaki bu bloğu bul ve güncelle */

.google-btn-official {
    background: #4285F4 !important;
    color: white !important;
    border: none;
    border-radius: 4px !important;
    padding: 2px !important;
    
    /* 👇 SORUN BURADAYDI: '!important' sildik 👇 */
    display: flex;  
    /* 👆 Eskiden: display: flex !important; yazıyordu */
    
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.25) !important;
    transition: box-shadow .3s ease !important;
    width: 100%;
    margin-bottom: 5px;
    height: 46px;
    cursor: pointer;
}

.google-btn-official:active {
    background: #3367D6 !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3) !important;
}

/* Logonun arkasındaki Beyaz Kutu */
.google-icon-wrapper {
    background: white;
    width: 40px;
    height: 40px;
    border-radius: 2px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: 1px; /* Sol kenardan çok hafif pay */
}

/* Google G Logosu */
.google-icon {
    width: 22px;
    height: 22px;
    display: block;
}

/* "Google ile Giriş Yap" Yazısı */
.google-btn-text {
    flex-grow: 1; /* Kalan boşluğu doldur */
    text-align: center; /* Yazıyı ortala */
    font-family: 'Roboto', sans-serif; /* Google Fontu */
    font-weight: 500;
    font-size: 1rem;
    padding-right: 40px; /* İkonun genişliği kadar sağdan boşluk ver ki tam ortalansın */
}

/* ========================================= */
/* --- GOOGLE LOGO GÖRÜNÜRLÜK GARANTİSİ --- */
/* ========================================= */

/* Resmin Kapsayıcısını Zorla Görünür Yap */
.google-icon-wrapper {
    /* Genişlik ve yükseklik değerlerinin olduğundan emin ol */
    width: 40px !important; 
    height: 40px !important;
    flex-shrink: 0 !important; /* Asla küçülme! */
    overflow: hidden !important; /* Taşma yok */
}

/* Resmin Kendisini Görünür Yap */
.google-icon {
    /* Boyutları zorla ver */
    width: 22px !important; 
    height: 22px !important;
    display: block !important;
    /* Opaklık ve filtreleri sıfırla */
    opacity: 1 !important;
    filter: none !important;
}

/* Google Giriş Alanı */
#settings-content-wrapper > div:first-child {
    flex-shrink: 0 !important;
    margin-bottom: 5px !important;
    border: none !important; /* Alt çizgiyi kaldırdık, daha temiz olsun */
    padding-bottom: 0 !important;
}

/* Sıfırlama Butonu */
#settings-menu .btn-reset {
    flex-shrink: 0 !important;
    margin-top: 5px !important;
    margin-bottom: 0 !important;
    height: 45px !important; /* Sabit yükseklik */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem !important;
}

/* Geri Dön Butonu */
#settings-menu .btn-back {
    margin-top: 15px !important;
    flex-shrink: 0;
    height: 50px !important;
}

/* Google Giriş Alanı Sabitleme */
#settings-content-wrapper > div:first-child {
    flex-shrink: 0 !important; /* Ezilme */
    min-height: 46px !important;
}

/* Anahtarları hafifçe dengele (Çok küçültmeden) */
.setting-row .switch {
    transform: scale(0.9); /* Sadece %10 küçült, belli belirsiz */
    margin-right: -2px;
}
/* --- LİDERLİK TABLOSU --- */
.leaderboard-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.leader-item {
    display: flex;
    align-items: center;
    background: var(--liste-eleman-bg);
    padding: 12px;
    border-radius: 15px;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

/* Sıralama Numarası */
.leader-rank {
    font-size: 1.1rem;
    font-weight: 900;
    width: 35px;
    text-align: center;
    color: var(--yazi-renk);
    opacity: 0.7;
}

/* Avatar ve İsim */
.leader-info {
    flex-grow: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
}
.leader-avatar { font-size: 1.5rem; }
.leader-name { font-weight: bold; font-size: 0.95rem; color: var(--yazi-renk); }
.leader-badge { font-size: 0.8rem; }

/* Kazanma Sayısı */
.leader-score {
    font-weight: 800;
    color: var(--mavi-yazi);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* --- İLK 3 ÖZEL EFEKTLERİ --- */
/* 1. Altın */
.leader-item.rank-1 {
    background: linear-gradient(135deg, #fff 0%, #fff9c4 100%);
    border: 2px solid #f1c40f;
    transform: scale(1.02);
}
.leader-item.rank-1 .leader-rank { color: #f39c12; font-size: 1.5rem; text-shadow: 0 1px 0 rgba(0,0,0,0.1); }

/* 2. Gümüş */
.leader-item.rank-2 {
    border: 2px solid #bdc3c7;
}
.leader-item.rank-2 .leader-rank { color: #7f8c8d; font-size: 1.3rem; }

/* 3. Bronz */
.leader-item.rank-3 {
    border: 2px solid #e67e22;
}
.leader-item.rank-3 .leader-rank { color: #d35400; font-size: 1.2rem; }

/* --- İSTATİSTİK MENÜSÜ DÜZELTMESİ (FİNAL) --- */
#stats-menu {
    flex-direction: column !important;
    justify-content: flex-start !important;
    overflow: hidden !important; /* Kartın dışına taşmayı engelle */
    padding: 20px !important;
    max-height: 85dvh !important; /* Ekranın %85'inden büyük olmasın */
}

/* Başlık ve Sekmelerin küçülmesini engelle */
#stats-menu h2, 
#stats-menu .market-tabs {
    flex-shrink: 0 !important;
}

/* İçerik Alanı (Kaydırılabilir Kısım) */
#stats-personal-content,
#stats-leaderboard-content {
    flex-grow: 1 !important;  /* Kalan tüm boşluğu kapla */
    overflow-y: auto !important; /* İçerik taşarsa kaydır */
    min-height: 0 !important; /* Flexbox taşma hatasını önle */
    width: 100% !important;
    
    /* İçerik ile butonlar arasına mesafe */
    margin-bottom: 10px; 
    padding-bottom: 10px;
}

/* Geri Dön Butonu (En Altta Sabit) */
#stats-menu .menu-card-footer {
    flex-shrink: 0 !important; /* Asla ezilmesin/kaybolmasın */
    margin-top: auto !important;
    width: 100% !important;
    display: flex;
    justify-content: center;
    padding-top: 10px !important;
    border-top: 1px solid rgba(0,0,0,0.05); /* Şık bir çizgi */
}

/* --- İÇERİK GÖRÜNÜRLÜK DÜZELTMESİ --- */

/* 1. Tüm sekme içeriklerini varsayılan olarak gizle */
.market-content-section {
    display: none !important;
}

/* 2. Sadece 'active' sınıfı olanı göster */
.market-content-active {
    /* Flex yaparak görünür hale getiriyoruz */
    display: flex !important; 
    
    /* İçindekileri alt alta diz (Yan yana sıkışmasınlar) */
    flex-direction: column !important;
    
    /* Alanı doldur */
    width: 100% !important;
    height: 100% !important;
    
    /* Kaydırma ayarları */
    overflow-y: auto !important;
    min-height: 0 !important;
}

/* 3. İstatistik Listesinin Kendisi */
#stats-list {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important; /* Grafikler arası boşluk */
    flex-shrink: 0 !important; /* Asla kaybolma */
}
/* --- LİDERLİK TABLOSU (GARANTİLİ GRID TASARIM) --- */

.leaderboard-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    padding: 5px 2px;
    box-sizing: border-box;
    overflow-x: hidden !important; /* Yana taşmayı kesin engelle */
}

/* Her Satır (Kart) */
.leader-item {
    display: grid;
    /* Şablon: [Sıra No] [Avatar+İsim (Esnek)] [Puanlar (Sağ)] */
    grid-template-columns: 40px 1fr auto; 
    align-items: center;
    gap: 10px;
    
    background: var(--liste-eleman-bg);
    padding: 10px;
    border-radius: 12px;
    border-bottom: 2px solid rgba(0,0,0,0.05);
    
    width: 100%;
    max-width: 100%;
    box-sizing: border-box; /* Padding taşma yapmasın */
}

/* 1. SOL: Sıralama Numarası */
.leader-rank {
    font-size: 1.2rem;
    font-weight: 900;
    text-align: center;
    color: var(--yazi-renk);
    opacity: 0.5;
    font-family: monospace; /* Sayılar hizalı dursun */
}

/* 2. ORTA: Avatar ve İsim */
.leader-info {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden; /* İsim taşarsa gizle */
    min-width: 0; /* Flexbox taşma fix */
}

.leader-avatar {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.leader-name-group {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.leader-name {
    font-weight: bold;
    font-size: 0.95rem;
    color: var(--yazi-renk);
    
    /* Uzun isimleri ... yap */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leader-subtext {
    font-size: 0.7rem;
    opacity: 0.7;
}

/* 3. SAĞ: Puan ve Altın */
.leader-stats {
    text-align: right;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 70px; /* Rakamlar için yer ayır */
}

.score-main {
    font-weight: 900;
    color: var(--mavi-yazi); /* Tema rengi */
    font-size: 1rem;
}

.score-sub {
    font-size: 0.75rem;
    color: #f39c12; /* Altın sarısı */
    font-weight: 600;
    margin-top: 2px;
}

/* --- İLK 3 RENKLENDİRMESİ --- */
/* 1. Sıra (Altın Rengi) */
.leader-item.rank-1 .leader-rank { color: #f1c40f; opacity: 1; font-size: 1.5rem; text-shadow: 0 1px 0 rgba(0,0,0,0.1); }
.leader-item.rank-1 { background: linear-gradient(to right, rgba(241, 196, 15, 0.1), transparent); border-left: 4px solid #f1c40f; }

/* 2. Sıra (Gümüş Rengi) */
.leader-item.rank-2 .leader-rank { color: #95a5a6; opacity: 1; font-size: 1.3rem; }
.leader-item.rank-2 { border-left: 4px solid #95a5a6; }

/* 3. Sıra (Bronz Rengi) */
.leader-item.rank-3 .leader-rank { color: #d35400; opacity: 1; font-size: 1.3rem; }
.leader-item.rank-3 { border-left: 4px solid #d35400; }

/* --- LİDERLİK TABLOSU GÜNCEL (İKONLU TASARIM) --- */



/* --- LİDERLİK TABLOSU (KAYMA SORUNU KESİN ÇÖZÜM) --- */

.leaderboard-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    
    /* 🔥 DÜZELTME: Genişliği %100 yapma, bırak kapsayıcıya uysun */
    width: auto !important; 
    
    /* Yanlardan taşmayı önlemek için margin ve padding'i sıfırla */
    margin: 0 !important;
    padding: 0 !important;
    
    box-sizing: border-box !important;
    overflow-x: hidden !important;
}

.leader-item {
    display: grid;
    /* Şablon: [Sıra] [İsim] [Puan] */
    grid-template-columns: 35px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    
    background: var(--liste-eleman-bg);
    padding: 10px 8px; /* Sağdan soldan sadece 8px boşluk */
    
    border-radius: 12px;
    border-bottom: 2px solid rgba(0,0,0,0.05);
    
    /* 🔥 DÜZELTME: Genişlik ayarı */
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important; /* Kenarlıkları genişliğe dahil et */
}

/* --- DİĞER DETAYLAR (AYNI KALABİLİR) --- */
.leader-rank {
    font-size: 1.1rem;
    font-weight: 900;
    text-align: center;
    color: var(--yazi-renk);
    opacity: 0.5;
    font-family: monospace;
}

.leader-info {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    min-width: 0;
}

.leader-avatar { font-size: 1.4rem; flex-shrink: 0; }

.leader-name-group {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    gap: 2px;
    align-items: flex-start;
    text-align: left;
    min-width: 0;
    width: 100%;
}

.leader-name {
    font-weight: bold;
    font-size: 0.9rem;
    color: var(--yazi-renk);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    width: 100%;
}

.leader-sub-icons {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--yazi-renk);
    opacity: 0.8;
}

.leader-stats {
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 50px;
    flex-shrink: 0;
}

.score-main {
    font-weight: 900;
    color: var(--mavi-yazi);
    font-size: 0.95rem;
    white-space: nowrap;
}

/* Renkler */
.leader-item.rank-1 { background: linear-gradient(to right, rgba(241, 196, 15, 0.1), transparent); border-left: 4px solid #f1c40f; }
.leader-item.rank-1 .leader-rank { color: #f1c40f; opacity: 1; font-size: 1.4rem; }

.leader-item.rank-2 { border-left: 4px solid #95a5a6; }
.leader-item.rank-2 .leader-rank { color: #95a5a6; opacity: 1; font-size: 1.2rem; }

.leader-item.rank-3 { border-left: 4px solid #d35400; }
.leader-item.rank-3 .leader-rank { color: #d35400; opacity: 1; font-size: 1.2rem; }

/* --- GÜNCELLENMİŞ MODAL BUTONLARI (3'LÜ IZGARA) --- */

.modal-buttons {
    display: flex;
    justify-content: center;
    align-items: stretch; /* Hepsinin boyunu eşitle */
    gap: 10px; /* Butonlar arası boşluk */
    width: 100%;
    margin-top: 15px;
}

.modal-btn {
    flex: 1; /* Hepsi eşit genişlikte olsun */
    min-width: 0; /* İçerik taşmasını önle */
    height: 75px; /* SABİT YÜKSEKLİK */
    
    border: none;
    border-radius: 15px;
    
    display: flex;
    flex-direction: column; /* İkon üstte, yazı altta */
    justify-content: center;
    align-items: center;
    gap: 5px;
    
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 0 rgba(0,0,0,0.1);
    
    /* Uzun yazıları yönetmek için */
    white-space: normal; 
    line-height: 1.1;
    padding: 5px;
}

.modal-btn:active {
    transform: translateY(4px);
    box-shadow: none;
}

/* Buton İkonları için özel stil */
.btn-icon-large {
    font-size: 1.6rem;
    margin-bottom: 2px;
}

/* Renkler */
.btn-home { background: #e74c3c; color: white; }      /* Ana Menü (Kırmızı) */
.btn-ads { background: linear-gradient(135deg, #f1c40f 0%, #f39c12 100%); color: white; text-shadow: 0 1px 1px rgba(0,0,0,0.2); } /* Reklam (Altın) */
.btn-replay { background: #2ecc71; color: white; }    /* Tekrar (Yeşil) */

/* ========================================= */
/* --- YENİLENMİŞ PREMİUM MODAL BUTONLARI --- */
/* ========================================= */

.modal-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px; /* Butonlar arası boşluk (Havadar olsun) */
    width: 100%;
    margin-top: 25px; /* Mesajdan biraz uzaklaşsın */
    padding: 0 5px;   /* Kenarlardan taşmayı önle */
    box-sizing: border-box;
}

.modal-btn {
    flex: 1; /* Eşit genişlik */
    height: 54px; /* 👇 YÜKSEKLİĞİ KISTIK (Daha kibar) */
    min-width: 0;
    
    border: none;
    border-radius: 14px; /* Hafif yuvarlak köşeler */
    
    display: flex;
    flex-direction: row; /* 👇 İKON VE YAZI YAN YANA GELSİN (Daha şık) */
    justify-content: center;
    align-items: center;
    gap: 8px; /* İkon ile yazı arası */
    
    font-size: 0.85rem; /* Yazı boyutu ideal */
    font-weight: 700;
    letter-spacing: 0.3px;
    color: white;
    
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    /* Modern, yumuşak gölge */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

/* Tıklama Efekti */
.modal-btn:active {
    transform: scale(0.96);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* İkon Boyutu */
.btn-icon-large {
    font-size: 1.2rem; /* İkonu biraz küçülttük */
    display: flex; /* Hizalama için */
}

/* --- RENK PALETİ (Gradient - Premium Hissi) --- */

/* 1. Ana Menü (Sol) - Yumuşak Kırmızı/Pembe */
.btn-home {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5253 100%);
    box-shadow: 0 4px 15px rgba(238, 82, 83, 0.3);
}

/* 2. Reklam (Orta) - Parlak Altın/Turuncu */
.btn-ads {
    background: linear-gradient(135deg, #f1c40f 0%, #f39c12 100%);
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3);
    border: 1px solid rgba(255,255,255,0.2); /* Hafif parlama */
}

/* 3. Tekrar Oyna (Sağ) - Canlı Yeşil/Turkuaz */
.btn-replay {
    background: linear-gradient(135deg, #2ecc71 0%, #1abc9c 100%);
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
}

/* --- LİDERLİK TABLOSUNDAKİ ROZET --- */
.leader-name-badge {
    display: inline-block;
    margin-left: 6px;       /* İsimden biraz uzaklaşsın */
    font-size: 1.1rem;      /* İsimden biraz daha büyük dursun */
    vertical-align: middle; /* Hizalama */
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15)); /* Hafif gölge */
    cursor: help;           /* Üzerine gelince adı yazar (title) */
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* İsmin hizalamasını garantiye alalım */
.leader-name {
    display: flex !important;
    align-items: center !important;
    gap: 2px;
}

/* ========================================= */
/* --- VURGULAR (ÇİZGİLERİ KORUYAN VERSİYON) --- */
/* ========================================= */

/* ========================================= */
/* --- 1. IZGARA VE ÇİZGİ KORUMASI (KESİN ÇÖZÜM) --- */
/* ========================================= */

/* Rehber Çizgiler (Satır/Sütun) */
.cell.guide-highlight {
    background-color: var(--rehber-renk) !important;
    
    /* Çizgileri Yutan Efektleri İPTAL ET */
    transform: none !important;    /* Büyümeyi engelle */
    box-shadow: none !important;   /* Gölgeyi engelle */
    border-radius: 0 !important;
    
    /* Kenarlıklara DOKUNMA (border: none yazma!) */
    /* Z-index'i düşük tut ki çizgilerin altında kalsın */
    z-index: 0 !important; 
}

/* Seçili Hücre ve Aynı Sayılar */
.cell.selected, 
.cell.highlight-same {
    background-color: var(--secili-hucre) !important;
    color: var(--mavi-yazi) !important;
    font-weight: bold !important;

    /* Düz Tasarım */
    transform: none !important; 
    box-shadow: none !important;
    border-radius: 0 !important;
    
    /* Çizgilerin üzerine çıkmaması için z-index ayarı */
    z-index: 1 !important;
}

/* ========================================= */
/* --- 2. KALIN ÇİZGİLERİ (3x3) GARANTİYE AL --- */
/* ========================================= */

/* Bu sınıflar her zaman EN ÜSTTE ve BASKIN olmalı */
.cell.border-right {
    border-right: 2px solid var(--kalin-cizgi) !important;
}

.cell.border-bottom {
    border-bottom: 2px solid var(--kalin-cizgi) !important;
}

/* Köşe çakışmalarını önlemek için */
.cell.border-right.border-bottom {
    border-right: 2px solid var(--kalin-cizgi) !important;
    border-bottom: 2px solid var(--kalin-cizgi) !important;
}

/* ========================================= */
/* --- HATA RENGİ DÜZELTMESİ --- */
/* ========================================= */

/* Hatalı hücre her zaman KIRMIZI yazmalı */
.cell.wrong {
    /* Mavi rengi ezmek için !important şart */
    color: #e74c3c !important; 
    
    /* Seçiliyken mavi arka plan olmasın, hafif kırmızı olsun ki hata olduğu anlaşılsın */
    background-color: #fadbd8 !important; 
    
    /* Hata olduğunu belli eden diğer ayarlar */
    font-weight: bold !important;
    z-index: 10 !important; /* Diğer renklerin üstüne çıksın */
}

/* Eğer hücre hem seçili hem hatalıysa (yazarken), yine Kırmızı kazansın */
.cell.selected.wrong {
    color: #e74c3c !important;
    background-color: #fadbd8 !important;
}

/* ========================================= */
/* --- YENİ İSTATİSTİK KARTLARI (GRID) --- */
/* ========================================= */

.stat-card-modern {
    background: var(--liste-eleman-bg);
    border-radius: 16px;
    padding: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.2s;
}

.stat-card-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-left: 10px; /* Sol çizgi ile yazı arası */
    /* border-left JS tarafından inline veriliyor */
}

.stat-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--yazi-renk);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-rate {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--mavi-yazi);
    opacity: 0.8;
}

/* 3 Sütunlu Izgara Yapısı */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 Yan Yana */
    gap: 8px;
}

.stat-box {
    background: rgba(255,255,255,0.5);
    border-radius: 10px;
    padding: 8px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.sb-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    opacity: 0.6;
    font-weight: 700;
    margin-bottom: 2px;
}

.sb-val {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--yazi-renk);
}

.sb-val.highlight {
    color: #27ae60; /* Yeşil Renk */
}

/* ========================================= */
/* --- YENİ OYUN SONU (ZAFER) EKRANI --- */
/* ========================================= */

.win-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    margin-bottom: 15px;
}

/* SKOR KUTUSU */
.win-score-box {
    background: rgba(0,0,0,0.03);
    border-radius: 15px;
    padding: 10px;
    text-align: center;
    border: 2px solid rgba(0,0,0,0.05);
}
.win-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.win-value-score {
    font-size: 2rem;
    font-weight: 900;
    color: var(--mavi-yazi);
    line-height: 1.1;
}

/* ALTIN KUTUSU */
.win-gold-box {
    background: linear-gradient(135deg, #fff9c4 0%, #fff 100%);
    border: 2px solid #f1c40f;
    border-radius: 15px;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    box-shadow: 0 5px 15px rgba(241, 196, 15, 0.2);
    animation: pulseGold 2s infinite;
}
.win-gold-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.1));
}
.win-gold-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.win-value-gold {
    font-size: 1.8rem;
    font-weight: 900;
    color: #f39c12;
}

@keyframes pulseGold {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* 2x REKLAM BUTONU (Özel Tasarım) */
.btn-double-reward {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 15px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.4);
    transition: transform 0.2s;
    margin-top: 5px;
}
.btn-double-reward:active { transform: scale(0.95); }
.ad-icon { background: white; color: #27ae60; padding: 2px 6px; border-radius: 6px; font-size: 0.7rem; font-weight: 900; }
/* --- YENİ GOOGLE GİRİŞ BUTONU (KARANLIK MOD) --- */
.btn-google-dark {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #131314; /* Görseldeki koyu arka plan */
    border: 1px solid #8e918f; /* İnce gri kenarlık */
    border-radius: 24px; /* Tam yuvarlatılmış köşeler */
    padding: 8px 16px 8px 8px; /* Sol tarafta ikon için daha az boşluk */
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    font-family: 'Roboto', sans-serif; /* Google fontu */
    text-decoration: none;
    width: auto; /* Genişlik içeriğe göre */
    min-width: 200px; /* Çok küçülmemesi için */
    margin: 10px auto; /* Ortalama */
}

/* Buton içindeki metin */
.btn-google-dark span {
    color: #ffffff; /* Beyaz metin */
    font-size: 16px;
    font-weight: 500;
    margin-left: 12px; /* İkon ile metin arası boşluk */
}

/* Google "G" Logosu SVG ayarları */
.google-icon {
    width: 24px;
    height: 24px;
    background-color: white; /* Logonun arkası beyaz */
    border-radius: 50%; /* Logonun arkasını yuvarlak yap */
    padding: 2px; /* Logoyu beyaz dairenin içine it */
}

/* Hover (Üzerine gelince) Efekti */
.btn-google-dark:hover {
    background-color: #2d2e30; /* Biraz daha açık gri */
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Tıklama Efekti */
.btn-google-dark:active {
    background-color: #424548;
}

/* --- LİDERLİK TABLOSU DÜZELTMESİ (BOYUT VE RENK) --- */

/* 1. Tüm kartları standart boyuta getir (Taşmayı Önle) */
.leader-item {
    width: 100% !important; /* Genişlik kapsayıcıya uysun */
    box-sizing: border-box !important; /* Çerçeveler genişliğe dahil olsun */
    margin-left: 0 !important;
    margin-right: 0 !important;
    transform: none !important; /* 🔥 BÜYÜMEYİ İPTAL ET (Sorunu çözen kod) */
    transition: background 0.2s, border 0.2s; /* Sadece renk değişsin, boyut değil */
}

/* 2. Sıralama Renkleri (Sadece Renk Değişimi, Boyut Değil) */

/* 🥇 1. SIRA: ALTIN (Gold) */
.leader-item.rank-1 {
    background: linear-gradient(to right, rgba(241, 196, 15, 0.15), transparent) !important;
    border: 2px solid #f1c40f !important; /* Altın Çerçeve */
}
/* Rakam Rengi */
.leader-item.rank-1 .leader-rank { 
    color: #f1c40f !important; 
    font-size: 1.3rem !important; /* Rakam biraz büyük kalabilir */
    opacity: 1 !important;
}

/* 🥈 2. SIRA: GÜMÜŞ */
.leader-item.rank-2 {
    border: 2px solid #bdc3c7 !important;
    border-left: 4px solid #bdc3c7 !important; /* Sol çizgi */
}
.leader-item.rank-2 .leader-rank { color: #95a5a6 !important; opacity: 1 !important; }

/* 🥉 3. SIRA: BRONZ */
.leader-item.rank-3 {
    border: 2px solid #d35400 !important;
    border-left: 4px solid #d35400 !important;
}
.leader-item.rank-3 .leader-rank { color: #d35400 !important; opacity: 1 !important; }

/* 👤 "SEN" (KULLANICI) İÇİN ÖZEL AYAR */
/* Eğer kullanıcı 1. sıradaysa, Mavi değil ALTIN görünsün diye bu ayarı yapıyoruz */
.leader-item.is-me {
    /* Varsayılan olarak Mavi (Eğer ilk 3'te değilse) */
    border: 2px solid var(--mavi-yazi);
    background: rgba(41, 128, 185, 0.1);
}

/* 🔥 AMA: Eğer hem "SEN" hem "1. SIRA" isen -> ALTIN KAZANIR */
.leader-item.rank-1.is-me {
    border-color: #f1c40f !important; /* Mavi yerine Altın olsun */
    background: linear-gradient(to right, rgba(241, 196, 15, 0.2), transparent) !important;
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.2); /* Hafif altın parlaması */
}