:root {
    --tla-sky: #58c7ef;
    --tla-sky-strong: #19aee5;
    --tla-sky-soft: #eef9fd;
    --tla-black: #0d1117;
    --tla-black-2: #171c23;
    --tla-text: #161b22;
    --tla-muted: #68727d;
    --tla-line: #e7ebef;
    --tla-surface: #ffffff;
    --tla-surface-alt: #f7f9fb;
    --tla-win: #22a65a;
    --tla-draw: #d99b17;
    --tla-loss: #d94a52;
}

.tla-wrapper,
.tla-wrapper * {
    box-sizing: border-box;
}

.tla-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    overflow: hidden;
    background: var(--tla-surface);
    border: 1px solid var(--tla-line);
    border-radius: 20px;
    box-shadow: 0 18px 50px rgba(13, 17, 23, .08);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* Header premium minimal */
.tla-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 112px;
    padding: 26px 30px 26px 34px;
    color: #fff;
    background: var(--tla-black);
    border-bottom: 4px solid var(--tla-sky-strong);
}

.tla-header::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 8px;
    background: var(--tla-sky-strong);
}

.tla-header-copy {
    min-width: 0;
}

.tla-subtitulo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--tla-sky);
    font-size: 10px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 1.8px;
    text-transform: uppercase;
}

.tla-subtitulo::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--tla-sky-strong);
    box-shadow: 0 0 0 4px rgba(25,174,229,.12);
}

.tla-header h2 {
    margin: 0;
    padding: 0;
    color: #fff;
    font-size: clamp(23px, 3vw, 32px);
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: -.7px;
}

.tla-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    background: #fff;
}

.tla-tabla {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.tla-tabla th,
.tla-tabla td {
    text-align: center;
    vertical-align: middle;
}

.tla-tabla thead {
    background: var(--tla-surface-alt);
}

.tla-tabla th {
    height: 46px;
    padding: 0 8px;
    color: #7b858f;
    font-size: 10px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: .65px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--tla-line);
}

.tla-tabla th.tla-col-club {
    text-align: left;
}

.tla-tabla td {
    height: 68px;
    padding: 8px;
    color: var(--tla-text);
    font-size: 13px;
    font-weight: 600;
    border-bottom: 1px solid var(--tla-line);
    background: #fff;
}

.tla-tabla tbody tr:last-child td {
    border-bottom: 0;
}

.tla-tabla tbody tr {
    transition: background-color .18s ease, transform .18s ease;
}

.tla-tabla tbody tr:hover td {
    background: #fbfdfe;
}

/* Column widths */
.tla-col-pos { width: 7%; }
.tla-col-club { width: 35%; }
.tla-col-pj,
.tla-col-v,
.tla-col-e,
.tla-col-d,
.tla-col-g,
.tla-col-gc,
.tla-col-dg { width: 6%; }
.tla-col-pt { width: 10%; }

.tla-posicion {
    color: #6f7882 !important;
    font-size: 13px !important;
    font-weight: 800 !important;
}

.tla-equipo {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    text-align: left !important;
}

.tla-equipo img,
.tla-escudo-fallback {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    object-fit: contain;
    padding: 5px;
    background: #fff;
    border: 1px solid #edf0f2;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(13,17,23,.05);
}

.tla-equipo-data {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.tla-nombre {
    display: block;
    width: 100%;
    overflow: hidden;
    color: var(--tla-text);
    font-size: 13px;
    line-height: 1.15;
    font-weight: 800;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.tla-puntos {
    color: var(--tla-black) !important;
    font-size: 16px !important;
    font-weight: 900 !important;
}

/* Forma reciente: pequeña, limpia y ordenada */
.tla-forma {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
}

.tla-forma span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border-radius: 6px;
    color: #fff;
    font-size: 8px;
    line-height: 1;
    font-weight: 900;
}

.tla-v { background: var(--tla-win); }
.tla-e { background: var(--tla-draw); }
.tla-d { background: var(--tla-loss); }

/* Deportes Iquique: acento celeste sobrio */
.tla-tabla tbody tr.tla-iquique td {
    background: var(--tla-sky-soft);
    border-bottom-color: #d7eef8;
}

.tla-tabla tbody tr.tla-iquique td:first-child {
    box-shadow: inset 5px 0 0 var(--tla-sky-strong);
}

.tla-tabla tbody tr.tla-iquique .tla-nombre,
.tla-tabla tbody tr.tla-iquique .tla-puntos {
    color: #087da8 !important;
}

.tla-tabla tbody tr.tla-iquique .tla-equipo img {
    border-color: #bfe7f7;
    box-shadow: 0 4px 14px rgba(25,174,229,.12);
}

.tla-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 42px;
    padding: 10px 18px;
    background: var(--tla-black);
    color: #98a2ad;
    font-size: 9px;
    line-height: 1;
    letter-spacing: .25px;
}

.tla-footer a {
    margin-left: 4px;
    color: var(--tla-sky);
    font-weight: 700;
    text-decoration: none;
}

.tla-footer a:hover {
    color: #fff;
}

.tla-error {
    width: 100%;
    padding: 22px;
    background: #fff;
    border: 1px solid #f1d5d8;
    border-left: 5px solid var(--tla-loss);
    border-radius: 12px;
    color: #9f3038;
    font-size: 13px;
}

/* Tablet: conserva lectura sin scroll lateral */
@media (max-width: 900px) {
    .tla-col-g,
    .tla-col-gc {
        display: none;
    }

    .tla-col-pos { width: 7%; }
    .tla-col-club { width: 43%; }
    .tla-col-pj,
    .tla-col-v,
    .tla-col-e,
    .tla-col-d,
    .tla-col-dg { width: 8%; }
    .tla-col-pt { width: 10%; }
}

/* Mobile: jerarquía # / Club / PJ / DG / PT */
@media (max-width: 650px) {
    .tla-wrapper {
        border-radius: 14px;
        box-shadow: 0 12px 34px rgba(13, 17, 23, .07);
    }

    .tla-header {
        min-height: 92px;
        padding: 21px 18px 21px 23px;
        border-bottom-width: 3px;
    }

    .tla-header::before {
        width: 6px;
    }

    .tla-subtitulo {
        margin-bottom: 7px;
        font-size: 8px;
        letter-spacing: 1.3px;
    }

    .tla-header h2 {
        font-size: 22px;
        letter-spacing: -.4px;
    }

    .tla-col-v,
    .tla-col-e,
    .tla-col-d,
    .tla-col-g,
    .tla-col-gc {
        display: none;
    }

    .tla-col-pos { width: 9%; }
    .tla-col-club { width: 55%; }
    .tla-col-pj { width: 11%; }
    .tla-col-dg { width: 11%; }
    .tla-col-pt { width: 14%; }

    .tla-tabla th {
        height: 38px;
        padding: 0 3px;
        font-size: 8px;
    }

    .tla-tabla td {
        height: 58px;
        padding: 6px 3px;
        font-size: 11px;
    }

    .tla-posicion {
        font-size: 11px !important;
    }

    .tla-equipo {
        gap: 8px;
    }

    .tla-equipo img,
    .tla-escudo-fallback {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
        padding: 4px;
        border-radius: 10px;
    }

    .tla-equipo-data {
        gap: 0;
    }

    .tla-nombre {
        font-size: 11px;
    }

    .tla-forma {
        display: none;
    }

    .tla-puntos {
        font-size: 14px !important;
    }

    .tla-tabla tbody tr.tla-iquique td:first-child {
        box-shadow: inset 4px 0 0 var(--tla-sky-strong);
    }

    .tla-footer {
        min-height: 38px;
        padding: 9px 12px;
        font-size: 8px;
    }
}

/* Mobile pequeño: # / Club / PJ / PT */
@media (max-width: 400px) {
    .tla-col-dg {
        display: none;
    }

    .tla-col-pos { width: 10%; }
    .tla-col-club { width: 62%; }
    .tla-col-pj { width: 13%; }
    .tla-col-pt { width: 15%; }

    .tla-equipo img,
    .tla-escudo-fallback {
        width: 31px;
        height: 31px;
        flex-basis: 31px;
    }

    .tla-nombre {
        font-size: 10px;
    }
}
