/*
 * TAG Legal Desk v2.1, J144: "Just for fun" in Stats (js\v21_fun.js), the Badge Book's groups (js\v21_badges.js) and
 * the fun lines in the trophy room (js\v21_trophy.js). The desk's own tokens and glass only, so Light, Dark, Night
 * Shift, Eucalypt, Harbour and High contrast all follow; numbers use tabular figures. Nothing here moves, so reduced
 * motion and Calm need nothing more. Welfare first: while the core marks the page data-quiet every piece hides.
 * Fresh prefixes: v21fn- (fun) and v21bk- (the book's groups); nothing here restyles another package's classes.
 */

:root[data-quiet="on"] .v21fn,
:root[data-quiet="on"] .v21fn-trophy { display: none !important; }

/* ---------- Stats: Just for fun ---------- */
.v21fn { display: grid; gap: 16px; min-width: 0; }
.v21fn-intro, .v21fn-own, .v21fn-team { margin: 0; max-width: 72ch; }
.v21fn-team { font-weight: 600; }
.v21fn-you { display: grid; gap: 10px; padding: 16px; border-radius: var(--r-card); min-width: 0; }
.v21fn-h { margin: 0; font-size: .875rem; line-height: 1.25rem; font-weight: 700; color: var(--ink-2); }
.v21fn-lines { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px 20px; }
.v21fn-line { display: grid; gap: 2px; min-width: 0; }
.v21fn-words { overflow-wrap: anywhere; }
.v21fn-big { font-family: var(--font-num, inherit); font-variant-numeric: tabular-nums; font-size: 1.375rem; line-height: 1.75rem; font-weight: 750; color: var(--brand-text); }
.v21fn-sub { display: block; }
.v21fn-table td { min-width: 96px; }

/* ---------- the Badge Book's groups ---------- */
.v21bk-groups { display: grid; gap: 16px; min-width: 0; }
.v21bk-group { display: grid; gap: 8px; min-width: 0; }
.v21bk-group-h { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; font-size: .875rem; line-height: 1.25rem; font-weight: 700; color: var(--ink-2); }
.v21bk-group-n { font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---------- the trophy room's fun lines ---------- */
.v21fn-trophy { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 16px; }
.v21fn-trophy li { display: grid; gap: 0; min-width: 0; }
.v21fn-trophy .v21fn-tv { font-family: var(--font-num, inherit); font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); }

/* ---------- High contrast and forced colours ---------- */
:root[data-theme="high_contrast"] .v21fn-big,
:root[data-theme="high_contrast"] .v21fn-trophy .v21fn-tv { color: #000000; }
:root[data-theme="high_contrast"] .v21fn-you { background: #FFFFFF; border: 2px solid #000000; box-shadow: none; }
@media (forced-colors: active) {
  .v21fn-you { border: 1px solid CanvasText; }
  .v21fn-big, .v21fn-trophy .v21fn-tv { color: CanvasText; }
}

/* ---------- narrow screens: nothing scrolls sideways but the framed table ---------- */
@media (max-width: 480px) {
  .v21fn-lines { grid-template-columns: minmax(0, 1fr); }
  .v21fn-you { padding: 12px; }
}
