/* ============================================
   VALORA SPORTS - Mundial 2026 Dashboard
   Identidad de marca: negro + cian + azules
   ============================================ */

:root {
    /* Fondo */
    --bg-primary: #000000;
    --bg-secondary: #05080d;
    --bg-card: rgba(8, 13, 20, 0.92);
    --bg-glass: rgba(103, 255, 255, 0.04);
    --border-glass: rgba(103, 255, 255, 0.10);
    --text-primary: #eaf6fb;
    --text-secondary: #9bb4c2;
    --text-muted: #5d6f7d;

    /* Paleta oficial Valora Sports */
    --val-cyan: #67ffff;       /* PANTONE 311 C  */
    --val-blue: #00a2ce;       /* PANTONE 2183 C */
    --val-blue-deep: #0060a1;  /* PANTONE 2133 C */
    --val-blue-soft: #8cc4d1;  /* PANTONE 7458 C */
    --val-black: #000000;

    /* Acentos */
    --accent-primary: var(--val-cyan);
    --accent-secondary: var(--val-blue);
    --accent-gradient: linear-gradient(135deg, var(--val-blue-deep), var(--val-blue), var(--val-cyan));

    --live-color: #ff4d6d;
    --win-color: #3ad29f;
    --draw-color: var(--val-blue-soft);
    --loss-color: #ff4d6d;
    --finished-color: #5d6f7d;
    --scheduled-color: var(--val-cyan);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 22px rgba(103, 255, 255, 0.14);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ============ HEADER ============ */

.header {
    background:
        radial-gradient(900px 200px at 12% -40%, rgba(103, 255, 255, 0.18), transparent 70%),
        linear-gradient(135deg, #000000 0%, #001a2e 45%, #003a5c 100%);
    padding: 20px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-glass);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.6);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Logo oficial Valora Sports */
.logo-img {
    height: 30px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(103, 255, 255, 0.35));
}

/* Lado derecho del header: indicador EN VIVO + logo del Mundial */
.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-wc {
    height: 40px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.25));
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #ffffff;
    line-height: 1.1;
}

.header-subtitle {
    font-size: 0.8rem;
    color: var(--val-blue-soft);
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.header-live {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 77, 109, 0.15);
    border: 1px solid rgba(255, 77, 109, 0.3);
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #ffb3c1;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--live-color);
    border-radius: 50%;
    animation: pulse-live 1.5s ease-in-out infinite;
}

@keyframes pulse-live {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(255, 77, 109, 0.5); }
    50% { opacity: 0.5; box-shadow: 0 0 0 8px rgba(255, 77, 109, 0); }
}

/* ============ NAVIGATION ============ */

.nav-wrap {
    display: flex;
    align-items: stretch;
    max-width: 1400px;
    margin: 0 auto;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-glass);
    position: sticky;
    top: 85px;
    z-index: 90;
}

.nav-tabs {
    display: flex;
    gap: 4px;
    padding: 12px 24px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.nav-tabs::-webkit-scrollbar {
    display: none;
}

.nav-tab {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 10px 20px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    font-family: inherit;
}

.nav-tab:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
    border-color: var(--border-glass);
}

.nav-tab.active {
    background: linear-gradient(135deg, var(--val-cyan), var(--val-blue));
    color: #00151c;
    border-color: transparent;
    font-weight: 700;
    box-shadow: 0 2px 14px rgba(103, 255, 255, 0.35);
}

/* Flecha de scroll del menú: ocupa el 10% a la derecha (solo móvil) */
.nav-scroll-hint {
    display: none;
    flex: 0 0 10%;
    align-items: center;
    justify-content: center;
    border: none;
    border-left: 1px solid var(--border-glass);
    cursor: pointer;
    font-family: inherit;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--val-cyan);
    background: var(--bg-secondary);
    transition: opacity 0.25s ease;
    animation: nav-hint 1.6s ease-in-out infinite;
}

/* Glifo: › por defecto, ‹ al llegar al final */
.nav-scroll-hint::before {
    content: '\203A';
}

.nav-scroll-hint.at-end::before {
    content: '\2039';
}

/* Al final: apunta al inicio y la animación rebota a la izquierda */
.nav-scroll-hint.at-end {
    animation-name: nav-hint-left;
}

.nav-scroll-hint.hidden {
    opacity: 0;
    pointer-events: none;
}

@keyframes nav-hint {
    0%, 100% { transform: translateX(0); opacity: 0.85; }
    50% { transform: translateX(3px); opacity: 1; }
}

@keyframes nav-hint-left {
    0%, 100% { transform: translateX(0); opacity: 0.85; }
    50% { transform: translateX(-3px); opacity: 1; }
}

/* ============ MAIN CONTENT ============ */

.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    min-height: calc(100vh - 200px);
}

.tab-panel {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

/* ============ MATCH CARDS ============ */

.matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.matches-grid-final {
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
}

.match-card-wrapper {
    display: flex;
    flex-direction: column;
}

.match-card-wrapper .match-card {
    flex: 1;
}

.final-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    max-width: 520px;
    margin: 0 auto;
}

.final-layout .match-card-wrapper {
    width: 100%;
}

.match-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.match-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--border-glass);
    transition: var(--transition);
}

.match-card:hover {
    border-color: rgba(103, 255, 255, 0.30);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.match-card:hover::before {
    background: linear-gradient(90deg, var(--val-cyan), var(--val-blue-deep));
}

/* Live match card */
.match-card.live {
    border-color: rgba(255, 77, 109, 0.35);
    box-shadow: 0 0 25px rgba(255, 77, 109, 0.12);
    animation: glow-live 2s ease-in-out infinite alternate;
}

.match-card.live::before {
    background: linear-gradient(90deg, #ff4d6d, #ff7d94, #ff4d6d);
    height: 3px;
    animation: shimmer 2s linear infinite;
}

@keyframes glow-live {
    from { box-shadow: 0 0 15px rgba(255, 77, 109, 0.1); }
    to { box-shadow: 0 0 30px rgba(255, 77, 109, 0.22); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.match-card.finished::before {
    background: var(--finished-color);
}

/* Pending / TBD match card */
.match-card.pending {
    border-color: rgba(103, 255, 255, 0.08);
    background: rgba(5, 10, 16, 0.6);
}

.match-card.pending::before {
    background: linear-gradient(90deg, rgba(103, 255, 255, 0.3), rgba(0, 96, 161, 0.3));
}

.match-card.pending .match-teams {
    opacity: 0.7;
}

/* Placeholder flag (?) */
.placeholder-flag {
    width: 32px;
    height: 22px;
    border-radius: 3px;
    background: rgba(103, 255, 255, 0.10);
    border: 1px dashed rgba(103, 255, 255, 0.35);
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.team-name.placeholder-name {
    color: var(--text-muted);
    font-style: italic;
    font-weight: 500;
    font-size: 0.85rem;
}

.match-status.pending {
    background: rgba(103, 255, 255, 0.12);
    color: var(--val-cyan);
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.match-stage {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.match-status {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 4px 10px;
    border-radius: 100px;
}

.match-status.live {
    background: rgba(255, 77, 109, 0.15);
    color: #ffb3c1;
    animation: pulse-status 1.5s ease-in-out infinite;
}

@keyframes pulse-status {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.match-status.finished {
    background: rgba(93, 111, 125, 0.2);
    color: var(--text-muted);
}

.match-status.scheduled {
    background: rgba(103, 255, 255, 0.12);
    color: var(--val-cyan);
}

.match-teams {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.team-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.team-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.team-flag {
    width: 32px;
    height: 22px;
    border-radius: 3px;
    object-fit: cover;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    flex-shrink: 0;
}

.team-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-score {
    font-size: 1.5rem;
    font-weight: 800;
    min-width: 36px;
    text-align: center;
    color: var(--text-primary);
}

.team-score.winner {
    color: var(--win-color);
}

.match-divider {
    width: 100%;
    height: 1px;
    background: var(--border-glass);
    position: relative;
}

.match-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-glass);
}

.match-datetime {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.match-datetime .match-time-highlight {
    color: var(--accent-primary);
    font-weight: 700;
}

.match-channels {
    display: flex;
    gap: 6px;
    align-items: center;
}

.channel-logo {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: contain;
    background: rgba(255,255,255,0.08);
    padding: 3px;
    transition: var(--transition);
}

.channel-logo:hover {
    background: rgba(255,255,255,0.15);
    transform: scale(1.1);
}

.channel-chip {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    background: rgba(255,255,255,0.10);
    white-space: nowrap;
}

.match-number {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-glass);
    padding: 2px 8px;
    border-radius: 100px;
}

.match-label {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 8px 16px;
    margin-bottom: 8px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--val-blue-deep), var(--val-blue));
    color: #fff;
}

.match-label.third-place {
    background: linear-gradient(135deg, #335a6b, var(--val-blue-soft));
    color: #00151c;
}

/* ============ STANDINGS TABLES ============ */

.standings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 20px;
}

.group-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    overflow: hidden;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.group-card:hover {
    border-color: rgba(103, 255, 255, 0.18);
    box-shadow: var(--shadow-glow);
}

.group-header {
    background: linear-gradient(135deg, var(--val-blue-deep), var(--val-blue));
    padding: 12px 20px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #fff;
}

/* Ciclo de color de cabeceras de grupo con la paleta Valora */
.group-card:nth-child(4n+1) .group-header { background: linear-gradient(135deg, #003a5c, var(--val-blue-deep)); }
.group-card:nth-child(4n+2) .group-header { background: linear-gradient(135deg, var(--val-blue-deep), var(--val-blue)); }
.group-card:nth-child(4n+3) .group-header { background: linear-gradient(135deg, var(--val-blue), var(--val-cyan)); color: #00151c; }
.group-card:nth-child(4n+4) .group-header { background: linear-gradient(135deg, #4a8ba0, var(--val-blue-soft)); color: #00151c; }

.standings-table {
    width: 100%;
    border-collapse: collapse;
}

.standings-table th {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid var(--border-glass);
}

.standings-table th:first-child {
    text-align: left;
    padding-left: 20px;
}

.standings-table td {
    padding: 10px 8px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(103, 255, 255, 0.04);
}

.standings-table td:first-child {
    text-align: left;
    padding-left: 20px;
}

.standings-table tr:last-child td {
    border-bottom: none;
}

.standings-table tr:hover td {
    background: rgba(103, 255, 255, 0.04);
}

.standings-table tr.qualified td {
    color: var(--text-primary);
}

.standings-table tr.qualified td:first-child {
    border-left: 3px solid var(--win-color);
}

.standings-table tr.third-qualified td:first-child {
    border-left: 3px solid var(--draw-color);
}

.standings-team {
    display: flex;
    align-items: center;
    gap: 8px;
}

.standings-team .team-flag {
    width: 24px;
    height: 16px;
}

.standings-team .team-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.standings-pts {
    font-weight: 700 !important;
    color: var(--text-primary) !important;
    font-size: 0.95rem !important;
}

/* Badge de resultado en vivo / mas reciente junto al nombre del equipo */
.result-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.3px;
    color: #fff;
    vertical-align: middle;
    white-space: nowrap;
}

.result-badge.win  { background: #16a34a; }   /* verde - gana/gano */
.result-badge.loss { background: #dc2626; }   /* rojo - pierde/perdio */
.result-badge.draw { background: #6b7280; }   /* gris - empate */

/* Indicador de que el resultado es de un partido en juego */
.result-badge.live {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
    animation: result-badge-pulse 1.6s ease-in-out infinite;
}

@keyframes result-badge-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.55; }
}

/* ============ SECTION SUBTITLE ============ */

.section-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: -12px;
    margin-bottom: 16px;
    font-weight: 500;
}

.subtitle-badge {
    display: inline-block;
    background: var(--val-cyan);
    color: #00151c;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 100px;
    margin-right: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    vertical-align: middle;
}

/* ============ GOLEADORES / ASISTENTES ============ */

.stats-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 20px;
}

.stats-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.stats-card-header {
    background: linear-gradient(135deg, var(--val-blue-deep), var(--val-blue));
    padding: 12px 20px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #fff;
}

.stats-header-teal {
    background: linear-gradient(135deg, var(--val-blue), var(--val-cyan)) !important;
    color: #00151c !important;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
}

.stats-table th {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-glass);
}

.stats-table th:last-child {
    text-align: center;
}

.stats-table td {
    padding: 8px 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(103, 255, 255, 0.04);
}

.stats-table tr:hover td {
    background: rgba(103, 255, 255, 0.04);
}

.stats-rank {
    font-weight: 700;
    color: var(--text-muted);
    width: 30px;
}

.stats-table tr:nth-child(1) .stats-rank { color: var(--val-cyan); }
.stats-table tr:nth-child(2) .stats-rank { color: var(--val-blue-soft); }
.stats-table tr:nth-child(3) .stats-rank { color: var(--val-blue); }

.stats-player {
    font-weight: 600;
    color: var(--text-primary);
}

.stats-country {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
}

.stats-flag {
    width: 20px;
    height: 14px;
    border-radius: 2px;
    object-fit: cover;
}

.stats-value {
    text-align: center !important;
    font-weight: 800;
    font-size: 1rem;
    color: var(--text-primary);
}

.stats-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ============ NEWS ============ */

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.news-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    border-color: rgba(103, 255, 255, 0.3);
    box-shadow: var(--shadow-glow);
    transform: translateY(-3px);
}

.news-img {
    height: 180px;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-glass);
}

.news-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.news-date {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--val-cyan);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.news-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-excerpt {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-loading, .news-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
    .stats-columns {
        grid-template-columns: 1fr;
    }

    .news-grid {
        grid-template-columns: 1fr;
    }

    .news-img {
        height: 150px;
    }
}

/* ============ EMPTY STATE ============ */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1rem;
    font-weight: 500;
}

/* ============ FOOTER ============ */

.footer {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 0.75rem;
    border-top: 1px solid var(--border-glass);
    margin-top: 40px;
}

/* ============ RESPONSIVE ============ */

@media (min-width: 769px) {
    .final-layout {
        max-width: 900px;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .final-layout .match-card-wrapper {
        width: calc(50% - 12px);
    }
}

@media (max-width: 768px) {
    .header {
        padding: 14px 16px;
    }

    .header h1 {
        font-size: 1.1rem;
    }

    .header-subtitle {
        font-size: 0.7rem;
    }

    .logo-img {
        height: 24px;
    }

    .logo-wc {
        height: 30px;
    }

    .header-right {
        gap: 10px;
    }

    .nav-wrap {
        top: 68px;
    }

    .nav-tabs {
        padding: 8px 12px;
        gap: 4px;
    }

    .nav-tab {
        padding: 8px 14px;
        font-size: 0.78rem;
    }

    /* La flecha se muestra y toma el 10% del ancho en móvil */
    .nav-scroll-hint {
        display: flex;
    }

    .main-content {
        padding: 16px;
    }

    .matches-grid {
        grid-template-columns: 1fr;
    }

    .matches-grid-final {
        grid-template-columns: 1fr;
    }

    .standings-grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 1.1rem;
    }

    .match-card {
        padding: 16px;
    }

    .team-name {
        font-size: 0.85rem;
    }

    .team-score {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .header-live {
        padding: 6px 10px;
        font-size: 0.65rem;
    }

    .nav-tab {
        padding: 6px 12px;
        font-size: 0.72rem;
    }

    .match-footer {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
}

/* ============ SCROLLBAR ============ */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ============ LOADING SKELETON ============ */

.skeleton {
    background: linear-gradient(90deg, var(--bg-glass) 25%, rgba(103, 255, 255, 0.08) 50%, var(--bg-glass) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============ CLICKABLE CARDS ============ */

.match-card {
    cursor: pointer;
}

/* ============ MATCH VENUE ============ */

.match-footer-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.match-venue {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* ============ GOAL ANIMATION ============ */

.match-card.goal-scored {
    animation: goal-glow 0.5s ease-out 3;
    border-color: var(--win-color) !important;
}

@keyframes goal-glow {
    0% { box-shadow: 0 0 0 0 rgba(58, 210, 159, 0.6); }
    50% { box-shadow: 0 0 30px 8px rgba(58, 210, 159, 0.3); }
    100% { box-shadow: 0 0 0 0 rgba(58, 210, 159, 0); }
}

.team-score.score-flash {
    animation: score-pop 0.4s ease-out 3;
    color: var(--win-color) !important;
}

@keyframes score-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.6); }
    100% { transform: scale(1); }
}

/* ============ GOAL TOAST NOTIFICATION ============ */

.goal-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, var(--val-blue-deep), var(--val-cyan));
    color: #00151c;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.goal-toast.show {
    transform: translateX(0);
}

.goal-toast-icon {
    font-size: 1.3rem;
}

/* ============ MATCH DETAIL MODAL ============ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(8px);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 28px;
    position: relative;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.modal-overlay.show .modal-content {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: rgba(103, 255, 255, 0.12);
    color: var(--text-primary);
}

.modal-header-bar {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 24px;
    padding-right: 44px; /* espacio para el boton de cerrar (X) */
}

/* El estado va centrado en la barra para no quedar debajo de la X */
.modal-header-bar .match-status {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.modal-stage {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.modal-scoreboard {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 20px 0 24px;
    border-bottom: 1px solid var(--border-glass);
    margin-bottom: 20px;
}

.modal-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex: 1;
    text-align: center;
}

.modal-flag {
    width: 64px;
    height: 44px;
    border-radius: 6px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.modal-flag.placeholder-flag {
    width: 64px;
    height: 44px;
    font-size: 1.2rem;
}

.modal-team-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-score-center {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-score {
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1;
}

.modal-score-sep {
    font-size: 1.8rem;
    font-weight: 300;
    color: var(--text-muted);
}

.modal-vs {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 8px 16px;
    border: 1px solid var(--border-glass);
    border-radius: 100px;
}

.modal-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.modal-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
}

.modal-info-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.modal-info-value {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* ---- Pestañas del modal ---- */
.modal-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-glass);
    margin-bottom: 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.modal-tabs::-webkit-scrollbar {
    display: none;
}

.modal-tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    padding: 10px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    transition: var(--transition);
}

.modal-tab:hover {
    color: var(--text-secondary);
}

.modal-tab.active {
    color: var(--val-cyan);
    border-bottom-color: var(--val-cyan);
}

.modal-tab-panel {
    display: none;
}

.modal-tab-panel.active {
    display: block;
}

.modal-tab-panel > .modal-section:first-child,
.modal-tab-panel > .modal-info-grid:first-child,
.modal-tab-panel > #modalH2H .modal-section {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* ---- Cara a cara ---- */
.h2h-summary {
    display: flex;
    align-items: center;
    gap: 10px;
}

.h2h-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.h2h-flag {
    width: 40px;
    height: 28px;
    border-radius: 4px;
    object-fit: cover;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.h2h-counts {
    display: flex;
    gap: 14px;
}

.h2h-count {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.h2h-num {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1;
}

.h2h-lbl {
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-top: 3px;
}

.h2h-last {
    margin-top: 16px;
    padding: 12px;
    background: var(--bg-glass);
    border-radius: var(--radius-sm);
}

.h2h-last-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-align: center;
}

.h2h-last-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.h2h-last-team {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    flex: 1;
    text-align: center;
}

.h2h-last-score {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
}

.h2h-last-meta {
    text-align: center;
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ---- Clasificación dentro del modal ---- */
.modal-st-pos {
    font-weight: 700;
    color: var(--text-muted);
    width: 22px;
}

.modal-st-current {
    background: rgba(103, 255, 255, 0.06);
}

.modal-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-glass);
}

.modal-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-primary);
    margin-bottom: 12px;
}

.possession-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.possession-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 40px;
    text-align: center;
}

.possession-bar {
    flex: 1;
    height: 8px;
    background: rgba(0, 96, 161, 0.35);
    border-radius: 100px;
    overflow: hidden;
}

.possession-home {
    height: 100%;
    background: linear-gradient(90deg, var(--val-cyan), var(--val-blue));
    border-radius: 100px;
    transition: width 0.5s ease;
}

.events-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.event-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-glass);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
}

.event-minute {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-primary);
    min-width: 35px;
}

.event-icon {
    font-size: 1rem;
}

.event-desc {
    color: var(--text-secondary);
    flex: 1;
}

.lineup-team {
    margin-bottom: 16px;
}

.lineup-header {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.lineup-formation {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.lineup-players {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.lineup-player {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.75rem;
}

.lineup-player.starter {
    background: rgba(103, 255, 255, 0.10);
    color: var(--text-primary);
}

.lineup-player.sub {
    background: var(--bg-glass);
    color: var(--text-muted);
}

.player-number {
    font-weight: 700;
    font-size: 0.7rem;
    color: var(--accent-primary);
}

.player-name {
    font-weight: 500;
}

.lineup-subs-label {
    width: 100%;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 8px;
    margin-bottom: 2px;
}

.officials-list {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.official-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.official-role {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
}

.official-item span:last-child {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.modal-loading, .modal-no-data {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

@media (max-width: 480px) {
    .modal-content {
        padding: 20px;
        max-height: 90vh;
    }

    .modal-scoreboard {
        gap: 16px;
    }

    .modal-flag {
        width: 48px;
        height: 33px;
    }

    .modal-score {
        font-size: 2rem;
    }

    .modal-info-grid {
        grid-template-columns: 1fr;
    }

    .modal-team-name {
        font-size: 0.85rem;
    }
}

.modal-content::-webkit-scrollbar {
    width: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 2px;
}

/* ============ BRACKET / CLASIFICACIÓN ============ */

.bracket-scroll {
    overflow-x: auto;
    overflow-y: auto;
    padding: 10px 0 20px;
    scrollbar-width: thin;
}

.bracket-container {
    display: flex;
    align-items: stretch;
    min-width: 1600px;
    gap: 0;
}

.bk-round {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    width: 155px;
}

.bk-round-label {
    text-align: center;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--val-cyan);
    padding: 8px 0;
    background: var(--bg-primary);
    position: sticky;
    top: 0;
    z-index: 2;
    border-bottom: 1px solid var(--border-glass);
    margin-bottom: 4px;
}

.bk-round-matches {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    flex: 1;
    padding: 4px 0;
}

.bk-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 2px 4px;
}

.bk-match {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 6px;
    width: 100%;
    cursor: pointer;
    transition: var(--transition);
    overflow: hidden;
}

.bk-match:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 12px rgba(103, 255, 255, 0.15);
}

.bk-match.bk-live {
    border-color: var(--live-color);
    box-shadow: 0 0 10px rgba(255, 77, 109, 0.2);
}

.bk-date {
    font-size: 0.55rem;
    color: var(--text-muted);
    text-align: center;
    padding: 3px 6px 2px;
    background: rgba(103, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-glass);
    white-space: nowrap;
}

.bk-team {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 6px;
    border-bottom: 1px solid rgba(103, 255, 255, 0.04);
}

.bk-team:last-of-type {
    border-bottom: none;
}

.bk-team.bk-w {
    background: rgba(58, 210, 159, 0.08);
}

.bk-team.bk-w .bk-name {
    font-weight: 700;
    color: var(--text-primary);
}

.bk-team.bk-w .bk-score {
    color: var(--win-color);
    font-weight: 800;
}

.bk-flag {
    width: 18px;
    height: 12px;
    border-radius: 2px;
    object-fit: cover;
    flex-shrink: 0;
}

.bk-name {
    flex: 1;
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bk-score {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 14px;
    text-align: center;
}

.bk-id {
    font-size: 0.5rem;
    color: var(--text-muted);
    text-align: center;
    padding: 1px 0;
    opacity: 0.5;
}

.bk-match.bk-empty {
    text-align: center;
    padding: 12px 6px;
    opacity: 0.3;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.bk-gap {
    flex-shrink: 0;
    width: 28px;
}

.bk-svg {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
}

.bk-final-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 170px;
    gap: 24px;
}

.bk-final-col .bk-round {
    width: 100%;
}

.bk-final-col .bk-round-label {
    font-size: 0.7rem;
    color: var(--val-cyan);
}

.bk-final-col .bk-match {
    border-color: rgba(103, 255, 255, 0.25);
}

.bk-third .bk-round-label {
    color: var(--text-muted) !important;
}

.bk-third .bk-match {
    border-color: var(--border-glass) !important;
    opacity: 0.8;
}

@media (max-width: 768px) {
    .bracket-container {
        min-width: 1300px;
    }
    .bk-round {
        width: 125px;
    }
    .bk-final-col {
        width: 140px;
    }
}
