:root {
    --ucl-blue: #f8971d;  /* Europa League Turuncusu */
    --ucl-dark: #121212;  /* Derin Siyah/Gri (Arka plan) */
    --ucl-gold: #ffffff;
    --win: #22c55e;
    --loss: #ef4444;
    --draw: #eab308;
}

body {
    margin: 0;
    padding: 0;
    background: var(--ucl-dark);
    font-family: 'Montserrat', sans-serif;
    color: white;
    overflow: hidden;
}

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #05070a;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s ease, visibility 0.8s;
}

.main-loader {
    width: 80px;
    height: 80px;
    border: 6px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top: 6px solid var(--ucl-blue); 
    border-right: 6px solid rgba(0, 51, 153, 0.3);
    border-bottom: 6px solid var(--ucl-blue);
    animation: main-spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

@keyframes main-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-hidden {
    opacity: 0;
    visibility: hidden;
}

#map {
    height: 100vh;
    width: 100%;
    background: var(--ucl-dark);
}

.ucl-navbar {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 1);
    padding: 8px 15px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.ucl-logo-img {
    width: 45px;
    height: 45px;
    object-fit: contain;
    margin-right: 15px;
}

.ucl-nav-text {
    color: var(--ucl-dark);
}

.ucl-nav-text h1 {
    margin: 0;
    font-size: 16px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
}

.uefa-footer-logo {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    width: 70px;
    opacity: 0.9;
    pointer-events: none;
}

.ismail-credit {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    font-size: 11px;
    color: #fff;
    text-decoration: none;
    background: var(--ucl-blue);
    padding: 8px 18px;
    border-radius: 25px;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: 0.3s;
}

.ismail-credit:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.ucl-card {
    width: 300px !important;
    color: #fff;
    overflow: hidden;
    border-radius: 12px;
    background: #1a1a1a;
    border: 1px solid #333;
}

.card-header {
    position: relative;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #000;
}

.bg-flag {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(15px) brightness(0.4);
    transform: scale(1.4);
    z-index: 1;
}

.team-logo-card {
    position: relative;
    z-index: 2;
    width: 65px;
    height: 65px;
    object-fit: contain;
}

.card-body {
    padding: 15px;
    text-align: center;
}

.team-name {
    font-size: 18px;
    font-weight: 900;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.team-meta {
    font-size: 9px;
    color: #94a3b8;
    margin: 8px 0 15px;
    display: flex;
    justify-content: center;
    gap: 6px;
    font-weight: 600;
}

.match-list {
    max-height: 180px;
    overflow-y: auto;
    text-align: left;
}

.match-row {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 5px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: 0.2s;
}

.match-row:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(3px);
}

.res-badge {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 10px;
    margin-right: 12px;
    flex-shrink: 0;
}

.w {
    background: var(--win);
    color: white;
}

.l {
    background: var(--loss);
    color: white;
}

.d {
    background: var(--draw);
    color: #000;
}

.m-score {
    color: var(--ucl-gold);
    font-weight: bold;
    margin-left: auto;
}

.custom-team-marker {
    display: flex;
    align-items: center;
    justify-content: center;
}

.marker-logo-only {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.marker-logo-only img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    z-index: 2;
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.5));
}

.marker-logo-only::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid var(--ucl-blue);
    border-radius: 50%;
    z-index: 1;
    animation: ucl-ring-pulse 1.5s infinite ease-out;
    box-shadow: 0 0 15px var(--ucl-blue), inset 0 0 10px var(--ucl-blue);
}

@keyframes ucl-ring-pulse {
    0% {
        transform: scale(0.7);
        opacity: 1;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
    background-color: rgba(248, 151, 29, 0.4);
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
    background-color: var(--ucl-blue);
    color: white;
    font-family: 'Montserrat';
    font-weight: 900;
}

.marker-cluster div::after {
    display: none !important;
}

.marker-cluster {
    background-clip: padding-box;
    border-radius: 20px;
    animation: none !important;
}

.leaflet-popup-content-wrapper {
    background: none;
    box-shadow: none;
    padding: 0;
}

.leaflet-popup-content {
    margin: 0 !important;
    width: 300px !important;
}

.leaflet-popup-tip {
    background: #1a1a1a;
}

.uefa-logo-link {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 1001;
    cursor: pointer;
    display: inline-block;
}

.uefa-footer-logo {
    position: relative;
    bottom: 0;
    left: 0;
    width: 70px;
    opacity: 0.9;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.uefa-footer-logo:hover {
    transform: scale(1.1);
    opacity: 1;
}

.tournament-switcher {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%); /* Ortalar */
    display: flex;
    gap: 15px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    padding: 10px 20px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1001;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.switch-btn {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid transparent;
}

.switch-btn img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.switch-btn:hover {
    transform: scale(1.2) translateY(-5px);
    background: #fff;
}

/* Aktif olan turnuvaya göre parlama rengi */
.switch-btn.ucl:hover { box-shadow: 0 0 15px #003399; border-color: #003399; }
.switch-btn.uel:hover { box-shadow: 0 0 15px #f8971d; border-color: #f8971d; }
.switch-btn.uecl:hover { box-shadow: 0 0 15px #00ff00; border-color: #00ff00; }

/* --- MOBİL RESPONSIVE DÜZENLEMELER (768px ve Altı) --- */
@media (max-width: 768px) {
    
    /* 1. Navbar'ı Üst Ortaya Al ve Küçült */
    .ucl-navbar {
        top: 10px;
        left: 50% !important;
        transform: translateX(-50%); /* Tam ortalar */
        width: auto;
        min-width: 200px;
        justify-content: center;
        padding: 5px 12px;
        white-space: nowrap; /* Yazının taşmasını engeller */
    }

    .ucl-logo-img {
        width: 30px;
        height: 30px;
        margin-right: 8px;
    }

    .ucl-nav-text h1 {
        font-size: 14px;
        letter-spacing: 1px;
    }

    /* 2. Sol Alttaki UEFA Logosunu Gizle */
    .uefa-logo-link {
        display: none !important;
    }

    /* 3. Sağ Alttaki Credit (İsmail Öksüz) Yazısını Gizle */
    .ismail-credit {
        display: none !important;
    }

    /* 4. Takım Popup Kartını Mobil İçin Optimize Et */
    .leaflet-popup-content {
        width: 260px !important;
        margin: 0 !important;
    }

    .ucl-card {
        max-height: 380px; /* Küçük ekranlarda kart çok uzamasın */
        overflow-y: auto;
    }

    /* 5. Alt Menü (Tournament Switcher) Hizalaması */
    .tournament-switcher {
        bottom: 15px;
        gap: 10px;
        padding: 8px 12px;
    }

    .switch-btn {
        width: 38px;
        height: 38px;
    }

    body.popup-open .ucl-navbar {
        transform: translate(-50%, -150%); /* Ortalanmış hali koruyarak yukarı gizler */
        opacity: 0;
        pointer-events: none;
    }
    
    .ucl-navbar {
        transition: transform 0.3s ease, opacity 0.3s ease; /* Yumuşak geçiş efekti */
    }
}

/* Çok küçük ekranlar için yazı iptali */
@media (max-width: 480px) {
    .ucl-nav-text h1 {
        font-size: 12px;
    }
    
    .ucl-navbar {
        min-width: 150px;
    }
}

.marker-logo-only.eliminated img {
    filter: grayscale(100%) brightness(0.6);
    opacity: 0.8;
}

.marker-logo-only.eliminated::after {
    animation: none !important; 
    display: none !important;  
}

.marker-logo-only.eliminated {
    border: none !important;
}


.marker-cluster-small.cluster-eliminated,
.marker-cluster-medium.cluster-eliminated,
.marker-cluster-large.cluster-eliminated {
    background-color: rgba(100, 100, 100, 0.2) !important;
}

/* Hepsi elenmiş kümenin iç dairesini renksiz/gri yap */
.marker-cluster-small.cluster-eliminated div,
.marker-cluster-medium.cluster-eliminated div,
.marker-cluster-large.cluster-eliminated div {
    background-color: #444 !important;
    color: #888 !important;
    box-shadow: none !important;
}

/* Küme elenmişse herhangi bir parlama efektini kapat */
.cluster-eliminated {
    filter: grayscale(1);
    opacity: 0.7;
}