/* Competiciones: capa premium (resumen, pestañas, tabla, comparador) */

/* Encabezado ---------------------------------------------------------- */
.page-head { align-items: flex-end; }
.tour-title .tour-logo { width: 46px; height: 46px; filter: drop-shadow(0 4px 8px rgba(17, 28, 22, .18)); }
.tour-title h1 { letter-spacing: -0.02em; }
.league-selector-wrapper { display: none; }

/* Resumen de la liga --------------------------------------------------- */
.tp-kpis { display: grid; grid-template-columns: 1.35fr repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.tp-kpis:empty { display: none; }
.tp-k { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 14px 16px 13px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(17, 28, 22, .04); overflow: hidden; }
.tp-k:first-child { background: linear-gradient(135deg, #0F4130, #1B6746); border-color: transparent; color: #fff; }
.tp-k__l { font: 600 10.5px/1 var(--font-data); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.tp-k:first-child .tp-k__l { color: rgba(255, 255, 255, .7); }
.tp-k__v { font-family: var(--font-display); font-size: 22px; font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tp-k:first-child .tp-k__v { color: #fff; font-size: 24px; }
.tp-k__s { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-3); }
.tp-k:first-child .tp-k__s { color: rgba(255, 255, 255, .8); }
.tp-k__s img { width: 20px; height: 20px; object-fit: contain; flex: none; }
.tp-k--ld { grid-column: 1 / -1; align-items: center; color: var(--ink-3); }
@media (max-width: 1100px) { .tp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tp-k:first-child { grid-column: 1 / -1; } }

/* Pestañas y barra ----------------------------------------------------- */
.dash-toolbar { border-bottom: 0; align-items: center; padding: 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.dash-tabs { display: inline-flex; gap: 4px; padding: 0; }
.tab-btn { height: 38px; padding: 0 18px; margin: 0; border: 0; border-radius: 11px; font-weight: 500; }
.tab-btn:hover { background: var(--surface-2); }
.tab-btn.active { background: var(--brand); color: #fff; border-bottom-color: transparent; box-shadow: 0 6px 14px rgba(27, 103, 70, .28); }
.global-filters { padding: 0 4px 0 0; }
.global-filters .select { width: 92px; height: 38px; border-radius: 10px; }
.tp-refresh { width: 38px; height: 38px; padding: 0; display: inline-grid; place-items: center; border-radius: 10px; color: var(--ink-2); }
.tp-refresh:hover { color: var(--brand); border-color: var(--brand); }

/* Clasificación -------------------------------------------------------- */
#standings-container { border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 10px 28px rgba(17, 28, 22, .06); overflow: hidden; }
.tp-tbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--surface), var(--surface-2)); }
.tp-find { position: relative; width: 240px; }
.tp-find .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--ink-3); }
.tp-find input { width: 100%; height: 36px; padding: 0 12px 0 34px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); font: 400 13px var(--font-ui); color: var(--ink); }
.tp-find input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus); }
.tp-more { height: 34px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink-2); font: 500 12.5px/1 var(--font-ui); cursor: pointer; }
.tp-more:hover { border-color: var(--brand); color: var(--brand-ink); }
.tp-note { margin-left: auto; font-size: 12px; color: var(--ink-3); max-width: 52ch; }
.standings-card, #standings-container .table-responsive { border: 0; border-radius: 0; }
.standings-table { border-collapse: separate; border-spacing: 0; }
.standings-table thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); font-size: 11px; padding: 11px 10px; text-align: center; cursor: help; }
.standings-table thead th:nth-child(2) { text-align: left; }
.standings-table td { padding: 10px 10px; text-align: center; }
.standings-table td.standings-club { text-align: left; }
.standings-table tbody tr { transition: background .12s; }
.standings-table tbody tr:nth-child(odd) td { background: rgba(236, 241, 237, .35); }
.standings-table tbody tr:hover td { background: var(--brand-tint); }
.standings-pos { width: 52px; }
.standings-table tbody tr:first-child .standings-pos { display: table-cell; color: #8F5E0F; font-weight: 700; }
.standings-table tbody tr:first-child td { background: #FBF4DC; }
.team-cell-link img { width: 28px; height: 28px; filter: drop-shadow(0 1px 2px rgba(17, 28, 22, .2)); }
.standings-table td.standings-num:nth-child(3) { font-size: 15px; }
.standings-table td.standings-num:nth-child(10) { font-weight: 600; }
.form-cell { gap: 4px; }
.form-badge { width: 20px; height: 20px; border-radius: 50%; font-size: 10px; }
.tp-hide-np th:nth-child(11), .tp-hide-np td:nth-child(11), .tp-hide-np th:nth-child(12), .tp-hide-np td:nth-child(12) { display: none; }

/* Fixture -------------------------------------------------------------- */
.tp-soon { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 460px; margin: 0 auto; text-align: center; }
.tp-soon .icon { width: 34px; height: 34px; padding: 8px; border-radius: 50%; background: var(--brand-tint); color: var(--brand); box-sizing: content-box; }
.tp-soon b { font-family: var(--font-display); font-size: 20px; font-weight: 600; color: var(--ink); }
.tp-soon span { font-size: 14px; color: var(--ink-3); line-height: 1.5; }
#view-fixture.fixture-sin-datos #fixture-container { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: 18px; padding: 24px 0; }

/* Comparador de equipos ------------------------------------------------ */
.scatter-section { border-radius: 18px; box-shadow: 0 10px 28px rgba(17, 28, 22, .06); }
.scatter-section .card__head { padding: 20px 22px 14px; border-bottom: 0; }
.scatter-section .card__title { font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.scatter-select-wrap { min-width: 190px; }
.scatter-select { height: 38px; border-radius: 10px; }
.tp-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 22px 12px; }
.tp-presets__t { margin-right: 4px; font: 600 10.5px/1 var(--font-data); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.tp-presets__sp { flex: 1; }
.tp-pre { height: 32px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font: 500 12.5px/1 var(--font-ui); cursor: pointer; transition: all .15s; }
.tp-pre:hover { border-color: var(--brand); color: var(--ink); }
.tp-pre.is-on { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 14px rgba(27, 103, 70, .25); }
.tp-sw { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.tp-sw input { width: 16px; height: 16px; accent-color: var(--brand); }
.tp-reading { margin: 0 22px 4px; padding: 10px 14px; border-radius: 12px; background: var(--brand-tint); color: var(--brand-ink); font-size: 12.5px; line-height: 1.5; }
.tp-reading[hidden] { display: none; }
.scatter-chart-wrap { height: 620px; padding: 6px 22px 22px; }
.scatter-chart-wrap canvas { height: 100% !important; }
@media (max-width: 860px) { .scatter-chart-wrap { height: 480px; padding: 6px 10px 16px; } .tp-presets, .tp-reading { padding-inline: 14px; margin-inline: 0; } .tp-note { margin-left: 0; } }

/* ===== Parte 2: fixture, tablas por tipo, líderes, cara a cara, exportar ===== */
.tp-fixture-on #fixture-container, .tp-fixture-on .fixture-filters { display: none !important; }
.tp-fixture-on.fixture-sin-datos #fixture-container { display: none !important; }
.dash-tabs { flex-wrap: wrap; }

/* Fixture */
.tp-fx__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.tp-fx__bar .select { height: 40px; width: auto; flex: 1 1 260px; max-width: 380px; border-radius: 10px; }
.tp-fx__sp { flex: 1; }
.tp-nav { width: 40px; height: 40px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink-2); font-size: 22px; line-height: 1; cursor: pointer; transition: all .15s; }
.tp-nav:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); background: var(--brand-tint); }
.tp-nav:disabled { opacity: .35; cursor: not-allowed; }
.tp-fx__sum { margin: 2px 2px 12px; font-size: 13px; color: var(--ink-3); }
.tp-day { margin: 20px 2px 10px; font: 600 11px/1.4 var(--font-data); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.tp-mcs { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 10px; }
/* Tarjeta de partido (.tp-mc, .tp-sc, .tp-hr, .tp-cr, .tp-est): css/alab-tarjeta-partido.css, compartida con el Panel. */
.tp-cr--s { width: 16px; height: 16px; vertical-align: -3px; margin-right: 5px; }
.tp-cr--xl { width: 64px; height: 64px; }

/* Tablas por tipo */
.tp-seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface-3); gap: 2px; }
.tp-seg__b { height: 30px; padding: 0 13px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); font: 500 12.5px/1 var(--font-ui); cursor: pointer; }
.tp-seg__b.is-on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(17, 28, 22, .14); font-weight: 600; }
.tp-more[hidden] { display: none; }
#tpAlt[hidden] { display: none; }
.tp-alt__c { margin: 0; padding: 12px 20px; font-size: 12.5px; color: var(--ink-3); background: var(--surface-2); }
.tp-alt tbody td { text-align: center; }
.tp-alt td.standings-club { text-align: left; }
.tp-stamp { display: flex; align-items: center; gap: 12px; padding: 14px 20px; background: #0F2D22; color: #fff; }
.tp-stamp img { width: 30px; height: 30px; }
.tp-stamp b { display: block; font-family: var(--font-display); font-size: 17px; font-weight: 600; }
.tp-stamp span { font-size: 11.5px; opacity: .75; }

/* Líderes */
.tp-lead { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.tp-board { border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(17, 28, 22, .05); overflow: hidden; }
.tp-board header { padding: 16px 18px 10px; }
.tp-board h3 { margin: 0; font-family: var(--font-display); font-size: 19px; font-weight: 600; }
.tp-board header span { font-size: 12px; color: var(--ink-3); }
.tp-board ol { list-style: none; margin: 0; padding: 4px 8px 10px; }
.tp-board li a { display: grid; grid-template-columns: 24px 38px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 11px; text-decoration: none; color: var(--ink); transition: background .15s; }
.tp-board li a:hover { background: var(--brand-tint); }
.tp-rk { font: 600 12px/1 var(--font-data); font-style: normal; color: var(--ink-3); text-align: center; }
.tp-rk--top { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: #fff; }
.tp-ph { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: var(--surface-3); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.tp-board li b { display: block; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-board li span { font-size: 11.5px; color: var(--ink-3); }
.tp-board li em { font: 600 17px/1 var(--font-data); font-style: normal; color: var(--ink); text-align: right; }
.tp-board li em small { display: block; margin-top: 2px; font: 400 10px var(--font-ui); color: var(--ink-3); }

/* Cara a cara */
.tp-h2h { max-width: 980px; margin: 0 auto; }
.tp-h2h__sel { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.tp-h2h__sel .select { width: 100%; height: 42px; border-radius: 10px; }
.tp-h2h__head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 22px 18px; border-radius: 20px; background: linear-gradient(135deg, #0F4130, #1B6746); color: #fff; }
.tp-h2h__t { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.tp-h2h__t .tp-cr { filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .3)); }
.tp-h2h__t b { font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.tp-h2h__t span { font-size: 12.5px; opacity: .8; }
.tp-h2h__t .form-cell { margin-top: 4px; }
.tp-h2h__vs { font: 600 14px/1 var(--font-data); letter-spacing: .12em; opacity: .65; }
.tp-hrs { margin-top: 16px; padding: 8px 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.tp-hrow { display: grid; grid-template-columns: 74px minmax(0, 1fr) 74px; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.tp-hrow:last-child { border-bottom: 0; }
.tp-hrow > b { font: 600 15px/1 var(--font-data); color: var(--ink-2); }
.tp-hrow > b:last-child { text-align: right; }
.tp-hrow > b.is-best { color: var(--brand); }
.tp-hrow__c { text-align: center; }
.tp-hrow__c span { display: block; margin-bottom: 6px; font-size: 12.5px; color: var(--ink-2); }
.tp-hrow__c small { color: var(--ink-3); }
.tp-hrow__bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; gap: 2px; background: var(--surface-3); }
.tp-hrow__bar i { display: block; background: #A9B8AF; }
.tp-hrow__bar i.r { background: #A9B8AF; }
.tp-hrow__bar i.is-best { background: var(--brand); }
.tp-h2h__none { padding: 14px; border-radius: 12px; background: var(--surface-2); color: var(--ink-3); font-size: 13px; }
.tp-h2h__f { margin-top: 16px; font-size: 11.5px; color: var(--ink-3); text-align: center; }
@media (max-width: 860px) { .tp-mcs { grid-template-columns: 1fr; } .tp-fx__bar .select { min-width: 0; flex: 1; } .tp-lead { grid-template-columns: 1fr; } .tp-h2h__sel { grid-template-columns: 1fr; } .tp-h2h__head { padding: 16px 8px; } .tp-hrow { grid-template-columns: 58px minmax(0, 1fr) 58px; } }

.tp-cr--s { display: inline-block; }
