/* Shared Countries / Categories ranking cards */
.geo-rank-page {
    width: min(100%, 1480px);
    margin: 0 auto;
    padding: 22px 26px 48px;
    color: #edf2f8;
}
.geo-rank-page,
.geo-rank-page * { box-sizing: border-box; }
.geo-rank-page .geo-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    margin: 0 0 16px;
    padding: 25px 28px;
    border: 1px solid #293443;
    border-radius: 18px;
    background: linear-gradient(120deg,#151d29,#0f151e);
}
.geo-rank-page .geo-eyebrow {
    display: block;
    color: #d6ff3f;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .13em;
    text-transform: uppercase;
}
.geo-rank-page .geo-page-header h1 {
    margin: 9px 0 7px;
    color: #f7f9fc;
    font-size: clamp(28px,3vw,42px);
    line-height: 1.08;
    font-weight: 900;
    letter-spacing: -.04em;
}
.geo-rank-page .geo-page-header p {
    margin: 0;
    color: #aab6c6;
    font-size: 13px;
    line-height: 1.55;
}
.geo-rank-page .geo-period-switch {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border: 1px solid #2b3748;
    border-radius: 12px;
    background: #111923;
}
.geo-rank-page .geo-period-switch label {
    color: #aebbd0;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.geo-rank-page .geo-period-switch select {
    min-width: 150px;
    min-height: 42px;
    padding: 8px 34px 8px 12px;
    border: 1px solid #39475b;
    border-radius: 8px;
    background: #0b111b;
    color: #f4f6fa;
    font-size: 13px;
}
.geo-rank-page .geo-period-note {
    margin: 0 0 16px;
    color: #9ba9bb;
    font-size: 12px;
}
.geo-rank-page .geo-period-note strong { color: #d6ff3f; }
.geo-rank-page .geo-metric-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 16px;
    align-items: start;
}
.geo-rank-page .geo-metric-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #293443;
    border-radius: 15px;
    background: linear-gradient(145deg,#141c27,#10161f);
    box-shadow: 0 8px 24px rgba(0,0,0,.14);
}
.geo-rank-page .geo-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 58px;
    padding: 15px 17px;
    border-bottom: 1px solid rgba(148,163,184,.13);
    background: rgba(255,255,255,.018);
}
.geo-rank-page .geo-card-heading h2 {
    margin: 0;
    color: #f1f5f9;
    font-size: 15px;
    font-weight: 850;
    letter-spacing: -.015em;
}
.geo-rank-page .geo-card-heading > span {
    flex: 0 0 auto;
    padding: 5px 8px;
    border: 1px solid rgba(214,255,63,.2);
    border-radius: 6px;
    background: rgba(214,255,63,.07);
    color: #d6ff3f;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .08em;
}
.geo-rank-page .geo-metric-card ol {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: none;
}
.geo-rank-page .geo-metric-card li {
    display: grid;
    grid-template-columns: 28px minmax(0,1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 43px;
    margin: 0;
    padding: 8px 16px;
    border-bottom: 1px solid rgba(148,163,184,.09);
    color: #e5edf7;
    font-size: 12px;
    line-height: 1.35;
}
.geo-rank-page .geo-metric-card li:last-child { border-bottom: 0; }
.geo-rank-page .geo-rank-position {
    display: grid;
    place-items: center;
    width: 23px;
    height: 23px;
    border-radius: 7px;
    background: #202a37;
    color: #aebbd0;
    font-size: 10px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}
.geo-rank-page .geo-metric-card li:nth-child(-n+3) .geo-rank-position {
    background: rgba(214,255,63,.1);
    color: #d6ff3f;
}
.geo-rank-page .geo-metric-card li a {
    min-width: 0;
    overflow: hidden;
    color: #dce5f1;
    font-size: 12px;
    font-weight: 650;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.geo-rank-page .geo-metric-card li a:hover { color: #d6ff3f; }
.geo-rank-page .geo-metric-card li strong {
    color: #f7f9fc;
    font-size: 12px;
    font-weight: 850;
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.geo-rank-page .geo-metric-card li.geo-empty {
    display: block;
    padding: 20px 16px;
    color: #8492a6;
    font-size: 12px;
    text-align: center;
}
@media(max-width:900px) {
    .geo-rank-page { padding: 18px 16px 36px; }
    .geo-rank-page .geo-metric-grid { grid-template-columns: minmax(0,1fr); }
}
@media(max-width:600px) {
    .geo-rank-page { padding: 14px 12px 30px; }
    .geo-rank-page .geo-page-header { align-items: stretch; flex-direction: column; padding: 20px 17px; }
    .geo-rank-page .geo-period-switch { align-items: stretch; flex-direction: column; }
    .geo-rank-page .geo-period-switch select { width: 100%; }
    .geo-rank-page .geo-metric-card li { grid-template-columns: 25px minmax(0,1fr) auto; gap: 7px; padding-inline: 11px; }
}


/* Country / Category detail athlete table */
.geo-rank-page .geo-athlete-table-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    border: 1px solid #293443;
    border-radius: 14px;
    background: #101720;
    box-shadow: 0 8px 24px rgba(0,0,0,.14);
    scrollbar-width: thin;
    scrollbar-color: #39475b #111923;
}

.geo-rank-page .geo-athlete-table {
    width: 100%;
    min-width: 980px;
    margin: 0;
    border: 0;
    border-collapse: separate;
    border-spacing: 0;
    color: #e5edf7;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.geo-rank-page .geo-athlete-table th,
.geo-rank-page .geo-athlete-table td {
    padding: 13px 15px;
    border: 0;
    border-bottom: 1px solid rgba(148,163,184,.10);
    text-align: right;
    vertical-align: middle;
    white-space: nowrap;
}

.geo-rank-page .geo-athlete-table th {
    background: #151e2a;
    color: #9eacbf;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.geo-rank-page .geo-athlete-table th:first-child,
.geo-rank-page .geo-athlete-table td:first-child {
    width: 48px;
    text-align: center;
}

.geo-rank-page .geo-athlete-table th:nth-child(2),
.geo-rank-page .geo-athlete-table td:nth-child(2) {
    min-width: 250px;
    text-align: left;
}

.geo-rank-page .geo-athlete-table tbody tr {
    background: transparent;
    transition: background .15s ease;
}

.geo-rank-page .geo-athlete-table tbody tr:hover {
    background: rgba(255,255,255,.035);
}

.geo-rank-page .geo-athlete-table tbody tr:last-child td {
    border-bottom: 0;
}

.geo-rank-page .geo-athlete-table td:first-child {
    color: #aebbd0;
    font-weight: 800;
}

.geo-rank-page .geo-athlete-cell {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 11px;
    text-align: left;
}

.geo-rank-page .geo-athlete-cell img {
    display: block;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border: 1px solid #344154;
    border-radius: 50%;
    background: #202a37;
    object-fit: cover;
}

.geo-rank-page .geo-athlete-cell > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.geo-rank-page .geo-athlete-cell strong {
    overflow: hidden;
    color: #f1f5f9;
    font-size: 12px;
    font-weight: 800;
    text-overflow: ellipsis;
}

.geo-rank-page .geo-athlete-cell small {
    overflow: hidden;
    color: #8998ac;
    font-size: 11px;
    text-overflow: ellipsis;
}

.geo-rank-page .geo-athlete-table .geo-empty {
    padding: 28px 16px;
    color: #8998ac;
    text-align: center;
    white-space: normal;
}

@media (max-width: 600px) {
    .geo-rank-page .geo-athlete-table-wrap {
        border-radius: 11px;
    }

    .geo-rank-page .geo-athlete-table {
        min-width: 920px;
    }

    .geo-rank-page .geo-athlete-table th,
    .geo-rank-page .geo-athlete-table td {
        padding: 11px 12px;
    }
}


/* Country detail heading, flag and period buttons */
.geo-rank-page .geo-country-heading { min-width: 0; }
.geo-rank-page .geo-country-title-row {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
}
.geo-rank-page .geo-country-title-row h1 { margin: 9px 0 7px; }
.geo-rank-page .geo-country-flag {
    display: block;
    flex: 0 0 48px;
    width: 48px;
    height: 36px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 7px;
    background: #202a37;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0,0,0,.22);
}
.geo-rank-page .geo-period-switch {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
}
.geo-rank-page .geo-period-label {
    color: #aebbd0;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .08em;
}
.geo-rank-page .geo-period-buttons {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px;
    border: 1px solid #2b3748;
    border-radius: 10px;
    background: #0b111b;
}
.geo-rank-page .geo-period-buttons button {
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: #aebbd0;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.geo-rank-page .geo-period-buttons button:hover {
    color: #f7f9fc;
    background: rgba(255,255,255,.06);
}
.geo-rank-page .geo-period-buttons button.is-active {
    border-color: rgba(214,255,63,.28);
    background: rgba(214,255,63,.12);
    color: #d6ff3f;
}
@media (max-width: 600px) {
    .geo-rank-page.country-detail-page { padding: 12px 10px 28px; }
    .geo-rank-page.country-detail-page .geo-page-header {
        gap: 18px;
        padding: 17px 14px;
        border-radius: 14px;
    }
    .geo-rank-page .geo-country-title-row { gap: 10px; }
    .geo-rank-page .geo-country-title-row h1 {
        min-width: 0;
        margin: 5px 0;
        font-size: clamp(25px, 7vw, 34px);
        overflow-wrap: anywhere;
    }
    .geo-rank-page .geo-country-flag {
        flex-basis: 42px;
        width: 42px;
        height: 32px;
    }
    .geo-rank-page .geo-country-heading p { font-size: 12px; }
    .geo-rank-page .geo-period-switch {
        width: 100%;
        align-items: stretch;
        gap: 7px;
        padding: 0;
        border: 0;
        background: transparent;
    }
    .geo-rank-page .geo-period-label { padding-left: 2px; }
    .geo-rank-page .geo-period-buttons {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
        gap: 4px;
        padding: 4px;
        border-radius: 10px;
    }
    .geo-rank-page .geo-period-buttons button {
        min-width: 0;
        min-height: 42px;
        padding: 8px 3px;
        border-radius: 7px;
        font-size: 11px;
        white-space: nowrap;
    }
    .geo-rank-page .geo-period-note { margin-bottom: 12px; }
}

@media (max-width: 360px) {
    .geo-rank-page .geo-period-buttons button { font-size: 10px; }
}


/* Mobile athlete cards: prevent oversized thumbnails and horizontal table clipping */
@media (max-width: 600px) {
    .geo-rank-page.country-detail-page .geo-athlete-table-wrap {
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }
    .geo-rank-page.country-detail-page .geo-athlete-table {
        display: block;
        width: 100%;
        min-width: 0;
        border-collapse: separate;
    }
    .geo-rank-page.country-detail-page .geo-athlete-table thead { display: none; }
    .geo-rank-page.country-detail-page .geo-athlete-table tbody {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    .geo-rank-page.country-detail-page .geo-athlete-table tbody tr {
        display: grid;
        grid-template-columns: 30px minmax(0, 1fr);
        gap: 0 9px;
        padding: 12px;
        border: 1px solid #293443;
        border-radius: 13px;
        background: linear-gradient(145deg, #141c27, #10161f);
    }
    .geo-rank-page.country-detail-page .geo-athlete-table tbody td {
        display: flex;
        min-width: 0;
        align-items: center;
        justify-content: space-between;
        padding: 8px 0;
        border: 0;
        border-bottom: 1px solid rgba(148,163,184,.09);
        text-align: right;
        white-space: normal;
        font-size: 12px;
    }
    .geo-rank-page.country-detail-page .geo-athlete-table tbody td:first-child {
        grid-column: 1;
        grid-row: 1;
        justify-content: center;
        align-self: start;
        width: auto;
        padding-top: 12px;
        color: #d6ff3f;
        font-weight: 900;
    }
    .geo-rank-page.country-detail-page .geo-athlete-table tbody td:nth-child(2) {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
        padding: 2px 0 12px;
        text-align: left;
    }
    .geo-rank-page.country-detail-page .geo-athlete-cell {
        width: 100%;
        gap: 11px;
    }
    .geo-rank-page.country-detail-page .geo-athlete-cell img {
        display: block !important;
        flex: 0 0 48px !important;
        width: 48px !important;
        min-width: 48px !important;
        max-width: 48px !important;
        height: 48px !important;
        min-height: 48px !important;
        max-height: 48px !important;
        border-radius: 50% !important;
        object-fit: cover !important;
    }
    .geo-rank-page.country-detail-page .geo-athlete-cell strong {
        display: block;
        max-width: 100%;
        font-size: 13px;
        white-space: normal;
    }
    .geo-rank-page.country-detail-page .geo-athlete-cell small {
        display: block;
        max-width: 100%;
        font-size: 11px;
        white-space: normal;
    }
    .geo-rank-page.country-detail-page .geo-athlete-table tbody td:nth-child(n+3) {
        grid-column: 1 / -1;
        gap: 12px;
    }
    .geo-rank-page.country-detail-page .geo-athlete-table tbody td:nth-child(n+3)::before {
        content: attr(data-label);
        color: #8f9db0;
        font-size: 10px;
        font-weight: 800;
        letter-spacing: .04em;
        text-transform: uppercase;
        text-align: left;
    }
    .geo-rank-page.country-detail-page .geo-athlete-table tbody td:last-child { border-bottom: 0; }
    .geo-rank-page.country-detail-page .geo-athlete-table .geo-empty {
        display: block;
        grid-column: 1 / -1;
        text-align: center;
    }
}


/* Explicit mobile athlete cards. Separate markup avoids table-layout conflicts on phones. */
.geo-rank-page.country-detail-page .geo-mobile-athletes { display: none; }
@media (max-width: 700px) {
  .geo-rank-page.country-detail-page .geo-desktop-athletes { display: none !important; }
  .geo-rank-page.country-detail-page .geo-mobile-athletes {
    display: flex !important; flex-direction: column; gap: 12px; width: 100%; min-width: 0;
  }
  .geo-rank-page.country-detail-page .geo-mobile-athlete-card {
    display: block; width: 100%; min-width: 0; margin: 0; padding: 13px;
    border: 1px solid #293443; border-radius: 13px;
    background: linear-gradient(145deg,#141c27,#10161f);
    box-shadow: 0 7px 20px rgba(0,0,0,.13);
  }
  .geo-rank-page.country-detail-page .geo-mobile-athlete-heading {
    display: grid; grid-template-columns: 28px 48px minmax(0,1fr); align-items: center; gap: 10px;
    min-width: 0; padding-bottom: 12px; border-bottom: 1px solid rgba(148,163,184,.13);
  }
  .geo-rank-page.country-detail-page .geo-mobile-athlete-rank {
    color: #d6ff3f; font-size: 13px; font-weight: 900; text-align: center;
  }
  .geo-rank-page.country-detail-page .geo-mobile-athlete-heading img {
    display: block !important; width: 48px !important; height: 48px !important;
    min-width: 48px !important; max-width: 48px !important; min-height: 48px !important; max-height: 48px !important;
    margin: 0 !important; border: 1px solid #344154; border-radius: 50%; object-fit: cover;
  }
  .geo-rank-page.country-detail-page .geo-mobile-athlete-name {
    display: flex; flex-direction: column; gap: 3px; min-width: 0;
  }
  .geo-rank-page.country-detail-page .geo-mobile-athlete-name strong {
    display: block; color: #f1f5f9; font-size: 13px; line-height: 1.3; overflow-wrap: anywhere;
  }
  .geo-rank-page.country-detail-page .geo-mobile-athlete-name small {
    display: block; color: #8998ac; font-size: 11px; overflow-wrap: anywhere;
  }
  .geo-rank-page.country-detail-page .geo-mobile-athlete-metrics {
    display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 14px;
  }
  .geo-rank-page.country-detail-page .geo-mobile-athlete-metrics > div {
    display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 10px 0;
    border-bottom: 1px solid rgba(148,163,184,.08);
  }
  .geo-rank-page.country-detail-page .geo-mobile-athlete-metrics span {
    color: #8998ac; font-size: 9px; font-weight: 800; letter-spacing: .045em; text-transform: uppercase;
  }
  .geo-rank-page.country-detail-page .geo-mobile-athlete-metrics strong {
    color: #e5edf7; font-size: 12px; line-height: 1.3; overflow-wrap: anywhere; font-variant-numeric: tabular-nums;
  }
  .geo-rank-page.country-detail-page .geo-mobile-empty {
    padding: 22px 14px; color: #8998ac; text-align: center; border: 1px solid #293443; border-radius: 12px;
  }
}

/* Country detail mobile: keep the three core metrics on one row. */
@media (max-width: 700px) {
  .geo-rank-page.country-detail-page .geo-mobile-athlete-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 8px;
  }

  .geo-rank-page.country-detail-page .geo-mobile-athlete-metrics > div {
    min-width: 0;
    padding: 10px 0 9px;
  }

  .geo-rank-page.country-detail-page .geo-mobile-athlete-metrics span {
    font-size: 8px;
    line-height: 1.2;
    letter-spacing: .025em;
    overflow-wrap: anywhere;
  }

  .geo-rank-page.country-detail-page .geo-mobile-athlete-metrics strong {
    font-size: 11px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
