/* 3C Arena — the Light/Dark design system (handoff v2 + v3): the home page (guest + member) and
   the Play, Arena, Tournaments and Rankings tabs. Scoped under #home (<main> on index.html) and
   #tp (<main id="tp"> on each tab page), so nothing here reaches the other pages. Both themes
   are first-class: dark is the base, light is the override under :root[data-theme="light"],
   exactly as style.css already does it site-wide. tabs.css adds the tab pages' own layouts.

   Tokens are the handoff's data/design_tokens.json. Gold stays the primary-action colour in BOTH
   themes (the pack measures onGold/gold at 9.84:1), unlike style.css's --accent, which turns blue
   in light. Type is the project's licensed Montserrat/Source Sans, not the pack's system stack:
   docs/03 says "Prefer existing licensed font". */

:is(#home, #tp) {
  --bg: #080F1B;
  --surface: #111E30;
  --surface-2: #16263B;
  --line: #34465F;
  --ink: #F4F7FC;
  --muted: #B4C1D4;
  --tint: #67B9FF;
  --gold: #F3C34D;
  --on-gold: #182033;
  --self: #3C321A;
  --good: #61DAAB;
  --ring: #83C8FF;
  /* Hero text always sits on the photograph, so it is fixed, not themed. */
  --on-art: #FFFFFF;
  --on-art-soft: #D6DFED;

  --card-pad: 24px;
  --r: 12px;
  --r-sm: 8px;
  --gap: 24px;
}

:root[data-theme="light"] :is(#home, #tp) {
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --surface-2: #EDF2F7;
  --line: #CBD5E1;
  --ink: #101D35;
  --muted: #4F6078;
  --tint: #005BC4;
  --self: #FFF2CC;
  --good: #167048;
  --ring: #005BC4;
}

:is(#home, #tp) {
  display: block;
  background: var(--bg);
  color: var(--ink);
}
:is(#home, #tp) *, :is(#home, #tp) *::before, :is(#home, #tp) *::after { box-sizing: border-box; }
:is(#home, #tp) h1, :is(#home, #tp) h2, :is(#home, #tp) h3, :is(#home, #tp) p { margin: 0; }
:is(#home, #tp) h1 { font-family: var(--display); font-weight: 800; letter-spacing: -.02em; line-height: 1.12; text-wrap: balance; }
:is(#home, #tp) h2 { font-family: var(--display); font-size: 24px; font-weight: 700; line-height: 1.2; text-wrap: balance; }
:is(#home, #tp) h3 { font-family: var(--display); font-size: 19px; font-weight: 700; line-height: 1.25; }
:is(#home, #tp) a { color: var(--tint); }
:is(#home, #tp) img { display: block; max-width: 100%; }
:is(#home, #tp) :focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; }
:is(#home, #tp) [hidden] { display: none !important; }

/* The handoff's 1200px measure, with its 24/20/16 gutters. */
:is(#home, #tp) .h-wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 24px; }
:is(#home, #tp) .h-sec { padding-block: 22px; }
:is(#home, #tp) .h-sec--tight { padding-block: 14px; }
:is(#home, #tp) .h-sec__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 16px; }
:is(#home, #tp) .h-more { font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; }
:is(#home, #tp) .h-more:hover { text-decoration: underline; }
:is(#home, #tp) .h-muted { color: var(--muted); }
:is(#home, #tp) .h-meta { font-size: 14px; color: var(--muted); }

/* ---------- controls ---------- */

:is(#home, #tp) .h-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: 650 15px/1 var(--body); text-decoration: none; cursor: pointer;
}
:is(#home, #tp) .h-btn:hover { background: var(--surface-2); text-decoration: none; }
:is(#home, #tp) .h-btn[disabled], :is(#home, #tp) .h-btn[aria-disabled="true"] { cursor: not-allowed; opacity: .55; }
:is(#home, #tp) .h-btn--primary { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
:is(#home, #tp) .h-btn--primary:hover { background: #FFD470; border-color: #FFD470; }
/* On the hero photograph, not on a themed surface. */
:is(#home, #tp) .h-btn--onart { background: transparent; border-color: #C2D0E2; color: var(--on-art); }
:is(#home, #tp) .h-btn--onart:hover { background: rgba(255, 255, 255, .12); }
:is(#home, #tp) .h-btn--sm { min-height: 38px; padding: 8px 14px; font-size: 14px; }
:is(#home, #tp) .h-btn--wide { width: 100%; }

:is(#home, #tp) .h-ico { width: 20px; height: 20px; flex: none; background: currentColor;
  -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
:is(#home, #tp) .h-ico--lg { width: 28px; height: 28px; }
/* The coin is the game's own gold coin, in its colours, rather than a shape in the text colour. */
:is(#home, #tp) .h-ico.h-i-coin { background: url(brand/coin.png) center / contain no-repeat; -webkit-mask: none; mask: none; }

:is(#home, #tp) .h-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line);
  font-size: 13px; font-weight: 650; color: var(--ink); white-space: nowrap; }
:is(#home, #tp) .h-badge--live { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, transparent); }
:is(#home, #tp) .h-badge--open { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
:is(#home, #tp) .h-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }

/* ---------- hero ---------- */

:is(#home, #tp) .h-hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 340px; display: grid; align-items: center;
  background: #061323 var(--hero-src, url(home/hero-1440.webp)) 62% center / cover no-repeat;
  color: var(--on-art);
}
:is(#home, #tp) .h-hero--member { min-height: 260px; }
/* Keeps the headline legible over the lit end of the photograph, and fades the art into the page. */
:is(#home, #tp) .h-hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(6, 16, 28, .93) 0%, rgba(6, 16, 28, .84) 32%, rgba(6, 16, 28, .30) 62%, rgba(6, 16, 28, 0) 88%),
    linear-gradient(0deg, var(--bg) 0%, rgba(6, 16, 28, 0) 22%);
}
:is(#home, #tp) .h-hero__in { padding-block: 48px; }
:is(#home, #tp) .h-sec:first-of-type { padding-top: 34px; }
:is(#home, #tp) .h-hero h1 { font-size: clamp(32px, 4.4vw, 48px); max-width: 560px; color: var(--on-art); }
:is(#home, #tp) .h-hero p { max-width: 460px; color: var(--on-art-soft); }
:is(#home, #tp) .h-hero__sub { margin-top: 12px; font-size: 18px; }
:is(#home, #tp) .h-hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
:is(#home, #tp) .h-hero__fine { margin-top: 16px; font-size: 14px; color: var(--on-art-soft); }
:is(#home, #tp) .h-hero__logo { display: block; width: auto; height: 128px; margin: 0 0 18px -6px; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .45)); }

/* ---------- guest: mode cards ---------- */

:is(#home, #tp) .h-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
:is(#home, #tp) .h-mode {
  display: flex; align-items: flex-start; gap: 16px; padding: 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  color: inherit; text-decoration: none;
}
:is(#home, #tp) a.h-mode:hover { background: var(--surface-2); text-decoration: none; }
:is(#home, #tp) .h-mode .h-ico { color: var(--ink); }
:is(#home, #tp) .h-mode p { margin-top: 4px; font-size: 14px; color: var(--muted); }

/* ---------- shared layout ---------- */

/* The handoff's ~64/36 content split. */
:is(#home, #tp) .h-split { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr); gap: var(--gap); align-items: start; }
:is(#home, #tp) .h-stack { display: grid; gap: var(--gap); }
:is(#home, #tp) .h-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--card-pad); }
:is(#home, #tp) .h-card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 16px; }

/* ---------- tournaments ---------- */

:is(#home, #tp) .h-tcards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
:is(#home, #tp) .h-tcard { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
:is(#home, #tp) .h-tcard__art { width: 100%; aspect-ratio: 2.7; object-fit: cover; background: var(--surface-2); }
:is(#home, #tp) .h-tcard__body { padding: 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
:is(#home, #tp) .h-tcard__title { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
:is(#home, #tp) .h-facts { display: grid; gap: 8px; font-size: 14px; color: var(--muted); }
:is(#home, #tp) .h-fact { display: flex; align-items: center; gap: 8px; }
:is(#home, #tp) .h-tcard .h-btn { margin-top: auto; }
/* The only tournament: art beside the details across the full column (stacked again on a phone, below). */
:is(#home, #tp) .h-tcard--wide { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
:is(#home, #tp) .h-tcard--wide .h-tcard__art { height: 100%; min-height: 240px; aspect-ratio: auto; object-position: 32% center; }
:is(#home, #tp) .h-tcard--wide .h-tcard__body { padding: 24px; gap: 14px; justify-content: center; }
:is(#home, #tp) .h-tcard--wide .h-facts { font-size: 15px; }
/* No events yet: the hint sits flush under the title, and the button stays its own width. */
:is(#home, #tp) .h-tcard--empty .h-empty { padding: 0; font-size: 15px; line-height: 1.5; }
:is(#home, #tp) .h-tcard--empty .h-btn { margin-top: 6px; align-self: flex-start; }

/* ---------- rankings ---------- */

:is(#home, #tp) .h-board { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
:is(#home, #tp) .h-board th { font-size: 13px; font-weight: 650; color: var(--muted); text-align: left; padding: 0 0 10px; }
:is(#home, #tp) .h-board th:last-child, :is(#home, #tp) .h-board td:last-child { text-align: right; }
:is(#home, #tp) .h-board td { padding: 11px 0; border-top: 1px solid var(--line); }
:is(#home, #tp) .h-board tbody tr:first-child td { border-top: 0; }
:is(#home, #tp) .h-board__rank { width: 34px; color: var(--muted); font-size: 14px; }
:is(#home, #tp) .h-board__who { display: flex; align-items: center; gap: 10px; min-width: 0; }
:is(#home, #tp) .h-board__who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:is(#home, #tp) .h-board__score { font-weight: 700; }
/* The viewer's own row, fetched separately from the page above it. */
:is(#home, #tp) .h-board tr.h-self td { background: var(--self); border-top-color: transparent; }
:is(#home, #tp) .h-board tr.h-self td:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); padding-left: 10px; }
:is(#home, #tp) .h-board tr.h-self td:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; padding-right: 10px; }
:is(#home, #tp) .h-board tr.h-self td { font-weight: 700; }

:is(#home, #tp) .h-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-2); border: 1px solid var(--line); }
:is(#home, #tp) .h-initials { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
  font: 700 13px/1 var(--display); text-transform: uppercase; }
:is(#home, #tp) .h-avatar--lg { width: 64px; height: 64px; }

:is(#home, #tp) .h-tabs { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; }
:is(#home, #tp) .h-tabs button {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  padding: 7px 14px; border-radius: 999px; font: 650 13px/1 var(--body); min-height: 34px;
}
:is(#home, #tp) .h-tabs button[aria-selected="true"] { background: var(--ink); color: var(--bg); }

/* ---------- member: greeting + stats ---------- */

:is(#home, #tp) .h-greet { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding-block: 20px; }
:is(#home, #tp) .h-greet h1 { font-size: clamp(22px, 2.6vw, 28px); }
:is(#home, #tp) .h-greet__side { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }

:is(#home, #tp) .h-stats { display: grid; grid-template-columns: auto repeat(4, minmax(0, 1fr)) minmax(200px, 1.3fr); align-items: center; gap: 0; }
:is(#home, #tp) .h-stat { padding-inline: 20px; border-left: 1px solid var(--line); }
:is(#home, #tp) .h-stat:first-child { border-left: 0; padding-left: 0; }
:is(#home, #tp) .h-stat b { display: block; font-family: var(--display); font-size: 22px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
:is(#home, #tp) .h-stat span { display: block; margin-top: 3px; font-size: 13px; color: var(--muted); }

:is(#home, #tp) .h-tier { display: flex; align-items: center; gap: 12px; padding-right: 20px; }
:is(#home, #tp) .h-tier img { width: 44px; height: 44px; flex: none; }
:is(#home, #tp) .h-tier b { display: block; font-family: var(--display); font-size: 19px; font-weight: 800; }
:is(#home, #tp) .h-tier span { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }

:is(#home, #tp) .h-prog { padding-left: 20px; border-left: 1px solid var(--line); }
:is(#home, #tp) .h-prog__bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
:is(#home, #tp) .h-prog__bar i { display: block; height: 100%; border-radius: 999px; background: var(--tint); }
:is(#home, #tp) .h-prog__nums { margin-top: 6px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
:is(#home, #tp) .h-prog__nums b { color: var(--ink); }

/* ---------- rows (friends, clubs, live, missions) ---------- */

:is(#home, #tp) .h-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
:is(#home, #tp) .h-row:first-child { border-top: 0; padding-top: 0; }
:is(#home, #tp) .h-row__main { min-width: 0; flex: 1; }
:is(#home, #tp) .h-row__main b { display: block; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:is(#home, #tp) .h-row__main span { display: block; font-size: 13px; color: var(--muted); }
:is(#home, #tp) .h-row__end { display: flex; align-items: center; gap: 8px; flex: none; }

:is(#home, #tp) .h-mission { padding: 12px 0; border-top: 1px solid var(--line); }
:is(#home, #tp) .h-mission:first-child { border-top: 0; padding-top: 0; }
:is(#home, #tp) .h-mission__top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
:is(#home, #tp) .h-mission__top b { font-weight: 650; }
:is(#home, #tp) .h-mission__top span { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
:is(#home, #tp) .h-mission progress { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; margin-top: 8px; display: block; border: 0; border-radius: 999px; background: var(--surface-2); }
:is(#home, #tp) .h-mission progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 999px; }
:is(#home, #tp) .h-mission progress::-webkit-progress-value { background: var(--tint); border-radius: 999px; }
:is(#home, #tp) .h-mission progress::-moz-progress-bar { background: var(--tint); border-radius: 999px; }
:is(#home, #tp) .h-mission.is-complete progress::-webkit-progress-value { background: var(--good); }
:is(#home, #tp) .h-mission.is-complete progress::-moz-progress-bar { background: var(--good); }

:is(#home, #tp) .h-streak { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; font-weight: 650; }
:is(#home, #tp) .h-streak img { width: 18px; height: 18px; }

/* ---------- history table ---------- */

:is(#home, #tp) .h-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
:is(#home, #tp) .h-table th { text-align: left; font-size: 13px; font-weight: 650; color: var(--muted); padding: 0 12px 10px 0; }
:is(#home, #tp) .h-table td { padding: 11px 12px 11px 0; border-top: 1px solid var(--line); }
:is(#home, #tp) .h-table th:last-child, :is(#home, #tp) .h-table td:last-child { padding-right: 0; text-align: right; }
:is(#home, #tp) .h-win { color: var(--good); font-weight: 650; }
:is(#home, #tp) .h-loss { color: var(--muted); font-weight: 650; }
:is(#home, #tp) .h-scroll { overflow-x: auto; }
:is(#home, #tp) .h-scroll .h-table { min-width: 560px; }

/* ---------- callout ---------- */

:is(#home, #tp) .h-callout {
  position: relative; isolation: isolate; overflow: hidden; border-radius: var(--r);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px;
  padding: 32px; color: var(--on-art);
  background: #0B1B2E var(--hero-src, url(home/hero-1440.webp)) 75% center / cover no-repeat;
}
:is(#home, #tp) .h-callout::before { content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(8, 18, 32, .95) 0%, rgba(8, 18, 32, .78) 55%, rgba(8, 18, 32, .45) 100%); }
:is(#home, #tp) .h-callout h2 { color: var(--on-art); }
:is(#home, #tp) .h-callout p { margin-top: 6px; color: var(--on-art-soft); }

/* ---------- states: skeleton, empty, error ---------- */

:is(#home, #tp) .h-skel { border-radius: var(--r-sm); background: var(--surface-2); color: transparent; }
:is(#home, #tp) .h-skel--line { height: 12px; margin-block: 8px; }
:is(#home, #tp) .h-skel--card { height: 116px; }
@media (prefers-reduced-motion: no-preference) {
  :is(#home, #tp) .h-skel { animation: h-pulse 1.4s ease-in-out infinite; }
  @keyframes h-pulse { 50% { opacity: .55; } }
}
:is(#home, #tp) .h-empty { padding: 16px 0; color: var(--muted); font-size: 14px; }
:is(#home, #tp) .h-error { padding: 16px 0; font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--muted); }

/* ---------- auth resolution: never flash the wrong state ----------
   The <head> bootstrap sets data-auth to "guest" (no stored session) or "pending" (a token exists,
   so a member page is likely and the shell waits for /v1/me to confirm). app.js then resolves it to
   "guest" or "member". Without JS the attribute stays unset and the guest page shows, which is the
   correct public view. */
:root[data-auth="pending"] #home #guest,
:root[data-auth="guest"] #home #member,
:root[data-auth="member"] #home #guest { display: none; }
:root:not([data-auth="pending"]) #home #resolving { display: none; }
#home #member { display: none; }
:root[data-auth="member"] #home #member { display: block; }
#home #resolving { padding-block: 48px; }

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

@media (max-width: 1023px) {
  :is(#home, #tp) .h-wrap { padding-inline: 20px; }
  :is(#home, #tp) .h-split { grid-template-columns: minmax(0, 1.45fr) minmax(260px, 1fr); }
  :is(#home, #tp) .h-modes { grid-template-columns: 1fr; }
  :is(#home, #tp) .h-stats { grid-template-columns: auto repeat(4, minmax(0, 1fr)); row-gap: 20px; }
  :is(#home, #tp) .h-prog { grid-column: 1 / -1; padding-left: 0; border-left: 0; border-top: 1px solid var(--line); padding-top: 16px; }
}

@media (max-width: 767px) {
  :is(#home, #tp) .h-wrap { padding-inline: 16px; }
  :is(#home, #tp) .h-sec { padding-block: 18px; }
  /* The spec's mobile order for a member: play, stats, tournaments, rankings, then the rest. */
  :is(#home, #tp) .h-split, :is(#home, #tp) .h-tcards { grid-template-columns: 1fr; }
  :is(#home, #tp) .h-tcard--wide { grid-template-columns: 1fr; }
  :is(#home, #tp) .h-tcard--wide .h-tcard__art { height: auto; min-height: 0; aspect-ratio: 2.7; }
  :is(#home, #tp) .h-tcard--wide .h-tcard__body { padding: 16px; }
  :is(#home, #tp) .h-card { padding: 20px; }
  :is(#home, #tp) .h-hero { min-height: 300px; background-position: 68% center; }
  :is(#home, #tp) .h-hero::before { background:
    linear-gradient(90deg, rgba(6, 16, 28, .94) 0%, rgba(6, 16, 28, .82) 62%, rgba(6, 16, 28, .55) 100%),
    linear-gradient(0deg, var(--bg) 0%, rgba(6, 16, 28, 0) 24%); }
  :is(#home, #tp) .h-hero h1 { font-size: 32px; }
  :is(#home, #tp) .h-hero__logo { height: 88px; margin-bottom: 14px; }
  :is(#home, #tp) .h-hero__in { padding-block: 32px; }
  :is(#home, #tp) .h-hero__cta .h-btn { flex: 1 1 200px; min-height: 48px; }
  :is(#home, #tp) .h-btn { min-height: 48px; }
  :is(#home, #tp) .h-stats { grid-template-columns: 1fr 1fr; row-gap: 18px; }
  :is(#home, #tp) .h-tier { grid-column: 1 / -1; padding-right: 0; }
  :is(#home, #tp) .h-stat { padding-inline: 0; border-left: 0; }
  :is(#home, #tp) .h-stat:nth-child(odd) { padding-right: 12px; }
  :is(#home, #tp) .h-stat:nth-child(even) { padding-left: 12px; border-left: 1px solid var(--line); }
  :is(#home, #tp) .h-callout { padding: 24px; }
  :is(#home, #tp) .h-callout .h-btn { width: 100%; }
}

/* 320px and 200% zoom: the tab strip is the one thing that cannot shrink any further. */
@media (max-width: 400px) {
  :is(#home, #tp) .h-tabs { display: flex; width: 100%; }
  :is(#home, #tp) .h-tabs button { flex: 1; padding-inline: 8px; }
  :is(#home, #tp) .h-sec__head { flex-direction: column; align-items: flex-start; }
}

/* ---------- icon classes ----------
   The pack's SVGs are currentColor line art, which an <img> cannot inherit, so they are applied as
   masks over currentColor instead (docs/01 names this as the alternative to inlining). Declaring
   each url() here rather than inline in the HTML keeps every path relative to this stylesheet. */
:is(#home, #tp) .h-i-coin      { --i: url(home/icons/coin.svg); }
:is(#home, #tp) .h-i-computer  { --i: url(home/icons/computer.svg); }
:is(#home, #tp) .h-i-globe     { --i: url(home/icons/globe.svg); }
:is(#home, #tp) .h-i-journey   { --i: url(home/icons/journey.svg); }
:is(#home, #tp) .h-i-learn     { --i: url(home/icons/learn.svg); }
:is(#home, #tp) .h-i-play      { --i: url(home/icons/play.svg); }
:is(#home, #tp) .h-i-players   { --i: url(home/icons/players.svg); }
:is(#home, #tp) .h-i-practice  { --i: url(home/icons/practice.svg); }
:is(#home, #tp) .h-i-wifi      { --i: url(home/icons/wifi.svg); }

/* The browser game is for computers; phones and tablets are sent to the app. style.css sets this
   with a bare class, which ":is(#home, #tp) .h-btn { display: inline-flex }" would otherwise outrank — so
   the same toggle is restated here at matching specificity. */
:is(#home, #tp) .h-btn.for-desktop { display: none; }
@media (hover: hover) and (pointer: fine) {
  :is(#home, #tp) .h-btn.for-desktop { display: inline-flex; }
  :is(#home, #tp) .h-btn.for-touch { display: none; }
}


/* ---------- shrink floors ----------
   A grid or flex child defaults to min-width:auto, i.e. it refuses to shrink below its own
   min-content and overflows the track instead. Every track here is already bounded by the page
   measure, so each child is allowed to shrink and its own text handles the wrapping. */
:is(#home, #tp) .h-split > *, :is(#home, #tp) .h-stack > *, :is(#home, #tp) .h-tcards > *, :is(#home, #tp) .h-modes > *,
:is(#home, #tp) .h-mode > *, :is(#home, #tp) .h-card__head > *, :is(#home, #tp) .h-tcard__title > * { min-width: 0; }
:is(#home, #tp) .h-board__who { min-width: 0; }
/* A handle is untrusted and can be long: it truncates rather than widening the table. */
:is(#home, #tp) .h-board__who a, :is(#home, #tp) .h-board__who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:is(#home, #tp) .h-tcard__title h3, :is(#home, #tp) .h-row__main b { overflow-wrap: anywhere; }
/* The title wraps; its status badge keeps its full width rather than being clipped at the card's edge. */
:is(#home, #tp) .h-tcard__title .h-badge { flex: none; }
