/* ════════════════════════════════════════════════════════════
   HARİTA ANA EKRANI
   Üst bar (HESAP / PUANLAR) + XP şeridi, harita tam ekran,
   sağda etiketli altıgen butonlar, solda filo çekmecesi.
   (js/game/ana-ekran.js body'ye .harita-ana-ekran ekler)
   ════════════════════════════════════════════════════════════ */
:root {
    --ae-ust: 64px;
    --ae-serit: 30px;
    --ae-panel: rgba(10, 18, 34, 0.94);
    --ae-kenar: rgba(71, 85, 105, 0.55);
    --ae-hx: 56px;
}

/* ── ÜST BAR ── */
body.harita-ana-ekran #gameHeader {
    height: var(--ae-ust) !important; min-height: var(--ae-ust) !important;
    background: linear-gradient(180deg, #0b1628 0%, #0f1f3a 100%) !important;
    border-bottom: none !important;
}
body.harita-ana-ekran .hd-level-pill,
body.harita-ana-ekran #headerStatsPanel,
body.harita-ana-ekran .hd-date-pill { display: none !important; }
body.harita-ana-ekran #hdMobileCenter {
    display: flex !important; flex-direction: row !important; align-items: center !important;
    gap: 28px !important; flex: 1 1 auto !important; justify-content: flex-start !important; padding: 0 8px !important;
}
body.harita-ana-ekran .hdmc-row {
    display: grid !important; grid-template-columns: auto auto; grid-template-rows: auto auto;
    column-gap: 4px; align-items: center; justify-items: start;
}
body.harita-ana-ekran .hdmc-etiket {
    grid-column: 1 / -1; font-size: 11px; font-weight: 700; letter-spacing: .12em; color: #cbd5e1; line-height: 1;
}
body.harita-ana-ekran .hdmc-icon, body.harita-ana-ekran .hdmc-star { display: none; }
body.harita-ana-ekran .hdmc-balance { font-size: 24px !important; font-weight: 800 !important; line-height: 1.1; }
body.harita-ana-ekran .hdmc-puan { font-size: 24px !important; font-weight: 800 !important; color: #facc15 !important; line-height: 1.1; }
body.harita-ana-ekran .hd-seri-chip { grid-column: 1 / -1; margin: 2px 0 0; justify-self: start; }

/* XP şeridi (header'ın hemen altı) */
#xpSerit {
    display: none; align-items: center; gap: 8px; height: var(--ae-serit); padding: 0 8px 0 0;
    background: #0e1a30; border-bottom: 1px solid rgba(99, 102, 241, 0.25); position: relative; z-index: 45;
}
body.harita-ana-ekran #xpSerit { display: flex; }
.xps-seviye {
    height: 100%; min-width: 46px; padding: 0 10px; display: flex; align-items: center; justify-content: center;
    background: #1e3a6b; color: #e2e8f0; font-weight: 800; font-size: 15px;
    clip-path: polygon(0 0, 100% 0, 82% 100%, 0 100%);
}
.xps-cubuk { flex: 1; height: 100%; position: relative; overflow: hidden; }
.xps-cubuk > div { position: absolute; inset: 0 auto 0 0; width: 0%; background: linear-gradient(90deg, #15803d, #22c55e); transition: width .6s ease; }
.xps-cubuk > span { position: relative; z-index: 1; display: flex; height: 100%; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 600; color: #f1f5f9; text-shadow: 0 1px 2px rgba(0,0,0,.8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 8px; }
.xps-gorev { position: relative; color: #facc15; padding: 2px 4px; }
.xps-rozet { position: absolute; top: -4px; right: -6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: #dc2626; color: #fff; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.xps-rozet.hidden { display: none; }

/* Ana alan yüksekliği: üst bar + XP şeridi */
body.harita-ana-ekran #gameContainer > main { height: calc(100vh - var(--ae-ust) - var(--ae-serit)) !important; }
body.harita-ana-ekran #sidebar { display: none !important; }
body.harita-ana-ekran #rightPanel { display: none !important; }
body.harita-ana-ekran #panelToggleBtn { display: none !important; }

/* Leaflet'in kendi zoom'u yerine sağ sütundaki +/− kullanılır */
body.harita-ana-ekran .leaflet-control-zoom { display: none !important; }
body.harita-ana-ekran #mapFilterBtn { opacity: 0 !important; pointer-events: none !important; }
body.harita-ana-ekran #mapFilterPanel { top: 12px !important; bottom: auto !important; left: auto !important; right: calc(var(--ae-hx) + 34px) !important; }
body.harita-ana-ekran #mapLeftPanelToggle { display: none !important; }

/* ── SAĞ SÜTUN ── */
body.harita-ana-ekran #mobileRightNav {
    display: flex !important; flex-direction: column; align-items: center; gap: 6px;
    position: fixed !important; right: 6px !important; top: calc(var(--ae-ust) + var(--ae-serit) + 8px) !important;
    bottom: 8px; max-height: none !important; width: calc(var(--ae-hx) + 26px);
    padding: 0 !important; background: transparent !important; border: none !important; box-shadow: none !important;
    backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
    overflow-y: auto; overflow-x: visible; z-index: 1200 !important; scrollbar-width: none;
}
.hx-grup--harita { display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; }
.hx-mini {
    width: 44px; height: 40px; display: flex; align-items: center; justify-content: center; color: #e0e7ff;
    background: linear-gradient(180deg, #3b4b9a, #26336d); border: 2px solid #1e1b4b; border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,.45);
}
.hx-mini:hover { filter: brightness(1.2); }

body.harita-ana-ekran .hx-btn {
    position: relative; width: auto !important; height: auto !important; min-height: 0 !important;
    display: flex !important; flex-direction: column; align-items: center; gap: 0 !important;
    background: transparent !important; border: none !important; padding: 0 !important; box-shadow: none !important;
}
.hx-ikon {
    width: var(--ae-hx); height: calc(var(--ae-hx) * 0.92); display: flex; align-items: center; justify-content: center;
    color: #e2e8f0; background: linear-gradient(160deg, #2f3d63 0%, #141c33 70%);
    clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
    box-shadow: inset 0 0 0 2px rgba(148, 163, 184, .35);
    transition: transform .12s, filter .12s;
}
.hx-btn:hover .hx-ikon { filter: brightness(1.25); transform: translateY(-1px); }
.hx-btn:active .hx-ikon { transform: scale(.94); }
.hx-etiket {
    margin-top: -6px; position: relative; z-index: 1; min-width: 70px; padding: 1px 6px; text-align: center;
    background: #f8fafc; color: #0f172a; font-size: 10.5px; font-weight: 800; letter-spacing: .03em;
    border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.5); white-space: nowrap;
}
.hx-btn--ana .hx-ikon { background: linear-gradient(160deg, #4f46e5 0%, #312e81 75%); color: #fff; }
.hx-btn--ana .hx-etiket { background: #6366f1; color: #fff; }
.hx-btn--bonus .hx-ikon { background: linear-gradient(160deg, #b91c1c 0%, #450a0a 75%); color: #fecaca; }
.hx-rozet {
    position: absolute; top: 0; left: 4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px;
    background: #dc2626; color: #fff; font-size: 12px; font-weight: 900; display: flex; align-items: center; justify-content: center;
    border: 2px solid #fff; z-index: 2;
}
.hx-rozet--sari { background: #f59e0b; color: #1c1917; }
.hx-rozet.hidden { display: none; }
/* eski tooltip / pk noktası bu düzende gereksiz */
body.harita-ana-ekran .mrn-tooltip, body.harita-ana-ekran .mrn-divider { display: none !important; }
/* Açılır paneller (MENÜ / ETKİNLİK) */
.hx-popover {
    position: fixed; right: calc(var(--ae-hx) + 34px); bottom: 16px; z-index: 1300; width: 250px; max-height: 70vh; overflow-y: auto;
    background: var(--ae-panel); border: 1px solid var(--ae-kenar); border-radius: 14px; padding: 6px;
    box-shadow: 0 12px 36px rgba(0,0,0,.55); display: grid; gap: 2px;
}
.hx-popover.hidden { display: none; }
.hx-popover > button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: #e2e8f0; font-size: 14px; font-weight: 600; text-align: left; }
.hx-popover > button:hover { background: rgba(99, 102, 241, .2); }
.hx-popover--liste { width: 300px; top: calc(var(--ae-ust) + var(--ae-serit) + 12px); bottom: auto; }
.hx-liste-baslik { font-size: 11px; font-weight: 800; letter-spacing: .08em; color: #94a3b8; padding: 8px 8px 4px; text-transform: uppercase; }
.hx-liste-satir { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; border-radius: 10px; color: #e2e8f0; font-size: 13px; text-align: left; width: 100%; }
.hx-liste-satir span { font-size: 11.5px; color: #94a3b8; }
button.hx-liste-satir:hover { background: rgba(245, 158, 11, .15); }
.hx-liste-bos { font-size: 12px; color: #64748b; padding: 4px 10px 8px; }

/* ── SOL FİLO ÇEKMECESİ ── */
.filo-cekmece-ac {
    position: absolute; left: 0; top: 50%; transform: translateY(-50%); z-index: 1100;
    width: 40px; height: 96px; display: flex; align-items: center; justify-content: center; color: #fff;
    background: #0f2748; border: 2px solid #1e3a8a; border-left: none; border-radius: 0 16px 16px 0;
    box-shadow: 2px 0 10px rgba(0,0,0,.4); transition: left .28s ease;
}
.filo-cekmece-ac.acik { left: min(420px, 86vw); }
.filo-cekmece-ac.acik svg { transform: rotate(180deg); }
.filo-cekmece {
    position: absolute; left: 0; top: 0; bottom: 0; width: min(420px, 86vw); z-index: 1100;
    display: flex; flex-direction: column; background: rgba(21, 28, 41, 0.9); backdrop-filter: blur(6px);
    transform: translateX(-102%); transition: transform .28s ease; box-shadow: 6px 0 24px rgba(0,0,0,.45);
}
.filo-cekmece.acik { transform: none; }
.fc-ust { display: flex; align-items: center; gap: 8px; padding: 10px 10px 8px; }
.fc-sekmeler { flex: 1; display: grid; grid-template-columns: 1fr 1fr; border-radius: 6px; overflow: hidden; }
.fc-sekmeler button { padding: 9px 6px; font-size: 16px; font-weight: 600; color: #fff; background: #1d5fa8; }
.fc-sekmeler button.aktif { background: #22a045; }
.fc-kapat { color: #e2e8f0; font-size: 22px; font-weight: 800; padding: 0 6px; }
.fc-ana-buton { margin: 0 10px 8px; padding: 11px; border-radius: 6px; font-size: 17px; font-weight: 700; color: #fff; background: #1d4ed8; box-shadow: inset 0 -3px 0 rgba(0,0,0,.25); }
.fc-ana-buton--kirmizi { background: #8b0f0f; }
.fc-ana-buton:hover { filter: brightness(1.15); }
.fc-liste { flex: 1; overflow-y: auto; }
.fc-satir {
    width: 100%; display: grid; grid-template-columns: 28px 1fr auto 86px; align-items: center; gap: 8px;
    padding: 11px 12px; color: #f1f5f9; text-align: left; border-bottom: 1px solid rgba(148, 163, 184, .18);
}
.fc-satir:hover { background: rgba(59, 130, 246, .14); }
.fc-ikon { font-size: 18px; text-align: center; }
.fc-ad { display: flex; flex-direction: column; min-width: 0; }
.fc-ad b { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-ad small { font-size: 11px; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-yuzde { font-size: 14px; font-variant-numeric: tabular-nums; color: #e2e8f0; }
.fc-durum { font-size: 13px; font-weight: 700; text-align: right; letter-spacing: .02em; }
.fc-bos { padding: 18px; color: #94a3b8; font-size: 13px; text-align: center; }
.fc-bant { margin: 6px 0 0; padding: 10px; text-align: center; font-size: 14px; color: #fff; background: #1d5fa8; }
.fc-bant.hidden { display: none; }
.fc-filtreler { display: grid; grid-template-columns: repeat(4, 1fr); background: #334155; }
.fc-filtreler button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; color: #e2e8f0; font-size: 12.5px; }
.fc-filtreler button.aktif { background: #1d5fa8; }
.fc-filtreler em { position: absolute; top: 3px; right: 10px; font-style: normal; font-size: 10px; font-weight: 800; color: #facc15; }

/* ── SOL ALT KISAYOLLAR (görev zinciri + OBS) ── */
.hx-sol-alt { position: absolute; left: 12px; bottom: 16px; z-index: 1050; display: flex; flex-direction: column; gap: 8px; }
body.harita-ana-ekran .hx-sol-alt .mission-chain-widget {
    position: relative !important; top: auto !important; left: auto !important; bottom: auto !important;
    width: 52px !important; height: 52px !important; border-radius: 6px !important;
    background: linear-gradient(180deg, #3b4b9a, #1e2a5c) !important; border: 2px solid #0f172a !important; color: #e0e7ff !important;
}
body.harita-ana-ekran .hx-sol-alt .mission-chain-widget svg { width: 26px !important; height: 26px !important; }
body.harita-ana-ekran .hx-sol-alt .mission-badge { top: -8px !important; right: -8px !important; min-width: 22px; height: 22px; font-size: 12px; }

/* Harita üstündeki diğer öğeler sağ sütunla çakışmasın */
body.harita-ana-ekran .harita-firsat-rozeti { top: 10px; }
body.harita-ana-ekran .yolda-karar-kart { left: 76px; bottom: 16px; }
body.harita-ana-ekran .leaflet-bottom.leaflet-right { right: calc(var(--ae-hx) + 30px); }

/* ── MOBİL ── */
@media (max-width: 640px) {
    :root { --ae-ust: 58px; --ae-serit: 26px; --ae-hx: 46px; }
    body.harita-ana-ekran #hdMobileCenter { gap: 16px !important; }
    body.harita-ana-ekran .hdmc-balance, body.harita-ana-ekran .hdmc-puan { font-size: 19px !important; }
    body.harita-ana-ekran .hdmc-etiket { font-size: 9.5px; }
    body.harita-ana-ekran .lang-switcher { display: none !important; }
    .hx-etiket { font-size: 9px; min-width: 58px; }
    .hx-mini { width: 38px; height: 34px; }
    #mobileRightNav { gap: 4px !important; }
    .xps-cubuk > span { font-size: 11px; }
        .fc-satir { grid-template-columns: 24px 1fr auto 70px; padding: 10px; }
    .fc-sekmeler button { font-size: 14px; }
    .fc-ana-buton { font-size: 15px; }
    .hx-popover { right: calc(var(--ae-hx) + 30px); }
}

/* Eski düzende #mapArea sabit top:64px idi; XP şeridiyle birlikte hizala */
body.harita-ana-ekran #mapArea {
    top: calc(var(--ae-ust) + var(--ae-serit)) !important;
    height: calc(100vh - var(--ae-ust) - var(--ae-serit)) !important;
    bottom: auto !important;
}
body.harita-ana-ekran .hdmc-puan::after { content: none; }

/* Kısa ekranlarda sağ sütun sığsın */
@media (max-height: 960px) and (min-width: 641px) {
    :root { --ae-hx: 46px; }
    #mobileRightNav { gap: 3px !important; }
    .hx-mini { width: 38px; height: 32px; }
    .hx-etiket { font-size: 9.5px; min-width: 62px; }
}
@media (max-height: 760px) {
    :root { --ae-hx: 40px; }
    .hx-grup--harita { flex-direction: row; }
    .hx-mini { width: 30px; height: 28px; }
}

/* Çekmece sağ sütunun altına girmesin (sütun ≈ --ae-hx + 26px) */
.filo-cekmece { width: min(420px, calc(100vw - var(--ae-hx) - 34px)); }
.filo-cekmece-ac.acik { left: min(420px, calc(100vw - var(--ae-hx) - 34px)); }
@media (max-width: 640px) {
    .filo-cekmece-ac { width: 30px; height: 80px; }
    .fc-satir { grid-template-columns: 22px 1fr auto; }
    .fc-satir .fc-durum { grid-column: 2 / -1; text-align: left; font-size: 11px; margin-top: -4px; }
    .fc-ad b { font-size: 14px; }
    .fc-filtreler button { font-size: 11px; }
}

.filo-cekmece-ac { z-index: 1250; }

/* ════════ HARİTADA HAREKET (js/game/harita-hareket.js) ════════ */
.canli-otobus-kap { background: transparent !important; border: none !important; }
.canli-otobus { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.co-yon { position: relative; display: flex; align-items: center; justify-content: center; transition: transform .25s linear; filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)); }
.co-yon svg { animation: coSalinim 1.1s ease-in-out infinite; }
@keyframes coSalinim { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-0.6px); } }
.co-duman { position: absolute; left: 50%; bottom: -6px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: rgba(203, 213, 225, .55); animation: coDuman 1s ease-out infinite; pointer-events: none; }
@keyframes coDuman { from { transform: translateY(0) scale(.6); opacity: .8; } to { transform: translateY(10px) scale(1.8); opacity: 0; } }
.co-kod { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); font-size: 9px; font-weight: 800; padding: 0 4px; border-radius: 4px; background: #0f172a; color: #fff; border: 1px solid; white-space: nowrap; pointer-events: none; }
.canli-otobus--rakip .co-yon { opacity: .9; }
.canli-otobus--rakip .co-duman { width: 4px; height: 4px; margin-left: -2px; bottom: -4px; }

/* Kalan yol: sefer yönünde akan kesikli çizgi; gidilen yol: düz parlak iz */
.rota-akis { animation: rotaAkis 1.4s linear infinite; }
@keyframes rotaAkis { to { stroke-dashoffset: -22; } }
.rota-gidilen { filter: drop-shadow(0 0 3px rgba(34, 211, 238, .6)); }

.takip-btn { display: block; width: 100%; margin-top: 8px; padding: 6px; border-radius: 8px; background: #4f46e5; color: #fff; font-weight: 700; font-size: 12px; }
.takip-btn:hover { background: #6366f1; }
.takip-cipi {
    position: absolute; top: 56px; left: 50%; transform: translateX(-50%); z-index: 700;
    display: flex; align-items: center; gap: 8px; padding: 5px 8px 5px 12px; border-radius: 999px;
    background: rgba(79, 70, 229, .92); color: #fff; font-size: 12.5px; font-weight: 700; box-shadow: 0 4px 14px rgba(0,0,0,.4);
}
.takip-cipi button { width: 20px; height: 20px; border-radius: 50%; background: rgba(255,255,255,.2); font-size: 11px; }

.rakip-popup { min-width: 190px; }
.rakip-firma { font-weight: 800; font-size: 13px; }
.rakip-rota { font-weight: 700; margin: 2px 0 4px; }
.rakip-not { font-size: 11.5px; color: #64748b; }
.rakip-sefer-btn { width: 100%; margin-top: 8px; padding: 6px; border-radius: 8px; background: #16a34a; color: #fff; font-weight: 700; font-size: 12px; }


.rakip-seviye { font-size: 10px; font-weight: 700; color: #64748b; margin-left: 4px; }
.rakip-uyari { color: #b45309 !important; font-weight: 600; margin-top: 4px; }

/* ════════ MİNİ 3D HARİTA YAPILARI (js/game/harita-yapilar.js) ════════ */
.yapi3d { background: transparent !important; border: none !important; }
.yapi3d-ic { width: 100%; height: 100%; transition: transform .18s ease, filter .18s ease; transform-origin: 50% 80%; filter: drop-shadow(0 3px 3px rgba(0,0,0,.45)); }
.yapi3d-ic svg { display: block; overflow: visible; }
.yapi3d:hover .yapi3d-ic { transform: translateY(-3px) scale(1.12); filter: drop-shadow(0 6px 6px rgba(0,0,0,.5)) brightness(1.08); }
.yapi3d--otogar:not(.yapi3d--sahip) .yapi3d-ic { opacity: .82; filter: grayscale(.35) drop-shadow(0 2px 2px rgba(0,0,0,.4)); }
.yapi3d--sahip .yapi3d-ic { animation: yapiSahipNabiz 3s ease-in-out infinite; }
@keyframes yapiSahipNabiz { 0%, 100% { filter: drop-shadow(0 3px 3px rgba(0,0,0,.45)); } 50% { filter: drop-shadow(0 0 7px rgba(129, 140, 248, .9)); } }

/* ════════ AYARLAR ════════ */
.ayar-bolum h4 { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #94a3b8; margin-bottom: 8px; }
.ayar-satir { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border-radius: 12px; background: rgba(30, 41, 59, .55); border: 1px solid rgba(71, 85, 105, .45); margin-bottom: 8px; cursor: pointer; }
.ayar-satir b { display: block; font-size: 14px; color: #f1f5f9; }
.ayar-satir small { display: block; font-size: 12px; color: #94a3b8; margin-top: 2px; }
.ayar-segment { display: flex; background: rgba(2, 6, 23, .7); border-radius: 10px; padding: 3px; flex-shrink: 0; }
.ayar-segment button { padding: 7px 12px; border-radius: 8px; font-size: 13px; font-weight: 700; color: #94a3b8; }
.ayar-segment button.aktif { background: #4f46e5; color: #fff; }
.ayar-anahtar { appearance: none; -webkit-appearance: none; width: 44px; height: 24px; border-radius: 999px; background: #475569; position: relative; flex-shrink: 0; cursor: pointer; transition: background .2s; }
.ayar-anahtar::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.ayar-anahtar:checked { background: #22c55e; }
.ayar-anahtar:checked::after { transform: translateX(20px); }
.yapi-uzak .yapi3d--yakit .yapi3d-ic, .yapi-uzak .yapi3d--dinlenme .yapi3d-ic, .yapi-uzak .yapi3d--avrupa-dinlenme .yapi3d-ic { transform: scale(.55); }
.yapi-uzak .yapi3d--otogar .yapi3d-ic, .yapi-uzak .yapi3d--avrupa-terminal .yapi3d-ic { transform: scale(.75); }
.yapi-orta .yapi3d--yakit .yapi3d-ic, .yapi-orta .yapi3d--dinlenme .yapi3d-ic, .yapi-orta .yapi3d--avrupa-dinlenme .yapi3d-ic { transform: scale(.8); }
.yapi-yakin .yapi3d-ic { transform: scale(1.5); }
.yapi-cok-yakin .yapi3d-ic { transform: scale(2.1); }
.yapi-yakin .yapi3d:hover .yapi3d-ic { transform: translateY(-3px) scale(1.65); }
.yapi-cok-yakin .yapi3d:hover .yapi3d-ic { transform: translateY(-3px) scale(2.25); }
