/* The event header and sponsor are shared, in app/app.css */

.event-tabs {
    margin-bottom: 24px;
}


/* ---------- Stats and round progress ---------- */

.stat-tiles {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat {
    display: flex;
    flex-direction: column;
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.stat-value {
    font: 800 34px/1.1 Nunito, sans-serif;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    color: var(--muted);
    font-size: 14px;
}

.stat-note {
    color: var(--muted);
    font-size: 12px;
    font-style: italic;
}

.stat-sim .stat-value {
    color: var(--accent-text);
}

.round-progress {
    margin-bottom: 20px;
}

.rp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px 24px;
}

.rp-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
}

.rp-label {
    font-weight: 500;
}

.rp-count {
    margin-left: auto;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.rp-bar {
    height: 6px;
    border-radius: 999px;
    background: var(--raised);
    overflow: hidden;
}

.rp-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
    transition: width 0.4s ease-out;
}


/* ---------- Leaderboard ---------- */

.lb-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
}

.lb-status.live::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--live);
    animation: pulse 2s ease-out infinite;
}

.lb-status.error {
    color: var(--warn);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 var(--live); }
    100% { box-shadow: 0 0 0 8px transparent; }
}

.lb-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.lb-search {
    position: relative;
    flex: 0 1 280px;
}

.lb-search i {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 13px;
}

.lb-search .input {
    width: 100%;
    padding-left: 34px;
}

.lb-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin: 0 0 18px;
    padding: 0;
    color: var(--muted);
    font-size: 13px;
    list-style: none;
}

/* Shown on the Sim Cup and Commoners tabs while the field is still a projection */
.lb-filter-note {
    display: flex;
    gap: 10px;
    align-items: baseline;
    margin: 0 0 14px;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--muted);
    font-size: 14px;
}

.lb-filter-note[hidden] {
    display: none;
}

.lb-filter-note i {
    color: var(--accent-text);
}

.lb-filter-note strong {
    color: var(--text);
}

.lb-legend .cup {
    margin: 0 6px 0 0;
}

.lb {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-variant-numeric: tabular-nums;
}

.lb th {
    position: sticky;
    top: var(--appbar-h);
    z-index: 2;
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-solid);
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
    user-select: none;
}

.lb th[data-sort] {
    cursor: pointer;
}

.lb th[data-sort]:hover,
.lb th.sorted {
    color: var(--text);
}

.lb th.sorted::after {
    content: '\f0d8';   /* caret-up */
    margin-left: 6px;
    font: var(--fa-font-solid);
    font-size: 10px;
}

.lb th.sorted.desc::after {
    content: '\f0d7';   /* caret-down */
}

.lb td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.lb-row:hover td {
    background: var(--row-hover);
}

.lb-row.cup-sim .c-rank {
    box-shadow: inset 3px 0 var(--accent);
}

.lb-row.is-pending .c-rank {
    box-shadow: inset 3px 0 var(--warn);
}

.lb-row.is-out td {
    opacity: 0.45;
}

.c-rank {
    width: 52px;
}

.rank {
    display: inline-grid;
    place-items: center;
    min-width: 30px;
    height: 30px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--raised);
    font-size: 13px;
    font-weight: 700;
}

.rank.medal-1 { background: var(--gold-soft); color: var(--gold); }
.rank.medal-2 { background: var(--silver-soft); color: var(--silver); }
.rank.medal-3 { background: var(--bronze-soft); color: var(--bronze); }

.c-player .name {
    margin-right: 8px;
    font-weight: 500;
}

.cup {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    vertical-align: 1px;
}

.cup i {
    font-size: 10px;
}

.cup.sim {
    background: var(--accent-soft);
    color: var(--accent-text);
}

.cup.pending {
    border: 1px dashed var(--warn);
    color: var(--warn);
}

.cup.pending b {
    padding: 0 5px;
    border-radius: 999px;
    background: var(--warn-soft);
}

.cup.commoners {
    background: var(--raised);
    color: var(--text);
}

.c-pts {
    font-weight: 700;
}

.c-round {
    width: 72px;
}

.score {
    display: block;
}

.score.under { color: var(--danger-text); }
.score.even { color: var(--muted); }

.pts {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.dnf {
    color: var(--muted);
    opacity: 0.6;
}

.c-odds {
    width: 110px;
}

/* Percentage, a short bar under it, then the betting line */
.odds {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    width: 52px;
}

.odds-pct {
    font-weight: 700;
}

.odds-pct.high { color: var(--accent-text); }
.odds-pct.mid { color: var(--text); }
.odds-pct.low { color: var(--muted); }

.odds-bar {
    width: 100%;
    height: 3px;
    border-radius: 999px;
    background: var(--raised);
    overflow: hidden;
}

.odds-bar span {
    display: block;
    height: 100%;
    background: var(--accent);
}

.odds-line {
    color: var(--muted);
    font-size: 11px;
    line-height: 1;
}

.odds-out {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
}

.lb-cut td {
    padding: 14px 8px;
    border-top: 2px dashed var(--accent);
    background: var(--accent-soft);
}

.lb-cut.projected td {
    border-top-color: var(--muted);
    background: var(--raised);
}

.cut-title {
    margin-right: 12px;
    color: var(--accent-text);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.lb-cut.projected .cut-title {
    color: var(--text);
}

.cut-detail {
    color: var(--muted);
    font-size: 13px;
}

.lb .empty {
    padding: 28px 12px;
}

.lb-note {
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 13px;
}

/* Only used on phones */
.c-toggle,
.m-odds,
.lb-detail {
    display: none;
}


/* ---------- Register ---------- */

.form-sheet {
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.form-sheet iframe {
    display: block;
    width: 100%;
    height: 2750px;
    border: 0;
}


/* ---------- Phones ---------- */

@media (max-width: 767px) {
    /* Two by two instead of one wide row */
    .stat-tiles {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .stat {
        padding: 14px 16px;
    }

    .stat-value {
        font-size: 28px;
    }

    .card.lb-card {
        padding: 16px 12px;
    }

    .lb-search {
        flex: 1 1 100%;
    }

    .lb-legend {
        display: none;
    }

    /* Rank | player | points | chevron; tap a row for its rounds and odds */
    .c-odds,
    .c-round {
        display: none;
    }

    .c-toggle {
        display: table-cell;
        width: 28px;
        color: var(--muted);
        text-align: right;
    }

    .c-toggle i {
        transition: transform 0.2s;
    }

    .lb-row {
        cursor: pointer;
    }

    .lb-row.open .c-toggle i {
        transform: rotate(180deg);
    }

    .c-rank {
        width: 44px;
    }

    .c-player .name {
        display: block;
        margin: 0 0 4px;
    }

    .m-odds {
        display: inline-block;
        margin-left: 6px;
        color: var(--muted);
        font-size: 12px;
    }

    .c-pts {
        text-align: right;
    }

    .lb-detail.open {
        display: table-row;
    }

    .lb-detail td {
        padding: 4px 8px 14px 52px;
        background: var(--row-hover);
    }

    .detail-rounds {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
        gap: 10px;
    }

    .detail-rounds b {
        display: block;
        color: var(--muted);
        font-size: 11px;
        letter-spacing: 0.06em;
    }

    .detail-odds {
        margin-top: 10px;
        color: var(--muted);
        font-size: 13px;
    }

    .lb-cut td {
        padding: 12px 8px;
    }

    .cut-title,
    .cut-detail {
        display: block;
    }

    .form-sheet iframe {
        height: 3200px;
    }
}
