/* =================================================================================================
   admin.css: the account app of /login, /dashboard and /admin (DESIGN §15.7; UIKIT 1-8, 20-23, 28,
   29; boards dashboard-login.png and dashboard-admin.png). Owner: dashboard slot (CONTRACTS.md).

   kit.css (loaded first) draws the components: .k-panel (+ --slop), .k-key, .k-field, .k-seg,
   .k-switch, .k-tube, .k-tile, .k-row, .k-alert, .k-toast, .k-bars, .k-table, .k-lcdmap, .k-regions,
   .k-avatar. This file lays them out and dresses the admin analytics views in the same tokens
   (void #0C0716 page, goo #4BEA3C, goo-3 #A6FF6B; Gluten titles, Fredoka text, Martian Mono only
   inside the LCD map). portal-entry.js enables it on the account routes only.

   The page is see-through: the thin renderer paints the void behind #dashboard-shell
   (entry/thin.js) and the goo drips of [data-paint] panels; the body gradient is the void's CSS
   stand-in (no WebGPU, the boot frame, forced colours).
   ================================================================================================= */

/* 1. Page ---------------------------------------------------------------------------------------- */
html.dashboard-active {
  --dash-max: 1438px;
  --dash-gutter: var(--gutter, 36px);
  scroll-padding-top: 24px;
}
html.dashboard-active body {
  min-width: 320px;
  margin: 0;
  color: var(--text, #E8DDF7);
  font: 400 16px/1.5 var(--f-body, 'Fredoka', system-ui, sans-serif);
  background:
    radial-gradient(ellipse 58% 42% at 20% -6%, var(--glow-core, #2A1450), transparent 72%),
    radial-gradient(ellipse 60% 46% at 86% 104%, var(--glow-mid, #170C2B), transparent 74%),
    var(--void-0, #0C0716);
  -webkit-font-smoothing: antialiased;
}
#dashboard-shell {
  color: var(--text);
  background: transparent;
  font-family: var(--f-body, 'Fredoka', system-ui, sans-serif);
}
/* zero specificity: kit classes and the rules below always win */
:where(#dashboard-shell) :where(h1, h2, h3, h4, p, ul, ol, figure) { margin: 0; }

/* 2. App bar: the small wordmark (36 size) + Sign out · Back to games -------------------------- */
.masthead {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: calc(var(--dash-max) + 2 * var(--dash-gutter));
  margin: 0 auto;
  padding: max(26px, calc(env(safe-area-inset-top, 0px) + 12px))
    max(var(--dash-gutter), calc(env(safe-area-inset-right, 0px) + 8px)) 18px
    max(var(--dash-gutter), calc(env(safe-area-inset-left, 0px) + 8px));
}
.brand { display: inline-flex; flex: 0 1 auto; min-width: 0; border-radius: 12px; line-height: 0; }
.brand__mark { display: block; width: 285px; max-width: 100%; height: auto; }
.brand:focus { outline: none; }
.brand:focus-visible { box-shadow: var(--k-ring); }
#header-actions { display: flex; flex: none; align-items: center; justify-content: flex-end; gap: 14px; }

/* 3. The app column and its layouts --------------------------------------------------------------- */
#app {
  box-sizing: border-box;
  width: 100%;
  max-width: calc(var(--dash-max) + 2 * var(--dash-gutter));
  margin: 0 auto;
  padding: 10px max(var(--dash-gutter), calc(env(safe-area-inset-right, 0px) + 8px)) 36px
    max(var(--dash-gutter), calc(env(safe-area-inset-left, 0px) + 8px));
}
#dashboard-shell .loading { display: grid; place-items: center; min-height: 52vh; }
/* the loader shows only when the session check takes a while (DESIGN §10: loader after 300 ms) */
#dashboard-shell .loading .k-loader { animation: k-fade-in 160ms linear 300ms both; }

.dash-layout { display: grid; gap: 28px; align-items: start; }
.dash-layout--player { max-width: 640px; margin: 0 auto; }
.dash-layout--admin { grid-template-columns: minmax(0, 640fr) minmax(0, 770fr); }
.dash-layout > * { min-width: 0; }

.auth-stage { display: grid; justify-items: center; padding: 40px 0 8px; }
.auth-shell { box-sizing: border-box; width: 100%; max-width: 440px; }
.dash-panel { box-sizing: border-box; }

/* Panel titles: Gluten 800 44 / 32 with the CSS ink stroke + lip (kit .k-t-display-*) in cream. */
.panel-title, .auth-title, .dash-title, .offer-title, .view-title { color: var(--cream); overflow-wrap: anywhere; }

/* 4. Sign in | Sign up, the passkey step, the remembered account ------------------------------------ */
/* Peeper peeks over the panel's top edge (baked scene art, behind the panel body). */
.auth-peeker {
  position: absolute;
  z-index: -1;
  left: 56%;
  top: -36px;
  width: 60px;
  height: auto;
  transform: rotate(-5deg);
  pointer-events: none;
}
.auth-seg { margin: 0 0 26px; }
.auth-tabpanel { min-width: 0; }
.auth-title { margin: 0 -24px 10px 0; text-wrap: balance; }  /* titles may run into the right padding (board) */
.auth-title:focus, .panel-title:focus, .offer-title:focus, .view-title:focus { outline: none; }
.auth-lede { margin: 0 0 26px; font: 500 15px/1.4 var(--f-body); color: var(--text-dim); }
.auth-form { display: grid; gap: 18px; }
.auth-form > .k-key--cream, .auth-form > .k-key--plum { margin-top: 0; }
/* tight stack as on the board: the next key covers the goo key's drip, only its stem shows in the gap */
.auth-submit { margin-top: 6px; }
.auth-alert { margin: 0; }
.auth-status { margin: 0; font: 500 15px/1.35 var(--f-body); color: var(--text); }
.auth-status:empty { display: none; }
.auth-why { margin: -8px 0 0; font: 500 15px/1.35 var(--f-body); color: var(--text); }
.auth-tube { margin: 2px 0 0; }
/* the input's own ~20-character width must not set the form's minimum: at 320 px the password box
   (icon + input + eye) ran 2 px past the panel. The flex input still fills its box. */
#dashboard-shell .k-field__input { width: 0; }
/* a busy form's focused field stays focused (read-only, admin.js lockControls) and dims like the rest */
.k-field__input[aria-disabled="true"] { color: var(--k-disabled-text); }
.auth-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 14px; }
.link-button { margin: 0; padding: 0; border: 0; background: none; font-size: 16px; line-height: 1.2; cursor: pointer; appearance: none; }

.remembered-account { display: flex; align-items: center; gap: 18px; min-width: 0; margin: 0 0 26px; }
.remembered-copy { display: grid; gap: 6px; min-width: 0; }
.remembered-title { margin: 0; font-size: min(34px, var(--fs-display-l)); }
.remembered-email { font: 500 14px/1.3 var(--f-body); color: var(--text-dim); overflow-wrap: anywhere; }
.remembered-panel .auth-form { gap: 16px; }
.remembered-panel .auth-footer { margin-top: 20px; }

/* The passkey offer (after sign up) and the add passkey form. */
.offer-head { display: flex; align-items: flex-start; gap: 22px; }
.offer-well {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  flex: none;
  width: 64px;
  height: 64px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: var(--butter);
  box-shadow: inset 0 3px 0 var(--butter-hi), 0 4px 0 var(--ink);
}
.offer-copy { min-width: 0; padding-top: 2px; }
.offer-title { margin: 2px 0 8px; }
.offer-text { font: 500 15px/1.35 var(--f-body); color: var(--text); }
.offer-form { display: grid; gap: 14px; margin-top: 28px; }
.offer-keys { display: flex; flex-wrap: wrap; gap: 18px; }
.offer-keys > .k-key { flex: 1 1 auto; }
.offer-keys > .k-key--plum { flex: 0 1 150px; }
.enroll-form { margin-top: 4px; }
.enroll-panel .auth-lede { margin-bottom: 22px; }

.error-panel { text-align: center; }
.error-panel .auth-footer { justify-content: center; }
.error-art { width: min(260px, 80%); margin: 0 auto 14px; }
.error-panel .auth-lede { margin-bottom: 8px; }
.error-panel .dash-note { margin: 0 0 8px; }
.error-panel .k-key { margin-top: 14px; }

/* 5. The player panel: avatar + "Hey Mo! :>", Jump back in, Passkeys, Settings ---------------------- */
.player-head { display: flex; align-items: center; gap: 22px; min-width: 0; }
.dash-avatar { flex: none; }
.player-copy { min-width: 0; }
.player-meta { margin: 10px 0 0; font: 500 14px/1.3 var(--f-body); color: var(--text-dim); overflow-wrap: anywhere; }
.dash-section { margin-top: 36px; }
.dash-title { margin: 0 0 16px; }
.dash-note { margin: 14px 0 0; font: 500 13px/1.4 var(--f-body); color: var(--text-dim); }
.dash-empty.empty, .dash-empty { padding: 2px 0; text-align: left; font: 500 15px/1.4 var(--f-body); color: var(--text-dim); }
.dash-error { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }

.jump-list, .passkey-list, .settings-list, .skeleton-list { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.jump-row { gap: 18px; padding: 9px 12px 9px 10px; }
/* one dormant drip under the kit's mini portal (board) */
.jump-portal::after {
  content: "";
  position: absolute;
  left: 26%;
  top: calc(100% + 4px);
  width: 8px;
  height: 10px;
  border-radius: 45% 45% 50% 50% / 35% 35% 65% 65%;
  background: var(--dormant-5);
  box-shadow: 0 0 0 2px var(--ink);
}
/* a long title wraps to a second line before it ends in "..." (the Play key's name keeps the whole title).
   Line 1.1 + 1 px: room for the ink lip under line 2, and no sliver of a clamped line 3 shows. */
.jump-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  padding-bottom: 1px;
  color: var(--cream);
  line-height: 1.1;
  white-space: normal;
  overflow-wrap: break-word;
}
.jump-meta { font-size: 14px; }
.jump-play { min-width: 112px; }
.jump-play .jump-play__glyph { width: 20px; height: 20px; margin-left: -4px; }

.passkey-row { gap: 12px; padding: 7px 14px; }
.passkey-row > svg { flex: none; }
.passkey-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.passkey-keys { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 20px; }
.passkey-section > .auth-why { margin: 12px 0 0; }

.settings-list { gap: 4px; }
.setting-row { display: grid; grid-template-columns: minmax(210px, max-content) minmax(0, 1fr); align-items: center; column-gap: 26px; }
.setting-desc { font: 500 13px/1.35 var(--f-body); color: var(--text-dim); }

/* Loading: still slab skeletons, no shimmer (DESIGN §15.7). */
.skeleton-row { min-height: 70px; }
.skeleton-row::before { content: ""; width: 42%; height: 14px; border-radius: 7px; background: var(--void-4); }
.passkey-row.skeleton-row { min-height: 42px; }
.region-skeleton.skeleton-row { min-height: 42px; border-radius: 12px; }
.skeleton-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--void-4); }

/* 6. The admin panel: Admin + live, tiles, the LCD map + regions, plays today (Chart | Table) --------- */
.admin-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 20px; margin: 0 0 24px; }
.admin-title-row { display: flex; align-items: center; gap: 14px; min-width: 0; }
.admin-live { flex: none; }
.admin-live .live-dot.offline { box-sizing: border-box; width: 10.8px; height: 10.8px; border: 1.6px solid var(--ink); border-radius: 50%; background: var(--void-5); }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 10px; }
.admin-tabs .k-key[aria-current="page"] {
  --k-face: var(--goo-5);
  --k-lip-c: var(--goo-7);
  --k-label: var(--text-ink);
  --k-sh-in: inset 0 3px 0 var(--k-lit-c), inset 0 -4px 0 var(--k-shade-c);
}

.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 18px; }
.metrics .k-tile { min-width: 0; }
.metrics .k-tile__value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-totals { margin: 14px 0 0; font: 500 13px/1.45 var(--f-body); color: var(--text-dim); }
.admin-totals__label { margin-right: 2px; font-weight: 700; color: var(--text); }
.live-count { color: var(--goo-3, #A6FF6B); }

.admin-network { display: grid; grid-template-columns: minmax(0, 1fr) 214px; gap: 26px; margin-top: 30px; }
.admin-network__map, .admin-network__regions { min-width: 0; }
.regions-title { margin: 0 0 16px; font: 700 16px/1.1 var(--f-body); color: var(--text-hi); }
.admin-network__map .dash-title { margin-bottom: 16px; }
.network-regions > li { min-width: 0; }
.network-regions > li.is-unknown { color: var(--text-dim); }
.network-regions > li.is-unknown::before { background: transparent; box-shadow: inset 0 0 0 2px var(--text-dim); }

.admin-plays { margin-top: 38px; }
.admin-plays__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin: 0 0 18px; }
.admin-plays__head .dash-title { margin: 0; }
.admin-plays__head .k-seg { width: 190px; }
.admin-tabpanel { min-width: 0; }
.plays-chart { position: relative; }
.plays-chart .k-bars__label { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.plays-chart .k-bars__track { cursor: default; }
.plays-tip { top: -10px; left: 0; pointer-events: none; text-align: left; white-space: nowrap; }
.plays-chart .dash-note { margin-top: 10px; }

.admin-filter {
  box-sizing: border-box;
  width: min(260px, 100%);
  height: 40px;
  margin: 0;
  padding: 0 14px;
  border: 2.5px solid var(--ink);
  border-radius: var(--r-field);
  background: var(--cream);
  color: var(--text-ink);
  font: 500 16px/1.2 var(--f-body);
  box-shadow: inset 0 5px 0 rgba(201, 179, 138, .32);
  appearance: none;
}
.admin-filter::placeholder { color: var(--placeholder); opacity: 1; }
.admin-filter::-webkit-search-cancel-button { display: none; }
.admin-filter:focus { outline: 2px solid transparent; box-shadow: inset 0 5px 0 rgba(201, 179, 138, .32), var(--k-ring); }
.admin-table-wrap { margin-top: 16px; }
.game-summary-table { min-width: 540px; }
.game-summary-row { cursor: pointer; }
.game-summary-row:hover > *, .game-summary-row:focus-within > * { background: rgba(58, 37, 102, .5); }
.game-detail-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: var(--text-hi);
  font-weight: 600;
}
#dashboard-shell .k-table a.game-detail-link:focus-visible { box-shadow: var(--k-ring); }
.release-game-link { max-width: 100%; overflow-wrap: anywhere; }

.admin-lists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 38px; align-items: start; }

/* Wells inside a panel: void-3, ink 2.5, lip 4 (the tile body) ---------------------------------------- */
#dashboard-shell :is(.panel, .card) {
  box-sizing: border-box;
  min-width: 0;
  border: var(--ink-small) solid var(--ink);
  border-radius: var(--r-tile);
  background: var(--void-3);
  box-shadow: 0 var(--lip-tile) 0 var(--ink);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  min-height: 56px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--void-4);
}
.panel-head .dash-title, .panel-head h3, .panel-head h4 { margin: 0; }
.panel-head h3:not(.dash-title), .panel-head h4 { font: 700 16px/1.2 var(--f-body); color: var(--text-hi); }
.panel-head .muted { margin: 4px 0 0; }
.muted { font: 500 14px/1.4 var(--f-body); color: var(--text-dim); }
.empty { padding: 24px 16px; color: var(--text-dim); text-align: center; font: 500 15px/1.4 var(--f-body); }
.empty-state { display: grid; justify-items: start; gap: 10px; width: min(560px, 100%); padding: 22px 24px; }
.empty-state h3 { font: 700 18px/1.2 var(--f-body); color: var(--text-hi); }
.game-detail-loading { display: flex; align-items: center; gap: 14px; }

.activity-list { max-height: 380px; overflow: auto; overscroll-behavior: contain; }
.activity-row {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--void-4);
  font: 500 15px/1.35 var(--f-body);
}
.activity-row:last-child { border-bottom: 0; }
.activity-row .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--goo-5, #4BEA3C); box-shadow: 0 0 0 1.5px var(--ink); }
.activity-row.suspicious .pulse { background: var(--warn); }
.activity-row strong { display: block; overflow: hidden; color: var(--text-hi); font-weight: 600; text-overflow: ellipsis; }
.activity-row small { display: block; margin-top: 2px; color: var(--text-dim); font: 500 13px/1.35 var(--f-body); }
.activity-row time { color: var(--text-dim); font: 500 12px/1.3 var(--f-body); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.player-row {
  width: 100%;
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--void-4);
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.player-row:hover { background: rgba(58, 37, 102, .55); }
/* rows inside scrollers carry the ONE ring inside their box (an outside ring would be clipped) */
.player-row:focus-visible, .network-roster-row:focus-within {
  outline: 2px solid transparent;
  box-shadow: inset 0 0 0 var(--focus-outer-w) var(--focus-outer), inset 0 0 0 calc(var(--focus-outer-w) + var(--focus-inner-w)) var(--focus-inner);
}
.event-name { min-width: 0; overflow-wrap: anywhere; }
[role="region"].activity-list:focus-visible, [role="region"].table-scroll:focus-visible {
  outline: 2px solid transparent;
  box-shadow: inset 0 0 0 var(--focus-outer-w) var(--focus-outer), inset 0 0 0 calc(var(--focus-outer-w) + var(--focus-inner-w)) var(--focus-inner);
}
.event-range { white-space: normal; }

/* 7. Detail views (a game's analytics, a player's profile, releases) ---------------------------------- */
.admin-panel--wide { max-width: var(--dash-max); }
.view-section { min-width: 0; }
.dashboard-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 22px; margin: 0 0 20px; }
.dashboard-head .muted { margin: 6px 0 0; overflow-wrap: anywhere; }
.eyebrow { font: 600 14px/1.3 var(--f-body); color: var(--text-dim); }
.view-title { margin: 6px 0 2px; }
.view-back { flex: none; }

.game-dashboard { display: grid; gap: 24px; min-width: 0; }
.game-dashboard > *, .game-detail-grid > *, .game-events-grid > * { min-width: 0; }
.game-dashboard-head, .game-dashboard .game-metrics { margin-bottom: 0; }
.game-summary-details, .game-breakdowns { display: grid; gap: 12px; min-width: 0; }
.section-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 14px; margin-top: 6px; }
.section-heading .dash-title { margin: 0; }
.section-heading p { margin: 0; font-size: 13px; }
.game-stat-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.game-stat { min-width: 0; }
.game-stat .k-tile__value { overflow: hidden; font-size: 20px; text-overflow: ellipsis; white-space: nowrap; }

/* The live player network of one game: the LCD map + regions + connections */
.game-network-panel { min-width: 0; overflow: hidden; }
.network-panel-head { align-items: flex-start; }
.network-head-status { display: grid; justify-items: end; gap: 8px; min-width: 0; }
.network-live-badge { flex: none; }
.network-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 12px; font: 500 12px/1.3 var(--f-body); color: var(--text-dim); font-variant-numeric: tabular-nums; }
.network-legend-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.network-legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--latency-color, var(--text-dim)); box-shadow: 0 0 0 1.5px var(--ink); }
.network-legend-dot.good { --latency-color: var(--goo-3); }
.network-legend-dot.fair { --latency-color: var(--butter); }
.network-legend-dot.slow { --latency-color: var(--tang); }
.network-legend-dot.poor { --latency-color: var(--danger); }
.network-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 300px); gap: 20px; padding: 18px 16px 16px; align-items: start; }
.network-side { display: grid; align-content: start; gap: 16px; min-width: 0; }
.network-side .regions-title { margin: 0; }
.network-roster {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  border: 2.4px solid var(--ink);
  border-radius: 12px;
  background: var(--void-2);
}
.network-roster-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 42px; padding: 8px 14px; border-bottom: 1px solid var(--void-4); }
.network-roster-head h4 { font: 700 15px/1.2 var(--f-body); color: var(--text-hi); }
.network-roster-head span { color: var(--goo-3); font: 600 14px/1 var(--f-body); font-variant-numeric: tabular-nums; }
.network-roster-list { max-height: 300px; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.network-roster-list .empty { margin: 0; }
.network-roster-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; min-width: 0; padding: 9px 12px; border-bottom: 1px solid var(--void-4); }
.network-roster-row:last-child { border-bottom: 0; }
.network-roster-row:hover, .network-roster-row.is-highlighted { background: rgba(58, 37, 102, .55); }
.network-player-copy { min-width: 0; }
.network-player-copy .player-identity-button { min-height: 32px; max-width: 100%; margin: -4px -6px 0; padding: 4px 6px; }
.network-player-copy .player-identity-label { display: block; overflow: hidden; color: var(--text-hi); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.network-player-copy small { display: block; overflow: hidden; color: var(--text-dim); font: 500 12px/1.35 var(--f-body); text-overflow: ellipsis; white-space: nowrap; }
.network-player-telemetry { display: grid; justify-items: end; gap: 4px; }
.network-player-telemetry time { color: var(--text-dim); font: 500 12px/1.2 var(--f-body); white-space: nowrap; }
.network-latency {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  height: 24px;
  padding: 0 9px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--pill);
  color: var(--latency-color, var(--text-dim));
  font: 600 12px/1 var(--f-body);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.network-latency.is-stale { opacity: .7; }
.network-note { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 14px; padding: 10px 16px; border-top: 1px solid var(--void-4); font: 500 12px/1.4 var(--f-body); color: var(--text-dim); }
.network-note span:last-child { text-align: right; }

/* The LCD map (UIKIT 29) ------------------------------------------------------------------------ */
.world-stage {
  position: relative;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  isolation: isolate;
}
.world-stage.k-lcdmap { padding: 10px 10px 30px; color: var(--goo-3); }
.world-stage--compact { aspect-ratio: 1.42; }
.world-canvas { position: relative; width: 100%; aspect-ratio: 2 / 1; }
.world-map { display: block; width: 100%; height: 100%; overflow: visible; }
.world-stage .k-lcdmap__caption { position: absolute; left: 14px; right: 14px; bottom: 9px; margin: 0; text-wrap: balance; }
.world-grid line { stroke: var(--lcd-grid); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.world-land path { fill: var(--lcd-land); stroke: var(--goo-8); stroke-width: 1.6px; vector-effect: non-scaling-stroke; }
.latency-good { --latency-color: var(--goo-3); }
.latency-fair { --latency-color: var(--butter); }
.latency-slow { --latency-color: var(--tang); }
.latency-poor { --latency-color: var(--danger); }
.latency-unknown { --latency-color: var(--text-dim); }
.connection-path {
  fill: none;
  stroke: var(--goo-7);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 4 5;
  opacity: .9;
  vector-effect: non-scaling-stroke;
  animation: network-connection-flow 1.2s linear infinite;
}
.connection-path.is-stale { stroke-dasharray: 2 7; opacity: .45; }
.connection-path.is-highlighted { stroke: var(--goo-3); stroke-width: 2.6; opacity: 1; }
/* RTT labels show for the highlighted cluster only (hover a blip or a connection row); the tooltip, the
   roster and the data table carry every RTT, so the LCD stays readable. */
.connection-rtt { pointer-events: none; opacity: 0; transition: opacity 120ms linear; }
.connection-rtt.is-highlighted { opacity: 1; }
.connection-rtt rect { fill: var(--lcd-top); stroke: var(--goo-8); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.connection-rtt text { fill: var(--latency-color, var(--goo-3)); font: 600 17px/1 var(--f-lcd, 'Martian Mono', ui-monospace, monospace); font-variant-numeric: tabular-nums; }
.connection-rtt.is-stale.is-highlighted { opacity: .75; }
.player-map-marker { cursor: default; }
.player-map-pulse, .server-map-ring { transform-box: fill-box; transform-origin: center; }
.player-map-pulse {
  fill: none;
  stroke: var(--goo-3);
  stroke-width: 1.2;
  opacity: .5;
  vector-effect: non-scaling-stroke;
  animation: network-marker-pulse 2.4s ease-out infinite;
}
.player-map-halo { fill: none; stroke: var(--goo-3); stroke-width: 1.4; opacity: .45; vector-effect: non-scaling-stroke; }
.player-map-core { fill: var(--goo-3); stroke: var(--lcd); stroke-width: 2; vector-effect: non-scaling-stroke; }
.player-map-marker.is-highlighted .player-map-halo { stroke-width: 2.4; opacity: 1; }
.player-map-marker.is-highlighted .player-map-core { fill: var(--goo-1); }
.player-map-count { fill: var(--goo-1); font: 700 22px/1 var(--f-lcd, 'Martian Mono', ui-monospace, monospace); paint-order: stroke; stroke: var(--lcd); stroke-width: 6px; stroke-linejoin: round; }
.server-map-ring { fill: none; stroke: var(--cream); stroke-width: 1.2; opacity: .3; vector-effect: non-scaling-stroke; }
.server-map-core { fill: var(--cream); stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; }
.server-map-label { fill: var(--cream); font: 600 19px/1 var(--f-lcd, 'Martian Mono', ui-monospace, monospace); paint-order: stroke; stroke: var(--lcd); stroke-width: 6px; stroke-linejoin: round; }
.world-stage--compact .network-rtt-labels, .world-stage--compact .server-map-label, .world-stage--compact .player-map-count { display: none; }
/* The map's own labels scale with it (1000 units wide): on a narrow map they would fall under the type
   floor (12 px fine, 13 px coarse; the RTT label is 17 units), so they hide there. The blips' titles,
   the connection roster and the data table still carry every count and RTT. */
.world-canvas { container-type: inline-size; }
@container (max-width: 709.98px) {
  .network-rtt-labels, .server-map-label, .player-map-count { display: none; }
}
@media (pointer: coarse) {
  @container (max-width: 769.98px) {
    .network-rtt-labels, .server-map-label, .player-map-count { display: none; }
  }
}
.connection-path.phase-1, .phase-1 .player-map-pulse { animation-delay: -.4s; }
.connection-path.phase-2, .phase-2 .player-map-pulse { animation-delay: -.8s; }
.connection-path.phase-3, .phase-3 .player-map-pulse { animation-delay: -1.2s; }
.connection-path.phase-4, .phase-4 .player-map-pulse { animation-delay: -1.6s; }
.connection-path.phase-5, .phase-5 .player-map-pulse { animation-delay: -2s; }
.network-tooltip { transform: translate(-50%, calc(-100% - 16px)); pointer-events: none; text-align: left; white-space: normal; }
.network-tooltip[hidden] { display: none; }
.network-tooltip strong { display: block; overflow-wrap: anywhere; }
.network-tooltip-rtt { font-variant-numeric: tabular-nums; }
.network-map-empty {
  position: absolute;
  left: 50%;
  top: 46%;
  z-index: 3;
  box-sizing: border-box;
  display: grid;
  gap: 3px;
  width: min(300px, calc(100% - 28px));
  padding: 12px 16px;
  border: 2.5px solid var(--ink);
  border-radius: 16px;
  background: var(--pill);
  color: var(--text-dim);
  font: 500 13px/1.35 var(--f-body);
  text-align: center;
  box-shadow: 0 3px 0 var(--ink);
  transform: translate(-50%, -50%);
}
.network-map-empty strong { color: var(--text-hi); font: 600 15px/1.3 var(--f-body); }
.network-map-empty.compact { top: auto; bottom: 36px; transform: translateX(-50%); }
.network-unmapped-badge {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 3;
  padding: 4px 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--pill);
  color: var(--text-dim);
  font: 600 12px/1.2 var(--f-body);
}

@keyframes network-connection-flow { to { stroke-dashoffset: -18; } }
@keyframes network-marker-pulse {
  0% { opacity: .6; transform: scale(.7); }
  70%, 100% { opacity: 0; transform: scale(1.5); }
}

/* Activity over time: one series in goo-data, 4 px data ends square at the baseline, hairline grid */
.game-trend-panel { min-width: 0; }
.range-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.trend-bars {
  box-sizing: border-box;
  display: flex;
  align-items: flex-end;
  gap: clamp(1px, .3vw, 4px);
  height: 190px;
  padding: 18px 16px 0;
  border-bottom: 1px solid var(--void-5);
  background: linear-gradient(to top, var(--void-4) 1px, transparent 1px) 0 0 / 100% 25% content-box;
}
.trend-bar-shell { display: flex; align-items: flex-end; flex: 1 1 0; min-width: 1px; height: 100%; }
.trend-bar { width: 100%; min-height: 0; border-radius: 4px 4px 0 0; background: transparent; }
.trend-bar.has-data { background: var(--goo-data); }
.trend-bar-shell:hover .trend-bar.has-data { background: var(--goo-data-hover); }
.trend-caption {
  display: grid;
  grid-template-columns: minmax(74px, 1fr) minmax(0, auto) minmax(74px, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: var(--text-dim);
  font: 500 12px/1.3 var(--f-body);
  font-variant-numeric: tabular-nums;
}
.trend-caption strong { overflow: hidden; color: var(--text); font-weight: 600; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.trend-caption span:last-child { text-align: right; }

.game-detail-grid, .game-events-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.game-current-panel, .game-players-panel, .game-sessions-panel, .event-types-panel, .game-events-panel { min-width: 0; overflow: hidden; }

/* Tables in wells (kit .k-table) */
.table-scroll { max-height: 560px; overflow: auto; }
.panel > .table-scroll, .card > .table-scroll { padding: 12px; }
.game-dashboard .table-scroll { max-width: 100%; overscroll-behavior: contain; scrollbar-gutter: stable; }
.game-current-panel .game-current-list { max-height: 340px; overscroll-behavior: contain; }
.event-types-table, .game-events-panel .game-event-list { max-height: 520px; overscroll-behavior: contain; }
#dashboard-shell .k-table { white-space: nowrap; }
#dashboard-shell .k-table thead th { position: sticky; top: 0; z-index: 1; }
#dashboard-shell .k-table tbody td { font-variant-numeric: tabular-nums; }
.game-name { font-weight: 600; color: var(--text-hi); }
.game-player-cell small { display: block; color: var(--text-dim); font: 500 12px/1.3 var(--f-body); }
.player-identity-button {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  min-height: 36px;
  max-width: min(360px, 42vw);
  margin: -6px -8px;
  padding: 6px 8px;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-hi);
  font: 600 15px/1.2 var(--f-body);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.player-identity-button:hover { color: var(--goo-3); }
.player-identity-button:focus-visible { outline: 2px solid transparent; box-shadow: var(--k-ring); }
.player-identity-label { color: var(--text-hi); font-weight: 600; }
.session-status, .risk-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-sizing: border-box;
  height: 26px;
  padding: 0 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--pill);
  color: var(--text-dim);
  font: 600 13px/1 var(--f-body);
  white-space: nowrap;
}
.session-status.live { color: var(--text-hi); }
.session-status.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--goo-5); box-shadow: 0 0 0 1.5px var(--ink); }
.risk-pill.medium { color: var(--warn); }
.risk-pill.high { color: var(--danger); }
.session-detail { max-width: 340px; overflow: hidden; color: var(--text-dim); font: 500 13px/1.4 var(--f-body); text-overflow: ellipsis; white-space: nowrap; }
.session-detail strong, .session-detail small { display: block; overflow: hidden; text-overflow: ellipsis; }
.session-detail strong { color: var(--text); font-weight: 600; }
td.session-detail small { font-size: 12px; }  /* not the browser's "smaller" (10.8 px) */
.event-kind { color: var(--goo-3); font-weight: 600; }

.breakdown-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.breakdown-card { min-width: 0; overflow: hidden; }
.breakdown-card.wide { grid-column: 1 / -1; }
.breakdown-card .panel-head { min-height: 48px; }
.breakdown-list { display: grid; padding: 6px 16px 12px; }
.breakdown-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(90px, .7fr); align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--void-4); font: 500 14px/1.35 var(--f-body); }
.breakdown-row:last-child { border-bottom: 0; }
.breakdown-copy { min-width: 0; }
.breakdown-copy strong, .breakdown-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breakdown-copy strong { color: var(--text-hi); font-weight: 600; font-variant-numeric: tabular-nums; }
.breakdown-copy small { margin-top: 2px; color: var(--text-dim); font-size: 12px; }
.breakdown-meter { display: block; width: 100%; height: 12px; background: linear-gradient(90deg, var(--void-5) 1px, transparent 1px); }
.breakdown-bar { display: block; height: 100%; min-width: 0; border-radius: 0 4px 4px 0; background: var(--goo-data); }

.player-profile { display: grid; gap: 20px; }
.player-profile .dashboard-head, .player-profile .metrics { margin-bottom: 0; }
.profile-identity { display: flex; align-items: center; gap: 18px; padding: 16px 20px; }
.profile-name { margin: 0 0 4px; font: 800 26px/1 var(--f-display, 'Gluten', 'Fredoka', system-ui, sans-serif); color: var(--cream); overflow-wrap: anywhere; }

.catalog-view { display: grid; gap: 20px; }
.catalog-view .dashboard-head { margin: 0; }
.release-list { display: grid; }
.release-row {
  display: grid;
  grid-template-columns: minmax(140px, .8fr) minmax(220px, 1.6fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 62px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--void-4);
}
.release-row:last-child { border-bottom: 0; }
.release-identity { min-width: 0; }
.release-identity small { display: block; margin-top: 2px; color: var(--text-dim); font: 500 12px/1.3 var(--f-body); }
.tag-editor { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.tag-editor .tag-input { width: 100%; }
.release-toggle { min-width: 150px; color: var(--text-dim); font-size: 15px; white-space: nowrap; }
.release-toggle .released { color: var(--goo-3); }

/* Hidden helpers (the live map's data table stays readable by screen readers). */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  white-space: nowrap !important;
}
.network-data-table { table-layout: fixed; white-space: normal !important; }
.network-data-table th, .network-data-table td { width: 1px; max-width: 1px; padding: 0; overflow: hidden; }

/* 8. Toasts, the privacy link ------------------------------------------------------------------------ */
#toast.k-toasts { z-index: 20; }
.dashboard-footer {
  display: flex;
  justify-content: center;
  padding: 6px 16px max(28px, calc(env(safe-area-inset-bottom, 0px) + 16px));
}
.dashboard-privacy {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-fine);
  border-radius: 4px;
  color: var(--link);
  font: 600 15px/1.2 var(--f-body);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.dashboard-privacy:hover { color: var(--goo-1); }
.dashboard-privacy:focus-visible { outline: 2px solid transparent; box-shadow: var(--k-ring); }
/* the auth panels carry their own Back to games · Privacy links */
#dashboard-shell[data-view="auth"] .dashboard-footer,
#dashboard-shell[data-view="loading"] .dashboard-footer { display: none; }

/* 9. Widths ------------------------------------------------------------------------------------------ */
@media (max-width: 1199.98px) {
  .dash-layout--admin { grid-template-columns: minmax(0, 1fr); max-width: 770px; margin: 0 auto; }
}
@media (max-width: 1050px) {
  .network-layout { grid-template-columns: minmax(0, 1fr); }
  .game-detail-grid, .game-events-grid { grid-template-columns: minmax(0, 1fr); }
  .network-roster-list { max-height: 260px; }
}
@media (max-width: 759.98px) {
  html.dashboard-active { --dash-gutter: 12px; }
  .masthead { padding-top: max(14px, calc(env(safe-area-inset-top, 0px) + 8px)); padding-bottom: 10px; }
  .brand__mark { width: 198px; }
  #header-actions { gap: 10px; }
  /* phones: the header keys become 44 px icon keys; their words stay their names */
  .app-key { --k-h: 44px; width: var(--k-h); padding: 0; }
  .app-key .k-key__label {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
  #app { padding-top: 6px; }
  .auth-stage { padding-top: 32px; }
  .auth-peeker { width: 52px; top: -31px; }
  .auth-footer { margin-top: 18px; }
  .player-head { gap: 16px; }
  .player-head .dash-avatar { --k-av: 72px !important; }
  .dash-section { margin-top: 30px; }
  /* Jump back in on phones: Play is a round goo icon key (admin.js adds .k-key--icon; its name stays
     "Play Satsuma"), so the title and "Played ..." get the room; neither is cut to a stub. */
  .jump-row { gap: 10px; padding: 8px; }
  .jump-meta { display: block; font-size: 13px; }
  .jump-meta > svg { display: none; }
  .jump-play { min-width: 0; padding: 0 14px; }
  .jump-play.k-key--icon { padding: 0; }
  .jump-play.k-key--icon .k-key__label {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
  .jump-play.k-key--icon .jump-play__glyph { width: 24px; height: 24px; margin: 0 0 0 2px; }
  .plays-chart .k-bars__label { max-width: 112px; }
  .setting-row { grid-template-columns: minmax(0, 1fr); }
  .setting-desc { margin: -8px 0 8px 64px; }
  .admin-network { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .admin-lists { grid-template-columns: minmax(0, 1fr); }
  .admin-plays__head .k-seg { width: 100%; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .world-stage { aspect-ratio: 4 / 3; }
  .world-stage--compact { aspect-ratio: 4 / 3; }
  .release-row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .release-toggle { justify-self: start; }
  .breakdown-grid { grid-template-columns: minmax(0, 1fr); }
  .network-note { flex-direction: column; }
  .network-note span:last-child { text-align: left; }
  .network-head-status { justify-items: start; }
  .network-legend { justify-content: flex-start; }
  .panel-head { flex-wrap: wrap; }
  .admin-filter { width: 100%; }
  .trend-bars { height: 150px; padding: 14px 10px 0; }
  .trend-caption { grid-template-columns: 1fr 1fr; gap: 4px 10px; }
  .trend-caption strong { grid-column: 1 / -1; grid-row: 1; }
  .trend-caption span:first-child { grid-column: 1; grid-row: 2; }
  .trend-caption span:last-child { grid-column: 2; grid-row: 2; }
  .player-identity-button { max-width: 58vw; }
}
@media (max-width: 399.98px) {
  .jump-portal { width: 56px; height: 32px; }
}
@media (max-width: 359.98px) {
  .jump-portal { display: none; }
}
@media (max-width: 420px) {
  .offer-head { gap: 16px; }
  .offer-well { width: 56px; height: 56px; border-radius: 16px; }
}
@media (pointer: coarse) {
  .brand { min-height: var(--target-coarse); align-items: center; }
  .dashboard-privacy { min-height: var(--target-coarse); }
  .admin-filter { height: 44px; }
  .player-identity-button { min-height: 44px; }
  /* information text is at least 13 px on coarse pointers (DESIGN §5 floors) */
  .network-unmapped-badge, .world-stage .k-lcdmap__caption, .activity-row time, .network-legend,
  .network-player-copy small, .network-player-telemetry time, .network-latency, .network-note, .trend-caption,
  .game-player-cell small, td.session-detail small, .breakdown-copy small, .release-identity small { font-size: 13px; }
}

/* 10. Reduced motion (aio.motion over the OS, both ways): no flow, no pulse, blips still ---------------- */
@media (prefers-reduced-motion: reduce) {
  html:not([data-motion="full"]) .connection-path,
  html:not([data-motion="full"]) .player-map-pulse { animation: none !important; }
  .player-map-pulse { opacity: .42; transform: none; }
}
html[data-motion="reduce"] .connection-path,
html[data-motion="reduce"] .player-map-pulse { animation: none !important; }
html[data-motion="reduce"] .player-map-pulse { opacity: .42; transform: none; }

/* 11. Forced colours: system colours; pictures and goo decoration hide -------------------------------- */
@media (forced-colors: active) {
  #dashboard-shell :is(.panel, .card), .network-roster, .network-map-empty, .admin-filter, .offer-well { border-color: CanvasText; }
  .auth-peeker, .error-art, .jump-portal::after { display: none; }
  .world-land path { fill: Canvas; stroke: CanvasText; }
  .world-grid line, .connection-path { stroke: GrayText; }
  .player-map-core { fill: Highlight; stroke: Canvas; }
  .player-map-halo, .player-map-pulse, .server-map-ring { stroke: CanvasText; }
  .server-map-core { fill: CanvasText; }
  .trend-bar.has-data, .breakdown-bar, .plays-chart .k-bars__bar { background: Highlight; forced-color-adjust: none; }
  .k-regions > li::before { forced-color-adjust: none; background: CanvasText; }
  .dashboard-privacy { color: LinkText; }
}
