/* "Top N" ranking line and sheet, shared by the build page and style tag pages.
 * Sheet rows come from css/rankings.css; the sheet shell from css/sc-club.css. */

/* ---------- Category rank line (under the stats strip, no box) ---------- */
.sc-build-rank-line { font: inherit; }
.sc-build-rank-line__num { color: #ddd; }
.sc-build-rank-line__label { color: #fff; }
.sc-build-rank-line--1 :is(.sc-build-rank-line__num, .sc-build-rank-line__label) { color: #e6bc6e; }
.sc-build-rank-line--2 :is(.sc-build-rank-line__num, .sc-build-rank-line__label) { color: #c4c4cc; }
.sc-build-rank-line--3 :is(.sc-build-rank-line__num, .sc-build-rank-line__label) { color: #c58a55; }
.sc-build-rank-line__pic { border: 2px solid #121214; }
.sc-build-rank-line__pic + .sc-build-rank-line__pic { margin-left: -14px; }
.sc-build-rank-line__pic:nth-child(1) { z-index: 5; }
.sc-build-rank-line__pic:nth-child(2) { z-index: 4; }
.sc-build-rank-line__pic:nth-child(3) { z-index: 3; }
.sc-build-rank-line__pic:nth-child(4) { z-index: 2; }
.sc-build-rank-line__pic:nth-child(5) { z-index: 1; }

/* "Top builds" sheet (rows come from css/rankings.css) */
.sc-rank-all { text-decoration: none; }
.sc-rank-dialog { max-height: 90vh; max-height: 90dvh; }
.sc-modal.sc-club-sheet .sc-modal-dialog.sc-rank-dialog { padding-bottom: env(safe-area-inset-bottom, 0px); }
.sc-rank-num { color: #ddd; }
.sc-rank-num--1 { color: #e6bc6e; }
.sc-rank-num--2 { color: #c4c4cc; }
.sc-rank-num--3 { color: #c58a55; }
/* The build you're viewing: tinted by its rank (gold, silver, bronze; dark red for 4-5) */
.sc-rankings-row.sc-rank-item--me { background: rgb(64 14 14 / 15%); border-left: 3px solid rgba(190, 55, 55, 0.75); }
.sc-rankings-row--gold.sc-rank-item--me { background: rgb(56 45 15 / 15%); border-left-color: rgba(230, 184, 60, 0.85); }
.sc-rankings-row--silver.sc-rank-item--me { background: rgb(70 74 86 / 15%); border-left-color: rgba(210, 214, 224, 0.75); }
.sc-rankings-row--bronze.sc-rank-item--me { background: rgb(62 36 14 / 15%); border-left-color: rgba(205, 127, 50, 0.8); }
/* One shimmer sweep on that row each time the sheet opens */
.sc-rank-item--me.u-shimmer::after { animation: none; opacity: 0.5; }
@media (prefers-reduced-motion: no-preference) {
    #scBuildCategoryRankSheet.show .sc-rank-item--me.u-shimmer::after { animation: u-shimmer-sweep 4.8s ease-in-out 0.35s 1 both; }
}
.sc-rank-bolt { color: #f5c542; }
.sc-rank-dialog .sc-rankings-thumb { width: 60px; height: 60px; }
.sc-rank-foot { border-top: 1px solid rgba(255, 255, 255, 0.08); }
.sc-rank-media { background: #232327; }
.sc-rank-media img { opacity: 0; transition: opacity 0.25s ease; }
.sc-rank-media img.is-loaded { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .sc-rank-media img { transition: none; } }

/* Points colour (also set in single-car.css, which tag pages don't load) */
.sc-rank-dialog .sc-build-score__num { color: #f5c542; }
.sc-rank-dialog .sc-build-score__lab { color: rgba(245, 197, 66, 0.72); }

/* Switching rankings: one steady height, whichever list is showing */
.sc-modal.sc-club-sheet .sc-modal-dialog.sc-rank-dialog--multi { height: 90vh; height: 90dvh; }
@media (min-width: 992px) {
    .sc-modal.sc-club-sheet .sc-modal-dialog.sc-rank-dialog--multi { height: min(780px, 90dvh); }
}
.sc-rank-chip { font-family: inherit; background: transparent; border: 1px solid rgba(255, 255, 255, 0.14); color: rgba(255, 255, 255, 0.7); }
.sc-rank-chip[aria-pressed="true"] { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.45); color: #fff; }
.sc-rank-chips { border-bottom: 1px solid rgba(255, 255, 255, 0.08); }

/* Rows start and end on the same 16px edge as the header: 3px accent + 13px padding */
.sc-rank-dialog .sc-rankings-row__link { padding-left: 13px; padding-right: 16px; }
.sc-rank-dialog .sc-rankings-row:not(.sc-rankings-row--gold, .sc-rankings-row--silver, .sc-rankings-row--bronze, .sc-rank-item--me) { border-left: 3px solid transparent; }

/* Marks the signed-in owner's own builds */
.sc-rank-you-pill { background: rgba(213, 32, 32, 0.2); color: #ff8080; letter-spacing: 0.04em; }
