.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%;
}


.expand-cell{
    width:99%;
}


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

.wgr-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;
}

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


/* ---------- 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 ---------- */

.wgr-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-wgr{
    font-size: 1.15rem;
    font-variant-numeric: tabular-nums;
}

.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;
    text-wrap: balance;
}


/* ---------- movers and your rank ---------- */

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

#wgr-app,
#leaderboard-container{
    min-width: 0;
    max-width: 100%;
}

#leaderboard-container > div{
    overflow-x: auto;
}

.mover-card,
.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;
}

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

/* the flag hangs 9px off the avatar's right edge, so leave room before the text */
.mover-card .player-avatar-wrapper{
    margin-right: 18px;
}

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

.mover-stat{
    font-size: 0.8rem;
    color: var(--sgt-white);
}

.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;
    margin-bottom: 0.25rem;
}

.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: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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


/* ---------- controls ---------- */

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

/* min-width 0 lets the chip row scroll inside the flex row instead of widening the page */
.wgr-chips{
    display: flex;
    flex-direction: row;
    gap: 0.4rem;
    overflow-x: auto;
    scrollbar-width: none;
    max-width: 100%;
    min-width: 0;
}

.wgr-chips::-webkit-scrollbar{
    display: none;
}

/* same look as the scorecard's strokes gained toggle: btn-outline red, solid when selected */
.wgr-chip{
    flex-shrink: 0;
    letter-spacing: normal;
    white-space: nowrap;
}

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


/* ---------- standings table ---------- */

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

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

.wgr-table tbody tr.wgr-row{
    cursor: pointer;
}

/* 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 */
.wgr-table tbody tr.wgr-row.odd > td{
    background-color: var(--sgt-md-gray);
}

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

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

/* site leaderboard dividers: rank | ... | wgr, visible on the gray rows only (the chevron column sits outside them) */
.wgr-table tbody tr.wgr-row > td.wgr-rank{
    border-right: 1px solid transparent;
}

.wgr-table tbody tr.wgr-row > td.wgr-value{
    border-left: 1px solid transparent;
}

.wgr-table tbody tr.wgr-row.odd > td.wgr-rank,
.wgr-table tbody tr.wgr-row.is-me > td.wgr-rank,
.wgr-table tbody tr.wgr-row.is-open > td.wgr-rank{
    border-right-color: var(--sgt-dark-gray);
}

.wgr-table tbody tr.wgr-row.odd > td.wgr-value,
.wgr-table tbody tr.wgr-row.is-me > td.wgr-value,
.wgr-table tbody tr.wgr-row.is-open > td.wgr-value{
    border-left-color: var(--sgt-dark-gray);
}

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

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

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

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

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

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

.wgr-rank{
    min-width: 4.5rem;
}

.wgr-rank-num{
    font-variant-numeric: tabular-nums;
}

.wgr-value{
    font-variant-numeric: tabular-nums;
    font-weight: bold;
}

.wgr-trend svg{
    vertical-align: middle;
}

.rank-change{
    padding-left:5px;
    font-size: 0.8em;
}

.rank-drop{
    color: #e05252;
}

.rank-rise{
    color: #3fb35c;
}

.rank-same{
    color: var(--sgt-light-gray);
}

.rank-new{
    margin-left: 5px;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    background: var(--sgt-red);
    color: var(--sgt-white);
    font-size: 0.6rem;
    vertical-align: middle;
}

.wgr-overall{
    font-size: 0.7em;
    color: var(--sgt-light);
}

.wgr-hcp{
    padding-left: 0.5rem;
    color: var(--sgt-light);
    font-size: 0.75em;
}

.wgr-badge{
    margin-left: 0.5rem;
    font-size: 0.8em;
}

.wgr-badge.hot{
    color: #f08a24;
}

.wgr-badge.cold{
    color: #6cb4ee;
}

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

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

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

.wgr-spark path{
    stroke: var(--sgt-light);
}

.wgr-spark circle{
    fill: var(--sgt-light);
}

.wgr-spark.up path{
    stroke: #3fb35c;
}

.wgr-spark.up circle{
    fill: #3fb35c;
}

.wgr-spark.down path{
    stroke: #e05252;
}

.wgr-spark.down circle{
    fill: #e05252;
}

.tier-divider td{
    padding: 0.35rem 0.6rem !important;
}

.tier-divider span{
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--sgt-light);
    font-size: 0.65rem;
    letter-spacing: 0.15rem;
}

.tier-divider span::before,
.tier-divider span::after{
    content: '';
    flex: 1;
    border-top: 1px dashed var(--sgt-light-gray);
}

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


/* ---------- details drawer ---------- */

.wgr-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;
}

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

.detail-tiles{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.detail-tiles .me-stat{
    background: var(--sgt-dark-gray);
    border-radius: 0.75rem;
    padding: 0.6rem 0.8rem;
}

.wgr-history-chart{
    width: 100%;
}

.wgr-history-svg{
    display: block;
    width: 100%;
    height: auto;
    touch-action: pan-y;
}

.wgr-history-svg .line{
    fill: none;
    stroke: var(--sgt-red);
    stroke-width: 2.5;
    stroke-linejoin: round;
}

.wgr-history-svg .area{
    fill: var(--sgt-red);
    opacity: 0.12;
}

.wgr-history-svg .grid{
    stroke: var(--sgt-light-gray);
    stroke-dasharray: 3 4;
}

.wgr-history-svg .axis{
    fill: var(--sgt-light);
    font-size: 11px;
    letter-spacing: 0.05rem;
}

.wgr-history-svg .best{
    fill: #3fb35c;
}

.wgr-history-svg .current{
    fill: var(--sgt-white);
    stroke: var(--sgt-red);
    stroke-width: 2;
}

.wgr-history-svg .hover-line{
    stroke: var(--sgt-light);
    stroke-width: 1;
}

.wgr-history-svg .hover-dot{
    fill: var(--sgt-white);
}

.wgr-chart-tip{
    position: absolute;
    transform: translate(-50%, -100%);
    background: var(--sgt-black);
    border: 1px solid var(--sgt-light-gray);
    border-radius: 0.5rem;
    padding: 0.3rem 0.55rem;
    font-size: 0.7rem;
    color: var(--sgt-light);
    white-space: nowrap;
    pointer-events: none;
}

.wgr-expiring{
    margin-top: 0.75rem;
    padding: 0.6rem 0.8rem;
    border-radius: 0.75rem;
    border: 1px solid #b7791f;
    background: rgba(183, 121, 31, 0.12);
    font-size: 0.8rem;
}

.wgr-events-table{
    width: 100%;
    font-size: 0.85rem;
}

.wgr-events-table th{
    color: var(--sgt-light);
    font-size: 0.7rem;
    font-weight: normal;
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid var(--sgt-light-gray);
}

.wgr-events-table td{
    padding: 0.45rem 0.5rem;
    border-bottom: 1px solid var(--sgt-dark-gray);
}

.wgr-pts{
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-variant-numeric: tabular-nums;
}

.wgr-pts span{
    min-width: 3.2rem;
}

.wgr-pts-bar{
    width: 70px;
    height: 6px;
    border-radius: 3px;
    background: var(--sgt-light-gray);
    overflow: hidden;
}

.wgr-pts-bar div{
    height: 100%;
    background: var(--sgt-red);
}

.wgr-pill{
    font-size: 0.65rem;
    color: var(--sgt-light);
}

.wgr-pill.expiring,
.wgr-pill.final{
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    color: var(--sgt-white);
    background: #b7791f;
}

.wgr-pill.final{
    background: #c0392b;
}


/* ---------- how it works ---------- */

.wgr-how-steps{
    padding-left: 1.2rem;
    font-size: 0.9rem;
    color: var(--sgt-light);
}

.wgr-how-steps li{
    margin-bottom: 0.5rem;
}


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

@media (max-width:768px){

    .hero-image{
        min-height: 0;
    }

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

    .wgr-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-wgr{
        font-size: 0.95rem;
    }

    .podium-change{
        line-height: 1;
    }

    .podium-tag{
        font-size: 0.55rem;
        letter-spacing: 0.03rem;
        padding: 0.15rem 0.45rem;
        border-radius: 0.6rem;
        line-height: 1.35;
    }

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

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

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

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

    .wgr-table{
        font-size: 75%;
    }

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

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

    /* fixed layout keeps the table (and any open drawer) at screen width; long names truncate instead */
    .wgr-table{
        table-layout: fixed;
    }

    .wgr-table .col-rank{
        width: 3.4rem;
    }

    .wgr-table .col-events{
        width: 3.6rem;
    }

    .wgr-table .col-wgr{
        width: 4.6rem;
    }

    .wgr-table .col-toggle{
        width: 2rem;
    }

    .wgr-table .wgr-rank .rank-change{
        display: block;
        padding-left: 0;
        margin: 0.15rem auto 0;
        width: fit-content;
    }

    .wgr-table .wgr-player{
        overflow: hidden;
    }

    .wgr-table .wgr-player > div{
        min-width: 0;
    }

    .wgr-table .wgr-player a{
        flex: 0 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .wgr-table .wgr-player .wgr-badge,
    .wgr-table .wgr-player .wgr-me-tag,
    .wgr-table .wgr-player .wgr-hcp{
        flex-shrink: 0;
    }

    .wgr-table td.wgr-toggle,
    .wgr-table th.col-toggle{
        padding-left: 0;
        padding-right: 0.25rem;
    }

    .wgr-events-table{
        table-layout: fixed;
        font-size: 0.75rem;
    }

    .wgr-events-table .col-finish{
        width: 3.4rem;
    }

    .wgr-events-table .col-points{
        width: 3.6rem;
    }

    .wgr-events-table .col-left{
        width: 4.4rem;
    }

    .wgr-events-table th,
    .wgr-events-table td{
        padding: 0.4rem 0.3rem;
    }

    .wgr-event-name{
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .wgr-pts{
        gap: 0.3rem;
    }

    .wgr-pts span{
        min-width: 2.4rem;
    }

    /* no room for the decay bar on a phone; the event name gets the space instead */
    .wgr-pts-bar{
        display: none;
    }

    .detail-tiles{
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .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;;
      }

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

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

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

    .wgr-chips{
        flex: 1 1 100%;
    }

    /* movers become a swipeable strip instead of a tall stack */
    .mover-grid{
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: 78%;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }

    .mover-grid::-webkit-scrollbar{
        display: none;
    }

    .mover-card{
        scroll-snap-align: start;
    }

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

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

}
