
#page-header{
    height:350px;
    width:100%;
}

/* ---------- Hero ---------- */

#event-hero{
    padding: 2rem 0 2.5rem;
}

.event-eyebrow{
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #9e9e9e;
}

.event-title{
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin: 0.5rem 0 1rem;
}

.event-rule{
    width: 64px;
    height: 3px;
    margin: 0 auto 2rem;
    border-radius: 2px;
    background: #1266F1;
}

#sponsor{
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 1.25rem 0.6rem 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    text-decoration: none;
    transition: border-color 0.3s, background 0.3s;
}

#sponsor:hover{
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.08);
}

#sponsor .sponsor-label{
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #bdbdbd;
}

#sponsor img{
    height: 56px;
    width: auto;
}

/* ---------- Main card ---------- */

#event-card{
    padding: 1.5rem;
    border-radius: 12px;
    background: #f8f9fa;
}

#event-tabs{
    padding: 0.35rem;
    margin-bottom: 1.5rem;
    border-radius: 10px;
    background: #e9ecef;
}

#event-tabs .nav-link{
    margin: 0;
    border-radius: 8px;
    font-weight: 500;
    color: #616161;
    box-shadow: none;
    background: transparent;
    transition: background 0.2s, color 0.2s;
}

#event-tabs .nav-link:hover{
    color: #212121;
}

#event-tabs .nav-link.active{
    color: #fff;
    background: #1266F1;
    box-shadow: 0 2px 6px rgba(18, 102, 241, 0.35);
}

#register-frame{
    max-width: 700px;
    margin: 0 auto;
}

#register-frame iframe{
    display: block;
}

/* ---------- Leaderboard ---------- */

/* Cup colours: Sim Cup = blue, Commoners Cup = green */
#event-card{
    --sim: #1266F1;
    --sim-soft: #e8f0fe;
    --commoners: #14a44d;
    --commoners-soft: #e6f6ec;
}

#lb-stats{
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.lb-stat-sim{ box-shadow: inset 0 3px 0 var(--sim); }
.lb-stat-sim .lb-stat-value{ color: var(--sim); }
.lb-stat-commoners{ box-shadow: inset 0 3px 0 var(--commoners); }
.lb-stat-commoners .lb-stat-value{ color: var(--commoners); }

#lb-legend{
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.5rem;
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    color: #6c757d;
}

#lb-legend strong{
    margin-right: 0.3rem;
    color: #212529;
    font-weight: 600;
}

.lb-dot{
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 0.45rem;
    border-radius: 50%;
    vertical-align: 0;
}

.lb-dot-sim{ background: var(--sim); }
.lb-dot-pending{ border: 1.5px dashed var(--sim); }

.lb-stat-note{
    margin-top: 0.15rem;
    font-size: 0.72rem;
    color: #6c8ec4;
}

.lb-stat-note:empty{
    display: none;
}
.lb-dot-commoners{ background: var(--commoners); }

.lb-stat{
    padding: 0.9rem 1rem;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e6e8eb;
    text-align: center;
}

.lb-stat-value{
    font-family: "Nunito", sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
    color: #212529;
}

.lb-stat-label{
    margin-top: 0.2rem;
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #8a9199;
}

#lb-toolbar{
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

#lb-search-wrap{
    position: relative;
    flex: 1 1 220px;
    max-width: 320px;
}

#lb-search-wrap i{
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    color: #9aa1a8;
}

#lb-search{
    width: 100%;
    padding: 0.55rem 0.9rem 0.55rem 2.3rem;
    border: 1px solid #dde1e5;
    border-radius: 8px;
    background: #fff;
    font-size: 0.95rem;
    color: #212529;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#lb-search:focus{
    border-color: #1266F1;
    box-shadow: 0 0 0 3px rgba(18, 102, 241, 0.15);
}

#lb-filters{
    display: inline-flex;
    padding: 3px;
    border-radius: 8px;
    background: #e9ecef;
}

#lb-filters button{
    border: 0;
    padding: 0.4rem 0.95rem;
    border-radius: 6px;
    background: transparent;
    font-size: 0.85rem;
    font-weight: 500;
    color: #616161;
    cursor: pointer;
}

#lb-filters button.active{
    background: #fff;
    color: #212529;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* No inner scroll: the table grows with the page and the header sticks to the viewport */
#lb-scroll{
    border: 1px solid #e6e8eb;
    border-radius: 10px;
    background: #fff;
}

#lb-table th:first-child{ border-top-left-radius: 10px; }
#lb-table th:last-child{ border-top-right-radius: 10px; }

#lb-table{
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.95rem;
    color: #212529;
}

#lb-table th{
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 0.75rem 0.75rem;
    background: #f3f5f7;
    border-bottom: 1px solid #e6e8eb;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #6c757d;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

#lb-table th:hover{
    color: #212529;
}

#lb-table th.sorted{
    color: #1266F1;
}

#lb-table th.sorted::after{
    content: "\25B2";
    margin-left: 0.35rem;
    font-size: 0.6rem;
}

#lb-table th.sorted.desc::after{
    content: "\25BC";
}

#lb-table td{
    padding: 0.7rem 0.75rem;
    border-bottom: 1px solid #f0f2f4;
    vertical-align: middle;
    white-space: nowrap;
}

#lb-table tbody tr:last-child td{
    border-bottom: 0;
}

#lb-table tbody tr:hover td{
    background: #f7f9fc;
}

/* Sticky rank + player columns for horizontal scroll on small screens */
#lb-table .lb-rank{
    position: sticky;
    left: 0;
    width: 56px;
    text-align: center;
}

#lb-table .lb-player{
    position: sticky;
    left: 56px;
    text-align: left;
}

#lb-table td.lb-rank,
#lb-table td.lb-player{
    z-index: 1;
    background: #fff;
}

#lb-table th.lb-rank,
#lb-table th.lb-player{
    z-index: 3;
}

#lb-table .lb-round,
#lb-table .lb-total{
    text-align: center;
}

.lb-rank-badge{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #6c757d;
    background: #f1f3f5;
}

.lb-medal-1{ background: #fbe7a1; color: #7a5a00; }
.lb-medal-2{ background: #e3e6ea; color: #4a5058; }
.lb-medal-3{ background: #f3d3b8; color: #7a4318; }

.lb-name{
    font-weight: 500;
}

.lb-cup{
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-left: 0.6rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    vertical-align: 1px;
}

.lb-cup i{
    font-size: 0.6rem;
}

.lb-cup-sim{ background: var(--sim-soft); color: var(--sim); }

/* In the top 40 but hasn't finished all rounds yet */
.lb-cup-pending{
    background: transparent;
    border: 1px dashed var(--sim);
    color: var(--sim);
    cursor: help;
}

.lb-cup-pending b{
    margin-left: 0.1rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: var(--sim-soft);
    font-weight: 700;
    letter-spacing: 0;
}
.lb-cup-commoners{ background: var(--commoners-soft); color: #0d7a38; }

/* Cup rows get a coloured accent on the left edge */
#lb-table tr.cup-sim td.lb-rank{ box-shadow: inset 3px 0 0 var(--sim); }
#lb-table tr.cup-sim.is-pending td.lb-rank{ box-shadow: inset 3px 0 0 rgba(18, 102, 241, 0.3); }
#lb-table tr.cup-commoners td.lb-rank{ box-shadow: inset 3px 0 0 var(--commoners); }

.lb-score{
    display: block;
    font-weight: 600;
}

.lb-score.under{ color: #c62828; }
.lb-score.over{ color: #1e3a5f; }
.lb-score.even{ color: #495057; }

.lb-pts{
    display: block;
    font-size: 0.72rem;
    color: #9aa1a8;
}

.lb-dnf{
    color: #c4c9ce;
}

#lb-table td.lb-total{
    font-family: "Nunito", sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
}

/* Divider row between the last qualifier and everyone below */
#lb-table tr.lb-cut td{
    padding: 0.45rem 0.75rem;
    border-top: 2px dashed var(--sim);
    border-bottom: 0;
    background: var(--sim-soft);
    white-space: normal;
}

#lb-table tr.lb-cut td > span{
    position: sticky;
    left: 0.75rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--sim);
}

#lb-table tr.lb-cut em{
    margin-left: 0.75rem;
    font-style: normal;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    font-size: 0.78rem;
    color: #5a6b85;
}

/* Projected cut (nobody officially qualified yet): lighter so it reads as a preview */
#lb-table tr.lb-cut-projected td{
    border-top: 2px dotted var(--sim);
    background: transparent;
}

/* Missed a closed round, so can't qualify */
#lb-table tr.is-out td{
    opacity: 0.45;
}

/* Sim Cup odds column */
#lb-table .lb-odds{
    width: 96px;
    text-align: center;
}

.lb-odds-pct{
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
}

.lb-odds-high{ color: var(--sim); }
.lb-odds-mid{ color: #495057; }
.lb-odds-low{ color: #9aa1a8; }

.lb-odds-bar{
    display: block;
    width: 56px;
    height: 4px;
    margin: 0.3rem auto 0;
    border-radius: 2px;
    background: #e9ecef;
    overflow: hidden;
}

.lb-odds-bar span{
    display: block;
    height: 100%;
    border-radius: 2px;
    background: var(--sim);
}

/* Betting-line version of the odds, small like the points under each score */
.lb-odds-line{
    display: block;
    margin-top: 0.2rem;
    font-size: 0.72rem;
    color: #9aa1a8;
    font-variant-numeric: tabular-nums;
}

.lb-odds-out{
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #b0b6bc;
    cursor: help;
}

#lb-odds-note{
    margin: 0.75rem 0.25rem 0;
    font-size: 0.8rem;
    color: #8a9199;
}

#lb-odds-note i{
    margin-right: 0.2rem;
    color: #b0b6bc;
}

#lb-odds-note strong{
    color: #6c757d;
    font-weight: 600;
}

.lb-empty{
    padding: 3rem 1rem !important;
    text-align: center;
    color: #8a9199;
    white-space: normal !important;
}

/* Narrow screens scroll the table sideways (header no longer sticks, since it's inside a scroll box) */
@media (max-width: 991px){
    #lb-scroll{
        overflow-x: auto;
    }
}

@media (max-width: 576px){
    .event-title{
        font-size: 2.25rem;
    }

    #event-card{
        padding: 0.75rem;
        border-radius: 8px;
    }

    #sponsor img{
        height: 44px;
    }

    #lb-stats{
        grid-template-columns: repeat(2, 1fr);
    }

    .lb-stat{
        padding: 0.7rem 0.5rem;
    }

    /* Just the icon on small screens to keep the name column narrow */
    .lb-cup{
        padding: 0.2rem 0.35rem;
    }

    .lb-cup span{
        display: none;
    }

    #lb-table tr.lb-cut em{
        display: block;
        margin: 0.15rem 0 0;
    }

    .lb-stat-value{
        font-size: 1.35rem;
    }

    .lb-stat-label{
        font-size: 0.65rem;
        letter-spacing: 1px;
    }

    #lb-search-wrap{
        max-width: none;
    }

    #lb-table td,
    #lb-table th{
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}
