/* ==========================================================================
   Perfect Game - Event Stats (events/Stats/EventStats.aspx).

   Draws on the leaderboard scale, so this page reads as the same product as
   Stats/Leaderboard.aspx, a player profile, a team page and event top
   performers. Shared pieces - the source picker, the empty and error states -
   live in Stats.Shared.css.

   This is a stat-per-column table, which the team page also draws. It does not
   reuse .stat-table because the header cells here are buttons that sort, and
   the leading column stays put while fifteen stat columns scroll sideways.
   ========================================================================== */

.es {
    font-family: var(--lb-body);
    color: var(--lb-dark);
}

.es a {
    color: var(--lb-green);
    text-decoration: none;
}

.es a:hover {
    color: var(--lb-green-dk);
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Section bar
   -------------------------------------------------------------------------- */

.es-section {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    background: var(--lb-panel);
    border-left: 3px solid var(--lb-green);
    padding: 8px 12px;
    font-family: var(--lb-head);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--lb-dark);
}

.es-section-note,
.es-count {
    font-family: var(--lb-body);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    color: var(--lb-quiet);
}

.es-spacer {
    flex: 1;
}

@media (max-width: 767px) {
    .es-section {
        align-items: flex-start;
    }

    .es-spacer {
        flex-basis: 100%;
        height: 0;
    }
}

/* --------------------------------------------------------------------------
   Toolbar - perspective, phase, stat source and search. Sticks to the top so
   the controls stay reachable while the rows scroll under them.
   -------------------------------------------------------------------------- */

.es-toolbar-wrap {
    position: sticky;
    top: var(--pg-stats-head-h);
    z-index: 30;
    background: var(--lb-bg);
    padding: 16px 0 10px;
}

.es-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid var(--lb-line);
    border-radius: var(--lb-r);
}

.es-group-label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--lb-mute);
    margin-bottom: 5px;
}

.es-seg {
    display: flex;
}

.es-seg-btn,
a.es-seg-btn {
    font-family: var(--lb-body);
    font-size: 13px;
    font-weight: 600;
    padding: 9px 16px;
    min-height: 40px;
    cursor: pointer;
    margin-left: -1px;
    border: 1px solid var(--lb-input);
    background: #fff;
    color: var(--lb-mute);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: background-color .18s ease, color .18s ease;
}

.es-seg-btn:hover,
a.es-seg-btn:hover {
    background: #eef0f2;
    color: var(--lb-dark);
    text-decoration: none;
}

.es-seg-btn.active,
a.es-seg-btn.active,
a.es-seg-btn.active:hover {
    background: var(--lb-dark);
    border-color: var(--lb-dark);
    color: #fff;
}

.es-tabs {
    display: flex;
    align-self: flex-end;
    align-items: flex-end;
    border-bottom: 3px solid var(--lb-line);
}

.es-tab,
a.es-tab {
    font-family: var(--lb-head);
    font-size: 13px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 12px 20px;
    min-height: 44px;
    cursor: pointer;
    border: 1px solid var(--lb-line);
    border-bottom: 3px solid transparent;
    border-radius: var(--lb-r) var(--lb-r) 0 0;
    margin-bottom: -3px;
    margin-left: -1px;
    background: var(--lb-bg);
    color: var(--lb-mute);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: background-color .18s ease, color .18s ease;
}

.es-tab:hover,
a.es-tab:hover {
    background: #eef0f2;
    color: var(--lb-dark);
    text-decoration: none;
}

.es-tab.active,
a.es-tab.active,
a.es-tab.active:hover {
    background: var(--lb-dark);
    color: #fff;
    border-bottom-color: var(--lb-green);
}

.es-toolbar-sep {
    width: 1px;
    height: 40px;
    background: #e6eae6;
}

/* The picker stacks its label over its buttons here, so the toolbar reads as
   one row of controls rather than a label chasing its buttons along the line. */
.es-toolbar .sv2-filter-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.es-toolbar .sv2-filter-label {
    font-family: var(--lb-body);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--lb-mute);
}

.es-search {
    font-family: var(--lb-body);
    font-size: 14px;
    padding: 11px 13px;
    min-height: 44px;
    width: 220px;
    align-self: flex-end;
    border: 1px solid var(--lb-input);
    border-radius: var(--lb-r);
    background: #fff;
    color: var(--lb-dark);
}

.es-search:focus {
    border-color: var(--lb-green);
    outline: none;
}

@media (max-width: 767px) {
    .es-toolbar-sep {
        display: none;
    }

    .es-group,
    .es-tabs,
    .es-toolbar .sv2-filter-row,
    .es-search {
        width: 100%;
    }

    .es-seg-btn,
    a.es-seg-btn,
    .es-tab,
    a.es-tab {
        flex: 1 1 0;
        justify-content: center;
        padding: 12px 10px;
    }
}

/* --------------------------------------------------------------------------
   Table - wide screens
   -------------------------------------------------------------------------- */

.es-table-wrap {
    background: #fff;
    border: 1px solid var(--lb-line);
    border-radius: var(--lb-r);
    overflow: hidden;
}

.es-table-scroll {
    overflow-x: auto;
}

.es-table {
    width: 100%;
    min-width: 1120px;
    border-collapse: collapse;
    background: #fff;
}

.es-table thead tr {
    background: var(--lb-dark);
}

.es-table th {
    background: var(--lb-dark);
    padding: 0;
    border: 0;
    white-space: nowrap;
}

/* The name stays put while the stats scroll sideways. */
.es-table th.es-who,
.es-table td.es-who {
    position: sticky;
    left: 0;
    z-index: 2;
    width: 268px;
    min-width: 268px;
    border-right: 1px solid var(--lb-line-soft);
}

.es-table th.es-who {
    z-index: 3;
    padding: 0 14px;
    border-right-color: rgba(255, 255, 255, 0.08);
    font-family: var(--lb-head);
    font-size: 10.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    text-align: left;
    height: 46px;
}

/* Every stat header is a button, so the whole cell is the sort target. */
.es-sort,
a.es-sort {
    display: block;
    width: 100%;
    font-family: var(--lb-head);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
    text-align: right;
    padding: 13px 8px;
    min-height: 44px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .18s ease, color .18s ease;
}

.es-sort:hover,
a.es-sort:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    text-decoration: none;
}

.es-sort.is-on,
a.es-sort.is-on,
a.es-sort.is-on:hover {
    background: rgba(64, 168, 76, 0.22);
    color: #fff;
    font-weight: 700;
}

.es-row {
    border-bottom: 1px solid var(--lb-line-soft);
    background: #fff;
    transition: background-color .12s ease;
}

.es-table td {
    padding: 10px 8px;
    text-align: right;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--lb-dark);
    vertical-align: middle;
}

.es-table td.es-who {
    background: #fff;
    padding: 10px 14px;
    text-align: left;
    border-left: 3px solid transparent;
}

.es-row:hover {
    background: #f4f9f5;
}

.es-row:hover td.es-who {
    background: #f4f9f5;
    border-left-color: var(--lb-green);
}

.es a.es-name {
    display: block;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--lb-dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.es a.es-name:hover {
    color: var(--lb-green);
    text-decoration: none;
}

.es-sub {
    display: block;
    font-size: 11.5px;
    color: var(--lb-quiet);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Marks the leading number in a column. */
.es-table td.is-best {
    color: var(--lb-green-dk);
    font-weight: 700;
    background: rgba(64, 168, 76, 0.08);
}

.es-row:hover td.is-best {
    background: rgba(64, 168, 76, 0.14);
}

/* --------------------------------------------------------------------------
   Table - phones. Each row becomes a card with a scrolling stat strip.
   -------------------------------------------------------------------------- */

.es-cards {
    display: none;
    flex-direction: column;
    gap: 10px;
}

.es-card {
    background: #fff;
    border: 1px solid var(--lb-line);
    border-radius: var(--lb-r);
    overflow: hidden;
}

.es-card-head {
    padding: 12px 13px;
}

.es a.es-card-name {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: var(--lb-dark);
}

.es-card-sub {
    display: block;
    font-size: 12.5px;
    color: var(--lb-quiet);
    margin-top: 2px;
}

.es-card-stats {
    display: flex;
    border-top: 1px solid var(--lb-line-soft);
    overflow-x: auto;
}

.es-card-stat {
    flex: 0 0 auto;
    min-width: 62px;
    padding: 9px 6px;
    text-align: center;
    border-right: 1px solid var(--lb-bg);
}

.es-card-label {
    font-family: var(--lb-head);
    font-size: 9.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--lb-quiet);
}

.es-card-value {
    font-size: 14px;
    margin-top: 2px;
    color: var(--lb-dark);
    font-variant-numeric: tabular-nums;
}

.es-card-stat.is-best .es-card-value {
    color: var(--lb-green-dk);
    font-weight: 700;
}

@media (max-width: 859px) {
    .es-table-wrap {
        display: none;
    }

    .es-cards {
        display: flex;
    }
}

/* --------------------------------------------------------------------------
   No search match. Server-rendered empty states use .sv2-empty; this one is
   raised by the client filter, so it ships hidden.
   -------------------------------------------------------------------------- */

.es-nomatch {
    display: none;
    background: #fff;
    border: 1px dashed var(--lb-input);
    border-radius: var(--lb-r);
    padding: 48px 24px;
    text-align: center;
}

.es-nomatch.is-on {
    display: block;
}

.es-nomatch-head {
    font-family: var(--lb-head);
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--lb-dark);
}

.es-nomatch-body {
    font-size: 14px;
    color: var(--lb-mute);
    margin-top: 8px;
    line-height: 1.55;
}

