/* =========================================================================
   css/base.css
   Temel HTML sıfırlamaları, genel sayfa yapısı, animasyonlar ve modallar
   ========================================================================= */

html {
    min-height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100dvh;
    overflow-x: hidden;
    /* Cutout clearance is on .game-top-bar / #menu — not here (avoids double gap). */
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    user-select: none;
    touch-action: manipulation;
    overscroll-behavior-y: contain;
    transition: background .3s;
}

input, textarea, [contenteditable="true"] {
    user-select: text;
    -webkit-user-select: text;
}

/*
 * Keep spatial UI LTR on Arabic just as Holy Rabbit does.  Only text-bearing
 * elements opt into RTL, so button order, HUD positions and board coordinates
 * never mirror.
 */
html.kzl-rtl [data-i18n],
html.kzl-rtl .section-title,
html.kzl-rtl .modal-body p,
html.kzl-rtl .modal-body li,
html.kzl-rtl .chat-balloon-panel,
html.kzl-rtl .pb-name,
html.kzl-rtl .pb-rank {
    direction: rtl;
    unicode-bidi: plaintext;
    text-align: right;
}

html.kzl-rtl input,
html.kzl-rtl textarea {
    direction: rtl;
    text-align: right;
}

html.kzl-rtl #board,
html.kzl-rtl .board-container,
html.kzl-rtl .players-row,
html.kzl-rtl .game-top-bar {
    direction: ltr;
}

/* --- RTL KAPSAM GENİŞLETMESİ ---------------------------------------------
   Yukarıdaki kural yalnızca [data-i18n] taşıyan öğeleri kapsıyordu. Sonradan
   eklenen ekranların metinleri JavaScript ile innerHTML üzerinden basılıyor
   ve data-i18n taşımıyor; bu yüzden Arapça'da soldan sağa çiziliyorlardı:
     • Market / satın alma paneli
     • Bildirim (push) ayarları satırları
     • Uyarı ve onay pencereleri (showCustomAlert / showCustomConfirm)
     • Sesli sohbet kiralama notu
   Aynı seçici mantığı korunuyor: SADECE metin akışı RTL olur; düğme sırası,
   HUD yerleşimi ve tahta koordinatları aynalanmaz. */
html.kzl-rtl #kzl-market-panel .kzl-pack-title,
html.kzl-rtl #kzl-market-panel .kzl-pack-gain,
html.kzl-rtl #kzl-market-panel .kzl-pack-bonus,
html.kzl-rtl #kzl-market-panel .kzl-pack-best,
html.kzl-rtl #kzl-market-panel h2,
html.kzl-rtl #kzl-market-panel .dd-container > div,
html.kzl-rtl #kzl-push-settings,
html.kzl-rtl #kzl-push-settings span,
html.kzl-rtl .custom-modal-title,
html.kzl-rtl .custom-modal-text,
html.kzl-rtl #setup-voice-note {
    direction: rtl;
    unicode-bidi: plaintext;
    text-align: right;
}

/* Fiyat ve paket sayıları her zaman soldan sağa okunur (Arapça'da da
   rakamlar LTR akar); bunlar aynalanmamalı. */
html.kzl-rtl #kzl-market-panel .kzl-pack-amount,
html.kzl-rtl .kzl-voice-num {
    direction: ltr;
    unicode-bidi: isolate;
}

/* --- Genel Overlay & Menü Konteynerleri --- */
#menu, #settings-menu, #store-menu, #victory-modal, #about-menu, #history-menu, #icon-picker-modal, #local-setup-menu, #profile-menu, #notification-menu, #quest-menu, #leaderboard-menu {
    position: fixed;
    inset: 0;
    background: rgba(245,245,247,.92);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    /* blur menü aç/kapa'da (özellikle Android WebView) ciddi kasma yapıyor */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    display: none;
}

#menu {
    display: flex;
    align-items: flex-start;
    padding-top: max(20px, var(--safe-area-inset-top, env(safe-area-inset-top, 0px)));
    padding-bottom: max(20px, var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
    background: var(--bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}

#settings-menu, #store-menu, #history-menu, #about-menu, #profile-menu, #notification-menu, #quest-menu, #leaderboard-menu {
    background: var(--bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 0;
    padding-top: max(20px, var(--safe-area-inset-top, env(safe-area-inset-top, 0px)));
    padding-bottom: max(20px, var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

/* ── Ana Menü tarzı kart çerçevesi (alt sayfalar için) ──
   #menu > .card ile BİREBİR aynı boyut ve görünüm. */
.menu-card-frame {
    background: var(--card-bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    /* TEK KAYNAK: çerçevenin köşe yarıçapı. Başlık ve son çocuk da BU
       değişkeni kullanır; böylece üç yer birbirinden ayrışamaz.
       Ölçekli değeri css/responsive.css yalnız bu değişkeni değiştirerek
       verir — `border-radius`'ı ayrıca ezmez. */
    --kzl-frame-radius: 36px;
    border-radius: var(--kzl-frame-radius);
    box-shadow: 0 10px 26px rgba(0,0,0,.10);
    border: 1px solid rgba(255,255,255,.8);
    display: flex;
    flex-direction: column;
    width: min(90vw, 420px);
    max-width: none;
    flex: 0 0 auto;
    /* ⚠️ ESKİDEN: height:84vh + max-height:84vh + overflow:hidden.
       Kart, ekran yüksekliğine sabitlenip içeriği KIRPIYORDU; gövdedeki
       kaydırma çubuğu da gizli olduğu için (scrollbar-width:none) kullanıcı
       "alt kısım kesildi" diye görüyordu. Kısa pencerede profil kartı 590px
       ekranda 495px'e sıkışıp içeriği 360px'lik gizli bir kutuya hapsediyordu.
       ANA MENÜ REFERANSI: #menu > .card'ın yüksekliği yok, sayfayı kapsayıcı
       (#menu) kaydırıyor. Alt sayfalar da artık aynı davranıyor: kart içerik
       kadar uzar, kaydırmayı panel kapsayıcısı üstlenir. */
    height: auto;
    max-height: none;
    overflow: visible;
    box-sizing: border-box;
    text-align: center;
    transition: transform .2s ease, opacity .2s ease;
    animation: none;
}

.menu-card-frame > .modal-header,
.menu-card-frame > .profile-tabs,
.menu-card-frame > .quest-tabs {
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
}

.menu-card-frame > .modal-header {
    /* ⚠️ ESKİDEN: `border-radius: 0`. Başlık opak zeminli ve çerçevenin en
       üstünde; köşeleri kare olduğu için kartın yuvarlak köşelerinin ÜSTÜNÜ
       boyuyordu. Eskiden çerçevede `overflow:hidden` vardı ve bunu kırpıp
       gizliyordu; kırpma kaldırılınca (uzun sayfaların alt kısmı kesilmesin
       diye) kusur ortaya çıktı. Başlık artık çerçeveyle AYNI yarıçapı
       kullanıyor — iki üst köşe simetrik ve yuvarlak. */
    border-radius: var(--kzl-frame-radius) var(--kzl-frame-radius) 0 0;
    box-shadow: none;
    margin-top: 0 !important;
    padding: 18px 24px;
}

/* Alt köşeler: çerçevenin son çocuğu zeminli olursa köşeden taşmasın. */
.menu-card-frame > :last-child {
    border-bottom-left-radius: var(--kzl-frame-radius);
    border-bottom-right-radius: var(--kzl-frame-radius);
}

.menu-card-frame > .modal-body {
    /* Gövde artık KENDİ İÇİNDE kaydırmıyor; kart kadar uzuyor ve kaydırmayı
       panel kapsayıcısı yapıyor (ana menüyle aynı model). Böylece uzun
       sayfalarda bütün içeriğe tek bir dikey kaydırmayla ulaşılıyor. */
    flex: 0 0 auto;
    min-height: 0;
    overflow: visible;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
    height: auto !important;      /* satır içi height:60vh/70vh'yi etkisizleştirir */
    max-height: none;
    margin: 0;
    box-sizing: border-box;
    scrollbar-width: none;
}

.menu-card-frame > .modal-body::-webkit-scrollbar {
    display: none;
}

/* ── Bildirim paneli metin hizası ──────────────────────────────────────
   .menu-card-frame `text-align:center` uyguluyor; bildirim kartlarının
   tarih / başlık / mesaj satırları ortalanınca tasarım bozuluyordu.
   Yalnız METİN hizası değişir — düğme sırası ve konumlar aynı kalır. */
#notification-menu .kzl-notif-card .kzl-notif-date,
#notification-menu .kzl-notif-card .kzl-notif-title,
#notification-menu .kzl-notif-card .kzl-notif-msg {
    text-align: left;
}

/* Arapça: yalnız bu metin satırları sağa akar (düğmeler aynalanmaz). */
html.kzl-rtl #notification-menu .kzl-notif-card .kzl-notif-date,
html.kzl-rtl #notification-menu .kzl-notif-card .kzl-notif-title,
html.kzl-rtl #notification-menu .kzl-notif-card .kzl-notif-msg {
    direction: rtl;
    unicode-bidi: plaintext;
    text-align: right;
}

/* ── BAŞLIKTAKİ BAKİYE GÖSTERGESİ ──────────────────────────────────────
   `.player-stat` ÜST BAR için yazılmıştı: layout.css'te `flex:1 1 auto` +
   `margin-right:auto`, responsive.css'te `min-width: calc(72*u)`. Orada
   doğru — bakiye kutusu dar ekranda ezilmesin diye taban genişliği var.

   Ama aynı sınıf Mağaza ve Görev Merkezi BAŞLIĞINDA da kullanılıyor ve
   orada ters tepiyordu (390px'te ölçüldü):
     • Mağaza : kutu 96px, içerik 38px → 58px ölü alan
     • Görev  : kutu 92px, içerik 61px → 31px ölü alan
   İçerik sola yaslı olduğu için gösterge X düğmesinden uzağa itiliyordu.

   Başlıkta kutu artık içeriğini sarar; X ile arasındaki mesafeyi yalnız
   sarmalayıcının `gap`i belirler (Geçmiş başlığıyla aynı: 16px). */
.modal-header .player-stat {
    flex: 0 0 auto;
    min-width: 0;
    max-width: none;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
    white-space: nowrap;
}

/* ── PANEL BİLGİ NOTU — TEK TASARIM ────────────────────────────────────
   Bildirimler panelindeki "1 saat sonra otomatik silinir" notu ile
   Sıralama sekmelerindeki "ilk 19 kişi gösterilir" notu AYNI görünmeli.
   Ölçüler tek yerde: iki not da bu sınıfı kullanır.
     .kzl-panel-note         → listenin ÜSTÜNDE (bildirimler)
     .kzl-panel-note-footer  → listenin ALTINDA (sıralama) — ayırıcı üstte */
.kzl-panel-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 1.45;
    text-align: center;
}
.kzl-panel-note-footer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, .1);
}
html.kzl-rtl .kzl-panel-note {
    direction: rtl;
    unicode-bidi: plaintext;
}

/* ── "1 saat sonra otomatik silinir" notu: ORTALANIR ───────────────────
   Bu satır yukarıdaki listeden ÇIKARILDI. Oraya bildirim KARTLARININ metin
   hizası için konmuştu; oysa bu bir kart satırı değil, panelin genel
   bilgi notu — hemen altındaki "Bu sekmede hiç bildiriminiz yok." satırıyla
   aynı eksende durması gerekiyor. Solda kalınca panelin tek hizasız
   öğesiydi.
   İkon ile metin tek blok hâlinde ortalanır (main_menu.js'te flex satır);
   metin iki satıra sararsa iki satır da ortalı kalır. */
#notification-menu #notif-autodelete-note {
    text-align: center;
}
html.kzl-rtl #notification-menu #notif-autodelete-note {
    direction: rtl;
    unicode-bidi: plaintext;
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════════════
   OKUNMUŞ / OKUNMAMIŞ AYRIMI
   ═══════════════════════════════════════════════════════════════════
   Şartname: "Okunmamış bildirimler belirgin, okunanlar daha soluk
   gösterilmeli." Eskiden tek fark okunmamıştaki kırmızı noktaydı; kart
   gövdesi ikisinde de birebir aynıydı.
   Solukluk KARTIN TAMAMINA uygulanır (opacity) — böylece içindeki
   düğmeler ve renk şeridi de birlikte soluyor; yalnız metin rengini
   değiştirmek yarım bir ayrım olurdu. */
#notification-menu .kzl-notif-card.kzl-notif-read {
    opacity: .55;
    box-shadow: none;
}
#notification-menu .kzl-notif-card.kzl-notif-read:hover,
#notification-menu .kzl-notif-card.kzl-notif-read:active {
    opacity: .8;
}
#notification-menu .kzl-notif-card.kzl-notif-unread {
    box-shadow: 0 4px 14px rgba(0, 0, 0, .07);
}
/* Karta dokunma artık bir eylem — dokunma geri bildirimi ver. */
#notification-menu .kzl-notif-card[data-kzl-act="notif-open"]:active {
    transform: scale(.985);
}
#notification-menu .kzl-notif-card {
    transition: opacity .2s ease, transform .12s ease;
}
/* Sekme başlığındaki okunmamış sayısı */
#notification-menu .kzl-tab-count {
    font-variant-numeric: tabular-nums;
    opacity: .75;
}

/* Sağa hizalanan tarih/başlık, sağ üstteki sil düğmesiyle çakışmasın.
   (32 px düğme + 12 px kenar boşluğu = 44 px; satır içi dolgu ile aynı.) */
html.kzl-rtl #notification-menu .kzl-notif-card .kzl-notif-date,
html.kzl-rtl #notification-menu .kzl-notif-card .kzl-notif-title {
    padding-right: 44px;
}


/* Mağaza ana menünün üstünde kalsın (hayalet tıklama alta düşmesin) */
#store-menu {
    z-index: 2100;
}

#icon-picker-modal {
    z-index: 3500;
    background: rgba(0,0,0,.55);
}

#local-setup-menu {
    background: rgba(0,0,0,.5);
}
#local-setup-menu .menu-card-frame {
    background: var(--bg) !important;
    border-radius: 20px !important;
    padding: 18px;
    box-shadow: 0 18px 45px rgba(0,0,0,.28) !important;
    border: none !important;
    height: auto;
    max-height: 84vh;
    overflow-y: auto;
}

#icon-picker-modal .card,
#local-setup-menu .card {
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@keyframes menuFadeIn {
    0% { opacity: 0; transform: scale(0.96) translateY(10px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* --- Altın Oran Pencere Genişlikleri (Fluid Design) --- */
.modal-header, .profile-tabs, .modal-body, .card {
    width: 100%;
    max-width: min(90vw, 420px);
    box-sizing: border-box;
    margin-left: auto;
    margin-right: auto;
}

.modal-body {
    background: transparent;
    border-radius: 0;
    padding: 15px 15px 25px 15px;
    box-shadow: none;
    margin-bottom: 20px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    min-height: 0;
}

.modal-header {
    background: var(--card-bg);
    margin-top: max(15px, var(--safe-area-inset-top, env(safe-area-inset-top, 0px)));
    margin-bottom: 15px;
    border-radius: 24px;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: none;
    border-radius: 36px 36px 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,.06);
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding: 14px 20px;
}

.modal-header h2 { 
    margin: 0; 
    font-size: 15px; 
    font-weight: 700; 
    color: var(--text-main); 
    display: flex; 
    align-items: center; 
    gap: 6px;
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}

.modal-body { 
    margin-top: 0;
    margin-bottom: 0;
    padding: 15px 25px 25px;
    overflow-y: auto; 
    flex: 1 1 auto; 
    position: relative;
    min-height: 0;
    max-height: 85vh;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
/* Webkit scrollbar gizle */
#settings-menu > .modal-body::-webkit-scrollbar,
#store-menu > .modal-body::-webkit-scrollbar,
#history-menu > .modal-body::-webkit-scrollbar,
#about-menu > .modal-body::-webkit-scrollbar,
#profile-menu > .modal-body::-webkit-scrollbar,
#notification-menu > .modal-body::-webkit-scrollbar,
#quest-menu > .modal-body::-webkit-scrollbar,
#leaderboard-menu > .modal-body::-webkit-scrollbar {
    display: none;
}

/* Header içindeki butonlar: kompakt boyut */
.modal-header .menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    margin: 0;
    padding: 6px 14px;
    font-size: 13px;
    flex-shrink: 0;
    min-height: 0;
    border-radius: 14px;
}
.modal-header .menu-icon-btn {
    width: 36px;
    height: 36px;
    min-height: 36px;
    border-radius: 12px;
    flex-shrink: 0;
}

/* ── Online menüler: overlay arka planı Market ile aynı ──
   Yarı saydam siyah: ana menü arkada görünür kalır. */
#online-setup-menu,
#online-lobby-menu,
#mini-online-queue-menu,
#random-online-hub {
    background: rgba(0,0,0,.5) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}
/* ── Market teması: online panellerin .card kutusu market görünümü alır ── */
/* NOT: width/margin/max-height/padding'de !important YOK — menu_popover.js
   inline stillerle hizalama yapabilsin diye. */
#online-setup-menu > .card,
#online-lobby-menu > .card,
#mini-online-queue-menu > .card,
#random-online-hub > .card {
    background: var(--bg) !important;
    width: min(90vw, 420px);
    max-width: none;
    max-height: min(85vh, 800px);
    border-radius: 20px !important;
    box-sizing: border-box;
    margin: 0 auto;
    flex-shrink: 0;
    padding: 18px;
    box-shadow: 0 18px 45px rgba(0,0,0,.28) !important;
    border: none !important;
    overflow-y: auto;
}


.card {
    background: var(--card-bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 35px 25px;
    border-radius: 36px;
    text-align: center;
    max-height: none;
    overflow: visible;
    box-shadow: 0 10px 26px rgba(0,0,0,.10);
    border: 1px solid rgba(255,255,255,.8);
    transition: transform .2s ease, opacity .2s ease;
    will-change: auto;
    animation: none;
}

/*
 * The main menu remains the original narrow, centered card. Its overlay owns
 * scrolling only on short viewports, avoiding a scrollbar inside the card.
 */
#menu > .card {
    width: min(90vw, 420px);
    max-width: none;
    align-self: flex-start;
    flex: 0 0 auto;
    max-height: none;
    overflow: visible;
}

.card h1 { margin: 0 0 5px; font-size: 28px; font-weight: 800; letter-spacing: 0; }
.card h3 { margin: 0 0 20px; font-size: 20px; font-weight: 600; color: var(--text-secondary); }

/* --- Custom Dialog Modal (Uyarı Pencereleri) --- */
.custom-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    animation: none;
    padding: 20px;
}

.custom-modal-box {
    background: var(--card-bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid rgba(255,255,255,.6);
    border-radius: 18px;
    padding: 16px;
    width: 100%;
    max-width: 250px;
    box-shadow: 0 10px 25px rgba(0,0,0,.15);
    text-align: center;
    transform: scale(.9);
    will-change: auto;
    animation: none;
}

.custom-modal-title { font-size: 15px; font-weight: 800; color: var(--text-main); margin: 0 0 6px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.custom-modal-text { font-size: 11px; color: var(--text-secondary); line-height: 1.45; margin: 0 0 14px; }
.custom-modal-text b { color: var(--text-main); }
.custom-modal-buttons { display: flex; gap: 6px; justify-content: center; }
.custom-modal-btn { flex: 1; padding: 8px; border-radius: 10px; font-size: 11px; font-weight: 700; cursor: pointer; border: none; transition: all .2s; }
.custom-modal-btn.cancel { background: rgba(0,0,0,.05); color: var(--text-main); }
.custom-modal-btn.confirm { background: var(--apple-blue); color: #fff; box-shadow: 0 3px 10px rgba(0,122,255,.3); }

/* --- Kompakt modaller: yerel oyun ayarları (market teması) --- */
#local-setup-menu {
    padding: 16px;
    box-sizing: border-box;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
#local-setup-menu .card {
    max-width: min(94vw, 300px);
    background: var(--bg) !important;
    border-radius: 20px !important;
    padding: 18px !important;
    box-shadow: 0 18px 45px rgba(0,0,0,.28) !important;
    border: none !important;
}
#local-setup-menu .card > div:first-child {
    margin-bottom: 10px !important;
}
#local-setup-menu .card > div:nth-child(3) {
    margin-bottom: 12px !important;
}
#local-setup-menu #local-map-type-section,
#local-setup-menu #local-player-count-section {
    margin-bottom: 12px !important;
}
#local-setup-menu .card h2 {
    font-size: 17px !important;
}
#local-setup-menu #local-map-type-section > div:last-child,
#local-setup-menu #bot-difficulty-selector {
    gap: 6px !important;
}
#local-setup-menu #local-mode-selector .mode-btn,
#local-setup-menu #bot-difficulty-selector .mode-btn {
    padding: 8px 6px !important;
    font-size: 11px !important;
    border-radius: 10px !important;
}
#local-setup-menu .count-btn {
    width: 44px !important;
    height: 44px !important;
    font-size: 17px !important;
}
#local-setup-menu #setup-cards-container {
    gap: 8px !important;
    margin-bottom: 12px !important;
    grid-template-columns: repeat(2, 1fr) !important;
}
#local-setup-menu .menu-btn.primary {
    margin-top: 6px !important;
    padding: 11px 14px !important;
    font-size: 13px !important;
    border-radius: 12px !important;
}

/* Yerel kurulum: oyuncu kartı içeriği */
#local-setup-menu .setup-card.local-setup-player-card {
    padding: 10px 11px !important;
    gap: 10px !important;
    border-radius: 14px !important;
}

/*
 * Friend and clan profiles are detail sheets, not compact alerts.  The card
 * itself never scrolls; its content region is the only scroll owner when
 * content genuinely exceeds the available dialog height.
 */
#friend-profile-modal,
#clan-profile-modal {
    padding:
        max(12px, env(safe-area-inset-top))
        max(12px, env(safe-area-inset-right))
        max(12px, env(safe-area-inset-bottom))
        max(12px, env(safe-area-inset-left)) !important;
}

.detail-modal-card {
    width: min(85vw, 300px) !important;
    max-width: min(85vw, 300px) !important;
    max-height: min(82dvh, 720px) !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
    isolation: isolate;
}

.detail-modal-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}

#friend-profile-modal .detail-modal-content > [style*="max-width:272px"],
#clan-profile-modal .detail-modal-content > [style*="max-width:272px"] {
    max-width: 100% !important;
}

.detail-modal-card > button[aria-label]:not(.kzl-close-x) {
    top: max(10px, env(safe-area-inset-top)) !important;
    right: max(10px, env(safe-area-inset-right)) !important;
}

@media (max-width: 600px) {
    .detail-modal-card {
        width: 95% !important;
        max-width: min(85vw, 300px) !important;
        max-height: min(82dvh, 720px) !important;
        border-radius: 24px !important;
    }

    .detail-modal-content {
        padding-left: 20px !important;
        padding-right: 20px !important;
        padding-bottom: max(20px, env(safe-area-inset-bottom)) !important;
    }
}

/* --- Yardımcı Sınıflar (Utilities) --- */
.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.item-locked { filter: grayscale(1); opacity: .7; }

/* --- Temel Animasyonlar --- */
@keyframes cardPopIn { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes popIn { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideDown { from { transform: translate(-50%,-150%); opacity: 0; } to { transform: translate(-50%,0); opacity: 1; } }
@keyframes slideUp { from { transform: translate(-50%,0); opacity: 1; } to { transform: translate(-50%,-150%); opacity: 0; } }

/* --- Zırh: Yatay Ekran Uyarısı (Mobil) --- */
@media screen and (max-height: 500px) and (orientation: landscape) and (pointer: coarse) {
    body::after {
        content: "📱 Lütfen telefonu dik tutun!";
        position: fixed; inset: 0; z-index: 2147483647;
        background: var(--bg, #1c1c1e); color: var(--text-main, #fff);
        display: flex; align-items: center; justify-content: center;
        font-size: 20px; font-weight: 800; letter-spacing: 1px;
    }
    body > * { display: none !important; }
}

@media(max-height:700px){
    /* ⚠️ Buradaki `max-height:80vh` KALDIRILDI. Ana menü kartı `#menu > .card`
       ile zaten korunuyordu; ama alt sayfalardaki diğer `.card` öğeleri kısa
       pencerede kırpılıyor ve alt kısımlarına ulaşılamıyordu. Dolgu aynı. */
    .card{padding:20px}
}
@media(max-width:480px){
    .card{padding:25px 20px}
    .card h1{font-size:24px}
}

.logo-text {
    background: linear-gradient(110deg, transparent 0%, transparent 10%, rgba(66, 133, 244, 0.25) 30%, rgba(234, 67, 53, 0.25) 45%, rgba(251, 188, 5, 0.25) 55%, rgba(52, 168, 83, 0.25) 70%, transparent 90%, transparent 100%), linear-gradient(to right, #555555, #888888);
    background-size: 600px 100%, 100% 100%;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbow-flow 20s linear infinite;
    display: inline-block;
    letter-spacing: 0;
    word-spacing: normal;
    white-space: nowrap;
}

@keyframes rainbow-flow {
    0% { background-position: -500px 0, 0 0; }
    100% { background-position: 500px 0, 0 0; }
}

/* Ludo katlanma animasyonu kaldırıldı — "Ludo" Pine Cone'un içine giriyordu */
.logo-fold {
    display: inline;
    white-space: pre;
    overflow: visible;
    max-width: none;
    margin-left: 0;
    animation: none;
    background: inherit;
    background-size: inherit;
    color: inherit;
    -webkit-background-clip: inherit;
    background-clip: inherit;
}

/*
 * The Guide brand is intentionally one text run.  Unlike the main-menu
 * logo-fold treatment, its sky sweep must never collapse part of the name.
 */
.guide-brand-title {
    /*
     * Deliberately independent from .logo-text/.logo-fold: this is one
     * immutable text run, so the sky animation always spans the full name.
     */
    display: inline-block;
    max-width: 100%;
    min-width: 0;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: keep-all;
    line-height: 1.2;
    font-size: clamp(14px, 5.5vw, 18px) !important;
    background: linear-gradient(110deg, transparent 0%, transparent 10%, rgba(66, 133, 244, 0.25) 30%, rgba(234, 67, 53, 0.25) 45%, rgba(251, 188, 5, 0.25) 55%, rgba(52, 168, 83, 0.25) 70%, transparent 90%, transparent 100%), linear-gradient(to right, #555555, #888888);
    background-size: 600px 100%, 100% 100%;
    color: transparent !important;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbow-flow 20s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
    .guide-brand-title {
        animation: none;
    }
}

