/* Terraces 5 specific fixes for tournament-leaderboard control.
   Keep this minimal so we align with Scotland's compact leaderboard treatment. */

.table-block .select--custom {
    min-height: 3.8rem;
    font-size: 1.5rem;
}

@media (min-width: 768px) {
    /* Keep Division + Type selectors inline on Terraces 5, like Scotland. */
    .table-block .select--custom.col-md-5.col-sm-12 {
        display: inline-block;
        width: auto;
        min-width: 18rem;
        max-width: 24rem;
        vertical-align: middle;
    }

    .table-block .select--custom.col-md-5.col-sm-12 + .select--custom.col-md-5.col-sm-12 {
        margin-left: 1rem;
    }
}

/* Reduce vertical density introduced by previous override. */
.custom-table-leaderboard .table__row {
    padding-top: 1.2rem;
    padding-bottom: 1.2rem;
}

@media (min-width: 480px) {
    .table-leaderboard-fix .table-text,
    .table-leaderboard-fix .generic-table td,
    .generic-table .table-leaderboard-fix td {
        max-width: unset;
        min-width: unset;
        width: unset;
    }
}

@media (min-width: 992px) {
    .table-leaderboard-fix .table-text,
    .table-leaderboard-fix .generic-table td,
    .generic-table .table-leaderboard-fix td {
        max-width: unset;
        min-width: unset;
        width: unset;
    }

    .table-leaderboard-fix .table-text--position {
        width: 40px;
    }
}

@media (min-width: 1200px) {
    .table-leaderboard-fix .table-text--position {
        max-width: unset;
        min-width: unset;
        width: 48px;
    }
}

.table-leaderboard-fix .table__row .pga img,
.table-leaderboard-fix .table__row .country img {
    width: unset;
    height: unset;
    margin: 0 auto;
}

.table-leaderboard-fix .table__row .arrow img {
    width: unset;
    height: unset;
    display: inline-block;
}

.table-leaderboard-fix .pga,
.table-leaderboard-fix .country,
.table-leaderboard-fix .arrow {
    width: 33px;
    padding: 0;
    text-align: center;
}

.table-leaderboard-fix .arrow {
    width: 90px;
}

/* Match Scotland player identity line treatment (name + flag + club). */
.table-leaderboard-fix .entry-name {
    min-width: 16rem;
}

.table-leaderboard-fix .entry-name .player-names {
    margin-bottom: .2rem;
}

.table-leaderboard-fix .entry-name .player-names .table-text {
    font-weight: 500;
    line-height: 1.35;
}

.table-leaderboard-fix .entry-name .entrant-info {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding-left: .8rem;
    padding-right: .8rem;
    line-height: 1.2;
}

.table-leaderboard-fix .entry-name .entrant-info img {
    display: inline-block;
    width: auto;
    height: auto;
    max-width: 16px;
    max-height: 12px;
    vertical-align: middle;
}

.table-leaderboard-fix .entry-name .entrant-info .table-text-small {
    color: #8d8d93;
    text-transform: uppercase;
    letter-spacing: 0;
}

/* Round scores are rendered as anchors; make them look like plain table values. */
.table-leaderboard-fix .stat a.table-text {
    text-decoration: none;
    color: inherit;
}

.table-leaderboard-fix .stat a.table-text:hover,
.table-leaderboard-fix .stat a.table-text:focus,
.table-leaderboard-fix .stat a.table-text:active {
    text-decoration: none;
    color: inherit;
}

/* Keep right-side stat columns visually aligned across rows. */
.table-leaderboard-fix ._l-right-col .stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex: 0 0 64px;
    width: 64px;
    min-width: 64px;
    max-width: 64px;
}

.table-leaderboard-fix ._l-right-col .stat:first-child,
.table-leaderboard-fix ._l-right-col .stat:last-child {
    flex-basis: 72px;
    width: 72px;
    min-width: 72px;
    max-width: 72px;
}

.table-leaderboard-fix ._l-right-col .stat.stat--thru {
    flex-basis: 56px;
    width: 56px;
    min-width: 56px;
    max-width: 56px;
}

.table-leaderboard-fix ._l-right-col .stat .table-text,
.table-leaderboard-fix ._l-right-col .stat .table-text-small {
    width: 100%;
    text-align: center;
}

/* Values should be slightly bolder than labels. */
.table-leaderboard-fix ._l-right-col .stat .table-text {
    font-weight: 600;
}

/* Round-by-round values are anchors: ensure they never look like links. */
.table-leaderboard-fix ._l-right-col .stat a.table-text,
.table-leaderboard-fix ._l-right-col .stat a.table-text:visited,
.table-leaderboard-fix ._l-right-col .stat a.table-text:hover,
.table-leaderboard-fix ._l-right-col .stat a.table-text:focus,
.table-leaderboard-fix ._l-right-col .stat a.table-text:active {
    text-decoration: none !important;
    border-bottom: 0 !important;
    color: inherit !important;
    font-weight: 600;
}

@media (max-width: 767.98px) {
    .table-leaderboard-fix ._l-right-col .stat {
        flex-basis: 52px;
        width: 52px;
        min-width: 52px;
        max-width: 52px;
    }

    .table-leaderboard-fix ._l-right-col .stat:first-child,
    .table-leaderboard-fix ._l-right-col .stat:last-child {
        flex-basis: 58px;
        width: 58px;
        min-width: 58px;
        max-width: 58px;
    }

    .table-leaderboard-fix ._l-right-col .stat.stat--thru {
        flex-basis: 46px;
        width: 46px;
        min-width: 46px;
        max-width: 46px;
    }
}

/* Round values may be injected as inner a.round_link HTML from API. */
.table-leaderboard-fix a.round_link,
.table-leaderboard-fix a.round_link:visited,
.table-leaderboard-fix a.round_link:hover,
.table-leaderboard-fix a.round_link:focus,
.table-leaderboard-fix a.round_link:active {
    text-decoration: none !important;
    border-bottom: 0 !important;
    color: inherit !important;
    font-weight: 600;
}

@media (max-width: 767.98px) {
    .table-block .select--custom.col-md-5.col-sm-12 + .select--custom.col-md-5.col-sm-12 {
        margin-left: 0;
        margin-top: .8rem;
    }

    .table-leaderboard-fix .entry-name {
        min-width: 0;
    }

    .table-leaderboard-fix .entry-name .entrant-info {
        padding-left: 0;
        padding-right: 0;
    }
}
