/* DO NOT EDIT — copied from packages/shared/src/design/css/chrome.css
   by `npm run tokens`. Edit the source there, regenerate, commit both.
   A vitest in packages/shared fails if this file drifts from the source. */
/* Shell and page furniture — the layout vocabulary shared by all three
   surfaces. Linked by public/phone (and public/app) after /shared/tokens.css
   and /shared/controls.css; imported directly by apps/desktop/src/index.css
   through the @tdtt/shared exports map. public/landing links tokens.css and
   controls.css only — it has no rail/topbar shell, so it never links this
   file.

   Hand-written, NOT generated. `npm run tokens` COPIES this file to
   apps/server/public/shared/chrome.css so the no-build web surfaces can link
   it. Edit this file, never the copy.

   Every value here comes from tokens.css custom properties. Adding a colour
   means adding it to tokens.ts, not writing a hex literal below. */

/* ── top bar ──────────────────────────────────────────────────────────────
   Search and the user block only. The six-tab nav in the mockups is NOT
   adopted: it is a second taxonomy over the same routes, and navigation
   lives entirely in the rail. */
.tdtt-topbar {
  display: flex; align-items: center; gap: 16px;
  height: 68px; padding: 0 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.tdtt-topbar__spacer { flex: 1; }

.tdtt-logo {
  display: flex; align-items: center; justify-content: center;
  width: 190px; min-height: 68px; padding: 8px 12px;
  background: var(--input);
  border-right: 1px solid var(--border);
}
.tdtt-logo img { max-width: 100%; max-height: 44px; height: auto; width: auto; display: block; }

.tdtt-search {
  position: relative; flex: 0 1 420px; min-width: 0;
}
.tdtt-search input {
  width: 100%; height: 38px; padding: 0 68px 0 36px;
  font-family: var(--body); font-size: 13px; color: var(--text);
  background: var(--input);
  border: 1px solid var(--border); border-radius: 10px;
}
.tdtt-search input::placeholder { color: var(--muted); }
.tdtt-search input:focus {
  outline: none; border-color: var(--border-hi);
  box-shadow: 0 0 0 3px rgb(from var(--cyan) r g b / 0.08);
}
.tdtt-search__icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none; display: flex;
}
.tdtt-search__kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  padding: 3px 7px; font-family: var(--mono); font-size: 10px;
  color: var(--text-dim); background: var(--surface);
  border: 1px solid var(--border); border-radius: 6px; pointer-events: none;
}

.tdtt-userchip {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 10px 5px 5px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
}
.tdtt-userchip__name {
  font-family: var(--body); font-size: 13px; font-weight: 600; color: var(--text);
  line-height: 1.1;
}
.tdtt-userchip__level {
  display: inline-block; margin-top: 2px; padding: 1px 8px;
  font-family: var(--head); font-size: 9px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--text);
  background: var(--grad-primary); border-radius: 999px;
}
/* A second userchip shape: name + a plain sub-line, for a surface with no
   "level" concept (`/app`'s top bar) instead of __level's badge pill. Both
   live here, not per-surface, same reasoning as `.tdtt-logo img` -- one
   control, one implementation, even when only one surface currently uses
   this variant. */
.tdtt-userchip__info { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; min-width: 0; }
.tdtt-userchip__sub {
  font-size: 0.62rem; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px;
}
.tdtt-bell { position: relative; display: flex; color: var(--text-dim); }
.tdtt-bell__dot {
  position: absolute; top: -2px; right: -2px;
  min-width: 15px; height: 15px; padding: 0 4px;
  font-family: var(--body); font-size: 9px; font-weight: 700; line-height: 15px;
  text-align: center; color: var(--text);
  background: var(--magenta); border-radius: 999px;
}

/* Top bar settings gear -- bare icon button, no chip/border. Was a
   Tailwind one-off on desktop and a per-surface rule on /app; one control,
   one implementation, same case as `.tdtt-logo img`. */
.tdtt-gear { display: flex; align-items: center; justify-content: center; color: var(--text-dim); background: none; border: 0; cursor: pointer; }
.tdtt-gear:hover { color: var(--text); }

/* ── rail ─────────────────────────────────────────────────────────────────
   Flat and grouped: every destination visible at once, no accordion. The
   --icons variant collapses to glyphs on card-browse pages so the facet
   column has room; navigation never disappears entirely. */
.tdtt-rail {
  display: flex; flex-direction: column; gap: 18px;
  width: 190px; flex: none; padding: 18px 10px;
  background: var(--bg); border-right: 1px solid var(--border);
  overflow-y: auto;
}
.tdtt-rail--icons { width: 64px; padding: 18px 8px; }
.tdtt-rail--icons .tdtt-railgroup__label,
.tdtt-rail--icons .tdtt-railitem__label { display: none; }
.tdtt-rail--icons .tdtt-railitem { justify-content: center; padding: 0; }
.tdtt-rail--icons .tdtt-railitem__chev { display: none; }

.tdtt-railgroup { display: flex; flex-direction: column; gap: 3px; }
.tdtt-railgroup__label {
  padding: 0 10px 6px;
  font-family: var(--head); font-size: 10px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}

/* Icon colour comes from the PILLAR, set by the renderer as --ac. There is no
   per-item palette: Leaderboard and Local Shops are both colosseum magenta. */
.tdtt-railitem {
  display: flex; align-items: center; gap: 11px;
  height: 40px; padding: 0 10px;
  font-family: var(--body); font-size: 13.5px; font-weight: 600;
  color: var(--text-dim); text-decoration: none;
  border-radius: 10px; border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.tdtt-railitem__icon { display: flex; flex: none; color: var(--ac, var(--text-dim)); }
.tdtt-railitem__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tdtt-railitem__chev { flex: none; opacity: 0; transition: opacity 0.15s; }
.tdtt-railitem:hover { color: var(--text); background: var(--surface); border-color: var(--border); }

/* Active is a GRADIENT-FILLED PILL with a right chevron -- the one place the
   brand gradient is used outside a primary CTA, and deliberately so: it marks
   where you are, which is a singular state per surface. */
.tdtt-railitem.on {
  color: var(--text);
  background: var(--grad-primary);
  border-color: transparent;
}
.tdtt-railitem.on .tdtt-railitem__icon { color: var(--text); }
.tdtt-railitem.on .tdtt-railitem__chev { opacity: 1; }

.tdtt-rail__footer { margin-top: auto; display: flex; flex-direction: column; gap: 3px; }
.tdtt-railitem--outline {
  color: var(--cyan); border-color: var(--border-hi); background: var(--input);
}
.tdtt-railitem--outline .tdtt-railitem__icon { color: var(--cyan); }
.tdtt-railitem--danger { color: var(--red); }
.tdtt-railitem--danger .tdtt-railitem__icon { color: var(--red); }

/* ── right rail ───────────────────────────────────────────────────────────
   Contextual per page, ending in an artwork promo card. */
.tdtt-aside {
  display: flex; flex-direction: column; gap: 14px;
  width: 330px; flex: none; padding: 18px 16px 24px 0;
  overflow-y: auto;
}
.tdtt-asidecard {
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px;
}
.tdtt-asidecard__head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
  font-family: var(--head); font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text);
}
.tdtt-asidecard__head .tdtt-asidecard__icon { color: var(--ac, var(--cyan)); display: flex; }
.tdtt-asidecard__more {
  margin-left: auto; font-family: var(--body); font-size: 11px; font-weight: 600;
  letter-spacing: 0; text-transform: none; color: var(--cyan); text-decoration: none;
}

/* ── shell layout ─────────────────────────────────────────────────────── */
.tdtt-shell { display: flex; flex-direction: column; height: 100%; background: var(--bg); }
.tdtt-shell__body { display: flex; flex: 1; min-height: 0; }
.tdtt-shell__main { flex: 1; min-width: 0; padding: 18px 16px 24px; overflow-y: auto; }

@media (max-width: 1023px) {
  .tdtt-rail, .tdtt-aside { display: none; }
}

/* ── banner ───────────────────────────────────────────────────────────────
   Procedural, not photographic -- no banner art is sourced. It composites
   back to front: a pillar-tinted radial wash, the hex lattice, a scanline
   pass, an oversized ghosted glyph, the hand-script overlay, a vignette.
   Layers are the point; a flat dark plate is not this design.

   --banner-image is an OPTIONAL escape hatch. If banner art is ever exported,
   adopting it is one custom property per page, not a rebuild. */
.tdtt-banner {
  position: relative; isolation: isolate; overflow: hidden;
  padding: 30px 32px;
  border: 1px solid var(--border); border-radius: 18px;
  background:
    radial-gradient(120% 140% at 82% 18%,
      rgb(from var(--ac, var(--cyan)) r g b / 0.28) 0%, transparent 62%),
    linear-gradient(160deg, var(--surface) 0%, var(--bg) 72%);
}
/* --banner-image (optional future art) on top, then the scanline pass, then
   the six gradients that tile into a hex lattice. The lattice geometry is
   copied from the app's existing `.bf-hex-lattice` utility so the banner's
   texture matches the page texture behind it; only the colour differs, being
   derived from a token here rather than a hex literal. */
.tdtt-banner::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    var(--banner-image, none),
    repeating-linear-gradient(0deg, rgb(from var(--cyan) r g b / 0.05) 0 1px, transparent 1px 3px),
    linear-gradient(30deg, rgb(from var(--cyan) r g b / 0.07) 12%, transparent 12.5%, transparent 87%, rgb(from var(--cyan) r g b / 0.07) 87.5%, rgb(from var(--cyan) r g b / 0.07)),
    linear-gradient(150deg, rgb(from var(--cyan) r g b / 0.07) 12%, transparent 12.5%, transparent 87%, rgb(from var(--cyan) r g b / 0.07) 87.5%, rgb(from var(--cyan) r g b / 0.07)),
    linear-gradient(30deg, rgb(from var(--cyan) r g b / 0.07) 12%, transparent 12.5%, transparent 87%, rgb(from var(--cyan) r g b / 0.07) 87.5%, rgb(from var(--cyan) r g b / 0.07)),
    linear-gradient(150deg, rgb(from var(--cyan) r g b / 0.07) 12%, transparent 12.5%, transparent 87%, rgb(from var(--cyan) r g b / 0.07) 87.5%, rgb(from var(--cyan) r g b / 0.07)),
    linear-gradient(60deg, rgb(from var(--cyan) r g b / 0.05) 25%, transparent 25.5%, transparent 75%, rgb(from var(--cyan) r g b / 0.05) 75%, rgb(from var(--cyan) r g b / 0.05)),
    linear-gradient(60deg, rgb(from var(--cyan) r g b / 0.05) 25%, transparent 25.5%, transparent 75%, rgb(from var(--cyan) r g b / 0.05) 75%, rgb(from var(--cyan) r g b / 0.05));
  background-size: cover, auto, 44px 76px, 44px 76px, 44px 76px, 44px 76px, 44px 76px, 44px 76px;
  background-position: center, 0 0, 0 0, 0 0, 22px 38px, 22px 38px, 0 0, 22px 38px;
  opacity: 0.85;
}
/* vignette */
.tdtt-banner::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(120% 100% at 50% 40%, transparent 40%,
    rgb(from var(--bg) r g b / 0.75) 100%);
}
.tdtt-banner__eyebrow {
  font-family: var(--head); font-size: 12px; font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--ac, var(--cyan));
}
.tdtt-banner__title {
  margin: 6px 0 0;
  font-family: var(--display); font-size: clamp(38px, 5vw, 64px);
  font-weight: 400; line-height: 0.95; letter-spacing: 0.02em;
  text-transform: uppercase; color: var(--text);
}
.tdtt-banner__accent { color: var(--magenta); }
.tdtt-banner__sub {
  margin: 10px 0 0; max-width: 56ch;
  font-family: var(--body); font-size: 14.5px; color: var(--text-dim);
}
.tdtt-banner__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
/* The hand-lettered overlay. Bangers on a slight rotation, magenta, low
   priority in the reading order -- decoration, not information. */
.tdtt-banner__script {
  position: absolute; right: 30px; bottom: 22px; z-index: -1;
  transform: rotate(-8deg);
  font-family: var(--comic); font-size: clamp(20px, 2.4vw, 34px); line-height: 0.9;
  letter-spacing: 0.02em; text-align: right; color: var(--magenta);
  text-shadow: 0 0 22px rgb(from var(--magenta) r g b / 0.55);
  pointer-events: none; user-select: none;
}
@media (max-width: 900px) { .tdtt-banner__script { display: none; } }
/* The oversized ghosted glyph. Each page supplies its own mark as the element's
   content; this only positions and fades it. Sits at z-index -1 like the other
   decorative layers, so it never paints over the headline. */
.tdtt-banner__glyph {
  position: absolute; right: 6%; top: 50%; z-index: -1;
  transform: translateY(-50%);
  font-family: var(--display); font-size: clamp(140px, 20vw, 300px); line-height: 1;
  color: rgb(from var(--ac, var(--cyan)) r g b / 0.10);
  pointer-events: none; user-select: none;
}
@media (max-width: 900px) { .tdtt-banner__glyph { display: none; } }

/* ── stat tile row ────────────────────────────────────────────────────────
   The row of figures under a page banner. `.tdtt-stat` alone (controls.css)
   is a bare value/label/underline for dense contexts; INSIDE `.tdtt-statrow`
   the same element becomes a boxed tile with an icon, an accent tint and a
   dotted texture.

   Per-tile accent is deliberate and does not contradict `.tdtt-stat`'s
   "not a rainbow" note: that warns against colouring tiles arbitrarily,
   while these carry DIFFERENT metrics and the accent is what tells them
   apart. It still arrives through the existing `--sec-accent`, so
   `StatTile`'s `accent` prop drives it unchanged.

   Grid rather than flex so the child list stays FLAT (.i/.v/.l/.u) and no
   wrapper element is needed -- `StatTile` emits those children directly, and
   requiring a new wrapper would break every existing caller. `min-content`
   on the icon column collapses to zero when a tile has no `.i`, so the icon
   is optional without a second rule. */
.tdtt-statrow {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin: 16px 0;
}
.tdtt-statrow .tdtt-stat {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; align-items: center;
  grid-template-columns: min-content 1fr;
  grid-template-areas: 'icon value' 'icon label';
  column-gap: 12px; row-gap: 2px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px;
}
/* dotted texture, tinted by the tile's own accent */
.tdtt-statrow .tdtt-stat::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(
    rgb(from var(--sec-accent, var(--cyan)) r g b / 0.22) 1px, transparent 1px);
  background-size: 7px 7px;
  opacity: 0.5;
}
/* accent wash from the leading edge */
.tdtt-statrow .tdtt-stat::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(
    100deg, rgb(from var(--sec-accent, var(--cyan)) r g b / 0.16), transparent 62%);
}
.tdtt-statrow .tdtt-stat .i {
  grid-area: icon;
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 11px;
  color: var(--sec-accent, var(--cyan));
  background: rgb(from var(--sec-accent, var(--cyan)) r g b / 0.12);
}
.tdtt-statrow .tdtt-stat .v {
  grid-area: value;
  font-size: 1.5rem; color: var(--sec-accent, var(--text));
}
.tdtt-statrow .tdtt-stat .l { grid-area: label; font-size: 0.58rem; color: var(--text-dim); }
/* The bare variant's underline is redundant once the tile has a box and a
   tint, and it would sit awkwardly across the grid. */
.tdtt-statrow .tdtt-stat .u { display: none; }

/* ── content panel ────────────────────────────────────────────────────── */
.tdtt-panel {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px;
}
.tdtt-panel__head {
  display: flex; align-items: center; gap: 9px; margin-bottom: 12px;
  font-family: var(--head); font-size: 12px; font-weight: 700;
  letter-spacing: 0.11em; text-transform: uppercase; color: var(--text);
}
.tdtt-panel__icon { color: var(--ac, var(--cyan)); display: flex; }
.tdtt-panel__more {
  margin-left: auto; font-family: var(--body); font-size: 11.5px; font-weight: 600;
  letter-spacing: 0; text-transform: none; color: var(--cyan); text-decoration: none;
}

/* ── tabs (underline blade) ───────────────────────────────────────────────
   Distinct from .seg-slab on purpose: a slab segment is a MODE switch and
   fills solid; a tab is a SECTION switch within one subject and underlines. */
.tdtt-tabs {
  display: flex; gap: 4px; overflow-x: auto;
  border-bottom: 1px solid var(--border); scrollbar-width: none;
}
.tdtt-tabs::-webkit-scrollbar { display: none; }
.tdtt-tabs__tab {
  position: relative; flex: none;
  padding: 12px 16px 13px;
  font-family: var(--body); font-size: 13.5px; font-weight: 600;
  color: var(--text-dim); background: none; border: 0; cursor: pointer;
  white-space: nowrap;
}
.tdtt-tabs__tab:hover { color: var(--text); }
.tdtt-tabs__tab.on { color: var(--cyan); }
.tdtt-tabs__tab.on::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px;
  height: 2px; background: var(--cyan); border-radius: 2px;
  box-shadow: 0 0 10px rgb(from var(--cyan) r g b / 0.7);
}

/* ── buttons ──────────────────────────────────────────────────────────────
   Four variants, no fifth. --primary is the ONE main action on a page and is
   the only button carrying the brand gradient. Home's three coloured CTAs are
   --accent with an explicit --ac override, not three bespoke buttons. */
.tdtt-btn {
  display: inline-flex; align-items: center; gap: 9px;
  min-height: 42px; padding: 0 18px;
  font-family: var(--head); font-size: 12.5px; font-weight: 700;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--text); text-decoration: none; cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: 11px;
  transition: filter 0.15s, border-color 0.15s, background 0.15s;
}
.tdtt-btn:hover { filter: brightness(1.12); }
.tdtt-btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.tdtt-btn[disabled] { opacity: 0.45; cursor: not-allowed; filter: none; }
.tdtt-btn__sub {
  display: block; margin-top: 2px;
  font-family: var(--body); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0; text-transform: none; color: rgb(from var(--text) r g b / 0.72);
}
.tdtt-btn--primary {
  background: var(--grad-primary); border-color: transparent;
  box-shadow: 0 0 22px rgb(from var(--magenta) r g b / 0.32);
}
.tdtt-btn--accent {
  background: var(--ac, var(--cyan)); border-color: transparent; color: var(--bg);
}
.tdtt-btn--accent .tdtt-btn__sub { color: rgb(from var(--bg) r g b / 0.75); }
.tdtt-btn--ghost { background: transparent; border-color: var(--border-hi); color: var(--cyan); }
.tdtt-btn--danger { background: transparent; border-color: var(--red); color: var(--red); }

/* ── facet column ─────────────────────────────────────────────────────── */
.tdtt-facets {
  display: flex; flex-direction: column; gap: 18px;
  width: 260px; flex: none; padding-right: 4px; overflow-y: auto;
}
.tdtt-facets__group { display: flex; flex-direction: column; gap: 4px; }
.tdtt-facets__label {
  padding-bottom: 6px;
  font-family: var(--head); font-size: 10px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.tdtt-facets__row {
  display: flex; align-items: center; gap: 9px;
  height: 34px; padding: 0 10px;
  font-family: var(--body); font-size: 12.5px; color: var(--text-dim);
  background: var(--input); border: 1px solid transparent;
  border-left: 3px solid var(--ac, var(--border-hi)); border-radius: 8px;
  cursor: pointer; text-decoration: none;
}
.tdtt-facets__row:hover { color: var(--text); background: var(--surface); }
.tdtt-facets__row.on { color: var(--text); background: var(--surface-2); border-color: var(--border-hi); }
.tdtt-facets__count { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--muted); }
@media (max-width: 1599px) { .tdtt-facets { display: none; } }

/* ── detail overlay ───────────────────────────────────────────────────────
   ONE primitive, two contents: the Dice Throne character detail and the TCG
   card modal are the same interaction. Behaviour (Esc, browser-back, focus
   trap, focus restore, prev/next) belongs to the JS that renders this. */
.tdtt-overlay {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 4vh 16px;
  background: rgb(from var(--bg) r g b / 0.82);
  backdrop-filter: blur(6px);
  overflow-y: auto;
}
.tdtt-overlay__panel {
  position: relative; width: 100%; max-width: 1180px;
  background: var(--surface);
  border: 1px solid var(--border-hi); border-radius: 18px;
  box-shadow: 0 30px 90px rgb(from var(--bg) r g b / 0.9);
}
.tdtt-overlay__close {
  position: absolute; top: 14px; right: 14px; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  color: var(--text); background: var(--input);
  border: 1px solid var(--border-hi); border-radius: 11px; cursor: pointer;
}
.tdtt-overlay__close:hover { color: var(--magenta); border-color: var(--magenta); }
.tdtt-overlay__close:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* ── card grid + tile ─────────────────────────────────────────────────── */
.tdtt-cardgrid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
}
.tdtt-cardtile {
  position: relative; display: block; overflow: hidden;
  background: var(--input);
  border: 1px solid var(--border); border-radius: 12px;
  cursor: pointer; text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.tdtt-cardtile:hover { border-color: var(--border-hi); transform: translateY(-2px); }
.tdtt-cardtile img { display: block; width: 100%; height: auto; }
.tdtt-cardtile__band {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 6px 8px;
  font-family: var(--head); font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--text);
  background: linear-gradient(to top, rgb(from var(--bg) r g b / 0.94), transparent);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── ranked table ─────────────────────────────────────────────────────────
   Replaces the podium. The 32px first-column gutter is load-bearing: it keeps
   a long name's ellipsis clear of the medal glyph. */
/* `table-layout: fixed` is load-bearing, not tidiness: without it a td sizes
   to its content, so `text-overflow` has nothing to overflow and a long name
   widens the row instead of truncating. Fixed layout also makes the declared
   32px rank gutter actually hold. Mirrors what `.tdtt-rank-row .who`/`.nm` do
   for the flex twin in controls.css. */
.tdtt-table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.tdtt-table th {
  padding: 10px 12px; text-align: left;
  font-family: var(--head); font-size: 10px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.tdtt-table td {
  padding: 11px 12px;
  font-family: var(--body); font-size: 13.5px; color: var(--text);
  border-bottom: 1px solid rgb(from var(--border) r g b / 0.6);
}
.tdtt-table th:first-child, .tdtt-table td:first-child { width: 32px; padding-left: 14px; }
.tdtt-table tbody tr:hover td { background: var(--surface-2); }
.tdtt-table tbody tr.tdtt-table__medal td {
  background: linear-gradient(90deg, rgb(from var(--ac, var(--gold)) r g b / 0.16), transparent 55%);
}
/* Ranks 2 and 3 want a dimmer accent than rank 1's gold. The rule above only
   pulls the r/g/b channels out of `--ac` and always reapplies a fixed 0.16
   alpha, so an alpha baked into `--ac` itself (e.g. a caller setting
   `--ac: rgb(from var(--gold) r g b / 0.6)`) has NO visible effect through
   that formula alone -- all three ranks would render identically. There is
   no silver/bronze token in the palette, so ranks 2 and 3 override the
   background directly here, reusing --gold at a lower alpha instead of
   inventing a colour. Selected via `data-rank` (set by the caller alongside
   `--ac`) rather than `:nth-child`, since a caller may render fewer than
   three ranked rows and nth-child would tint whatever row happens to be
   second or third. */
.tdtt-table tbody tr.tdtt-table__medal[data-rank="2"] td {
  background: linear-gradient(90deg, rgb(from var(--gold) r g b / 0.10), transparent 55%);
}
.tdtt-table tbody tr.tdtt-table__medal[data-rank="3"] td {
  background: linear-gradient(90deg, rgb(from var(--gold) r g b / 0.06), transparent 55%);
}
/* Player cell: pairs `.tdtt-avatar` (a flex container itself, so it lays out
   as a block box) with `.tdtt-table__name` (also display:block) side by
   side -- without this wrapper the two would stack vertically inside the
   <td> instead. This is NOT the `.tdtt-table__name` element itself, so it
   doesn't conflict with that class's own "never on the <td>" rule; it's the
   ordinary flex row around the avatar + name pair every caller needs, so it
   lives here rather than being reinvented per surface. `min-width: 0` is
   load-bearing: a flex item defaults to `min-width: auto`, which refuses to
   shrink below its content's width, so `.tdtt-table__name`'s
   `text-overflow: ellipsis` never gets the chance to engage without it --
   the exact same reasoning `.tdtt-rank-row .who` documents in controls.css. */
.tdtt-table__player { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tdtt-table__player .tdtt-table__name { flex: 1 1 auto; min-width: 0; }
/* The player column is the only one carrying a value of unbounded length, so
   it is the only one that truncates. Everything else is a short number. */
.tdtt-table__name {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tdtt-table__num { width: 84px; text-align: right; font-family: var(--mono); }
/* Win-rate band colours. Reuses the exact `.rec.good/.even/.bad` vocabulary
   controls.css defines for the hero strip (identical green/gold/red mapping)
   rather than inventing a parallel one -- a caller adds `rec` alongside the
   band name to the SAME `.tdtt-table__num` <td> the value already lives in.
   A new selector is still needed (not just reusing `.tdtt-hero-strip .rec.
   good` as-is): that rule requires a `.tdtt-hero-strip` ancestor around a
   nested `.rec` span, but the ranked table's win-rate value sits directly on
   the `.tdtt-table__num` <td> itself -- required by the fixed-column-width
   contract above, which needs that class on both the <th> and the <td>. */
.tdtt-table__num.rec.good { color: var(--green); }
.tdtt-table__num.rec.even { color: var(--gold); }
.tdtt-table__num.rec.bad  { color: var(--red); }

/* "Show my place" / "your row" highlight — the `.tdtt-rank-row.me` equivalent
   for the table. Originated in apps/server/public/app/leaderboard.css; moved
   here (2026-09-10, Task 6 fix round) because desktop renders this same table
   in React with Tailwind rather than mirroring page-local CSS, and phone/
   landing render it too — four surfaces reaching for "my row" independently
   is exactly what promoting a shared class prevents. Declarations are the
   shipped, reviewed `/app` version, unchanged.

   KNOWN TRADE-OFF, left as-is: this selector and `.tdtt-table__medal td`
   above have equal specificity (0-2-1 vs 0-2-1), so `.me` wins on source
   order (declared after). A signed-in player who is ALSO in the top three
   loses their medal tint in favour of the `.me` tint. Noticed on `/app` and
   deliberately deferred there as a rare, real edge case — not fixed here
   either, now documented where the rule actually lives instead of only in
   that page's own history. */
.tdtt-table tbody tr.tdtt-table__row.me td {
  background: color-mix(in srgb, var(--sec-accent, var(--cyan)) 10%, var(--surface));
}

/* ── pager ────────────────────────────────────────────────────────────── */
.tdtt-pager { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 18px 0; }
.tdtt-pager__page {
  min-width: 36px; height: 36px; padding: 0 10px;
  font-family: var(--body); font-size: 13px; font-weight: 600; color: var(--text-dim);
  background: var(--input); border: 1px solid var(--border); border-radius: 9px; cursor: pointer;
}
.tdtt-pager__page:hover { color: var(--text); border-color: var(--border-hi); }
.tdtt-pager__page.on { color: var(--bg); background: var(--cyan); border-color: transparent; }
.tdtt-pager__page[disabled] { opacity: 0.4; cursor: not-allowed; }
