
/* ==========================================================================
   1. VARIABLES & RESET
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* dark scale */
    --dark-1000: #08090a;
    --dark-900: #0e0f10;
    --dark-800: #111214;
    --dark-700: #22252a; /* nuevo */
    --dark-600: #363a41;

    /* text scale */
    --text-900: #ffffff;
    --text-800: #9198a4;
    --text-700: #5c6169;
    --rating-9: #186a3b;
    --rating-8: #28b463;
    --rating-7: #f4d03f;
    --rating-6: #f39c12;
    --rating-5: #e74c3c;
    --rating-4: #953228;
    --rating-low: #953228;

    /* Inactive-status colors for distribution bars (slightly different grays) */
    --bench: #2d2d32;
    --injured: #252529;
    --suspended: #222226;
    --not-in-squad: #1d1d21;
    
    --font-family: "Google Sans Flex", sans-serif;
    
    --max-width: 1064px;
    --sidebar-width: 220px;
    --gap-layout: 40px;

    --border-radius: 6px;
}

div.header-index {
    margin: 30px 0 30px;

    span {
        font-weight: 300;
        color: var(--text-700);
        font-size: 14px;
    }
    h1 {
        line-height: 1;
        font-weight: 700;
        line-height: 1;
        color: inherit;
        font-size: 20px;
    }
}

/* Team Cards (Home) */
.team-card-container {
    padding-bottom: 8px;
    padding-top: 8px;
    margin-bottom: 50px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    gap: 20px;
}
.team-card-container::-webkit-scrollbar { display: none; }

.team-card {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 18px 10px;
    background-color: var(--dark-900);
    border: 1px solid var(--dark-700);
    border-radius: var(--border-radius);
    text-decoration: none;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.team-card:hover {
    transform: translateY(-2px);
}

.team-card__badge {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.team-card__rank {
    font-size: 13px;
    color: var(--text-800);
    font-weight: 500;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 2px;

    svg {
        width: 12px;
        height: 12px;
        margin-right: 6px;
    }
}

.team-card__trend {
    width: 12px;
    height: 12px;
    fill: var(--rating-5);
    flex-shrink: 0;
}

.team-card__trend--up {
    fill: var(--rating-8);
}

.team-card__bubble {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 38px;
    height: 38px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid var(--dark-1000);
}
.team-card__bubble.rating-9  { background: var(--rating-9); }
.team-card__bubble.rating-8  { background: var(--rating-8); }
.team-card__bubble.rating-7  { background: var(--rating-7); color: #1a1a1c; }
.team-card__bubble.rating-6  { background: var(--rating-6); }
.team-card__bubble.rating-5  { background: var(--rating-5); }
.team-card__bubble.rating-low { background: var(--rating-low); }

/* ==========================================================================
   2. BASE TYPOGRAPHY & LAYOUT
   ========================================================================== */
body {
    background-color: var(--dark-1000);
    color: var(--text-900);
    font-family: var(--font-family);
    font-optical-sizing: auto;
    font-variation-settings: "slnt" 0, "wdth" 100, "GRAD" 0, "ROND" 0;
    line-height: 1.5;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s;
}

a:hover {
    opacity: 0.8;
}

h1, h2, h3 {
    font-weight: 700;
    line-height: 1.2;
}

/* Page Scaffolding */
.app-container {
    display: flex;
}

.main-content {
    flex: 1;
    min-width: 0;
    max-width: 1300px;
    margin: 0 auto;
}

.header-content-match {
    margin: 40px 0 10px;

    h1 {
        font-weight: 300;
        color: var(--text-700);
        font-size: 14px;
    }
}

.player-page, .match-page {
    max-width: 950px;
    padding: 0 30px;
}

.team-page, .tournament-page, .index-page {
    padding: 0 30px;
}

.header-content-index {
    margin-top: 42px;
    margin-bottom: 20px;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;

    h3, h4 {
        font-size: 16px;
        font-weight: 300;
        color: var(--text-800);
    }
}

.section-header {
    font-weight: 400;
    text-transform: uppercase;
    padding: 0 0 5px 15px;
}

.empty-state, .empty-text {
    padding: 20px;
    text-align: center;
    color: var(--text-800);
    font-size: 13px;
}

/* ==========================================================================
   3. TOPBAR & NAVIGATION
   ========================================================================== */
.topbar {
    width: 100%;
    padding: 10px 0;
    /* position: sticky; */
    top: 0;
    z-index: 50;
}

.topbar-inner {
    max-width: 1100px;
    display: flex;
    align-items: center;
    height: 50px;
    position: relative;
}

/* Branding */
.branding {

    .sidebar & {
        padding: 19px 55px 18px 32px;
        flex-shrink: 0;
        border-bottom: 1px solid var(--dark-700);
    }
}

.topbar-branding {
    display: none;
}

.logo-link {
    font-size: 22px;
    font-weight: 800;
    position: relative;
    color: #ffffff;
    background: linear-gradient(
        135deg, #71717e 0%, #ffffff 10%, #71717e 30%, #ffffff 50%, #71717e 70%, #ffffff 90%, #71717e 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;

    .white-theme & {
        color: var(--dark-1000);
    }

    .white-theme &:after {
        background: linear-gradient(180deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, .15));
    }
}



/* Toggle Buttons */
.mobile-menu-btn,
.mobile-search-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-900);
    font-size: 24px;
    cursor: pointer;
    padding: 8px; /* Consistent touch target */
}

/* Desktop Search */
.search-container {
    flex: 1; 
    display: flex;
    position: relative;
    max-width: 400px;
}

.search-form {
    width: 100%;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    background-color: var(--dark-800);
    border: 2px solid transparent;
    border-radius: 99px;
    padding: 8px 16px 8px 40px;
    color: var(--text-900);
    font-family: var(--font-family);
    outline: none;
    transition: border-color 0.2s;
    font-size: 16px;
}

.search-input:focus {
    border-color: var(--dark-600);
}

.search-input::placeholder {
    color: var(--text-700);
}

.search-icon-inside {
    position: absolute;
    left: 15px;
    color: var(--text-800);
    font-size: 17px;
    pointer-events: none;
}

/* Desktop Dropdown Styles */
.search-dropdown-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--dark-800);
    border: 1px solid var(--dark-700);
    border-radius: 8px;
    margin-top: 10px;
    z-index: 60;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.search-results-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    text-decoration: none;
    color: var(--text-900);
    border-bottom: 1px solid var(--dark-700);
    transition: background 0.15s;
}

.search-result-item:hover {
    background-color: var(--dark-700);
}

.search-result-item:last-child {
    border-bottom: none;
}

.result-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    background-color: var(--dark-800);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.result-name {

}

.result-sub {
    font-size: 11px;
    color: var(--text-800);
}

.result-type-badge {
    font-size: 10px;
    padding: 2px 6px;
    background: var(--dark-800);
    color: var(--text-800);
    border-radius: 4px;
    text-transform: uppercase;
}

/* Mobile Search Overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--dark-1000); 
    z-index: 1000;
    display: none; 
    flex-direction: column;
    padding: 15px;
    padding-right: 5px;
}

.search-overlay.active {
    display: flex;
}

.search-overlay-header {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
    gap: 5px;
}

.search-form-overlay {
    flex-grow: 1;
}

.overlay-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.overlay-search-input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border-radius: 6px;
    border: none;
    background: var(--dark-800);
    color: var(--text-900);
    font-size: 16px;
    outline: none;
}

.overlay-search-input:focus {
    border-color: var(--dark-600);
}

.overlay-search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-800);
    font-size: 18px;
}

.close-overlay-btn {
    background: none;
    border: none;
    color: var(--text-800);
    font-size: 28px;
    cursor: pointer;
    padding: 4px;
}

.close-overlay-btn:hover {
    color: var(--text-900);
}

.search-overlay-content {
    flex-grow: 1;
    overflow-y: auto;
}

/* Mobile Search Results */
.search-results-mobile {
    padding-right: 10px;
}
.search-results-mobile h4 {
    font-size: 14px;
    color: var(--text-800);
    margin-bottom: 12px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.search-results-mobile ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.search-results-mobile li, .search-results-mobile li a {
    margin-bottom: 2px;
}
.search-results-mobile li a {
    display: flex;
    align-items: center;
    padding: 12px;
    background: var(--dark-800);
    border-radius: 4px;
    border-bottom: none;
    text-decoration: none;
    color: var(--text-900);
    font-size: 15px;
    transition: background 0.2s;
    border: 1px solid transparent; 
}
.search-results-mobile .result-type {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-700);
}


/* ==========================================================================
   4. SIDEBAR
   ========================================================================== */
.sidebar {
    border-right: 1px solid var(--dark-700);
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Scroll wrapper: independent sidebar scroll */
.sidebar-scroll-wrapper {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow-y: auto;

    /* Firefox thin scrollbar */
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.sidebar-scroll-wrapper:hover {
    scrollbar-color: rgba(255,255,255,0.10) transparent;
}

/* Webkit (Chrome/Edge/Safari) thin scrollbar */
.sidebar-scroll-wrapper::-webkit-scrollbar {
    width: 3px;
}

.sidebar-scroll-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-scroll-wrapper::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 4px;
}

.sidebar-scroll-wrapper:hover::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.10);
}

.sidebar-scroll-wrapper::-webkit-scrollbar-button {
    display: none;
    height: 0;
}

/* Fade overlays: sticky inside scroll, never cover scrollbar */
.sidebar-nav {

}

.sidebar-nav::before,
.sidebar-nav::after {
    content: '';
    display: block;
    position: sticky;
    height: 24px;
    pointer-events: none;
    z-index: 1;
}

.sidebar-nav::before {
    top: 0;
    margin-bottom: -24px;
    background: linear-gradient(to bottom, var(--dark-1000), transparent);
}

.sidebar-nav::after {
    bottom: 0;
    margin-top: -24px;
    background: linear-gradient(to top, var(--dark-1000), transparent);
}

.nav-section {
    padding: 32px 30px 0;
    font-size: 14px;
    font-weight: 400;
}

.nav-title {
    color: var(--text-700);
    margin-bottom: 8px;
    margin-left: 10px;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    color: #adb1bb;
}

.nav-link > svg {
    margin-right: 4px;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-900);
}

.nav-link.active {
    font-weight: 500;
}

.team-rating-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    font-weight: 700;
    font-size: 15px;
}


/* ==========================================================================
   5. MATCH & PLAYER LISTS (CARDS)
   ========================================================================== */

/* Player Row (Used in Lists) */
.player-row-wrapper {
    display: flex;
    align-items: stretch;
    margin-bottom: 10px;
    gap: 10px;
}

.player-info-card {
    flex: 1;
    background-color: var(--dark-800);
    border-radius: 4px;
    padding: 5px 10px;
    display: flex;
    align-items: center;
    transition: background-color 0.2s;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.player-info-card:hover {
    opacity: 0.8;
}

/* Player Row Columns */
.face-col {
    width: 34px;
    display: flex;
    justify-content: center;
    flex-shrink: 0;
}
.player-face-img, .player-face-placeholder {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--dark-800);
}
.player-face-placeholder {
    background-image: url('data:image/svg+xml;utf8,<svg fill="%2352525b" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>');
    background-size: 20px;
    background-repeat: no-repeat;
    background-position: center;
}

.club-col, .league-col {
    width: 26px;
    display: flex;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-800);
}
.club-placeholder-icon, .league-placeholder-icon {
    font-size: 16px;
    opacity: 0.5;
}

.info-col {
    flex: 1;
    padding: 0 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
}

.player-name {
    font-weight: 500;
    color: var(--text-900);
}



/* Match Grid & Cards */

.match-summary {

}

.match-stats-grid {
    margin-bottom: 40px;
}

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

.match-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    border: 1px solid var(--dark-700);
    border-radius: var(--border-radius);
    padding: 15px 10px 18px;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    gap: 24px;
}

.match-card:hover {
    transform: translateY(-2px);
}



.match-summary .match-card-date {
    display: flex;
    align-items: baseline;
    justify-content: center;
    flex-wrap: wrap;
    line-height: 1;
    gap: 10px;
    font-weight: 400;
    margin-bottom: 20px;
}

.match-card .match-card-date {
    display: flex;
    align-items: baseline;
    justify-content: center;
    flex-wrap: wrap;
    line-height: 1;
    gap: 10px;
    font-weight: 400;
}

.match-summary .tournament-badge {
    position: relative;
    top: 4px;
}

.match-card .tournament-badge {
    position: relative;
    top: 4px;
}

.match-summary .tournament-name {
    font-size: 16px;
}

.match-card .tournament-name {
    font-size: 14px;
}

.match-summary .round {
    font-size: 14px;
    font-weight: 300;
    color: var(--text-800);
}

.match-card .round {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-800);
    text-transform: uppercase;
}

.match-summary .date {
    font-size: 14px;
    font-weight: 500;
    color: #4a4b50;
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

.match-card .date {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-800);
    text-transform: uppercase;
    letter-spacing: -0.5px;
}



.match-details {
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    gap: 24px;

    .match-grid & {
        gap: 8px;
    }
}

.team-info {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 6px;

    &.home-side {
        justify-content: flex-end;
    }
}

.match-details .team-info {
    gap: 12px;
}

.team-info.home-side .team-badge-container {
    order: 1;
}

.team-info.away-side .team-badge-container {
}

.team-badge-container {
    position: relative;
}

.match-summary .team-badge-container {
    top: -3px;
}



.match-summary .team-badge {
    width: 32px;
    height: 32px;
}

.match-grid .team-badge {
    width: 20px;
    height: 20px;
}

.match-summary .team-name {
    font-size: 18px;
    font-weight: 600;
}

.match-grid .team-name {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.3;
} 

.team-name.current-team {
    color: var(--text-900);
}

.home-side .team-name {
    text-align: right;
}

.team-score {
    font-weight: 700;
    color: var(--text-900);
    font-size: 16px;
    line-height: 1.2;
    background: var(--dark-800);
    border-radius: 4px;
    position: relative;
    isolation: isolate; /* limita el z-index negativo del hijo solo a este padre */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    min-height: 32px;
    padding-top: 2px;
    width: 32px;
}

.match-summary .team-score {
    width: 50px;
    font-size: 20px;
    min-height: 38px;
    background: var(--dark-800);
}

.score-group {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    top: -7px;

    .match-grid & {
        gap: 8px;
    }
}

.match-team-rating {
    position: absolute;
    top: 32px;
    font-weight: 700;
    font-size: 13px;
    background: var(--dark-800);
    padding: 3px;
    border-radius: 4px;
    width: 34px;
    text-align: center;
    line-height: 1;

    .match-grid & {
        display: none;
    }
}

.rating-bar-container {
    position: absolute;
    bottom: -7px;
    display: flex;
    gap: 2px;
    height: 9px;
    background: var(--dark-800);
    padding: 2px;
    border-radius: 2px;

    .home-rating & {
        right: 4px;
        left: 4px;
    }

    .away-rating & {
        left: 4px;
        right: 4px;
    }

    &.empty {
        width: 4px;
        background: #1e1e20;
    }

    .match-summary & {
        display: none;
    }
}

.rating-bar-group {
    border-radius: 1px;
}




/* ==========================================================================
   6. HEATMAP COMPONENTS
   ========================================================================== */

.heatmap-team {
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    gap: 10px;
}

/* Unified Heatmap Box */
.heatmap-box {
    width: 50px;
    height: auto;
    min-height: 38px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-900);
    background-color: var(--dark-800);
    flex-shrink: 0;
    position: relative;
    text-decoration: none;
}


/* Indicators */
.icon-sub {
    font-size: 10px;
    position: absolute;
    bottom: -1px;
    right: 2px;
}
.icon-goal {
    position: absolute;
    top: 5px;
    right: 3px;
    line-height: 0;
    font-size: 20px;
    letter-spacing: -2px;
}

/* Transfer Separator */
/* ================================
   Transfer separator (NO GAP)
   ================================ */

.heatmap-box.transfer-separator{
  overflow: hidden;
  background-color: transparent;
}

/* Ahora 2 columnas reales (sin hueco) */
.heatmap-box.transfer-separator .transfer-card{
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;     
      isolation: isolate;
    overflow: hidden;         /* <-- clave */
}

/* Mitades ocupan todo hasta el centro */
.heatmap-box.transfer-separator .team-box{
    position: relative;
    flex: 1 1 50%;
    background-image: var(--team-bg);
    background-repeat: no-repeat;
    background-size: 80% auto;
    z-index: 1;
}


/* Encuadre por lado + el “corte” diagonal llegando al centro */
.heatmap-box.transfer-separator .old-team{
  background-position: 7px 50%;

  &::before {
        content: '‹';
        position: absolute;
        top: 7%;
        left: -1px;
        font-size: 22px;
        color: var(--text-800);
  }
}
.heatmap-box.transfer-separator .new-team{
  background-position: -1px 50%;

    &::before {
        content: '›';
        position: absolute;
        top: 7%;
        right: 0px;
        font-size: 22px;
        color: var(--text-800);
    }
}



/* ==========================================================================
   7. PAGE: MATCH DETAIL
   ========================================================================== */



/* Roster Divider */
.match-roster-divider {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-800);
    margin: 24px 0 12px 0;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-align: center;
    border-top: 1px solid var(--dark-800);
    padding-top: 12px;
}

/* Versus Row Layouts */
.layout-home-versus .flag {
    margin-right: 0;
    margin-left: 6px; /* Consistency */
}

.layout-away-versus {
    flex-direction: row-reverse; 
    justify-content: flex-end; 
}
.layout-away-versus .player-info-card {
    flex-direction: row-reverse;
}
.layout-away-versus .info-col {
    flex-direction: row-reverse;
}
.layout-away-versus .flag {
    margin-left: 0 !important;
    margin-right: 6px;
}

/* Comparison Row (Match Detail: home vs away on same line) */
.comparison-row {
    display: flex;
    align-items: stretch;
    margin-bottom: 10px;
    gap: 10px;
}

.comparison-row .player-info-card {
    min-width: 0;
    position: relative;
    overflow: hidden;
}

.comparison-row .heatmap-box {
    flex-shrink: 0;
}

.heatmap-box-empty {
    background: transparent;
    pointer-events: none;
}

/* Away side: reverse element order via flexbox order */
.comparison-row .home-side .face-col  { order: 3; }
.comparison-row .home-side .club-col  { order: 2; }
.comparison-row .home-side .info-col  { order: 1; }
.comparison-row .home-side .info-col  { flex-direction: row-reverse; }
.comparison-row .home-side .flag      { margin-left: 0; margin-right: 6px; }

/* Empty placeholder when one side has fewer players */
.comparison-row .empty-slot {
    flex: 0 0 calc((100% - 129px) / 2); /* calculamos manualmente el width ya que si no flex no me calcula bien */
    min-width: 0;
    box-sizing: border-box;
}

.comparison-row .played-no {
    opacity: 0.5;
}



/* ==========================================================================
   8. PAGE: TEAM & TOURNAMENT
   ========================================================================== */

.main-header-team {
    margin: 20px 0 50px;
}

.main-header-tournament {
    margin: 20px 0 50px;    
}

.player-list-section {
    margin-bottom: 80px;
}

.full-heatmap-section {
    margin-top: 50px;
}

.section-header-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-right: 0;
}

.heatmap-header-container {
    display: flex;
    gap: 10px;
    padding-right: 0; 
    position: relative;

    &:before {
        position: absolute;
        content: '';
        left: -27px;
        right: 0px;
        bottom: -5px;
        height: 1px;
        background: linear-gradient(to right, #08090a 0%, #22252a 10%, #22252a 90%, #08090a 100%);
    }
}

.heatmap-col-header {
    width: 50px; 
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex-shrink: 0;
    padding-top: 4px;
    position: relative;

    &:before {
        position: absolute;
        content: '';
        left: -5px;
        top: 0;
        bottom: -30px;
        width: 1px;
        background: linear-gradient(to bottom, #08090a 0%, #22252a 50%, #08090a 100%);
    }
}

.heatmap-col-header .match-date {
    font-size: 12px;
    margin-bottom: 4px;
    padding: 0;
}

.match-result-block {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 4px;

    &.win {
        color: var(--rating-8);
    }

    &.draw {
        color: var(--rating-7);
    }

    &.loss {
        color: var(--rating-5);
    }
}

.match-result-row {
    display: flex;
    justify-content: center;
    gap: 4px;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 600;
}

.team-rating-val {
    font-size: 14px;
    font-weight: 700;
    padding-bottom: 2px;
    width: 54px;
    height: auto;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: linear-gradient(0deg, #252529 var(--rating-fill, 0%), transparent var(--rating-fill, 0%));
    display: none;
}

.heatmap-col-header-empty {
    width: 32px; 
    flex-shrink: 0;
}

/* Month Timeline Bar (Tournament Page) */
.month-bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    position: relative; /* Para las etiquetas flotantes */
}

.month-labels {
    position: absolute;
    top: 8px;
    width: calc(50px * 12 + 10px * 11);  /* same total as bar */
    height: 32px;
    overflow: hidden; /* Oculta desbordamiento de etiquetas en anchos pequeños */
}

.month-label {
    position: absolute;
    top: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-800);
    letter-spacing: 0.5px;
    transform: translateX(-50%);
    /* Position using CSS custom property: center of the column */
    left: calc(var(--col-pos) * 60px + 25px);  /* col * (50+10) + 50/2 */
}

.month-bar-container {
    display: flex;
    height: 32px;
    border-radius: 4px;
    overflow: hidden;
}

.month-cell {
    width: 60px; /* 50px box + 10px gap */
    flex-shrink: 0;
}

.month-cell:first-child,
.month-cell:last-child {
    width: 55px;
}

.month-cell-solid {
    background-color: var(--dark-800);
}

.month-cell-mixed {
    background: repeating-linear-gradient(90deg, var(--dark-800) 0 3px, transparent 3px 6px);
}

/* Heatmap Legend */
.heatmap-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px 10px;
    margin-top: 30px;
    font-size: 11px;
    color: var(--text-800);

    .injured {
        font-weight: 900;
        font-size: 15px;
        line-height: 1;
        position: relative;
        top: 1px;
    }

    .suspended {
        color: var(--rating-5);
    }
}

.heatmap-legend span strong {
    margin-right: 2px;
}

/* ==========================================================================
   9. PAGE: PLAYER DETAIL
   ========================================================================== */
/* Header */
.player-header-container {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 40px 25px 40px;
}
.player-header-photo img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--dark-800);
    padding: 6px;
}
.player-header-info h1 {
    margin: 0;
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: .2px;
}
.player-header-team {
    color: var(--text-800);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    margin-left: -2px;
    font-size: 15px;

    img {
        position: relative;
        top: -1px;
    }

    span {
        text-decoration: underline;
    }
}

/* Steam Reviews */
.steam-reviews-container {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}
.steam-review-row {
    margin-bottom: 2px;
    border: 1px solid var(--dark-700);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    padding: 22px 25px 23px;
    flex: 1 1 0;
    min-width: 0;
    box-sizing: border-box;
}

.steam-grid {
    position: absolute;
    top: 18px;
    height: 32px;
    left: 0;
    right: 0;
    background-image: linear-gradient(to right, rgba(255,255,255,0.035) 1px, transparent 1px);
    background-size: 20% 100%;
    border-right: 1px solid rgba(255,255,255,0.035);
}

.steam-grid:before {
    content: "";
    position: absolute;
    top: 9%;
    bottom: 9%;
    left: 0;
    right: 0;
    border-top: 1px solid rgba(255,255,255,0.035);
    border-bottom: 1px solid rgba(255,255,255,0.035);
}

/* Evolution Chart Cards */
.player-chart-card {
    padding-bottom: 18px;
}
.player-chart-mv {
    display: none;
}
.chart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.player-chart-wrap {
    position: relative;
    height: 125px;
    min-width: 0;
    overflow: hidden;
    margin-left: -10px;
    margin-right: -2px;
}
.chart-no-data {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-700);
    font-size: 12px;
}
.review-label {
    color: var(--text-800);
    font-weight: 300;
    line-height: 1.3;
}
.review-verdict {
    margin-top: 2px;
}
.review-verdict.no-data {
    color: var(484c52);
    font-weight: 300;
}
.review-verdict:hover {
    text-decoration: underline;
    cursor: default;
}

/* Player Rating Distribution Bar */
.dist-bar-wrapper {
    display: flex;
    width: 100%;
    margin-top: 20px;
    position: relative;
    gap: 4px;
}
.dist-bar-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
    position: relative;
    z-index: 1;
}
.dist-bar-label {
    font-size: 11px;
    font-weight: 400;
    white-space: nowrap;
    text-align: center;
    padding-bottom: 7px;
    margin-bottom: 4px;
    color: var(--text-800);
}
.dist-bar-track {
    display: flex;
    width: 100%;
    height: 14px;
    overflow: hidden;
    border-radius: 2px;
}

.border-rating-9, .border-rating-8, .border-rating-9-8 { border: 1px solid #28b463; background: #28b463 }
.border-rating-7, .border-rating-6, .border-rating-7-6 { border: 1px solid #f4d03f; background: #f4d03f }
.border-rating-5, .border-rating-low, .border-rating-5-4 { border: 1px solid #e74c3c; background: #e74c3c }
.border-bench, .border-injured { border: 1px solid #434348; background: #434348 }

.dist-bar-seg {
    min-width: 1px;
    height: 100%;
    opacity: 0.7;
}

/* Heatmap View Switcher */
.view-switcher-dropdown {
    position: relative;
    display: inline-block;
}
.switcher-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
    transition: background 0.2s;
    border: .5px solid var(--dark-700);
    background: var(--dark-800);
    color: var(--text-800);
}
.switcher-btn:hover { background: var(--dark-800); }
.switcher-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.25rem;
    background: var(--dark-800);
    border-radius: var(--border-radius);
    min-width: 140px;
    z-index: 50;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    overflow: hidden;
    padding: 10px 0;
}
.switcher-option {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: var(--text-800);
    padding: 6px 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s, color 0.2s;
}
.switcher-option:hover {
    background: var(--dark-800);
    color: var(--text-900);
}
.switcher-option.active {
    color: var(--text-900);
    font-weight: 600;
    background: var(--dark-800);
}

/* Full Grid View */
.heatmap-player {
    display: grid;
    grid-template-columns: repeat(auto-fill, 50px); /* rigido */
    gap: 10px;
}

.history-rating:focus:not(:focus-visible) {
    outline: none;
}

/* ── Expanding heatmap card ──────────────────────────────── */
.heatmap-card {
    position: absolute;
    inset: 0;
    background: inherit;
    color: inherit;
    border-radius: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.heatmap-val {
    position: relative;
    font-size: inherit;
    font-weight: inherit;
    line-height: 1;
}
.heatmap-pop {
    opacity: 0;
    pointer-events: none;
    position: absolute;
    top: 4px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    font-size: 12px;
    line-height: 1.2;
    transition: opacity 0.15s ease 0.08s;
}

.heatmap-box.is-active .heatmap-pop {
    opacity: 1;
    pointer-events: auto;
}

.heatmap-pop__date {
    width: 100%;
    text-align: center;
    border-bottom: 1px solid #08090a26;
    padding: 4px 0;
    margin-bottom: 37px;
    font-weight: 400;
}

.heatmap-pop__row {
    width: 100%;
    text-align: center;
}

.heatmap-pop__date + .heatmap-pop__row { /* Selecciona el primer .heatmap-pop_row (no es el primer hijo) */
    border-top: 1px solid #08090a26;
    padding-top: 6px;
}

.heatmap-pop__link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    text-decoration: none;
    transition: background 0.15s;
}

.heatmap-pop__link:hover {
    background: rgba(255,255,255,0.25);
}

.sub-on-indicator {
    position: absolute;
    bottom: 0;
    right: 2px;
    font-size: 9px;
    line-height: 1;
}

.heatmap-box.is-active .sub-on-indicator {
    display: none;
}


/* ── Hover expand (Solo se activa si JS detecta un ratón) ──────────────── */
body.has-mouse .history-rating:hover {
    z-index: 50;
}
body.has-mouse .history-rating:hover .heatmap-card {
    top: -28px;
    left: -5px;
    right: -5px;
    bottom: -67px;
    border-radius: 6px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.55);
    border: 1px solid rgba(255,255,255,0.12);
}
body.has-mouse .history-rating:hover .heatmap-val {
    transform: translateY(-20px);
}
body.has-mouse .history-rating:hover .heatmap-pop {
    opacity: 1;
    pointer-events: auto;
}
body.has-mouse .history-rating:hover .sub-on-indicator {
    display: none;
}
/* Click expand */
.heatmap-box.is-active {
    z-index: 50;
}
.heatmap-box.is-active .heatmap-card {
    top: -28px;
    left: -5px;
    right: -5px;
    bottom: -67px;
    border-radius: 6px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.55);
    border: 1px solid rgba(255,255,255,0.12);
}
.heatmap-box.is-active .heatmap-val {
    transform: translateY(-20px);
}




/* History List (Cards Implementation) */
.match-history-list {
    margin-top: 1rem;
}
.history-cards-wrapper {
    display: grid;
    /* Definimos 3 columnas: la del medio crece, las laterales se ajustan */
    grid-template-columns: max-content max-content 1fr 1fr 54px; 
    gap: 12px;
    width: 100%;
}


.match-history-card:hover {
    transform: translateY(-1px);
}

.player-stat-info {
    background-color: var(--dark-800);
    padding: 8px 12px;
    border-radius: 4px;
    white-space: nowrap;
}

.stat-hint {
    text-align: center;
    font-weight: 300;
    border-radius: 3px;
    font-size: 13px;
    color: var(--text-800);
    padding: 4px 6px;
    margin-left: 3px;
    background: #101012;
}

.stat-mins {
    text-align: center;
    font-weight: 600;
    border-radius: 3px;
    font-size: 13px;
    color: #babdc3;
    padding: 4px 6px;
    margin-left: 2px;
    background: #101012;
}

.match-compact-date {
    background-color: var(--dark-800);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    text-transform: uppercase;
    font-weight: 500;
    line-height: 1.8;
    color: var(--text-800);

    &.mobile {
        display: none;
    }
}

.match-compact-tournament {
    background-color: var(--dark-800);
    padding: 8px 12px;
    border-radius: 4px;

    .round {
        text-align: center;
        font-weight: 300;
        border-radius: 3px;
        font-size: 13px;
        color: var(--text-800);
        margin-left: 4px;
    }
}

.match-compact-result {
    background-color: var(--dark-800);
    padding: 8px 12px;
    border-radius: 4px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.match-compact-team {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 4px;

    .team-badge {
        width: 20px;
        height: 20px;
        flex: 0 0 20px;
    }

    .team-name {
        color: var(--text-900);
        display: block;
        font-weight: 400;
        font-size: 14px;
        flex: 1;         /* Este ocupará todo el espacio restante entre los dos fijos */
        min-width: 0;
    }
}

.match-compact-home .team-name {
    text-align: right;
}

.team-compact-score {
    flex: 0 0 24px;
    display: block;
    background: #27272a;
    text-align: center;
    font-weight: 700;
    border-radius: 3px;
}


/* ==========================================================================
   10. UTILITIES & COLORS
   ========================================================================== */

/* Flags */
.flag {
    background: url(https://cdn.football-graph.com/static/images_flags_responsive_custom.png) no-repeat;
    background-size: 100%;
    width: 18px;
    height: 12px;
    display: inline-block;
    vertical-align: middle;
    margin-left: 6px;
    border-radius: 2px;
}

/* Rating Color Classes */
.rating-9       { background-color: var(--rating-9); color: var(--text-900); }
.rating-8       { background-color: var(--rating-8); color: var(--dark-1000); }
.rating-7       { background-color: var(--rating-7); color: var(--dark-1000); }
.rating-6       { background-color: var(--rating-6); color: var(--dark-1000); }
.rating-5       { background-color: var(--rating-5); color: var(--dark-1000); }
.rating-low       { background-color: var(--rating-4); color: var(--dark-1000); }
.rating-none    { background-color: var(--dark-800); color: var(--text-800); }

.heatmap-box.rating-injured { 
    background-color: var(--dark-800);
    color: var(--text-800);
    font-size: 18px;
    font-weight: 900;
}

.heatmap-box.rating-bench,
.heatmap-box.rating-suspended,
.heatmap-box.rating-none {
    background-color: var(--dark-800);
    color: var(--text-800);
    font-size: 12px;
}
.heatmap-box.rating-suspended {
    color: var(--rating-5);
}

.text-rating-9  { color: var(--rating-9); }
.text-rating-8  { color: var(--rating-8); }
.text-rating-7  { color: var(--rating-7); }
.text-rating-6  { color: var(--rating-6); }
.text-rating-5  { color: var(--rating-5); }
.text-rating-low  { color: var(--rating-4); }

.segment.r9     { background-color: var(--rating-9); }
.segment.r8     { background-color: var(--rating-8); }
.segment.r7     { background-color: var(--rating-7); }
.segment.r6     { background-color: var(--rating-6); }
.segment.r5     { background-color: var(--rating-5); }

.segment.injured        { border-left: 2px solid var(--dark-1000); }
.segment.suspended      { border-left: 2px solid var(--dark-1000); color: var(--rating-5); font-size: 10px; }
.segment.bench          { border-left: 2px solid var(--dark-1000); }
.segment.not_in_squad   { border-left: 2px solid var(--dark-1000); }

.tooltip-content .match-date {
    font-size: 12px;
    margin-bottom: 4px;
}

.tooltip-content .match-result-row {
    font-size: 12px;
    font-weight: 500;
}

.tooltip-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 5px;
}



/* ==========================================================================
   11. MEDIA QUERIES
   ========================================================================== */








@keyframes slideInSidebar {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* FLAG POSITIONS */
.flag-ad { background-position: 0 0.406504%; }
.flag-ae { background-position: 0 0.813008%; }
.flag-af { background-position: 0 1.219512%; }
.flag-ag { background-position: 0 1.626016%; }
.flag-ai { background-position: 0 2.03252%; }
.flag-al { background-position: 0 2.439024%; }
.flag-am { background-position: 0 2.845528%; }
.flag-an { background-position: 0 3.252032%; }
.flag-ao { background-position: 0 3.658536%; }
.flag-aq { background-position: 0 4.06504%; }
.flag-ar { background-position: 0 4.471544%; }
.flag-as { background-position: 0 4.878048%; }
.flag-at { background-position: 0 5.284552%; }
.flag-au { background-position: 0 5.691056%; }
.flag-aw { background-position: 0 6.09756%; }
.flag-az { background-position: 0 6.504064%; }
.flag-ba { background-position: 0 6.910568%; }
.flag-bb { background-position: 0 7.317072%; }
.flag-bd { background-position: 0 7.723576%; }
.flag-be { background-position: 0 8.13008%; }
.flag-bf { background-position: 0 8.536584%; }
.flag-bg { background-position: 0 8.943088%; }
.flag-bh { background-position: 0 9.349592%; }
.flag-bi { background-position: 0 9.756096%; }
.flag-bj { background-position: 0 10.1626%; }
.flag-bm { background-position: 0 10.569104%; }
.flag-bn { background-position: 0 10.975608%; }
.flag-bo { background-position: 0 11.382112%; }
.flag-br { background-position: 0 11.788616%; }
.flag-bs { background-position: 0 12.19512%; }
.flag-bt { background-position: 0 12.601624%; }
.flag-bv { background-position: 0 13.008128%; }
.flag-bw { background-position: 0 13.414632%; }
.flag-by { background-position: 0 13.821136%; }
.flag-bz { background-position: 0 14.22764%; }
.flag-ca { background-position: 0 14.634144%; }
.flag-cc { background-position: 0 15.040648%; }
.flag-cd { background-position: 0 15.447152%; }
.flag-cf { background-position: 0 15.853656%; }
.flag-cg { background-position: 0 16.26016%; }
.flag-ch { background-position: 0 16.666664%; }
.flag-ci { background-position: 0 17.073168%; }
.flag-ck { background-position: 0 17.479672%; }
.flag-cl { background-position: 0 17.886176%; }
.flag-cm { background-position: 0 18.29268%; }
.flag-cn { background-position: 0 18.699184%; }
.flag-co { background-position: 0 19.105688%; }
.flag-cr { background-position: 0 19.512192%; }
.flag-cu { background-position: 0 19.918696%; }
.flag-cv { background-position: 0 20.3252%; }
.flag-cx { background-position: 0 20.731704%; }
.flag-cy { background-position: 0 21.138208%; }
.flag-cz { background-position: 0 21.544712%; }
.flag-de { background-position: 0 21.951216%; }
.flag-dj { background-position: 0 22.35772%; }
.flag-dk { background-position: 0 22.764224%; }
.flag-dm { background-position: 0 23.170728%; }
.flag-do { background-position: 0 23.577232%; }
.flag-dz { background-position: 0 23.983736%; }
.flag-ec { background-position: 0 24.39024%; }
.flag-ee { background-position: 0 24.796744%; }
.flag-eg { background-position: 0 25.203248%; }
.flag-eh { background-position: 0 25.609752%; }
.flag-er { background-position: 0 26.016256%; }
.flag-es { background-position: 0 26.42276%; }
.flag-et { background-position: 0 26.829264%; }
.flag-fi { background-position: 0 27.235768%; }
.flag-fj { background-position: 0 27.642272%; }
.flag-fk { background-position: 0 28.048776%; }
.flag-fm { background-position: 0 28.45528%; }
.flag-fo { background-position: 0 28.861784%; }
.flag-fr { background-position: 0 29.268288%; }
.flag-ga { background-position: 0 29.674792%; }
.flag-gd { background-position: 0 30.081296%; }
.flag-ge { background-position: 0 30.4878%; }
.flag-gf { background-position: 0 30.894304%; }
.flag-gh { background-position: 0 31.300808%; }
.flag-gi { background-position: 0 31.707312%; }
.flag-gl { background-position: 0 32.113816%; }
.flag-gm { background-position: 0 32.52032%; }
.flag-gn { background-position: 0 32.926824%; }
.flag-gp { background-position: 0 33.333328%; }
.flag-gq { background-position: 0 33.739832%; }
.flag-gr { background-position: 0 34.146336%; }
.flag-gs { background-position: 0 34.55284%; }
.flag-gt { background-position: 0 34.959344%; }
.flag-gu { background-position: 0 35.365848%; }
.flag-gw { background-position: 0 35.772352%; }
.flag-gy { background-position: 0 36.178856%; }
.flag-hk { background-position: 0 36.58536%; }
.flag-hm { background-position: 0 36.991864%; }
.flag-hn { background-position: 0 37.398368%; }
.flag-hr { background-position: 0 37.804872%; }
.flag-ht { background-position: 0 38.211376%; }
.flag-hu { background-position: 0 38.61788%; }
.flag-id { background-position: 0 39.024384%; }
.flag-ie { background-position: 0 39.430888%; }
.flag-il { background-position: 0 39.837392%; }
.flag-in { background-position: 0 40.243896%; }
.flag-io { background-position: 0 40.6504%; }
.flag-iq { background-position: 0 41.056904%; }
.flag-ir { background-position: 0 41.463408%; }
.flag-is { background-position: 0 41.869912%; }
.flag-it { background-position: 0 42.276416%; }
.flag-jm { background-position: 0 42.68292%; }
.flag-jo { background-position: 0 43.089424%; }
.flag-jp { background-position: 0 43.495928%; }
.flag-ke { background-position: 0 43.902432%; }
.flag-kg { background-position: 0 44.308936%; }
.flag-kh { background-position: 0 44.71544%; }
.flag-ki { background-position: 0 45.121944%; }
.flag-km { background-position: 0 45.528448%; }
.flag-kn { background-position: 0 45.934952%; }
.flag-kp { background-position: 0 46.341456%; }
.flag-kr { background-position: 0 46.74796%; }
.flag-kw { background-position: 0 47.154464%; }
.flag-ky { background-position: 0 47.560968%; }
.flag-kz { background-position: 0 47.967472%; }
.flag-la { background-position: 0 48.373976%; }
.flag-lb { background-position: 0 48.78048%; }
.flag-lc { background-position: 0 49.186984%; }
.flag-li { background-position: 0 49.593488%; }
.flag-lk { background-position: 0 49.999992%; }
.flag-lr { background-position: 0 50.406496%; }
.flag-ls { background-position: 0 50.813%; }
.flag-lt { background-position: 0 51.219504%; }
.flag-lu { background-position: 0 51.626008%; }
.flag-lv { background-position: 0 52.032512%; }
.flag-ly { background-position: 0 52.439016%; }
.flag-ma { background-position: 0 52.84552%; }
.flag-mc { background-position: 0 53.252024%; }
.flag-md { background-position: 0 53.658528%; }
.flag-me { background-position: 0 54.065032%; }
.flag-mg { background-position: 0 54.471536%; }
.flag-mh { background-position: 0 54.87804%; }
.flag-mk { background-position: 0 55.284544%; }
.flag-ml { background-position: 0 55.691048%; }
.flag-mm { background-position: 0 56.097552%; }
.flag-mn { background-position: 0 56.504056%; }
.flag-mo { background-position: 0 56.91056%; }
.flag-mp { background-position: 0 57.317064%; }
.flag-mq { background-position: 0 57.723568%; }
.flag-mr { background-position: 0 58.130072%; }
.flag-ms { background-position: 0 58.536576%; }
.flag-mt { background-position: 0 58.94308%; }
.flag-mu { background-position: 0 59.349584%; }
.flag-mv { background-position: 0 59.756088%; }
.flag-mw { background-position: 0 60.162592%; }
.flag-mx { background-position: 0 60.569096%; }
.flag-my { background-position: 0 60.9756%; }
.flag-mz { background-position: 0 61.382104%; }
.flag-na { background-position: 0 61.788608%; }
.flag-nc { background-position: 0 62.195112%; }
.flag-ne { background-position: 0 62.601616%; }
.flag-nf { background-position: 0 63.00812%; }
.flag-ng { background-position: 0 63.414624%; }
.flag-ni { background-position: 0 63.821128%; }
.flag-nl { background-position: 0 64.227632%; }
.flag-no { background-position: 0 64.634136%; }
.flag-np { background-position: 0 65.04064%; }
.flag-nr { background-position: 0 65.447144%; }
.flag-nu { background-position: 0 65.853648%; }
.flag-nz { background-position: 0 66.260152%; }
.flag-om { background-position: 0 66.666656%; }
.flag-pa { background-position: 0 67.07316%; }
.flag-pe { background-position: 0 67.479664%; }
.flag-pf { background-position: 0 67.886168%; }
.flag-pg { background-position: 0 68.292672%; }
.flag-ph { background-position: 0 68.699176%; }
.flag-pk { background-position: 0 69.10568%; }
.flag-pl { background-position: 0 69.512184%; }
.flag-pm { background-position: 0 69.918688%; }
.flag-pn { background-position: 0 70.325192%; }
.flag-pr { background-position: 0 70.731696%; }
.flag-pt { background-position: 0 71.1382%; }
.flag-pw { background-position: 0 71.544704%; }
.flag-py { background-position: 0 71.951208%; }
.flag-qa { background-position: 0 72.357712%; }
.flag-re { background-position: 0 72.764216%; }
.flag-ro { background-position: 0 73.17072%; }
.flag-rs { background-position: 0 73.577224%; }
.flag-ru { background-position: 0 73.983728%; }
.flag-rw { background-position: 0 74.390232%; }
.flag-sa { background-position: 0 74.796736%; }
.flag-sb { background-position: 0 75.20324%; }
.flag-sc { background-position: 0 75.609744%; }
.flag-sd { background-position: 0 76.016248%; }
.flag-se { background-position: 0 76.422752%; }
.flag-sg { background-position: 0 76.829256%; }
.flag-sh { background-position: 0 77.23576%; }
.flag-si { background-position: 0 77.642264%; }
.flag-sj { background-position: 0 78.048768%; }
.flag-sk { background-position: 0 78.455272%; }
.flag-sl { background-position: 0 78.861776%; }
.flag-sm { background-position: 0 79.26828%; }
.flag-sn { background-position: 0 79.674784%; }
.flag-so { background-position: 0 80.081288%; }
.flag-sr { background-position: 0 80.487792%; }
.flag-ss { background-position: 0 80.894296%; }
.flag-st { background-position: 0 81.3008%; }
.flag-sv { background-position: 0 81.707304%; }
.flag-sy { background-position: 0 82.113808%; }
.flag-sz { background-position: 0 82.520312%; }
.flag-tc { background-position: 0 82.926816%; }
.flag-td { background-position: 0 83.33332%; }
.flag-tf { background-position: 0 83.739824%; }
.flag-tg { background-position: 0 84.146328%; }
.flag-th { background-position: 0 84.552832%; }
.flag-tj { background-position: 0 84.959336%; }
.flag-tk { background-position: 0 85.36584%; }
.flag-tl { background-position: 0 85.772344%; }
.flag-tm { background-position: 0 86.178848%; }
.flag-tn { background-position: 0 86.585352%; }
.flag-to { background-position: 0 86.991856%; }
.flag-tp { background-position: 0 87.39836%; }
.flag-tr { background-position: 0 87.804864%; }
.flag-tt { background-position: 0 88.211368%; }
.flag-tv { background-position: 0 88.617872%; }
.flag-tw { background-position: 0 89.024376%; }
.flag-ty { background-position: 0 89.43088%; }
.flag-tz { background-position: 0 89.837384%; }
.flag-ua { background-position: 0 90.243888%; }
.flag-ug { background-position: 0 90.650392%; }
.flag-gb, .flag-uk { background-position: 0 91.056896%; }
.flag-um { background-position: 0 91.4634%; }
.flag-us { background-position: 0 91.869904%; }
.flag-uy { background-position: 0 92.276408%; }
.flag-uz { background-position: 0 92.682912%; }
.flag-va { background-position: 0 93.089416%; }
.flag-vc { background-position: 0 93.49592%; }
.flag-ve { background-position: 0 93.902424%; }
.flag-vg { background-position: 0 94.308928%; }
.flag-vi { background-position: 0 94.715432%; }
.flag-vn { background-position: 0 95.121936%; }
.flag-vu { background-position: 0 95.52844%; }
.flag-wf { background-position: 0 95.934944%; }
.flag-ws { background-position: 0 96.341448%; }
.flag-ye { background-position: 0 96.747952%; }
.flag-za { background-position: 0 97.154456%; }
.flag-zm { background-position: 0 97.56096%; }
.flag-zr { background-position: 0 97.967464%; }
.flag-zw { background-position: 0 98.373968%; }
.flag-nir { background-position: 0 98.780472%; }
.flag-eng, .flag-en { background-position: 0 99.186976%; }
.flag-wal { background-position: 0 99.59348%; }
.flag-sco { background-position: 0 100.0%; }


/* Mini Match Info (Player Card) */
.rating-day-wrapper {
    margin-left: 12px;
}

.card-mini-match {
    font-weight: 700;
    font-size: 10px;
    color: var(--text-900);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

/* ==========================================================================
   Player Cards (Home Highlight)
   ========================================================================== */
.player-card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 20px;
    margin-bottom: 60px;
}

.player-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background: var(--dark-800);
    border-radius: var(--border-radius);
    padding: 35px 23px 25px 20px;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;

    &.matchday {
        background: 
            radial-gradient(800px circle at 88% 88%, rgb(230 204 131 / 15%), #08090a 58%), 
            linear-gradient(150deg, #08090a 0%, #ffffff26 49%, #08090a 100%);
        -webkit-mask-image: 
            repeating-linear-gradient(130deg, #1010125e 0 4px, #00000070 4px 8px), 
            linear-gradient(45deg, #00000000 0%, #fff 50%, #00000000 100%);
    }

    &.month {
        background: 
            radial-gradient(800px circle at 88% 88%, rgb(40 180 99 / 11%), #08090a 58%), 
            linear-gradient(150deg, #08090a 0%, #ffffff26 49%, #08090a 100%);
        -webkit-mask-image: 
            repeating-linear-gradient(130deg, #1010125e 0 4px, #00000070 4px 8px), 
            linear-gradient(45deg, #00000000 0%, #fff 50%, #00000000 100%);
    }
}

.player-card:hover {
    transform: translateY(-2px);
}

/* Photo Column */
.card-photo-col {
    position: relative;
    align-self: center;
}

.card-player-img {
    width: 68px;
    height: 68px;
    position: relative;
    z-index: 1;
    border-radius: 50%;
    object-fit: cover;
    background: var(--dark-1000);
    mask-image: radial-gradient(circle at 106% 11%, transparent 19px, black 19px);
    padding: 5px;
}

.card-team-logo {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--dark-1000);
    padding: 5px;
    position: absolute;
    top: -10px;
    left: 56px;
    z-index: 1;
}

/* Info Column */
.card-info-col {
    flex: 1;
    text-align: center;
    margin-top: 8px;
}

.card-player-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-900);
    line-height: 1.3;
}

.card-team-name {
    display: block;
    color: var(--text-700);
    margin-top: 4px;
    font-size: 15px;
    line-height: 1.2;
}




.card-label {
    font-size: 10px;
    text-transform: uppercase;
    line-height: 1.3;
    text-align: center;
    letter-spacing: -0.5px;
    font-weight: 700;
    padding: 3px;
    
    &.gold {
        color: transparent;
        background-image:
            linear-gradient(180deg, rgba(255,255,255,.22), rgba(0,0,0,0)),
            linear-gradient(135deg, #fff3bf 0%, #f2d06b 22%, #b88f32 55%, #ffe08a 78%, #7a5a16 100%);
        -webkit-background-clip: text;
        background-clip: text;
        text-shadow: 0 1px 0 rgba(255,255,255,.12);
        /* color: #382c0a; */
        /* background: linear-gradient(160deg, #eee09d 0%, #b88f32 100%); */
    }

    &.bronze {
        /* color: #3d1f14; */
        /* background: linear-gradient(160deg, #f5dcc7 0%, #bf7e58 100%); */
    }

    &.platinum {
        /* color: #0b2233; */
        /* background: linear-gradient(160deg, #e6f6ff 0%, #6bb7d8 55%, #2c6d8a 100%); */
    }

    &.silver {
        color: transparent;
        background-image:
            linear-gradient(180deg, rgba(255,255,255,.22), rgba(0,0,0,0)),
            linear-gradient(135deg, #f5fcff 0%, #c6e2f0 25%, #7fb7cd 55%, #eaf6ff 78%, #3f6a7c 100%);
        -webkit-background-clip: text;
        background-clip: text;
        text-shadow: 0 1px 0 rgba(255,255,255,.10);
        /* color: #12212a; */
        /* background: linear-gradient(160deg, #f2fbff 0%, #b9d7e6 55%, #6c9fb6 100%); */
    }
}

.card-match-context {
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--text-700);
    display: flex;
}

/* Rating Column */
.card-rating-col {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 20px;
}

/* Response */
@media (max-width: 600px) {
    .player-card { 
        min-height: auto; 
    }
    .card-photo-col { 

    }
    .card-player-name { 
        font-size: 1.2rem; 
    }
}



/* ---------- Banner base ---------- */
.fg-banner{
    position:relative;
    overflow:hidden;
    border-radius:12px;
    padding:35px;
    border: 1px solid var(--dark-700);
}

.main-header-match .fg-banner {
    padding: 15px 10px 25px;
    margin-bottom: 40px;
}

.fg-banner__bg{
    position:absolute;
    inset:-40px -70px -40px -70px;
    background-image: var(--bg-badge-url);
    background-repeat:no-repeat;
    opacity:.1;
    filter: grayscale(1) contrast(1.25) brightness(1.05);
    background-size: 456px auto;
    background-position: 9% 23%;
    -webkit-mask-image: repeating-linear-gradient(115deg, rgba(0,0,0,.95) 0 2px, rgba(0,0,0,0) 2px 4px),
    radial-gradient(closest-side at 55% 50%, rgba(0,0,0,.95) 0 66%, rgba(0,0,0,0) 74%);
    mask-repeat: repeat, no-repeat;
    mask-size: auto, 100% 100%;
    -webkit-mask-repeat: repeat, no-repeat;
    -webkit-mask-size: auto, 100% 100%;
    clip-path: polygon(8% 12%, 28% 8%, 44% 18%, 58% 8%, 82% 14%,92% 34%, 80% 52%, 90% 70%, 70% 88%,48% 78%, 32% 92%, 16% 76%, 10% 54%, 18% 36%);
}

.fg-banner__team1 {
    position:absolute;
    inset:-40px -70px -40px -70px;
    inset: 0px 0px 0px -120px;
    background-image: var(--bg-badge-url);
    background-repeat:no-repeat;
    opacity:.1;
    filter: grayscale(1) contrast(1.25) brightness(1.05);
    background-size: 50% auto;
    background-position: -5% 23%;
    -webkit-mask-image: repeating-linear-gradient(115deg, rgba(0,0,0,.95) 0 2px, rgba(0,0,0,0) 2px 4px),
    radial-gradient(closest-side at 55% 50%, rgba(0,0,0,.95) 0 66%, rgba(0,0,0,0) 74%);
    mask-repeat: repeat, no-repeat;
    mask-size: auto, 100% 100%;
    -webkit-mask-repeat: repeat, no-repeat;
    -webkit-mask-size: auto, 100% 100%;
    clip-path: polygon(8% 12%, 28% 8%, 44% 18%, 58% 8%, 82% 14%,92% 34%, 80% 52%, 90% 70%, 70% 88%,48% 78%, 32% 92%, 16% 76%, 10% 54%, 18% 36%);
}

.fg-banner__team2 {
    position:absolute;
    inset:-40px -70px -40px -70px;
    inset: 0px -120px 0px 0px;
    background-image: var(--bg-badge-url);
    background-repeat:no-repeat;
    opacity:.1;
    filter: grayscale(1) contrast(1.25) brightness(1.05);
    background-size: 50% auto;
    background-position: 105% 23%;
    -webkit-mask-image: repeating-linear-gradient(115deg, rgba(0,0,0,.95) 0 2px, rgba(0,0,0,0) 2px 4px),
    radial-gradient(closest-side at 55% 50%, rgba(0,0,0,.95) 0 66%, rgba(0,0,0,0) 74%);
    mask-repeat: repeat, no-repeat;
    mask-size: auto, 100% 100%;
    -webkit-mask-repeat: repeat, no-repeat;
    -webkit-mask-size: auto, 100% 100%;
    clip-path: polygon(8% 12%, 28% 8%, 44% 18%, 58% 8%, 82% 14%,92% 34%, 80% 52%, 90% 70%, 70% 88%,48% 78%, 32% 92%, 16% 76%, 10% 54%, 18% 36%);
}
 

/* ---------- Contenido ---------- */
.fg-banner__content {
    position:relative;
    z-index:1;
    display:flex;
    gap:15px;
    align-items: center;
    justify-content: center;
}

.fg-banner h1{
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .2px;
    margin: 0 0 2px 0;
}

.fg-banner__badge{
  width:32px;
  height:32px;
}


.fg-banner__rank{
  font-size:14px;
  color: var(--text-700);
  display:flex;
  align-items:center;
  gap:3px;
}

.fg-banner__ranknum{
  letter-spacing:.3px;
}

.fg-banner__trendicon{
    width: 16px;
    height: 16px;
    fill: var(--rating-5);
}

.fg-banner__trendicon--up{
    fill: var(--rating-8);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
    padding: 50px 0 30px;
    margin-top: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--text-800);
    font-size: 14px;
    font-weight: 300;
}

.footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-800);
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--text-900);
    opacity: 1;
}

/* ==========================================================================
   LEGAL PAGES
   ========================================================================== */
.legal-body {
    background-color: #f4f4f5;
    color: #18181b;
}

.legal-page-header {
    background: #ffffff;
}

.legal-page-header-inner {
    max-width: 780px;
    margin: 0 auto;
    padding: 16px 24px;
}

.legal-container {
    max-width: 780px;
    margin: 0 auto;
    padding: 48px 24px 80px;
}

.legal-container h1 {
    margin-bottom: 6px;
    line-height: 1.25;
}

.legal-updated {
    color: #71717a;
    font-size: 14px;
    display: block;
    margin-bottom: 40px;
}

.legal-section {
    background: #ffffff;
    border-radius: 8px;
    padding: 24px 28px;
    margin-bottom: 16px;
}

.legal-section h2 {
    font-size: 14px;
    font-weight: 700;
    color: #18181b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 14px;
}

.legal-section p {
    font-size: 14px;
    line-height: 1.75;
    color: #3f3f46;
    margin-bottom: 10px;
}

.legal-section ul {
    list-style: disc;
    padding-left: 20px;
    margin-top: 6px;
    margin-bottom: 10px;
}

.legal-section li {
    font-size: 14px;
    line-height: 1.75;
    color: #3f3f46;
    margin-bottom: 4px;
}

.legal-section a {
    color: #16a34a;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.legal-section a:hover {
    color: #15803d;
    opacity: 1;
}

.legal-table-wrapper {
    overflow-x: auto;
    margin: 10px 0;
}

.legal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.legal-table th {
    text-align: left;
    padding: 8px 12px;
    background: #f4f4f5;
    color: #52525b;
    font-weight: 600;
    border-bottom: 1px solid #e4e4e7;
}

.legal-table td {
    padding: 8px 12px;
    color: #3f3f46;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}

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

.legal-page-footer {
    background: #ffffff;
    padding: 20px 0;
}

.legal-page-footer-inner {
    max-width: 780px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: #71717a;
}

.legal-page-footer-links {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.legal-page-footer-links a {
    color: #71717a;
    font-size: 12px;
}

.legal-page-footer-links a:hover {
    color: #18181b;
    opacity: 1;
}

@media (max-width: 600px) {
    .site-footer {
        flex-direction: column;
        align-items: flex-start;
    }
    .legal-page-footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .legal-page-footer-links {
        gap: 12px;
    }
    .legal-container {
        padding: 32px 16px 60px;
    }
    .legal-section {
        padding: 18px 16px;
    }
}






























/* 2. Media Queries para el contenedor .player-page */
/* Calculados para ir restando un cuadradito a la vez en player detail */

@media (max-width: 1366px) {
    .heatmap-team .heatmap-box:nth-child(n+10), .heatmap-header-container .heatmap-col-header:nth-child(n+10), 
    .month-cell-mixed:nth-child(n+10) { display: none; }
    .month-labels { width: calc(50px * 9 + 10px * 8); }
}

@media (max-width: 1220px) {
    .player-page { max-width: 890px; } 
    .heatmap-team .heatmap-box:nth-child(n+9), .heatmap-header-container .heatmap-col-header:nth-child(n+9),
    .month-cell-mixed:nth-child(n+9) { display: none; }
    .month-labels { width: calc(50px * 8 + 10px * 7); }
}

@media (max-width: 1152px) {
    .player-page { max-width: 830px; }
    .round { display: none; }
    .heatmap-team .heatmap-box:nth-child(8), .heatmap-header-container .heatmap-col-header:nth-child(8),
    .month-cell-mixed:nth-child(8) { display: none; }
    .month-labels { width: calc(50px * 7 + 10px * 6); }
}

@media (max-width: 1088px) {
    .player-page { max-width: 770px; }
    .steam-reviews-container { gap: 12px; }
    .steam-review-row { padding: 12px 12px 15px; }
    .heatmap-team .heatmap-box:nth-child(7), .heatmap-header-container .heatmap-col-header:nth-child(7),
    .month-cell-mixed:nth-child(6) { display: none; }
    .month-labels { width: calc(50px * 6 + 10px * 5); }
    .switcher-option { padding: 12px 20px; }
}

@media (max-width: 1024px) {
    .player-page { max-width: 710px; }
    .match-compact-team .team-name { display: none; }
    .match-compact-team { gap: 6px; }
    .heatmap-team .heatmap-box:nth-child(6), .heatmap-header-container .heatmap-col-header:nth-child(6),
    .month-cell-mixed:nth-child(5) { display: none; }
    .month-labels { width: calc(50px * 5 + 10px * 4); }
}

@media (max-width: 960px) {
    .player-page { max-width: 650px; }
    .match-compact-tournament { display: none; }
    .history-cards-wrapper {  grid-template-columns: max-content max-content 1fr 54px; }
}

/* Por debajo de aqui se esconde el sidebar */
@media (max-width: 900px) {
    .player-page { max-width: 774px; width: 774px; }
    
    /* topbar */
    .desktop-search { display: none; }
    .mobile-menu-btn { display: block; }
    .mobile-search-btn { display: block; }
    .topbar .topbar-branding { display: block; }
    .topbar-inner { justify-content: space-between; } /* Center logo */

    /* Sidebar */
    .sidebar-nav::before, .sidebar-nav::after { display: none; } /* Elimina los desvanecimientos */
    .sidebar.open { display: block; animation: slideInSidebar 0.2s ease-out; } /* Efecto menú */
    .nav-link { font-size: 16px; padding: 6px 0; } /* Menu un poco mas grande */
    .sidebar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 300px;
        height: auto;
        background-color: var(--dark-1000);
        z-index: 2000;
        overflow-y: auto;
        box-shadow: 0 0 200px var(--dark-1000);
    }
    .sidebar-scroll-wrapper { overflow: visible; } /* Para que el scroll no afecte a la animación del sidebar */

    /* player row */
    .face-col { width: 24px; } /* Cara en player row compacta */
    .player-face-img { width: 24px; height: 24px; } /* Cara en player row mas pequeña */
    .info-col { padding: 0 0 0 6px; } /* Disminuye padding entre escudo y nombre en player row */
    .home-side .info-col { padding: 0 6px 0 0; } 
    
}

@media (max-width: 780px) {
    .player-page { max-width: 710px; width: 710px; }
    .team-card-container {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        scroll-padding-left: var(--_slider-inset);
        gap: 12px;
        margin-left: calc(-1 * var(--_slider-inset));
        margin-right: calc(-1 * var(--_slider-inset));
        padding-left: var(--_slider-inset);
        padding-right: var(--_slider-inset);
        margin-bottom: 30px;
    }
}

/* Eliminamos padding a los lados en player-page y minimizamos en match-page */
@media (max-width: 710px) {
    .player-page { max-width: 590px; width: 590px; padding: 0; }
    .match-page { padding: 0 12px; }
}

@media (max-width: 610px) {
    .player-page { max-width: 530px; width: 530px; }
    .player-chart-card { flex: 1 1 100%; }
    .heatmap-team .heatmap-box:nth-child(5), .heatmap-header-container .heatmap-col-header:nth-child(5),
    .month-cell-mixed:nth-child(4) { display: none; }
    .month-labels { width: calc(50px * 4 + 10px * 3); }
}

@media (max-width: 540px) {
    .player-page { max-width: 470px; width: 470px; }
    .match-compact-date.desktop { display: none; }
    .match-compact-date.mobile { display: block; }
    .history-cards-wrapper { gap: 8px; }
    .stat-hint { padding: 0; background: none; }
    .stat-mins { padding: 0; background: none; }
    .team-compact-score { flex: 0 0 18px; }
    .match-compact-result { gap: 4px;}
    .match-compact-team { gap: 4px; }
}

/* Por debajo de aqui el ancho es siempre 100% con padding a los lados */
@media (max-width: 480px) {
    .player-page, .team-page, .tournament-page, .index-page { max-width: 100%; width: 100%; padding: 0 12px; }
    /* Heatmap : cajas dinámicas, gap fijo */
    .heatmap-player { grid-template-columns: repeat(auto-fit, minmax(42px, 1fr)); gap: 8px; }
    .heatmap-team { gap: 8px; }
    .heatmap-player .heatmap-box {  min-height: 36px; width: auto;}
    .heatmap-team .heatmap-box, .history-cards-wrapper .heatmap-box,
    .comparison-row .heatmap-box { min-height: 36px; width: 44px; }
    .heatmap-header-container { gap: 8px; }
    .heatmap-col-header { width: 44px; }
    .match-compact-result, .match-compact-date, .match-compact-tournament, .player-stat-info { padding: 6px 8px; }
    .history-cards-wrapper { grid-template-columns: max-content max-content minmax(0, 1fr) 44px; } /* Permitimos que la columna info colapse por debajo de su contenido */
    .team-card-container, .player-card-container { gap: 12px; }
    /* player row */
    .player-row-wrapper, .comparison-row { gap: 8px; margin-bottom: 8px; }
    .player-info-card { padding: 5px 1px; }
    .club-col { width: 12px; position: relative; height: 100%; }
    .club-logo-img { width: 12px; height: 12px; position: absolute; top: 0; left: -3px;}
    .home-side .club-logo-img { left: 3px; }
    .info-col, .home-side .info-col { padding: 0 }
     /* team cards */
    .team-card { width: 19vw; } /* cabrán 4 cards y media en pantalla */
}

/* 3 cuadraditos */
@media (max-width: 412px) {
    .match-compact-date.mobile { font-size: 11px; }
    .player-stat-info { white-space: nowrap; overflow: hidden; text-overflow: clip; } /* corta el texto cuando no cabe */
    .team-card { width: 25vw; } /* cabrán 3 cards y media en pantalla */
}

