.scoreboard-hero p {
    margin: .55rem 0 0;
    color: rgba(255,255,255,.76);
    font-weight: 600;
}

#scoreboard-smooth-root {
    max-width: 1240px;
}

.smooth-chart-card,
.smooth-ranking {
    border: 1px solid rgba(31,31,31,.08);
    border-radius: 24px;
    background: rgba(255,255,255,.92);
    box-shadow: 0 18px 52px rgba(27,45,99,.12);
}

.smooth-chart-card {
    padding: clamp(1.1rem, 3vw, 2rem);
    overflow: hidden;
}

.smooth-ranking {
    margin-top: 1.4rem;
    padding: clamp(1rem, 2.5vw, 1.6rem);
}

.smooth-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.smooth-section-heading h2 {
    margin: 0;
    color: #171b2e;
    font-size: clamp(1.35rem, 3vw, 2rem);
    letter-spacing: -.025em;
}

.smooth-participant-count {
    color: #73798d;
    font-size: .76rem;
    font-weight: 700;
    white-space: nowrap;
}

.smooth-score-chart {
    min-height: 340px;
    overflow: hidden;
    border: 1px solid rgba(31,31,31,.08);
    border-radius: 18px;
    background: linear-gradient(180deg, #f8f9ff, #f2f4fb);
}

.smooth-score-chart svg {
    width: 100%;
    height: auto;
    min-height: 340px;
    display: block;
}

.smooth-grid-line {
    stroke: rgba(35,42,76,.10);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.smooth-axis-label {
    fill: #7c8298;
    font: 600 12px Montserrat, sans-serif;
}

.smooth-main-line {
    fill: none;
    stroke-width: 3.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
    filter: drop-shadow(0 3px 4px rgba(26,35,100,.10));
    animation: smooth-line-draw 1.15s cubic-bezier(.22,.7,.25,1) both;
    cursor: pointer;
    transition: opacity .22s ease, stroke-width .22s ease, filter .22s ease;
}

.smooth-main-line:hover {
    stroke-width: 5;
}

.smooth-main-line.is-muted { opacity: .1; }
.smooth-main-line.is-selected {
    opacity: 1;
    stroke-width: 5;
    filter: drop-shadow(0 3px 6px rgba(26,35,100,.22));
}

@keyframes smooth-line-draw {
    from { stroke-dashoffset: var(--line-length, 1600); }
    to { stroke-dashoffset: 0; }
}

.smooth-score-legend {
    display: flex;
    gap: .55rem;
    margin-top: 1rem;
    padding-bottom: .15rem;
    overflow-x: auto;
    scrollbar-width: thin;
}

.smooth-legend-item {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    flex: 0 0 auto;
    padding: .25rem .15rem;
    border: 0;
    color: #525970;
    background: transparent;
    font-size: .74rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .2s ease, color .2s ease;
}

.smooth-legend-item.is-muted { opacity: .24; }
.smooth-legend-item.is-selected { color: #171b2e; }

.smooth-legend-item i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.smooth-ranking-heading {
    padding: 0 .25rem;
}

.smooth-score-list {
    display: grid;
    gap: .65rem;
}

.smooth-rank-card {
    --rank-color: #68728c;
    display: grid;
    grid-template-columns: 72px minmax(210px, 1fr) 150px 210px;
    align-items: center;
    gap: 1rem;
    min-height: 94px;
    padding: .9rem 1.1rem;
    border: 1px solid rgba(31,31,31,.07);
    border-radius: 17px;
    color: #24283a;
    background: rgba(247,248,252,.96);
    box-shadow: 0 7px 20px rgba(27,45,99,.055);
    opacity: 0;
    transform: translateY(10px);
    animation: smooth-card-in .45s ease forwards;
    animation-delay: calc(var(--rank-index) * 35ms);
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.smooth-rank-card:hover {
    z-index: 1;
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--rank-color) 45%, transparent);
    box-shadow: 0 13px 30px rgba(27,45,99,.12);
}

.smooth-rank-card.is-muted { opacity: .42; }
.smooth-rank-card.is-selected {
    border-color: #5060d7;
    box-shadow: 0 0 0 2px rgba(80,96,215,.12), 0 13px 30px rgba(27,45,99,.12);
}

@keyframes smooth-card-in {
    to { opacity: 1; transform: translateY(0); }
}

.smooth-rank-number {
    color: #73798d;
    font-size: 1.38rem;
    font-weight: 800;
    text-align: center;
}

.smooth-rank-user {
    min-width: 0;
}

.smooth-rank-user .user-identity {
    max-width: 100%;
}

.smooth-rank-user .user-avatar {
    width: 52px;
    height: 52px;
    font-size: 1.05rem;
}

.smooth-rank-name {
    min-width: 0;
    overflow: hidden;
    color: #24283a !important;
    font-size: 1.03rem;
    font-weight: 750;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.smooth-rank-name:hover {
    color: var(--rank-color) !important;
}

.smooth-rank-stats strong,
.smooth-rank-stats span {
    display: block;
}

.smooth-rank-stats strong {
    color: #24283a;
    font-size: 1.45rem;
    line-height: 1.1;
}

.smooth-rank-stats strong small {
    color: #9297a8;
    font-size: .72em;
    font-weight: 650;
}

.smooth-rank-stats span {
    margin-top: .3rem;
    color: #898fa1;
    font-size: .8rem;
    font-weight: 650;
}

.smooth-sparkline {
    width: 100%;
    height: 56px;
    display: block;
}

.smooth-sparkline path {
    fill: none;
    stroke: var(--rank-color);
    stroke-width: 3;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
    filter: drop-shadow(0 2px 3px color-mix(in srgb, var(--rank-color) 25%, transparent));
}

.smooth-sparkline .spark-guide {
    stroke: color-mix(in srgb, var(--rank-color) 16%, transparent);
    stroke-width: 1;
}

.smooth-loading,
.smooth-error {
    min-height: 180px;
    display: grid;
    place-items: center;
    color: #858b9f;
    font-weight: 650;
}

.smooth-loading i { margin-right: .55rem; }
.smooth-error { color: #c54b58; }

[data-bs-theme="dark"] .smooth-chart-card,
[data-bs-theme="dark"] .smooth-ranking {
    border-color: rgba(174,185,255,.11);
    background: rgba(17,20,39,.94);
    box-shadow: 0 22px 58px rgba(0,0,0,.32);
}

[data-bs-theme="dark"] .smooth-section-heading h2 { color: #f3f5ff; }
[data-bs-theme="dark"] .smooth-participant-count {
    color: #929ab6;
}

[data-bs-theme="dark"] .smooth-score-chart {
    border-color: rgba(174,185,255,.10);
    background: linear-gradient(180deg, #101321, #0d101c);
}

[data-bs-theme="dark"] .smooth-grid-line { stroke: rgba(188,196,231,.12); }
[data-bs-theme="dark"] .smooth-axis-label { fill: #8991ad; }
[data-bs-theme="dark"] .smooth-legend-item { color: #c3c9df; background: transparent; }
[data-bs-theme="dark"] .smooth-legend-item.is-selected { color: #fff; }

[data-bs-theme="dark"] .smooth-rank-card {
    border-color: rgba(174,185,255,.08);
    color: #eef0fb;
    background: rgba(27,31,53,.96);
    box-shadow: 0 7px 22px rgba(0,0,0,.17);
}

[data-bs-theme="dark"] .smooth-rank-card.is-selected { border-color: #8290ec; }

[data-bs-theme="dark"] .smooth-rank-name,
[data-bs-theme="dark"] .smooth-rank-stats strong { color: #f0f2ff !important; }
[data-bs-theme="dark"] .smooth-rank-stats span { color: #929ab6; }

@media (max-width: 900px) {
    .smooth-rank-card { grid-template-columns: 58px minmax(170px, 1fr) 120px 155px; gap: .7rem; }
}

@media (max-width: 680px) {
    .smooth-score-chart { min-height: 260px; }
    .smooth-score-chart svg { min-height: 260px; }
    .smooth-rank-card { grid-template-columns: 52px minmax(0, 1fr) 95px; padding: .8rem; }
    .smooth-sparkline { grid-column: 2 / -1; height: 42px; }
    .smooth-rank-user .user-avatar { width: 44px; height: 44px; }
    .smooth-rank-stats strong { font-size: 1.13rem; }
}

@media (prefers-reduced-motion: reduce) {
    .smooth-main-line,
    .smooth-rank-card { animation: none; opacity: 1; transform: none; }
}

/* Scoreboard layout: restrained surfaces and a consistent 8px grid. */
.jumbotron.scoreboard-hero {
    padding: 48px 0 !important;
    border-radius: 0 !important;
    background: #1623c1 !important;
    box-shadow: none !important;
}

.scoreboard-hero .container,
#scoreboard-smooth-root {
    width: min(100% - 32px, 1180px);
    max-width: 1180px;
}

.scoreboard-hero .container { text-align: left; }
.scoreboard-hero h1 { margin: 0; }
.scoreboard-hero p { margin-top: 8px; }

#scoreboard-smooth-root { padding-top: 40px; }

.smooth-chart-card,
.smooth-ranking {
    padding: 24px;
    border-radius: 8px;
    box-shadow: none;
    background: #fff;
}

.smooth-ranking { margin-top: 32px; }
.smooth-section-heading { margin-bottom: 20px; }
.smooth-section-heading h2 { font-size: 1.65rem; letter-spacing: -.02em; }

.smooth-score-chart {
    min-height: 360px;
    border-radius: 6px;
    background: #f7f8fb;
}

.smooth-score-chart svg { min-height: 360px; }
.smooth-score-legend { gap: 16px; margin-top: 16px; }

.smooth-score-list {
    gap: 0;
    overflow: hidden;
    border: 1px solid rgba(31,31,31,.1);
    border-radius: 8px;
}

.smooth-rank-card {
    min-height: 80px;
    padding: 12px 16px;
    border: 0;
    border-bottom: 1px solid rgba(31,31,31,.1);
    border-radius: 0;
    background: #fff;
    box-shadow: none;
}

.smooth-rank-card:last-child { border-bottom: 0; }
.smooth-rank-card:hover {
    transform: none;
    border-color: rgba(31,31,31,.1);
    box-shadow: none;
    background: #f7f8fb;
}

.smooth-rank-card.is-muted { opacity: .35; }
.smooth-rank-card.is-selected {
    border-color: rgba(31,31,31,.1);
    background: #eef1ff;
    box-shadow: inset 3px 0 0 #4054c7;
}

.smooth-rank-user .user-avatar {
    width: 44px;
    height: 44px;
    border: 1px solid rgba(31,31,31,.1);
    box-shadow: none !important;
}

[data-bs-theme="dark"] .smooth-chart-card,
[data-bs-theme="dark"] .smooth-ranking,
[data-bs-theme="dark"] .smooth-rank-card { background: #15182a; box-shadow: none; }

[data-bs-theme="dark"] .smooth-score-chart { background: #101321; }
[data-bs-theme="dark"] .smooth-score-list,
[data-bs-theme="dark"] .smooth-rank-card { border-color: rgba(255,255,255,.1); }
[data-bs-theme="dark"] .smooth-rank-card:hover { background: #1a1e33; }
[data-bs-theme="dark"] .smooth-rank-card.is-selected {
    border-color: rgba(255,255,255,.1);
    background: #202642;
    box-shadow: inset 3px 0 0 #8290ec;
}

@media (max-width: 680px) {
    .scoreboard-hero { padding: 32px 0 !important; }
    #scoreboard-smooth-root { width: min(100% - 20px, 1180px); padding-top: 24px; }
    .smooth-chart-card, .smooth-ranking { padding: 16px; }
    .smooth-ranking { margin-top: 24px; }
    .smooth-score-chart, .smooth-score-chart svg { min-height: 260px; }
    .smooth-rank-card { padding: 12px 10px; }
}
