/* Road to F1 - the pyramid and its rung dialog.
   Owns Pages/Shared/_LadderRoad.cshtml and the #ladderModal code in js/site.js.
   button.gbox adds a transition to .gbox and MUST stay after it. */

.gbox { position: relative; background: var(--slot-fill); border: 2px solid var(--track-line); border-radius: 8px; color: var(--track-line); text-align: center; padding: 10px 10px 11px; }
.gbox .short { display: block; font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: .01em; }
.rg { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.rg-USA { background: var(--blue); } .rg-Europe { background: var(--muted); } .rg-Global { background: var(--red); }
.gbox .nm { font-size: 10.5px; line-height: 1.25; opacity: .72; margin: 2px 0 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.gbox .cnt { font-size: 11px; font-variant-numeric: tabular-nums; } .gbox .cnt b { color: var(--blue); font-weight: 700; } .gbox .cnt.zero { color: var(--track-line); opacity: .55; }
.gbox.pole { border-color: var(--red); box-shadow: 0 0 0 3px var(--pole-glow); } .gbox.pole .short { color: var(--red); }
.gbox .poletag { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: var(--red); color: #fff; font-family: var(--font-display); font-size: 8.5px; font-weight: 700; letter-spacing: .12em; padding: 1px 7px; border-radius: 3px; white-space: nowrap; }

/* One layout at every width. Each tier is a centred flex line, so the silhouette - narrow at
   the top, wide at the bottom - falls out of how many series share a tier. */
.rtf { margin-top: 2.25rem; }
.pyramid {
    position: relative; max-width: 660px; margin-inline: auto; padding: 34px 16px 22px;
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    background: var(--track-bg); border-radius: 10px;
    box-shadow: inset 0 0 0 1px var(--border), var(--shadow);
}
/* No overflow:hidden here - the POLE tag hangs above the F1 box's border and would be clipped -
   so the rumble strip carries its own corner radius instead. */
.pyramid::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 10px;
    border-radius: 10px 10px 0 0;
    background: repeating-linear-gradient(90deg, var(--red) 0 18px, var(--rumble-white) 18px 36px);
}
.prow { width: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
/* The 104px floor is load-bearing: it is what keeps four boxes on one line down to the 34rem
   breakpoint below, so flex-wrap never produces a lopsided three-plus-one row. */
.prow .gbox { width: clamp(104px, 10vw, 132px); flex: 0 0 auto; }
.pclimb { font-size: 15px; line-height: 1; color: var(--track-line); opacity: .45; }
.pband {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: .6rem;
    font-family: var(--font-display); font-weight: 700; font-size: .62rem;
    letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.pband::before, .pband::after { content: ""; flex: 1 1 auto; max-width: 3.5rem; height: 1px; background: var(--border); }
/* Below ~34rem four legible boxes cannot share a line. Fix the column width rather than let
   flex-wrap pick it: four break to a clean 2x2, three to 2 + 1. */
@media (max-width: 34rem) {
    .prow { gap: 8px; }
    .prow .gbox { width: min(46%, 260px); }
}

/* The ladder cards are buttons; clicking one opens a dialog listing that rung's drivers. */
button.gbox { font-family: inherit; cursor: pointer; }
.gbox { transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease; }
button.gbox:hover { transform: translateY(-3px); border-color: var(--blue); box-shadow: 0 8px 18px rgba(0, 0, 0, .16); }
button.gbox.pole:hover { border-color: var(--red); }
button.gbox:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
button.gbox.is-empty { opacity: .82; }

.rlpop { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.rlpop[hidden] { display: none; }
.rlpop-scrim { position: absolute; inset: 0; background: rgba(6, 8, 14, .55); backdrop-filter: blur(3px); opacity: 0; transition: opacity .18s ease; }
.rlpop.show .rlpop-scrim { opacity: 1; }
.rlpop-panel { position: relative; z-index: 1; width: min(560px, 100%); max-height: 82vh; display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 1rem; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(10px) scale(.985); transition: opacity .2s ease, transform .2s ease; }
.rlpop.show .rlpop-panel { opacity: 1; transform: none; }
.rlpop-accent { flex: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--blue), #fff 50%, var(--red)); }
.rlpop-close { position: absolute; top: .6rem; right: .6rem; z-index: 3; width: 2rem; height: 2rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); font-size: 1.2rem; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.rlpop-close:hover { border-color: var(--red); color: var(--red); }
.rlpop-close:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.rlpop-content { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.rlpop-head { flex: 0 0 auto; padding: 1rem 1.15rem .4rem; }
.rlpop-eyebrow { font-family: var(--font-display); font-weight: 600; font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.rlpop-title { font-family: var(--font-display); font-weight: 700; font-size: 1.45rem; line-height: 1.05; margin: .15rem 0 0; display: flex; align-items: center; gap: .5rem; color: var(--ink); }
.rlpop-title .rg { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.rlpop-sub { display: block; color: var(--muted); font-size: .84rem; margin-top: .2rem; }
.rlpop-count { display: inline-block; margin: .55rem 0 0; font-family: var(--font-display); font-weight: 700; font-size: .7rem; letter-spacing: .09em; text-transform: uppercase; color: var(--blue); background: color-mix(in srgb, var(--blue) 14%, transparent); border-radius: 999px; padding: .18rem .65rem; }
.rlpop-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: .7rem 1.15rem 1.2rem; }
.rlpop-grid { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }
.rlpop-driver { display: grid; grid-template-columns: auto 1fr auto; gap: .7rem; align-items: start; background: var(--surface-2); border: 1px solid var(--border); border-radius: .7rem; padding: .55rem .65rem; }
.rlpop-ava { position: relative; }
.rlpop-ava img { width: 52px; height: 52px; border-radius: .55rem; object-fit: cover; object-position: top; display: block; background: var(--surface); border: 1px solid var(--border); }
.rlpop-ava .num { position: absolute; bottom: -5px; right: -5px; font-family: var(--font-display); font-weight: 700; font-size: .62rem; color: #fff; background: var(--red); border-radius: 999px; padding: .02rem .32rem; box-shadow: var(--shadow); }
.rlpop-dname { font-family: var(--font-display); font-weight: 700; font-size: .96rem; color: var(--ink); line-height: 1.12; display: flex; align-items: center; gap: .3rem; }
.rlpop-dmeta { font-size: .75rem; color: var(--muted); margin-top: .12rem; }
.rlpop-chips { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .4rem; }
.rlpop-chip { font-family: var(--font-display); font-weight: 600; font-size: .62rem; letter-spacing: .03em; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: .06rem .42rem; }
.rlpop-chip.is-here { color: var(--blue); border-color: color-mix(in srgb, var(--blue) 45%, var(--border)); background: color-mix(in srgb, var(--blue) 10%, transparent); }
.rlpop-dlink { color: var(--muted); font-size: .95rem; align-self: start; line-height: 1; }
.rlpop-dlink:hover { color: var(--blue); }
.rlpop-empty { text-align: center; padding: 1.6rem 1rem 1.2rem; color: var(--muted); }
.rlpop-empty .ico { font-size: 1.9rem; }
.rlpop-empty p { margin: .5rem 0 0; }
.rlpop-empty strong { color: var(--ink); font-family: var(--font-display); }

