/**
 * Player Page v2.11 — TST Design System v5
 * Tokens: brand #305180 · brand-dark #1E3A5F · lime #E1FA59 · lime-dark #B8CC30
 * gold #F5B021 · live #E63946 · wta #6A4C93 · win #2A9D8F
 * Fonts: DM Sans (headline/UI) · Lora (body) · DM Mono (datos)
 */

/* ════════════════════════════════════════════════════════════
   0 — TOKEN LAYER (hereda del child theme; re-declarados aquí
       por si el plugin carga en contextos sin :root global)
   ════════════════════════════════════════════════════════════ */
:root {
    --tst-brand:          #305180;
    --tst-brand-dark:     #1E3A5F;
    --tst-brand-mid:      #254368;
    --tst-brand-light:    #D6E3F0;
    --tst-lime:           #E1FA59;
    --tst-lime-dark:      #B8CC30;
    --tst-gold:           #F5B021;
    --tst-gold-dark:      #C8890F;
    --tst-live:           #E63946;
    --tst-wta:            #6A4C93;
    --tst-win:            #2A9D8F;
    --tst-white:          #FFFFFF;
    --tst-off-white:      #F7F6F2;
    --tst-paper:          #EFEFEA;
    --tst-ink-100:        #1A1A1A;
    --tst-ink-60:         #5C5C5C;
    --tst-ink-30:         #A8A8A8;
    --tst-ink-10:         #E4E3DC;
    --tst-font-headline:  "DM Sans", "Helvetica Neue", Arial, sans-serif;
    --tst-font-body:      "Lora", Georgia, serif;
    --tst-font-mono:      "DM Mono", "Courier New", monospace;
    --tst-fs-2xl:         clamp(2.25rem, 1.9rem + 1.8vw, 3.00rem);
    --tst-fs-xl:          clamp(1.75rem, 1.5rem + 1.3vw, 2.25rem);
    --tst-fs-lg:          clamp(1.375rem, 1.2rem + 0.9vw, 1.75rem);
    --tst-fs-md:          clamp(1.125rem, 1.05rem + 0.4vw, 1.25rem);
    --tst-fs-base:        clamp(1.00rem, 0.95rem + 0.25vw, 1.0625rem);
    --tst-fs-sm:          clamp(0.80rem, 0.75rem + 0.25vw, 0.875rem);
    --tst-fs-xs:          clamp(0.70rem, 0.65rem + 0.2vw, 0.75rem);
    --tst-gap-xs:         4px;
    --tst-gap-sm:         8px;
    --tst-gap-md:         16px;
    --tst-gap-lg:         24px;
    --tst-gap-xl:         40px;
    --tst-gap-2xl:        64px;
    --tst-radius-sm:      4px;
    --tst-radius-md:      8px;
    --tst-radius-lg:      12px;
    --tst-card-shadow:    0 1px 3px rgba(0,0,0,.07), 0 4px 12px rgba(0,0,0,.06);
    --tst-card-shadow-hover: 0 4px 8px rgba(0,0,0,.09), 0 12px 28px rgba(0,0,0,.10);
    --tst-transition:     150ms ease;
    --tst-transition-slow: 350ms ease;
    --tst-focus-color:    #F5B021;
    --tst-focus-width:    2px;
    --tst-focus-offset:   3px;
}

/* ════════════════════════════════════════════════════════════
   1 — RESET & BASE
   ════════════════════════════════════════════════════════════ */
.tst-player-page *,
.tst-player-page *::before,
.tst-player-page *::after { box-sizing: border-box; }

.tst-player-page {
    font-family: var(--tst-font-headline);
    background: var(--tst-off-white);
    min-height: 100vh;
    color: var(--tst-ink-100);
}

/* Focus visible */
.tst-player-page *:focus-visible {
    outline: var(--tst-focus-width) solid var(--tst-focus-color);
    outline-offset: var(--tst-focus-offset);
    border-radius: var(--tst-radius-sm);
}
.tst-player-page *:focus:not(:focus-visible) { outline: none; }

/* Screen reader only */
.tst-sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800;900&family=DM+Mono:wght@400;500;700&family=Lora:ital,wght@0,400;0,700;1,400&display=swap');

/* ════════════════════════════════════════════════════════════
   2 — HEADER DEL JUGADOR
   ════════════════════════════════════════════════════════════ */
.tst-player-header {
    background: var(--tst-brand-dark);
    color: var(--tst-white);
    padding: 40px var(--tst-gap-lg) 32px;
    position: relative;
    overflow: hidden;
}

/* Brillo sutil de fondo */
.tst-player-header::before {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 380px; height: 380px;
    background: radial-gradient(circle, rgba(225,250,89,.08) 0%, transparent 68%);
    pointer-events: none;
}
.tst-player-header::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--tst-lime-dark), transparent);
}

.tst-player-header-content {
    max-width: 1280px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.tst-player-photo-section {
    display: flex;
    align-items: center;
    gap: var(--tst-gap-lg);
}

/* Foto */
.tst-player-photo {
    width: 108px;
    height: 108px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,.25);
    box-shadow: 0 6px 24px rgba(0,0,0,.35);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--tst-brand-mid);
}
.tst-player-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tst-player-photo-initials {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 36px; font-weight: 800;
    color: var(--tst-lime);
}

.tst-player-title-section { flex: 1; min-width: 0; }

/* Meta row (país + badges) */
.tst-player-header-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--tst-gap-sm);
    margin-bottom: 10px;
}
.tst-player-country-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(255,255,255,.14);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    font-size: var(--tst-fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.tst-player-country-flag { font-size: 16px; }

/* Nombre */
.tst-player-name {
    font-size: var(--tst-fs-xl);
    font-weight: 900;
    line-height: 1.05;
    margin: 0 0 var(--tst-gap-md);
    letter-spacing: -.5px;
    word-break: break-word;
}
.tst-player-name-first { color: var(--tst-lime); }
.tst-player-name-last  { color: var(--tst-white); }

/* Rankings row */
.tst-player-rankings {
    display: flex;
    flex-wrap: wrap;
    gap: var(--tst-gap-md);
    align-items: flex-end;
}
.tst-ranking-badge { text-align: center; }
.tst-ranking-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    opacity: .75;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: .6px;
}
.tst-ranking-value {
    display: block;
    font-family: var(--tst-font-mono);
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.tst-ranking-value--official { color: var(--tst-white); }
.tst-ranking-value--best     { color: var(--tst-lime); }
.tst-ranking-value--points   { color: rgba(255,255,255,.8); font-size: 22px; }
.tst-ranking-year {
    display: inline-block;
    font-family: var(--tst-font-headline);
    font-size: 10px;
    font-weight: 500;
    opacity: .65;
    margin-left: 3px;
    vertical-align: super;
}

/* ════════════════════════════════════════════════════════════
   3 — BADGES
   ════════════════════════════════════════════════════════════ */
.tst-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--tst-radius-sm);
    font-family: var(--tst-font-headline);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: var(--tst-white);
    line-height: 1;
}
.tst-badge--tour    { /* color set inline per tour */ }
.tst-badge--retired { background: var(--tst-ink-60); }
.tst-badge--wiki    { background: var(--tst-brand-light); color: var(--tst-brand-dark); font-size:10px; }

/* ════════════════════════════════════════════════════════════
   4 — NAVIGATION TABS
   ════════════════════════════════════════════════════════════ */
.tst-player-tabs {
    background: var(--tst-white);
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--tst-ink-10);
}
.tst-player-tabs-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 var(--tst-gap-sm);
}
.tst-player-tabs-inner::-webkit-scrollbar { display: none; }

.tst-tab-button {
    flex: 1;
    min-width: 110px;
    padding: 18px var(--tst-gap-md);
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-family: var(--tst-font-headline);
    font-size: var(--tst-fs-sm);
    font-weight: 700;
    color: var(--tst-ink-60);
    cursor: pointer;
    transition: color var(--tst-transition), border-color var(--tst-transition);
    white-space: nowrap;
    letter-spacing: .3px;
}
.tst-tab-button:hover      { color: var(--tst-brand); }
.tst-tab-button.active     { color: var(--tst-brand-dark); border-bottom-color: var(--tst-lime-dark); }

/* ════════════════════════════════════════════════════════════
   5 — TAB CONTENT CONTAINER
   ════════════════════════════════════════════════════════════ */
.tst-player-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: var(--tst-gap-xl) var(--tst-gap-lg);
}
.tst-tab-pane { display: none; }
.tst-tab-pane.active { display: block; }

/* ════════════════════════════════════════════════════════════
   6 — CARD
   ════════════════════════════════════════════════════════════ */
.tst-card {
    background: var(--tst-white);
    border-radius: var(--tst-radius-lg);
    padding: var(--tst-gap-lg);
    box-shadow: var(--tst-card-shadow);
    border: 1px solid var(--tst-ink-10);
}

/* ════════════════════════════════════════════════════════════
   7 — SECTION HEADER (dentro de card y standalone)
   ════════════════════════════════════════════════════════════ */
.tst-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--tst-gap-sm);
    margin-bottom: var(--tst-gap-md);
    padding-bottom: var(--tst-gap-sm);
    border-bottom: 2px solid var(--tst-lime-dark);
}
.tst-section-header h3 {
    font-family: var(--tst-font-headline);
    font-size: var(--tst-fs-sm);
    font-weight: 800;
    color: var(--tst-brand-dark);
    text-transform: uppercase;
    letter-spacing: .8px;
    margin: 0;
}
.tst-section-header__meta {
    font-size: var(--tst-fs-xs);
    color: var(--tst-ink-60);
    font-weight: 500;
}
.tst-section-header__link {
    font-size: var(--tst-fs-xs);
    font-weight: 700;
    color: var(--tst-gold);
    text-decoration: none;
    transition: color var(--tst-transition);
    white-space: nowrap;
}
.tst-section-header__link:hover { color: var(--tst-gold-dark); }

/* Standalone (fuera de card) */
.tst-section-header--standalone {
    border-bottom: 2px solid var(--tst-lime-dark);
    padding-bottom: var(--tst-gap-sm);
    margin-bottom: var(--tst-gap-lg);
}

/* ════════════════════════════════════════════════════════════
   8 — STATS LIST (info personal + rankings)
   ════════════════════════════════════════════════════════════ */
.tst-stats-list { list-style: none; padding: 0; margin: 0; }
.tst-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--tst-ink-10);
    gap: var(--tst-gap-md);
}
.tst-stat-item:last-child { border-bottom: none; }
.tst-stat-label {
    font-size: var(--tst-fs-sm);
    color: var(--tst-ink-60);
    font-weight: 500;
    flex-shrink: 0;
}
.tst-stat-value {
    font-size: var(--tst-fs-sm);
    color: var(--tst-ink-100);
    font-weight: 700;
    text-align: right;
    word-break: break-word;
}

/* ════════════════════════════════════════════════════════════
   9 — OVERVIEW GRID
   ════════════════════════════════════════════════════════════ */
.tst-overview-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--tst-gap-lg);
}
@media (min-width: 640px) {
    .tst-overview-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 960px) {
    .tst-overview-grid { grid-template-columns: 3fr 2fr; }
}

/* Próximo partido */
.tst-card--next-match { border-top: 3px solid var(--tst-brand); }
.tst-next-match-body { padding-top: var(--tst-gap-sm); }
.tst-next-match-tournament {
    font-size: var(--tst-fs-sm);
    font-weight: 700;
    color: var(--tst-brand-dark);
    margin-bottom: var(--tst-gap-xs);
}
.tst-next-match-vs {
    font-size: var(--tst-fs-md);
    font-weight: 800;
    color: var(--tst-ink-100);
    margin-bottom: var(--tst-gap-xs);
}
.tst-next-match-date {
    font-size: var(--tst-fs-sm);
    color: var(--tst-ink-60);
    margin-bottom: 4px;
}
.tst-next-match-round {
    display: inline-block;
    font-size: var(--tst-fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--tst-brand);
    background: var(--tst-brand-light);
    padding: 2px 8px;
    border-radius: var(--tst-radius-sm);
    margin-top: 4px;
}

/* Stats de temporada */
.tst-season-stats-row {
    display: flex;
    justify-content: space-around;
    gap: var(--tst-gap-md);
    padding: var(--tst-gap-sm) 0;
}
.tst-season-stat { text-align: center; }
.tst-season-stat__value {
    display: block;
    font-family: var(--tst-font-mono);
    font-size: var(--tst-fs-lg);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    margin-bottom: 4px;
}
.tst-season-stat__label {
    font-size: var(--tst-fs-xs);
    color: var(--tst-ink-60);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* ════════════════════════════════════════════════════════════
   10 — NEWS CARDS (grid 3 cols)
   ════════════════════════════════════════════════════════════ */
.tst-news-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--tst-gap-lg);
}
@media (min-width: 640px) {
    .tst-news-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
    .tst-news-grid { grid-template-columns: repeat(3, 1fr); }
}

.tst-news-card {
    background: var(--tst-white);
    border-radius: var(--tst-radius-lg);
    overflow: hidden;
    box-shadow: var(--tst-card-shadow);
    border: 1px solid var(--tst-ink-10);
    display: flex;
    flex-direction: column;
    transition: transform var(--tst-transition-slow), box-shadow var(--tst-transition-slow);
}
.tst-news-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--tst-card-shadow-hover);
}

/* Imagen */
.tst-news-card__image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--tst-paper);
    flex-shrink: 0;
}
.tst-news-card__thumb {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
    transition: transform var(--tst-transition-slow);
}
.tst-news-card:hover .tst-news-card__thumb { transform: scale(1.04); }

.tst-news-card__category {
    position: absolute;
    top: var(--tst-gap-sm);
    left: var(--tst-gap-sm);
    background: var(--tst-brand);
    color: var(--tst-white);
    font-family: var(--tst-font-headline);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 3px 8px;
    border-radius: var(--tst-radius-sm);
}

/* Body */
.tst-news-card__body {
    padding: var(--tst-gap-md);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.tst-news-card__title {
    font-family: var(--tst-font-headline);
    font-size: var(--tst-fs-sm);
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 var(--tst-gap-sm);
    /* 3-line clamp */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tst-news-card__title a {
    color: var(--tst-ink-100);
    text-decoration: none;
    transition: color var(--tst-transition);
}
.tst-news-card__title a:hover { color: var(--tst-brand); }

.tst-news-card__excerpt {
    font-family: var(--tst-font-headline);
    font-size: var(--tst-fs-xs);
    color: var(--tst-ink-60);
    line-height: 1.6;
    margin: 0 0 var(--tst-gap-md);
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tst-news-card__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--tst-gap-sm);
    border-top: 1px solid var(--tst-ink-10);
    margin-top: auto;
}
.tst-news-card__date {
    font-size: var(--tst-fs-xs);
    color: var(--tst-ink-60);
    font-weight: 500;
}
.tst-news-card__readmore {
    font-size: var(--tst-fs-xs);
    font-weight: 700;
    color: var(--tst-gold);
    text-decoration: none;
    transition: color var(--tst-transition), transform var(--tst-transition);
    display: inline-block;
}
.tst-news-card__readmore:hover {
    color: var(--tst-gold-dark);
    transform: translateX(3px);
}

/* ════════════════════════════════════════════════════════════
   11 — BIOGRAFÍA
   ════════════════════════════════════════════════════════════ */
.tst-bio-text {
    font-family: var(--tst-font-body);
    font-size: var(--tst-fs-base);
    line-height: 1.8;
    color: var(--tst-ink-100);
}
.tst-bio-text p {
    margin: 0 0 var(--tst-gap-md);
}
.tst-bio-text p:last-child { margin-bottom: 0; }
.tst-bio-text a { color: var(--tst-brand); }

.tst-wiki-disclaimer {
    font-size: var(--tst-fs-xs);
    color: var(--tst-ink-60);
    margin-top: var(--tst-gap-lg) !important;
    padding-top: var(--tst-gap-md);
    border-top: 1px solid var(--tst-ink-10);
    font-family: var(--tst-font-headline) !important;
}
.tst-wiki-disclaimer a { color: var(--tst-gold); text-decoration: none; }
.tst-wiki-disclaimer a:hover { color: var(--tst-gold-dark); text-decoration: underline; }

/* ════════════════════════════════════════════════════════════
   12 — ACTIVIDAD / PARTIDOS
   ════════════════════════════════════════════════════════════ */
.tst-activity-tournament {
    margin-bottom: var(--tst-gap-lg);
    border-radius: var(--tst-radius-md);
    overflow: hidden;
    background: var(--tst-white);
    box-shadow: var(--tst-card-shadow);
    border: 1px solid var(--tst-ink-10);
}

.tst-activity-tournament__header {
    display: flex;
    align-items: center;
    gap: var(--tst-gap-sm);
    background: var(--tst-brand-dark);
    padding: 14px var(--tst-gap-md);
    border-left: 4px solid var(--tst-lime-dark);
}
.tst-activity-tournament__surface { font-size: 16px; flex-shrink: 0; }
.tst-activity-tournament__name {
    font-family: var(--tst-font-headline);
    font-size: var(--tst-fs-sm);
    font-weight: 700;
    color: var(--tst-white);
    text-transform: uppercase;
    letter-spacing: .4px;
}

/* Row de partido */
.tst-activity-row {
    display: grid;
    grid-template-columns: 40px 1fr auto 60px;
    gap: var(--tst-gap-md);
    align-items: center;
    padding: 14px var(--tst-gap-md);
    border-bottom: 1px solid var(--tst-ink-10);
    transition: background var(--tst-transition);
}
.tst-activity-row:last-child { border-bottom: none; }
.tst-activity-row:hover { background: var(--tst-off-white); }

/* V/D badge */
.tst-activity-result {
    width: 34px;
    height: 34px;
    border-radius: var(--tst-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--tst-font-headline);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .3px;
    flex-shrink: 0;
}
.tst-activity-result--win  { background: var(--tst-win);  color: var(--tst-white); }
.tst-activity-result--loss { background: var(--tst-ink-10); color: var(--tst-ink-60); }

/* Info del partido */
.tst-activity-info { min-width: 0; }
.tst-activity-opponent {
    font-family: var(--tst-font-headline);
    font-size: var(--tst-fs-sm);
    font-weight: 700;
    color: var(--tst-ink-100);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}
.tst-activity-round {
    font-size: var(--tst-fs-xs);
    color: var(--tst-ink-60);
    font-weight: 500;
}

/* Score por sets */
.tst-activity-score { text-align: center; }
.tst-sets-row {
    display: flex;
    gap: 4px;
    justify-content: center;
    align-items: center;
}
.tst-set {
    font-family: var(--tst-font-mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--tst-ink-60);
    width: 20px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.tst-set--won {
    font-weight: 700;
    color: var(--tst-brand-dark);
}
.tst-score-simple {
    font-family: var(--tst-font-mono);
    font-size: var(--tst-fs-sm);
    font-weight: 600;
    color: var(--tst-brand);
    font-variant-numeric: tabular-nums;
}

/* Fecha */
.tst-activity-date {
    font-family: var(--tst-font-mono);
    font-size: var(--tst-fs-xs);
    color: var(--tst-ink-60);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Empty state */
.tst-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--tst-gap-xl) var(--tst-gap-lg);
    background: var(--tst-brand-light);
    border: 1px dashed var(--tst-brand);
    border-radius: var(--tst-radius-md);
    text-align: center;
}
.tst-empty-state__icon { font-size: 28px; opacity: .55; margin-bottom: var(--tst-gap-sm); }
.tst-empty-state__title {
    font-family: var(--tst-font-headline);
    font-size: var(--tst-fs-sm);
    font-weight: 800;
    color: var(--tst-brand-dark);
    margin-bottom: 4px;
}
.tst-empty-state__desc {
    font-size: var(--tst-fs-xs);
    color: var(--tst-ink-60);
    max-width: 280px;
    line-height: 1.5;
}

/* ════════════════════════════════════════════════════════════
   13 — VIDEOS
   ════════════════════════════════════════════════════════════ */
.tst-videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--tst-gap-lg);
}
.tst-video-card {
    background: var(--tst-white);
    border-radius: var(--tst-radius-md);
    overflow: hidden;
    box-shadow: var(--tst-card-shadow);
    border: 1px solid var(--tst-ink-10);
    transition: transform var(--tst-transition-slow), box-shadow var(--tst-transition-slow);
}
.tst-video-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--tst-card-shadow-hover);
}
.tst-video-thumb {
    display: block;
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    overflow: hidden;
    background: var(--tst-brand-dark);
}
.tst-video-thumb img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform var(--tst-transition-slow);
}
.tst-video-card:hover .tst-video-thumb img { transform: scale(1.04); }
.tst-video-play {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.35);
    opacity: 0;
    transition: opacity var(--tst-transition);
}
.tst-video-card:hover .tst-video-play { opacity: 1; }
.tst-video-info { padding: var(--tst-gap-sm) var(--tst-gap-md) var(--tst-gap-md); }
.tst-video-title {
    font-family: var(--tst-font-headline);
    font-size: var(--tst-fs-sm);
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tst-video-title a { color: var(--tst-ink-100); text-decoration: none; }
.tst-video-title a:hover { color: var(--tst-brand); }
.tst-video-channel {
    font-size: var(--tst-fs-xs);
    color: var(--tst-ink-60);
    margin: 0;
}

/* ════════════════════════════════════════════════════════════
   14 — AD SLOTS (TST Design System v4+)
   ════════════════════════════════════════════════════════════ */
.tst-ad-slot {
    background: var(--tst-paper);
    border: 1px solid var(--tst-ink-10);
    border-radius: var(--tst-radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}
.tst-ad-slot--728x90 { min-height: 90px; width: 100%; }
.tst-ad-slot--300x250 { min-height: 250px; max-width: 300px; }
.tst-ad-slot__label {
    font-family: var(--tst-font-headline);
    font-size: 9px;
    color: var(--tst-ink-30);
    text-transform: uppercase;
    letter-spacing: .6px;
    position: absolute;
    top: 6px;
}

/* ════════════════════════════════════════════════════════════
   15 — ANIMATIONS (prefers-reduced-motion safe)
   ════════════════════════════════════════════════════════════ */
@keyframes tst-fade-in-up {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.tst-tab-pane.active .tst-card,
.tst-tab-pane.active .tst-news-card,
.tst-tab-pane.active .tst-activity-tournament {
    animation: tst-fade-in-up 250ms var(--tst-transition) backwards;
}
.tst-tab-pane.active .tst-card:nth-child(2) { animation-delay: 60ms; }
.tst-tab-pane.active .tst-news-card:nth-child(1) { animation-delay: 0ms; }
.tst-tab-pane.active .tst-news-card:nth-child(2) { animation-delay: 80ms; }
.tst-tab-pane.active .tst-news-card:nth-child(3) { animation-delay: 160ms; }
@media (prefers-reduced-motion: reduce) {
    .tst-player-page *,
    .tst-player-page *::before,
    .tst-player-page *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}

/* ════════════════════════════════════════════════════════════
   16 — RESPONSIVE — mobile-first breakpoints TST
   ════════════════════════════════════════════════════════════ */

/* ── ≤ 640px (móvil) ──────────────────────────────────────── */
@media (max-width: 640px) {

    /* Header comprimido */
    .tst-player-header { padding: 24px var(--tst-gap-md) 20px; }
    .tst-player-photo-section { gap: var(--tst-gap-md); }
    .tst-player-photo { width: 76px; height: 76px; }
    .tst-player-photo-initials { font-size: 26px; }
    .tst-player-name { font-size: clamp(1.35rem, 5vw, 1.75rem); margin-bottom: var(--tst-gap-sm); }
    .tst-player-header-meta { gap: 6px; margin-bottom: 8px; }
    .tst-player-country-badge { font-size: 9px; padding: 3px 8px; }

    /* Rankings en header */
    .tst-player-rankings { gap: var(--tst-gap-md); }
    .tst-ranking-value { font-size: 22px; }
    .tst-ranking-label { font-size: 9px; }

    /* Tabs */
    .tst-player-tabs-inner { padding: 0; }
    .tst-tab-button { min-width: 80px; padding: 14px var(--tst-gap-sm); font-size: 12px; }

    /* Content */
    .tst-player-content { padding: var(--tst-gap-lg) var(--tst-gap-md); }

    /* Cards */
    .tst-card { padding: var(--tst-gap-md); border-radius: var(--tst-radius-md); }

    /* Stats list */
    .tst-stat-item { padding: 10px 0; }
    .tst-stat-label { font-size: 12px; }
    .tst-stat-value { font-size: 12px; }

    /* News cards: imagen más pequeña en móvil */
    .tst-news-card__image { height: 160px; }
    .tst-news-card__body { padding: var(--tst-gap-sm) var(--tst-gap-md) var(--tst-gap-md); }
    .tst-news-card__title { font-size: 13px; }

    /* Actividad: grid comprimido */
    .tst-activity-row {
        grid-template-columns: 34px 1fr auto;
        grid-template-rows: auto auto;
        gap: var(--tst-gap-sm);
        padding: 12px var(--tst-gap-md);
    }
    .tst-activity-date {
        grid-column: 2;
        grid-row: 2;
        text-align: left;
        font-size: 10px;
        color: var(--tst-ink-60);
    }
    .tst-activity-score { grid-row: 1 / span 2; align-self: center; }
    .tst-activity-round { font-size: 10px; }

    /* Videos: 1 columna */
    .tst-videos-grid { grid-template-columns: 1fr; gap: var(--tst-gap-md); }

    /* Season stats */
    .tst-season-stats-row { gap: var(--tst-gap-sm); }
    .tst-season-stat__value { font-size: var(--tst-fs-md); }
}

/* ── 375px: teléfonos muy pequeños ────────────────────────── */
@media (max-width: 375px) {
    .tst-player-photo { width: 64px; height: 64px; }
    .tst-player-name { font-size: 1.2rem; }
    .tst-ranking-value { font-size: 18px; }
    .tst-activity-round { display: none; } /* solo round se oculta en pantallas muy chicas */
}

/* ── 641–768px (tablet) ─────────────────────────────────── */
@media (min-width: 641px) and (max-width: 768px) {
    .tst-player-header { padding: 36px var(--tst-gap-lg) 28px; }
    .tst-player-photo { width: 96px; height: 96px; }
    .tst-player-name { font-size: var(--tst-fs-xl); }
    .tst-player-content { padding: var(--tst-gap-xl) var(--tst-gap-lg); }
}

/* ── 769px+ (desktop base) ──────────────────────────────── */
@media (min-width: 769px) {
    .tst-player-header { padding: 56px var(--tst-gap-2xl) 44px; }
    .tst-player-photo  { width: 130px; height: 130px; }
    .tst-player-photo-initials { font-size: 44px; }
    .tst-player-name   { font-size: var(--tst-fs-2xl); }
    .tst-ranking-value { font-size: 34px; }
    .tst-player-content { padding: var(--tst-gap-xl) var(--tst-gap-2xl); }
}

/* ── 960px+ (desktop full) ──────────────────────────────── */
@media (min-width: 960px) {
    .tst-player-photo  { width: 148px; height: 148px; }
    .tst-ranking-value { font-size: 38px; }
    .tst-tab-button    { padding: 20px var(--tst-gap-lg); font-size: var(--tst-fs-sm); }
}

/* ════════════════════════════════════════════════════════════
   17 — ACTIVIDAD V2 (historial mejorado con sets doble fila)
   ════════════════════════════════════════════════════════════ */

/* Header de la sección de actividad + filtro año */
.tst-activity-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--tst-gap-md);
    margin-bottom: var(--tst-gap-lg);
}

/* Filtro de año */
.tst-year-filter {
    display: flex;
    gap: var(--tst-gap-xs);
    flex-wrap: wrap;
}
.tst-year-btn {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1.5px solid var(--tst-ink-10);
    background: var(--tst-white);
    font-family: var(--tst-font-headline);
    font-size: var(--tst-fs-xs);
    font-weight: 700;
    color: var(--tst-ink-60);
    cursor: pointer;
    transition: background var(--tst-transition), color var(--tst-transition), border-color var(--tst-transition);
    white-space: nowrap;
}
.tst-year-btn:hover { border-color: var(--tst-brand); color: var(--tst-brand); }
.tst-year-btn.active {
    background: var(--tst-brand);
    border-color: var(--tst-brand);
    color: var(--tst-white);
}

/* Torneo header mejorado */
.tst-activity-tournament__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--tst-gap-sm);
    background: var(--tst-brand-dark);
    padding: 12px var(--tst-gap-md);
    border-left: 4px solid var(--tst-lime-dark); /* se sobreescribe inline */
}
.tst-activity-tournament__left {
    display: flex;
    align-items: center;
    gap: var(--tst-gap-sm);
    min-width: 0;
}
.tst-activity-tournament__surface { font-size: 18px; flex-shrink: 0; }
.tst-activity-tournament__name {
    font-family: var(--tst-font-headline);
    font-size: var(--tst-fs-sm);
    font-weight: 700;
    color: var(--tst-white);
    text-transform: uppercase;
    letter-spacing: .4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tst-activity-tournament__year {
    font-size: var(--tst-fs-xs);
    color: rgba(255,255,255,.55);
    font-weight: 500;
    margin-top: 1px;
}
.tst-activity-tournament__result {
    display: flex;
    align-items: center;
    gap: var(--tst-gap-sm);
    flex-shrink: 0;
}
.tst-tourn-wl {
    font-family: var(--tst-font-mono);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 2px;
}
.tst-tourn-w   { color: var(--tst-lime); }
.tst-tourn-sep { color: rgba(255,255,255,.35); }
.tst-tourn-l   { color: rgba(255,255,255,.55); }
.tst-tourn-best {
    font-family: var(--tst-font-headline);
    font-size: 10px;
    font-weight: 700;
    color: var(--tst-lime-dark);
    background: rgba(184,204,48,.15);
    padding: 2px 7px;
    border-radius: var(--tst-radius-sm);
    text-transform: uppercase;
    letter-spacing: .3px;
    white-space: nowrap;
}

/* ─── ROW DE PARTIDO — REESCRITO para mobile ──────────────── */
/* Desktop: 4 columnas bien definidas */
.tst-activity-row {
    display: grid;
    grid-template-columns: 36px 1fr auto 52px;
    gap: var(--tst-gap-md);
    align-items: center;
    padding: 12px var(--tst-gap-md);
    border-bottom: 1px solid var(--tst-ink-10);
    transition: background var(--tst-transition);
    min-width: 0;
}
.tst-activity-row:last-child { border-bottom: none; }
.tst-activity-row:hover      { background: var(--tst-off-white); }

/* V/D badge */
.tst-activity-result {
    width: 32px;
    height: 32px;
    border-radius: var(--tst-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--tst-font-headline);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .3px;
    flex-shrink: 0;
}
.tst-activity-result--win  { background: var(--tst-win);  color: var(--tst-white); }
.tst-activity-result--loss { background: var(--tst-ink-10); color: var(--tst-ink-60); }

/* Info oponente */
.tst-activity-info { min-width: 0; overflow: hidden; }
.tst-activity-opponent {
    font-family: var(--tst-font-headline);
    font-size: var(--tst-fs-sm);
    font-weight: 700;
    color: var(--tst-ink-100);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 2px;
}
.tst-opp-rank {
    font-family: var(--tst-font-mono);
    font-size: 10px;
    font-weight: 500;
    color: var(--tst-ink-60);
    flex-shrink: 0;
}
.tst-activity-round {
    font-size: 11px;
    color: var(--tst-ink-60);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Score — dos filas (jugador arriba, rival abajo) */
.tst-activity-score { min-width: 0; }
.tst-sets-display { display: flex; flex-direction: column; gap: 2px; }
.tst-sets-row {
    display: flex;
    gap: 3px;
    align-items: center;
}
.tst-sets-row--mine  { /* sets del jugador */ }
.tst-sets-row--opp   { opacity: .65; }

.tst-set {
    font-family: var(--tst-font-mono);
    font-size: 13px;
    font-weight: 400;
    color: var(--tst-ink-60);
    width: 18px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}
.tst-set--won  { font-weight: 700; color: var(--tst-ink-100); }
.tst-set--lost { color: var(--tst-ink-30); }

/* Fecha */
.tst-activity-date {
    font-family: var(--tst-font-mono);
    font-size: 11px;
    color: var(--tst-ink-60);
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════
   18 — MOBILE FIXES para actividad (sin rayas rotas)
   ════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {

    /* Activity header: apilar en columna */
    .tst-activity-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--tst-gap-sm);
    }

    /* Filtro de año: scroll horizontal en móvil */
    .tst-year-filter {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 2px;
        width: 100%;
    }
    .tst-year-filter::-webkit-scrollbar { display: none; }
    .tst-year-btn { flex-shrink: 0; }

    /* Torneo header: apilar nombre y resultado */
    .tst-activity-tournament__header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--tst-gap-xs);
        padding: 10px var(--tst-gap-md);
    }
    .tst-activity-tournament__result {
        margin-left: calc(18px + var(--tst-gap-sm)); /* alinea debajo del nombre */
    }
    .tst-activity-tournament__name { font-size: 11px; white-space: normal; }
    .tst-tourn-best { font-size: 9px; }

    /* ROW DE PARTIDO en móvil:
       Layout simplificado SIN grid — flexbox puro para evitar rayas rotas.
       [V/D] [Nombre rival + ronda]    [Score]
                                       [fecha abajo derecha]
    */
    .tst-activity-row {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: var(--tst-gap-sm);
        padding: 10px var(--tst-gap-md);
        /* SIN grid — evita el problema de rayas */
    }

    .tst-activity-result {
        width: 28px;
        height: 28px;
        font-size: 10px;
        flex-shrink: 0;
    }

    .tst-activity-info {
        flex: 1;
        min-width: 0;
    }
    .tst-activity-opponent {
        font-size: 13px;
        margin-bottom: 1px;
    }
    .tst-opp-rank { font-size: 9px; }
    .tst-activity-round { font-size: 10px; }

    .tst-activity-score {
        flex-shrink: 0;
        margin-left: auto;
    }
    .tst-set { font-size: 12px; width: 16px; }

    .tst-activity-date {
        width: 100%;
        text-align: right;
        font-size: 10px;
        color: var(--tst-ink-30);
        padding-top: 2px;
        /* aparece en línea propia */
    }
}

@media (max-width: 375px) {
    .tst-activity-row { padding: 8px var(--tst-gap-sm); }
    .tst-activity-tournament__header { padding: 8px var(--tst-gap-sm); }
    .tst-activity-opponent { font-size: 12px; }
    .tst-set { font-size: 11px; width: 15px; }
}

/* ════════════════════════════════════════════════════════════
   19 — MOBILE: ocultar rayas decorativas (azul y amarilla)
   en cards de Vista General. Se ven bien en desktop pero en
   mobile rompen el layout y no aportan valor visual.
   ════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
    /* Raya azul izquierda en cards de overview */
    .tst-overview-grid .tst-card,
    #tab-overview .tst-card,
    #tab-bio .tst-card {
        border-left: none !important;
        padding-left: var(--tst-gap-md);
    }
    /* Raya amarilla/lime de section-header dentro de cards */
    .tst-card .tst-section-header,
    .tst-section-header--standalone {
        border-bottom-color: transparent;
        padding-bottom: var(--tst-gap-xs);
    }
    /* Ocultar pseudo-elementos que generan rayas decorativas */
    .tst-card::before,
    .tst-card::after {
        display: none !important;
    }
}

/* ════════════════════════════════════════════════════════════
   20 — TORNEO HEADER sin emoji (limpieza visual)
   ════════════════════════════════════════════════════════════ */
.tst-activity-tournament__left {
    display: flex;
    align-items: center;
    gap: var(--tst-gap-sm);
    min-width: 0;
    flex: 1;
}
/* Ajuste ahora que no hay emoji: el nombre ocupa más espacio */
.tst-activity-tournament__name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
@media (max-width: 640px) {
    .tst-activity-tournament__header {
        flex-direction: row;  /* mantener en fila en mobile también */
        align-items: center;
        padding: 10px var(--tst-gap-md);
        flex-wrap: wrap;
        gap: var(--tst-gap-xs) var(--tst-gap-sm);
    }
    .tst-activity-tournament__left { flex: 1; min-width: 0; }
    .tst-activity-tournament__result {
        flex-shrink: 0;
        margin-left: 0; /* ya no necesitamos el indent del emoji */
    }
    .tst-activity-tournament__name { font-size: 11px; }
    .tst-activity-tournament__year { font-size: 9px; }
    .tst-tourn-best { display: none; } /* muy chico, ocultar en mobile */
}

/* ════════════════════════════════════════════════════════════
   21 — MOBILE: fix específico para rayas en Vista General
   Las rayas azul vertical + amarilla horizontal que se ven en
   mobile vienen del section-header border-bottom y border-left
   en cards de información. En mobile simplificamos: sin rayas.
   ════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
    /* Ocultar la raya amarilla debajo del título de sección en mobile */
    .tst-section-header {
        border-bottom: none;
        padding-bottom: 4px;
        margin-bottom: var(--tst-gap-sm);
    }
    .tst-section-header--standalone {
        border-bottom: none;
        margin-bottom: var(--tst-gap-md);
    }
    /* El h3 del section-header ya tiene color, no necesita raya */
    .tst-section-header h3 {
        font-size: 11px;
    }
}

/* ════════════════════════════════════════════════════════════

/* ════════════════════════════════════════════════════════════
   22 — H2H BUTTON (en card Próximo Partido)
   Sigue las pautas del Design System TST v5:
   - Estilo de TAG/PILL activo: fondo brand, texto blanco
   - DM Sans 700, radio md, transición fast
   - El conteo usa DM Mono tabular-nums
   ════════════════════════════════════════════════════════════ */
.tst-h2h-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: var(--tst-gap-md);
    padding: 8px var(--tst-gap-md);
    background: var(--tst-brand-dark);
    color: var(--tst-white);
    border: none;
    border-radius: 20px; /* pill — igual a los tags del manual */
    font-family: var(--tst-font-headline);
    font-size: var(--tst-fs-xs);
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background var(--tst-transition), box-shadow var(--tst-transition);
    width: 100%;
    justify-content: center;
    box-shadow: none;
}
.tst-h2h-btn:hover {
    background: var(--tst-brand);
    box-shadow: 0 2px 8px rgba(48,81,128,.3);
}
.tst-h2h-btn:focus-visible {
    outline: var(--tst-focus-width) solid var(--tst-focus-color);
    outline-offset: var(--tst-focus-offset);
}

/* Ícono ⚔ */
.tst-h2h-btn__icon { font-size: 13px; opacity: .85; }

/* Balance "9-5" o "Primer encuentro" */
.tst-h2h-btn__count {
    font-family: var(--tst-font-mono);
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    background: var(--tst-lime);
    color: var(--tst-brand-dark);
    padding: 1px 7px;
    border-radius: 10px;
    letter-spacing: 0;
    text-transform: none;
    line-height: 1.6;
}
.tst-h2h-btn__count--new {
    background: rgba(255,255,255,.2);
    color: var(--tst-white);
    font-family: var(--tst-font-headline);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .2px;
    text-transform: none;
}

/* ════════════════════════════════════════════════════════════
   23 — H2H DRAWER / MODAL
   Sigue el patrón "Drawer Lateral de Jugador" del manual:
   - Width 320px fijo, position fixed right:0
   - Header: fondo brand-dark, avatar + nombre + botón cierre
   - Overlay semitransparente oscuro
   - En mobile: bottom sheet (border-radius arriba)
   ════════════════════════════════════════════════════════════ */
.tst-h2h-overlay {
    position: fixed;
    inset: 0;
    background: rgba(13, 22, 40, .6);
    z-index: 9999;
    display: flex;
    justify-content: flex-end;
    align-items: stretch;
    animation: tst-h2h-overlay-fadein 200ms ease forwards;
}
.tst-h2h-overlay[hidden] { display: none !important; }

@keyframes tst-h2h-overlay-fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* El drawer en sí */
.tst-h2h-modal {
    width: 320px;
    max-width: 100vw;
    height: 100%;
    background: var(--tst-white);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-shadow: -4px 0 40px rgba(0,0,0,.2);
    animation: tst-h2h-drawer-slidein 300ms cubic-bezier(0,0,.2,1) forwards;
}
@keyframes tst-h2h-drawer-slidein {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}

/* ── HEADER del drawer ─────────────────────────────────────── */
/* Fondo brand-dark, texto blanco, badge lime — igual al manual */
.tst-h2h-header {
    background: var(--tst-brand-dark);
    padding: var(--tst-gap-md) var(--tst-gap-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 2;
    border-bottom: 3px solid var(--tst-lime-dark);
    flex-shrink: 0;
}
.tst-h2h-header__left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.tst-h2h-header__label {
    font-family: var(--tst-font-headline);
    font-size: 9px;
    font-weight: 700;
    color: var(--tst-lime);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}
.tst-h2h-header__title {
    font-family: var(--tst-font-headline);
    font-size: var(--tst-fs-sm);
    font-weight: 800;
    color: var(--tst-white);
    line-height: 1.2;
}
.tst-h2h-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    border: none;
    color: rgba(255,255,255,.8);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--tst-transition), color var(--tst-transition);
    flex-shrink: 0;
    line-height: 1;
}
.tst-h2h-close:hover { background: rgba(255,255,255,.2); color: var(--tst-white); }
/* Focus inset sobre fondos dark — regla del manual */
.tst-h2h-close:focus-visible {
    outline: 2px solid var(--tst-lime);
    outline-offset: -3px;
}

/* ── SCOREBOARD — los dos jugadores ───────────────────────── */
/* Dos avatares con iniciales, wins grandes en lime, VS central */
.tst-h2h-scoreboard {
    background: var(--tst-brand-dark);
    padding: var(--tst-gap-lg) var(--tst-gap-lg) var(--tst-gap-md);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: var(--tst-gap-md);
    align-items: center;
    flex-shrink: 0;
}
.tst-h2h-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--tst-gap-xs);
    text-align: center;
}
/* Avatar circular 60px — igual al drawer de jugador del manual */
.tst-h2h-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    border: 2px solid rgba(255,255,255,.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--tst-font-headline);
    font-size: 18px;
    font-weight: 800;
    color: var(--tst-lime);
}
.tst-h2h-pname {
    font-family: var(--tst-font-headline);
    font-size: 10px;
    font-weight: 700;
    color: rgba(255,255,255,.8);
    max-width: 80px;
    text-align: center;
    line-height: 1.3;
    word-break: break-word;
}
.tst-h2h-pcountry {
    font-size: 11px;
    color: rgba(255,255,255,.45);
}
/* Wins: número grande, DM Mono, lime */
.tst-h2h-wins {
    font-family: var(--tst-font-mono);
    font-size: 40px;
    font-weight: 700;
    color: var(--tst-lime);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

/* VS central */
.tst-h2h-vs-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 0 var(--tst-gap-xs);
}
.tst-h2h-vs-label {
    font-family: var(--tst-font-headline);
    font-size: 10px;
    font-weight: 900;
    color: rgba(255,255,255,.3);
    letter-spacing: 2px;
}
.tst-h2h-total-badge {
    background: rgba(255,255,255,.1);
    color: rgba(255,255,255,.55);
    font-family: var(--tst-font-headline);
    font-size: 9px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
    white-space: nowrap;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .3px;
}

/* ── BARRA DE PROGRESO ─────────────────────────────────────── */
/* Fondo brand-mid, fill lime — igual al H2H del manual */
.tst-h2h-progress {
    background: var(--tst-brand-mid);
    padding: var(--tst-gap-sm) var(--tst-gap-lg);
    flex-shrink: 0;
}
.tst-h2h-bar {
    height: 5px;
    background: rgba(255,255,255,.12);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 5px;
}
.tst-h2h-bar__fill {
    height: 100%;
    background: var(--tst-lime);
    border-radius: 3px;
    transition: width 500ms cubic-bezier(0,0,.2,1);
    min-width: 4px;
}
.tst-h2h-bar-labels {
    display: flex;
    justify-content: space-between;
    font-family: var(--tst-font-mono);
    font-size: 10px;
    font-weight: 700;
    color: rgba(255,255,255,.45);
    font-variant-numeric: tabular-nums;
}

/* ── ESTADÍSTICAS DE SUPERFICIES ───────────────────────────── */
.tst-h2h-surfaces {
    padding: var(--tst-gap-md) var(--tst-gap-lg);
    border-bottom: 1px solid var(--tst-ink-10);
    flex-shrink: 0;
}
.tst-h2h-surfaces__title {
    font-family: var(--tst-font-headline);
    font-size: 9px;
    font-weight: 800;
    color: var(--tst-ink-60);
    text-transform: uppercase;
    letter-spacing: .8px;
    margin-bottom: var(--tst-gap-sm);
}
.tst-h2h-surface-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid var(--tst-ink-10);
    gap: var(--tst-gap-sm);
}
.tst-h2h-surface-row:last-child { border-bottom: none; }
.tst-h2h-surface-name {
    font-family: var(--tst-font-headline);
    font-size: var(--tst-fs-xs);
    font-weight: 600;
    color: var(--tst-ink-60);
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 80px;
}
.tst-h2h-surface-score {
    font-family: var(--tst-font-mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--tst-ink-100);
    font-variant-numeric: tabular-nums;
}
.tst-h2h-surface-score .tst-h2h-surface-win { color: var(--tst-win); }

/* ── HISTORIAL DE PARTIDOS ─────────────────────────────────── */
.tst-h2h-history { flex: 1; overflow-y: auto; }

.tst-h2h-history__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--tst-gap-md) var(--tst-gap-lg) var(--tst-gap-sm);
    border-bottom: 2px solid var(--tst-lime-dark);
    position: sticky;
    top: 0;
    background: var(--tst-white);
    z-index: 1;
}
.tst-h2h-history__title {
    font-family: var(--tst-font-headline);
    font-size: 10px;
    font-weight: 800;
    color: var(--tst-brand-dark);
    text-transform: uppercase;
    letter-spacing: .8px;
}
.tst-h2h-history__count {
    font-family: var(--tst-font-headline);
    font-size: 10px;
    font-weight: 700;
    color: var(--tst-brand);
    background: var(--tst-brand-light);
    padding: 2px 8px;
    border-radius: 10px;
}

/* Fila de partido */
.tst-h2h-match {
    display: grid;
    grid-template-columns: 26px 1fr auto;
    gap: var(--tst-gap-sm);
    align-items: center;
    padding: 11px var(--tst-gap-lg);
    border-bottom: 1px solid var(--tst-ink-10);
    transition: background var(--tst-transition);
}
.tst-h2h-match:last-child { border-bottom: none; }
.tst-h2h-match:hover { background: var(--tst-off-white); }

/* V/D badge — igual a actividad */
.tst-h2h-match__badge {
    width: 24px;
    height: 24px;
    border-radius: var(--tst-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--tst-font-headline);
    font-size: 9px;
    font-weight: 900;
    flex-shrink: 0;
}
.tst-h2h-match--win  .tst-h2h-match__badge { background: var(--tst-win);  color: var(--tst-white); }
.tst-h2h-match--loss .tst-h2h-match__badge { background: var(--tst-ink-10); color: var(--tst-ink-60); }

.tst-h2h-match__info { min-width: 0; }
.tst-h2h-match__event {
    font-family: var(--tst-font-headline);
    font-size: 11px;
    font-weight: 700;
    color: var(--tst-ink-100);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 1px;
}
.tst-h2h-match__meta {
    font-size: 10px;
    color: var(--tst-ink-60);
    display: flex;
    align-items: center;
    gap: 5px;
}
.tst-h2h-match__round {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tst-h2h-match__year {
    font-family: var(--tst-font-mono);
    font-weight: 400;
    color: var(--tst-ink-30);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

/* Score — igual al scoreboard del manual, sets en dos filas */
.tst-h2h-match__score { flex-shrink: 0; }
.tst-h2h-sets { display: flex; flex-direction: column; gap: 1px; }
.tst-h2h-sets-row {
    display: flex;
    gap: 2px;
}
.tst-h2h-set {
    font-family: var(--tst-font-mono);
    font-size: 12px;
    font-weight: 400;
    color: var(--tst-ink-30);
    width: 16px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}
.tst-h2h-set--won  { font-weight: 700; color: var(--tst-ink-100); }
.tst-h2h-set--lost { color: var(--tst-ink-30); }
/* Fila del rival, más tenue */
.tst-h2h-sets-row--opp .tst-h2h-set { opacity: .6; }
.tst-h2h-sets-row--opp .tst-h2h-set--won { opacity: 1; }

/* Empty state */
.tst-h2h-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--tst-gap-xl) var(--tst-gap-lg);
    text-align: center;
    gap: var(--tst-gap-sm);
}
.tst-h2h-empty__icon { font-size: 32px; opacity: .35; }
.tst-h2h-empty__text {
    font-family: var(--tst-font-headline);
    font-size: var(--tst-fs-sm);
    color: var(--tst-ink-60);
    line-height: 1.5;
    max-width: 220px;
    margin: 0;
}

/* ── MOBILE: bottom sheet ──────────────────────────────────── */
@media (max-width: 640px) {
    .tst-h2h-overlay { align-items: flex-end; }
    .tst-h2h-modal {
        width: 100vw;
        height: auto;
        max-height: 88vh;
        border-radius: var(--tst-radius-lg) var(--tst-radius-lg) 0 0;
        animation: tst-h2h-sheet-slidein 300ms cubic-bezier(0,0,.2,1) forwards;
    }
    @keyframes tst-h2h-sheet-slidein {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }
    .tst-h2h-scoreboard { padding: var(--tst-gap-md); gap: var(--tst-gap-sm); }
    .tst-h2h-avatar { width: 46px; height: 46px; font-size: 15px; }
    .tst-h2h-wins { font-size: 32px; }
    .tst-h2h-match { padding: 10px var(--tst-gap-md); }
}

@media (prefers-reduced-motion: reduce) {
    .tst-h2h-overlay, .tst-h2h-modal { animation: none !important; }
}
