/* /stats only. Same release of the editor's one-screen phone lock as gallery.css does, and for
   the same reason: styles.css clips the page to 100svh so the shutter is always reachable, and
   a table of nine rows has to scroll. */

  main.board{max-width:var(--shell);margin-inline:auto;width:100%;display:block;
    padding:clamp(16px,2.6vw,28px) var(--pad) var(--pad)}

  .mark a{text-decoration:none}
  .mark a:hover{color:var(--cyan)}

  .board-bar{margin-bottom:clamp(14px,2vw,22px)}
  .board-bar .note{margin:10px 0 0}

  .banner{border:1px solid rgba(53,200,255,.28);background:rgba(21,96,232,.1);border-radius:10px;
    padding:12px 14px;font-size:12.5px;color:var(--ink);margin-bottom:clamp(14px,2vw,22px);
    max-width:74ch}
  .banner b{font-weight:600}
  .banner code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11.5px;
    background:rgba(3,6,28,.6);padding:1px 5px;border-radius:4px}
  .banner.bad{border-color:rgba(255,120,120,.4);background:rgba(120,20,20,.18)}

  /* ---------- the leading style ----------
     A picture and four numbers, above the table, because "which one wins" is the question the
     page exists to answer and a nine-row table makes you read it rather than see it. */
  .lead{display:grid;grid-template-columns:clamp(180px,26vw,300px) minmax(0,1fr);
    gap:clamp(16px,2.4vw,30px);align-items:center;
    padding:clamp(14px,2vw,22px);margin-bottom:clamp(18px,2.4vw,28px);
    border:1px solid var(--line);border-radius:16px;
    background:
      radial-gradient(110% 140% at 6% 0%,rgba(21,96,232,.16),transparent 62%),
      linear-gradient(180deg,rgba(53,200,255,.05),rgba(3,6,28,0))}

  .lead-art{display:block;text-decoration:none;border-radius:12px;overflow:hidden;
    aspect-ratio:1;position:relative;transition:transform .2s ease}
  .lead-art:hover{transform:scale(1.012)}
  .lead-art .frame{position:absolute;inset:0;display:block;
    background:linear-gradient(150deg,#0A1E6B,#03061C);box-shadow:inset 0 0 0 1px var(--line)}
  .lead-art canvas{display:block;width:100%;height:100%}
  .lead-art:focus-visible{outline:2px solid var(--cyan);outline-offset:2px}

  .lead-body{min-width:0}
  .kicker{margin:0;font-size:11px;letter-spacing:.14em;text-transform:uppercase;color:var(--cyan)}
  .lead-body h2{font-family:'Bricolage Grotesque',sans-serif;font-weight:700;
    font-size:clamp(28px,4.4vw,48px);letter-spacing:-.03em;line-height:1.02;margin:6px 0 0}
  .lead-sub{margin:8px 0 0;font-size:13.5px;color:var(--ink);font-variant-numeric:tabular-nums}
  /* Capped, because the same 100-unit path stretched across a 1000px panel flattens into a
     horizon line and stops saying anything about the shape of the week. */
  .lead-spark{margin-top:14px;height:56px;max-width:480px}

  /* Three facts the ranked table below cannot state without being read line by line. */
  .tallies{display:flex;flex-wrap:wrap;gap:10px clamp(20px,3vw,40px);margin:18px 0 0}
  .tallies div{min-width:0}
  .tallies dt{font-size:11px;letter-spacing:.05em;color:var(--mute);text-transform:uppercase}
  .tallies dd{margin:3px 0 0;font-size:19px;letter-spacing:-.015em;font-variant-numeric:tabular-nums}

  /* ---------- sparklines ----------
     Normalised per line, so this is the shape of a style's week and never its size; the count
     in the row is what carries size. Stretched by preserveAspectRatio, hence no stroke scaling. */
  .sparkline{display:block;width:100%;height:100%;overflow:visible}
  .sp-line{fill:none;stroke:var(--cyan);stroke-width:1.6;vector-effect:non-scaling-stroke;
    stroke-linejoin:round;stroke-linecap:round}
  .sp-area{fill:rgba(53,200,255,.13)}
  .sp-dot{fill:#EAFBFF}
  .sparkline.big .sp-line{stroke-width:2.2}
  .sparkline.big .sp-area{fill:rgba(53,200,255,.16)}

  /* ---------- the table ----------
     One grid for every row so the bars share a left edge and the numbers share a right one;
     a per-row flex layout let the columns drift by a pixel or two and it read as sloppy. */
  .chart{list-style:none;margin:0;padding:0;display:grid;gap:2px;counter-reset:none}
  .row{display:grid;
    grid-template-columns:22px 56px minmax(84px,132px) 74px minmax(0,1fr) 62px 46px;
    align-items:center;gap:12px;padding:9px 10px;border-radius:8px;
    transition:background .18s ease}
  .row:hover{background:rgba(53,200,255,.05)}

  .row .rank{font-size:12px;color:var(--mute);text-align:right;font-variant-numeric:tabular-nums}
  .row.podium .rank{color:var(--ink)}
  .row.top .rank{color:var(--cyan);font-weight:600}

  /* 56, not the 38 this used to be. The swatch draws the same mark the editor's cold strip does,
     and the mark is low-frequency — a glow and a rim, no face — so it needs area to separate
     Apparition from Jumbotron from Dither, which all collapse to "a blue dot" below ~48px. That
     number is the same PFP legibility floor the mode-testing rule in CLAUDE.md is built on, and it
     applies to a swatch for exactly the same reason. Costs 18px of row height, nine times. */
  .row .sw{width:56px;height:56px;border-radius:10px;overflow:hidden;display:block;
    background:linear-gradient(150deg,#0A1E6B,#03061C);box-shadow:0 0 0 1px var(--line)}
  .row .sw canvas{display:block;width:100%;height:100%}

  .row .name{min-width:0}
  .row .name a{text-decoration:none;font-size:14px;letter-spacing:-.005em}
  .row .name a:hover{color:var(--cyan)}
  .row .name small{display:block;color:var(--mute);font-size:11px;
    font-family:ui-monospace,SFMono-Regular,Menlo,monospace}

  /* Empty until the trend call comes back — and it is allowed never to. The cell keeps its
     width either way so the columns do not jump when sparklines are missing. */
  .row .trend{height:26px;display:block;opacity:.85}

  .row .track{height:9px;border-radius:999px;background:rgba(53,200,255,.08);overflow:hidden}
  .row .fill{display:block;height:100%;width:0;border-radius:999px;
    background:linear-gradient(96deg,var(--blue),var(--cyan));
    transition:width .6s cubic-bezier(.2,.8,.2,1)}
  .row.top .fill{background:linear-gradient(96deg,var(--cyan),#EAFBFF)}

  .row .n{text-align:right;font-size:14px;font-variant-numeric:tabular-nums}
  .row .pct{text-align:right;font-size:12px;color:var(--mute);font-variant-numeric:tabular-nums}
  .row.zero .n,.row.zero .pct{color:var(--mute)}
  /* A zero row draws no sparkline, but the empty cell stays: `display:none` on a grid item
     removes it from the flow and every column after it shifts one place left. */

  .board-foot{color:var(--mute);font-size:12.5px;margin:clamp(20px,3vw,32px) 0 0;max-width:68ch}
  .board-foot b{color:var(--ink);font-weight:500}
  .board-foot code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11.5px}

  @media (prefers-reduced-motion:reduce){
    .row .fill{transition:none}
    .lead-art:hover,.tile:hover{transform:none}
  }

  @media (max-width:900px){
    body.page{height:auto;overflow:visible;display:block;padding-bottom:0}
    body.page main.board{display:block}
  }

  @media (max-width:760px){
    /* The panel stacks, and its picture stops being half the screen. */
    .lead{grid-template-columns:96px minmax(0,1fr);gap:14px;align-items:start}
    .lead-body h2{font-size:clamp(24px,7vw,34px)}
    .lead-spark{height:40px;margin-top:12px}
    .tallies{gap:8px 22px;margin-top:14px}
    .tallies dd{font-size:16px}
  }

  @media (max-width:640px){
    /* The percentage is the same fact as the bar, and the sparkline needs more room than a
       phone row has, so those two go and the bar stays. */
    .row{grid-template-columns:18px 44px minmax(0,1fr) minmax(46px,74px) 52px;gap:9px;padding:8px 4px}
    .row .sw{width:44px;height:44px;border-radius:8px}
    .row .name a{font-size:13px}
    .row .trend,.row .pct{display:none}
  }
