/* Agora design system.
   One file, one set of tokens. Warm paper in light mode, warm charcoal in
   dark mode (follows the system setting). Serif display type, a sans-serif
   for reading, tabular numbers, hairline rules instead of floating cards,
   one accent colour used sparingly. Game boards are physical objects and
   keep their own materials. */

/* ---------- tokens ---------- */
:root {
  color-scheme: light;
  --bg: #f3efe6;
  --surface: #fbf9f4;
  --surface-2: #ebe5d8;
  --sunk: #e6e0d2;
  --ink: #1b1a17;
  --ink-2: #5c5850;
  --ink-3: #8a857a;
  --rule: #d8d1c1;
  --rule-strong: #1b1a17;
  --accent: #c8104e;
  --accent-soft: #f6dce4;
  --on-accent: #fff;
  --ok: #1d7448;
  --ok-soft: #dcebdf;
  --warn: #9a5a00;
  --warn-soft: #f5e6c8;
  --err: #b3261e;
  --err-soft: #f6dcd8;
  --p1: #e0336f;
  --p1-hi: #ff7aa6;
  --p2: #5b4bd6;
  --p2-hi: #9d90ff;
  --board: #23252d;
  --board-cell: #30333d;
  --shadow: 0 1px 0 rgba(27, 26, 23, .06), 0 8px 24px -12px rgba(27, 26, 23, .25);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", monospace;
  --r: 6px;
  --r-sm: 4px;
  --page: 1080px;
  --gutter: clamp(1rem, 3.5vw, 2.2rem);
  /* names kept for older markup */
  --text: var(--ink);
  --muted: var(--ink-2);
  --line: var(--rule);
  --panel: var(--surface);
  --panel2: var(--surface-2);
  --accent2: var(--p2);
  --grad: var(--accent);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #141311;
    --surface: #1c1b18;
    --surface-2: #26241f;
    --sunk: #100f0d;
    --ink: #ede8dc;
    --ink-2: #a9a395;
    --ink-3: #7d786d;
    --rule: #34312b;
    --rule-strong: #ede8dc;
    --accent: #ff4d84;
    --accent-soft: #3b1d27;
    --on-accent: #1a0710;
    --ok: #5ccb8f;
    --ok-soft: #1c2f24;
    --warn: #f0b04a;
    --warn-soft: #33281a;
    --err: #ff7a6b;
    --err-soft: #3a1f1c;
    --board: #24262e;
    --board-cell: #31343f;
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, .7);
  }
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font: 400 15.5px/1.55 var(--sans);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--accent); }
::selection { background: var(--accent); color: var(--on-accent); }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.15; font-weight: 600; }
h1 { font-family: var(--serif); font-size: clamp(1.9rem, 4.4vw, 2.7rem); letter-spacing: -.015em; font-weight: 600; }
h2 { font-family: var(--serif); font-size: 1.35rem; margin-top: 2.2rem; display: flex; align-items: center; gap: .5rem; letter-spacing: -.005em; }
h2 .icon { display: none; }
h3 { font-size: 1rem; }
h4 { font-size: .74rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: .09em; font-weight: 600; }
p { margin: 0 0 .8em; }
.muted { color: var(--ink-2); }
.small { font-size: .82rem; }
.mono, code { font-family: var(--mono); font-size: .84em; }
.wrap { overflow-wrap: anywhere; }
.center { text-align: center; }
[hidden] { display: none !important; }
.icon { flex: none; vertical-align: -4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 200; background: var(--ink); color: var(--bg); padding: .5rem .8rem; border-radius: var(--r-sm); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h3, .todo span, .note-line span, .bubble, .kv dd, .asset, .ad-text { overflow-wrap: anywhere; }
h3 a { color: inherit; text-decoration: none; }
h3 a:hover { text-decoration: underline; text-decoration-color: var(--accent); }

/* ---------- top bar ---------- */
#progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: var(--accent); z-index: 100; opacity: 0; transition: width .25s ease, opacity .3s ease; }
#progress.on { width: 70%; opacity: 1; transition: width 4s cubic-bezier(.1, .7, .1, 1), opacity .1s; }
#progress.done { width: 100%; opacity: 0; }

header.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap;
  padding: .75rem var(--gutter);
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}
.logo { display: inline-flex; align-items: baseline; gap: .1rem; font-family: var(--serif); font-weight: 700; font-size: 1.45rem; letter-spacing: -.02em; text-decoration: none; line-height: 1; }
.mark { width: .42rem; height: .42rem; background: var(--accent); border-radius: 50%; display: inline-block; order: 2; margin-left: .08rem; }
nav { display: flex; gap: 1.3rem; flex: 1; overflow-x: auto; scrollbar-width: none; }
nav::-webkit-scrollbar { display: none; }
nav a { position: relative; display: inline-flex; align-items: center; gap: .4rem; padding: .35rem 0; text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: .93rem; white-space: nowrap; border-bottom: 2px solid transparent; }
nav a .icon { display: none; }
nav a:hover { color: var(--ink); }
nav a.active { color: var(--ink); border-bottom-color: var(--accent); }
.nav-badge { min-width: 1.1rem; height: 1.1rem; padding: 0 .28rem; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: .66rem; font-weight: 700; display: inline-grid; place-items: center; line-height: 1; }
.top-right { display: flex; align-items: center; gap: .7rem; margin-left: auto; }
.balance { font-size: .82rem; color: var(--ink-2); white-space: nowrap; font-family: var(--mono); }
.balance b { color: var(--ink); font-weight: 500; }
#net select { font-size: .82rem; padding: .32rem 1.6rem .32rem .55rem; }
#account .btn { white-space: nowrap; }
.bell { position: relative; display: inline-flex; align-items: center; gap: .2rem; }
.bell .nav-badge { position: absolute; top: -5px; right: -5px; }
.panel { position: fixed; top: 60px; right: var(--gutter); z-index: 80; width: min(380px, calc(100vw - 2rem)); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); padding: 1rem; box-shadow: var(--shadow); display: grid; gap: .7rem; }
.panel h3 { margin: 0; }

/* ---------- page frame ---------- */
main { width: 100%; max-width: var(--page); margin: 0 auto; padding: 2rem var(--gutter) 4rem; flex: 1; }
main:focus { outline: none; }
.page-head { margin-bottom: 1.4rem; padding-bottom: 1.1rem; border-bottom: 1px solid var(--rule-strong); }
.page-head h1 { display: flex; align-items: center; gap: .6rem; margin-bottom: .3rem; }
.page-head h1 .icon { display: none; }
.page-head p { color: var(--ink-2); max-width: 64ch; font-size: 1.02rem; margin: 0; }
.foot { border-top: 1px solid var(--rule); padding: 1.4rem var(--gutter) 1.6rem; font-size: .84rem; color: var(--ink-2); }
.foot p { margin: .15rem auto; max-width: var(--page); }
.foot b { color: var(--ink); font-weight: 600; }
.foot a { color: var(--ink); }

/* ---------- layout helpers ---------- */
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 1.2rem; margin: 1.2rem 0; }
.cols.wide-left { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: start; }
.list, .stack { display: flex; flex-direction: column; gap: .7rem; }
.row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row > input { flex: 1; min-width: 140px; }
.spacer { flex: 1; }
.arrow { color: var(--ink-3); font-family: var(--serif); font-style: italic; }
.amount { color: var(--ok); white-space: nowrap; font-weight: 600; font-family: var(--mono); font-size: .92em; }

/* ---------- surfaces ---------- */
.card, .item { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); padding: 1.1rem 1.2rem; }
.card { display: flex; flex-direction: column; gap: .75rem; }
.card > h3:first-child, .card > h2:first-child { margin-top: 0; }
.item { display: flex; flex-direction: column; gap: .55rem; transition: border-color .15s; }
.item:hover { border-color: color-mix(in srgb, var(--ink) 30%, var(--rule)); }
.item header { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.empty { color: var(--ink-2); text-align: center; padding: 2rem 1rem; border: 1px dashed var(--rule); border-radius: var(--r); display: grid; gap: .7rem; justify-items: center; font-family: var(--serif); font-style: italic; }
.empty .btn { font-family: var(--sans); font-style: normal; }

/* ---------- buttons ---------- */
.btn {
  font: inherit; font-weight: 600; font-size: .9rem; line-height: 1.2;
  color: var(--ink); background: var(--surface); border: 1px solid color-mix(in srgb, var(--ink) 28%, var(--rule));
  border-radius: var(--r-sm); padding: .58rem 1rem; cursor: pointer;
  white-space: normal; text-align: center;
  transition: background .12s, border-color .12s, color .12s, transform .05s;
}
.btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--ink); }
.btn:not(:disabled):active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.ghost { background: transparent; border-color: transparent; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: .25em; }
.btn.ghost:hover:not(:disabled) { background: transparent; border-color: transparent; text-decoration-color: var(--accent); }
.btn.small { padding: .3rem .6rem; font-size: .8rem; }
.btn.big { padding: .8rem 1.35rem; font-size: 1rem; }
.btn.wide { width: 100%; text-align: left; }
.btn.small, nav a, .tab { white-space: nowrap; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; }
a.btn.ghost { text-decoration: underline; text-decoration-color: var(--rule); }
.btn .icon { vertical-align: -3px; }
.link-btn { all: unset; cursor: pointer; color: var(--ink); font-size: .84rem; font-weight: 600; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: .2em; }
.link-btn:focus-visible { outline: 2px solid var(--accent); border-radius: 2px; }
.suggestions .btn { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; overflow: visible; text-align: left; }

/* ---------- forms ---------- */
input, textarea, select {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--ink) 22%, var(--rule)); border-radius: var(--r-sm);
  padding: .55rem .7rem; width: 100%; min-width: 0;
  transition: border-color .12s, box-shadow .12s;
}
input:hover, textarea:hover, select:hover { border-color: color-mix(in srgb, var(--ink) 45%, var(--rule)); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
textarea { resize: vertical; }
select { width: auto; cursor: pointer; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--accent); }
input.narrow { width: 90px; flex: none !important; min-width: 0 !important; }
.field { display: flex; flex-direction: column; gap: .32rem; flex: 1; min-width: 0; }
.label { font-size: .8rem; color: var(--ink); font-weight: 600; }
.hint { font-size: .8rem; color: var(--ink-2); }
.hint.err { color: var(--err); }
.hints { justify-content: space-between; gap: .2rem 1rem; }
.hints .hint:empty { display: none; }
.who { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; min-height: 1.2rem; }
.picker { display: grid; gap: .5rem; }
.amount-input { display: grid; gap: .35rem; }
.amount-input > .row > input { flex: 1 1 110px; }
.chips { display: flex; gap: .3rem; flex-wrap: wrap; }
.chip-btn { all: unset; cursor: pointer; font-size: .78rem; font-weight: 600; padding: .28rem .6rem; border-radius: var(--r-sm); border: 1px solid var(--rule); color: var(--ink-2); font-family: var(--mono); }
.chip-btn:hover { color: var(--ink); border-color: var(--ink); }
.chip-btn:focus-visible { outline: 2px solid var(--accent); }
.check { display: flex; gap: .55rem; align-items: flex-start; font-size: .88rem; color: var(--ink-2); cursor: pointer; }
.check input { margin-top: .22rem; }
details.create > summary, details.book > summary { cursor: pointer; list-style: none; }
details.create > summary::-webkit-details-marker, details.book > summary::-webkit-details-marker { display: none; }
details.create > summary h3 { display: inline; }
details.create > summary::after { content: " +"; color: var(--ink-3); }
details.create[open] > summary::after { content: " –"; }
details.create { margin: 1rem 0; }
details.book { display: flex; flex-direction: column; gap: .6rem; }
details.book > summary { color: var(--accent); font-weight: 600; }
details.book[open] > * + * { margin-top: .6rem; }

/* ---------- badges, chips, notes ---------- */
.badge { font-size: .7rem; font-weight: 600; padding: .14rem .45rem; border-radius: var(--r-sm); background: var(--surface-2); color: var(--ink-2); white-space: nowrap; letter-spacing: .01em; }
.badge.ok { color: var(--ok); background: var(--ok-soft); }
.badge.warn { color: var(--warn); background: var(--warn-soft); }
.badge.you { color: var(--accent); background: var(--accent-soft); margin-left: .2rem; }
.chip { display: inline-flex; align-items: center; gap: .45rem; min-width: 0; }
a.chip { text-decoration: none; }
a.chip:hover .pname { text-decoration: underline; text-decoration-color: var(--accent); }
.avatar { border-radius: 50%; flex: none; overflow: hidden; display: inline-block; box-shadow: 0 0 0 1px var(--rule); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ptext { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.pname { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 16ch; }
.paddr { color: var(--ink-3); font-size: .7rem; font-family: var(--mono); }
.note { border-radius: var(--r-sm); padding: .65rem .9rem; font-size: .9rem; background: var(--surface-2); border-left: 3px solid var(--ink-3); margin: .7rem 0; }
.note b { font-weight: 600; }
.note.warn { background: var(--warn-soft); border-left-color: var(--warn); color: var(--ink); }
.note.err { background: var(--err-soft); border-left-color: var(--err); color: var(--ink); }
.bubble { background: var(--surface-2); border-radius: var(--r); padding: .65rem .85rem; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.reply { border-left: 3px solid var(--ok); margin-left: 1.2rem; }
.bubble.private { background: transparent; border: 1px dashed color-mix(in srgb, var(--p2) 60%, transparent); }
.bubble.private .icon { color: var(--p2); }
.copybox { display: flex; gap: .5rem; align-items: center; background: var(--sunk); border: 1px solid var(--rule); border-radius: var(--r-sm); padding: .35rem .45rem .35rem .65rem; }
.copybox code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; color: var(--ink-2); }
.stat { display: flex; flex-direction: column; font-size: .78rem; color: var(--ink-2); }
.stat b { color: var(--ink); font-size: 1.05rem; font-weight: 600; }
.share { gap: .4rem; }

/* ---------- tabs and switches ---------- */
.tabs { display: flex; gap: 1.4rem; border-bottom: 1px solid var(--rule); margin: 1.4rem 0 1.1rem; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { all: unset; white-space: nowrap; flex: none; cursor: pointer; padding: .55rem 0; font-weight: 500; font-size: .94rem; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: .45rem; align-items: center; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.tab .count { font-size: .7rem; background: var(--surface-2); border-radius: var(--r-sm); padding: .04rem .4rem; color: var(--ink-2); font-weight: 600; }
.tab .count.hot { background: var(--accent); color: var(--on-accent); }
.tabpanel > section:first-child > h2:first-child { margin-top: .2rem; }
.switch { display: inline-flex; gap: 0; border: 1px solid var(--ink); border-radius: var(--r-sm); margin: .2rem 0 1rem; overflow: hidden; }
.switch a { display: inline-flex; align-items: center; gap: .4rem; padding: .42rem 1rem; text-decoration: none; font-weight: 600; font-size: .88rem; color: var(--ink); }
.switch a + a { border-left: 1px solid var(--ink); }
.switch a .icon { display: none; }
.switch a:hover { background: var(--surface-2); }
.switch a.on { background: var(--ink); color: var(--bg); }

/* explainer ("How it works") */
details.how { margin: .2rem 0 .4rem; }
details.how > summary { cursor: pointer; color: var(--ink); font-size: .88rem; font-weight: 600; list-style: none; display: inline-flex; gap: .4rem; align-items: center; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: .25em; }
details.how > summary::-webkit-details-marker { display: none; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 0; margin: .9rem 0 1.3rem; counter-reset: step; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.steps li { counter-increment: step; padding: .9rem 1.1rem 1rem 0; font-size: .9rem; color: var(--ink-2); border-bottom: 1px solid var(--rule); }
.steps li::before { content: counter(step, decimal-leading-zero); display: block; font-family: var(--serif); font-style: italic; color: var(--accent); font-size: 1.1rem; margin-bottom: .2rem; }
.steps li b { display: block; color: var(--ink); font-weight: 600; margin-bottom: .1rem; }

/* ---------- home ---------- */
.hero { max-width: 820px; padding: 1.6rem 0 1.8rem; }
.hero h1 { font-size: clamp(2.3rem, 6vw, 3.9rem); line-height: 1.02; letter-spacing: -.025em; margin-bottom: .9rem; }
.hero h1 em { font-style: italic; color: var(--accent); font-weight: 500; }
.hero p { color: var(--ink-2); font-size: 1.12rem; max-width: 56ch; }
.hero .row { margin-top: 1.4rem; gap: .9rem; }
.strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); margin: 1.6rem 0; border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule); }
.strip > div { padding: .9rem 1rem .9rem 0; }
.strip > div + div { padding-left: 1rem; border-left: 1px solid var(--rule); }
.strip b { display: block; font-family: var(--serif); font-size: 1.7rem; font-weight: 600; letter-spacing: -.01em; }
.strip span { color: var(--ink-2); font-size: .8rem; }

/* the directory of features: an index, not a wall of cards */
.features { display: grid; grid-template-columns: 1fr; margin: 1.6rem 0 0; border-top: 1px solid var(--rule-strong); }
.feature {
  display: grid; grid-template-columns: 2.2rem minmax(7rem, 9rem) 1fr minmax(8rem, 11rem);
  grid-template-areas: "icon name title meta" "icon name text meta";
  column-gap: 1.2rem; row-gap: .1rem; align-items: baseline;
  padding: 1.05rem .4rem 1.1rem; border-bottom: 1px solid var(--rule); text-decoration: none;
  transition: background .12s;
}
.feature:hover { background: var(--surface); }
.feature:hover h3 { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: .2em; }
.feature .ficon { grid-area: icon; color: var(--ink-2); align-self: start; padding-top: .1rem; }
.feature:hover .ficon { color: var(--accent); }
.fname { grid-area: name; font-family: var(--serif); font-size: 1.25rem; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.feature h3 { grid-area: title; margin: 0; font-size: 1rem; }
.feature p { grid-area: text; margin: 0; color: var(--ink-2); font-size: .92rem; max-width: 60ch; }
.fmeta { grid-area: meta; display: flex; flex-direction: column; align-items: flex-end; gap: .1rem; font-size: .78rem; color: var(--ink-2); font-family: var(--mono); text-align: right; align-self: center; }
.trust ul { padding-left: 1.1rem; color: var(--ink-2); display: grid; gap: .45rem; margin: 0; }
.trust b { color: var(--ink); font-weight: 600; }
.trust.card { margin-top: 2.4rem; background: transparent; border: 0; border-top: 1px solid var(--rule-strong); border-radius: 0; padding: 1.2rem 0 0; }

/* desk, checklist, feed, leaderboard */
.todo { display: flex; align-items: center; gap: .7rem; padding: .6rem .2rem; border-bottom: 1px solid var(--rule); text-decoration: none; font-weight: 500; font-size: .93rem; }
.todo:hover { color: var(--accent); }
.todo > span:first-child { flex: 1; }
.todo .icon { color: var(--ink-3); }
.meter { height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--accent); }
.progress { height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; }
.checklist a { display: flex; gap: .65rem; align-items: center; text-decoration: none; padding: .55rem .1rem; border-bottom: 1px solid var(--rule); font-weight: 500; font-size: .92rem; }
.checklist a:hover .task { text-decoration: underline; text-decoration-color: var(--accent); }
.checklist .box { width: 18px; height: 18px; border-radius: 3px; border: 1.5px solid var(--ink-3); display: grid; place-items: center; flex: none; font-size: .72rem; }
.checklist .done .task { color: var(--ink-3); text-decoration: line-through; }
.checklist .done .box { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.stats { gap: 1.4rem; }
.feed { display: flex; flex-direction: column; border-top: 1px solid var(--rule-strong); }
.feed-line { display: flex; align-items: center; gap: .6rem; padding: .6rem .1rem; border-bottom: 1px solid var(--rule); font-size: .9rem; }
.feed-text { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; min-width: 0; }
.feed-text .ptext .paddr { display: none; }
.feed-line a { text-decoration: none; white-space: nowrap; }
.feed-line > .muted:last-child, .feed-line > .small:last-child { font-family: var(--mono); font-size: .76rem; }
.board { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule-strong); }
.board li { display: flex; align-items: center; gap: .7rem; padding: .6rem .1rem; border-bottom: 1px solid var(--rule); }
.rank { width: 1.6rem; text-align: right; font-family: var(--serif); font-style: italic; font-size: 1.05rem; color: var(--ink-3); }
.board li:first-child .rank { color: var(--accent); }

/* profile */
.profile-head .pname { font-family: var(--serif); font-size: 1.8rem; max-width: 22ch; font-weight: 600; }
.profile-head .paddr { font-size: .8rem; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 0; margin: 1.2rem 0; border-top: 1px solid var(--rule-strong); }
.stat-card { gap: .15rem; padding: .85rem 1rem .9rem 0; background: transparent; border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; }
.stat-card b { font-family: var(--serif); font-size: 1.35rem; }

/* safety */
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: .9rem; }
.checks li { display: flex; gap: .75rem; align-items: flex-start; }
.checks p { margin: .1rem 0 0; font-size: .9rem; color: var(--ink-2); }
.tick { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); flex: none; }
.checks.warn .tick { background: var(--warn-soft); color: var(--warn); }
.contract-row { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: center; }
.contract-row code { font-size: .78rem; color: var(--ink-2); }

/* ---------- ping, swap, billboard, gigs ---------- */
.side { display: flex; flex-direction: column; gap: .6rem; align-items: flex-start; }
.side .stack { width: 100%; }
.boost { border-top: 1px dashed var(--rule); padding-top: .6rem; }
.asset-row { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.asset-row input { flex: 1; min-width: 120px; }
.swap { display: grid; grid-template-columns: 1fr auto 1fr; gap: .9rem; align-items: center; }
.swap-arrow { font-size: 1.3rem; color: var(--ink-3); font-family: var(--serif); }
.assets { display: flex; flex-wrap: wrap; gap: .4rem; }
.asset { background: var(--surface-2); border-radius: var(--r-sm); padding: .3rem .6rem; font-weight: 600; font-size: .86rem; }
.asset.lyx { color: var(--ok); font-family: var(--mono); }
.notes { display: flex; flex-direction: column; gap: .4rem; }
.note-line { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; font-size: .9rem; }
.applicant { border: 1px solid var(--rule); border-radius: var(--r); padding: .65rem .75rem; display: flex; flex-direction: column; gap: .4rem; }
.tile-row { display: flex; flex-direction: column; gap: .4rem; align-items: flex-start; padding-top: .65rem; border-top: 1px solid var(--rule); }
.tile-row .copybox { width: 100%; }
.ad { display: flex; align-items: center; gap: .85rem; flex-wrap: wrap; background: var(--surface-2); border: 1px solid var(--rule); border-radius: var(--r); padding: .75rem; text-decoration: none; font-weight: 600; overflow-wrap: anywhere; }
.ad img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--r-sm); flex: none; }
.ad-img:empty { display: none; }
.ad-host { flex-basis: 100%; font-size: .75rem; font-weight: 500; color: var(--ink-2); font-family: var(--mono); }
.ad-page { display: grid; place-items: center; min-height: 100vh; padding: .8rem; }
.ad-page #tile { width: 100%; max-width: 520px; display: flex; flex-direction: column; gap: .5rem; }
.ad-page #tile .ad { flex-direction: column; text-align: center; font-size: 1.05rem; padding: 1.2rem; }
.ad-page #tile .ad img { width: 100%; height: auto; max-height: 55vh; object-fit: contain; }
.ad-page .tag { font-size: .7rem; color: var(--ink-2); text-align: center; }

/* ---------- modal, toasts, transaction progress ---------- */
.modal-back { position: fixed; inset: 0; background: color-mix(in srgb, #0d0c0a 55%, transparent); display: grid; place-items: center; padding: 1rem; z-index: 50; overflow-y: auto; }
.modal { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); padding: 1.4rem 1.5rem; width: min(560px, 100%); max-height: calc(100vh - 2rem); overflow-y: auto; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); }
.modal h2, .modal h3 { margin-top: 0; font-family: var(--serif); font-size: 1.4rem; }
.kv { display: grid; grid-template-columns: minmax(90px, auto) 1fr; gap: 0 1rem; margin: .9rem 0; font-size: .9rem; border-top: 1px solid var(--rule); }
.kv dt, .kv dd { padding: .45rem 0; border-bottom: 1px solid var(--rule); }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.raw { margin: .6rem 0; font-size: .85rem; }
.raw summary { cursor: pointer; color: var(--ink-2); }
.raw > div { margin-top: .4rem; }
#toasts { position: fixed; bottom: 1rem; right: 1rem; left: 1rem; display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; z-index: 60; pointer-events: none; }
.toast { pointer-events: auto; background: var(--ink); color: var(--bg); border-radius: var(--r-sm); padding: .65rem .95rem; max-width: 420px; font-size: .9rem; box-shadow: var(--shadow); border-left: 3px solid var(--ink-3); }
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--err); }
.toast a { color: inherit; }
#txbox { position: fixed; right: 1rem; bottom: 1rem; z-index: 70; display: flex; flex-direction: column; gap: .5rem; width: min(380px, calc(100vw - 2rem)); }
.tx-card { background: var(--surface); border: 1px solid var(--rule); border-left: 3px solid var(--p2); border-radius: var(--r-sm); padding: .75rem .9rem; box-shadow: var(--shadow); display: grid; gap: .3rem; font-size: .9rem; }
.tx-card.ok { border-left-color: var(--ok); }
.tx-card.err { border-left-color: var(--err); }
.tx-head { display: flex; align-items: center; gap: .5rem; }
.tx-head b { flex: 1; font-weight: 600; }
.tx-close { all: unset; cursor: pointer; color: var(--ink-3); padding: 0 .25rem; }
.tx-close:focus-visible { outline: 2px solid var(--accent); border-radius: 2px; }
.tx-step { color: var(--ink-2); }
.tx-card.ok .tx-step { color: var(--ok); }
.tx-card.err .tx-step { color: var(--err); }
.tx-link a { color: var(--ink); font-size: .82rem; }
.spinner { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--rule); border-top-color: var(--ink); animation: spin .8s linear infinite; flex: none; }
.tx-card.ok .spinner, .tx-card.err .spinner { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* loading */
.skeleton { display: grid; gap: .9rem; padding-top: 1rem; }
.skeleton div { height: 86px; border-radius: var(--r); background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
.skeleton div:first-child { height: 46px; width: 55%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- games: shared ---------- */
.thumb { width: 44px; flex: none; display: inline-block; line-height: 0; }
.thumb .art { width: 100%; height: auto; border-radius: var(--r-sm); display: block; }
.thumb.big { width: 60px; }
.with-art { display: flex; align-items: center; gap: .65rem; }
.item header .thumb { margin-right: .15rem; }
.game-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: .55rem; }
.game-tile { all: unset; position: relative; cursor: pointer; display: grid; gap: .4rem; padding: .4rem .4rem .55rem; border-radius: var(--r); background: var(--surface); border: 1px solid var(--rule); text-align: center; transition: border-color .12s, transform .12s; }
.game-tile:hover { border-color: var(--ink); }
.game-tile[aria-checked="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: var(--surface-2); }
.game-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.game-tile .art { width: 100%; height: auto; border-radius: var(--r-sm); display: block; }
.tile-name { font-weight: 600; font-size: .84rem; }
.tile-new { position: absolute; top: 8px; right: 8px; padding: 1px 6px; border-radius: 2px; background: var(--accent); color: var(--on-accent); font-size: .6rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.duel { display: grid; grid-template-columns: minmax(240px, 320px) 1fr; gap: 2rem; align-items: start; margin-top: 1.2rem; }
.duel-side { display: flex; flex-direction: column; gap: .8rem; }
.duel-side h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
.player { display: flex; align-items: center; gap: .6rem; padding: .55rem .75rem; border: 1px solid var(--rule); border-radius: var(--r); background: var(--surface); flex-wrap: wrap; }
.player.active { border-color: var(--ink); box-shadow: inset 3px 0 0 var(--accent); }
.disc { width: 16px; height: 16px; border-radius: 50%; flex: none; }
.disc.p1, .cell.p1 { background: radial-gradient(circle at 35% 30%, var(--p1-hi), var(--p1)); }
.disc.p2, .cell.p2 { background: radial-gradient(circle at 35% 30%, var(--p2-hi), var(--p2)); }
.board-col { width: 100%; max-width: 560px; justify-self: center; }
.score { justify-content: center; gap: .5rem; font-weight: 600; color: var(--ink); font-family: var(--mono); font-size: .82rem; }
.score .spacer { flex: 0 0 2rem; }
.my-turn { animation: turn 2.6s ease-in-out infinite; }
@keyframes turn {
  0%, 100% { box-shadow: var(--shadow), 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); }
  50% { box-shadow: var(--shadow), 0 0 0 4px color-mix(in srgb, var(--accent) 35%, transparent); }
}

/* Connect Four */
.c4 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; background: #1f3f9a; border-radius: 12px; padding: 10px; max-width: 520px; width: 100%; justify-self: center; box-shadow: var(--shadow); }
.c4 .col { all: unset; display: grid; gap: 4px; padding: 2px; border-radius: 8px; }
.c4.my-turn .col:not(:disabled) { cursor: pointer; }
.c4.my-turn .col:not(:disabled):hover, .c4 .col:focus-visible { background: rgba(255, 255, 255, .1); outline: 2px solid #ffd27a; }
.cell { aspect-ratio: 1; border-radius: 50%; background: var(--bg); box-shadow: inset 0 3px 5px rgba(0, 0, 0, .45); }
.cell.win { box-shadow: 0 0 0 3px #fff, 0 0 16px rgba(255, 255, 255, .6); }

/* square boards: Five in a Row (wood), Reversi (felt), Tic-Tac-Toe */
.grid-board { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 2px; padding: 8px; border-radius: 10px; width: 100%; max-width: 560px; justify-self: center; box-shadow: var(--shadow); }
.grid-board.g1 { background: #b88a4a; gap: 1px; padding: 6px; }
.g1 .sq { background: #dcb77a; border-radius: 1px; }
.grid-board.g2 { background: #0f3a28; }
.g2 .sq { background: #17603f; border-radius: 2px; }
.grid-board.g5 { background: var(--board); gap: 6px; padding: 10px; max-width: 360px; }
.g5 .sq { background: var(--board-cell); border-radius: 8px; }
.sq { all: unset; aspect-ratio: 1; display: grid; place-items: center; border-radius: 4px; background: rgba(0, 0, 0, .25); }
.sq.ok { cursor: pointer; }
.sq.ok:hover, .sq:focus-visible { background: rgba(255, 255, 255, .2); outline: 2px solid #ffd27a; outline-offset: -2px; }
.stone { width: 82%; height: 82%; border-radius: 50%; display: block; }
.stone.p1 { background: radial-gradient(circle at 35% 30%, var(--p1-hi), var(--p1)); box-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.stone.p2 { background: radial-gradient(circle at 35% 30%, var(--p2-hi), var(--p2)); box-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.stone.win { box-shadow: 0 0 0 2px #fff, 0 0 12px rgba(255, 255, 255, .7); }
.g2 .sq.ok .stone:not(.p1):not(.p2) { width: 24%; height: 24%; background: rgba(255, 255, 255, .4); }
.ttt-mark { font-size: clamp(2rem, 9vw, 3.4rem); font-weight: 700; line-height: 1; font-family: var(--serif); }
.ttt-mark.p1 { color: var(--p1-hi); }
.ttt-mark.p2 { color: var(--p2-hi); }
.ttt-mark.win { text-shadow: 0 0 16px rgba(255, 255, 255, .8); }

/* Mancala (wood) */
.mancala { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: 1fr 1fr; gap: 8px; padding: 12px; border-radius: 22px; background: linear-gradient(160deg, #7a4a24, #4f2e14); box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .15); width: 100%; max-width: 620px; justify-self: center; color: #fbeedd; }
.mancala .store { grid-row: 1 / 3; width: clamp(44px, 9vw, 64px); border-radius: 999px; background: rgba(0, 0, 0, .32); box-shadow: inset 0 3px 8px rgba(0, 0, 0, .45); display: grid; place-items: center; }
.mancala .store .seeds { font-size: 1.3rem; font-weight: 700; }
.mancala .store.o0 .seeds { color: var(--p1-hi); }
.mancala .store.o1 .seeds { color: var(--p2-hi); }
.mancala .pits { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.mancala .store.o1 { grid-column: 1; grid-row: 1 / 3; }
.mancala .store.o0 { grid-column: 3; grid-row: 1 / 3; }
.mancala .pits.top { grid-column: 2; grid-row: 1; }
.mancala .pits.bottom { grid-column: 2; grid-row: 2; }
.mancala .pits { min-width: 0; }
.pit { all: unset; aspect-ratio: 1; border-radius: 50%; background: rgba(0, 0, 0, .32); box-shadow: inset 0 3px 6px rgba(0, 0, 0, .45); display: grid; place-items: center; align-content: center; position: relative; }
.pit .seeds { font-weight: 700; font-size: 1.05rem; }
.pit .dots { font-size: .55rem; letter-spacing: 1px; line-height: 1; max-width: 80%; text-align: center; overflow-wrap: anywhere; }
.pit.o0 .dots { color: var(--p1-hi); }
.pit.o1 .dots { color: var(--p2-hi); }
.pit.ok { cursor: pointer; box-shadow: inset 0 0 0 2px #ffd27a; }
.pit.ok:hover, .pit:focus-visible { background: rgba(255, 255, 255, .14); outline: 2px solid #ffd27a; }

/* Dots and Boxes */
div.dots { display: grid; grid-template-columns: repeat(4, 14px 1fr) 14px; grid-template-rows: repeat(4, 14px 1fr) 14px; aspect-ratio: 1; width: 100%; max-width: 460px; justify-self: center; padding: 14px; border-radius: 10px; background: var(--board); box-shadow: var(--shadow); }
.dots .dot { width: 14px; height: 14px; border-radius: 50%; background: #e9e4d6; z-index: 1; }
.dots .box { margin: 3px; border-radius: 4px; transition: background .2s; }
.dots .box.p1 { background: color-mix(in srgb, var(--p1) 50%, transparent); }
.dots .box.p2 { background: color-mix(in srgb, var(--p2) 55%, transparent); }
.dots .line { all: unset; display: block; border-radius: 4px; background: rgba(255, 255, 255, .06); }
.dots .line.h { height: 8px; align-self: center; margin: 0 -2px; }
.dots .line.v { width: 8px; justify-self: center; margin: -2px 0; }
.dots .line.p1 { background: var(--p1); }
.dots .line.p2 { background: var(--p2-hi); }
.dots .line.ok { cursor: pointer; background: rgba(255, 255, 255, .14); }
.dots .line.ok:hover, .dots .line:focus-visible { background: #ffd27a; outline: none; }

/* Hex */
.hex {
  --w: min(8.2vw, 44px); --hh: calc(var(--w) * 1.1547); --gap: 3px;
  display: grid; justify-content: center; justify-self: center; padding: 16px 18px; border-radius: 10px; background: var(--board);
  border-top: 4px solid var(--p1); border-bottom: 4px solid var(--p1); border-left: 4px solid var(--p2); border-right: 4px solid var(--p2);
  box-shadow: var(--shadow);
}
.hex-row { display: flex; gap: var(--gap); margin-left: calc(var(--r) * (var(--w) + var(--gap)) / 2); }
.hex-row + .hex-row { margin-top: calc(var(--hh) * -.25 + var(--gap)); }
.hx { all: unset; box-sizing: border-box; width: var(--w); height: var(--hh); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); background: var(--board-cell); transition: background .15s; }
.hx.e1 { background: color-mix(in srgb, var(--p1) 22%, var(--board-cell)); }
.hx.e2 { background: color-mix(in srgb, var(--p2) 30%, var(--board-cell)); }
.hx.e1.e2 { background: linear-gradient(135deg, color-mix(in srgb, var(--p1) 22%, var(--board-cell)) 50%, color-mix(in srgb, var(--p2) 30%, var(--board-cell)) 50%); }
.hx.p1 { background: radial-gradient(circle at 35% 30%, var(--p1-hi), var(--p1)); }
.hx.p2 { background: radial-gradient(circle at 35% 30%, var(--p2-hi), var(--p2)); }
.hx.p1.win { background: radial-gradient(circle, #fff 0 16%, var(--p1-hi) 20%, var(--p1)); }
.hx.p2.win { background: radial-gradient(circle, #fff 0 16%, var(--p2-hi) 20%, var(--p2)); }
.hx.ok { cursor: pointer; }
.hx.ok:hover, .hx:focus-visible { background: #ffd27a; outline: none; }

/* Nim */
.nim { display: grid; gap: .8rem; justify-self: center; width: 100%; max-width: 460px; padding: 18px 20px; border-radius: 10px; background: var(--board); box-shadow: var(--shadow); color: #cfc9bb; }
.heap { display: flex; align-items: center; gap: .9rem; min-height: 60px; }
.heap-n { width: 1.2rem; text-align: right; color: #a9a395 !important; font-family: var(--mono); }
.sticks { display: flex; gap: 10px; }
.stick { all: unset; box-sizing: border-box; width: 12px; height: 56px; border-radius: 6px; background: linear-gradient(var(--p1) 0 20%, #e8c98a 20% 100%); box-shadow: 0 3px 6px rgba(0, 0, 0, .35); transition: transform .15s, filter .15s, opacity .2s; }
.stick.gone { opacity: .12; box-shadow: none; }
.stick.ok { cursor: pointer; }
.stick.ok:hover, .stick.ok:hover ~ .stick.ok, .stick.ok:focus-visible, .stick.ok:focus-visible ~ .stick.ok { transform: translateY(-8px); filter: brightness(1.12); outline: none; }

/* tournaments */
.prizes { display: flex; flex-wrap: wrap; gap: .4rem; }
.prize { background: var(--surface-2); border-radius: var(--r-sm); padding: .3rem .6rem; font-size: .85rem; }
.prize b { font-family: var(--mono); font-weight: 600; }
.prizes.big .prize { font-size: 1rem; padding: .45rem .8rem; }
.prizes .prize:first-child { background: var(--ink); color: var(--bg); }
.prizes .prize:first-child * { color: inherit; }
.seats { display: flex; flex-wrap: wrap; gap: .4rem; }
.seats > * { background: var(--surface-2); border-radius: 999px; padding: .2rem .55rem .2rem .25rem; }
.seat-empty { color: var(--ink-3); font-size: .8rem; padding: .32rem .7rem !important; background: transparent !important; border: 1px dashed var(--rule); }
.champion { font-size: 1.05rem; gap: .6rem; }
.champion .icon { color: var(--accent); }
.bracket { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 1.2rem; overflow-x: auto; padding-bottom: .5rem; }
.round { display: flex; flex-direction: column; justify-content: space-around; gap: .8rem; }
.round h4 { margin: 0; }
.match { display: grid; gap: .25rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); padding: .55rem; text-decoration: none; }
.match:hover { border-color: var(--ink); }
.slot { display: flex; align-items: center; gap: .45rem; padding: .25rem .35rem; border-radius: var(--r-sm); }
.slot.won { background: var(--ok-soft); }
.slot.to-move { box-shadow: inset 3px 0 0 var(--accent); }

/* arcade results */
.result { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: .2rem 0; font-size: 1.05rem; }
.big-symbol { font-size: 1.3rem; font-weight: 600; }
.lucky { color: var(--warn); }
.playing-card { display: inline-grid; place-items: center; min-width: 2.5rem; height: 3.4rem; padding: 0 .3rem; border-radius: 5px; background: #fdfbf5; color: #1b1a17; font-weight: 700; font-size: 1.15rem; font-family: var(--serif); border: 1px solid #d6d0c2; box-shadow: 0 2px 5px rgba(0, 0, 0, .18); }
.playing-card.red { color: #b3122a; }
.poker { display: grid; gap: .5rem; }
.hand { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.hand .playing-card { min-width: 2.2rem; height: 3rem; font-size: 1rem; }
.hand .err { color: var(--err); font-weight: 700; }
.result.slots { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.slot-reels { display: inline-flex; gap: 4px; padding: 5px; border-radius: 8px; background: linear-gradient(#caa055, #85601f); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }
.reel { display: grid; place-items: center; width: 2.4rem; height: 2.8rem; border-radius: 5px; background: linear-gradient(#fff, #ebe5d6); font-size: 1.45rem; box-shadow: inset 0 -6px 10px rgba(0, 0, 0, .1); animation: reel-in .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.reel:nth-child(2) { animation-delay: .12s; }
.reel:nth-child(3) { animation-delay: .24s; }
@keyframes reel-in { from { transform: translateY(-45%); opacity: 0; } to { transform: none; opacity: 1; } }

/* win banner: quiet, with a little confetti */
.celebrate { position: relative; overflow: hidden; border-radius: var(--r-sm); padding: .85rem 1rem; background: var(--ink); color: var(--bg); text-align: center; animation: pop .4s cubic-bezier(.2, 1.4, .4, 1); }
.celebrate b { position: relative; font-family: var(--serif); font-size: 1.25rem; font-weight: 600; font-style: italic; }
.confetti i { position: absolute; top: -12px; width: 6px; height: 10px; border-radius: 1px; opacity: .9; animation: fall 2.4s linear infinite; }
.confetti i:nth-child(3n) { background: var(--p1-hi); }
.confetti i:nth-child(3n + 1) { background: var(--p2-hi); }
.confetti i:nth-child(3n + 2) { background: #f0c46a; }
.confetti i:nth-child(1) { left: 5%; animation-delay: 0s; }
.confetti i:nth-child(2) { left: 12%; animation-delay: .9s; }
.confetti i:nth-child(3) { left: 19%; animation-delay: .3s; }
.confetti i:nth-child(4) { left: 27%; animation-delay: 1.4s; }
.confetti i:nth-child(5) { left: 34%; animation-delay: .6s; }
.confetti i:nth-child(6) { left: 42%; animation-delay: 1.8s; }
.confetti i:nth-child(7) { left: 49%; animation-delay: .1s; }
.confetti i:nth-child(8) { left: 57%; animation-delay: 1.1s; }
.confetti i:nth-child(9) { left: 64%; animation-delay: .4s; }
.confetti i:nth-child(10) { left: 72%; animation-delay: 1.6s; }
.confetti i:nth-child(11) { left: 79%; animation-delay: .8s; }
.confetti i:nth-child(12) { left: 86%; animation-delay: 2s; }
.confetti i:nth-child(13) { left: 92%; animation-delay: .2s; }
.confetti i:nth-child(14) { left: 97%; animation-delay: 1.3s; }
@keyframes fall { to { transform: translateY(110px) rotate(540deg); } }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- front page ---------- */
.intro { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(250px, 1fr); gap: 3.2rem; align-items: end; padding: 1.4rem 0 2.6rem; border-bottom: 1px solid var(--rule-strong); }
.intro h1 { font-size: clamp(2.4rem, 6vw, 4.1rem); line-height: 1; letter-spacing: -.028em; margin-bottom: 1rem; }
.intro h1 em { font-style: italic; color: var(--accent); font-weight: 500; }
.kicker { display: flex; align-items: center; gap: .7rem; font-size: .76rem; font-weight: 600; letter-spacing: .11em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 1.3rem; }
.kicker::before { content: ""; width: 28px; height: 2px; background: var(--accent); flex: none; }
.lead { font-size: 1.14rem; color: var(--ink-2); max-width: 58ch; }
.intro .row { margin-top: 1.5rem; gap: .9rem; }
.intro .note { margin-top: 1.2rem; }
.ledger { border-top: 3px solid var(--ink); padding-top: .7rem; }
.ledger h2 { margin: 0 0 .3rem; font-family: var(--sans); font-size: .74rem; font-weight: 600; letter-spacing: .11em; text-transform: uppercase; color: var(--ink-2); }
.ledger dl { margin: 0 0 .7rem; }
.ledger dl > div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--rule); }
.ledger dt { color: var(--ink-2); font-size: .88rem; }
.ledger dd { margin: 0; font-family: var(--serif); font-size: 1.55rem; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }

.home-block { margin-top: 3.6rem; }
.home-block > h2:first-child { margin-top: 0; }
.block-head { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: .4rem 2.2rem; align-items: baseline; padding-bottom: .8rem; margin-bottom: .4rem; border-bottom: 1px solid var(--rule-strong); }
.block-head h2 { margin: 0; font-size: clamp(1.6rem, 3.4vw, 2.1rem); }
.block-head p { margin: 0; max-width: 56ch; }

.chapters { display: grid; grid-template-columns: 1fr 1fr; }
.chapter { padding: 1.6rem 2.2rem 1.8rem 0; border-bottom: 1px solid var(--rule); }
.chapter:nth-child(even) { padding: 1.6rem 0 1.8rem 2.2rem; border-left: 1px solid var(--rule); }
.chapter header { display: flex; align-items: baseline; gap: .75rem; }
.chapter-no { font-family: var(--serif); font-style: italic; font-size: 1.15rem; color: var(--accent); }
.chapter h3 { margin: 0; font-family: var(--serif); font-size: 2.1rem; font-weight: 600; letter-spacing: -.015em; }
.chapter-lead { color: var(--ink-2); margin: .35rem 0 1rem; max-width: 46ch; }
.chapter ul { list-style: none; margin: 0; padding: 0; }
.chapter li a { display: grid; gap: .15rem; padding: .75rem 0 .8rem; border-top: 1px solid var(--rule); text-decoration: none; }
.feat-name { font-weight: 600; font-size: 1rem; }
.feat-name .go { color: var(--accent); opacity: 0; transition: opacity .12s, margin .12s; }
.chapter li a:hover .feat-name { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: .2em; }
.chapter li a:hover .go, .chapter li a:focus-visible .go { opacity: 1; margin-left: .2rem; }
.feat-line { color: var(--ink-2); font-size: .92rem; max-width: 60ch; }
.feat-meta { font-family: var(--mono); font-size: .74rem; color: var(--ink-3); margin-top: .15rem; }

.flow { list-style: none; margin: 1.2rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.4rem; }
.flow li { position: relative; border-top: 3px solid var(--ink); padding-top: .9rem; }
.flow li:not(:last-child)::after { content: "→"; position: absolute; right: -1.75rem; top: .55rem; font-family: var(--serif); font-size: 1.4rem; color: var(--ink-3); }
.flow-who { display: block; font-size: .72rem; font-weight: 600; letter-spacing: .11em; text-transform: uppercase; color: var(--accent); margin-bottom: .2rem; }
.flow b { display: block; font-family: var(--serif); font-size: 1.4rem; font-weight: 600; margin-bottom: .35rem; letter-spacing: -.01em; }
.flow p { color: var(--ink-2); font-size: .93rem; margin: 0; }

.std-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; margin: 1.2rem 0 0; }
.std-list > div { border-top: 1px solid var(--rule); padding-top: .8rem; }
.std-list dt { font-weight: 600; }
.std { display: block; font-family: var(--mono); font-size: .72rem; color: var(--ink-3); font-weight: 400; margin-top: .1rem; }
.std-list dd { margin: .45rem 0 0; color: var(--ink-2); font-size: .9rem; }

.home-block.two { display: grid; grid-template-columns: 1fr 1fr; gap: 3.2rem; align-items: start; }
.home-block.two h2 { margin-top: 0; font-size: clamp(1.6rem, 3.4vw, 2.1rem); padding-bottom: .8rem; border-bottom: 1px solid var(--rule-strong); }
.fees { width: 100%; border-collapse: collapse; margin: .4rem 0 .8rem; font-size: .92rem; }
.fees th, .fees td { padding: .55rem .5rem .55rem 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: baseline; }
.fees th { font-weight: 600; }
.fees .fee { font-family: var(--mono); font-size: .86rem; white-space: nowrap; width: 4.5rem; }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 1rem; padding: .85rem 0; font-weight: 600; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--serif); font-size: 1.3rem; line-height: 1; color: var(--ink-3); }
.faq details[open] summary::after { content: "–"; color: var(--accent); }
.faq summary:hover { color: var(--accent); }
.faq details p { color: var(--ink-2); margin: 0 0 1rem; max-width: 62ch; }

.closing { margin: 3.6rem 0 0; padding: clamp(1.8rem, 5vw, 3rem) clamp(1.4rem, 4vw, 2.6rem); background: var(--ink); color: var(--bg); border-radius: var(--r); }
.closing h2 { margin: 0 0 1.4rem; font-size: clamp(1.7rem, 4vw, 2.5rem); max-width: 22ch; line-height: 1.1; }
.closing .btn.primary { background: var(--bg); color: var(--ink); border-color: var(--bg); }
.closing .btn.primary:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.closing .btn.ghost { color: var(--bg); text-decoration-color: color-mix(in srgb, var(--bg) 40%, transparent); }

@media (max-width: 900px) {
  .intro { grid-template-columns: 1fr; gap: 2rem; }
  .chapters { grid-template-columns: 1fr; }
  .chapter, .chapter:nth-child(even) { padding: 1.4rem 0 1.5rem; border-left: 0; }
  .flow { grid-template-columns: 1fr; gap: 1.6rem; }
  .flow li:not(:last-child)::after { display: none; }
  .std-list { grid-template-columns: 1fr 1fr; gap: 1.4rem; }
  .home-block.two { grid-template-columns: 1fr; gap: 2.6rem; }
  .block-head { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .std-list { grid-template-columns: 1fr; }
  .home-block { margin-top: 2.8rem; }
  .chapter h3 { font-size: 1.8rem; }
}

/* ---------- inside a Grid (iframe): compact ---------- */
.embedded .foot, .embedded .hero .row, .embedded .trust, .embedded .closing, .embedded .intro .row { display: none; }
.embedded main { padding-top: .9rem; }
.embedded header.top { padding-top: .4rem; padding-bottom: .4rem; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) and (min-width: 761px) {
  header.top nav { order: 3; flex-basis: 100%; }
}
@media (max-width: 860px) {
  .feature { grid-template-columns: 2rem 1fr; grid-template-areas: "icon name" "icon title" "icon text" "icon meta"; row-gap: .2rem; }
  .fmeta { flex-direction: row; justify-content: flex-start; gap: 1rem; align-items: baseline; text-align: left; margin-top: .3rem; }
}
@media (max-width: 760px) {
  body { padding-bottom: 64px; font-size: 15px; }
  header.top { gap: .6rem; backdrop-filter: none; background: var(--bg); padding-top: .6rem; padding-bottom: .6rem; }
  .top-right { flex: 1; justify-content: flex-end; min-width: 0; }
  header.top nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--rule);
    padding: .25rem .2rem calc(.25rem + env(safe-area-inset-bottom));
    justify-content: space-around; gap: 0; overflow: visible;
  }
  header.top nav a { flex-direction: column; gap: .12rem; font-size: .62rem; padding: .35rem .1rem; min-width: 0; flex: 1; text-align: center; border-bottom: 0; border-top: 2px solid transparent; }
  header.top nav a .icon { display: block; width: 21px; height: 21px; }
  header.top nav a.active { border-top-color: var(--accent); }
  .nav-badge { position: absolute; top: .1rem; left: calc(50% + 4px); }
  .logo { font-size: 1.25rem; }
  .balance { display: none; }
  .pname { max-width: 11ch; }
  #account .row { flex-wrap: nowrap; gap: .4rem; }
  #account .paddr { display: none; }
  #account .pname { max-width: 8ch; }
  #account .btn.primary { padding: .45rem .7rem; font-size: .82rem; }
  #net select { max-width: 7.5rem; font-size: .8rem; padding: .35rem .5rem; }
  #toasts { bottom: 76px; }
  #txbox { right: .75rem; bottom: 76px; }
  main { padding-top: 1.4rem; }
  .hero { padding-top: .6rem; }
  .duel { grid-template-columns: 1fr; gap: 1.2rem; }
  .swap { grid-template-columns: 1fr; }
  .swap-arrow { transform: rotate(90deg); justify-self: center; }
  .bubble.reply { margin-left: .5rem; }
  .panel { top: 56px; right: .5rem; left: .5rem; width: auto; }
  .bracket { grid-auto-columns: minmax(200px, 85%); }
  .strip > div + div { padding-left: .8rem; }
  .game-tiles { grid-template-columns: repeat(3, 1fr); }
  .tile-name { font-size: .74rem; }
  .thumb { width: 36px; }
  .thumb.big { width: 48px; }
  div.dots { padding: 10px; grid-template-columns: repeat(4, 11px 1fr) 11px; grid-template-rows: repeat(4, 11px 1fr) 11px; }
  .dots .dot { width: 11px; height: 11px; }
  .hex { padding: 12px 10px; }
  .sticks { gap: 7px; }
  .stick { width: 10px; height: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .confetti { display: none; }
  #progress { display: none; }
}
.trust .btn { align-self: flex-start; }
