/* Prime Tanki Ratings - design system v3.
   Owner review 2026-08-11: single leaderboard + champions podium on home, layered
   living background, medal treatment for the top ranks, big real art on profiles.
   Profile redesign 2026-08-11: the profile is three framed windows holding nested
   trays (frame > well > tray > card), the section tab row is gone, and the six
   overview glyphs are one masked steel family.

   Palette 2026-10-13 (owner call): matched to esports.playprimetanki.com, so the
   two sites read as one product. That site is the 2017 Tanki tournament look -
   a near-black page, near-black panels inside a 2px grey frame, pure white type,
   and lime #87d704 for whatever is active. The navy-and-forest-green scheme this
   file carried before is gone; the tokens below are HIS values, lifted from
   esports-site.css, not approximations of them.

   Lime is spent the way his site spends it: on figures, active states and the
   modification tier. The bars themselves sit a step down from it, because this
   page shows far more green at once than his ever does and full lime across all
   of them turns the page into a highlighter.

   WCAG AA floors, max-width 1200 shell, clean at 375px. */

:root {
  /* ---- the shared palette (esports-site.css, verbatim) ---- */
  --bg:        #0e0904;
  --panel:     rgba(13, 13, 13, 0.94);
  --panel-2:   rgba(26, 26, 26, 0.94);
  --line:      #8f8f8f;
  --rule:      rgba(255, 255, 255, 0.10);
  --zebra:     rgba(255, 255, 255, 0.04);
  --text:      #ffffff;
  --text-dim:  #c9c9c9;
  --text-faint:#8c8c8c;
  --accent:    #87d704;
  --accent-hi: #e9ff83;
  --gold:      #ffcf3f;
  --silver:    #cfd6dd;
  --bronze:    #d9925a;

  /* The bars keep the green they have always had (owner call 2026-10-13: "I
     liked the old ones there"). They used to borrow --accent-hi and --mod-ink,
     which is the only reason the palette change swept them up with it - these
     are their own tokens now, so recolouring the site leaves them alone.
     --bar-glow is --bar-b in rgb, for the spark's three-stop halo. */
  --bar-a:     #43a06b;
  --bar-b:     #76ff33;
  --bar-glow:  118, 255, 51;

  /* battle-mode quartet, re-cut from his accents (borders, icons and glows only;
     body text stays AA). He has no purple, so Juggernaut keeps one pitched to
     match the saturation of the other three. */
  --mode-dm:  #ffb03b;
  --mode-tdm: #49a6ff;
  --mode-ctf: #ff5a4f;
  --mode-jgr: #b98cff;

  --panel-glass: rgba(20, 20, 20, 0.80);
  --radius: 5px;
  --lift: 0 10px 24px -14px rgba(0, 0, 0, 0.75);
  --sheen: linear-gradient(155deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015) 40%, transparent 62%);
  --hover-ms: 140ms;
  /* One face for everything, as on his site. Exo 2 is gone. */
  --font-display: "Inter", Arial, Helvetica, sans-serif;
  --font-body: "Inter", Arial, Helvetica, sans-serif;
  --font-logo: "Quadrat Grotesk", "Inter", Arial, sans-serif;

  /* Profile window framing: a lit outer edge, a dark ring painted under it, a
     recessed well inside, and trays raised one step back off that well. All of
     it is neutral grey now - there is no blue left anywhere in the scheme. */
  --frame-edge:    #6b6b6b;
  --frame-ring:    rgba(0, 0, 0, 0.65);
  --frame-lit:     rgba(255, 255, 255, 0.075);
  --tray-edge:     #4a4a4a;
  --tray-lit:      rgba(255, 255, 255, 0.05);
  --card-edge:     #4f4f4f;
  --card-edge-hi:  #6f6f6f;
  --stat-ink:      var(--text-dim);
  --stat-ink-hi:   #ffffff;
  --note-ink:      #c9c9c9;
  /* The modification tier on garage cards: the house lime (owner call 2026-08-14
     asked for neon green; lime is that, in the shared palette). */
  --mod-ink:       #87d704;

  /* The accent rail along the top of a panel and down a mode card's leading edge. */
  --rail:       rgba(135, 215, 4, 0.55);

  /* The colour the tank well bottoms out at. tankview.js reads this to paint the
     veil that fades the mirrored tank away, so the reflection always dissolves
     into the exact surface under it. As rgb components, because the script
     composes its own alpha stops from them.
     (It was reading the old navy --bg until 2026-10-13 - a leftover the palette
     change missed, because it lives in the script rather than in this file.) */
  --well-floor-rgb: 8, 8, 8;
  color-scheme: dark;
}

/* Inter, the face the esports site and the game client both use. The same two
   files that site serves, so the letterforms are identical and not merely close.
   size-adjust matches his, so the sizes below mean what they say. */
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-v20-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  size-adjust: 94%;
}
/* The wordmark face, lower case only, used for the masthead and nothing else. */
@font-face {
  font-family: "Quadrat Grotesk";
  src: url("../fonts/quadrat-grotesk-new-bold.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-v20-cyrillic-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  size-adjust: 94%;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* The texture layer below is absolute rather than fixed so it travels with the
     page; it needs body as its containing block to span the whole document. */
  position: relative;
  isolation: isolate;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  /* The living background, bottom to top: the battlefield art, a heavy scrim to
     hold it back, then a lime haze and warm depth over the base.

     Re-cut 2026-10-13 for the esports palette. The two cool-blue depth gradients
     that used to sit here read as a different site the moment the base went warm
     near-black, so the aurora is lime now and the depth is a warm ash. Nothing in
     this stack is blue any more.

     The battlefield art is NOT here - it lives on .bg-art below, so it can be
     masked to transparent instead of faded to a colour that would seam. */
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 460px at 50% -140px, rgba(135, 215, 4, 0.07), transparent 65%),
    radial-gradient(900px 640px at 88% 12%, rgba(135, 215, 4, 0.035), transparent 60%),
    radial-gradient(1100px 800px at 6% 92%, rgba(94, 78, 54, 0.20), transparent 62%),
    linear-gradient(180deg, #14100a 0%, #0e0904 34%, #0a0703 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

/* The battlefield art: pinned to the top of the document at its natural 16:9
   proportions, scrolling with the page like the steel above it, and masked so its
   lower half dissolves to nothing. Because it fades to transparent rather than to
   a colour, whatever is behind it simply becomes more visible - there is no edge
   to match and no seam at any width or scroll position.
   Strength is `opacity` now, which is the one number to tune. */
.bg-art {
  position: absolute;
  z-index: -2;
  top: 0;
  left: 0;
  right: 0;
  height: 58vw;
  pointer-events: none;
  opacity: 0.09;
  background: url("../img/battle-bg.jpg") top center / 100% auto no-repeat;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 42%, transparent 96%);
  mask-image: linear-gradient(180deg, #000 0%, #000 42%, transparent 96%);
}

/* Soft vignette, fixed to the viewport. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(130% 95% at 50% 32%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

/* Scratched steel plate (owner-supplied 2026-08-14) under the film grain, both
   on one layer behind the content, blended rather than painted so the scratches
   catch the light without lifting the page off its dark base.

   Absolute, so it travels with the page - and the battlefield art below it now
   scrolls too, so the two backdrop layers move as one surface rather than one
   sliding across the other (owner call 2026-08-17). */
body::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.028;
  mix-blend-mode: overlay;
  background-image:
    url("../img/background.jpg"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: cover, 180px 180px;
  background-position: center, top left;
  background-repeat: no-repeat, repeat;
}

h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); }
p { margin: 0; }
ol, ul { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; }

a { color: var(--text); text-decoration: none; }

a, button, input {
  transition: color var(--hover-ms) ease-out, background-color var(--hover-ms) ease-out,
              border-color var(--hover-ms) ease-out, box-shadow var(--hover-ms) ease-out,
              opacity var(--hover-ms) ease-out, transform var(--hover-ms) ease-out;
}

:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }

::selection { background: var(--accent); color: #fff; }

.shell {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 20px;
}

main.shell { flex: 1; padding-block: 28px 56px; }

.dim { color: var(--text-dim); }
.quiet { color: var(--text-dim); padding: 24px 0; }

.vh {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* The shared card recipe: glassy panel, top light edge, hover sheen + gentle raise. */
.card-lit {
  position: relative;
  background: linear-gradient(180deg, var(--panel-glass), rgba(18, 18, 18, 0.85));
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 8px 22px -18px rgba(0, 0, 0, 0.6);
}
.card-lit::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--sheen);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--hover-ms) ease-out;
}
.card-lit:hover {
  transform: translateY(-2px);
  border-color: #6b6b6b;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), var(--lift);
}
.card-lit:hover::after { opacity: 1; }

/* ---------- header / footer ---------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(14, 9, 4, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(56, 56, 56, 0.8);
  box-shadow: 0 8px 24px -18px rgba(0, 0, 0, 0.7);
}

.head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 58px;
}

/* The esports site's masthead, lifted whole (owner call 2026-10-13): its logo
   mark, its wordmark face, and the second word in lime - "ratings" where that
   site says "esports". The drawn dot that used to stand in for a mark is gone. */
.brand {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
}

/* Quadrat Grotesk has no lower case - its lower-case glyphs ARE capitals. So the
   markup is typed in lower case and lower-cased again here, which is how the
   esports site drives it; anyone editing the template must keep it that way or
   the font falls back and the word arrives in real capitals at the wrong width. */
.brand-name {
  font-family: var(--font-logo);
  font-size: 19px;
  font-weight: 400;
  letter-spacing: -0.012em;
  line-height: 1;
  text-transform: lowercase;
  white-space: nowrap;
  color: var(--text);
}

.brand-name b {
  color: var(--accent);
  font-weight: 400;
}

.search { flex: 0 1 260px; }

.search-input {
  width: 100%;
  padding: 7px 14px;
  background: rgba(18, 18, 18, 0.85);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
.search-input::placeholder { color: var(--text-dim); }
.search-input:hover { border-color: #6b6b6b; background: var(--panel-2); }
.search-input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(95, 154, 6, 0.25);
}

.site-foot {
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(22, 22, 22, 0), rgba(0, 0, 0, 0.55));
  padding: 22px 0;
  font-size: 13px;
}
.foot-inner { display: flex; align-items: baseline; gap: 10px; }
.foot-brand { font-family: var(--font-display); font-weight: 600; letter-spacing: 0.05em; }
.foot-dim { color: var(--text-dim); }

/* ---------- favourites: the Save star + header bookmarks menu ---------- */

/* Everything here is injected by favourites.js, so none of it exists without
   JavaScript - there is no dead control to style around. */

.fav-ic { width: 16px; height: 16px; fill: currentColor; display: block; }
.fav-ic-lg { width: 22px; height: 22px; }

/* The star sits at the far end of the profile's own header strip. Icon only, and
   a FIXED box - a button that changes size on click drags its neighbours with
   it (owner call 2026-08-17). */
.fav-star {
  margin-left: auto;
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.4);
  color: var(--note-ink);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.fav-star:hover { color: var(--text); border-color: #6b6b6b; }
.fav-star.is-saved { color: var(--gold); border-color: rgba(255, 207, 63, 0.5); }
.fav-star.is-saved .fav-ic { filter: drop-shadow(0 0 6px rgba(255, 207, 63, 0.45)); }

/* The header menu. */
.fav-menu { position: relative; flex: none; }

/* The room for the count is reserved on the BUTTON, not inside it (owner call
   2026-10-13: with no bookmarks this "looks weird"). It used to be an invisible
   13px slot next to the star, which held the width but left the star sitting
   off-centre against a patch of nothing. A min-width wide enough for the count
   keeps the same promise - the search box cannot be nudged when a number turns
   up - while letting the star centre itself when it is alone. */
.fav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 62px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(18, 18, 18, 0.8);
  color: var(--text-dim);
  cursor: pointer;
}
.fav-toggle:hover { color: var(--text); border-color: #6b6b6b; }
.fav-count {
  text-align: center;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--gold);
}
/* Out of the flow entirely now, so the star centres; the button's min-width is
   what holds the layout still. */
.fav-count.is-empty { display: none; }

.fav-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  right: 0;
  width: min(280px, 78vw);
  padding: 12px 13px 13px;
  border: 1px solid var(--frame-edge);
  background: linear-gradient(180deg, #161616, #121212);
  box-shadow: 0 26px 50px -28px rgba(0, 0, 0, 0.95);
}
.fav-panel-head {
  margin-bottom: 9px;
  color: var(--note-ink);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.fav-empty { color: var(--text-dim); font-size: 12.5px; line-height: 1.45; }

.fav-list { display: flex; flex-direction: column; gap: 2px; max-height: 46vh; overflow-y: auto; }
.fav-row { display: flex; align-items: center; gap: 6px; }
.fav-link {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  font-size: 13.5px;
}
.fav-link:hover { background: rgba(135, 215, 4, 0.12); color: var(--accent-hi); }
.fav-badge { flex: none; }
.fav-nick { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fav-remove {
  flex: none;
  width: 24px;
  height: 24px;
  border: 0;
  background: none;
  color: var(--text-dim);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.fav-remove:hover { color: var(--mode-ctf); }

/* ---------- flat-tinted icons ---------- */

/* --s is an OPTICAL correction, not a size. These masks are drawn on canvases
   that are not all filled to the same degree - the gold box's art occupies 58%
   of its 40px square while the star and the crystal fill theirs edge to edge -
   so at one box size the gold box renders visibly smaller than its neighbours
   (owner, 2026-10-14: "the gold hunter icon looks too small compared to the
   other 2"). The profile's stat icons have carried this correction since August;
   the leaderboard's did not, which is the whole of the discrepancy.

   Every mask here is square or wider than tall, so `contain` resolves to a width
   fit, and `calc(100% * s) auto` is that same fit with the factor applied. */
.icon-flat {
  --m: none;
  --s: 1;
  display: inline-block;
  flex: none;
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: var(--m) center no-repeat;
  mask: var(--m) center no-repeat;
  -webkit-mask-size: calc(100% * var(--s)) auto;
  mask-size: calc(100% * var(--s)) auto;
}
.icon-xs { width: 14px; height: 14px; }

/* The same faceted diamond the profile shows (owner call 2026-10-14). The old
   crystal.png is a rounded gem cluster, and as a flat mask it loses its facets
   and reads as a blob. */
.i-crystal { --m: url("../icons/stats/crystal_big.png"); }
/* 1.72 would make its ink exactly as wide as the star's and the crystal's, but a
   closed square reads heavier than a five-point star at equal width, so it stops
   a little short: 1.55 puts it at 18px optical against their 20px. */
.i-goldbox { --m: url("../icons/stats/goldbox.png"); --s: 1.55; }
.i-xp      { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1.8l3 6.5 7.2.9-5.3 4.9 1.4 7.1L12 17.6l-6.3 3.6 1.4-7.1L1.8 9.2 9 8.3z'/%3E%3C/svg%3E"); }

.i-dm  { --m: url("../icons/modes/dm.png"); }
.i-tdm { --m: url("../icons/modes/tdm.png"); }
.i-ctf { --m: url("../icons/modes/ctf.png"); }
.i-cp  { --m: url("../icons/modes/cp.png"); }

/* Supplies board and its per-kind filter row (owner 2026-11-30). */
.i-supplies   { --m: url("../icons/stats/supplies.png"); --s: 1.32; }
.i-sup-health { --m: url("../icons/supplies/health.png"); }
.i-sup-armor  { --m: url("../icons/supplies/armor.png"); }
.i-sup-damage { --m: url("../icons/supplies/damage.png"); }
.i-sup-nitro  { --m: url("../icons/supplies/nitro.png"); }
.i-sup-mine   { --m: url("../icons/supplies/mine.png"); }
.seg-sup { flex-basis: 100%; flex-wrap: wrap; }

/* The `pixelated` that used to live here was written for icons/ranks/ - genuine
   13x13 pixel art shown at 2x. The markup now loads ranks_hq/ instead, which is
   106x103 artwork being scaled DOWN to 26px: nearest-neighbour throws away three
   pixels in four and shreds the badge. Smooth downscaling is what this art
   wants (fixed 2026-08-17). */
.row-badge img, .step-medal img { image-rendering: auto; }

/* ---------- home: category + window controls ---------- */

.lb-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

/* HUD pass 2026-08-14: the home page takes the profile's geometry - notched
   plates, square controls, an accent rail along each head. */
.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: rgba(18, 18, 18, 0.8);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  border-radius: var(--radius);
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.seg-btn:hover { color: var(--text); background: var(--panel-2); }
.seg-btn.is-active {
  color: #fff;
  background: linear-gradient(180deg, #5f9a06, var(--accent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 3px 12px -4px rgba(95, 154, 6, 0.6);
}

/* ---------- home: the leaderboard ---------- */

.board {
  position: relative;
  /* Flat near-black inside a 2px grey frame - the signature of the esports
     panels. The gradient that used to fill this ran almost exactly parallel to
     the page behind it, which is what made the old card foot measure 1.04:1
     against its own background. A flat fill and a visible frame settle it. */
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px -28px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  margin-bottom: 34px;
}
.board.is-loading { opacity: 0.55; pointer-events: none; }

.board-head {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 13px 18px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.7);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
  background: linear-gradient(180deg, rgba(75, 75, 75, 0.5), rgba(40, 40, 40, 0.12));
}
.board-ic { width: 22px; height: 22px; color: #ffffff; }

.board-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.countdown {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 5px 13px;
  border-radius: 999px;
  background: rgba(14, 9, 4, 0.7);
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.02em;
}
/* The template and boards.js both hide this with the `hidden` attribute, but a
   class selector setting `display` outranks the browser's own [hidden] rule, so
   an empty pill with a pulsing dot was drawn on every all-time board (owner,
   2026-10-14: "remove that too, I dont know what it is" - nor could anyone, it
   was a countdown with nothing to count). */
.countdown[hidden] { display: none; }
.countdown::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-hi);
  box-shadow: 0 0 8px rgba(135, 215, 4, 0.8);
  animation: cd-pulse 2.2s ease-in-out infinite;
}
@keyframes cd-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.board-rows { display: block; }

.row {
  position: relative;
  display: grid;
  grid-template-columns: 2.4rem 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 18px;
  border-top: 1px solid rgba(26, 26, 26, 0.7);
  transition: background-color var(--hover-ms) ease-out, box-shadow var(--hover-ms) ease-out;
}
.row:first-child { border-top: 0; }
.row:hover {
  background: linear-gradient(90deg, rgba(135, 215, 4, 0.07), rgba(26, 26, 26, 0.55) 40%, rgba(26, 26, 26, 0.3));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.pos {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
}

.row-badge { display: grid; place-items: center; }

.nick {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 14px;
}
.nick:hover { color: var(--accent-hi); }

.val {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  text-align: right;
}

/* Medals: positions 1-3 get real metal. */
.medal {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  color: #0e0904;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), 0 2px 6px -2px rgba(0, 0, 0, 0.7);
}
.top-1 .medal { background: radial-gradient(circle at 32% 28%, #ffe9a3, var(--gold) 58%, #8a6a20); }
.top-2 .medal { background: radial-gradient(circle at 32% 28%, #ffffff, var(--silver) 58%, #9a9a9a); }
.top-3 .medal { background: radial-gradient(circle at 32% 28%, #edc3a0, var(--bronze) 58%, #7d5433); }

/* The top three are rows like the rest, but bigger and lit (owner call
   2026-08-19, replacing the podium): more height, a metal rail down the leading
   edge, a wash across the row and the same glow the podium plinths carried. */
/* The match-up art sits behind the top three as ONE image spanning all of them
   (owner call 2026-08-19), not tiled per row - it is a scene, and repeating it
   three times would read as wallpaper. It lives on the list itself rather than
   on a row, so nothing in the markup or in boards.js has to change, and it is
   masked away to the right before it can reach the score column.

   Its height is the three tiers added up (74 + 62 + 52), so the art ends exactly
   where the ordinary rows begin. */
.board-rows { position: relative; }
.board-rows::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 0;
  height: 188px;
  background: url("../img/podium-banner.png") center top / auto 188px no-repeat;
  /* 0.12 on the old navy base; the cool page knocked this warm art back for free.
     Against a warm near-black it is the same temperature as what it sits on, so
     the same number read far louder and crowded the top three nicknames. */
  opacity: 0.07;
  pointer-events: none;
  /* Centred (owner call 2026-08-19), so it fades out on BOTH sides - it has to
     clear the rank column on the left as well as the scores on the right. */
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 22%, #000 78%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 22%, #000 78%, transparent 100%);
}
/* The rows themselves sit above it. */
.board-rows .row { z-index: 1; }

/* Four steps down, not one (owner call 2026-08-19): gold is the biggest, silver
   a step under it, bronze a step under that, and the ordinary rows continue the
   descent. The badge column is fixed at 26px on a normal row, so each tier
   widens it to fit its own rank art. */
.row.top-1, .row.top-2, .row.top-3 {
  --metal: var(--silver);
  border-top-color: transparent;
}
.row.top-1 {
  --metal: var(--gold);
  padding-block: 18px;
  grid-template-columns: 2.7rem 38px minmax(0, 1fr) auto;
}
.row.top-2 {
  padding-block: 14px;
  grid-template-columns: 2.6rem 33px minmax(0, 1fr) auto;
}
.row.top-3 {
  --metal: var(--bronze);
  padding-block: 11px;
  grid-template-columns: 2.5rem 29px minmax(0, 1fr) auto;
}

.top-1 {
  background: linear-gradient(90deg, rgba(255, 207, 63, 0.16), rgba(255, 207, 63, 0.04) 45%, transparent);
  box-shadow: inset 4px 0 0 var(--gold), 0 0 28px -6px rgba(255, 207, 63, 0.36);
}
.top-2 {
  background: linear-gradient(90deg, rgba(207, 214, 221, 0.13), rgba(207, 214, 221, 0.03) 45%, transparent);
  box-shadow: inset 3px 0 0 var(--silver), 0 0 20px -9px rgba(207, 214, 221, 0.22);
}
.top-3 {
  background: linear-gradient(90deg, rgba(217, 146, 90, 0.13), rgba(217, 146, 90, 0.03) 45%, transparent);
  box-shadow: inset 2px 0 0 var(--bronze), 0 0 16px -10px rgba(217, 146, 90, 0.18);
}

/* Everything inside a row scales with its tier. */
.top-1 .row-badge img { width: 38px; height: 38px; }
.top-2 .row-badge img { width: 33px; height: 33px; }
.top-3 .row-badge img { width: 29px; height: 29px; }

/* Premium account. The gold plaque carries a frame the bare insignia does not, so
   it renders a step larger to read as the same badge - the swap the game makes
   (reference client UserTitle.as: PREMIUM_RANK_ICON_SIZE > RANK_ICON_SIZE). */
.row-badge.is-premium img { width: 30px; height: 30px; max-width: none; }
.top-1 .row-badge.is-premium img { width: 42px; height: 42px; }
.top-2 .row-badge.is-premium img { width: 37px; height: 37px; }
.top-3 .row-badge.is-premium img { width: 33px; height: 33px; }
.fav-badge.is-premium { width: 23px; height: 23px; }

.top-1 .val, .top-2 .val, .top-3 .val { font-weight: 700; color: var(--metal); }
.top-1 .val { font-size: 18px; }
.top-2 .val { font-size: 16.5px; }
.top-3 .val { font-size: 15px; }

.top-1 .medal { width: 32px; height: 32px; font-size: 15px; }
.top-2 .medal { width: 29px; height: 29px; font-size: 13.5px; }
.top-3 .medal { width: 27px; height: 27px; font-size: 12.5px; }

.top-1 .nick, .top-2 .nick, .top-3 .nick {
  font-family: var(--font-display);
  font-weight: 700;
}
.top-1 .nick { font-size: 20px; }
.top-2 .nick { font-size: 17.5px; }
.top-3 .nick { font-size: 15.5px; }
.top-1:hover, .top-2:hover, .top-3:hover {
  background-color: rgba(26, 26, 26, 0.45);
}

/* Positions 4-10: a quieter distinction. */
/* Ranks 4-10 keep the heavier weight but drop the accent colour (owner call
   2026-10-14): a tinted number there read as a third medal tier under the real
   gold, silver and bronze, which is not what it means. The nickname beside it
   still carries the emphasis. */
.notable .pos { font-weight: 700; }
.notable .nick { font-family: var(--font-display); font-weight: 600; color: #ffffff; }

.row-empty {
  padding: 34px 18px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
}

/* The leaderboard's own podium: the champions podium at board scale, sitting
   inside the board frame above row 4. Slightly roomier, because this one is the
   headline of the page rather than a summary card. */
/* ---------- home: previous champions (one line per period) ---------- */

.champ-strip {
  margin-bottom: 34px;
  display: flex;
  flex-direction: column;
  gap: 1px;                       /* the hairline between lines IS the gap */
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.champ-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 22px;
  padding: 12px 18px;
  background: linear-gradient(180deg, var(--panel-glass), rgba(18, 18, 18, 0.9));
}

.champ-when {
  flex: none;
  min-width: 92px;
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.champ-wins {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 26px;
  min-width: 0;
}

.champ-win {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.champ-win .icon-flat {
  width: 15px;
  height: 15px;
  color: var(--accent-hi);
  align-self: center;
}

.champ-board {
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.champ-nick {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 700;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.champ-nick:hover { color: var(--accent-hi); }

.champ-val {
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 13px;
}

@media (max-width: 760px) {
  /* The three boards stack under the period label rather than squeezing. */
  .champ-line { gap: 8px 14px; padding: 12px 14px; }
  .champ-wins { flex-direction: column; align-items: flex-start; gap: 7px; }
}

/* ---------- home: champions podiums ---------- */

.champs { margin-bottom: 34px; }

.champs-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.champs-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

.champs-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.champs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: stretch;
}

.podium-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--panel-glass), rgba(18, 18, 18, 0.85));
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 8px 22px -18px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  transition: transform var(--hover-ms) ease-out, box-shadow var(--hover-ms) ease-out;
}
.podium-card:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), var(--lift);
}

.podium-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px 10px;
  color: var(--text);
  background: linear-gradient(180deg, rgba(75, 75, 75, 0.42), transparent);
}
.podium-head .icon-flat { width: 17px; height: 17px; }

.podium-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
}

.podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 8px;
  padding: 6px 14px 14px;
  flex: 1;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.step-empty { visibility: hidden; }

.step-medal {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--panel-2);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 3px 8px -3px rgba(0, 0, 0, 0.7);
}
.step-1 .step-medal {
  background: radial-gradient(circle at 32% 28%, #ffe9a3, var(--gold) 62%, #8a6a20);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), 0 0 14px rgba(255, 207, 63, 0.35);
}
.step-2 .step-medal { background: radial-gradient(circle at 32% 28%, #ffffff, var(--silver) 62%, #9a9a9a); }
.step-3 .step-medal { background: radial-gradient(circle at 32% 28%, #edc3a0, var(--bronze) 62%, #7d5433); }

.step-nick {
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12.5px;
  font-weight: 600;
}
.step-nick:hover { color: var(--accent-hi); }

.step-val {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
}

/* Pedestals are cut plates too: the top outer corner is chamfered, so the three
   steps read as machined blocks rather than rounded bars. */
.pedestal {
  width: 100%;
  display: grid;
  place-items: center;
  border-radius: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.step-1 .pedestal {
  height: 66px;
  color: #ffcf3f;
  background: linear-gradient(180deg, rgba(255, 207, 63, 0.3), rgba(255, 207, 63, 0.05));
  border: 1px solid rgba(255, 207, 63, 0.4);
}
.step-2 .pedestal {
  height: 46px;
  color: var(--silver);
  background: linear-gradient(180deg, rgba(207, 214, 221, 0.22), rgba(207, 214, 221, 0.04));
  border: 1px solid rgba(207, 214, 221, 0.3);
}
.step-3 .pedestal {
  height: 34px;
  color: var(--bronze);
  background: linear-gradient(180deg, rgba(217, 146, 90, 0.22), rgba(217, 146, 90, 0.04));
  border: 1px solid rgba(217, 146, 90, 0.3);
}

/* ==========================================================================
   PROFILE - the framed windows
   The game's garage framing, rebuilt in CSS. Four surfaces, always in the same
   order, so the eye reads a real window inside a window:

     1. .panel       the outer frame - a lit edge, a dark ring painted just
                     inside it, and a light lip over the top of that ring
     2. .panel-body  the well - the interior visibly sits deeper than the frame
     3. .tray        the sub-window - raised back off the well, own lit lip
     4. cards        one step brighter again, so they float inside the tray

   Depth is layered hairlines and shallow gradients only, never a blurry drop
   shadow. Owner call 2026-08-11: "window within a window", tab row deleted.
   ========================================================================== */

/* HUD pass 2026-08-14: panels are notched plates, not rounded cards. Two corners
   are cut on the diagonal - top-left and bottom-right - so the shape reads as
   machined rather than soft. The cut is a clip, so no border survives on the
   diagonal: the edge IS the cut, which is the look. */
.panel {
  position: relative;
  margin-bottom: 22px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 2px solid var(--line);
  box-shadow: 0 22px 44px -40px rgba(0, 0, 0, 0.95);
}
.panel:last-child { margin-bottom: 0; }

.panel-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 12px 20px 11px;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(75, 75, 75, 0.5), rgba(40, 40, 40, 0.12));
  border-bottom: 1px solid rgba(0, 0, 0, 0.7);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}
.panel-title {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #f0f0f0;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
/* The accent tick, the game's own list marker, at panel scale. */
.panel-title::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(180deg, #ffffff, #9a9a9a);
  box-shadow: 0 0 10px rgba(135, 215, 4, 0.45);
}

/* Steel rather than --text-dim: the header strip is the lightest surface on the
   page, where dim text measures 4.16:1. This lands at 5.6:1, clear of AA. */
.panel-note {
  margin-left: auto;
  color: var(--note-ink);
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.04em;
}

/* Flatten pass 2026-08-14: the panel is the ONLY raised surface on the page.
   Its body is a plain field - no second well - and the groups inside are told
   apart by whitespace, alignment and their label rule instead of by more boxes.
   The generous gap is what now does the work the tray borders used to. */
.panel-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding: 22px 20px 24px;
  border-radius: 0 0 13px 13px;
}

/* A tray is no longer a window within a window: it is simply a labelled group.
   Its head rule and the space around it carry the grouping. */
.tray {
  position: relative;
}

.tray-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
/* The hairline that runs from the label out to the tray edge. */
.tray-head::after {
  content: "";
  order: 1;
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(80, 80, 80, 0.9), rgba(80, 80, 80, 0));
}

.tray-title {
  color: var(--note-ink);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
/* The same accent tick as the panel head, one step smaller and without glow. */
.tray-title::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 11px;
  margin-right: 9px;
  vertical-align: -1px;
  border-radius: 2px;
  background: linear-gradient(180deg, #ffffff, rgba(255, 255, 255, 0.35));
}

/* The bare number said nothing on its own, so it is labelled now. The label is
   the quiet half and the figure the loud one, which keeps the count scannable
   at the end of the tray rule. */
.tray-count {
  order: 2;
  flex: none;
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  /* No chip at all (owner call 2026-08-15): the count is bare text on the tray
     rule. The padding is only breathing room where the rule meets it. */
  padding: 0 0 0 4px;
  background: none;
  border: 0;
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.tray-count-n {
  color: var(--stat-ink-hi);
  font-size: 10px;
  font-weight: 700;
}

/* ---------- profile: the identity tray ---------- */

/* The tank runs the full height of the frame beside the rank tray and the
   overview tray, so panel A has no dead space at any width. */
/* Owner call 2026-08-14: the tank sits beside the identity block ONLY, matching
   its height, and the overview runs the full width underneath both - rather than
   the tank spanning two rows and squeezing the figures into a half-width column.
   Owner call 2026-10-21: the big preview at every width (it was only below 1120px):
   identity, then the tank full width, then the overview. */
.ident-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "ident" "tank" "stats";
  gap: 20px;
  align-items: stretch;
}
.ident-grid > .tray-ident   { grid-area: ident; }
.ident-grid > .viewer-well  { grid-area: tank; }
.ident-grid > .tray-stats   { grid-area: stats; }

.tray-ident {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  min-width: 0;
}

.ident-row {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.badge-wrap {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
}
/* A quiet pool of shade under the art instead of a competing frame: the
   premium rank png already carries its own gold frame. */
.badge-wrap::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 16px;
  background: radial-gradient(62% 58% at 50% 46%, rgba(0, 0, 0, 0.38), transparent 74%);
}
/* Premium accounts get a whisper of gold in that pool, matching their chip. */
.badge-wrap.is-premium::before {
  background:
    radial-gradient(58% 54% at 50% 46%, rgba(255, 207, 63, 0.16), transparent 72%),
    radial-gradient(62% 58% at 50% 46%, rgba(0, 0, 0, 0.34), transparent 74%);
}
/* The art stands on the tray rather than floating over it. */
.badge-wrap::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -2px;
  transform: translateX(-50%);
  width: 70%;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(0, 0, 0, 0.45), transparent 70%);
}
.badge-img { position: relative; display: block; height: auto; }

.ident-names { min-width: 0; }

.nickname {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.14;
  overflow-wrap: anywhere;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.4);
}

.ident-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}

/* The standing tags, on their own line between the identity row and the
   experience bar (owner call 2026-08-19). tray-ident already puts 18px either
   side of this row, which reads as detached from the name above it - the
   negative top margin pulls it back under the rank it belongs to. */
.ident-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -8px;
}

.rank-name {
  padding-right: 4px;
  color: #c9c9c9;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* One chip geometry, three tints: gold for premium, steel for the staff role,
   green for the rating position. The role name replaces the old role image
   (owner call 2026-08-11), so it has to share the geometry exactly. */
.premium-tag, .role-chip, .rating-chip, .sanction-chip, .label-chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.premium-tag {
  background: linear-gradient(180deg, rgba(255, 207, 63, 0.25), rgba(255, 207, 63, 0.08));
  border-color: rgba(255, 207, 63, 0.5);
  color: #ffcf3f;
}

.role-chip {
  background: linear-gradient(180deg, rgba(201, 201, 201, 0.18), rgba(201, 201, 201, 0.06));
  border-color: rgba(210, 210, 210, 0.45);
  color: #e0e0e0;
}

.rating-chip {
  background: linear-gradient(180deg, rgba(135, 215, 4, 0.2), rgba(135, 215, 4, 0.07));
  border-color: rgba(135, 215, 4, 0.45);
  color: #a5e63a;
}

.sanction-chip {
  background: linear-gradient(180deg, rgba(240, 70, 60, 0.25), rgba(240, 70, 60, 0.08));
  border-color: rgba(240, 90, 80, 0.55);
  color: #ff6a5e;
  position: relative;
  cursor: help;
  outline: none;
  transition: box-shadow 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.sanction-chip:hover, .sanction-chip:focus-visible {
  border-color: rgba(255, 110, 100, 0.9);
  color: #ff8a80;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 10px rgba(240, 70, 60, 0.45), 0 0 22px rgba(240, 70, 60, 0.18);
}

.sanction-tip {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  z-index: 20;
  width: max-content;
  max-width: min(320px, calc(100vw - 32px));
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(240, 90, 80, 0.45);
  border-top: 2px solid #ff6a5e;
  background: rgba(16, 16, 18, 0.97);
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.9), 0 0 18px -6px rgba(240, 70, 60, 0.35);
  color: var(--text, #e8e8e8);
  font-family: var(--font-body, inherit);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.45;
  text-transform: none;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  pointer-events: none;
}

.sanction-tip b { color: #ff8a80; font-weight: 700; }

.sanction-chip:hover .sanction-tip, .sanction-chip:focus .sanction-tip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.label-superstar {
  background: linear-gradient(180deg, rgba(190, 120, 255, 0.28), rgba(190, 120, 255, 0.09));
  border-color: rgba(190, 120, 255, 0.6);
  color: #cf9dff;
}

.label-enhanced {
  background: linear-gradient(180deg, rgba(70, 180, 255, 0.25), rgba(70, 180, 255, 0.08));
  border-color: rgba(90, 185, 255, 0.55);
  color: #7cc8ff;
  position: relative;
  cursor: help;
  outline: none;
}

.label-tip {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  z-index: 20;
  width: max-content;
  max-width: min(320px, calc(100vw - 32px));
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(90, 185, 255, 0.45);
  border-top: 2px solid #7cc8ff;
  background: rgba(16, 16, 18, 0.97);
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.9);
  color: var(--text, #e8e8e8);
  font-family: var(--font-body, inherit);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.45;
  text-transform: none;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  pointer-events: none;
}

.label-chip:hover .label-tip, .label-chip:focus .label-tip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.ident-since { margin-top: 7px; color: var(--text-dim); font-size: 13px; }

.xpbar { max-width: 480px; }

.xpbar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.xpbar-cap {
  color: var(--text-dim);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.xpbar-val {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
}

.xpbar-track {
  height: 11px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.9);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.55), 0 1px 0 rgba(255, 255, 255, 0.045);
  overflow: hidden;
}

/* Same neon the M3 badges use (owner call 2026-08-19), running out of the
   darker accent so the bar still has depth rather than reading as a flat slab.
   position:relative carries the travelling spark below. */
.xpbar-fill {
  position: relative;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--bar-a), var(--bar-b));
}

/* The sweep, driven by modebars.js exactly as the battle-mode shares are. */
#profile.bars-armed .xpbar-fill {
  transition: width 1500ms cubic-bezier(0.62, 0.02, 0.28, 1);
}
.xpbar-fill::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -3px;
  width: 13px;
  height: 13px;
  margin-top: -6.5px;
  border-radius: 50%;
  background: var(--bar-b);
  box-shadow:
    0 0 10px 4px rgba(var(--bar-glow), 0.95),
    0 0 26px 10px rgba(var(--bar-glow), 0.5),
    0 0 44px 18px rgba(var(--bar-glow), 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 450ms ease-out;
}
#profile.bars-firing .xpbar-fill::after {
  opacity: 1;
  transition: opacity 120ms ease-in;
}

.xpbar-label { margin-top: 7px; color: var(--text-dim); font-size: 12.5px; }

/* ---------- profile: the tank well ---------- */

/* Deliberately NOT a bright panel: a dark inset well the tank sits inside. It
   now takes its height from the identity block beside it, with a floor so a
   sparse profile (no chips, no "tanker since") cannot squash the tank. */
.viewer-well {
  position: relative;
  min-height: 250px;
  border-radius: var(--radius);
  display: grid;
  /* A definite 1fr column, not an auto one: the viewer's own min(90vw,520px)
     would otherwise size the column and escape the well on a phone. */
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  min-width: 0;
  /* No padding, deliberately. The 10px inset here left an 11px strip of bare
     well around the canvas, and the veil inside the canvas bottoms out at the
     floor token while that strip was still mid-gradient - so the canvas border
     showed as a faint line down the sides and across the bottom (owner,
     2026-10-13, "the lines are still there", measured as a 2-4 level step right
     where the canvas edge falls). Full bleed, and there is no seam to see.
     The tank's breathing room comes from the camera's own framing (MARGIN),
     not from CSS. */
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.85);
  border-radius: 10px;
  /* Lifted 2026-10-13 (owner: "the preview is a bit dark"), from the well rather
     than from the tank - brightening the lightmap further would have started
     flattening the surface detail, and this costs the model nothing. A stronger
     top light, and the floor no longer buried under near-opaque black. */
  /* OPAQUE, all the way up. This used to start at rgba(0, 0, 0, 0.30), so the
     top of the well was 70% see-through and you were looking past it at the
     page: the battlefield art under its long alpha mask, and the big radial
     gradients on body. Those band, in horizontal lines, and that is what kept
     showing in the upper half of the well (owner marked them, 2026-10-13).
     An opaque base hides those outright.

     The grain on top is a dither for the well's OWN gradient, which bands in its
     own right: measured at 1:1, the ramp loses one level every ~7 rows, and a
     1-level step held for 7 pixels is exactly the kind of line the eye picks out
     on a dark panel. It is sized to the fault - about plus or minus 1.5 levels.
     An earlier attempt used 0.05 opacity, worth roughly 6 levels, which read as
     ugly noise and still left the real cause (the transparency above) in place. */
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='d'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='1' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23d)' opacity='0.014'/%3E%3C/svg%3E"),
    radial-gradient(118% 86% at 50% 6%, rgba(104, 104, 104, 0.42), transparent 66%),
    linear-gradient(180deg, rgb(22, 22, 22), rgb(var(--well-floor-rgb)));
  background-repeat: repeat, no-repeat, no-repeat;
  box-shadow: inset 0 3px 16px rgba(0, 0, 0, 0.45), 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
}
/* The rating sits at the far end of the Tanker panel head as plain text - no
   chip, no fill (owner call 2026-08-15). It inherits .panel-note for placement
   and steel colour; only the tracking is its own. */
.viewer-rating {
  color: #ffffff;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}

/* A faint floor glow under the tank, lighting the well rather than tinting it
   (owner call 2026-10-13: the green "looks odd"). Neutral white at a low alpha,
   so it reads as the tank catching light off the floor and not as a colour. */
.viewer-well::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 8%;
  transform: translateX(-50%);
  width: 76%;
  height: 20%;
  border-radius: 50%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(255, 255, 255, 0.10), transparent 70%);
  pointer-events: none;
}

/* The viewer keeps its verbatim inline width; max-width only stops it from
   outgrowing the well on a narrow screen. */
#tankview { position: relative; max-width: 100%; }
#tankview.tankview-flat { display: grid; place-items: center; }
#tankview.tankview-empty { opacity: 0.4; }

/* ---------- profile: overview stat cards ---------- */

/* Two deliberate lines (owner call 2026-08-14): kills / deaths / K-D lead at full
   size, then crystals / gold boxes / time in game sit a step down. Hairlines
   between the columns replace the cell borders entirely. */
.stats {
  display: grid;
  gap: 22px 0;
}
/* Two lines, two grids: the lead runs three across, the support line four, which
   one grid cannot express. Each line draws its own column hairlines. */
/* Four over four (owner call 2026-08-15): both lines now share the same column
   edges, which is what the 3-over-4 split could never do. */
.stats-lead { grid-template-columns: repeat(4, 1fr); }
.stats-sub  { grid-template-columns: repeat(4, 1fr); margin-top: 22px; }
.stat-card + .stat-card { padding-left: 22px; border-left: 1px solid rgba(56, 56, 56, 0.9); }

/* Both lines now share one size (owner call 2026-08-14): the step down read as
   an inconsistency rather than a hierarchy, so the six figures are one family
   and the line break alone groups them. */

/* Left-aligned, not centred (owner call 2026-08-16). Centring positioned each
   cell's contents by its own text width, so "54,229" and "2,981,669" started at
   different x and no column had a shared edge. Flush left gives every icon in a
   column one vertical line, which is the only thing that reads as a grid when
   the cells themselves are invisible. Padding comes from the hairline rule
   below, so the first column sits flush with the tray label. */
.stats-lead .stat-card, .stats-sub .stat-card {
  justify-content: flex-start;
}

.stat-card, .g-card, .skin-tile, .supply-card {
  position: relative;
  min-width: 0;
  transition: transform var(--hover-ms) ease-out, border-color var(--hover-ms) ease-out,
              box-shadow var(--hover-ms) ease-out;
}

/* Owner call 2026-08-15: each item sits in its own outlined box again. An
   outline only - no fill - so the tray still reads as one field of items rather
   than a stack of filled cards. No corner cut here: a clip breaks the outline
   on the diagonal, and on a small box that reads as a damaged border rather
   than a deliberate chamfer. Overview stats stay unboxed - they are a strip,
   not a set of objects. */
.g-card, .skin-tile, .supply-card {
  border: 1px solid var(--card-edge);
  /* Square corners (owner call 2026-08-19). Kept as a real border rather than a
     clip-path chamfer, so all four edges keep their outline - a clip cuts the
     border away on the diagonal, which is what made the notched version look
     broken at this size. */
  border-radius: 0;
  /* Raised, not recessed (owner call 2026-08-15: "like tabs, more 3d"): a lit
     top lip, a dark bottom lip and a soft floor shadow, with the sheen laid over
     the fill so the top third catches light. Hover pushes the whole thing one
     step further off the page. */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 12px 22px -16px rgba(0, 0, 0, 0.9);
  /* The recessed treatment the art well used to have, moved out to the whole
     card (owner call 2026-08-15): one dark plate holding art and caption
     together, rather than a box inside a box. */
  background:
    var(--sheen),
    linear-gradient(180deg, rgba(72, 72, 72, 0.5), rgba(30, 30, 30, 0.92) 64%);
}
.g-card:hover, .skin-tile:hover, .supply-card:hover {
  transform: translateY(-3px);
  border-color: var(--card-edge-hi);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 18px 30px -18px rgba(0, 0, 0, 0.95);
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 0;
}

/* The glyph lost its recessed plate: it now sits inline at low contrast, as a
   marker beside the figure rather than an object in its own frame. */
.stat-art {
  --icon: 28px;
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--stat-ink);
  transition: color var(--hover-ms) ease-out;
}
.stat-card:hover .stat-art { color: var(--stat-ink-hi); }

/* Every overview glyph is the same masked silhouette in one steel tint: the
   colour art is stripped, only the shape survives (owner call 2026-08-11).
   Each source carries a different amount of padding around its own drawing, so
   the box is tuned per icon - what has to match optically is the drawn glyph,
   not the file. Measured glyph coverage: kills 79%, deaths 98% wide by 64%
   tall, K/D 88%, crystal 100%, gold box 58%. */
.stat-ic {
  --m: none;
  --s: 1;
  display: block;
  width: calc(var(--icon) * var(--s));
  height: calc(var(--icon) * var(--s));
  background-color: currentColor;
  -webkit-mask: var(--m) center / contain no-repeat;
  mask: var(--m) center / contain no-repeat;
}
.i-s-kills   { --m: url("../icons/stats/kills.png");       --s: 1.04; }
.i-s-deaths  { --m: url("../icons/stats/deaths.png");      --s: 1.00; }
.i-s-kd      { --m: url("../icons/stats/kd.png");          --s: 0.98; }
.i-s-crystal { --m: url("../icons/stats/crystal_big.png"); --s: 0.84; }
/* The site's outline gold box, the same art the home leaderboard already masks.
   The garage variant (goldbox_game.png) is 55% solid alpha with no internal
   detail, so as a mask it collapses into a featureless slab. */
.i-s-goldbox { --m: url("../icons/stats/goldbox.png");     --s: 1.38; }
/* The game's own effect-indicator bolt, owner-supplied 2026-08-14. Its drawing
   fills 60% of its 40px canvas, so it is scaled up to sit at the same optical
   weight as the rest - the same correction the gold box needs. */
.i-s-supplies { --m: url("../icons/stats/supplies.png");   --s: 1.32; }

.stat-clock svg { display: block; width: calc(var(--icon) * 1.07); height: calc(var(--icon) * 1.07); }

.stat-body { display: flex; flex-direction: column; min-width: 0; }

/* The figures are the product: with the chrome gone they take the space it was
   using rather than the page simply getting shorter. */
.stat-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
}

.stat-label {
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

/* The rating position rides beside its own figure instead of being pinned to the
   cell corner, where it collided with the column hairline (owner call
   2026-08-14). Baseline-aligned, so it reads as a suffix rather than a badge. */
.stat-line {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}

.stat-pos {
  flex: none;
  /* Superscript, not a baseline suffix: it rides at the cap height of the figure
     beside it, the way a rank marker should (owner call 2026-08-14). */
  align-self: flex-start;
  /* line-height:1 collapses its own box to the glyph, otherwise the inherited
     1.5 leaves it tall enough to sit centred against the figure instead of high. */
  line-height: 1;
  margin-top: 1px;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-dim);
}

/* ---------- profile: battle modes (a ranked list, not a card grid) ---------- */

/* Owner call 2026-08-15: one full-width row per mode with a share bar, replacing
   the four-card grid. The list is already ordered by time, so the bars step down
   the page and the split between modes is readable without comparing numbers. */
.modes {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.mode-row {
  --hue: var(--accent-hi);
  position: relative;
  min-width: 0;
}
.mode-dm  { --hue: var(--mode-dm); }
.mode-tdm { --hue: var(--mode-tdm); }
.mode-ctf { --hue: var(--mode-ctf); }
.mode-jgr { --hue: var(--mode-jgr); }

.mode-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
}

/* Battle-type button art from the game's own mode panel. */
.mode-art {
  flex: none;
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.5));
}

.mode-name {
  font-family: var(--font-display);
  font-size: 17.5px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

/* The figures sit at the far end of the row, opposite the name. */
.mode-usage {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 2px 8px;
  margin-left: auto;
  padding-left: 12px;
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  text-align: right;
}
.mode-dot { opacity: 0.55; }

/* The share bar: a dark channel with a lit fill, rounded at both ends so a very
   short bar still reads as a bar rather than a dash. */
.mode-bar {
  position: relative;
  height: 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
/* Held empty from the head script until modebars.js takes over, so the first
   painted frame is already at zero. !important because the width it is beating
   is an inline style written by the template. */
.pre-sweep .mode-fill,
.pre-sweep .xpbar-fill {
  width: 0 !important;
  min-width: 0 !important;
  transition: none !important;
}
/* The figure is hidden for the same handful of milliseconds: otherwise the real
   total is painted, then the script rewrites it to 0, and the count-up looks
   like it counts DOWN first. Hidden rather than blanked, so the line keeps its
   height and nothing reflows when the digits arrive. */
.pre-sweep .xpbar-val,
.pre-sweep .stat-value.is-counted { visibility: hidden; }

/* The sweep is armed by modebars.js only after it has collapsed the bars, so a
   page without that script never transitions and never sits empty. Ease-out, so
   each bar decelerates into its final share rather than stopping dead. */
/* Ease in AND out (owner call 2026-08-16): the old curve started at full speed,
   so the bar was already moving before the eye caught it. This one builds from
   a standstill, runs quickest through the middle, and settles gently. */
#modes.bars-armed .mode-fill {
  transition: width 1500ms cubic-bezier(0.62, 0.02, 0.28, 1);
}

/* A spark riding the leading edge while the bar travels. It lives on the fill's
   right edge, is lit only for the duration of the run, and fades rather than
   snapping off - so a finished bar carries no permanent glow. */
/* The spark rides the leading edge only - the bar itself never glows, so the
   light reads as something travelling rather than the whole bar being lit. */
.mode-fill::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -3px;
  width: 13px;
  height: 13px;
  margin-top: -6.5px;
  border-radius: 50%;
  /* The bar's own end colour, not white: the spark should read as the bar's tip
     glowing, not as a separate object riding on it. */
  background: var(--bar-b);
  box-shadow:
    0 0 10px 4px rgba(var(--bar-glow), 0.95),
    0 0 26px 10px rgba(var(--bar-glow), 0.5),
    0 0 44px 18px rgba(var(--bar-glow), 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 450ms ease-out;
}
#modes.bars-firing .mode-fill::after {
  opacity: 1;
  transition: opacity 120ms ease-in;
}

.mode-fill {
  position: relative;
  display: block;
  height: 100%;
  min-width: 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--bar-a), var(--bar-b));
}

/* ---------- profile: garage trays ---------- */

/* Wide rows scroll inside their own tray, never the page. */
.hscroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 204px;
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 2px 2px 10px;
  scrollbar-width: thin;
  scrollbar-color: #5a5a5a transparent;
}
.hscroll::-webkit-scrollbar { height: 8px; }
.hscroll::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.55);
  border-radius: 999px;
}
.hscroll::-webkit-scrollbar-thumb {
  background: #5a5a5a;
  border-radius: 999px;
}
.hscroll::-webkit-scrollbar-thumb:hover { background: #6b6b6b; }

.g-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 9px;
  padding: 10px 11px 12px;
}

/* The art sits in its own shallow well, like the item slots in the garage. A
   fixed height keeps every card in a row aligned even if a preview is missing. */
/* Owner call 2026-08-15: no well behind the art. The card's own outline is the
   only box, and the item floats on it. The element survives purely as a fixed
   height, which is what keeps every caption in a row on one baseline. */
.g-art, .skin-plate, .supply-art {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
}
/* Each well is sized well clear of the art it holds (owner call 2026-08-14: the
   items were "almost touching the top"). The old boxes left only 8px of total
   slack, so any off-centre transparent padding inside a PNG - and the game art
   is full of it - read as the item riding high. ~32px of slack absorbs it. */
.g-art { width: 100%; height: 138px; }
.supply-art { width: 100%; height: 106px; }
.skin-plate { width: 100%; height: 128px; }

/* Title block, art and figures share rows across the tray (subgrid), so a title that
   wraps to two or three lines no longer pushes its art below the others (owner 2026-10-29). */
.hscroll.g-row { grid-template-rows: auto auto auto; row-gap: 0; }
.g-row .g-card {
  display: grid;
  grid-row: span 3;
  grid-template-rows: subgrid;
  row-gap: 9px;
  justify-items: center;
}
.g-head {
  order: -1;
  align-self: start;
  justify-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.g-row .g-usage { align-self: end; }

/* Augment icons are square badges, not landscape renders. */
.g-aug { width: 106px; height: 106px; }
/* The game's own alteration icons are 64-66px glyphs: shown at 2x on a dark plate
   rather than stretched to the 106px art box. */
.g-aug[src*="augments_game"] {
  width: 84px;
  height: 84px;
  padding: 10px;
  margin: 11px;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.07), rgba(0, 0, 0, 0.35) 75%);
  box-sizing: border-box;
  image-rendering: auto;
}

/* Game preview art is 164x106: native size, never downscaled. */
.g-preview {
  width: 164px;
  height: 106px;
  object-fit: contain;
  filter: drop-shadow(0 5px 9px rgba(0, 0, 0, 0.45));
}

/* Owner call 2026-08-15: the title heads the card from the top left, and the art
   drops below it. Ordered in CSS rather than moved in the template, so the
   markup keeps its reading order - art, name, figures - for screen readers. */
.g-name, .skin-name, .supply-name {
  order: -1;
  align-self: stretch;
  margin-top: 0;
  justify-content: flex-start;
  text-align: left;
  /* Caps as a card heading (owner call 2026-08-15). Uppercase sets wider than
     mixed case, and "Thunder Protection M1" is the longest title on the site -
     size and tracking are set so it still holds one line on a 204px card. */
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
/* A little air under the title before the art starts. */
.g-art, .skin-plate, .supply-art { margin-top: 4px; }

.g-name {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.3;
}
.g-nm { overflow-wrap: anywhere; }

/* Which turret an augment is for. Ordered alongside the title so it sits with it
   at the top of the card, but set as a quiet caption - it identifies the card,
   it is not the card's name. */
.g-for {
  order: -1;
  align-self: stretch;
  margin-top: -5px;
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
}

/* The modification tier, back to plain text after the name ("Wasp M0") in place
   of the mod logo. Secondary to the item name, so it is dimmed rather than
   chipped, and it is omitted on paints, which have no tiers. */
.g-mod {
  flex: none;
  color: var(--mod-ink);
  font-family: var(--font-display);
  font-weight: 700;
}

/* Bigger than it was, and pinned to the card floor so the line sits on one
   baseline across a whole row (owner call 2026-08-11). */
.g-usage {
  display: flex;
  flex-direction: column;
  gap: 3px;
  /* The card centres its children, so the block has to claim the full width
     itself or the rows would only be as wide as their own text. */
  width: 100%;
  margin-top: auto;
  font-family: var(--font-display);
  line-height: 1.25;
  text-align: left;
}
/* One row per figure: label pinned left, figure pinned right, so the two rows
   form a small ledger and the numbers share a right edge (owner call
   2026-08-14). min-width:0 lets a long label shrink rather than push the
   figure out of the card. */
/* Icons replace the written labels (owner call 2026-08-15): a clock for time, an
   XP badge for experience. The words survive for screen readers via .vh and as
   a title tooltip, so nothing is lost - only the repetition on twenty cards. */
.g-stat {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
}
/* A fixed marker column: the clock is square and the XP wordmark is wide, so
   without this the two figures would start at different x and the little ledger
   would lose its left edge. */
.g-key {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  color: var(--stat-ink);
}
/* Both markers are solid shapes now, not outlines: a filled clock face with the
   hands cut out of it, and a filled star for experience. The star is drawn one
   step larger because a star's points make it read smaller than a disc of the
   same box. */
.g-ic { display: block; }
.g-num { flex: none; }
/* Figure and marker share one tint (owner call 2026-08-15), so each row reads as
   a single object rather than a white number with a grey badge beside it. */
.g-num {
  color: var(--stat-ink);
  font-size: 13.5px;
  font-weight: 700;
}

/* A designed empty garage: the same recessed well the trays sit in, with the
   site's own tank mark in the overview icon tint. */
.empty-state {
  display: grid;
  place-items: center;
  padding: 40px 22px 42px;
  text-align: center;
  border: 1px solid var(--tray-edge);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.16));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), inset 0 6px 14px -10px rgba(0, 0, 0, 0.9);
}

.empty-art {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin-bottom: 14px;
  border-radius: 14px;
  color: #8c8c8c;
  background: linear-gradient(180deg, rgba(14, 9, 4, 0.7), rgba(14, 9, 4, 0.4));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), inset 0 2px 7px rgba(0, 0, 0, 0.5);
}

.empty-title { font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.empty-sub { color: var(--text-dim); font-size: 13px; margin-top: 4px; }

/* ---------- profile: skins ---------- */

/* Skins ride the same one-line scroller as the garage trays. The track is sized
   to the 163px native art plus the card's padding - narrower than a garage card,
   which also has to carry a usage line. */
.skins {
  grid-auto-columns: 187px;
}

.skin-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px 11px 12px;
}

/* Art is 163px wide natively: never upscaled, and only allowed to shrink when the
   track itself is narrower than that (two columns on a small phone). */
.skin-art {
  width: 163px;
  max-width: 100%;
  height: 96px;
  object-fit: contain;
  filter: drop-shadow(0 5px 9px rgba(0, 0, 0, 0.45));
}

/* No render for this item+code pair: the old family icon, at its own size. */
.skin-art.is-fallback {
  width: 58px;
  height: 58px;
  filter: drop-shadow(0 4px 7px rgba(0, 0, 0, 0.45));
}

/* The item carries identity, the code rides beside it as a chip - the render
   already says which turret this is, so the name no longer has to work alone. */
.skin-name {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.skin-code {
  flex: none;
  padding: 1px 6px;
  border: 1px solid var(--card-edge-hi);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.45);
  color: var(--stat-ink-hi);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ---------- profile: supplies ---------- */

/* One scrolling row, like the skins (owner 2026-11-30: "make the supplies used a row scrollable"). */
.supplies {
  grid-auto-columns: 170px;
}

.supply-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 11px 12px;
}

.supply-img {
  width: 120px;
  height: 78px;
  object-fit: contain;
  filter: drop-shadow(0 5px 9px rgba(0, 0, 0, 0.45));
}

/* Centred, unlike the garage titles: a supply name is one or two words over a
   wide card, and left-aligning it strands it against the edge. */
.supply-name {
  color: var(--text-dim);
  font-size: 16.5px;
  font-weight: 700;
  text-align: center;
}

.supply-count {
  margin-top: auto;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.15;
}

/* ---------- search + 404 ---------- */

.page-narrow { max-width: 560px; margin-inline: auto; padding-top: 16px; }

.page-title { font-size: 24px; font-weight: 700; margin-bottom: 8px; overflow-wrap: anywhere; }

.page-sub { color: var(--text-dim); margin-bottom: 20px; }

.search-hits { display: flex; flex-direction: column; gap: 8px; }

/* HUD pass 2026-08-14: a hit is a notched plate with an accent spine down its
   leading edge - the same device the battle-mode cards use, at list scale. */
.search-hit {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 12px 20px;
  background: linear-gradient(180deg, var(--panel-glass), rgba(18, 18, 18, 0.85));
  border-radius: var(--radius);
  font-size: 15px;
  transition: transform var(--hover-ms) ease-out, color var(--hover-ms) ease-out,
              box-shadow var(--hover-ms) ease-out;
}
.search-hit::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent-hi), rgba(95, 154, 6, 0.25));
  opacity: 0.75;
  transition: opacity var(--hover-ms) ease-out;
}
.search-hit:hover {
  transform: translateY(-1px);
  color: var(--accent-hi);
  box-shadow: var(--lift);
}
.search-hit:hover::before { opacity: 1; }
.hit-go { color: var(--text-dim); font-size: 18px; line-height: 1; }
.search-hit:hover .hit-go { color: var(--accent-hi); }

/* The 404 gets the page's one notched plate to sit on, so it reads as part of
   the same machine rather than loose text on the background. */
.page-missing {
  position: relative;
  text-align: center;
  margin-top: 26px;
  padding: 40px 26px 34px;
  background: linear-gradient(180deg, var(--panel-glass), rgba(18, 18, 18, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 18px 40px -28px rgba(0, 0, 0, 0.8);
}
.missing-code {
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
  margin-bottom: 10px;
  background: linear-gradient(180deg, #5a5a5a, #1a1a1a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.btn {
  display: inline-block;
  margin-top: 8px;
  padding: 10px 22px;
  background: linear-gradient(180deg, #5f9a06, var(--accent));
  border-radius: var(--radius);
  color: #fff;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 4px 14px -6px rgba(95, 154, 6, 0.7);
}
.btn:hover { background: linear-gradient(180deg, #87d704, #5f9a06); transform: translateY(-1px); }

/* ---------- responsive ---------- */

@media (max-width: 1060px) {
  .modes { grid-template-columns: repeat(2, 1fr); }
  /* No padding here either - a strip of bare well around the canvas is what
     drew the seam at full width, and it would draw it here too. */
  .viewer-well { padding: 0; }
  /* Four columns get tight here and "Gold Box Caught" wraps to two lines. The
     figures stay one size at every width - only the caption tightens. */
  .stat-label { font-size: 10px; letter-spacing: 0.03em; }
}

@media (max-width: 940px) {
  .champs-grid { grid-template-columns: 1fr; }
  .lb-controls { justify-content: center; }
}

@media (max-width: 760px) {
  /* Three columns of figures stop fitting: fall back to two, and rebuild the
     hairlines on the new column boundary instead of the old one. */
  /* Two columns per line, and the size step goes away: at this width a lead
     figure and a support figure can sit side by side, and the mismatch reads as
     a mistake rather than a hierarchy. */
  .stats-lead, .stats-sub { grid-template-columns: repeat(2, 1fr); }
  .stat-card + .stat-card { padding-left: 18px; }
  .stat-card:nth-child(odd) { padding-left: 0; border-left: 0; }
  .stat-card:nth-child(even) { border-left: 1px solid rgba(56, 56, 56, 0.9); }
  .stats-lead .stat-value, .stats-sub .stat-value { font-size: 22px; }
  .stats-sub .stat-art { --icon: 28px; width: 32px; height: 32px; }
  .stats-sub .stat-label { font-size: 11px; }
}

@media (max-width: 640px) {
  /* The tiers compress on a phone, so the art has to shrink with them or it
     would overhang the ordinary rows. */
  .board-rows::before { height: 132px; background-size: auto 132px; }

  .head-inner { gap: 10px; }
  /* The esports site keeps its whole wordmark on a phone, but its masthead has
     no search field to compete with. Ours does, and the full wordmark squeezed
     it to 30px, so the lime word drops here and the mark plus "prime tanki"
     carries the brand - which is what this header did before the masthead
     changed, for the same reason. */
  .brand-name { font-size: 16px; }
  .brand-name b { display: none; }
  .board-head { padding: 12px 14px; }
  .countdown { margin-left: 0; width: 100%; justify-content: center; }
  .row { padding: 9px 12px; gap: 9px; grid-template-columns: 2.1rem 26px minmax(0, 1fr) auto; }

  .panel-head { padding: 12px 15px 11px; }
  .panel-note { margin-left: 0; width: 100%; }
  /* ...but the rating is short enough to stay on the title's line. */
  .viewer-rating { margin-left: auto; width: auto; font-size: 11px; }
  .panel-body { padding: 16px 14px 18px; gap: 24px; }
  .tray-ident { gap: 15px; }
  .ident-row { gap: 15px; }
  .nickname { font-size: 25px; }
  /* Explicit heights, so both rank sets keep the weight they were tuned to:
     width:auto alone would drop each png back to its own intrinsic size
     (74x74 premium, 60x58 default) and the two would stop matching. */
  .badge-wrap { width: 96px; height: 96px; }
  .badge-img { height: 88px; width: auto; }
  .badge-wrap:not(.is-premium) .badge-img { height: 82px; }
}

@media (max-width: 620px) {
  /* Name and figures stop fitting on one line: the figures drop under the name,
     still above the bar, rather than both wrapping into a tangle. */
  .mode-head { flex-wrap: wrap; row-gap: 2px; }
  .mode-name { font-size: 15.5px; }
  .mode-usage {
    width: 100%;
    margin-left: 0;
    padding-left: 40px;
    justify-content: flex-start;
    text-align: left;
    font-size: 13px;
  }
}

@media (max-width: 520px) {
  /* Stack the stat cell so a seven-digit value can never widen the grid - still
     centred, so the phone layout matches the desktop one. */
  .stat-card { flex-direction: column; align-items: center; gap: 6px; padding: 2px 0; }
  .stats-lead .stat-card, .stats-sub .stat-card { padding-inline: 0; }
  .stat-body { align-items: center; text-align: center; }
  .stat-art { --icon: 24px; width: 26px; height: 26px; }
  .stat-value { font-size: 21px; }
  .stat-pos { top: 0; right: 0; }
}

@media (max-width: 420px) {
  /* One mode per row: "Team Deathmatch" and "Capture the Flag" are never
     abbreviated, so they get the full width rather than wrapping in a column. */
  .modes { grid-template-columns: 1fr; }
  :root { --notch: 12px; --notch-sm: 8px; }
  .seg-btn { padding: 8px 11px; }
  .supplies { grid-auto-columns: 140px; }
  .supply-art { height: 92px; }
  .supply-img { width: 100px; height: 65px; }
  .ident-row { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* ---------- motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
  .card-lit:hover, .stat-card:hover, .g-card:hover,
  .skin-tile:hover, .supply-card:hover, .podium-card:hover,
  .search-hit:hover, .btn:hover { transform: none; }
}

/* Augment cards (2026-09-05): the mounted marker beside the turret name, and a
   text label in the usage row where the other cards carry a glyph. */
.g-eq {
  margin-left: 6px;
  color: var(--mod-ink);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.g-key-text {
  margin-right: 6px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- the Battle Fund (owner 2026-11-15) ----------
   Dashboard / Overview: the fund in the middle on the game's own crystal pile, what bought experience paid in on
   the left (gold), who shares it on the right (lime). VectorLab pass 2026-11-16: 8px grid (4px micro), weights
   400/500/600 only, 12px floor, L1 panels with hairlines, no glows, no inner scroll boxes, no motion. */

.i-fund { --m: url("../img/battle-fund-pot.png"); --s: 1.35; }

.fund .board-title { font-weight: 600; }
.fund-head { gap: 8px 16px; }
.fund-when {
  margin-left: auto;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-dim);
}
.fund-when time { color: var(--text); font-weight: 500; }

.fund-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px) minmax(0, 1fr);
}

/* ---- the two lists: L1 (one step up, hairlines) ---- */
.fund-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: rgba(255, 255, 255, 0.025);
}
.fund-in { border-right: 1px solid var(--rule); }
.fund-out { border-left: 1px solid var(--rule); }

.fund-panel-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--rule);
}
.fund-panel-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.fund-in .fund-panel-title { color: var(--gold); }
.fund-out .fund-panel-title { color: var(--accent); }
.fund-panel-meta { font-size: 12px; line-height: 1.4; color: var(--text-faint); }

.fund-list { display: block; }
.fund-row {
  display: grid;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 4px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.fund-row:first-child { border-top: 0; }
.fund-row:hover { background: rgba(255, 255, 255, 0.04); }
.fund-in .fund-row { grid-template-columns: 28px minmax(0, 1fr) auto; }
.fund-out .fund-row { grid-template-columns: 32px 28px minmax(0, 1fr) auto; }

.fund-badge { display: grid; place-items: center; width: 28px; height: 28px; }
.fund-badge img { width: 28px; height: 28px; }

.fund-who {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  min-height: 44px;
}
.fund-name {
  overflow: hidden;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.fund-who:hover .fund-name, .fund-who:focus-visible .fund-name { color: var(--accent-hi); }
.fund-meta { font-size: 12px; line-height: 1.4; color: var(--text-faint); white-space: nowrap; }

.fund-amt {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.fund-amt::after {
  content: "";
  width: 12px;
  height: 13px;
  background: url("../icons/stats/crystal.png") center / contain no-repeat;
}
.fund-amt.is-in { color: var(--gold); }
.fund-amt.is-out { color: var(--accent); }

.fund-pos {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  text-align: center;
}
/* The site's metal medals, with no outer glow: a 2px rail marks the top three. */
.fund-medal {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
  color: #0e0904;
}
.is-top-1 .fund-medal { background: radial-gradient(circle at 32% 28%, #ffe9a3, var(--gold) 58%, #8a6a20); }
.is-top-2 .fund-medal { background: radial-gradient(circle at 32% 28%, #ffffff, var(--silver) 58%, #77808a); }
.is-top-3 .fund-medal { background: radial-gradient(circle at 32% 28%, #ffd2ad, var(--bronze) 58%, #7a4a26); }
.is-top-1 { box-shadow: inset 2px 0 0 var(--gold); }
.is-top-2 { box-shadow: inset 2px 0 0 var(--silver); }
.is-top-3 { box-shadow: inset 2px 0 0 var(--bronze); }

.fund-more {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 16px;
  border-top: 1px solid var(--rule);
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
}
.fund-more:hover { color: var(--accent-hi); }

/* "Find your place" (owner 2026-11-17): the header's search box inside the fighters' panel, the player's row pinned. */
.fund-find { margin-top: 8px; }
.fund-panel-title { scroll-margin-top: 72px; }   /* a #fund-out-title jump lands below the sticky site header */
.fund-find .search-input { padding: 6px 12px; }
.fund-me { border-bottom: 1px solid var(--rule); }
.fund-out .fund-me .fund-row { grid-template-columns: minmax(32px, auto) 28px minmax(0, 1fr) auto; }
.fund-row.is-me { background: rgba(95, 154, 6, 0.12); box-shadow: inset 2px 0 0 var(--accent); }
.fund-row.is-me .fund-pos { color: var(--accent-hi); font-weight: 600; }
.fund-find-note {
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-dim);
}

.fund-none { padding: 24px 16px; }
.fund-none-title { font-size: 14px; font-weight: 600; line-height: 1.25; }
.fund-none-text { margin-top: 8px; font-size: 14px; line-height: 1.5; color: var(--text-dim); max-width: 65ch; }

/* ---- the middle: the number, the pile, the flow, the week ---- */
.fund-core {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 24px 16px;
  text-align: center;
}
.fund-eyebrow {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.fund-total {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  font-size: 48px;
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.fund-total img { width: 36px; height: 33px; }

.fund-flow {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  width: 100%;
  margin-top: 8px;
}
.fund-pot { width: min(100%, 420px); height: auto; }   /* the game's own pile at 1.25x, no more */
.fund-flow-in, .fund-flow-out {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.fund-flow-in { order: -1; justify-self: start; color: var(--gold); }
.fund-flow-out { justify-self: end; color: var(--accent); }
.fund-arrow { width: 40px; height: 12px; flex: none; }

.fund-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  margin-top: 16px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
}
.fund-kpi { padding: 12px 8px; }
.fund-kpi + .fund-kpi { border-left: 1px solid var(--rule); }
.fund-kpi dt { font-size: 12px; line-height: 1.4; color: var(--text-faint); }
.fund-kpi dd { margin: 4px 0 0; font-size: 16px; font-weight: 600; line-height: 1.25; font-variant-numeric: tabular-nums; }

.fund-chart { width: 100%; margin-top: 16px; }
.fund-chart-cap {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: left;
}
.fund-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.fund-grid { fill: none; stroke: rgba(255, 255, 255, 0.08); stroke-width: 1; }
.fund-area { fill: rgba(135, 215, 4, 0.12); }
.fund-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.fund-dot { fill: var(--accent-hi); }
.fund-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-faint);
}
.fund-days li:first-child { text-align: left; }
.fund-days li:last-child { text-align: right; }

/* ---- last week ---- */
.fund-last {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  padding: 16px;
  border-top: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.025);
}
.fund-last-title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.fund-last-sum { font-size: 14px; line-height: 1.5; }
.fund-last-top { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.fund-last-top li { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.fund-last-nick { display: inline-flex; align-items: center; min-height: 44px; }
.fund-last-nick:hover { color: var(--accent-hi); }

/* ---- the closed state ---- */
.fund-empty { padding: 32px 24px; }
.fund-empty-title { font-size: 16px; font-weight: 600; line-height: 1.25; }
.fund-empty-text { margin-top: 8px; font-size: 14px; line-height: 1.5; color: var(--text-dim); max-width: 65ch; }
.fund-cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 16px;
  padding: 0 16px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #0e0904;
  font-size: 14px;
  font-weight: 600;
}

/* medium: the middle on top, the two lists side by side */
@media (max-width: 1279.98px) {
  .fund-stage { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fund-core { grid-column: 1 / -1; order: -1; border-bottom: 1px solid var(--rule); }
  .fund-flow, .fund-kpis, .fund-chart { max-width: 440px; }
}
/* narrow: one column */
@media (max-width: 767.98px) {
  .fund-stage { grid-template-columns: minmax(0, 1fr); }
  .fund-in { border-right: 0; border-bottom: 1px solid var(--rule); }
  .fund-out { border-left: 0; }
  .fund-when { margin-left: 0; width: 100%; }
  .fund-total { font-size: 40px; }
  .fund-core { padding: 24px 16px 16px; }
  /* the key numbers stack: label left, figure right (Dashboard, Narrow) */
  .fund-kpis { grid-template-columns: minmax(0, 1fr); }
  .fund-kpi { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 12px 16px; }
  .fund-kpi + .fund-kpi { border-left: 0; border-top: 1px solid var(--rule); }
  .fund-kpi dd { margin: 0; }
}
