.hero-image{
    position: relative;
    min-height: 300px;
    background-image: linear-gradient(180deg, rgba(27, 26, 26, 0.55) 0%, rgba(27, 26, 26, 0.92) 100%), url('/public/home/hero.jpg');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: 50% 50%;
}


.cr-section-label,
.cr-label{
    color: var(--sgt-light);
    font-size: 0.7rem;
    letter-spacing: 0.15rem;
    margin-bottom: 0.4rem;
}

.cr-link-btn{
    background: none;
    border: 0;
    padding: 0;
    color: var(--sgt-white);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--sgt-red);
    letter-spacing: inherit;
    font-size: inherit;
}

.cr-link-btn:hover{
    color: var(--sgt-light);
}

.cr-me-tag{
    margin-left: 0.5rem;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    border: 1px solid var(--sgt-red);
    font-size: 0.6rem;
    color: var(--sgt-white);
    flex-shrink: 0;
}

.cr-pill{
    margin-left: 0.4rem;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    font-size: 0.6rem;
    color: var(--sgt-white);
    white-space: nowrap;
}

.cr-pill.new{
    background: var(--sgt-red);
}

.cr-pill.live{
    background: #2e7d4a;
}


/* ---------- avatars ---------- */

.player-avatar-wrapper{
    height:32px;
    width:32px;
    margin-right:9px;
    flex-shrink: 0;
}

.player-avatar{
    width:32px;
    height:32px;
    border-radius:50%;
    overflow: hidden;
}

.player-avatar img{
    width: 100%;
    height:auto;
}

.player-flag{
    position: absolute;
    bottom:0;
    right:-9px;
    height:18px;
    width: 18px !important;
    border-radius: 50%;
}

.player-avatar-wrapper.podium-avatar,
.player-avatar.podium-avatar{
    width: 64px;
    height: 64px;
    margin-right: 0;
}

.player-flag.podium-avatar{
    height: 24px;
    width: 24px !important;
    right: -4px;
}


/* ---------- podium ---------- */

.cr-podium{
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    align-items: end;
    max-width: 760px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.podium-card{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 1rem 0.75rem;
    background: rgba(41, 41, 41, 0.85);
    border: 1px solid var(--sgt-light-gray);
    border-radius: 1rem;
    color: var(--sgt-white);
    letter-spacing: inherit;
    min-width: 0;
}

.podium-card:focus-visible{
    border-color: var(--sgt-light);
}

.podium-card.place-1{
    order: 2;
    padding-top: 1.75rem;
    padding-bottom: 1.5rem;
    border-color: var(--sgt-red);
    box-shadow: 0 0 0 1px var(--sgt-red), 0 10px 30px rgba(0, 0, 0, 0.45);
}

.podium-card.place-2{
    order: 1;
}

.podium-card.place-3{
    order: 3;
}

.podium-place{
    font-family: 'NeoBold';
    font-size: 1.6rem;
    line-height: 1;
}

.podium-card.place-1 .podium-place{
    font-size: 2.2rem;
    color: var(--sgt-red);
}

.podium-name{
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.podium-total{
    font-size: 1.15rem;
    font-variant-numeric: tabular-nums;
}

.podium-total span{
    font-size: 0.65rem;
    color: var(--sgt-light);
}

.podium-tag{
    font-size: 0.65rem;
    color: var(--sgt-light);
    border: 1px solid var(--sgt-light-gray);
    border-radius: 999px;
    padding: 0.1rem 0.6rem;
    text-align: center;
}


/* ---------- latest records and your records ---------- */

#cr-app,
#cr-list{
    min-width: 0;
    max-width: 100%;
}

#cr-list > div{
    overflow-x: auto;
}

.me-card{
    background: var(--sgt-dark-gray);
    border: 1px solid var(--sgt-light-gray);
    border-radius: 1rem;
    padding: 0.85rem 1rem;
    color: var(--sgt-white);
    text-align: left;
    letter-spacing: inherit;
    min-width: 0;
}

.me-card{
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 2rem;
    border-color: var(--sgt-red);
}

.me-rank{
    font-family: 'NeoBold';
    font-size: 2.6rem;
    line-height: 1;
}

.me-stats{
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem 1.75rem;
    flex: 1 1 320px;
}

.me-stat-value{
    font-size: 1.15rem;
    font-variant-numeric: tabular-nums;
}

.me-stat-sub{
    font-size: 0.7rem;
    color: var(--sgt-light);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.me-actions{
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
}


/* ---------- tabs and controls ---------- */

.cr-tab{
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--sgt-light);
    letter-spacing: inherit;
    white-space: nowrap;
}

.cr-tab:hover{
    color: var(--sgt-white);
}

.cr-tab[aria-selected='true']{
    color: var(--sgt-red);
    border-bottom-color: var(--sgt-red);
}

.cr-tab-count:not(:empty){
    margin-left: 0.4rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: var(--sgt-red);
    color: var(--sgt-white);
    font-size: 0.65rem;
}

.cr-controls{
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

/* controls wrap onto extra lines rather than scrolling sideways */
.cr-chips,
.cr-selects{
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    max-width: 100%;
    min-width: 0;
}

.cr-chip{
    letter-spacing: normal;
    white-space: nowrap;
}

/* usernames run to 64 characters; truncate the name, never the clear button */
.cr-holder-chip{
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    min-width: 0;
}

.cr-holder-chip-name{
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cr-chip[aria-pressed='true']{
    background-color: var(--sgt-red) !important;
    color: #fff !important;
}

/* segmented TIPS / SGT switch that leads the chip row */
.cr-tee-toggle{
    display: inline-flex;
    flex-shrink: 0;
    margin-right: 0.4rem;
    padding: 2px;
    border-radius: 999px;
    border: 1px solid var(--sgt-light-gray);
    background: var(--sgt-black);
}

.cr-tee{
    background: none;
    border: 0;
    border-radius: 999px;
    padding: 0.2rem 0.9rem;
    color: var(--sgt-light);
    font-size: 0.75rem;
    letter-spacing: 0.1rem;
}

.cr-tee:hover{
    color: var(--sgt-white);
}

.cr-tee[aria-pressed='true']{
    background: var(--sgt-white);
    color: var(--sgt-dark-gray);
}

.cr-select{
    background-color: var(--sgt-md-gray);
    color: var(--sgt-white);
    border: 1px solid var(--sgt-light-gray);
    border-radius: 0.5rem;
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    letter-spacing: 0.05rem;
}

.cr-select:focus{
    outline: 0;
    border-color: var(--sgt-light);
}


/* ---------- course table ---------- */

.cr-table{
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.cr-table td,
.cr-table th{
    padding: 0.7rem 0.6rem;
}

.cr-table .col-record{
    width: 44%;
}

.cr-table .col-attempt{
    width: 8.5rem;
}

.cr-table .col-toggle{
    width: 2.5rem;
}

.cr-attempt-btn{
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid var(--sgt-red);
    background: none;
    color: var(--sgt-white);
    font-size: 0.7rem;
    letter-spacing: 0.1rem;
    text-decoration: none;
    white-space: nowrap;
}

.cr-attempt-btn:hover{
    background: var(--sgt-red);
    color: var(--sgt-white);
}

.cr-attempt-btn.live{
    border-color: #2e7d4a;
    background: rgba(46, 125, 74, 0.2);
}

.cr-attempt-btn.live:hover{
    background: #2e7d4a;
}

.cr-other-tee{
    font-size: 0.7rem;
    letter-spacing: 0.05rem;
    color: var(--sgt-light);
}

.cr-table tbody tr.cr-row,
.cr-table tbody tr.cr-holder-row{
    cursor: pointer;
}

.cr-table tbody tr.odd{
    background-color: var(--sgt-md-gray);
}

.cr-table tbody tr.cr-row > td:first-child,
.cr-table tbody tr.cr-holder-row > td:first-child{
    border-top-left-radius: 1rem;
    border-bottom-left-radius: 1rem;
}

.cr-table tbody tr.cr-row > td:last-child,
.cr-table tbody tr.cr-holder-row > td:last-child{
    border-top-right-radius: 1rem;
    border-bottom-right-radius: 1rem;
}

/* site leaderboard dividers: rank | ... | total, visible on the gray rows only */
.cr-holders-table tbody tr.cr-holder-row > td:first-child{
    border-right: 1px solid transparent;
}

.cr-holders-table tbody tr.cr-holder-row > td:last-child{
    border-left: 1px solid transparent;
}

.cr-holders-table tbody tr.cr-holder-row.odd > td:first-child,
.cr-holders-table tbody tr.cr-holder-row.is-me > td:first-child{
    border-right-color: var(--sgt-dark-gray);
}

.cr-holders-table tbody tr.cr-holder-row.odd > td:last-child,
.cr-holders-table tbody tr.cr-holder-row.is-me > td:last-child{
    border-left-color: var(--sgt-dark-gray);
}

.cr-table tbody tr.cr-holder-row.is-me{
    background-color: color-mix(in srgb, var(--sgt-red) 22%, var(--sgt-md-gray));
}

.cr-table tbody tr.cr-row.is-open{
    background-color: var(--sgt-md-gray);
}

.cr-table tbody tr.cr-row.is-open > td:first-child{
    border-bottom-left-radius: 0;
}

.cr-table tbody tr.cr-row.is-open > td:last-child{
    border-bottom-right-radius: 0;
}

.cr-table tbody tr.cr-row.flash{
    animation: cr-flash 1.6s ease-out;
}

@keyframes cr-flash{
    0%, 30% { box-shadow: inset 0 0 0 2px var(--sgt-red); }
    100% { box-shadow: inset 0 0 0 2px transparent; }
}

.cr-course-meta{
    font-size: 0.7rem;
    color: var(--sgt-light);
    letter-spacing: 0.05rem;
    margin-top: 0.15rem;
}

.cr-diff.easy{
    color: #3fb35c;
}

.cr-diff.medium{
    color: #e0a83a;
}

.cr-diff.hard{
    color: #e05252;
}

.cr-record.is-me{
    box-shadow: inset 3px 0 0 var(--sgt-red);
}

.cr-score{
    display: inline-block;
    min-width: 2.9rem;
    margin-right: 0.75rem;
    padding: 0.35rem 0.4rem;
    border-radius: 0.5rem;
    background: var(--sgt-light-gray);
    color: var(--sgt-white);
    text-align: center;
    text-decoration: none;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

a.cr-score:hover{
    background: var(--sgt-red);
    color: var(--sgt-white);
}

.cr-record.is-me .cr-score{
    background: var(--sgt-red);
}

.cr-score.big{
    font-family: 'NeoBold';
    font-size: 1.6rem;
    min-width: 4.2rem;
    padding: 0.4rem 0.6rem;
}

.cr-score.empty{
    background: none;
    border: 1px dashed var(--sgt-light-gray);
    color: var(--sgt-light);
}

.cr-holder{
    min-width: 0;
}

/* the flag hangs 9px off the avatar's right edge, so leave room before the name */
.cr-record .player-avatar-wrapper{
    margin-right: 16px;
}

.cr-holder-name{
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cr-holder-date{
    font-size: 0.7rem;
    color: var(--sgt-light);
    letter-spacing: 0.05rem;
}

.cr-open{
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    font-size: 0.7rem;
    letter-spacing: 0.1rem;
    color: var(--sgt-light);
}

.cr-open > span:first-child{
    padding: 0.3rem 0.6rem;
    border: 1px dashed var(--sgt-light-gray);
    border-radius: 0.5rem;
}

.cr-expand{
    background: none;
    border: 0;
    color: var(--sgt-light);
    padding: 0.25rem 0.4rem;
    transition: transform 0.2s ease;
}

.cr-row.is-open .cr-expand{
    transform: rotate(180deg);
    color: var(--sgt-white);
}

.cr-sentinel td{
    padding: 0 !important;
    height: 1px;
}

.cr-total{
    font-weight: bold;
}


/* ---------- course drawer ---------- */

.cr-detail-row > td{
    background-color: var(--sgt-md-gray);
    border-bottom-left-radius: 1rem;
    border-bottom-right-radius: 1rem;
    padding: 0.5rem 1rem 1.25rem !important;
    cursor: default;
}

.cr-detail{
    border-top: 1px solid var(--sgt-light-gray);
    padding-top: 1rem;
    color: var(--sgt-white);
}

.cr-detail-sides{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 1rem;
}

.cr-detail-side{
    background: var(--sgt-dark-gray);
    border-radius: 0.75rem;
    padding: 0.8rem 1rem 1rem;
    min-width: 0;
}

.cr-detail-record{
    display: flex;
    flex-direction: row;
    align-items: center;
    min-height: 3.2rem;
}

.cr-gap{
    margin-top: 0.75rem;
    padding: 0.4rem 0.7rem;
    border-radius: 0.5rem;
    border: 1px solid var(--sgt-light-gray);
    font-size: 0.7rem;
    letter-spacing: 0.05rem;
    color: var(--sgt-light);
}

.cr-board-table{
    width: 100%;
    table-layout: fixed;
    margin-top: 0.75rem;
    font-size: 0.85rem;
}

.cr-board-table th{
    color: var(--sgt-light);
    font-size: 0.65rem;
    font-weight: normal;
    padding: 0.35rem 0.4rem;
    border-bottom: 1px solid var(--sgt-light-gray);
}

.cr-board-table td{
    padding: 0.35rem 0.4rem;
    border-bottom: 1px solid var(--sgt-md-gray);
}

.cr-board-table .col-pos{
    width: 2.6rem;
}

.cr-board-table .col-tries{
    width: 3.4rem;
}

.cr-board-table .col-best{
    width: 3.2rem;
    font-variant-numeric: tabular-nums;
}

.cr-board-table tr.is-me td{
    background: color-mix(in srgb, var(--sgt-red) 22%, var(--sgt-dark-gray));
}

.cr-board-table .player-avatar-wrapper{
    margin-right: 14px;
}

.flyover-iframe{
    width:100%;
    height:calc(100% - 32px);
}

.modal-fullscreen {
    width: calc(100vw - 40px) !important;
    height: calc(100% - 40px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    margin-top: 20px !important;
}


/* ---------- my attempts ---------- */

.cr-attempt-grid{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: 1rem;
}

.cr-attempt-tile{
    display: flex;
    flex-direction: column;
    background: var(--sgt-md-gray);
    border-radius: 1rem;
    overflow: hidden;
}

.cr-attempt-body{
    flex: 1;
    padding: 1rem;
    border-bottom: 1px solid var(--sgt-dark-gray);
}

.cr-attempt-course{
    display: block;
    width: 100%;
    background: none;
    border: 0;
    padding: 0;
    text-align: left;
    color: var(--sgt-white);
    letter-spacing: inherit;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cr-attempt-course:hover{
    text-decoration: underline;
    text-decoration-color: var(--sgt-red);
}

.cr-rounds{
    display: flex;
    gap: 0.3rem;
    margin-top: 0.6rem;
}

.cr-rounds span{
    flex: 1;
    height: 5px;
    border-radius: 3px;
    background: var(--sgt-light-gray);
}

.cr-rounds span.done{
    background: var(--sgt-light);
}

.cr-rounds span.current{
    background: var(--sgt-red);
}

.cr-attempt-actions{
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
}


/* ---------- teams ---------- */

.team-faces{
    display: flex;
    flex-shrink: 0;
    margin-right: 0.6rem;
}

.team-faces img{
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--sgt-md-gray);
    border: 2px solid var(--sgt-dark-gray);
}

.team-faces img + img{
    margin-left: -10px;
}

.cr-row.odd .team-faces img,
.cr-row.is-open .team-faces img{
    border-color: var(--sgt-md-gray);
}

.cr-holder-name a:hover{
    text-decoration: underline !important;
    text-decoration-color: var(--sgt-red) !important;
}

/* real spaces sit either side of the slash so long teams can wrap between names */
.team-sep{
    color: var(--sgt-light);
}

.is-me-name{
    color: var(--sgt-white);
    text-decoration: underline !important;
    text-decoration-color: var(--sgt-red) !important;
    text-underline-offset: 3px;
}

.team-members{
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
}

.team-member{
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

/* the flag hangs 9px off the avatar's right edge, so leave room before the name */
.team-member .player-avatar-wrapper{
    margin-right: 16px;
}

/* every format at a course: a row per tee, a cell per format */
.format-grid{
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.format-grid-row{
    display: grid;
    grid-template-columns: 3rem repeat(4, minmax(0, 1fr));
    gap: 0.4rem;
    align-items: stretch;
}

.format-grid-tee{
    align-self: center;
    font-size: 0.7rem;
    letter-spacing: 0.1rem;
    color: var(--sgt-light);
}

.format-cell{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.4rem 0.3rem;
    border-radius: 0.5rem;
    border: 1px solid var(--sgt-light-gray);
    background: var(--sgt-md-gray);
    color: var(--sgt-white);
    letter-spacing: inherit;
    min-width: 0;
}

.format-cell:hover{
    border-color: var(--sgt-light);
}

.format-cell.open{
    background: none;
    border-style: dashed;
    color: var(--sgt-light);
}

.format-cell.mine{
    border-color: var(--sgt-red);
}

.format-cell.selected{
    background: var(--sgt-white);
    border-color: var(--sgt-white);
    color: var(--sgt-dark-gray);
}

.format-cell-label{
    font-size: 0.55rem;
    letter-spacing: 0.05rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.format-cell-score{
    font-variant-numeric: tabular-nums;
}

.cr-attempt-btn.pending{
    border-color: #b7791f;
    background: rgba(183, 121, 31, 0.2);
}

.cr-attempt-btn.pending:hover{
    background: #b7791f;
}

.cr-attempt-group{
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.4rem;
}

.cr-attempt-tile.ready{
    box-shadow: inset 0 0 0 1px #2e7d4a;
}

.cr-tee-line{
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.7rem;
    letter-spacing: 0.05rem;
    color: var(--sgt-light);
}

/* the ring keeps black and white tees visible on the dark drawer */
.cr-tee-swatch{
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 50%;
    flex: none;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.cr-tee-swatch.tee-black{ background: #111111; }
.cr-tee-swatch.tee-blue{ background: #1f5fd1; }
.cr-tee-swatch.tee-white{ background: #f4f4f4; }
.cr-tee-swatch.tee-yellow{ background: #f2c318; }
.cr-tee-swatch.tee-green{ background: #2e8b4f; }
.cr-tee-swatch.tee-red{ background: #d03f25; }

.invite-players{
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    font-size: 0.8rem;
    color: var(--sgt-light);
}

.invite-player.accepted{
    color: var(--sgt-white);
}

.invite-player.accepted i{
    color: #3fb35c;
}


/* ---------- invite modal ---------- */

.invite-slot{
    margin-bottom: 0.25rem;
}

.member-select{
    border-color: var(--sgt-light) !important;
    color: var(--sgt-dark-gray) !important;
    font-size: 16px !important;
    padding-right: 2.25rem;
}

.member-select:focus{
    border-color: var(--sgt-red) !important;
    outline: 0 !important;
    box-shadow: none !important;
}

.member-select:disabled{
    background-color: var(--sgt-light) !important;
}

.clear-member-select{
    position: absolute;
    top: 50%;
    right: 0.5rem;
    transform: translateY(-50%);
    background: none;
    border: 0;
    padding: 0;
    font-size: 20px;
    color: var(--sgt-red);
}

.autocomplete-suggestions{
    background-color: white;
    border-radius: 0.375rem;
    padding-left: 10px;
    padding-right: 10px;
    overflow-y: hidden;
}

.autocomplete-suggestion{
    cursor: pointer;
}

#invite-hint:empty{
    display: none;
}


/* ---------- small screens ---------- */

@media (max-width:768px){

    .hero-image{
        min-height: 0;
        padding-left: 0.6rem !important;
        padding-right: 0.6rem !important;
    }

    .hero-image h1{
        font-size: 1.4rem;
    }

    #cr-update-line{
        font-size: 0.6rem !important;
        line-height: 1.6;
    }

    .cr-podium{
        gap: 0.4rem;
        margin-top: 1rem !important;
    }

    .podium-card{
        padding: 0.7rem 0.3rem 0.6rem;
        font-size: 0.7rem;
        letter-spacing: 0.04rem;
        gap: 0.25rem;
        border-radius: 0.75rem;
    }

    .podium-card.place-1{
        padding-top: 1rem;
        padding-bottom: 0.9rem;
    }

    .podium-place{
        font-size: 1.2rem;
    }

    .podium-card.place-1 .podium-place{
        font-size: 1.6rem;
    }

    .podium-total{
        font-size: 0.95rem;
    }

    .podium-tag{
        font-size: 0.55rem;
        letter-spacing: 0.03rem;
        padding: 0.15rem 0.45rem;
    }

    .player-avatar-wrapper.podium-avatar,
    .player-avatar.podium-avatar{
        width: 44px;
        height: 44px;
    }

    .player-flag.podium-avatar{
        height: 16px;
        width: 16px !important;
    }

    .me-card{
        gap: 0.75rem 1.25rem;
    }

    .me-rank{
        font-size: 2rem;
    }

    .cr-controls{
        justify-content: center;
    }

    .cr-chips,
    .cr-selects{
        flex: 1 1 100%;
        justify-content: center;
    }

    .cr-tee-toggle{
        margin-right: 0;
    }

    /* the course list becomes cards: name and details on top, the record and its button below.
       Same rows as the desktop table, laid out as a grid, so paging, jumping and the drawer don't change */
    .cr-course-table,
    .cr-course-table tbody{
        display: block;
    }

    .cr-course-table thead{
        display: none;
    }

    .cr-course-table tbody tr.cr-row{
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        grid-template-areas:
            "course course toggle"
            "record attempt attempt";
        align-items: center;
        gap: 0.6rem 0.5rem;
        margin-bottom: 0.6rem;
        padding: 0.75rem 0.5rem 0.75rem 0.85rem;
        border-radius: 1rem;
        background-color: var(--sgt-md-gray);
    }

    .cr-course-table tbody tr.cr-row > td{
        display: block;
        padding: 0;
        border-radius: 0 !important;
        min-width: 0;
    }

    .cr-course-table .cr-course{
        grid-area: course;
    }

    .cr-course-table .cr-record{
        grid-area: record;
        box-shadow: none;
    }

    .cr-course-table .cr-attempt{
        grid-area: attempt;
        justify-self: end;
    }

    .cr-course-table .cr-toggle{
        grid-area: toggle;
        align-self: start;
    }

    .cr-course-table tbody tr.cr-row.is-open{
        margin-bottom: 0;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }

    .cr-course-table tbody tr.cr-detail-row,
    .cr-course-table tbody tr.cr-detail-row > td{
        display: block;
    }

    .cr-course-table tbody tr.cr-detail-row{
        margin-bottom: 0.6rem;
    }

    .cr-course-table tbody tr.cr-detail-row > td{
        padding: 0 0.6rem 1rem !important;
    }

    .cr-course-table tbody tr.cr-sentinel,
    .cr-course-table tbody tr.cr-empty{
        display: block;
    }

    .cr-course-table tbody tr.cr-empty > td{
        display: block;
    }

    .cr-course-table .cr-course-meta{
        font-size: 0.65rem;
    }

    .cr-course-table .cr-holder-name{
        font-size: 0.85rem;
    }

    .cr-course-table .cr-attempt-btn{
        padding: 0.35rem 0.6rem;
        font-size: 0.65rem;
    }

    .cr-course-table .cr-score{
        min-width: 2.6rem;
        margin-right: 0.6rem;
    }

    /* the ranked holders table stays a table; fixed layout keeps it at screen width */
    .cr-holders-table{
        table-layout: fixed;
        font-size: 75%;
    }

    .cr-holders-table td,
    .cr-holders-table th{
        padding: 0.55rem 0.35rem;
    }

    .cr-holders-table .three-quarter-font{
        font-size: 75% !important;
    }

    /* team names wrap inside the card rather than truncating */
    .cr-course-table .cr-record .cr-holder-name{
        white-space: normal;
        overflow-wrap: anywhere;
        line-height: 1.35;
    }

    .team-faces img{
        width: 24px;
        height: 24px;
    }

    /* every card is gray, not just the odd rows */
    .cr-course-table .team-faces img{
        border-color: var(--sgt-md-gray);
    }

    .format-grid-row{
        grid-template-columns: 2.6rem repeat(4, minmax(0, 1fr));
        gap: 0.3rem;
    }

    .format-cell{
        padding: 0.35rem 0.2rem;
    }

    .format-cell-label{
        font-size: 0.5rem;
    }

    .invite-slot input{
        font-size: 16px !important;
    }

    .cr-holders-table .col-rank{
        width: 2.8rem;
    }

    .cr-holders-table .col-num{
        width: 2.8rem;
    }

    .cr-holders-table .cr-holder-row td:nth-child(2) > div{
        min-width: 0;
    }

    .cr-detail-row > td{
        padding: 0.5rem 0.6rem 1rem !important;
    }

    .cr-detail-side{
        padding: 0.7rem;
    }

    .cr-board-table{
        font-size: 0.75rem;
    }

    .player-avatar-wrapper:not(.no-shrink){
        height:24px;
        width:24px;
        margin-right:6px;
    }

    .player-avatar:not(.no-shrink){
        width:24px;
        height:24px;
    }

    .player-flag:not(.no-shrink){
        right:-6px;
        height:12px;
        width: 12px !important;
    }

    /* the small flag still hangs 6px off the avatar, so leave room before the name */
    .cr-record .player-avatar-wrapper:not(.no-shrink),
    .cr-board-table .player-avatar-wrapper:not(.no-shrink),
    .team-member .player-avatar-wrapper:not(.no-shrink){
        margin-right: 12px;
    }

}


/* desktop table: backgrounds go on the cells, not the row, so every browser clips them to the cells'
   rounded corners and an open row joins its details without a notch (phone cards paint the row itself) */
@media (min-width:769px){

    .cr-course-table tbody tr.cr-row.odd,
    .cr-course-table tbody tr.cr-row.is-open{
        background-color: transparent;
    }

    .cr-course-table tbody tr.cr-row.odd > td,
    .cr-course-table tbody tr.cr-row.is-open > td{
        background-color: var(--sgt-md-gray);
    }

}

/* no browser focus box on click; keyboard focus gets a quiet underline instead */
.cr-tab:focus{
    outline: 0;
    box-shadow: none;
}

.cr-tab:focus-visible{
    color: var(--sgt-white);
    border-bottom-color: var(--sgt-light);
}

.cr-tab[aria-selected='true']:focus-visible{
    border-bottom-color: var(--sgt-red);
}

.cr-tab{
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--sgt-light);
    letter-spacing: inherit;
    white-space: nowrap;
}

.cr-tab:hover{
    color: var(--sgt-white);
}

.cr-tab[aria-selected='true']{
    color: var(--sgt-red);
    border-bottom-color: var(--sgt-red);
}

.cr-tab-count:not(:empty){
    margin-left: 0.4rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: var(--sgt-red);
    color: var(--sgt-white);
    font-size: 0.65rem;
}


/* ---------- record history: shared ---------- */

/* the view switch under the HISTORY tab: the same pill toggle as the tee, a size up and on its own row */
.cr-tee-toggle.h-views{
    margin-right: 0;
    max-width: 100%;
}

.h-views .cr-tee{
    padding: 0.35rem 1.1rem;
    white-space: nowrap;
}

.h-views .cr-tee i{
    margin-right: 0.45rem;
}

/* the count on a type pill */
.h-count:not(:empty){
    margin-left: 0.45rem;
    opacity: 0.75;
    font-variant-numeric: tabular-nums;
}

.h-sub{
    font-size: 0.65rem;
    letter-spacing: 0.05rem;
    color: var(--sgt-light);
    margin-bottom: 0.6rem;
}

.h-rank{
    width: 1.6rem;
    flex-shrink: 0;
    text-align: center;
    color: var(--sgt-light);
    font-variant-numeric: tabular-nums;
    font-size: 0.75rem;
}

.h-player{
    color: var(--sgt-white);
}

.h-player:hover{
    color: var(--sgt-light);
}

.h-course-link{
    background: none;
    border: 0;
    padding: 0;
    color: var(--sgt-white);
    letter-spacing: inherit;
    text-align: left;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.h-course-wrap{
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    min-width: 0;
}

.h-course-wrap .h-course-link{
    min-width: 0;
}

.h-course-wrap .h-tee{
    flex-shrink: 0;
}

.h-course-link:hover{
    text-decoration: underline;
    text-decoration-color: var(--sgt-red);
    text-underline-offset: 3px;
}

.h-tee{
    margin-left: 0.3rem;
    padding: 0 0.4rem;
    border: 1px solid var(--sgt-light-gray);
    border-radius: 999px;
    font-size: 0.6rem;
    color: var(--sgt-light);
    vertical-align: middle;
}

.h-tag{
    color: var(--sgt-light);
}

.h-tag.standing{
    color: #3fb35c;
}

.up{
    color: #3fb35c;
}

.down{
    color: #e05252;
}

/* one player's share against the other's: red is the left-hand player (you, on your own cards) */
.h-split{
    display: flex;
    gap: 2px;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
}

.h-split > span{
    display: block;
    min-width: 3px;
}

.h-split-left{
    background: var(--sgt-red);
}

.h-split-right{
    background: var(--sgt-light);
}

.h-key{
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 0.4rem;
    flex-shrink: 0;
}

.h-key.a{
    background: var(--sgt-red);
}

.h-key.b{
    background: var(--sgt-light);
}

.h-key.other{
    border: 1px solid var(--sgt-light);
}


/* ---------- activity ---------- */

.h-activity-grid{
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1.5rem;
    align-items: start;
}

.h-day{
    position: sticky;
    top: 0;
    z-index: 1;
    margin: 1rem 0 0.4rem;
    padding: 0.35rem 0;
    background: var(--sgt-dark-gray);
    color: var(--sgt-light);
    font-size: 0.7rem;
    letter-spacing: 0.15rem;
    border-bottom: 1px solid var(--sgt-light-gray);
}

.h-feed > .h-day:first-child{
    margin-top: 0;
}

.h-item{
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0.65rem 0.75rem;
    border-radius: 1rem;
    min-width: 0;
}

.h-item:nth-child(even){
    background: var(--sgt-md-gray);
}

/* your rows get the same red tint as your row on the record holders table */
.h-item.is-me{
    background: color-mix(in srgb, var(--sgt-red) 22%, var(--sgt-md-gray));
}

.h-item .player-avatar-wrapper{
    margin-right: 16px;
}

.h-item.type-took .cr-score{
    background: var(--sgt-red);
}

.h-item-body{
    min-width: 0;
    flex: 1;
}

.h-item-course{
    font-size: 0.95rem;
}

.h-item-line{
    font-size: 0.8rem;
    color: var(--sgt-light);
}

.h-verb{
    color: var(--sgt-light);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05rem;
}

.h-item-meta{
    text-transform: uppercase;
    margin-top: 0.15rem;
    font-size: 0.65rem;
    letter-spacing: 0.05rem;
    color: var(--sgt-light);
}

.h-sentinel{
    height: 1px;
}

.h-movers,
.h-book-card,
.h-mine{
    color: var(--sgt-white);
    background: var(--sgt-md-gray);
    border-radius: 1rem;
    padding: 0.9rem 1rem 1rem;
    min-width: 0;
}

.h-movers{
    position: sticky;
    top: 1rem;
}

.h-mover-list,
.h-book-list,
.h-reign-list,
.h-contested-list,
.h-exchange-list{
    list-style: none;
    margin: 0;
    padding: 0;
}

.h-mover,
.h-book-row,
.h-reign{
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.25rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--sgt-dark-gray);
    min-width: 0;
}

.h-mover:last-child,
.h-book-row:last-child,
.h-reign:last-child{
    border-bottom: 0;
}

.h-mover.is-me,
.h-book-row.is-me,
.h-reign.is-me{
    background: color-mix(in srgb, var(--sgt-red) 22%, var(--sgt-md-gray));
    border-radius: 0.5rem;
}

.h-mover .player-avatar-wrapper,
.h-book-row .player-avatar-wrapper,
.h-reign .player-avatar-wrapper{
    margin: 0 14px 0 0.25rem;
}

.h-mover-name{
    flex: 1;
    min-width: 0;
    background: none;
    border: 0;
    padding: 0;
    color: var(--sgt-white);
    font-size: 0.8rem;
    letter-spacing: inherit;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.h-mover-name:hover{
    text-decoration: underline;
    text-decoration-color: var(--sgt-red);
}

.h-mover-split{
    font-size: 0.65rem;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.h-mover-net,
.h-book-value{
    min-width: 2.6rem;
    text-align: right;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--sgt-white);
}


/* ---------- rivalries ---------- */

.h-mine{
    margin-bottom: 1.5rem;
    border: 1px solid var(--sgt-red);
}

.h-rival-grid{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
    gap: 0.75rem;
}

.h-rival-card{
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: var(--sgt-dark-gray);
    border: 1px solid var(--sgt-light-gray);
    border-radius: 0.75rem;
    padding: 0.75rem;
    color: var(--sgt-white);
    letter-spacing: inherit;
    text-align: left;
    min-width: 0;
}

.h-rival-card:hover,
.h-rival-card:focus-visible{
    border-color: var(--sgt-light);
}

.h-rival-card .player-avatar-wrapper{
    margin-right: 16px;
}

.h-rival-name{
    min-width: 0;
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.h-rival-score{
    font-weight: 700;
    font-size: 1.6rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.h-rival-dash{
    color: var(--sgt-light);
    margin: 0 0.35rem;
}

.h-rivalry{
    color: var(--sgt-white);
    border-radius: 1rem;
    padding: 0.6rem 0.75rem;
    cursor: pointer;
}

.h-rivalry:nth-child(odd){
    background: var(--sgt-md-gray);
}


.h-rivalry.is-open{
    background: var(--sgt-md-gray);
    box-shadow: inset 0 0 0 1px var(--sgt-light-gray);
}

/* after the open style so one of yours keeps its tint when opened */
.h-rivalry.is-me{
    background: color-mix(in srgb, var(--sgt-red) 22%, var(--sgt-md-gray));
}

.h-rivalry:focus-visible{
    outline: 1px solid var(--sgt-light);
}

.h-rivalry-head{
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(120px, 220px) minmax(0, 1fr);
    align-items: center;
    gap: 0.75rem;
}

.h-side{
    display: flex;
    flex-direction: row;
    align-items: center;
    min-width: 0;
    min-height: 32px;
}

.h-side.right{
    justify-content: flex-end;
}

.h-side.right .player-avatar-wrapper{
    margin: 0 9px 0 10px;
}

.h-side-name{
    min-width: 0;
    line-height: 1.2;
    color: var(--sgt-white);
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.h-side .player-avatar-wrapper{
    margin-right: 16px;
}

/* names take the free space, so each count sits against the bar in a straight column */
.h-side .h-side-name{
    flex: 1;
}

.h-side.right .h-side-name{
    text-align: right;
}

/* a fixed width so the names line up whatever the count, centred on the avatar's line */
.h-side-won{
    flex-shrink: 0;
    min-width: 2.4em;
    margin: 0 0.4rem;
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1;
    text-align: center;
    color: var(--sgt-light);
    font-variant-numeric: tabular-nums;
}

.h-side-won.lead{
    color: var(--sgt-white);
}

.h-rivalry-total{
    margin-top: 0.35rem;
    text-align: center;
    font-size: 0.6rem;
    letter-spacing: 0.05rem;
    color: var(--sgt-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.h-rivalry-detail{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 1rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--sgt-light-gray);
    cursor: default;
}

.h-rivalry-detail-col{
    background: var(--sgt-dark-gray);
    border-radius: 0.75rem;
    padding: 0.8rem 1rem;
    min-width: 0;
}

.h-holdings{
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.25rem;
    margin-bottom: 0.6rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--sgt-light);
}

.h-holdings b{
    color: var(--sgt-white);
    margin-left: 0.25rem;
}

.h-contested,
.h-exchange{
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--sgt-md-gray);
    font-size: 0.8rem;
    min-width: 0;
}

.h-contested .h-course-link{
    flex: 1;
    min-width: 0;
}

.h-contested-holder,
.h-exchange-score,
.h-exchange-day,
.h-contested-count{
    flex-shrink: 0;
    font-size: 0.7rem;
    color: var(--sgt-light);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.h-contested-holder{
    max-width: 40%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.h-exchange-day{
    width: 6.5rem;
}

.h-exchange-what{
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--sgt-light);
    font-size: 0.75rem;
}


/* ---------- record book ---------- */

.h-book{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
    gap: 1rem;
}

.h-book-main,
.h-reign-main{
    flex: 1;
    min-width: 0;
    font-size: 0.85rem;
}

.h-book-main .h-course-link{
    display: block;
}

.h-book-sub{
    font-size: 0.65rem;
    letter-spacing: 0.04rem;
    color: var(--sgt-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.h-book-value{
    min-width: 4.5rem;
    font-size: 0.8rem;
}


/* ---------- course drawer history ---------- */

.cr-detail-wide{
    grid-column: 1 / -1;
}

.h-history-summary{
    font-size: 0.7rem;
    letter-spacing: 0.05rem;
    color: var(--sgt-light);
    margin-bottom: 0.5rem;
}

.h-chart-wrap{
    position: relative;
    margin-bottom: 0.75rem;
}

.h-chart svg{
    display: block;
    overflow: visible;
}

.h-grid{
    stroke: var(--sgt-light-gray);
    stroke-width: 1;
    opacity: 0.6;
}

.h-axis{
    fill: var(--sgt-light);
    font-size: 10px;
    letter-spacing: 0.05em;
    font-variant-numeric: tabular-nums;
}

.h-line{
    fill: none;
    stroke: var(--sgt-red);
    stroke-width: 2;
    stroke-linejoin: round;
}

.h-dot{
    fill: var(--sgt-red);
    stroke: var(--sgt-dark-gray);
    stroke-width: 2;
}

.h-dot.current{
    fill: var(--sgt-white);
    stroke: var(--sgt-red);
}

.h-dot.clipped{
    fill: var(--sgt-dark-gray);
    stroke: var(--sgt-red);
    stroke-dasharray: 2 2;
}

.h-hit{
    fill: transparent;
}

.h-point{
    cursor: pointer;
    outline: none;
}

.h-point:hover .h-dot,
.h-point:focus .h-dot{
    stroke: var(--sgt-white);
}

.h-tip{
    position: absolute;
    z-index: 2;
    width: 180px;
    padding: 0.5rem 0.65rem;
    background: var(--sgt-black);
    border: 1px solid var(--sgt-light-gray);
    border-radius: 0.5rem;
    font-size: 0.75rem;
    pointer-events: none;
}

.h-tip-score{
    font-weight: 700;
    font-size: 1.1rem;
}

.h-tip-sub{
    font-size: 0.6rem;
    letter-spacing: 0.04rem;
    color: var(--sgt-light);
    text-transform: uppercase;
}

.h-reign .cr-score{
    margin-right: 0.5rem;
}

.h-reign-held{
    flex-shrink: 0;
    font-size: 0.65rem;
    letter-spacing: 0.04rem;
    color: var(--sgt-light);
    white-space: nowrap;
}

.h-reign-held.standing{
    color: #3fb35c;
}


/* the movers sit above the feed once there's no room beside it */
@media (max-width:991.98px){

    .h-activity-grid{
        grid-template-columns: minmax(0, 1fr);
    }

    .h-movers{
        order: -1;
        position: static;
    }

}


/* history rows show team faces instead of one avatar */
.h-item .team-faces,
.h-book-row .team-faces,
.h-reign .team-faces{
    flex-shrink: 0;
    margin-right: 0.75rem;
}

.h-book-team{
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


@media (max-width:768px){

    /* centered like the rest of the controls on phones */
    .cr-tee-toggle.h-views{
        display: flex;
        width: fit-content;
        margin: 0 auto;
    }

    .h-views .cr-tee{
        padding: 0.3rem 0.7rem;
        font-size: 0.65rem;
    }

    /* the movers sit above the feed here, so keep them short */
    .h-mover:nth-child(n+6){
        display: none;
    }

    .h-item{
        padding: 0.6rem 0.5rem;
        align-items: flex-start;
    }

    .h-item .cr-score{
        min-width: 2.6rem;
        margin-right: 0.6rem;
    }

    .h-item .player-avatar-wrapper{
        display: none;
    }

    /* rivalry rows: the two players side by side, the bar and totals underneath */
    .h-rivalry-head{
        grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas:
            "rank left right"
            "rank mid mid";
        gap: 0.4rem 0.5rem;
    }

    .h-rivalry-head > .h-rank{
        grid-area: rank;
    }

    .h-side.left{
        grid-area: left;
    }

    .h-side.right{
        grid-area: right;
    }

    .h-rivalry-mid{
        grid-area: mid;
    }

    .h-side-name{
        font-size: 0.75rem;
    }

    .h-side-won{
        font-size: 1rem;
        margin: 0 0.4rem;
    }

    .h-exchange-day{
        width: auto;
    }

    .h-exchange{
        flex-wrap: wrap;
        gap: 0.15rem 0.5rem;
    }

    .h-exchange-what{
        flex-basis: 100%;
        order: 3;
        white-space: normal;
    }

    .h-exchange-what .h-course-link{
        white-space: normal;
        text-align: left;
    }

    .h-contested-holder{
        max-width: 45%;
        font-size: 0.6rem;
    }

    .h-book-value{
        min-width: 3.6rem;
    }

    .h-item .team-faces{
        display: none;
    }

}
