/* Parlee Games: accounts and leaderboards. "Race results after dark": slanted position plates,
   a podium that makes a fuss about the top three, and the signed-in player always lit up. */
:root {
  --gold: #ffcf40; --gold-deep: #e89a00; --silver: #dfe5f0; --silver-deep: #8d99ad; --bronze: #f0a66e; --bronze-deep: #b0612b;
  --parlee-font: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* Top bar: leaderboards link + account button */
.topnav { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.topnav--push { margin-left: auto; }
.toplink { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: var(--r-btn); text-decoration: none; font-weight: 700; color: var(--chalk-dim); transition: color .15s, background .15s; }
.toplink svg { width: 20px; height: 20px; color: var(--sun-text); }
.toplink:hover, .toplink.is-on { color: var(--chalk); background: var(--night-2); }
.acct { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: var(--r-btn); border: 1px solid var(--night-3); background: var(--night-2); font-weight: 700; cursor: pointer; max-width: 190px; transition: border-color .15s; }
.acct:hover { border-color: var(--chalk-dim); }
.acct:not(.is-in) { background: var(--sun); color: var(--ink-on-sun); border-color: transparent; }
.acct__av { font-size: 1.25rem; line-height: 1; }
.acct__av:empty { display: none; }
.acct__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) {
  .topbar__inner { flex-wrap: wrap; gap: 10px 12px; }
  .topnav { margin-left: auto; }
  .topbar .search { order: 3; flex-basis: 100%; max-width: none; margin-left: 0; }
  .toplink span { display: none; }
  .toplink { padding: 0 12px; background: var(--night-2); border: 1px solid var(--night-3); }
  .acct { padding: 0 13px; max-width: 150px; }
}

/* Small marks on existing pages */
.card__cup { display: inline-flex; color: var(--sun-text); }
.card__cup svg { width: 16px; height: 16px; }
.iconbtn--cup { color: var(--sun-text); text-decoration: none; }
.footer__links { display: inline-flex; gap: 18px; }
.youtag, .guesttag { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px; font: 700 .62rem/1.4 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; vertical-align: middle; }
.youtag { background: var(--sun); color: var(--ink-on-sun); }
.guesttag { border: 1px solid var(--night-3); color: var(--chalk-dim); }
.who { all: unset; cursor: pointer; font: inherit; font-weight: inherit; color: inherit; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.who:hover { text-decoration: underline; text-decoration-color: var(--sun); text-underline-offset: 3px; }
.who:focus-visible { outline: 3px solid var(--berry); outline-offset: 3px; border-radius: 6px; }
.medals { display: inline-flex; gap: 6px; }
.medals__m b { font-weight: 700; margin-left: 1px; font-size: .9em; }

/* Leaderboard pages */
.lb { padding-block: 28px 64px; }
.lb__hero { max-width: 720px; margin-bottom: 26px; }
.lb__title { margin: 6px 0 10px; font: 800 var(--step-3)/1 var(--f-display); letter-spacing: -.025em; text-wrap: balance; }
.lb__lede { margin: 0; color: var(--chalk-dim); font-size: 1.08rem; max-width: 62ch; }
.lb__lede strong { color: var(--sun-text); }
.lb__note { color: var(--chalk-dim); margin: 18px 0; text-align: center; }
.lb__cta { text-align: center; margin: 22px 0 0; }
.lb__more { display: flex; margin: 18px auto 0; cursor: pointer; }
.lb__empty { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 34px 16px; color: var(--chalk-dim); }
.lb__empty span { font-size: 3rem; line-height: 1; filter: drop-shadow(0 8px 18px color-mix(in srgb, var(--gold) 50%, transparent)); }
.lb__empty p { margin: 0; max-width: 44ch; }
.lb__empty strong { color: var(--chalk); display: block; font-size: 1.1rem; }

.cup { position: relative; padding: 24px clamp(14px, 3vw, 32px) 26px; border-radius: 28px; border: 1px solid var(--night-3); overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% -10%, color-mix(in srgb, var(--gold) 20%, transparent), transparent 60%),
    repeating-linear-gradient(115deg, transparent 0 46px, color-mix(in srgb, var(--chalk) 3%, transparent) 46px 48px),
    var(--night-2); }
.cup__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cup__sub { font: 500 var(--step--1)/1.4 var(--f-mono); color: var(--chalk-dim); letter-spacing: .04em; }

/* Podium */
.podium { list-style: none; margin: 34px auto 0; padding: 0; display: grid; grid-template-columns: 1fr 1.18fr 1fr; align-items: end; gap: clamp(6px, 1.6vw, 18px); max-width: 720px; }
.plinth { min-width: 0; display: flex; flex-direction: column; text-align: center; }
.plinth__racer { display: grid; justify-items: center; gap: 2px; padding: 0 4px 12px; animation: lb-drop .6s cubic-bezier(.2, 1.5, .4, 1) backwards; }
.plinth__av { position: relative; display: grid; place-items: center; width: clamp(54px, 13vw, 84px); aspect-ratio: 1; border-radius: 50%; font-size: clamp(1.9rem, 6.5vw, 3rem); line-height: 1; background: var(--night); box-shadow: 0 0 0 3px var(--plate), 0 12px 28px -10px var(--plate); margin-bottom: 8px; }
.plinth__av--none { color: var(--chalk-dim); font: 800 1.6rem var(--f-display); box-shadow: 0 0 0 2px var(--night-3); }
.plinth--1 .plinth__av { width: clamp(68px, 17vw, 108px); font-size: clamp(2.4rem, 8.5vw, 3.9rem); box-shadow: 0 0 0 4px var(--plate), 0 0 46px -4px var(--plate); }
.plinth__crown { position: absolute; top: -44%; left: 50%; font-size: .62em; transform: translateX(-50%) rotate(-7deg); animation: lb-crown 2.6s ease-in-out infinite; filter: drop-shadow(0 4px 8px rgb(0 0 0 / .5)); }
.plinth__name { max-width: 100%; font: 800 clamp(.95rem, 2.6vw, 1.25rem)/1.2 var(--f-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plinth__name .youtag, .plinth__name .guesttag { display: block; width: max-content; margin: 4px auto 0; }
.plinth__value { font: 800 clamp(1.1rem, 3.6vw, 1.7rem)/1.1 var(--f-display); color: var(--chalk); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.plinth__value small { font: 600 .5em var(--f-mono); margin-left: 4px; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.plinth__sub { font-size: var(--step--1); color: var(--chalk-dim); }
.plinth__block { position: relative; display: flex; align-items: flex-start; justify-content: center; padding-top: 8px; border-radius: 16px 16px 0 0; overflow: hidden; color: rgb(20 14 4 / .78);
  background: linear-gradient(180deg, var(--plate), var(--plate-deep)); transform-origin: bottom; animation: lb-rise .7s cubic-bezier(.2, 1.15, .3, 1) backwards;
  box-shadow: inset 0 2px 0 rgb(255 255 255 / .55), inset 0 -30px 40px -20px rgb(0 0 0 / .35); }
.plinth__block::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgb(255 255 255 / .55) 50%, transparent 65%); transform: translateX(-120%); animation: lb-shine 3.6s ease-in-out 1.2s infinite; }
.plinth__num { font: 800 italic clamp(2.4rem, 8vw, 4.4rem)/1 var(--f-display); letter-spacing: -.05em; padding-right: .14em; }
.plinth__ord { font: 800 italic clamp(.8rem, 2.2vw, 1.2rem)/1 var(--f-display); margin: .55em 0 0 3px; }
.plinth--1 { --plate: var(--gold); --plate-deep: var(--gold-deep); }
.plinth--2 { --plate: var(--silver); --plate-deep: var(--silver-deep); }
.plinth--3 { --plate: var(--bronze); --plate-deep: var(--bronze-deep); }
.plinth--1 .plinth__block { height: clamp(120px, 24vw, 176px); box-shadow: inset 0 2px 0 rgb(255 255 255 / .6), inset 0 -30px 40px -20px rgb(0 0 0 / .3), 0 0 60px -12px var(--gold); }
.plinth--2 .plinth__block { height: clamp(84px, 17vw, 124px); }
.plinth--3 .plinth__block { height: clamp(60px, 12vw, 90px); }
.plinth--1 .plinth__racer, .plinth--1 .plinth__block { animation-delay: .5s; }
.plinth--2 .plinth__racer, .plinth--2 .plinth__block { animation-delay: .25s; }
.plinth.is-empty { opacity: .45; }
.plinth.is-empty .plinth__name { font-weight: 600; color: var(--chalk-dim); font-size: .9rem; }
.plinth.is-me .plinth__name .who { color: var(--sun-text); }
.podium + .standings { margin-top: 0; border-top: 3px solid var(--night-3); padding-top: 14px; }
.podium { border-bottom: 0; }

/* Standings rows (4th and down) */
.standings { list-style: none; margin: 14px auto 0; padding: 0; display: grid; gap: 7px; max-width: 720px; }
.srow { display: grid; grid-template-columns: 58px 38px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 56px; padding-right: 18px; border-radius: 14px; background: color-mix(in srgb, var(--night) 55%, var(--night-2)); border: 1px solid var(--night-3); overflow: hidden; animation: lb-slide .4s ease-out backwards; animation-delay: calc(.75s + var(--i, 0) * 45ms); }
.srow__pos { align-self: stretch; display: grid; place-items: center; font: 800 italic 1.5rem/1 var(--f-display); letter-spacing: -.04em; color: var(--chalk); background: var(--night-3); clip-path: polygon(0 0, 100% 0, 80% 100%, 0 100%); padding-right: 8px; font-variant-numeric: tabular-nums; }
.srow__av { font-size: 1.6rem; line-height: 1; text-align: center; }
.srow__name { min-width: 0; display: flex; flex-direction: column; font-weight: 700; line-height: 1.25; white-space: nowrap; overflow: hidden; }
.srow__name > .who { overflow: hidden; text-overflow: ellipsis; }
.srow__name .youtag, .srow__name .guesttag { display: none; }
.srow__sub { font-size: var(--step--1); font-weight: 500; color: var(--chalk-dim); overflow: hidden; text-overflow: ellipsis; }
.srow__value { font: 800 1.2rem/1 var(--f-display); font-variant-numeric: tabular-nums; }
.srow__value small { font: 600 .55em var(--f-mono); margin-left: 4px; color: var(--chalk-dim); text-transform: uppercase; letter-spacing: .06em; }
.srow.is-me { border-color: var(--sun); background: color-mix(in srgb, var(--sun) 14%, var(--night-2)); box-shadow: 0 0 0 1px var(--sun), 0 10px 30px -16px var(--sun); }
.srow.is-me .srow__pos { background: var(--sun); color: var(--ink-on-sun); }
.standings__gap { text-align: center; color: var(--chalk-dim); letter-spacing: .3em; font-size: .7rem; }

/* How points work */
.howto { max-width: 720px; margin: 26px auto 0; border: 1px solid var(--night-3); border-radius: 16px; background: color-mix(in srgb, var(--night) 60%, transparent); }
.howto summary { cursor: pointer; padding: 14px 18px; font-weight: 700; }
.howto__body { padding: 0 18px 18px; color: var(--chalk-dim); }
.howto__body strong { color: var(--chalk); }
.howto__body ul { padding-left: 1.2em; display: grid; gap: 6px; }
.howto__formula { font: 500 1rem/1.5 var(--f-mono); color: var(--sun-text); padding: 12px 14px; border-radius: 12px; background: var(--night); overflow-x: auto; white-space: nowrap; }
.howto__formula span { border-bottom: 1px dashed currentColor; }
.howto__table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; margin-top: 8px; }
.howto__table th, .howto__table td { padding: 7px 10px; text-align: right; border-bottom: 1px solid var(--night-3); }
.howto__table th:first-child { text-align: left; }
.howto__table thead th { font: 500 var(--step--1) var(--f-mono); color: var(--chalk-dim); }
.howto__table td { color: var(--chalk); font-weight: 600; }

/* Game board cards on the hub */
.boards { margin-top: 44px; }
.boards__grid { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.bcard__link { display: flex; flex-direction: column; height: 100%; text-decoration: none; border-radius: var(--r-card); background: var(--night-2); border: 1px solid var(--night-3); overflow: hidden; transition: transform .2s ease, border-color .2s, box-shadow .2s; }
.bcard__link:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--game) 70%, var(--night-3)); box-shadow: var(--shadow); }
.bcard__media { position: relative; display: block; aspect-ratio: 16 / 6; overflow: hidden; background: color-mix(in srgb, var(--game) 30%, var(--night-3)); }
.bcard__media img { width: 100%; height: 100%; object-fit: cover; }
.bcard__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, var(--night-2)); }
.bcard__body { display: flex; flex-direction: column; gap: 2px; padding: 0 16px 16px; margin-top: -22px; position: relative; flex: 1; }
.bcard__title { font: 800 1.25rem/1.15 var(--f-display); }
.bcard__board { font: 500 var(--step--1)/1.4 var(--f-mono); color: var(--chalk-dim); letter-spacing: .03em; }
.bcard__top { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; flex: 1; }
.bcard__rows { display: grid; gap: 4px; }
.bcard__row { display: grid; grid-template-columns: 22px 24px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 5px 10px 5px 6px; border-radius: 10px; background: color-mix(in srgb, var(--night) 55%, transparent); }
.bcard__row b { font-variant-numeric: tabular-nums; }
.bcard__row.is-me { box-shadow: inset 0 0 0 1.5px var(--sun); }
.bcard__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bcard__name .guesttag { display: none; }
.bcard__foot { margin-top: auto; font-size: var(--step--1); color: var(--chalk-dim); }
.bcard__foot strong { color: var(--sun-text); }
.bcard__note { color: var(--chalk-dim); font-size: .95rem; }

/* One game's leaderboard page */
.gb__head { display: flex; align-items: center; gap: clamp(14px, 3vw, 28px); margin: 18px 0 22px; }
.gb__cover { flex: 0 0 clamp(120px, 26vw, 260px); border-radius: 16px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--game) 60%, var(--night-3)); box-shadow: 0 20px 50px -24px var(--game); }
.gb__cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.gb__copy { min-width: 0; }
.gb__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.gb__tabs { margin-bottom: 14px; }
.gb__body { padding: 20px clamp(12px, 3vw, 32px) 28px; border-radius: 28px; border: 1px solid var(--night-3);
  background:
    radial-gradient(120% 80% at 50% -10%, color-mix(in srgb, var(--game) 26%, transparent), transparent 62%),
    repeating-linear-gradient(115deg, transparent 0 46px, color-mix(in srgb, var(--chalk) 3%, transparent) 46px 48px),
    var(--night-2); }
.gb__meta { display: flex; justify-content: center; gap: 8px 10px; flex-wrap: wrap; font: 500 var(--step--1)/1.4 var(--f-mono); color: var(--chalk-dim); }
.gb__meta span { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--night-3); background: color-mix(in srgb, var(--night) 50%, transparent); }
.mybar { display: flex; align-items: center; justify-content: space-between; gap: 10px 18px; flex-wrap: wrap; max-width: 720px; margin: 16px auto 0; padding: 12px 18px; border-radius: 14px; background: color-mix(in srgb, var(--sun) 12%, var(--night)); border: 1px solid color-mix(in srgb, var(--sun) 50%, var(--night-3)); }
.mybar__place { font-weight: 700; }
.mybar__place b { font: 800 italic 1.3em var(--f-display); color: var(--sun-text); }
.mybar__score { color: var(--chalk-dim); font-variant-numeric: tabular-nums; }
.mybar .btn { min-height: 40px; cursor: pointer; }
@media (max-width: 560px) {
  .gb__head { flex-direction: column; align-items: flex-start; }
  .gb__cover { flex-basis: auto; width: 100%; max-width: 340px; }
  .srow { grid-template-columns: 48px 30px minmax(0, 1fr) auto; gap: 8px; padding-right: 12px; }
  .srow__pos { font-size: 1.25rem; }
  .srow__value { font-size: 1.05rem; }
  .cup, .gb__body { border-radius: 20px; }
}

/* "Top players" on a game's own page */
.miniboard { margin-top: 6px; padding: 14px 16px 16px; border-radius: 16px; border: 1px solid var(--night-3); background: var(--night-2); }
.miniboard__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.miniboard__title { margin: 0; display: inline-flex; align-items: center; gap: 8px; font: 800 1.1rem/1.2 var(--f-display); }
.miniboard__title svg { width: 20px; height: 20px; color: var(--sun-text); }
.miniboard__all { font-size: var(--step--1); font-weight: 700; color: var(--sun-text); text-underline-offset: 3px; }
.miniboard__note { margin: 0; color: var(--chalk-dim); font-size: .95rem; }
.mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.mini__row { display: grid; grid-template-columns: 26px 26px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 10px 6px 6px; border-radius: 10px; }
.mini__row:nth-child(odd) { background: color-mix(in srgb, var(--night) 55%, transparent); }
.mini__pos { text-align: center; font: 800 italic 1rem var(--f-display); color: var(--chalk-dim); }
.mini__name { min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini__row b { font-variant-numeric: tabular-nums; }
.mini__row.is-me { box-shadow: inset 0 0 0 1.5px var(--sun); background: color-mix(in srgb, var(--sun) 12%, transparent); }
.mini__gap { text-align: center; color: var(--chalk-dim); letter-spacing: .3em; font-size: .6rem; }

/* Player card */
.pcard { border: 0; padding: 0; background: transparent; color: var(--chalk); width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); }
.pcard::backdrop { background: rgb(8 6 24 / .72); backdrop-filter: blur(8px); }
.pcard__in { position: relative; padding: 24px 20px 20px; border-radius: 22px; border: 1px solid var(--night-3); background: linear-gradient(160deg, var(--night-3), var(--night-2) 55%); box-shadow: var(--shadow); animation: lb-pop .25s cubic-bezier(.2, 1.3, .4, 1); }
.pcard__x { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: color-mix(in srgb, var(--chalk) 12%, transparent); cursor: pointer; }
.pcard__top { display: flex; align-items: center; gap: 14px; }
.pcard__av { font-size: 3.2rem; line-height: 1; }
.pcard__name { margin: 0; font: 800 1.6rem/1.1 var(--f-display); }
.pcard__since { margin: 2px 0 0; color: var(--chalk-dim); font-size: var(--step--1); }
.pcard__stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 18px 0 14px; }
.pcard__stats > div { display: grid; gap: 2px; justify-items: center; padding: 10px 4px; border-radius: 12px; background: color-mix(in srgb, var(--night) 60%, transparent); min-width: 0; }
.pcard__stats b { font: 800 1.2rem/1.1 var(--f-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pcard__stats b small { font-size: .65em; color: var(--chalk-dim); }
.pcard__stats span { font: 500 .66rem/1.3 var(--f-mono); color: var(--chalk-dim); text-transform: uppercase; letter-spacing: .06em; }
.pcard__stats .medals { display: grid; }
.pcard__stats .medals b { font-size: .95rem; display: inline-flex; gap: 4px; }
.pcard__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.pcard__list a { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 12px 8px 6px; border-radius: 12px; text-decoration: none; background: color-mix(in srgb, var(--night) 60%, transparent); }
.pcard__list a:hover { background: var(--night); }
.pcard__place { text-align: center; font: 800 italic 1.1rem var(--f-display); }
.pcard__game { display: grid; font-weight: 700; min-width: 0; }
.pcard__game small, .pcard__score small { font: 500 .72rem/1.3 var(--f-mono); color: var(--chalk-dim); }
.pcard__score { display: grid; justify-items: end; font-weight: 800; font-variant-numeric: tabular-nums; }

.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }

@keyframes lb-rise { from { transform: scaleY(0); } }
@keyframes lb-drop { from { opacity: 0; transform: translateY(-34px) scale(.8); } }
@keyframes lb-slide { from { opacity: 0; transform: translateX(-18px); } }
@keyframes lb-pop { from { opacity: 0; transform: translateY(12px) scale(.96); } }
@keyframes lb-crown { 50% { transform: translateX(-50%) rotate(6deg) translateY(-3px); } }
@keyframes lb-shine { 0%, 55% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }

/* Filters: the competition toggles sit beside the device toggles */
#compete { margin-left: 4px; padding-left: 10px; border-left: 1px solid var(--night-3); }
#compete .devpick__btn svg { width: 18px; height: 18px; }
.facts dd a { color: var(--sun-text); text-underline-offset: 3px; }

/* Who is playing, in the bar above a game */
.acct--bar { height: 40px; padding: 0 12px 0 10px; max-width: 170px; border-radius: 12px; font-size: .92rem; }
.acct--bar.is-in { border-color: color-mix(in srgb, var(--sun) 55%, var(--night-3)); }
.acct--bar .acct__av { font-size: 1.15rem; }
@media (max-width: 560px) {
  .acct--bar { max-width: 118px; padding: 0 9px 0 8px; }
  .player__tools:has(.acct--bar) a.iconbtn[target="_blank"] { display: none; }
  .player__bar:has(.acct--bar) { gap: 8px; }
}
