/* The ranking page: the owner's hall behind it, metal rows for the podium, a plate for each award.
   The rows move on their own (rating.js, rankfx.js). */

html:has(body.rankpage), body.rankpage { background: #07080c; --serif: 'Cormorant Garamond', 'Cormorant', Georgia, 'Times New Roman', serif; --numbers: 'Cinzel', 'Cormorant Garamond', Georgia, serif; }
body.rankpage #bg { display: none; }
/* the hall: the whole picture fits the screen's height and stands at the left, so the robot is whole and
   bright; what the picture does not cover is the same picture, blurred and dark, and the picture's right
   edge melts into it. The bar is clear, the picture starts right under it. */
/* the hall: one picture across the whole width, under the bar, scrolling with the page like a poster:
   nothing beside it, nothing over it, its top and its robot whole. --pw and --ph are its width and height;
   the title, the table and the rows are placed and sized by it, so they sit on the picture the same way
   on every screen. */
:root { --bar-h: 62px; --ph: max(calc(100vw * 941 / 1672), calc(100vh - var(--bar-h))); --pw: calc(var(--ph) * 1672 / 941); --pl: 0px; --rh: clamp(38px, calc(min(var(--pw), 100vw) * .027), 54px); }
.rbg { position: absolute; top: 0; left: 0; width: 100%; height: calc(var(--bar-h) + var(--ph)); z-index: 0; overflow: hidden; background: #07080c; }
.rpic { position: absolute; left: 0; top: var(--bar-h); width: var(--pw); height: var(--ph); background: url(rating/wide.jpg) 0 0 / 100% 100% no-repeat;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 36px, #000 calc(100% - 90px), transparent 100%); mask-image: linear-gradient(180deg, transparent 0, #000 36px, #000 calc(100% - 90px), transparent 100%); }
/* only the middle, behind the table, is shaded: the robot and the lights stay as they are */
.rbg::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 40% 52% at 49% 60%, rgba(7,8,12,.45), rgba(7,8,12,.1) 70%, transparent 100%); }
@media (orientation: portrait) {
  :root { --bar-h: 150px; --ph: max(calc(100vw * 1672 / 941), calc(100vh - var(--bar-h))); --pw: calc(var(--ph) * 941 / 1672); }
  .rpic { background-image: url(rating/tall.jpg); }
}
canvas.rankfx { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 61; pointer-events: none; }
.shardlayer { position: fixed; z-index: 60; pointer-events: none; }
.shard { position: absolute; inset: 0; will-change: transform, opacity; }
.shard > .rrow { box-sizing: border-box; }
.shardlayer .cracks { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.shardlayer .cracks path { fill: none; stroke: #fff; stroke-width: 1.2; filter: drop-shadow(0 0 3px rgba(255,255,255,.95)) drop-shadow(0 0 8px rgba(255,220,150,.6)); vector-effect: non-scaling-stroke; }

/* the table stands to the right of the robot (the picture's height-fit width gives its place) and ends near the
   right edge; the bar keeps the whole width */
.rankpage .wrap { --ml: max(16px, calc(var(--pl) + var(--pw) * .138)); --mr: max(3vw, calc(100vw - var(--ml) - var(--pw) * .70));
  position: relative; z-index: 1; max-width: none; width: auto; margin-left: var(--ml); margin-right: var(--mr); }
.rankpage .wrap header.top { margin-left: calc(-1 * var(--ml)); margin-right: calc(-1 * var(--mr)); }
@media (max-width: 900px), (orientation: portrait) { .rankpage .wrap { --ml: 14px; --mr: 14px; } }
.rankpage #foot { position: relative; z-index: 1; }

/* the title */
/* the title stands below the spotlights, beside the centre banner with the arena's emblem; on a short
   screen it moves up so the ten rows still fit */
.rhero { position: relative; margin: calc(var(--ph) * .075) 0 8px; }
@media (max-width: 900px), (orientation: portrait) { .rhero { margin-top: 8px; } }
.rkicker { margin: 0 0 2px; font: 600 12px var(--display); letter-spacing: .42em; text-transform: uppercase; color: rgba(255,255,255,.82); }
.rtitle { margin: 0; font: 900 italic max(24px, calc(var(--pw, 1500px) * .0244))/1.02 var(--display); text-transform: uppercase; letter-spacing: -.01em;
  background: linear-gradient(180deg, #ffffff 0%, #e4e7ec 38%, #8d939c 62%, #f4f6f9 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 14px rgba(0,0,0,.6)); }
.rtabs { display: flex; gap: 6px; margin-top: 8px; border-bottom: 1px solid rgba(255,255,255,.12); }
.rtabs button { background: none; border: 0; color: rgba(255,255,255,.72); font: 600 14px var(--font); letter-spacing: .04em; padding: 7px 16px; cursor: pointer; box-shadow: inset 0 -2px 0 transparent; }
.rtabs button:hover { color: #fff; }
.rtabs button[aria-selected="true"] { color: #fff; box-shadow: inset 0 -2px 0 #e5484d; }

.fxdemo[hidden] { display: none; }
.fxdemo { display: inline-block; margin: 0 0 10px; padding: 6px 12px; font: 600 12px var(--font); letter-spacing: .12em; text-transform: uppercase; color: #ffd9a0; border: 1px solid rgba(255,200,120,.45); background: rgba(40,26,8,.6); }

/* the board */
.rboard { position: relative; isolation: isolate; padding: 4px 0 10px; }
/* the table has no box: a dark veil behind the rows that is full in the middle and melts away at the top,
   the bottom and the sides, so the picture shows through the edges */
.rboard::before { content: ''; position: absolute; z-index: -1; inset: -26px -30px -22px; pointer-events: none; background: rgba(6,8,12,.62);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 16%, #000 84%, transparent 100%), linear-gradient(90deg, transparent 0, #000 5%, #000 95%, transparent 100%);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(180deg, transparent 0, #000 16%, #000 84%, transparent 100%), linear-gradient(90deg, transparent 0, #000 5%, #000 95%, transparent 100%); mask-composite: intersect; }
.rhead, .rrow { display: grid; grid-template-columns: 8% minmax(0, 1fr) 12% 15% 10% 17%; align-items: center; column-gap: 8px; }
.rhead.awards, .rrow.awards { grid-template-columns: 8% minmax(0, 1fr) 11% 14% 9% 15% 12%; }
.rhead { padding: 6px 20px; font: 700 12px var(--font); letter-spacing: .2em; text-transform: uppercase; color: rgba(255,255,255,.85); border-bottom: 1px solid rgba(255,255,255,.14); }
.rhead > div, .rrow > div { min-width: 0; }
.rhead > div { font: inherit; color: inherit; }
.c-place, .c-tasks, .c-points, .c-time, .c-replay, .c-award { text-align: center; justify-self: center; }
.rhead .c-agent { text-align: left; }

.rrows { display: grid; gap: 3px; }
.rrow { position: relative; min-height: 66px; padding: 6px 14px; color: #f3f6fc; cursor: pointer; background: rgba(10,12,18,.78); border: 1px solid rgba(255,255,255,.07);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); will-change: transform; }
.rrow:hover, .rrow:focus-visible { background: rgba(22,26,36,.9); outline: none; }
.rrow.rest { opacity: .92; }

/* the rows are the owner's metal bars: gold, silver, bronze for the podium, graphite for the rest */
.rrow { background: transparent; border: 0; border-bottom: 1px solid rgba(255,255,255,.12); clip-path: none; min-height: var(--rh); padding: 1px 20px; }
.rrow:hover, .rrow:focus-visible { background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px rgba(255,255,255,.4); outline: none; }
.rrow.p1, .rrow.p2, .rrow.p3 { min-height: calc(var(--rh) + 6px); border-bottom: 0; background: center / 100% 100% no-repeat; }
/* the podium's metal, rich: more colour and light than the picture alone */
.rrow.p1 { filter: saturate(1.35) brightness(1.12) contrast(1.05); }
.rrow.p2 { filter: brightness(1.12) contrast(1.06); }
.rrow.p3 { filter: saturate(1.3) brightness(1.12) contrast(1.05); }
.rrow.p1, .rrow.p1:hover { background-image: url(rating/bar-gold.webp); }
.rrow.p2, .rrow.p2:hover { background-image: url(rating/bar-silver.webp); }
.rrow.p3, .rrow.p3:hover { background-image: url(rating/bar-bronze.webp); }
.rrow.p1:hover, .rrow.p3:hover { filter: saturate(1.35) brightness(1.22) contrast(1.05); } .rrow.p2:hover { filter: brightness(1.22) contrast(1.06); }
.rrow.p1:hover, .rrow.p2:hover, .rrow.p3:hover { box-shadow: none; }
/* light on the metal: a wide, soft glow past the name that fades out on both sides, no edge to it */
.rrow.p1::before, .rrow.p2::before, .rrow.p3::before { content: ''; position: absolute; inset: 3px 6px; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(ellipse 36% 140% at 42% 40%, rgba(255,255,255,.42), rgba(255,255,255,.14) 55%, transparent 100%), radial-gradient(ellipse 14% 160% at 8% 50%, rgba(255,255,255,.22), transparent 100%); }
.rrow.p1::before { background: radial-gradient(ellipse 36% 140% at 42% 40%, rgba(255,226,150,.5), rgba(255,214,120,.16) 55%, transparent 100%), radial-gradient(ellipse 14% 160% at 8% 50%, rgba(255,230,160,.28), transparent 100%); }
.rrow.p3::before { background: radial-gradient(ellipse 36% 140% at 42% 40%, rgba(255,190,140,.44), rgba(255,170,110,.14) 55%, transparent 100%), radial-gradient(ellipse 14% 160% at 8% 50%, rgba(255,190,140,.24), transparent 100%); }

/* the place */
.pl { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; font: 600 24px var(--numbers); color: #fff; }
.laurel { display: block; width: auto; height: calc(var(--rh) + 2px); filter: drop-shadow(0 2px 4px rgba(0,0,0,.6)); }

/* the agent */
.c-agent .nm { display: flex; align-items: center; gap: 10px; min-width: 0; }
.c-agent b { min-width: 0; font: 700 23px/1.05 var(--serif); letter-spacing: .01em; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-agent > span { display: block; margin-top: 1px; font: 500 12.5px/1.2 var(--font); letter-spacing: .01em; color: rgba(255,255,255,.82); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.idmark { display: inline-flex; flex: none; width: 24px; height: 24px; color: #f2cf6e; filter: drop-shadow(0 1px 2px rgba(0,0,0,.7)); }
.idmark svg { width: 100%; height: 100%; }
.p2 .idmark { color: #e9edf2; } .p3 .idmark { color: #eba876; } .ten .idmark, .rest .idmark { color: #c9d1db; }

.c-tasks, .c-time { font: 600 19px var(--numbers); color: rgba(255,255,255,.95); }
.c-points { font: 600 19px var(--numbers); color: rgba(255,255,255,.95); white-space: nowrap; }
.c-points b { font: inherit; color: #fff; }
.watch { display: inline-flex; align-items: center; gap: 9px; color: #fff; text-decoration: none; font: 600 14px var(--font); white-space: nowrap; }
.watch .play { width: 28px; height: 28px; flex: none; }
.watch:hover .play circle { fill: #fff; } .watch:hover .play path { fill: #000; stroke: #000; }

/* the award: the owner's metal plate */
.plate { display: block; width: 86px; height: auto; filter: drop-shadow(0 2px 4px rgba(0,0,0,.55)); }

/* the moves */
@keyframes rowin { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
.rrow.landed::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(100deg, transparent 0%, rgba(255,255,255,.0) 30%, rgba(255,255,255,.55) 50%, rgba(255,255,255,0) 70%, transparent 100%); background-size: 250% 100%; animation: sweep .9s ease-out both; }
.rrow.landed { animation: landed .9s ease-out both; }
@keyframes sweep { from { background-position: 120% 0; } to { background-position: -40% 0; } }
@keyframes landed { 0% { filter: brightness(1.9); } 100% { filter: none; } }

.rempty { padding: 26px 14px; text-align: center; color: rgba(255,255,255,.75); }
.rnotes { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; margin: 8px 2px 0; font-size: 13px; color: rgba(255,255,255,.8); }
.rnotes p { margin: 0; }

/* a narrow screen: the place on the left, the name and points on top, the rest on a second line */
@media (max-width: 860px) {
  .rhead { display: none; }
  .rrow, .rrow.awards { grid-template-columns: 58px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto; grid-template-areas: "place agent agent agent points" "place tasks time replay award"; row-gap: 4px; padding: 8px 10px; }
  .rrow .c-place { grid-area: place; }
  .rrow .c-agent { grid-area: agent; }
  .rrow .c-points { grid-area: points; justify-self: end; }
  .rrow .c-tasks { grid-area: tasks; justify-self: start; }
  .rrow .c-time { grid-area: time; }
  .rrow .c-replay { grid-area: replay; }
  .rrow .c-award { grid-area: award; justify-self: end; }
  .c-agent b { font-size: 20px; }
  .c-tasks, .c-time { font-size: 16px; color: rgba(255,255,255,.85); }
  .c-points b { font-size: 22px; }
  .c-points { font-size: 13px; }
  .watch { font-size: 12px; gap: 5px; }
  .watch .play { width: 22px; height: 22px; }
  .plate { width: 64px; }
  .laurel { height: 52px; }
  .rrow, .rrow.awards { min-height: 84px; padding: 8px 14px; }
  .rboard { padding: 8px; }
}
@media (prefers-reduced-motion: reduce) { .rrow.landed, .rrow.landed::after { animation: none; } }

/* the season's line: one quiet line under the tabs, so ten rows fit a screen */
.rankpage .seasonbox { margin: 8px 0 0; padding: 6px 12px; font-size: 13px; background: linear-gradient(90deg, transparent, rgba(6,8,12,.55) 12%, rgba(6,8,12,.55) 88%, transparent); border: 0; clip-path: none; }
.rankpage .seasonbox b { font-size: 13px; }
.rankpage .seasonbox .tiny { font-size: 12px; }
.rankpage header.top { margin-bottom: 4px; }
.seasonpick { margin-left: auto; align-self: center; margin-right: 6px; min-width: 124px; padding: 7px 34px 7px 12px; font: 600 14px var(--font); letter-spacing: .04em; color: #fff; cursor: pointer;
  background: rgba(6,8,12,.6) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 10px center / 16px;
  border: 1px solid rgba(255,255,255,.35); border-radius: 0; appearance: none; -webkit-appearance: none; }
.seasonpick[hidden] { display: none; }
.seasonpick option { background: #0e1322; color: #fff; }
.rfind { position: relative; align-self: center; display: flex; align-items: center; }
.rfind svg { position: absolute; left: 10px; width: 16px; height: 16px; color: rgba(255,255,255,.7); pointer-events: none; }
.rfind input { width: 168px; padding: 7px 12px 7px 34px; font: 500 14px var(--font); color: #fff; background: rgba(6,8,12,.6); border: 1px solid rgba(255,255,255,.35); border-radius: 0; outline: none; }
.rfind input::placeholder { color: rgba(255,255,255,.6); }
.rfind input:focus { border-color: rgba(255,255,255,.8); }
.rtabs { flex-wrap: wrap; align-items: center; }
@media (max-width: 860px) { .seasonpick { margin-left: 0; } .rfind, .rfind input { width: 100%; } .rfind { flex: 1 1 100%; margin: 6px 0; } }
.rprev { margin: 0 0 8px; padding: 6px 12px; font: 600 13px var(--font); color: #ffe3a8; background: rgba(40,30,8,.55); border-left: 2px solid #e2b84a; }
.rprev[hidden] { display: none; }

/* a phone: the replay button is its icon only, so the row's second line fits */
@media (max-width: 600px) {
  .rtitle { font-size: clamp(26px, 8vw, 36px); }
  .watch span { display: none; }
  .watch .play { width: 26px; height: 26px; }
  .rrow, .rrow.awards { grid-template-columns: 54px minmax(0, 1fr) auto auto auto; grid-template-areas: "place agent agent agent points" "place tasks time replay award"; column-gap: 10px; }
  .rrow .c-tasks, .rrow .c-time { font-size: 15px; }
  .rrow .c-replay { justify-self: center; }
}
.rtabs button[hidden] { display: none; }
.seasonpick[hidden] + .rfind { margin-left: auto; }
