:root {
    --color-navy: #0d1420;
    --color-navy-light: #16213a;
    --color-black: #05070a;
    --color-white: #ffffff;
    --color-yellow: #d7ff1e;
    --color-yellow-dim: rgba(215, 255, 30, 0.14);
    --color-blue: #4fa3ff;
    --color-blue-dim: rgba(79, 163, 255, 0.16);
    --color-gray: rgba(255, 255, 255, 0.56);
    --color-gray-faint: rgba(255, 255, 255, 0.34);
    --color-gray-light: rgba(255, 255, 255, 0.1);
    --color-bg: #05070a;
    --color-danger: #ff6b6b;
    --color-success: #3ddc84;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 24px 48px -22px rgba(0, 0, 0, 0.7);
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-display: 'Oswald', 'Arial Narrow', sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 106.25%;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    background-image:
        linear-gradient(rgba(5, 7, 10, 0.4), rgba(5, 7, 10, 0.4)),
        url("../images/background_web-ksEUAYj.png");
    background-position: center top;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    color: var(--color-white);
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    color: var(--color-yellow);
}

.icon {
    display: inline-block;
    vertical-align: -3px;
    flex-shrink: 0;
}

.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Header */
.site-header {
    position: relative;
    background: var(--color-navy);
    border-bottom: 1px solid var(--color-gray-light);
}

.site-header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
    background: linear-gradient(90deg, var(--color-yellow), transparent 60%);
    opacity: 0.7;
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    padding: 6px 11px;
}

.brand {
    display: flex;
    align-items: center;
}

.brand__logo {
    display: block;
    height: 52px;
    width: auto;
}

.brand__logo--sm {
    height: 26px;
}

.site-nav {
    display: flex;
    gap: 24px;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.site-nav a {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 4px;
}

.site-nav a:hover,
.site-nav a.is-active {
    color: var(--color-yellow);
}

.site-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--color-yellow);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.22s ease;
}

.site-nav a:hover::after {
    transform: scaleX(1);
}

.site-nav a.is-active::after {
    transform: scaleX(1);
}

.header-collapse {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
    gap: 32px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-divider {
    width: 1px;
    height: 22px;
    background: var(--color-gray-light);
}

.burger-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 9px;
    border: 1.5px solid rgba(255, 255, 255, 0.22);
    background: transparent;
    color: var(--color-white);
    cursor: pointer;
}

.burger-toggle.is-open {
    background: var(--color-yellow);
    color: var(--color-black);
    border-color: var(--color-yellow);
}

.header-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5, 7, 10, 0.72);
    z-index: 25;
}

.header-backdrop.is-open {
    display: block;
}

body.no-scroll {
    overflow: hidden;
}

.locale-switcher {
    display: flex;
    gap: 6px;
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
}

.locale-switcher__link {
    padding: 3px 8px;
    border-radius: 5px;
    color: var(--color-gray);
}

.locale-switcher__link.is-active {
    color: var(--color-black);
    background: var(--color-yellow);
}

/* Main */
.site-main {
    padding: 15px 10px 10px;
    min-height: 60vh;
}

@media (max-width: 640px) {
    body {
        background-image:
            linear-gradient(rgba(5, 7, 10, 0.36), rgba(5, 7, 10, 0.36)),
            url("../images/background_phone-mUH0pzM.png");
        background-position: center top;
    }
}

.flash {
    padding: 10px 14px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.flash--success {
    background: rgba(61, 220, 132, 0.14);
    color: var(--color-success);
}

.flash--error {
    background: rgba(255, 107, 107, 0.14);
    color: var(--color-danger);
}

/* Footer */
.site-footer {
    background: var(--color-black);
    color: var(--color-gray);
    font-size: 0.85rem;
    padding: 40px 16px 20px;
    border-top: 1px solid var(--color-gray-light);
    margin-top: 0px;
}

.footer-top {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    gap: 32px;
    padding-bottom: 28px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.footer-brand .brand__logo {
    height: 44px;
}

.footer-brand__tagline {
    margin: 0;
    max-width: 320px;
    line-height: 1.6;
}

.footer-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.footer-col__heading {
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-gray-faint);
    margin: 0 0 2px;
}

.footer-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--color-white);
    font-size: 0.86rem;
}

.footer-link:hover {
    color: var(--color-yellow);
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 18px;
    border-top: 1px solid var(--color-gray-light);
    font-size: 0.76rem;
}

.footer-bottom__credit {
    color: var(--color-gray);
    font-size: 0.68rem;
    text-align: center;
}

.footer-bottom__credit a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--color-gray-light);
    text-underline-offset: 3px;
}

.footer-bottom__credit a:hover {
    color: var(--color-white);
}

/* Page heading */
.page-title {
    font-family: var(--font-display);
    font-size: 1.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    margin: 0 0 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Cards */
.card {
    background: var(--color-navy);
    border: 1px solid var(--color-gray-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    margin-bottom: 20px;
}

.card__title {
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-gray);
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Tables */
.table-wrap {
    overflow-x: auto;
    background: var(--color-navy);
    border: 1px solid var(--color-gray-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.2rem;
    font-variant-numeric: tabular-nums;
}

th,
td {
    padding: 11px 12px;
    text-align: left;
    white-space: nowrap;
}

thead th {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-gray-faint);
    border-bottom: 1px solid var(--color-gray-light);
}

tbody tr {
    border-bottom: 1px solid var(--color-gray-light);
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
    box-shadow: inset 3px 0 0 var(--color-yellow);
}

tbody tr:last-child {
    border-bottom: none;
}

/* Responsive tables: each row always stays a single line, like a real table row — on narrow
   screens the less critical columns are hidden rather than wrapping or clipping, since a wide
   data table never fits a phone. The full detail is always one tap away (the player page). */
.hide-desktop {
    display: none;
}

.table-hint {
    font-size: 0.78rem;
    color: var(--color-gray);
    margin: 8px 2px 0;
}

@media (max-width: 560px) {
    .hide-mobile {
        display: none;
    }

    .hide-desktop {
        display: block;
    }
}

tr.rank-top-3 {
    background: linear-gradient(90deg, rgba(215, 255, 30, 0.08), transparent);
    font-weight: 700;
}

.rank-row--1 td:first-child {
    box-shadow: inset 4px 0 0 var(--gold, #ffe07a);
}

.rank-row--2 td:first-child {
    box-shadow: inset 4px 0 0 var(--silver, #d7dee6);
}

.rank-row--3 td:first-child {
    box-shadow: inset 4px 0 0 var(--bronze, #e6b585);
}

/* The ranking page runs its type a size up, same reasoning as the other "headline" pages. */
.ranking-page .page-header__title {
    font-size: 3rem;
}

.ranking-page .page-header__subtitle {
    font-size: 1.02rem;
}

.ranking-page .filter-bar {
    align-items: center;
    margin-bottom: 20px;
}

@media (max-width: 640px) {
    .ranking-page__banner {
        display: none;
    }

    .ranking-page .page-header__title {
        font-size: 2.2rem;
    }
}

.rank-position {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    font-weight: 700;
    font-size: 0.8rem;
}

.rank-position--gold {
    background: linear-gradient(145deg, #ffe07a, #d4a017);
    color: #3a2900;
    font-size: 1rem;
}

.rank-position--silver {
    background: linear-gradient(145deg, #eef1f4, #b8c0c8);
    color: #1c2430;
    font-size: 1rem;
}

.rank-position--bronze {
    background: linear-gradient(145deg, #e6b585, #ad6a35);
    color: #3a1f00;
    font-size: 1rem;
}

/* Ranking has two purpose-built views. Desktop keeps the quick comparison of a table while
   grouping related values; phones and narrow tablets use complete player cards instead of
   hiding columns or forcing horizontal scrolling. */
.ranking-mobile {
    display: none;
}

.ranking-table {
    font-size: 0.88rem;
}

.ranking-table th,
.ranking-table td {
    padding: 10px 9px;
    text-align: center;
}

.ranking-table thead th {
    font-size: 0.65rem;
}

.ranking-table__player a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin: 0 auto;
    max-width: 150px;
    overflow: hidden;
    font-size: 0.94rem;
    font-weight: 700;
    text-overflow: ellipsis;
}

.ranking-table__number,
.ranking-table__points,
.ranking-table__score,
.ranking-percentage {
    font-family: var(--font-display);
    font-size: 0.98rem;
    font-weight: 700;
}

.ranking-table__points {
    color: var(--color-yellow);
    font-size: 1.75rem;
    text-shadow: 0 0 10px rgba(215, 255, 30, 0.35);
}

.ranking-position-index {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--color-yellow);
    font-family: var(--font-display);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.ranking-position-index--desktop {
    min-width: 42px;
    gap: 3px;
}

.ranking-position-index--desktop strong {
    font-size: 1rem;
}

.ranking-record {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    font-family: var(--font-display);
    font-size: 0.95rem;
}

.ranking-record strong {
    color: var(--color-yellow);
}

.ranking-record small,
.ranking-game-balance small,
.ranking-table__last-match small {
    color: var(--color-gray-faint);
}

.ranking-game-balance,
.ranking-table__last-match {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ranking-game-balance strong {
    font-family: var(--font-display);
    font-size: 0.95rem;
}

.ranking-game-balance small,
.ranking-table__last-match small {
    font-size: 0.62rem;
}

.ranking-game-balance.is-positive strong,
.ranking-streak.is-positive {
    color: var(--color-success);
}

.ranking-game-balance.is-negative strong,
.ranking-streak.is-negative {
    color: var(--color-danger);
}

.ranking-streak {
    display: block;
    margin-top: 5px;
    color: var(--color-gray);
    font-size: 0.58rem;
    font-weight: 700;
    white-space: nowrap;
}

.ranking-no-data {
    color: var(--color-gray-faint);
}

@media (max-width: 1100px) {
    .ranking-desktop {
        display: none;
    }

    .ranking-mobile {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .ranking-mobile-card {
        position: relative;
        display: block;
        overflow: hidden;
        padding: 13px;
        border: 1px solid var(--color-gray-light);
        border-radius: var(--radius);
        background: var(--color-navy);
        box-shadow: var(--shadow);
        color: var(--color-white);
    }

    .ranking-mobile-card::before {
        content: "";
        position: absolute;
        inset: 0 auto 0 0;
        width: 3px;
        background: transparent;
    }

    .ranking-mobile-card.rank-row--1 {
        background: linear-gradient(100deg, rgba(255, 224, 122, 0.1), var(--color-navy) 58%);
    }

    .ranking-mobile-card.rank-row--1::before {
        background: var(--gold, #ffe07a);
    }

    .ranking-mobile-card.rank-row--2::before {
        background: var(--silver, #d7dee6);
    }

    .ranking-mobile-card.rank-row--3::before {
        background: var(--bronze, #e6b585);
    }

    .ranking-mobile-card__header {
        display: grid;
        grid-template-columns: 70px auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
    }

    .ranking-mobile-card__header>.avatar {
        width: 70px !important;
    }

    .ranking-position-index--mobile {
        align-self: stretch;
        min-height: 82px;
        padding-right: 12px;
        border-right: 1px solid rgba(215, 255, 30, 0.18);
    }

    .ranking-position-index--mobile strong {
        font-size: clamp(3.1rem, 9vw, 6.5rem);
        letter-spacing: -0.09em;
    }

    .ranking-mobile-card__identity {
        display: flex;
        flex-direction: column;
        min-width: 0;
        gap: 3px;
    }

    .ranking-mobile-card__identity strong {
        overflow: hidden;
        font-family: var(--font-display);
        font-size: 2rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ranking-mobile-card__identity small {
        color: var(--color-gray);
        font-size: 0.65rem;
    }

    .ranking-mobile-card__totals {
        display: flex;
        gap: 7px;
    }

    .ranking-mobile-card__totals>span {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-width: 56px;
        min-height: 45px;
        padding: 4px 7px;
        border: 1px solid var(--color-gray-light);
        border-radius: 7px;
        background: rgba(255, 255, 255, 0.025);
    }

    .ranking-mobile-card__totals strong {
        color: var(--color-yellow);
        font-family: var(--font-display);
        font-size: 1.08rem;
        line-height: 1;
    }

    .ranking-mobile-card__totals .ranking-mobile-card__points {
        min-width: 88px;
        min-height: 94px;
        border-color: rgba(215, 255, 30, 0.5);
        background: rgba(215, 255, 30, 0.055);
    }

    .ranking-mobile-card__totals .ranking-mobile-card__points strong {
        font-size: clamp(2.8rem, 7vw, 4rem);
        letter-spacing: -0.06em;
        text-shadow: 0 0 10px rgba(215, 255, 30, 0.35);
    }

    .ranking-mobile-card__totals .ranking-mobile-card__points small {
        font-size: 0.62rem;
        font-weight: 700;
    }

    .ranking-mobile-card__average {
        display: flex;
        align-items: baseline;
        justify-content: center;
        gap: 5px;
        width: 100%;
        margin-top: 6px;
        padding-top: 6px;
        border-top: 1px solid rgba(215, 255, 30, 0.18);
    }

    .ranking-mobile-card__average small {
        margin: 0;
        color: var(--color-gray);
        font-size: 0.5rem;
    }

    .ranking-mobile-card__average b {
        color: var(--color-white);
        font-family: var(--font-display);
        font-size: 0.72rem;
    }

    .ranking-mobile-card__totals small {
        margin-top: 4px;
        color: var(--color-gray);
        font-size: 0.5rem;
        text-transform: uppercase;
    }

    .ranking-mobile-card__primary-stats {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        margin-top: 12px;
        border: 1px solid var(--color-gray-light);
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.018);
    }

    .ranking-mobile-card__primary-stats>span {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 5px;
        padding: 9px 5px;
        text-align: center;
    }

    .ranking-mobile-card__primary-stats>span+span {
        border-left: 1px solid var(--color-gray-light);
    }

    .ranking-mobile-card__primary-stats small,
    .ranking-mobile-card__details small {
        color: var(--color-gray);
        font-size: 0.58rem;
        line-height: 1.2;
        text-transform: uppercase;
        letter-spacing: 0.035em;
    }

    .ranking-mobile-card__primary-stats strong {
        font-family: var(--font-display);
        font-size: 1rem;
    }

    .ranking-mobile-card__primary-stats i,
    .ranking-mobile-card__details i {
        margin: 0 4px;
        color: var(--color-gray-faint);
        font-style: normal;
    }

    .ranking-mobile-card__details {
        display: grid;
        grid-template-columns: 0.9fr 1.1fr;
        gap: 10px;
        margin-top: 10px;
    }

    .ranking-mobile-card__details>div {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 5px 8px;
        min-width: 0;
        padding: 9px 10px;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.025);
        text-align: center;
    }

    .ranking-mobile-card__details small {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        grid-column: 1 / -1;
    }

    .ranking-mobile-card__details>div>strong {
        font-family: var(--font-display);
        font-size: 0.9rem;
    }

    .ranking-mobile-card__details>div>span:last-child {
        font-size: 0.65rem;
        font-weight: 700;
        text-align: center;
    }

    .ranking-mobile-card__details .form-dots {
        align-self: center;
    }

    .ranking-mobile-card__details .ranking-streak {
        margin-top: 0;
    }
}

@media (max-width: 640px) {
    .ranking-page .filter-bar {
        align-items: stretch;
        padding: 13px;
    }

    .ranking-page .filter-pills {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .ranking-page .filter-pill {
        justify-content: center;
        padding: 8px 7px;
        font-size: 0.64rem;
    }
}

@media (max-width: 420px) {
    .ranking-mobile-card__header {
        grid-template-columns: 86px auto minmax(0, 1fr) auto;
        gap: 7px;
    }

    .ranking-position-index--mobile {
        min-height: 72px;
        padding-right: 9px;
    }

    .ranking-position-index--mobile strong {
        font-size: clamp(3.5rem, 16vw, 4.5rem);
    }

    .ranking-mobile-card__totals .ranking-mobile-card__points {
        min-width: 76px;
        padding-inline: 5px;
    }

    .ranking-mobile-card__details {
        grid-template-columns: 1fr;
    }
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-family: var(--font-display);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge--planned {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-white);
}

.badge--played {
    background: rgba(61, 220, 132, 0.16);
    color: var(--color-success);
}

.badge--mixed {
    background: var(--color-yellow-dim);
    color: var(--color-yellow);
}

.badge--standard {
    background: var(--color-blue-dim);
    color: var(--color-blue);
}

.badge--indoor {
    background: rgba(154, 111, 255, 0.16);
    color: #b79bff;
}

.badge--outdoor {
    background: rgba(255, 149, 74, 0.16);
    color: #ffb37a;
}

/* Recent form */
.form-dots {
    display: inline-flex;
    gap: 4px;
}

.form-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-white);
    font-size: 0.72rem;
    font-weight: 700;
}

.form-dot--0 {
    background: rgba(255, 107, 107, 0.18);
    color: #ff9d9d;
}

.form-dot--1 {
    background: rgba(255, 179, 92, 0.18);
    color: #ffc98a;
}

.form-dot--2 {
    background: rgba(61, 220, 132, 0.18);
    color: #7bebac;
}

.form-dot--3 {
    background: var(--color-yellow);
    color: var(--color-black);
}

/* Avatars: always a 2:3 portrait — the real uploaded photo, or a mock stand-in until
   one is uploaded (see the player_avatar macro). */
.avatar {
    display: block;
    aspect-ratio: 2 / 3;
    height: auto;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 7px;
    border: 2px solid var(--color-navy);
    background: var(--color-navy-light);
}

.player-avatar-link {
    position: relative;
    z-index: 2;
    display: inline-flex;
    flex-shrink: 0;
    border-radius: 9px;
}

.player-avatar-link:focus-visible {
    outline: 2px solid var(--color-yellow);
    outline-offset: 3px;
}

/* A match card keeps its full-card destination while player portraits above it remain
   independent links to their player profiles. */
.match-link-card {
    position: relative;
}

.match-link-card__target {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
}

.match-link-card__target:focus-visible {
    outline: 2px solid var(--color-yellow);
    outline-offset: -2px;
}

/* A match's participants: each one is its own column — photo on top, name below,
   never overlapping (see the match_player macro). */
.match-players {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.match-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.match-player__photo {
    position: relative;
    width: 100%;
}

.match-player__name {
    font-size: 0.72rem;
    color: var(--color-gray);
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-row .match-player--colored .avatar {
    border-color: var(--player-color);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--player-color) 35%, transparent);
}

.result-row .match-player--colored .match-player__name {
    color: var(--player-color);
    font-weight: 700;
}

/* Match list */
.match-card__meta {
    font-size: 0.8rem;
    color: var(--color-gray);
}

/* Sets */
.set-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--color-gray-light);
    gap: 12px;
    flex-wrap: wrap;
}

.set-card:last-child {
    border-bottom: none;
}

.set-card__label {
    font-family: var(--font-display);
    font-size: 0.72rem;
    text-transform: uppercase;
    color: var(--color-gray);
    letter-spacing: 0.04em;
    width: 60px;
}

.set-card__team {
    font-weight: 600;
}

.set-card__score {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-white);
    min-width: 70px;
    text-align: center;
}

.set-card__team--winner {
    color: var(--color-success);
}

/* Points table */
.points-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.points-list__row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-gray-light);
}

.points-list__row:last-child {
    border-bottom: none;
}

.points-list__value {
    font-family: var(--font-display);
    font-weight: 700;
}

/* Player profile hero: photo, name/meta, rank highlight and the four headline stats,
   all in one card over a dark court photo. */
.profile-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
    padding: 32px;
    background-color: var(--color-navy);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: 30% center;
}

.profile-hero .avatar {
    box-shadow: var(--shadow);
    flex-shrink: 0;
}

.profile-hero__info {
    flex: 1 1 200px;
    min-width: 0;
}

.profile-hero__name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 2.6rem;
    text-transform: uppercase;
    line-height: 1;
    margin: 0 0 10px;
    text-wrap: balance;
}

.profile-hero__nickname {
    color: var(--color-gray);
    font-size: 1rem;
    margin: 0 0 8px;
}

.profile-hero__meta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 0.84rem;
    color: var(--color-gray);
}

.profile-hero__meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.profile-hero__rank {
    flex: 0 0 92px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 10px;
    border-radius: var(--radius);
    border: 1px solid var(--color-gray-light);
    background: rgba(5, 7, 10, 0.55);
}

.profile-hero__rank .icon {
    color: var(--color-yellow);
}

.profile-hero__rank-value {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.7rem;
    color: var(--color-yellow);
}

.profile-hero__rank-label {
    font-size: 0.6rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-gray);
    text-align: center;
}

.profile-hero__stats {
    flex: 0 0 auto;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.profile-hero__stats .stat-tile {
    min-width: 92px;
    background: rgba(5, 7, 10, 0.55);
    margin-bottom: 0;
}

.stat-tile__icon {
    color: var(--color-yellow);
    margin-bottom: 6px;
    display: flex;
    justify-content: center;
}

.icon-box {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: var(--color-yellow-dim);
    color: var(--color-yellow);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

@media (max-width: 780px) {
    .profile-hero {
        justify-content: center;
        text-align: center;
        background-position: center 20%;
    }

    .profile-hero__meta {
        justify-content: center;
    }

    .profile-hero__stats {
        justify-content: center;
        width: 100%;
    }
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.stat-tile {
    background: var(--color-navy);
    border: 1px solid var(--color-gray-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px;
    text-align: center;
}

.stat-tile__value {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.stat-tile--positive .stat-tile__value {
    color: var(--color-success);
}

.stat-tile--negative .stat-tile__value {
    color: var(--color-danger);
}

.stat-tile--accent .stat-tile__value {
    color: var(--color-yellow);
}

.stat-tile__label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--color-gray);
    letter-spacing: 0.04em;
}

.section-title {
    font-family: var(--font-display);
    font-size: 0.92rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin: 28px 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.empty-state {
    color: var(--color-gray);
    font-style: italic;
    padding: 16px 0;
}

/* Forms (login / enter result) */
.auth-card {
    max-width: 360px;
    margin: 40px auto;
}

.form-row {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-row label {
    font-size: 0.8rem;
    font-weight: 600;
}

.form-row input,
input[type="text"],
input[type="number"],
select {
    padding: 9px 11px;
    border-radius: 8px;
    border: 1px solid var(--color-gray-light);
    background: var(--color-black);
    color: var(--color-white);
    font-size: 0.95rem;
    font-family: var(--font-sans);
}

.form-row input:focus,
input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    outline: 2px solid var(--color-yellow);
    outline-offset: 1px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--color-yellow);
    color: var(--color-black);
    border: none;
    padding: 11px 20px;
    border-radius: 9px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: pointer;
}

.button:hover {
    background: #c2eb12;
    color: var(--color-black);
}

.button--ghost {
    background: transparent;
    color: var(--color-white);
    border: 1.5px solid rgba(255, 255, 255, 0.28);
}

.button--ghost:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-white);
}

.button--sm {
    padding: 8px 16px;
    font-size: 0.76rem;
}

.form-errors {
    color: var(--color-danger);
    font-size: 0.8rem;
}

/* ---------------------------------------------------------------------- */
/* Page header (eyebrow + big title + subtitle), used on the matches page */
/* ---------------------------------------------------------------------- */

.page-header__eyebrow {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--color-yellow);
    margin: 0 0 8px;
}

.page-header__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 2.6rem;
    line-height: 1.02;
    text-transform: uppercase;
    margin: 0 0 8px;
    text-wrap: balance;
}

.page-header__subtitle {
    font-size: 0.95rem;
    color: var(--color-gray);
    margin: 0;
}

.filter-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid var(--color-gray-light);
    color: var(--color-white);
    background: transparent;
    cursor: pointer;
}

.filter-pill.is-active {
    background: var(--color-yellow);
    color: var(--color-black);
    border-color: var(--color-yellow);
}

/* ---------------------------------------------------------------------- */
/* Match rows (matches page): a date block, the four players, the score  */
/* ---------------------------------------------------------------------- */

.match-row {
    position: relative;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px 20px;
    padding: 18px 20px 18px 30px;
    overflow: hidden;
}

.match-row::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 8px;
    background: repeating-linear-gradient(-45deg, var(--color-yellow) 0 5px, #05070a 5px 10px);
}

.match-row__date {
    flex: 0 0 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.match-row__date-weekday {
    font-family: var(--font-display);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-gray);
}

.match-row__date-day {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-yellow);
    line-height: 1.1;
}

.match-row__date-sub {
    font-size: 0.68rem;
    color: var(--color-gray);
    line-height: 1.3;
}

.match-row__teams {
    flex: 1 1 220px;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.match-row__vs {
    color: var(--color-gray-faint);
    font-weight: 500;
    margin-right: 6px;
}

.match-row__meta {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--color-gray);
}

.match-row__score {
    flex: 0 0 auto;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--color-yellow);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

@media (max-width: 780px) {
    .match-row {
        flex-wrap: wrap;
    }

    .match-row__date {
        flex-direction: row;
        align-items: center;
        gap: 9px;
        flex: 0 0 auto;
    }

    .match-row__date-weekday {
        font-size: 0.8rem;
    }

    .match-row__date-day {
        font-size: 2.65rem;
        line-height: 1;
    }

    .match-row__date-sub {
        font-size: 0.9rem;
        font-weight: 600;
        line-height: 1.4;
    }

    .match-row__score {
        font-size: 1.65rem;
    }
}

@media (max-width: 640px) {
    .matches-page__banner {
        display: none;
    }
}

/* ---------------------------------------------------------------------- */
/* Players list: filter bar and player rows                               */
/* ---------------------------------------------------------------------- */

.filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.filter-bar__search {
    flex: 1 1 220px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 9px;
    border: 1px solid var(--color-gray-light);
    background: var(--color-black);
    color: var(--color-gray);
}

.filter-bar__search input {
    border: none;
    background: transparent;
    padding: 0;
    flex: 1;
    color: var(--color-white);
    font-size: 0.9rem;
}

.filter-bar__search input:focus {
    outline: none;
}

.filter-bar__field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-bar__field label {
    font-size: 0.64rem;
    letter-spacing: 0.06em;
    color: var(--color-gray-faint);
}

.filter-bar__field select {
    min-width: 150px;
}

.players-row {
    position: relative;
    display: flex;
    align-items: stretch;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
}

.players-row::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: var(--color-yellow);
    z-index: 1;
}

.players-row--left::before {
    background: var(--color-blue);
}

/* The photo dictates the row's height (it's the tallest child); everything else stretches
   to match it and centers its own content within that height. */
.players-row .avatar {
    flex-shrink: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
    margin-left: 5px;
}

.players-row__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 16px 20px 16px 16px;
}

.players-row__info {
    flex: 1 1 180px;
    min-width: 0;
}

.players-row__name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 2.15rem;
    text-transform: uppercase;
    margin: 0 0 6px;
}

.players-row__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: var(--color-gray);
    margin: 0;
}

.players-row__meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Match detail: one set's result, teams either side of the score, winner highlighted. */
.match-set-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px 4px;
    border-bottom: 1px solid var(--color-gray-light);
}

.match-set-row:last-child {
    border-bottom: none;
}

/* Match detail "Jugadors" card: 4 columns that actually fill the row's width — the avatar
   itself grows to its column's size (not just extra gap between fixed-size avatars), keeping
   its 2:3 aspect ratio from .avatar. The inline width the player_avatar macro sets needs
   !important to be overridden, same pattern as the mobile match-players override below. */
.match-jugadors-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.match-jugadors-grid__player {
    flex: 1 1 0;
    min-width: 64px;
    text-align: center;
}

.match-jugadors-grid__photo {
    position: relative;
}

.match-jugadors-grid__player .avatar {
    width: 100% !important;
}

.current-ranking-badge {
    display: none;
}

.match-jugadors-grid__name {
    margin: 8px 0 0;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
}

.current-ranking-badge {
    position: absolute;
    z-index: 4;
    right: 6px;
    bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 30px;
    padding: 0;
    border: 1px solid rgba(215, 255, 30, 0.9);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(8, 16, 24, 0.96), rgba(20, 31, 34, 0.96));
    box-shadow: 0 0 12px rgba(215, 255, 30, 0.42), inset 0 0 10px rgba(215, 255, 30, 0.08);
    color: var(--color-white);
    white-space: nowrap;
}

.current-ranking-badge strong {
    color: var(--color-yellow);
    font-family: var(--font-display);
    font-size: 1.1rem;
    line-height: 1;
    text-shadow: 0 0 8px rgba(215, 255, 30, 0.65);
}

.match-set-row__label {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-yellow);
    text-align: center;
}

.match-set-row__result {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    width: 100%;
    max-width: 760px;
}

.match-set-row__side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 0;
    text-align: center;
    font-weight: 600;
    color: var(--color-white);
}

.match-set-row__photos {
    display: flex;
    align-items: center;
    justify-content: center;
}

.match-set-row__player {
    display: contents;
}

.match-set-row__player-name {
    display: none;
}

.match-set-row__player+.match-set-row__player .player-avatar-link {
    margin-left: -20px;
}

.match-set-row__player:last-child .player-avatar-link {
    z-index: 3;
}

.match-set-row__names {
    display: block;
    width: 100%;
    overflow: hidden;
    font-size: 1rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.match-set-row__side.is-winner {
    color: var(--color-yellow);
    font-weight: 700;
}

.match-set-row__score {
    flex: 0 0 auto;
    min-width: 120px;
    text-align: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 3.4rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.match-set-row__score .is-winner {
    color: var(--color-yellow);
}

.match-set-row__score-separator {
    color: var(--color-white);
}

@media (min-width: 981px) {
    .match-set-row {
        padding: 10px 4px;
    }

    .match-set-row__label {
        font-size: 24px;
    }

    .match-set-row__result {
        gap: clamp(24px, 4vw, 48px);
        max-width: 860px;
    }

    .match-set-row__photos {
        align-items: flex-start;
        gap: 18px;
    }

    .match-set-row__player {
        display: flex;
        flex: 0 1 124px;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        min-width: 108px;
    }

    .match-set-row__player+.match-set-row__player .player-avatar-link {
        margin-left: 0;
    }

    .match-set-row__player .player-avatar-link,
    .match-set-row__player .avatar {
        width: 96px !important;
    }

    .match-set-row__side.is-loser .avatar {
        border-color: rgba(255, 255, 255, 0.18);
        filter: grayscale(0.8);
        opacity: 0.9;
    }

    .match-set-row__player-name {
        display: block;
        width: 100%;
        font-size: 1rem;
        line-height: 1.2;
        overflow-wrap: anywhere;
    }

    .match-set-row__names--compact {
        display: none;
    }

    .match-set-row__score {
        min-width: 150px;
        font-size: 6rem;
    }
}

.points-list__value--pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    padding: 4px 10px;
    border: 1px solid var(--color-gray-light);
    border-radius: 8px;
    font-size: 1.1rem;
}

/* The match detail page runs its type a size up — it's a "moment" page (result, teams,
   score), not a dense list, so it earns the extra room. */
.match-page .page-header__title {
    font-size: 3rem;
}

.match-page .page-header__subtitle {
    font-size: 1.02rem;
}

.match-page .card__title {
    font-size: 1.05rem;
}

.match-page .points-list__row {
    font-size: 0.95rem;
}

.match-points-list__games,
.match-partner-breakdown {
    display: none;
}

/* Match points: prominent fluorescent score boxes, matching the visual weight of
   the main result without changing generic points lists elsewhere in the site. */
.match-points-card {
    position: relative;
    overflow: hidden;
}

.match-points-card .card__title svg {
    color: var(--color-yellow);
}

.match-points-list {
    position: relative;
    isolation: isolate;
    gap: 3px;
}

.match-points-list::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: 8%;
    right: -14px;
    width: 100px;
    height: 84%;
    filter: blur(24px);
    pointer-events: none;
}

.match-points-list .points-list__row {
    position: relative;
    align-items: center;
    min-height: 54px;
    padding: 4px 10px 4px 16px;
    border: 1px solid rgba(215, 255, 30, 0.16);
    border-radius: 7px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.025), rgba(215, 255, 30, 0.035));
    box-shadow: inset 0 0 12px rgba(215, 255, 30, 0.025);
    font-size: 1rem;
}

.match-points-list .points-list__row:last-child {
    border-bottom: 1px solid rgba(215, 255, 30, 0.16);
}

.match-points-list .points-list__value--pill {
    box-sizing: border-box;
    width: 64px;
    min-width: 64px;
    height: 44px;
    padding: 0;
    border-color: var(--color-yellow);
    border-radius: 7px;
    background: rgba(9, 18, 24, 0.82);
    box-shadow: 0 0 9px rgba(215, 255, 30, 0.72), inset 0 0 9px rgba(215, 255, 30, 0.12);
    color: var(--color-yellow);
    font-size: 2rem;
    line-height: 1;
    text-shadow: 0 0 10px rgba(215, 255, 30, 0.7);
}

.match-points-list__games {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-left: auto;
    margin-right: 10px;
    font-family: var(--font-display);
    font-size: 0.62rem;
    font-weight: 500;
    white-space: nowrap;
}

.match-points-list__games-won,
.match-points-list__games-lost {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    text-align: center;
}

.match-points-list__games strong {
    font-size: 1rem;
    line-height: 1;
}

.match-points-list__games .icon circle {
    fill: currentColor;
    stroke: currentColor;
}

.match-points-list__games .icon path {
    stroke: var(--color-navy);
    stroke-width: 1.5;
}

.match-points-list__games-won {
    color: var(--color-yellow);
}

.match-points-list__games-lost {
    color: var(--color-danger);
}

.match-partner-breakdown {
    display: block;
}

.match-partner-breakdown .card__title svg {
    color: var(--color-yellow);
}

.match-partner-breakdown__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.match-partner-breakdown__player {
    display: grid;
    grid-template-columns: minmax(90px, 0.7fr) repeat(2, minmax(135px, 1fr));
    align-items: stretch;
    overflow: hidden;
    border: 1px solid var(--color-gray-light);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.018);
}

.match-partner-breakdown__header {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 8px;
    border-right: 1px solid var(--color-gray-light);
    font-family: var(--font-display);
    font-size: 0.88rem;
}

.match-partner-breakdown__header strong {
    overflow: hidden;
    min-width: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.match-partner-breakdown__result {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    min-width: 0;
    min-height: 70px;
    padding: 6px;
}

.match-partner-breakdown__result+.match-partner-breakdown__result {
    border-left: 1px solid var(--color-gray-light);
}

.match-partner-breakdown__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    border-radius: 6px;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
}

.match-partner-breakdown__result--won .match-partner-breakdown__count {
    border: 1px solid rgba(215, 255, 30, 0.65);
    background: rgba(215, 255, 30, 0.08);
    box-shadow: 0 0 7px rgba(215, 255, 30, 0.28);
    color: var(--color-yellow);
}

.match-partner-breakdown__result--lost .match-partner-breakdown__count {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.035);
    color: var(--color-gray);
}

.match-partner-breakdown__label {
    display: none;
}

.match-partner-breakdown__partners {
    display: flex;
    justify-content: center;
    gap: 4px;
    min-width: 0;
}

.match-partner-breakdown__partner {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-width: 28px;
    max-width: 42px;
    color: var(--color-white);
    font-size: 0.58rem;
    line-height: 1;
    text-align: center;
}

.match-partner-breakdown__partner .player-avatar-link,
.match-partner-breakdown__partner .avatar {
    width: 28px !important;
}

.match-partner-breakdown__partner>span {
    overflow: hidden;
    width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.match-partner-breakdown__result--lost .avatar {
    border-color: rgba(255, 255, 255, 0.18);
    filter: grayscale(1) brightness(0.74) contrast(1.12);
    opacity: 0.9;
}

.match-partner-breakdown__empty {
    color: var(--color-gray-faint);
}

@media (max-width: 640px) {
    .match-page__banner {
        display: none;
    }

    .match-set-row {
        gap: 13px;
        padding: 13px 0;
    }

    .match-set-row__result {
        gap: 4px;
    }

    .current-ranking-badge {
        right: 4px;
        bottom: 4px;
        width: 30px;
        height: 25px;
        border-radius: 6px;
    }

    .current-ranking-badge strong {
        font-size: 0.92rem;
    }

    .match-set-row__photos {
        align-items: flex-start;
        gap: 4px;
    }

    .match-set-row__player {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        width: clamp(44px, 13vw, 52px);
        min-width: 0;
    }

    .match-set-row__photos .player-avatar-link,
    .match-set-row__photos .avatar {
        width: clamp(44px, 13vw, 52px) !important;
    }

    .match-set-row__player+.match-set-row__player .player-avatar-link {
        margin-left: 0;
    }

    .match-set-row__player-name {
        display: block;
        overflow: hidden;
        width: 100%;
        font-size: 0.62rem;
        line-height: 1.15;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .match-set-row__names--compact {
        display: none;
    }

    .match-set-row__side.is-loser .avatar,
    .match-partner-breakdown__result--lost .avatar {
        border-color: rgba(255, 255, 255, 0.18);
        filter: grayscale(1) brightness(0.74) contrast(1.12);
        opacity: 0.9;
    }

    .match-set-row__score {
        min-width: 88px;
        font-size: 4rem;
        letter-spacing: -0.05em;
    }

    .match-set-row__names {
        font-size: 0.78rem;
    }

    .match-points-list .points-list__row {
        display: flex;
        gap: 8px;
        min-height: 54px;
        padding: 4px 8px;
    }

    .match-points-list .points-list__row>a {
        overflow: hidden;
        flex: 1 1 auto;
        min-width: 0;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .match-points-list .points-list__value--pill {
        width: 56px;
        min-width: 56px;
        height: 42px;
    }

    .match-points-list__games {
        flex: 0 0 auto;
        justify-content: center;
        gap: 6px;
        margin: 0;
    }

    .match-points-list__games-won,
    .match-points-list__games-lost {
        flex: 0 0 auto;
        justify-content: center;
        padding: 0;
    }

    .match-partner-breakdown__player {
        grid-template-columns: minmax(72px, 0.65fr) repeat(2, minmax(0, 1fr));
    }

    .match-partner-breakdown__header {
        gap: 4px;
        padding: 4px;
        font-size: 0.72rem;
    }

    .match-partner-breakdown__header .player-avatar-link,
    .match-partner-breakdown__header .avatar {
        width: 30px !important;
    }

    .match-partner-breakdown__result {
        grid-template-columns: 30px minmax(0, 1fr);
        gap: 3px;
        min-height: 58px;
        padding: 3px;
    }

    .match-partner-breakdown__count {
        min-height: 26px;
        font-size: 0.78rem;
    }

    .match-partner-breakdown__partners {
        gap: 2px;
    }

    .match-partner-breakdown__partner {
        min-width: 20px;
        max-width: 28px;
        font-size: 0.46rem;
    }

    .match-partner-breakdown__partner .player-avatar-link,
    .match-partner-breakdown__partner .avatar {
        width: 20px !important;
    }

    .match-page .page-header__title {
        font-size: 2.2rem;
    }
}

/* Upcoming match history: recent meetings and the accumulated record of every pair that
   will play together. The panels sit side by side on desktop and become a single stream on
   narrow screens. */
.match-history {
    display: grid;
    grid-template-columns: minmax(300px, 0.85fr) minmax(520px, 1.45fr);
    gap: 20px;
    margin-top: 20px;
}

.match-history>.card {
    min-width: 0;
    margin-bottom: 0;
}

.match-history__heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.match-history__heading .card__title {
    margin-bottom: 5px;
}

.match-history__heading .card__title svg {
    color: var(--color-yellow);
}

.match-history__description {
    max-width: 600px;
    margin: 0;
    color: var(--color-gray);
    font-size: 0.78rem;
    line-height: 1.45;
}

.match-history__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 185px;
    padding: 24px;
    border: 1px dashed var(--color-gray-light);
    border-radius: 10px;
    color: var(--color-gray);
    text-align: center;
}

.match-history__empty-icon {
    display: inline-flex;
    margin-bottom: 9px;
    color: var(--color-gray-faint);
}

.match-history__empty p {
    margin: 0;
    font-size: 0.86rem;
}

.match-history__matches {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.match-history-row {
    display: grid;
    grid-template-columns: minmax(92px, 1fr) auto 18px;
    align-items: center;
    gap: 12px;
    min-height: 67px;
    padding: 9px 10px 9px 13px;
    border: 1px solid var(--color-gray-light);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.018);
    transition: border-color 160ms ease, background 160ms ease;
}

.match-history-row:hover {
    border-color: rgba(215, 255, 30, 0.42);
    background: rgba(215, 255, 30, 0.025);
}

.match-history-row__meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 3px;
}

.match-history-row__meta strong {
    font-family: var(--font-display);
    font-size: 0.9rem;
}

.match-history-row__meta span {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow: hidden;
    color: var(--color-gray);
    font-size: 0.68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.match-history-row__scores {
    display: flex;
    gap: 5px;
}

.match-history-row__score {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 45px;
    min-height: 45px;
    border: 1px solid rgba(215, 255, 30, 0.2);
    border-radius: 7px;
    background: rgba(215, 255, 30, 0.035);
}

.match-history-row__score small {
    color: var(--color-gray);
    font-size: 0.48rem;
    line-height: 1;
    text-transform: uppercase;
}

.match-history-row__score strong {
    margin-top: 4px;
    color: var(--color-white);
    font-family: var(--font-display);
    font-size: 0.92rem;
    font-variant-numeric: tabular-nums;
}

.match-history-row__arrow {
    display: inline-flex;
    color: var(--color-gray-faint);
}

.pair-affinity-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.pair-affinity {
    min-width: 0;
    padding: 11px;
    border: 1px solid var(--color-gray-light);
    border-radius: 9px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.025), rgba(215, 255, 30, 0.018));
}

.pair-affinity__players {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
}

.pair-affinity__avatars {
    display: flex;
    padding-left: 8px;
}

.pair-affinity__avatars .player-avatar-link+.player-avatar-link {
    margin-left: -8px;
}

.pair-affinity__avatars .avatar {
    border-color: var(--color-navy-light);
}

.pair-affinity__names {
    overflow: hidden;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pair-affinity__names small {
    color: var(--color-gray-faint);
    font-size: 0.65rem;
}

.pair-affinity__percentage,
.pair-affinity__new {
    color: var(--color-yellow);
    font-family: var(--font-display);
    font-size: 1rem;
}

.pair-affinity__new {
    font-size: 0.68rem;
    text-transform: uppercase;
}

.pair-affinity__bar {
    overflow: hidden;
    height: 3px;
    margin: 10px 0;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.09);
}

.pair-affinity__bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--color-yellow);
    box-shadow: 0 0 8px rgba(215, 255, 30, 0.55);
}

.pair-affinity--empty .pair-affinity__bar span {
    display: none;
}

.pair-affinity__stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}

.pair-affinity__stats>div {
    min-width: 0;
}

.pair-affinity__stats dt {
    margin-bottom: 4px;
    color: var(--color-gray);
    font-size: 0.59rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pair-affinity__stats dd {
    display: flex;
    gap: 7px;
    margin: 0;
    font-family: var(--font-display);
    font-size: 0.72rem;
}

.pair-affinity__stats .is-positive {
    color: var(--color-yellow);
}

.pair-affinity__stats .is-negative {
    color: var(--color-gray);
}

@media (max-width: 980px) {
    .match-history {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .match-history {
        gap: 14px;
        margin-top: 14px;
    }

    .match-history__heading {
        flex-direction: column;
        margin-bottom: 14px;
    }

    .match-history-row {
        grid-template-columns: minmax(76px, 1fr) auto 14px;
        gap: 7px;
        padding: 8px;
    }

    .match-history-row__scores {
        gap: 3px;
    }

    .match-history-row__score {
        min-width: 39px;
        min-height: 41px;
    }

    .pair-affinity-grid {
        grid-template-columns: 1fr;
    }

    .pair-affinity {
        padding: 10px;
    }
}

.badge--hand-right {
    background: var(--color-yellow-dim);
    color: var(--color-yellow);
}

.badge--hand-left {
    background: var(--color-blue-dim);
    color: var(--color-blue);
}

.players-row__stats {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.players-row__stat {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 72px;
}

.players-row__stat-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-gray-faint);
}

.players-row__stat-value {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 3.5rem;
    font-variant-numeric: tabular-nums;
}

.players-row__stat-value small {
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 1.4rem;
    color: var(--color-gray);
    margin-left: 3px;
}

.players-row__score {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex: 0 0 auto;
}

.players-row__score-label {
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-gray-faint);
}

.players-row__score-value {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.7rem;
    color: var(--color-yellow);
}

.sparkline {
    color: var(--color-yellow);
}

@media (max-width: 900px) {
    .players-row__stats {
        gap: 16px;
        flex: 1 1 100%;
        order: 3;
    }
}

@media (max-width: 640px) {
    .players-row .avatar {
        width: 92px !important;
    }

    .players-row__body {
        padding: 14px 16px;
        gap: 12px;
    }
}

/* ---------------------------------------------------------------------- */
/* Statistics page: award cards                                           */
/* ---------------------------------------------------------------------- */

.awards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.award-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 0;
}

.award-card--profile {
    flex-direction: column;
    align-items: stretch;
}

.award-card__header {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
}

.award-card--accent {
    border-color: var(--color-yellow);
    box-shadow: 0 0 0 1px var(--color-yellow), var(--shadow);
}

.award-card__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--color-yellow-dim);
    color: var(--color-yellow);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.award-card__body {
    flex: 1;
    min-width: 0;
}

.award-card__title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.84rem;
    margin: 0;
}

.award-card__nickname {
    font-size: 0.72rem;
    color: var(--color-yellow);
    margin: 2px 0 0;
}

.award-card__player {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.award-card--profile .award-card__player {
    flex: 1;
    align-items: center;
    width: 100%;
    margin-top: 0;
}

.award-card__player-copy {
    flex: 1;
    min-width: 0;
}

.award-card__pair-photos {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.award-card__pair-photos .player-avatar-link+.player-avatar-link {
    margin-left: -18px;
}

.award-card__pair-photos .player-avatar-link:last-child {
    position: relative;
    z-index: 1;
}

.award-card__player-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    margin: 0;
}

.award-card__value {
    font-size: 0.8rem;
    color: var(--color-gray);
    margin: 2px 0 0;
    font-variant-numeric: tabular-nums;
}

/* The statistics page runs everything a size up from the rest of the site — it's the "wall of
   numbers" page, so both the hero photo and the type get more room to breathe. */
.stats-page .stats-hero-banner {
    min-height: 340px;
}

.stats-page .page-header__title {
    font-size: 3.2rem;
}

.stats-page .page-header__subtitle {
    font-size: 1.05rem;
}

.stats-page .section-title {
    font-size: 1.15rem;
}

.stats-page .award-card__icon {
    width: 54px;
    height: 54px;
    border-radius: 12px;
}

.stats-page .award-card__title {
    font-size: 1.02rem;
}

.stats-page .award-card__nickname {
    font-size: 0.88rem;
}

.stats-page .award-card__player-name {
    font-size: 1.15rem;
}

.stats-page .award-card__value {
    font-size: 0.92rem;
}

.stats-page .award-card {
    padding: 22px;
    gap: 16px;
}

@media (max-width: 640px) {
    .stats-page .stats-hero-banner {
        min-height: 220px;
    }

    .stats-page .page-header__title {
        font-size: 2.3rem;
    }
}

/* ---------------------------------------------------------------------- */
/* Home: hero, feature strip, three-column layout, stats strip            */
/* ---------------------------------------------------------------------- */

.home-dashboard .avatar {
    aspect-ratio: 4 / 5;
    border-radius: 9px;
}

.home-dashboard .match-players {
    gap: 12px;
}

.hero {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.hero__panel {
    position: relative;
    overflow: hidden;
    flex: 1 1 900px;
    padding: 44px;
    border-radius: var(--radius);
    background-color: var(--color-navy);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    border: 1px solid var(--color-gray-light);
}

.hero__eyebrow {
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--color-gray);
    margin: 0 0 14px;
}

.hero__headline {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 3.2rem;
    line-height: 1.03;
    text-transform: uppercase;
    margin: 0;
    text-wrap: balance;
}

.hero__headline em {
    font-style: normal;
    color: var(--color-yellow);
}

.hero__subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.75);
    margin: 18px 0 28px;
    max-width: 420px;
}

.hero__actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.hero__next-match {
    flex: 0 0 600px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hero__next-match .card {
    margin-bottom: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 10px;
}

.hero__next-match .panel-header {
    margin-bottom: 2px;
}

.hero__next-match .hero__eyebrow {
    font-size: 1rem;
}

.hero__next-match .match-list-item__meta {
    gap: 9px;
    margin-bottom: 18px !important;
    font-size: 0.9rem;
}

.hero__next-match .match-player__name {
    font-size: 0.86rem;
}

.hero__next-match .button {
    min-height: 52px;
    font-size: 0.94rem;
}

.feature-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 24px 34px;
    min-height: 122px;
    padding: 28px 36px;
    margin-bottom: 24px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 18px;
    flex: 1 1 220px;
    min-width: 0;
}

.feature-item .icon {
    color: var(--color-yellow);
    width: 48px;
    height: 48px;
}

.feature-item__title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.96rem;
    letter-spacing: 0.02em;
}

.feature-item__desc {
    margin-top: 3px;
    font-size: 0.86rem;
    color: var(--color-gray);
}

.home-grid {
    display: grid;
    grid-template-columns: 1.15fr 1.15fr 0.85fr;
    gap: 24px;
    align-items: start;
    margin-bottom: 24px;
}

.home-grid .card {
    margin-bottom: 0;
    height: 100%;
    padding: 26px;
    border-radius: 18px;
}

.home-grid .panel-header {
    margin-bottom: 20px;
}

.home-grid .panel-header__title {
    font-size: 1.12rem;
}

.home-grid .panel-header__link {
    font-size: 1.1rem;
}

.home-grid table {
    font-size: 1.1rem;
}

.home-grid th {
    font-size: 0.76rem;
}

.home-grid th,
.home-grid td {
    padding: 15px 12px;
}

.home-grid .rank-position {
    width: 34px;
    height: 34px;
}

.home-grid .match-list {
    gap: 16px;
}

.home-grid .match-list-item {
    padding: 18px;
    border-radius: 12px;
}

.home-grid .match-list-item__meta {
    gap: 8px;
    margin-bottom: 14px;
    font-size: 0.86rem;
}

.home-grid .match-player__name {
    font-size: 0.84rem;
}

@media (min-width: 981px) {
    .home-grid .match-list-item .match-players {
        width: 100%;
        flex-wrap: nowrap;
        gap: 6px;
    }

    .home-grid .match-list-item .match-player {
        flex: 1 1 0;
        width: auto !important;
    }

    .home-grid .match-list-item .player-avatar-link,
    .home-grid .match-list-item .avatar {
        width: 100% !important;
    }
}

.home-grid .section-title {
    font-size: 1.08rem;
    margin-top: 30px !important;
    margin-bottom: 16px !important;
}

.home-grid .result-row {
    gap: 16px;
    padding: 16px 0;
}

.home-grid .result-row__sets {
    gap: 14px;
}

.home-grid .result-set__score {
    font-size: 1.08rem;
}

.home-grid .player-color-dot {
    width: 10px;
    height: 10px;
}

/* In the three-column desktop dashboard, keep all four recent-result players and the three
   set scores on one row. The slightly smaller portraits fit the middle card without affecting
   the roomier single-column tablet layout or the stacked mobile layout below. */
@media (min-width: 981px) {
    .home-grid .result-row {
        flex-wrap: nowrap;
    }

    .home-grid .result-row .match-players {
        flex: 1 1 auto;
        flex-wrap: nowrap;
        gap: 8px;
        min-width: 0;
    }

    .home-grid .result-row .match-player,
    .home-grid .result-row .avatar {
        width: clamp(42px, 3vw, 50px) !important;
    }

    .home-grid .result-row__sets {
        flex: 0 0 auto;
        gap: 8px;
        margin-left: 0;
    }
}

.home-grid .top-ranking {
    gap: 20px;
}

.home-grid .top-ranking-row {
    gap: 14px;
}

.home-grid .top-ranking-row__top {
    font-size: 0.96rem;
}

.home-grid .bar-track {
    height: 8px;
    margin-top: 8px;
}

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

.panel-header__title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.94rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin: 0;
}

.panel-header__link {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-yellow);
    white-space: nowrap;
}

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

.match-list-item {
    border: 1px solid var(--color-gray-light);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
}

.match-list-item__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 0.74rem;
    color: var(--color-gray);
    margin-bottom: 8px;
}

.result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-gray-light);
}

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

.result-row__sets {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 10px;
    margin-left: auto;
    white-space: nowrap;
}

.result-set {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.result-set__score {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.88rem;
    font-variant-numeric: tabular-nums;
}

.result-set__pairing,
.result-set__team {
    display: inline-flex;
    align-items: center;
}

.result-set__pairing {
    gap: 4px;
}

.result-set__team {
    gap: 3px;
}

.player-color-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border: 1px solid color-mix(in srgb, var(--player-color) 75%, white);
    border-radius: 50%;
    background: var(--player-color);
    box-shadow: 0 0 5px color-mix(in srgb, var(--player-color) 55%, transparent);
}

.result-set__versus {
    width: 1px;
    height: 10px;
    margin: 0 1px;
    background: var(--color-gray);
    opacity: 0.65;
}

@media (max-width: 640px) {
    .result-row {
        flex-wrap: wrap;
        justify-content: center;
    }

    .home-grid .match-list-item .match-players {
        width: 100%;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 6px;
    }

    .home-grid .match-list-item .match-player {
        flex: 1 1 0;
        width: auto !important;
    }

    .home-grid .match-list-item .player-avatar-link,
    .home-grid .match-list-item .avatar {
        width: 100% !important;
    }

    .home-grid .result-row .match-players {
        width: 100%;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 6px;
    }

    .home-grid .result-row .match-player {
        flex: 1 1 0;
        width: auto !important;
    }

    .home-grid .result-row .player-avatar-link,
    .home-grid .result-row .avatar {
        width: 100% !important;
    }

    .result-row__sets {
        flex: 1 0 100%;
        justify-content: center;
        margin-left: 0;
        margin-top: 2px;
    }
}

.top-ranking {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.top-ranking-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-ranking-row__body {
    flex: 1;
    min-width: 0;
}

.top-ranking-row__top {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    font-weight: 600;
}

.bar-track {
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    margin-top: 5px;
}

.bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--color-yellow), #9fd400);
}

.promo-panel {
    position: relative;
    overflow: hidden;
    min-height: 190px;
    display: flex;
    align-items: flex-end;
    padding: 24px;
    border-radius: var(--radius);
    background-color: var(--color-navy);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    border: 1px solid var(--color-gray-light);
}

.promo-panel__eyebrow {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
}

.promo-panel__tagline {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.15rem;
    margin-top: 4px;
}

.stats-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 20px 32px;
    padding: 22px 28px;
    justify-content: space-between;
}

.stats-strip__item {
    display: flex;
    align-items: center;
    gap: 14px;
}

.stats-strip__item .icon {
    color: var(--color-yellow);
    width: 34px;
    height: 34px;
}

.stats-strip__value {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.3rem;
    font-variant-numeric: tabular-nums;
}

.stats-strip__label {
    font-size: 0.72rem;
    color: var(--color-gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

    .hero {
        flex-wrap: wrap;
    }

    .hero__panel,
    .hero__next-match {
        flex: 1 1 100%;
    }
}

@media (max-width: 640px) {
    .hero__next-match .card {
        padding: 10px;
    }

    .hero__next-match .match-players {
        width: 100%;
        flex-wrap: nowrap;
        justify-content: flex-start !important;
        gap: 6px;
    }

    .hero__next-match .match-player {
        flex: 1 1 0;
        width: auto !important;
    }

    .hero__next-match .player-avatar-link,
    .hero__next-match .avatar {
        width: 100% !important;
    }

    .home-grid .card {
        padding: 15px;
    }

    .home-grid th,
    .home-grid td {
        padding: 13px 9px;
    }

    .burger-toggle {
        display: inline-flex;
    }

    .header-collapse {
        display: none;
    }

    .header-collapse.is-open {
        display: flex;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
        background: var(--color-navy);
        border-bottom: 1px solid var(--color-gray-light);
        padding: 18px 16px 22px;
        box-shadow: var(--shadow);
        z-index: 30;
    }

    .header-collapse.is-open .site-nav {
        flex-direction: column;
        gap: 16px;
    }

    .header-collapse.is-open .header-right {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .header-collapse.is-open .header-divider {
        display: none;
    }

    .header-collapse.is-open .locale-switcher {
        justify-content: center;
    }

    .footer-top {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .hero__panel {
        padding: 28px 22px;
        background-position: 70% center;
    }

    .hero__headline {
        font-size: 2.2rem;
    }

    .feature-strip {
        flex-direction: column;
        align-items: stretch;
    }

    .feature-item {
        flex: 0 0 auto;
    }

    .stats-strip {
        justify-content: flex-start;
    }
}

/* ---------------------------------------------------------------------- */
/* How it works: player-facing tour and scoring rules                      */
/* ---------------------------------------------------------------------- */

.rules-page {
    max-width: 1180px;
    margin: 0 auto;
}

.rules-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
    align-items: stretch;
    gap: 20px;
    margin-bottom: 42px;
}

.rules-hero__copy,
.rules-hero__visual {
    border: 1px solid var(--color-gray-light);
    border-radius: 18px;
    background-color: var(--color-navy);
}

.rules-hero__copy {
    padding: 42px;
}

.rules-hero__copy .page-header__subtitle {
    max-width: 680px;
    margin-bottom: 0;
}

.rules-hero__visual {
    min-height: 270px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    overflow: hidden;
    background-image:
        linear-gradient(145deg, rgba(13, 20, 32, 0.55), rgba(5, 7, 10, 0.92)),
        url("../images/bola_padel-f7e7ZXZ.png");
    background-position: center;
    background-size: cover;
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 0.06em;
    text-align: center;
    text-transform: uppercase;
    color: var(--color-yellow);
}

.rules-hero__number {
    font-size: 6.8rem;
    font-weight: 700;
    line-height: 0.9;
    color: var(--color-white);
    text-shadow: 0 0 40px rgba(215, 255, 30, 0.3);
}

.rules-section {
    margin-bottom: 44px;
}

.rules-section__heading {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.rules-section__heading h2,
.rules-awards h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.65rem;
    line-height: 1.15;
    text-transform: uppercase;
}

.rules-section__icon {
    width: 54px;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 13px;
    background: var(--color-yellow-dim);
    color: var(--color-yellow);
}

.rules-section__step,
.rules-formula__label {
    margin: 0 0 2px;
    font-family: var(--font-display);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--color-yellow);
}

.rules-section__intro {
    max-width: 820px;
    margin: -4px 0 20px 68px;
    color: var(--color-gray);
}

.rules-card-grid {
    display: grid;
    gap: 16px;
}

.rules-card-grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.rules-card {
    padding: 22px;
    border: 1px solid var(--color-gray-light);
    border-radius: var(--radius);
    background: rgba(13, 20, 32, 0.92);
}

.rules-card h3,
.rules-format-card h3,
.rules-ranking-order h3 {
    margin: 0 0 8px;
    font-family: var(--font-display);
    font-size: 1.08rem;
    text-transform: uppercase;
}

.rules-card p,
.rules-format-card p,
.rules-ranking-order p {
    margin: 0;
    color: var(--color-gray);
}

.rules-formats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.rules-format-card {
    margin: 0;
    padding: 26px;
}

.rules-format-card--featured {
    border-color: rgba(215, 255, 30, 0.52);
    box-shadow: inset 0 2px 0 var(--color-yellow), var(--shadow);
}

.rules-format-card h3 {
    margin-top: 18px;
}

.rules-pairings {
    display: grid;
    gap: 8px;
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
}

.rules-pairings li {
    display: grid;
    grid-template-columns: minmax(50px, 1fr) auto 28px auto;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.045);
    font-variant-numeric: tabular-nums;
}

.rules-pairings li > span {
    color: var(--color-gray);
    font-size: 0.78rem;
}

.rules-pairings small {
    color: var(--color-yellow);
    text-align: center;
    text-transform: uppercase;
}

.rules-score-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--color-gray-light);
    border-radius: var(--radius);
    background: var(--color-navy);
}

.rules-score-strip article {
    min-height: 148px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 22px;
    text-align: center;
}

.rules-score-strip article + article {
    border-left: 1px solid var(--color-gray-light);
}

.rules-score-strip strong {
    font-family: var(--font-display);
    font-size: 2.6rem;
    line-height: 1;
    color: var(--color-yellow);
}

.rules-score-strip article > span:last-child {
    max-width: 240px;
    color: var(--color-gray);
}

.rules-score-strip__icon {
    color: var(--color-yellow);
}

.rules-note {
    margin: 12px 0 0;
    font-size: 0.82rem;
    color: var(--color-gray-faint);
    text-align: center;
}

.rules-ranking-order {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.rules-ranking-order article {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 20px;
    border: 1px solid var(--color-gray-light);
    border-radius: var(--radius);
    background: rgba(13, 20, 32, 0.92);
}

.rules-ranking-order article > span {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--color-yellow);
    color: var(--color-black);
    font-family: var(--font-display);
    font-weight: 700;
}

.rules-formula {
    display: grid;
    grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
    align-items: center;
    gap: 26px;
    margin-top: 18px;
    padding: 22px 24px;
    border-left: 3px solid var(--color-blue);
    border-radius: 0 var(--radius) var(--radius) 0;
    background: var(--color-blue-dim);
}

.rules-formula strong {
    font-family: var(--font-display);
    font-size: 1.2rem;
}

.rules-formula p:last-child {
    margin: 0;
    color: var(--color-gray);
}

.rules-awards {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 28px;
    padding: 30px 36px;
    border-color: rgba(215, 255, 30, 0.5);
    background: linear-gradient(110deg, var(--color-yellow-dim), var(--color-navy) 58%);
}

.rules-awards__number {
    flex: 0 0 auto;
    font-family: var(--font-display);
    font-size: 5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--color-yellow);
}

.rules-awards p:not(.rules-section__step) {
    margin: 8px 0 5px;
    color: rgba(255, 255, 255, 0.78);
}

.rules-awards small {
    color: var(--color-gray);
}

@media (max-width: 800px) {
    .rules-hero,
    .rules-formats,
    .rules-card-grid--three,
    .rules-ranking-order {
        grid-template-columns: 1fr;
    }

    .rules-hero__visual {
        min-height: 190px;
    }

    .rules-score-strip {
        grid-template-columns: 1fr;
    }

    .rules-score-strip article {
        min-height: 120px;
    }

    .rules-score-strip article + article {
        border-top: 1px solid var(--color-gray-light);
        border-left: 0;
    }

    .rules-section__intro {
        margin-left: 0;
    }

    .rules-formula {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media (max-width: 640px) {
    .rules-hero__copy {
        padding: 26px 22px;
    }

    .rules-hero__number {
        font-size: 5.2rem;
    }

    .rules-section {
        margin-bottom: 36px;
    }

    .rules-format-card {
        padding: 20px;
    }

    .rules-awards {
        align-items: flex-start;
        gap: 18px;
        padding: 24px 20px;
    }

    .rules-awards__number {
        font-size: 3.8rem;
    }
}

/* ---------------------------------------------------------------------- */
/* Motion & interaction: transitions, hover feedback, a bit of scoreboard  */
/* sparkle on top — kept subtle, and fully stilled for reduced-motion.     */
/* ---------------------------------------------------------------------- */

::selection {
    background: var(--color-yellow);
    color: var(--color-black);
}

a,
.button,
.badge,
.filter-pill,
.avatar,
.card,
.locale-switcher__link,
.footer-link,
.form-dot,
.rank-position {
    transition:
        color 0.15s ease,
        background-color 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.2s ease,
        transform 0.15s ease,
        opacity 0.15s ease;
}

a:focus-visible,
.button:focus-visible,
.filter-pill:focus-visible,
.burger-toggle:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--color-yellow);
    outline-offset: 2px;
}

.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 0 4px var(--color-yellow-dim);
}

.button--ghost:hover {
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08);
}

.button:active {
    transform: translateY(0) scale(0.96);
    box-shadow: none;
}

.filter-pill:hover:not(.is-active) {
    border-color: var(--color-yellow);
    color: var(--color-yellow);
}

/* Clickable rows/cards get a scoreboard-style lift, like a highlighted line on a big screen. */
.match-row:hover,
.players-row:hover,
.result-row:hover,
.match-list-item:hover,
a.award-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 28px -16px rgba(0, 0, 0, 0.65);
}

.match-row:hover .avatar,
.players-row:hover .avatar,
.match-player:hover .avatar,
a.award-card:hover .avatar {
    transform: scale(1.04);
}

.result-set__score,
.match-row__score {
    display: inline-block;
    transition: transform 0.2s ease, color 0.2s ease;
}

.result-row:hover .result-set__score,
.match-row:hover .match-row__score {
    transform: scale(1.08);
    color: #eaff70;
}

@media (prefers-reduced-motion: no-preference) {

    /* A live little pulse on "planned/upcoming" badges — a scoreboard "on deck" cue. */
    .badge--planned::before {
        content: "";
        display: inline-block;
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: currentColor;
        margin-right: 5px;
        animation: fpt-pulse 1.6s ease-in-out infinite;
    }

    /* A slow light sweep across the #1 rank badge — a trophy catching the light. */
    .rank-position--gold {
        position: relative;
        overflow: hidden;
    }

    .rank-position--gold::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.6) 48%, transparent 66%);
        transform: translateX(-120%);
        animation: fpt-shine 4s ease-in-out infinite;
    }

    @keyframes fpt-pulse {

        0%,
        100% {
            opacity: 1;
        }

        50% {
            opacity: 0.3;
        }
    }

    @keyframes fpt-shine {

        0%,
        45% {
            transform: translateX(-120%);
        }

        65%,
        100% {
            transform: translateX(120%);
        }
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}
