/*
 * Dotcoder Play Hub — "Lantern & Ledger"
 *
 * Two registers, deliberately kept apart:
 *
 *   Lantern  the catalog. Warm, lit from the top-left, generous radii, a serif
 *            editorial voice. This is the part that has to make someone want an
 *            account.
 *   Ledger   account, sessions, consent, admin. Monospace for anything the
 *            machine owns — handles, ids, scopes, timestamps, counts — hairline
 *            separations, no glow. These screens are where a member decides
 *            what a game may read about them, so they read as records, not
 *            marketing.
 *
 * Type is set from system faces only: the CSP is `style-src 'self'
 * 'unsafe-inline'` with no font-src, so a webfont would be blocked. Personality
 * comes from the pairing and the tracking, not from an exotic file.
 */

/* ------------------------------------------------------------------ tokens */

:root {
  /* Light is the base definition so no color exists only inside a media query. */
  --bg: #eef1f5;
  --bg-deep: #e2e7ee;
  --surface: #ffffff;
  --surface-2: #f5f7fa;
  --surface-sunk: #eaeef3;
  --line: #d7dee6;
  --line-strong: #b9c4d0;
  --ink: #11151b;
  --ink-2: #39414d;
  --muted: #66707e;
  --accent: #9a6b06;
  --accent-fill: #f2c14e;
  --accent-ink: #2a1f04;
  --accent-soft: rgba(242, 193, 78, 0.18);
  --lantern: rgba(242, 193, 78, 0.5);
  --lantern-2: rgba(140, 175, 214, 0.42);
  --danger: #b5301f;
  --danger-soft: rgba(181, 48, 31, 0.1);
  --ok: #0c7d57;
  --ok-soft: rgba(12, 125, 87, 0.12);
  --focus: #2f6fd0;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 12px 28px -18px rgba(16, 24, 40, 0.4);

  /* Status is real data from the registry, so each value gets its own color. */
  --s-live: #0c7d57;
  --s-beta: #9a6b06;
  --s-alpha: #5b3fc4;
  --s-retired: #66707e;
  --s-internal: #4a5765;

  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
    Georgia, "Times New Roman", serif;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;

  --pad: clamp(1rem, 4vw, 2.5rem);
  --measure: 62ch;
  --shell: 1180px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1015;
    --bg-deep: #08090d;
    --surface: #171a21;
    --surface-2: #1e222b;
    --surface-sunk: #12151b;
    --line: #272c36;
    --line-strong: #3a414f;
    --ink: #eceae4;
    --ink-2: #c2c8d2;
    --muted: #8c94a2;
    --accent: #f2c14e;
    --accent-fill: #f2c14e;
    --accent-ink: #241b05;
    --accent-soft: rgba(242, 193, 78, 0.14);
    --lantern: rgba(242, 193, 78, 0.22);
    --lantern-2: rgba(76, 110, 160, 0.3);
    --danger: #ff8177;
    --danger-soft: rgba(255, 129, 119, 0.12);
    --ok: #5fd3a6;
    --ok-soft: rgba(95, 211, 166, 0.12);
    --focus: #7fb0ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 18px 40px -24px rgba(0, 0, 0, 0.9);

    --s-live: #5fd3a6;
    --s-beta: #f2c14e;
    --s-alpha: #a78bfa;
    --s-retired: #8c94a2;
    --s-internal: #9fb0c2;

    color-scheme: dark;
  }
}

/* ------------------------------------------------------------------- reset */

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  /* The lantern: one warm source top-left, one cool counter-source far right.
     Fixed so it does not scroll away and re-composite on every frame. */
  background-image:
    radial-gradient(1100px 620px at 4% -12%, var(--lantern) 0%, transparent 62%),
    radial-gradient(900px 520px at 104% 8%, var(--lantern-2) 0%, transparent 60%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

img {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3,
h4,
p,
figure,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Focus is never removed, only replaced — keyboard use has to stay legible. */
:focus:not(:focus-visible) {
  outline: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Skip link: the catalog grid is long, so a keyboard user needs a way past it. */
.skip {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  z-index: 60;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 0.6rem 0.9rem;
  transition: top 120ms ease;
}

.skip:focus {
  top: 0.75rem;
}

/* --------------------------------------------------------------- typography */

.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.012em;
  line-height: 1.02;
  text-wrap: balance;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.86em;
  font-variant-numeric: tabular-nums;
}

.lede {
  color: var(--ink-2);
  font-size: 1.06rem;
  max-width: var(--measure);
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.86rem;
}

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

.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding-inline: var(--pad);
}

.stack > * + * {
  margin-top: var(--gap, 1rem);
}

.row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.spread {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

main {
  padding-block: clamp(1.75rem, 5vw, 3.25rem) 5rem;
  /* Reserved so the footer does not jump when a short view renders. */
  min-height: 60vh;
}

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

.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
}

.masthead-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 60px;
  padding-block: 0.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.06rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
  padding: 0.25rem;
  margin-left: -0.25rem;
  border-radius: var(--r-sm);
}

.brand img {
  width: 26px;
  height: 26px;
  border-radius: 7px;
}

.brand b {
  font-weight: 400;
}

.brand span {
  color: var(--muted);
}

.nav {
  display: flex;
  gap: 0.15rem;
  margin-left: auto;
  align-items: center;
}

.nav a {
  text-decoration: none;
  color: var(--ink-2);
  font-size: 0.9rem;
  padding: 0.42rem 0.7rem;
  border-radius: var(--r-sm);
  white-space: nowrap;
}

.nav a:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.nav a[aria-current="page"] {
  color: var(--ink);
  background: var(--surface-2);
  box-shadow: inset 0 -2px 0 var(--accent-fill);
}

.nav-count {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  background: var(--accent-fill);
  color: var(--accent-ink);
  border-radius: 999px;
  padding: 0.05rem 0.34rem;
  margin-left: 0.3rem;
  font-variant-numeric: tabular-nums;
}

/*
 * Below 640px the header cannot hold the brand, four sections, and the account
 * chip on one line — the sections and the chip get pushed off the right edge
 * with no way to reach them. It becomes two rows instead: identity on top,
 * sections underneath, scrolling sideways if the member has every section.
 */
@media (max-width: 640px) {
  .masthead-inner {
    flex-wrap: wrap;
    row-gap: 0.2rem;
    padding-block: 0.5rem 0.3rem;
  }

  .nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 0.15rem;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .masthead-inner > .row {
    margin-left: auto;
  }
}

/* The signed-in chip carries the handle in mono — it is an identifier. */
.who {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 0.28rem 0.7rem 0.28rem 0.32rem;
  font-size: 0.85rem;
}

.who:hover {
  border-color: var(--line-strong);
}

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-fill);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  flex: none;
}

.avatar.lg {
  width: 56px;
  height: 56px;
  font-size: 1.35rem;
  border-radius: 16px;
}

.avatar.sm {
  width: 22px;
  height: 22px;
  font-size: 0.64rem;
}

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

.hero {
  padding-block: clamp(1rem, 4vw, 2.5rem) clamp(1.25rem, 4vw, 2rem);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 7.2vw, 4.2rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  max-width: 17ch;
  text-wrap: balance;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero .lede {
  margin-top: 1rem;
}

/* --------------------------------------------------- kind index (signature) */

/*
 * The four sections are a filter over one catalog, and the API hands back a
 * real count per kind. So the index is built from counts rather than invented
 * numbering: the figure under each label is information, not ornament.
 */
.kind-index {
  display: flex;
  gap: 0.25rem;
  margin-top: clamp(1.5rem, 4vw, 2.25rem);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.kind-index::-webkit-scrollbar {
  display: none;
}

.kind {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  padding: 0.55rem 0.85rem 0.7rem;
  display: grid;
  gap: 0.1rem;
  justify-items: start;
  white-space: nowrap;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  transition: color 140ms ease, border-color 140ms ease;
}

.kind:hover {
  color: var(--ink-2);
  background: var(--surface-2);
}

.kind[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--accent-fill);
}

.kind-name {
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.kind-count {
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------- cards */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 1.05rem;
  text-decoration: none;
  color: inherit;
  /* Fixed floor so the grid does not reflow as descriptions of different
     lengths arrive. */
  min-height: 172px;
  box-shadow: var(--shadow);
  transition: transform 160ms ease, border-color 160ms ease;
}

a.card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

a.card:hover .card-title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.card-id {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.card-desc {
  color: var(--ink-2);
  font-size: 0.9rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  padding-top: 0.4rem;
}

/* Cards fade in once, staggered by index, and never when motion is reduced. */
.card-in {
  animation: rise 340ms cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
  animation-delay: calc(var(--i, 0) * 28ms);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* ------------------------------------------------------------------- chips */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.16rem 0.5rem;
  color: var(--muted);
  white-space: nowrap;
}

.chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.chip.plain::before {
  display: none;
}

.chip[data-status="live"] {
  color: var(--s-live);
  border-color: color-mix(in srgb, var(--s-live) 40%, transparent);
}
.chip[data-status="beta"] {
  color: var(--s-beta);
  border-color: color-mix(in srgb, var(--s-beta) 40%, transparent);
}
.chip[data-status="alpha"] {
  color: var(--s-alpha);
  border-color: color-mix(in srgb, var(--s-alpha) 40%, transparent);
}
.chip[data-status="retired"] {
  color: var(--s-retired);
}
.chip[data-access="internal"],
.chip[data-access="invite"] {
  color: var(--s-internal);
  border-color: color-mix(in srgb, var(--s-internal) 40%, transparent);
}
.chip[data-access="open"] {
  color: var(--s-live);
  border-color: color-mix(in srgb, var(--s-live) 40%, transparent);
}
.chip[data-presence="online"] {
  color: var(--s-live);
  border-color: color-mix(in srgb, var(--s-live) 40%, transparent);
}
.chip[data-presence="away"] {
  color: var(--s-beta);
}
.chip[data-presence="offline"] {
  color: var(--muted);
}
.chip[data-role="admin"],
.chip[data-role="team"] {
  color: var(--s-alpha);
  border-color: color-mix(in srgb, var(--s-alpha) 40%, transparent);
}
.chip[data-report="open"] {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
}
.chip[data-report="triaged"] {
  color: var(--s-beta);
}
.chip[data-report="actioned"] {
  color: var(--s-live);
}
.chip[data-report="dismissed"] {
  color: var(--muted);
}

/* ------------------------------------------------------------- ledger panel */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(1rem, 3vw, 1.5rem);
  box-shadow: var(--shadow);
}

.panel + .panel {
  margin-top: 1rem;
}

.panel > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}

.panel h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.panel h3 {
  font-size: 0.95rem;
  font-weight: 600;
}

.panel-note {
  color: var(--muted);
  font-size: 0.88rem;
  max-width: var(--measure);
}

.section-head {
  margin-bottom: 1rem;
}

.section-head h1 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.6vw, 2.7rem);
  letter-spacing: -0.018em;
  line-height: 1.04;
}

/* Ledger rows: hairline-separated, mono on the right for machine values. */
.ledger {
  border-top: 1px solid var(--line);
}

.ledger > li,
.ledger > div {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
}

.ledger .grow {
  flex: 1 1 14rem;
  min-width: 0;
}

.ledger .grow > * {
  overflow-wrap: anywhere;
}

.kv {
  display: grid;
  grid-template-columns: minmax(7rem, auto) 1fr;
  gap: 0.35rem 1rem;
  font-size: 0.92rem;
}

.kv dt {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-top: 0.15rem;
}

.kv dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------------ member card */

/*
 * The one place boldness is spent. It is the artifact of the product: the thing
 * an account actually gets you, and the object the rest of the design stays
 * quiet around.
 */
.member-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  background:
    radial-gradient(520px 260px at 88% -30%, var(--accent-soft), transparent 70%),
    var(--surface);
  padding: clamp(1.1rem, 3vw, 1.6rem);
  box-shadow: var(--shadow);
}

.member-card::after {
  /* A thin lit edge along the top; the lantern touching the card. */
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-fill), transparent);
  opacity: 0.75;
}

.member-card .handle {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--accent);
}

.member-card .name {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
}

.score {
  display: grid;
  gap: 0.1rem;
  justify-items: end;
  text-align: right;
}

.score b {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 2.9rem);
  line-height: 0.9;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ buttons */

.btn {
  appearance: none;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 550;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  padding: 0.58rem 1rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 42px;
  transition: background 130ms ease, border-color 130ms ease, opacity 130ms ease;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  background: var(--surface-2);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--accent-fill);
  border-color: transparent;
  color: var(--accent-ink);
  font-weight: 650;
}

.btn.primary:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent-fill) 86%, #fff);
}

.btn.quiet {
  border-color: transparent;
  background: transparent;
  color: var(--ink-2);
}

.btn.quiet:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--ink);
}

.btn.danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
  background: transparent;
}

.btn.danger:hover:not(:disabled) {
  background: var(--danger-soft);
}

.btn.sm {
  min-height: 34px;
  padding: 0.3rem 0.7rem;
  font-size: 0.84rem;
}

.btn.wide {
  width: 100%;
}

/* A button mid-request says so, and stops accepting a second click. */
.btn[data-busy="true"] {
  position: relative;
  color: transparent;
}

.btn[data-busy="true"]::after {
  content: "";
  position: absolute;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-color: var(--ink) transparent var(--ink) transparent;
  animation: spin 700ms linear infinite;
}

.btn.primary[data-busy="true"]::after {
  border-color: var(--accent-ink) transparent var(--accent-ink) transparent;
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

/* ------------------------------------------------------------------- forms */

.form {
  display: grid;
  gap: 0.9rem;
}

.form.narrow {
  max-width: 24rem;
}

.field {
  display: grid;
  gap: 0.3rem;
}

.field > label {
  font-size: 0.86rem;
  font-weight: 550;
  color: var(--ink-2);
}

.field .hint {
  font-size: 0.78rem;
  color: var(--muted);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
select,
textarea {
  font: inherit;
  font-size: 0.95rem;
  width: 100%;
  padding: 0.6rem 0.7rem;
  min-height: 42px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: var(--surface-sunk);
  color: var(--ink);
}

textarea {
  min-height: 5.5rem;
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--muted);
}

input[aria-invalid="true"] {
  border-color: var(--danger);
}

::placeholder {
  color: var(--muted);
  opacity: 1;
}

.field-error {
  font-size: 0.8rem;
  color: var(--danger);
}

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 0.9rem;
  margin: 0;
}

legend {
  font-size: 0.8rem;
  color: var(--muted);
  padding-inline: 0.35rem;
}

/* --------------------------------------------------------------- messaging */

.notice {
  border: 1px solid var(--line);
  border-left: 3px solid var(--muted);
  border-radius: var(--r-md);
  padding: 0.7rem 0.85rem;
  font-size: 0.9rem;
  background: var(--surface-2);
  color: var(--ink-2);
}

.notice.error {
  border-left-color: var(--danger);
  background: var(--danger-soft);
  color: var(--ink);
}

.notice.ok {
  border-left-color: var(--ok);
  background: var(--ok-soft);
  color: var(--ink);
}

.notice.accent {
  border-left-color: var(--accent-fill);
  background: var(--accent-soft);
  color: var(--ink);
}

.notice strong {
  font-weight: 650;
}

.empty {
  padding: 1.75rem 1rem;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
  display: grid;
  gap: 0.6rem;
  justify-items: center;
}

.empty p {
  max-width: 38ch;
}

/* Toast: a mutation that succeeds says so without moving the page. */
.toasts {
  position: fixed;
  inset: auto 0 1rem;
  z-index: 70;
  display: grid;
  gap: 0.5rem;
  justify-items: center;
  pointer-events: none;
  padding-inline: 1rem;
}

.toast {
  pointer-events: auto;
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
  padding: 0.55rem 1.05rem;
  font-size: 0.88rem;
  box-shadow: var(--shadow);
  max-width: min(30rem, 100%);
  animation: toast-in 200ms ease backwards;
}

.toast[data-tone="error"] {
  background: var(--danger);
  color: #fff;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ---------------------------------------------------------------- skeletons */

/*
 * Skeletons match the real element's box exactly, so the first paint and the
 * loaded paint occupy identical space and nothing shifts.
 */
.skel {
  background: linear-gradient(
    90deg,
    var(--surface-2) 0%,
    var(--surface-sunk) 50%,
    var(--surface-2) 100%
  );
  background-size: 200% 100%;
  animation: sweep 1.3s linear infinite;
  border-radius: var(--r-md);
  color: transparent;
}

.skel.card {
  box-shadow: none;
  border-style: dashed;
}

.skel-line {
  height: 0.8rem;
  border-radius: 999px;
}

@keyframes sweep {
  to {
    background-position: -200% 0;
  }
}

/* ------------------------------------------------------------------ detail */

.detail {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  align-items: start;
}

@media (max-width: 900px) {
  .detail {
    grid-template-columns: minmax(0, 1fr);
  }
}

.detail-head h1 {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5.5vw, 3.1rem);
  line-height: 1;
  letter-spacing: -0.02em;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.86rem;
  margin-bottom: 0.9rem;
}

.back:hover {
  color: var(--ink);
}

.achievement {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}

.achievement .pts {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  color: var(--accent);
  margin-left: auto;
  padding-top: 0.1rem;
  white-space: nowrap;
}

.achievement.locked {
  opacity: 0.6;
}

.tick {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  flex: none;
  margin-top: 0.15rem;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
}

.achievement:not(.locked) .tick {
  background: var(--accent-fill);
  border-color: transparent;
  color: var(--accent-ink);
}

/* ------------------------------------------------------------------ consent */

/*
 * The consent screen is the highest-stakes screen in the product: it is where a
 * member hands a game access to their identity. It gets its own centered, quiet
 * layout so nothing competes with "who is asking" and "what they get".
 */
.consent {
  max-width: 34rem;
  margin: clamp(1rem, 6vh, 3.5rem) auto 0;
}

.consent-head {
  text-align: center;
  display: grid;
  gap: 0.6rem;
  justify-items: center;
  margin-bottom: 1.25rem;
}

.consent-head h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4.4vw, 2.1rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.handoff {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: center;
}

.handoff .arrow {
  color: var(--muted);
  font-family: var(--font-mono);
}

.scope-list > li {
  display: flex;
  gap: 0.7rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
  align-items: flex-start;
}

.scope-list > li:last-child {
  border-bottom: 0;
}

.scope-list .mark {
  color: var(--accent);
  flex: none;
  line-height: 1.5;
}

.scope-list b {
  font-weight: 600;
  display: block;
  font-size: 0.94rem;
}

.scope-list span {
  color: var(--muted);
  font-size: 0.84rem;
}

.consent-actions {
  display: grid;
  gap: 0.6rem;
  margin-top: 1.1rem;
}

@media (min-width: 480px) {
  .consent-actions {
    grid-template-columns: 1fr 1.4fr;
  }
}

/* ------------------------------------------------------------------- tabs */

.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tabs a {
  text-decoration: none;
  color: var(--muted);
  padding: 0.5rem 0.8rem;
  font-size: 0.9rem;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
}

.tabs a:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.tabs a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent-fill);
}

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

.foot {
  border-top: 1px solid var(--line);
  padding-block: 1.5rem 2.5rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.foot a {
  color: var(--muted);
}

/* ------------------------------------------------------------------ utility */

.cols-2 {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}

.gap-sm {
  --gap: 0.5rem;
}

.gap-lg {
  --gap: 1.5rem;
}

.pill-rail {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.searchbar {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.searchbar .field {
  flex: 1 1 12rem;
}

.people > li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.people > li:last-child {
  border-bottom: 0;
}

.people .who-name {
  font-weight: 550;
  font-size: 0.95rem;
}

.people .who-handle {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.people .actions {
  margin-left: auto;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* At 375px, right-aligned action clusters would overflow; they wrap to a full
   row of their own instead. */
@media (max-width: 460px) {
  .people .actions,
  .ledger .actions {
    margin-left: 0;
    width: 100%;
  }

  .people .actions .btn,
  .ledger .actions .btn {
    flex: 1 1 auto;
  }
}

.feed-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.feed-item:last-child {
  border-bottom: 0;
}

.feed-item p {
  font-size: 0.94rem;
}

.feed-item time {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

table.data th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
  padding: 0 0.6rem 0.5rem 0;
  border-bottom: 1px solid var(--line);
}

table.data td {
  padding: 0.6rem 0.6rem 0.6rem 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.scroll-x {
  overflow-x: auto;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Download verification: the SHA-256 is only interesting to someone who asked
   for it, so it stays collapsed rather than filling the card with a hex wall. */
.checksum {
  margin-top: 0.75rem;
  font-size: 0.85rem;
}
.checksum summary {
  cursor: pointer;
  color: var(--ink-soft, inherit);
}
.checksum pre {
  overflow-x: auto;
  padding: 0.5rem 0.6rem;
  border-radius: var(--r-sm, 6px);
  background: var(--surface-sunk, rgba(0, 0, 0, 0.04));
}
/* A 64-character hash has no spaces to wrap on. */
.break {
  overflow-wrap: anywhere;
}
