/* ============================================================
   TdB Home Widget — home-widget.css
   Paleta alineada con los plugins NBA / WNBA / ACB / Euroliga
   ============================================================ */

/* Variables de rating — idénticas a los plugins individuales */
:root {
    --tdb-legendary : #7B3FF2;
    --tdb-elite     : #00D084;
    --tdb-verygood  : #FFB800;
    --tdb-good      : #FF6B35;
    --tdb-needswork : #EF476F;
}

/* ── Contenedor ── */
.tdb-hw {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 680px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* ── Pestañas ── */
.tdb-hw__tabs {
    display: flex;
    gap: 4px;
}

.tdb-hw__tab {
    flex: 1;
    padding: 9px 6px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    transition: background 0.15s, color 0.15s;
    line-height: 1.3;
}

.tdb-hw__tab:hover {
    background: #ebebeb;
    color: #333;
}

.tdb-hw__tab.is-active {
    background: #fff;
    color: #111;
    border-color: #ccc;
    border-bottom-color: #fff;
    position: relative;
    z-index: 1;
}

.tdb-hw__tab-emoji {
    display: block;
    font-size: 18px;
    line-height: 1.2;
    margin-bottom: 2px;
}

/* ── Panel / card ── */
.tdb-hw__pane {
    display: none;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 0 0 12px 12px;
    padding: 16px 18px 12px;
}

.tdb-hw__pane.is-active {
    display: block;
}

/* ── Encabezado de temporada ── */
.tdb-hw__season {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #999;
    margin: 0 0 12px;
}

/* ── Lista de jugadores ── */
.tdb-hw__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tdb-hw__player {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid #f0f0f0;
}

.tdb-hw__player:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* ── Número de ranking ── */
.tdb-hw__rank {
    font-size: 11px;
    font-weight: 600;
    color: #bbb;
    min-width: 18px;
    text-align: center;
}

/* Top 3 — número más destacado */
.tdb-hw__player:nth-child(1) .tdb-hw__rank { color: #C9AA00; }
.tdb-hw__player:nth-child(2) .tdb-hw__rank { color: #909090; }
.tdb-hw__player:nth-child(3) .tdb-hw__rank { color: #A0674A; }

/* ── Info jugador ── */
.tdb-hw__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tdb-hw__name {
    font-size: 14px;
    font-weight: 600;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tdb-hw__team {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Rating ── */
.tdb-hw__rating {
    font-size: 20px;
    font-weight: 700;
    min-width: 48px;
    text-align: right;
    letter-spacing: -0.5px;
    flex-shrink: 0;
}

.tdb-hw__rating.tdb-legendary { color: var(--tdb-legendary); }
.tdb-hw__rating.tdb-elite     { color: var(--tdb-elite);     }
.tdb-hw__rating.tdb-verygood  { color: var(--tdb-verygood);  }
.tdb-hw__rating.tdb-good      { color: var(--tdb-good);      }
.tdb-hw__rating.tdb-needswork { color: var(--tdb-needswork); }

/* ── Footer / enlace ── */
.tdb-hw__footer {
    margin-top: 14px;
    text-align: right;
}

.tdb-hw__link {
    font-size: 12px;
    font-weight: 500;
    color: #555;
    text-decoration: none;
    transition: color 0.15s;
}

.tdb-hw__link:hover {
    color: #111;
    text-decoration: underline;
}

/* ── Foto del jugador ── */
.tdb-hw__photo {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f0f0f0;
    position: relative;
    border: 2px solid #ff6a00; /* naranja, ajusta el tono exacto */
}

.tdb-hw__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

.tdb-hw__initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #999;
    background: #f0f0f0;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

/* Cuando hay fotos el rank ocupa menos espacio */
.tdb-hw--photos .tdb-hw__rank {
    min-width: 14px;
}

/* ── Estado vacío ── */
.tdb-hw__empty {
    font-size: 13px;
    color: #aaa;
    text-align: center;
    padding: 24px 0;
    margin: 0;
}

/* ── Responsive: pantallas pequeñas ── */
@media ( max-width: 480px ) {
    .tdb-hw__tab {
        font-size: 11px;
        padding: 7px 4px;
    }
    .tdb-hw__tab-emoji {
        font-size: 16px;
    }
    .tdb-hw__name {
        font-size: 13px;
    }
    .tdb-hw__rating {
        font-size: 17px;
    }
}

/* ── Modo oscuro ── */
@media ( prefers-color-scheme: dark ) {
    .tdb-hw__tab {
        background: #1e1e1e;
        color: #888;
        border-color: #333;
    }
    .tdb-hw__tab:hover {
        background: #2a2a2a;
        color: #ccc;
    }
    .tdb-hw__tab.is-active {
        background: #2c2c2c;
        color: #eee;
        border-color: #444;
        border-bottom-color: #2c2c2c;
    }
    .tdb-hw__pane {
        background: #2c2c2c;
        border-color: #444;
    }
    .tdb-hw__season { color: #666; }
    .tdb-hw__player { border-bottom-color: #3a3a3a; }
    .tdb-hw__name   { color: #eee; }
    .tdb-hw__team   { color: #777; }
    .tdb-hw__link   { color: #aaa; }
    .tdb-hw__link:hover { color: #eee; }
    .tdb-hw__photo { background: #2a2a2a; }
    .tdb-hw__initials { background: #2a2a2a; color: #666; }
}
