/* =========================================================
   TELEGOLE — Puan durumu
   Renkler style.css'teki :root değişkenlerinden gelir.
   ========================================================= */

.pd {
    margin-top: 12px;
    border-radius: var(--r-lg);
    background: linear-gradient(180deg, var(--panel), rgba(8, 14, 12, .92));
    border: 1px solid var(--line);
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow);
    /* overflow: hidden yok — açılır lig listesi bölümün dışına taşabilmeli */
}

/* ---- başlık + lig sekmeleri ---- */
.pd__head {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
}

.pd__title {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1.4px;
    color: var(--gold-2);
}

/* ---- lig seçici (mevcut lig + açılır liste) ---- */
.pd__picker { position: relative; margin-left: auto; }

.pd__current {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    padding: 0 12px;
    border-radius: 99px;
    border: 1px solid var(--line-2);
    background: var(--panel-2);
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .4px;
    white-space: nowrap;
    transition: border-color .15s, background .15s, color .15s;
}
.pd__current:hover { border-color: var(--gold); color: var(--gold-2); }
.pd__current[aria-expanded="true"] {
    background: var(--gold-dim);
    border-color: var(--gold);
    color: var(--gold-2);
}

.pd__caret { width: 14px; height: 14px; flex: none; opacity: .7; transition: transform .16s; }
.pd__current[aria-expanded="true"] .pd__caret { transform: rotate(180deg); }

.pd__cur-flag,
.pd__opt-flag { display: inline-flex; flex: none; }
.pd__flag {
    width: 18px;
    height: 13px;
    flex: none;
    object-fit: cover;          /* API bayrağı <img> olarak gelir */
    border-radius: 3px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2);
}
.pd__flag svg { width: 100%; height: 100%; display: block; }

/* ---- açılır liste ---- */
.pd__menu {
    position: absolute;
    z-index: 30;
    top: calc(100% + 6px);
    right: 0;
    min-width: 190px;
    max-height: 280px;
    overflow-y: auto;
    padding: 5px;
    border-radius: var(--r);
    background: var(--panel-3);
    border: 1px solid var(--line-2);
    box-shadow: 0 16px 36px rgba(0, 0, 0, .55);
}
.pd__menu[hidden] { display: none; }

.pd__opt {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 9px 11px;
    border-radius: var(--r-sm);
    color: var(--text-2);
    font-size: 12.5px;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
    transition: background .13s, color .13s;
}
.pd__opt:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.pd__opt.is-on { background: var(--gold-dim); color: var(--gold-2); }

.pd__panel[hidden] { display: none; }

/* ---- tablo ---- */
.pd__scroll { overflow-x: auto; }

.pd__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    white-space: nowrap;
}

.pd__table th {
    padding: 9px 8px;
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-3);
    background: var(--panel-2);
    border-bottom: 1px solid var(--line);
}

.pd__table td {
    padding: 8px;
    text-align: center;
    border-bottom: 1px solid var(--line);
    color: var(--text-2);
}
.pd__table tbody tr:last-child td { border-bottom: 0; }
.pd__table tbody tr:hover td { background: rgba(255, 255, 255, .03); }

.pd-c-rank { width: 44px; }
.pd-c-team { text-align: left !important; min-width: 168px; }
.pd-c-pts  { width: 46px; }
.pd-c-form { width: 118px; }

/* sıra rozeti */
.pd__rank {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: var(--panel-3);
    color: var(--text-2);
    font-size: 11px;
    font-weight: 700;
}

/* takım */
.pd__team { display: flex; align-items: center; gap: 9px; min-width: 0; max-width: 100%; }

.pd__logo { width: 21px; height: 21px; flex: none; object-fit: contain; }

.pd__name {
    color: var(--text);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pd__gd { font-variant-numeric: tabular-nums; }
.pd-c-pts b { color: var(--gold-2); font-size: 13.5px; font-weight: 800; }

/* ---- bölge renkleri (API açıklamasından) ---- */
.pd__table tbody tr.is-ucl  .pd__rank { background: rgba(47, 130, 220, .22); color: #8ec2ff; box-shadow: inset 0 0 0 1px rgba(47,130,220,.5); }
.pd__table tbody tr.is-uel  .pd__rank { background: rgba(120, 90, 220, .2);  color: #b4a4ff; box-shadow: inset 0 0 0 1px rgba(120,90,220,.45); }
.pd__table tbody tr.is-uecl .pd__rank { background: rgba(46, 180, 110, .18); color: #85e0ae; box-shadow: inset 0 0 0 1px rgba(46,180,110,.45); }
.pd__table tbody tr.is-down .pd__rank { background: rgba(224, 36, 46, .18);  color: #ff9095; box-shadow: inset 0 0 0 1px rgba(224,36,46,.45); }

/* ---- son 5 maç ---- */
.pd__form { display: inline-flex; gap: 3px; }

.pd__f {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    font-size: 9.5px;
    font-weight: 800;
    font-style: normal;
    line-height: 1;
}
.pd__f--w { background: rgba(46, 180, 110, .2);  color: #7fe0a8; }
.pd__f--d { background: rgba(255, 255, 255, .1); color: var(--text-3); }
.pd__f--l { background: rgba(224, 36, 46, .18);  color: #ff9095; }

/* ---- alt bilgi / boş durum ---- */
.pd__foot {
    padding: 8px 16px 10px;
    color: var(--text-3);
    font-size: 11px;
}

.pd__empty {
    padding: 28px 18px;
    text-align: center;
    color: var(--text-3);
    font-size: 12.5px;
}


/* =========================================================
   DUYARLI — dar ekranda sütunlar sırayla kalkar
   ========================================================= */
@media (max-width: 760px) {
    .pd-c-goal { display: none; }          /* A / Y */
    .pd-c-team { min-width: 140px; }
}

@media (max-width: 560px) {
    .pd__head { padding: 10px 12px; gap: 10px; }
    .pd__title { font-size: 12px; }
    .pd__picker { margin-left: auto; }
    .pd__current { height: 30px; font-size: 11.5px; padding: 0 10px; }

    .pd-c-wdl { display: none; }           /* G / B / M */
    .pd__table { font-size: 12px; }
    .pd__table th, .pd__table td { padding: 7px 5px; }
    .pd-c-form { width: 96px; }
    .pd__f { width: 16px; height: 16px; font-size: 9px; }
    .pd__name { font-size: 12px; }
}

@media (max-width: 400px) {
    .pd-c-form { display: none; }          /* son 5 de kalkar */
    .pd-c-team { min-width: 120px; }
}


/* =========================================================
   İKİ SÜTUN: PUAN DURUMU + GOL KRALLIĞI
   Tablo tek başına 1272px'e yayılınca takım adıyla sayılar
   arasında büyük bir boşluk kalıyordu. Yan panel hem o
   boşluğu kapatıyor hem tabloyu kompakt gösteriyor.
   ========================================================= */
.pd__cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;      /* kısa panel tabloya kadar uzamasın */
    gap: 14px;
}
.pd__cols--tek { grid-template-columns: minmax(0, 1fr); }
.pd__main { min-width: 0; }


/* ---- gol krallığı ---- */
.ts {
    border-radius: var(--r-sm, 6px);
    border: 1px solid var(--line);
    background: var(--panel-2);
    overflow: hidden;
}

.ts__title {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--line);
    color: var(--gold-2);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.2px;
}
.ts__ico { width: 15px; height: 15px; flex: none; opacity: .9; }

.ts__list { list-style: none; margin: 0; padding: 0; }

.ts__row {
    display: grid;
    grid-template-columns: 20px 18px minmax(0, 1fr) 30px;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-bottom: 1px solid var(--line);
}
.ts__row:last-child { border-bottom: 0; }
.ts__row:hover { background: rgba(255, 255, 255, .03); }

.ts__place {
    color: var(--text-3);
    font-size: 10.5px;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
/* İlk üç sırayı altınla ayır — tablodaki sıra rozetiyle aynı dil. */
.ts__row:nth-child(-n+3) .ts__place { color: var(--gold-2); }

.ts__logo { width: 19px; height: 19px; flex: none; object-fit: contain; }

.ts__who { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.ts__name {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ts__team {
    font-size: 9.5px;
    color: var(--text-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ts__goals {
    color: var(--gold-2);
    font-size: 13px;
    font-weight: 800;
    text-align: right;
    font-variant-numeric: tabular-nums;
}


@media (max-width: 1040px) {
    /* Yan panel alta iner, listeyi yatayda ikiye böl. */
    .pd__cols { grid-template-columns: minmax(0, 1fr); }
    .ts__list { display: grid; grid-template-columns: 1fr 1fr; }
    .ts__row:nth-child(odd) { border-right: 1px solid var(--line); }
}

@media (max-width: 620px) {
    .ts__list { grid-template-columns: 1fr; }
    .ts__row:nth-child(odd) { border-right: 0; }
}


/* Geniş ekranda tablo sabit düzene geçer: artan alan tek başına
   takım sütununa yığılıp adla sayılar arasında boşluk bırakmasın,
   sayı sütunları arasında eşit paylaşılsın. Dar ekranda otomatik
   düzen sürer — orada sütunlar zaten sırayla kalkıyor. */
@media (min-width: 761px) {
    .pd__table { table-layout: fixed; }
    .pd-c-team { width: 24%; }
    .pd-c-pts  { width: 52px; }
    .pd-c-form { width: 124px; }
}


/* Favori takımın satırı — puan durumunda gözden kaçmasın. */
.pd__table tbody tr.is-fav td {
    background: linear-gradient(90deg, var(--gold-dim), transparent 60%);
    box-shadow: inset 0 0 0 0 transparent;
}
.pd__table tbody tr.is-fav td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.pd__table tbody tr.is-fav .pd__name { color: var(--gold-2); font-weight: 700; }
