/* GBAdhoc Lobby. Look and motion from the approved Fable mockup (builds/lobby-mockup).
   Dark = the GBAdhoc site's own palette. Light = the 5.0.0 woodblock print: paper, indigo ink.
   Accents are the emulator's: GBA indigo, Game Boy green, GBC teal. */
:root {
  --bg: #ebe2cb;
  --bg-deep: #dfd3b3;
  --panel: #f6f0e0;
  --panel-2: #ece3cc;
  --line: #d3c7a7;
  --line-strong: #b5a782;
  --ink: #25213b;
  --mute: #575270;
  --dim: #625d6d;          /* darkened from the mockup for 4.5:1 on paper */
  --accent: #4f3fc4;
  --accent-ink: #4333b0;
  --btn: #2b2649;
  --btn-hover: #3a3364;
  --on-btn: #f8f3e4;
  --gbc: #096a65;
  --host: #47620a;
  --host-bg: #dde5ae;
  --host-line: #a9bb55;
  --wait: #84560a;
  --wait-bg: #f1e0b1;
  --wait-line: #cfae62;
  --play: #4333b0;
  --play-bg: #dedaf2;
  --play-line: #a9a0e2;
  --seal: #ac3623;
  --moon: #f5eed9;
  --shadow: 0 1px 0 rgba(255,255,255,.5) inset, 0 10px 30px -18px rgba(37,33,59,.45);
  --scrim: rgba(37,33,59,.42);
  --bar: rgba(235,226,203,.86);
  --radius: 14px;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1180px;
  --serif: "Shippori Mincho", "Iowan Old Style", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(.2,.7,.2,1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0e0e13;
  --bg-deep: #1f1b3d;
  --panel: #16161d;
  --panel-2: #1c1c25;
  --line: #2a2a35;
  --line-strong: #3d3c4c;
  --ink: #ecebe4;
  --mute: #a3a2ae;
  --dim: #8a8996;          /* lightened from the mockup for 4.5:1 on panels */
  --accent: #8f80ff;
  --accent-ink: #c9c1ff;
  --btn: #8f80ff;
  --btn-hover: #a497ff;
  --on-btn: #0d0b1f;
  --gbc: #1fb8b0;
  --host: #bcd84a;
  --host-bg: rgba(155,188,15,.13);
  --host-line: rgba(155,188,15,.5);
  --wait: #e3b55a;
  --wait-bg: rgba(227,181,90,.11);
  --wait-line: rgba(227,181,90,.42);
  --play: #c9c1ff;
  --play-bg: rgba(143,128,255,.15);
  --play-line: rgba(143,128,255,.5);
  --seal: #ea5c44;
  --moon: #2b2842;
  --shadow: 0 10px 30px -18px rgba(0,0,0,.9);
  --scrim: rgba(5,5,9,.66);
  --bar: rgba(14,14,19,.84);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
/* paper grain, very quiet */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .15 0 0 0 0 .13 0 0 0 0 .23 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] body::before { opacity: .0; }
body > * { position: relative; z-index: 1; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.15; text-wrap: balance; }
a { color: var(--accent-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.eyebrow { font: 500 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--gbc); }
.path { font-style: italic; color: var(--ink); }
.only-dark { display: none; }
:root[data-theme="dark"] .only-dark { display: block; }
:root[data-theme="dark"] .only-light { display: none; }

/* ---- the logo's seven-colour rule, used once at the very top */
.rule { display: flex; height: 3px; }
.rule i { display: block; }
.rule i:nth-child(1) { flex: 5; background: #8f80ff; }
.rule i:nth-child(2) { flex: 5; background: #9bbc0f; }
.rule i:nth-child(3) { flex: 1; background: #e8386d; }
.rule i:nth-child(4) { flex: 1; background: #f5c518; }
.rule i:nth-child(5) { flex: 1; background: #7dcb2f; }
.rule i:nth-child(6) { flex: 1; background: #1fb8b0; }
.rule i:nth-child(7) { flex: 1; background: #7b4fd8; }

/* ---- top bar */
.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: calc(9px + env(safe-area-inset-top, 0px)) var(--gutter) 9px;
  background: var(--bar); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.bar-mark { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 600; }
.bar-mark span { color: var(--dim); font-weight: 500; }
.live { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--mute); white-space: nowrap; }
.live b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--host); position: relative; flex: none; }
.live-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--host); opacity: 0; animation: ring 2.6s var(--ease) infinite; }
@keyframes ring { 0% { transform: scale(.5); opacity: .7; } 100% { transform: scale(1.5); opacity: 0; } }
.live-item { display: flex; align-items: center; gap: 7px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: transparent; border: 1px solid var(--line); color: var(--mute);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--panel-2); color: var(--ink); }
.icon-btn svg { width: 17px; height: 17px; }

/* ---- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border-radius: 999px;
  background: var(--btn); color: var(--on-btn); font-weight: 600; text-decoration: none;
  border: 1px solid var(--btn); transition: transform .15s var(--ease), background .15s;
}
.btn:hover { background: var(--btn-hover); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--panel-2); }
.btn-small { min-height: 36px; padding: 0 16px; font-size: 14px; }
.btn svg { width: 16px; height: 16px; }

/* ---- hero */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%); }
.hero-in {
  position: relative; z-index: 2; max-width: var(--max); margin: 0 auto;
  padding: clamp(28px, 5vw, 56px) var(--gutter) clamp(120px, 15vw, 190px);
  display: grid; gap: 18px; justify-items: start;
}
.hero .logo { width: clamp(150px, 22vw, 210px); height: auto; margin-left: -18px; }
.hero h1 { font: 700 clamp(31px, 5.4vw, 54px)/1.1 var(--serif); letter-spacing: -.01em; max-width: 16ch; }
.hero .lead { font-size: clamp(16px, 2vw, 19px); color: var(--mute); max-width: 52ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 4px; }
.hero-cta .have { font-size: 14px; color: var(--mute); }
.moon {
  position: absolute; z-index: 0; right: clamp(-40px, 8vw, 150px); top: clamp(24px, 4vw, 44px);
  width: clamp(190px, 30vw, 340px); aspect-ratio: 1; border-radius: 50%; background: var(--moon);
}
.strip {
  position: absolute; z-index: 1; left: 50%; bottom: 0; transform: translateX(-50%);
  width: max(100%, 980px); max-width: none; height: clamp(120px, 15vw, 205px); object-fit: cover; object-position: 50% 100%;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, rgba(0,0,0,.45) 30%, #000 64%); mask-image: linear-gradient(180deg, transparent 0%, rgba(0,0,0,.45) 30%, #000 64%);
  mix-blend-mode: multiply; user-select: none; pointer-events: none;
}
:root[data-theme="dark"] .strip { mix-blend-mode: luminosity; filter: brightness(.62) contrast(1.15); opacity: .9; }

/* ---- board */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.board-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-top: clamp(28px, 4vw, 44px); }
.board-head h2 { font: 700 clamp(24px, 3.4vw, 32px)/1.15 var(--serif); margin-top: 8px; }
.board-head p.sub { color: var(--mute); font-size: 14px; margin-top: 6px; }
.tools { display: grid; gap: 12px; margin-top: 18px; }
.tools-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button {
  border: 0; background: transparent; color: var(--mute); font-size: 14px; font-weight: 500;
  min-height: 36px; padding: 0 14px; border-radius: 999px; white-space: nowrap; display: flex; align-items: center; gap: 7px;
  transition: background .2s, color .2s;
}
.seg button[aria-pressed="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 0 0 1px var(--line); }
.seg .n { font: 500 12px/1 var(--mono); color: var(--dim); font-variant-numeric: tabular-nums; }
.search { position: relative; flex: 1 1 220px; min-width: 0; max-width: 340px; margin-left: auto; }
.search svg { position: absolute; left: 13px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--dim); pointer-events: none; }
.field {
  width: 100%; min-height: 42px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel);
  padding: 0 16px; color: var(--ink); transition: border-color .15s;
}
.field::placeholder { color: var(--dim); }
.field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.search .field { padding-left: 38px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; margin: 0 calc(var(--gutter) * -1); padding-inline: var(--gutter); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px 0 5px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--mute); font-size: 14px; font-weight: 500;
  transition: border-color .15s, color .15s, background .15s;
}
.chip.all { padding-left: 14px; }
.chip img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.chip .n { font: 500 12px/1 var(--mono); color: var(--dim); }
.chip:hover { color: var(--ink); border-color: var(--line-strong); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip[aria-pressed="true"] .n { color: inherit; opacity: .7; }

.board { display: grid; gap: 14px; margin-top: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1120px) { .board { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---- room card */
.room {
  position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; display: grid; gap: 14px; align-content: space-between; box-shadow: var(--shadow);
  cursor: pointer; transition: border-color .2s, transform .2s var(--ease);
  text-align: left; color: inherit;
}
.room:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.room[data-status="playing"] { background: color-mix(in srgb, var(--panel) 55%, var(--bg)); box-shadow: none; }
.room[data-status="playing"] .rc-art { filter: saturate(.55) opacity(.8); }
.room.mine { border-color: var(--accent); }
.room.mine::before {
  content: "Your room"; position: absolute; top: -10px; left: 14px; font: 500 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase;
  background: var(--accent); color: var(--on-btn); padding: 4px 8px; border-radius: 4px;
}
:root:not([data-theme="dark"]) .room.mine::before { color: #fbf7ec; }
.rc-top { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 14px; align-items: start; }
.rc-art { width: 76px; height: 76px; border-radius: 9px; object-fit: cover; background: var(--panel-2); box-shadow: 0 0 0 1px rgba(0,0,0,.14), 0 6px 14px -8px rgba(0,0,0,.5); }
.rc-main { min-width: 0; display: grid; gap: 4px; justify-items: start; }
.rc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; margin-bottom: 3px; }
.rc-main h3 { font-size: 17px; font-weight: 600; letter-spacing: -.005em; }
.rc-meta { font-size: 13px; color: var(--dim); }
.rc-note { font-size: 14px; color: var(--mute); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }
.rc-note b { color: var(--ink); font-weight: 500; }
/* a 20-character name with no break opportunity ("WWWW…", CJK) must wrap, never widen the page */
.rc-note, .rc-note b, .players b { min-width: 0; overflow-wrap: anywhere; }
.want-tag { font: 500 11px/1 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--mute); border: 1px solid var(--line-strong); border-radius: 4px; padding: 2px 5px; margin-right: 7px; vertical-align: 1px; white-space: nowrap; }
.rc-bot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px dashed var(--line); padding-top: 12px; }
/* a waiting room's code is not public until the relay sees it hosted */
.code-soon { font: 500 11px/1.3 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--dim); }
.code-soon.big { display: block; font-size: 12px; padding: 16px 12px; text-align: center; border: 1px dashed var(--line-strong); border-radius: 12px; max-width: 320px; margin: 0 auto; }
.rc-state { margin-left: auto; display: flex; align-items: center; gap: 8px; font: 500 12px/1 var(--mono); color: var(--dim); }
.rc-age { font-size: 13px; color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---- the code: four carved blocks. Uninked until a PSP hosts, inked while it does. */
.code { display: inline-flex; gap: 4px; }
.code span {
  width: 31px; height: 38px; display: grid; place-items: center; border-radius: 7px;
  font: 700 19px/1 var(--mono); color: var(--ink); background: transparent; border: 1.5px dashed var(--line-strong);
  transition: background .24s var(--ease), color .24s var(--ease), border-color .24s var(--ease);
  transition-delay: calc(var(--i) * 25ms);
}
[data-status="hosting"] .code span { background: var(--ink); color: var(--bg); border: 1.5px solid var(--ink); }
[data-status="playing"] .code span { background: var(--panel-2); color: var(--dim); border: 1.5px solid var(--line); }
.code.big { gap: 8px; }
.codebox.linked .code span { background: var(--play-bg); color: var(--play); border-color: var(--play-line); }
.code.big span { width: clamp(52px, 15vw, 66px); height: clamp(64px, 18vw, 80px); border-radius: 12px; font-size: clamp(32px, 9vw, 42px); border-width: 2px; }
.copy {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--mute); font-size: 13px; font-weight: 500;
  transition: background .15s, color .15s, border-color .15s;
}
.copy:hover { background: var(--panel-2); color: var(--ink); border-color: var(--line-strong); }
.copy svg { width: 14px; height: 14px; }
.copy.done { color: var(--host); border-color: var(--host-line); }

/* ---- status pill */
.pill {
  display: inline-flex; align-items: center; gap: 7px; min-height: 26px; padding: 0 10px 0 8px; border-radius: 999px;
  font-size: 13px; font-weight: 600; white-space: nowrap; border: 1px solid; transform-origin: 50% 50%;
  transition: background .3s, color .3s, border-color .3s;
}
.pill i { width: 9px; height: 9px; border-radius: 50%; flex: none; position: relative; }
[data-status="waiting"] .pill { color: var(--wait); background: var(--wait-bg); border-color: var(--wait-line); }
[data-status="waiting"] .pill i { border: 1.5px dashed currentColor; animation: spin 6s linear infinite; }
[data-status="hosting"] .pill { color: var(--host); background: var(--host-bg); border-color: var(--host-line); }
[data-status="hosting"] .pill i { background: currentColor; }
[data-status="hosting"] .pill i::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid currentColor; animation: ring 2.2s var(--ease) infinite; }
[data-status="playing"] .pill { color: var(--play); background: var(--play-bg); border-color: var(--play-line); }
[data-status="playing"] .pill i { width: 14px; background: radial-gradient(circle at 4.5px 50%, currentColor 4px, transparent 4.5px), radial-gradient(circle at 9.5px 50%, currentColor 4px, transparent 4.5px); border-radius: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.pill.flip { animation: flip .32s var(--ease); }
@keyframes flip { 0% { transform: perspective(300px) rotateX(0); } 48% { transform: perspective(300px) rotateX(90deg); } 52% { transform: perspective(300px) rotateX(-90deg); } 100% { transform: perspective(300px) rotateX(0); } }
.room.bloom::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  border: 2px solid var(--host); animation: bloom .32s var(--ease) forwards;
}
.room.bloom[data-status="playing"]::after { border-color: var(--accent); }
@keyframes bloom { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.035); } }
.seats { display: inline-flex; gap: 3px; align-items: center; }
.seats i { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--dim); transition: background .24s, border-color .24s; }
.seats i.on { background: var(--ink); border-color: var(--ink); }

/* ---- empty states */
.empty {
  grid-column: 1 / -1; position: relative; overflow: hidden; text-align: center; display: grid; justify-items: center; gap: 12px;
  border: 1px dashed var(--line-strong); border-radius: 20px; padding: clamp(40px, 8vw, 80px) 20px clamp(36px, 6vw, 60px);
}
.empty .scene { position: relative; width: 190px; height: 130px; margin-bottom: 4px; }
.empty .scene .m { position: absolute; left: 50%; top: 4px; width: 118px; height: 118px; margin-left: -59px; border-radius: 50%; background: var(--moon); }
.empty .scene img { position: absolute; right: -44px; top: -8px; width: 190px; mix-blend-mode: multiply; -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent 100%); mask-image: radial-gradient(closest-side, #000 55%, transparent 100%); }
:root[data-theme="dark"] .empty .scene img { mix-blend-mode: screen; filter: invert(1) brightness(.85); opacity: .6; }
.empty h3 { font: 700 26px/1.2 var(--serif); }
.empty p { color: var(--mute); max-width: 44ch; }
.empty .btn { margin-top: 8px; }

/* ---- how it works */
.how { margin-top: clamp(56px, 8vw, 96px); display: grid; gap: 22px; }
.how h2 { font: 700 clamp(24px, 3.4vw, 32px)/1.15 var(--serif); }
.how-grid { display: grid; gap: 14px; }
@media (min-width: 860px) { .how-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.step-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 8px; align-content: start; }
.step-card .k { font: 700 28px/1 var(--serif); color: var(--seal); }
.step-card h3 { font-size: 17px; font-weight: 600; }
.step-card p { color: var(--mute); font-size: 15px; }
.needs { display: grid; gap: 18px; align-items: center; border-left: 3px solid #9bbc0f; padding: 4px 0 4px 20px; }
@media (min-width: 860px) { .needs { grid-template-columns: minmax(0, 1fr) 300px; } }
.needs h3 { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.needs ul { margin: 0; padding-left: 18px; color: var(--mute); display: grid; gap: 6px; font-size: 15px; }
.needs ul b { color: var(--ink); font-weight: 600; }
.needs figure { margin: 0; display: grid; gap: 8px; }
.needs figure img { width: 100%; height: auto; aspect-ratio: 480 / 272; border-radius: 10px; image-rendering: pixelated; border: 1px solid var(--line); }
.needs figcaption { font-size: 13px; color: var(--dim); }

.foot { max-width: var(--max); margin: clamp(56px, 8vw, 96px) auto 0; padding: 24px var(--gutter) 120px; border-top: 1px solid var(--line); display: grid; gap: 10px; font-size: 13px; color: var(--dim); }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; }
.foot a { color: var(--mute); }

/* ---- phone: a thumb-reach action bar */
.dock { display: none; }
@media (max-width: 680px) {
  .bar .btn { display: none; }
  .hero-in { padding-top: 22px; padding-bottom: 104px; gap: 14px; }
  .hero .logo { width: 128px; margin-left: -11px; }
  .hero .lead { font-size: 15px; }
  .hero-cta .btn { min-height: 42px; padding: 0 18px; font-size: 15px; }
  .strip { height: 104px; }
  .live .lbl-long { display: none; }
  .live { gap: 10px; font-size: 13px; }
  .search { max-width: none; flex-basis: 100%; margin-left: 0; }
  .dock {
    display: flex; position: fixed; z-index: 15; left: 0; right: 0; bottom: 0; gap: 10px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--bar); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  }
  .dock .btn { flex: 1; }
  .rc-top { grid-template-columns: 68px minmax(0, 1fr); gap: 12px; }
  .rc-art { width: 68px; height: 68px; }
}

/* ---- dialogs: a sheet on phones, a card on desktop */
dialog {
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); padding: 0; border-radius: 20px;
  width: min(560px, calc(100vw - 32px)); max-height: min(calc(100% - 32px), 860px); overflow: hidden; box-shadow: 0 30px 80px -20px rgba(0,0,0,.55);
}
dialog.wide { width: min(880px, calc(100vw - 32px)); }
dialog::backdrop { background: var(--scrim); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
dialog[open] { display: flex; flex-direction: column; animation: rise .28s var(--ease); }
dialog[open]::backdrop { animation: fade .24s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes fade { from { opacity: 0; } }
@media (max-width: 680px) {
  dialog, dialog.wide { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 22px 22px 0 0; border-width: 1px 0 0; max-height: calc(100% - 24px); }
  dialog[open] { animation: sheet .3s var(--ease); }
  @keyframes sheet { from { transform: translateY(40%); opacity: .4; } }
}
.d-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--line); flex: none; }
.d-head h2 { font: 700 20px/1.2 var(--serif); flex: 1; min-width: 0; }
.d-head .crumbs { font: 500 12px/1 var(--mono); color: var(--dim); letter-spacing: .04em; white-space: nowrap; }
.d-body { overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 18px; overscroll-behavior: contain; flex: 1 1 auto; min-height: 0; }
.d-body > * { flex: none; }
.d-foot { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); flex: none; background: var(--bg); }
.d-foot .spacer { flex: 1; }

/* create: game grid */
.pick-tools { display: flex; gap: 10px; align-items: center; }
.pick-tools .search { max-width: none; margin: 0; flex: 1; }
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 14px 12px; }
@media (max-width: 420px) { .games { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; } }
.game { border: 0; background: transparent; padding: 0; text-align: left; display: grid; gap: 7px; align-content: start; color: var(--ink); }
.game img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--panel-2); box-shadow: 0 0 0 1px rgba(0,0,0,.16), 0 8px 18px -10px rgba(0,0,0,.55); transition: transform .2s var(--ease), box-shadow .2s; }
.game:hover img, .game:focus-visible img { transform: translateY(-3px); box-shadow: 0 0 0 2px var(--accent), 0 14px 22px -12px rgba(0,0,0,.6); }
.game b { font-size: 13px; font-weight: 600; line-height: 1.25; }
.game small { font-size: 12px; color: var(--dim); display: block; font-weight: 400; margin-top: 2px; }
.none { color: var(--mute); text-align: center; padding: 28px 0; grid-column: 1 / -1; }
.chosen { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 14px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.chosen img { width: 72px; height: 72px; border-radius: 9px; object-fit: cover; }
.chosen h3 { font-size: 17px; font-weight: 600; }
.chosen p { font-size: 13px; color: var(--dim); margin-top: 3px; }
.form-row { display: grid; gap: 8px; }
.form-row label, .form-row .lab { font-size: 14px; font-weight: 600; }
.form-row .opt { font-weight: 400; color: var(--dim); }
.form-row .hint { font-size: 13px; color: var(--dim); }
.form-row .field { border-radius: 12px; min-height: 46px; }
.with-btn { display: flex; gap: 8px; }
.with-btn .field { flex: 1; min-width: 0; }
.wants { display: flex; gap: 8px; flex-wrap: wrap; }
.want { min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--mute); font-size: 14px; font-weight: 500; }
.want[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.privacy { font-size: 13px; color: var(--dim); }

/* room sheet */
.sheet-hero { position: relative; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line); isolation: isolate; }
.sheet-hero .blur { position: absolute; inset: -30px; z-index: -1; background-size: cover; background-position: center; filter: blur(28px) saturate(1.1); opacity: .34; }
.sheet-hero .in { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 14px; align-items: center; padding: 14px; background: color-mix(in srgb, var(--panel) 72%, transparent); }
.sheet-hero img.art { width: 84px; height: 84px; border-radius: 10px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.16), 0 8px 18px -10px rgba(0,0,0,.6); }
.sheet-hero h3 { font-size: 19px; font-weight: 600; }
.sheet-hero .rc-meta { margin-top: 3px; }
.sheet-hero .rc-note { margin-top: 6px; -webkit-line-clamp: 3; }
.codebox { display: grid; justify-items: center; gap: 12px; padding: 6px 0 2px; }
.codebox .acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.codebox .state { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.codebox .say { font-size: 15px; color: var(--mute); text-align: center; max-width: 40ch; }
.codebox .say b { color: var(--ink); font-weight: 600; }
/* the match screen after a lobby restart lost the ticket: neutral, no lamp */
.lost { display: grid; gap: 14px; justify-items: center; text-align: center; padding: 8px 0; }
.lost .say { font-size: 15px; color: var(--mute); max-width: 44ch; margin: 0; }
.lost .say b { color: var(--ink); font-weight: 600; }
.lost .muted { max-width: 44ch; margin: 0; }
.codebox .hold { font: 500 12px/1 var(--mono); color: var(--dim); letter-spacing: .04em; }

/* relay tracker: three stations on a line */
.track { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); position: relative; padding-top: 4px; }
.track::before { content: ""; position: absolute; left: 16.66%; right: 16.66%; top: 14px; height: 2px; background: var(--line-strong); opacity: .6; }
.track .fill { position: absolute; left: 16.66%; top: 14px; height: 2px; width: 66.68%; background: var(--ink); transform: scaleX(0); transform-origin: 0 50%; transition: transform .32s var(--ease); }
.track[data-at="1"] .fill { transform: scaleX(.5); }
.track[data-at="2"] .fill { transform: scaleX(1); }
.st { display: grid; justify-items: center; gap: 8px; text-align: center; position: relative; }
.st i { width: 22px; height: 22px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line-strong); position: relative; transition: background .24s .08s, border-color .24s .08s; }
.st.done i { background: var(--ink); border-color: var(--ink); }
.st.now i { border-color: var(--ink); }
.st.now i::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--seal); animation: breathe 1.6s ease-in-out infinite; }
.st.now i::before { content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 1px solid var(--seal); animation: ring 1.8s var(--ease) infinite; }
@keyframes breathe { 50% { transform: scale(.55); opacity: .6; } }
.st b { font-size: 13px; font-weight: 600; }
.st span { font-size: 12px; color: var(--dim); display: block; font-weight: 400; margin-top: 2px; }
.st:not(.done):not(.now) b { color: var(--dim); }

.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 12px; }
.steps li { counter-increment: s; position: relative; padding-left: 40px; min-height: 28px; padding-top: 2px; color: var(--mute); font-size: 15px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 700 13px/1 var(--mono); background: var(--panel-2); border: 1px solid var(--line); color: var(--ink); }
.steps li b { color: var(--ink); font-weight: 600; }
.steps .inl { font: 700 .95em var(--mono); letter-spacing: .12em; color: var(--ink); background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 4px 1px 7px; }
.h-small { font: 500 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--gbc); }
.note-box { font-size: 14px; color: var(--mute); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.note-box b { color: var(--ink); font-weight: 600; }
.others { display: grid; gap: 8px; }
.other { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; color: var(--ink); }
.other:hover { border-color: var(--line-strong); }
.other small { color: var(--dim); display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


.toast {
  position: fixed; z-index: 2147483647; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: opacity .25s, transform .25s var(--ease); box-shadow: 0 12px 30px -12px rgba(0,0,0,.6);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 680px) { .toast { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); } }

/* ================= round 2: tabs, handle, chat, trading, Pokédex ================= */
.av { border-radius: 50%; flex: none; display: inline-block; vertical-align: middle; }
.av.anon { color: var(--dim); }
.rc-note .av { margin-right: 6px; vertical-align: -4px; }
#meBtn { padding: 0; overflow: hidden; }
#meBtn .av { width: 100%; height: 100%; }
#meBtn .av.anon { width: 22px; height: 22px; }

/* ---- Lobby | Trading */
.tabs { position: sticky; top: calc(55px + env(safe-area-inset-top, 0px)); z-index: 12; background: var(--bar); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.tabs-in { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); display: flex; align-items: stretch; gap: 26px; }
.tab { border: 0; background: none; padding: 14px 2px 12px; font-size: 16px; font-weight: 600; color: var(--mute); border-bottom: 2px solid transparent; display: flex; align-items: center; gap: 8px; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.tab .n { font: 500 12px/1 var(--mono); color: var(--dim); }
.discord { margin-left: auto; align-self: center; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--mute); text-decoration: none; white-space: nowrap; }
.discord:hover { color: var(--ink); }
.discord svg { width: 16px; height: 16px; }
@media (max-width: 680px) { .discord .long { display: none; } .tabs-in { gap: 20px; } .tab { font-size: 15px; } }

/* ---- games without box art: a plain version-colour block */
.tile { display: inline-grid; place-items: center; background: var(--c); color: #fbf7ec; position: relative; overflow: hidden; flex: none; font-size: 20px; }
.tile b { font: 700 1.6em/1 var(--serif); }
.tile i { position: absolute; right: .3em; bottom: .25em; font: 500 9px/1 var(--mono); font-style: normal; opacity: .85; letter-spacing: .04em; }
.chip .tile { width: 28px; height: 28px; border-radius: 50%; font-size: 9px; }
.chip .tile i { display: none; }
.game .tile { width: 100%; aspect-ratio: 1; border-radius: 10px; font-size: 30px; box-shadow: 0 0 0 1px rgba(0,0,0,.16), 0 8px 18px -10px rgba(0,0,0,.55); transition: transform .2s var(--ease), box-shadow .2s; }
.game:hover .tile, .game:focus-visible .tile { transform: translateY(-3px); box-shadow: 0 0 0 2px var(--accent), 0 14px 22px -12px rgba(0,0,0,.6); }
.chosen .tile { width: 72px; height: 72px; border-radius: 9px; }
.sheet-hero .tile { width: 84px; height: 84px; border-radius: 10px; font-size: 22px; }
.stack { display: inline-flex; }
.stack > * { margin-left: -12px; box-shadow: 0 0 0 2px var(--panel); }
.stack > :first-child { margin-left: 0; }
.chip[aria-pressed="true"] .stack > * { box-shadow: 0 0 0 2px var(--ink); }
#chips { display: grid; gap: 2px; }
.chips.sub .chip { min-height: 34px; font-size: 13px; background: transparent; }
.chips.sub .chip[aria-pressed="true"] { background: var(--ink); }
.g-series { display: flex; gap: 8px; flex-wrap: wrap; }
.g-h { font: 700 18px/1.2 var(--serif); display: flex; align-items: baseline; gap: 8px; margin: 6px 0 12px; }
.g-h span { font: 500 12px/1 var(--mono); color: var(--dim); }
#games { display: grid; gap: 14px; }


/* ---- trading */
.head-acts { display: flex; gap: 10px; align-items: center; flex: none; }
.wants-box { margin-top: 18px; display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.wb-mons { display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; margin-top: 8px; min-height: 40px; }
.wb-mons .w { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; }
.wb-mons .none-yet { color: var(--dim); font-size: 14px; }
.toggle { min-height: 42px; padding: 0 14px 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--mute); font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.toggle::before { content: ""; width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--line-strong); }
.toggle[aria-pressed="true"] { color: var(--host); border-color: var(--host-line); background: var(--host-bg); }
.toggle[aria-pressed="true"]::before { background: var(--host); border-color: var(--host); box-shadow: inset 0 0 0 2px var(--panel); }
.mon { --sz: 48px; width: var(--sz); height: var(--sz); display: inline-grid; place-items: center; flex: none; position: relative; }
.mon img { width: 100%; height: 100%; image-rendering: pixelated; object-fit: contain; }
.mon em { display: none; }
.mon.ns { border-radius: 50%; background: linear-gradient(135deg, var(--a) 50%, var(--b) 50%); transform: scale(.74); box-shadow: inset 0 0 0 2px rgba(0,0,0,.14); }
.mon.ns img { display: none; }
.mon.ns em { display: block; font: 700 calc(var(--sz) * .3)/1 var(--mono); font-style: normal; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.mon.sm { --sz: 34px; }
.tp { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 12px; align-content: start; box-shadow: var(--shadow); cursor: pointer; transition: border-color .2s, transform .2s var(--ease); }
.tp:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.tp.mine { border-color: var(--accent); }
.tp.mine::before { content: "Your post"; position: absolute; top: -10px; left: 14px; font: 500 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; background: var(--accent); color: #fbf7ec; padding: 4px 8px; border-radius: 4px; }
:root[data-theme="dark"] .tp.mine::before { color: var(--on-btn); }
.tp-head { display: flex; align-items: center; gap: 9px; font-size: 14px; min-width: 0; }
.tp-head b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-head .rc-age { margin-left: auto; }
.ver { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px 3px 7px; }
.ver::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.ver small { font: 500 10px/1 var(--mono); color: var(--dim); }
.match { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--host); background: var(--host-bg); border: 1px solid var(--host-line); border-radius: 8px; padding: 6px 10px; }
.match::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.tp-lists { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.tp-lists > div { display: grid; gap: 8px; align-content: start; min-width: 0; }
.tp-lists > div + div { border-left: 1px dashed var(--line); padding-left: 12px; }
.ents { display: flex; flex-wrap: wrap; gap: 8px 4px; }
.ent { width: 64px; display: grid; justify-items: center; text-align: center; gap: 1px; border-radius: 10px; padding: 2px 0 4px; }
.ent b { font-size: 12px; font-weight: 500; line-height: 1.2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ent small { font: 500 10px/1.25 var(--mono); color: var(--dim); max-width: 100%; overflow-wrap: anywhere; }
.ent.hit { background: var(--host-bg); box-shadow: 0 0 0 1px var(--host-line); }
.ents.big .ent { width: 84px; }
.ents.big .mon { --sz: 64px; }
.ents.big .ent b { font-size: 13px; white-space: normal; }
.ents.big .ent small { font-size: 11px; }
.tp-foot { display: flex; align-items: center; gap: 10px; border-top: 1px dashed var(--line); padding-top: 10px; font-size: 13px; color: var(--dim); }
.tp-foot .rc-state { margin-left: auto; }
.roomlink { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 12px 0 10px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--ink); font-size: 13px; font-weight: 600; }
.roomlink:hover { background: var(--panel-2); }
.roomlink code { font: 700 13px/1 var(--mono); letter-spacing: .1em; }
.roomlink i { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.roomlink[data-status="hosting"] i { background: var(--host); }
.roomlink[data-status="waiting"] i { background: transparent; border: 1.5px dashed var(--wait); }
.roomlink[data-status="playing"] i { background: var(--play); }
.discord-card { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 18px; display: grid; gap: 10px; align-content: start; justify-items: start; }
.discord-card h3 { font: 700 20px/1.2 var(--serif); }
.discord-card p { color: var(--mute); font-size: 14px; }
.roombox { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 14px; color: var(--mute); }
.roombox .btn { margin-left: auto; }
.post-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.post-top b { font-weight: 600; font-size: 17px; }
.post-top .rc-age { margin-left: auto; }
.post-lists { display: grid; gap: 16px; }
.post-lists > div { display: grid; gap: 10px; }

/* trade editor */
.vers { display: flex; flex-wrap: wrap; gap: 8px; }
.verpick { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 13px 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--mute); font-size: 14px; font-weight: 500; }
.verpick::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.verpick[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.vgroup { display: grid; gap: 8px; }
.vgroup + .vgroup { margin-top: 4px; }
.vgroup > span { font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.erows { display: grid; gap: 8px; }
.erow { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; gap: 8px 10px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.erow .mon { --sz: 44px; }
.erow .nm { font-size: 14px; font-weight: 600; display: block; }
.erow .field { min-height: 34px; border-radius: 8px; padding: 0 10px; font-size: 13px; margin-top: 4px; }
.erow .want { min-height: 34px; padding: 0 10px; font-size: 12px; }
.erow .icon-btn { width: 32px; height: 32px; }
.add-mon { min-height: 44px; border-radius: 12px; border: 1px dashed var(--line-strong); background: transparent; color: var(--ink); font-size: 14px; font-weight: 600; }
.add-mon:hover { background: var(--panel-2); }
.as-me { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--mute); flex-wrap: wrap; }
.as-me b { color: var(--ink); font-weight: 600; }

/* Pokédex picker */
#dexDlg { height: min(calc(100% - 32px), 780px); }
.dex-tools { display: grid; gap: 10px; padding: 14px 20px 12px; border-bottom: 1px solid var(--line); flex: none; }
.dex-tools .row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.dex-tools .search { max-width: none; margin: 0; flex: 1 1 200px; }
.types { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 0 20px 2px; }
.types::-webkit-scrollbar { display: none; }
.tchip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 11px 0 8px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--mute); font-size: 13px; font-weight: 500; }
.tchip::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--line-strong)); }
.tchip.all::before { display: none; }
.tchip.all { padding-left: 11px; }
.tchip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.dex-h { font: 700 17px/1.2 var(--serif); display: flex; align-items: baseline; gap: 8px; position: sticky; top: -20px; background: var(--bg); padding: 8px 0; z-index: 2; margin: -8px 0 -6px; }
.dex-h span { font: 500 12px/1 var(--mono); color: var(--dim); }
.dex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
@media (max-width: 420px) { .dex-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; } }
.dex-cell { position: relative; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 6px 2px 7px; display: grid; justify-items: center; gap: 1px; color: var(--ink); min-width: 0; transition: border-color .15s, background .15s, transform .15s var(--ease); }
.dex-cell:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.dex-cell .mon { --sz: 56px; }
.dex-cell .no { font: 500 10px/1 var(--mono); color: var(--dim); font-style: normal; }
.dex-cell b { font-size: 12px; font-weight: 500; line-height: 1.2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.dex-cell[aria-pressed="true"] { border-color: var(--ink); background: var(--panel-2); box-shadow: 0 0 0 1px var(--ink); }
.dex-cell[aria-pressed="true"]::after { content: ""; position: absolute; top: 6px; right: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 8.2l2.3 2.3 4.7-5'/%3E%3C/svg%3E") center/contain no-repeat; }
.dex-cell .oth { position: absolute; top: 5px; left: 6px; font: 500 9px/1 var(--mono); text-transform: uppercase; letter-spacing: .04em; color: var(--dim); }
.tray { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.tray .lab { font-size: 13px; color: var(--mute); white-space: nowrap; }
.tray .lab b { color: var(--ink); }
.tray .mons { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.tray .mons::-webkit-scrollbar { display: none; }
@media (max-width: 680px) {
  #dexDlg { height: calc(100% - 24px); }
  .tp-lists { gap: 8px; }
  .ent { width: 60px; }
  .erow { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .erow .want { grid-column: 2; justify-self: start; grid-row: 2; }
  .erow .icon-btn { grid-column: 3; grid-row: 1; }
  .dex-tools { padding: 12px 16px 10px; }
}

/* ---- motion: one easing, 180 to 320 ms, transform and opacity only */
::view-transition { pointer-events: none; }
::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation-duration: 280ms; animation-timing-function: cubic-bezier(.2,.7,.2,1); }
html[data-vt^="tab"] #view { view-transition-name: view; }
html[data-vt^="tab"]::view-transition-old(root), html[data-vt^="tab"]::view-transition-new(root) { animation: none; }
html[data-vt="tab-fwd"]::view-transition-old(view) { animation: vt-out-l 200ms cubic-bezier(.2,.7,.2,1) both; }
html[data-vt="tab-fwd"]::view-transition-new(view) { animation: vt-in-r 300ms cubic-bezier(.2,.7,.2,1) both; }
html[data-vt="tab-back"]::view-transition-old(view) { animation: vt-out-r 200ms cubic-bezier(.2,.7,.2,1) both; }
html[data-vt="tab-back"]::view-transition-new(view) { animation: vt-in-l 300ms cubic-bezier(.2,.7,.2,1) both; }
@keyframes vt-out-l { to { opacity: 0; transform: translateX(-36px); } }
@keyframes vt-out-r { to { opacity: 0; transform: translateX(36px); } }
@keyframes vt-in-r { from { opacity: 0; transform: translateX(36px); } }
@keyframes vt-in-l { from { opacity: 0; transform: translateX(-36px); } }
html[data-vt="morph"] .vt-src [data-m="a"], html[data-vt="morph"] dialog.vt-dst[open] [data-m="a"] { view-transition-name: m-a; }
html[data-vt="morph"] .vt-src [data-m="b"], html[data-vt="morph"] dialog.vt-dst[open] [data-m="b"] { view-transition-name: m-b; }
dialog.vt-dst[open], dialog.vt-dst[open]::backdrop { animation: none; }  /* kept until close: no second rise when the transition ends */
dialog.closing { animation: dlg-out 180ms cubic-bezier(.2,.7,.2,1) forwards; }
dialog.closing::backdrop { animation: fade-out 180ms ease forwards; }
@keyframes dlg-out { to { opacity: 0; transform: translateY(14px); } }
@keyframes fade-out { to { opacity: 0; } }

/* ================= round 3: profile, regions, ask to join, find a partner, share card ================= */
.av.avm { display: inline-grid; place-items: center; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.av.avm img { width: 112%; height: 112%; max-width: none; image-rendering: pixelated; object-fit: contain; }
.rc-head { flex-wrap: wrap; }
.tp-head .rc-age { white-space: nowrap; }
.board-head .head-acts { align-self: flex-end; }

/* profile sheet */
.prof-top { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.prof-top .av { width: 72px; height: 72px; }
.prof-top .name { font: 700 clamp(21px, 5vw, 26px)/1.15 var(--serif); }
.prof-top .sub { font-size: 13px; color: var(--dim); margin-top: 3px; }
.gal { max-height: 236px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); gap: 6px; padding: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overscroll-behavior: contain; }
.gal button { aspect-ratio: 1; border: 1px solid transparent; border-radius: 10px; background: none; display: grid; place-items: center; padding: 0; }
.gal button:hover { background: var(--panel-2); }
.gal button[aria-pressed="true"] { border-color: var(--ink); background: var(--panel-2); box-shadow: 0 0 0 1px var(--ink); }
.gal .mon { --sz: 44px; }
.gal .av { width: 40px; height: 40px; }

/* notifications: the ask, the browser's prompt, the system note */
.nask { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 14px; color: var(--mute); }
.nask b { color: var(--ink); font-weight: 600; display: block; }
.nask > div:first-child { flex: 1 1 200px; }
.nask .acts { display: flex; gap: 8px; }
.pingbox { border: 1px solid var(--accent); border-radius: 12px; padding: 12px 14px; display: grid; gap: 10px; background: var(--play-bg); font-size: 14px; }
.pingbox .row { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: start; }
.pingbox .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pingbox small { color: var(--mute); display: block; }
.d-foot .btn + .btn { margin-left: 0; }

/* find me a partner */
.qbar { max-width: var(--max); margin: 0 auto; padding: 8px var(--gutter) 10px; display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--mute); }
.qbar b { color: var(--ink); font-weight: 600; }
.qbar .live-dot { background: var(--wait); }
.qbar .live-dot::after { border-color: var(--wait); }
.qbar .btn { margin-left: auto; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--mute); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.check b { color: var(--ink); font-weight: 600; display: block; }
.q-stage { display: grid; justify-items: center; text-align: center; gap: 14px; padding: 6px 0; }
.radar { position: relative; width: 196px; height: 196px; display: grid; place-items: center; }
.radar i { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid var(--line-strong); opacity: 0; animation: radar 3s cubic-bezier(.2,.7,.2,1) infinite; }
.radar i:nth-child(2) { animation-delay: 1s; }
.radar i:nth-child(3) { animation-delay: 2s; }
@keyframes radar { 0% { transform: scale(.46); opacity: .95; } 100% { transform: scale(1); opacity: 0; } }
.radar .ra { position: relative; width: 92px; height: 92px; border-radius: 12px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.16), 0 12px 24px -12px rgba(0,0,0,.6); }
.q-count { font: 700 clamp(22px, 5vw, 30px)/1.15 var(--serif); }
.q-sub { color: var(--mute); font-size: 15px; }
.q-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 15px; color: var(--mute); justify-items: center; }
.q-lines li { display: flex; align-items: center; gap: 8px; }
.q-lines li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.q-lines li.next { color: var(--dim); }
.q-lines li.next::before { background: transparent; border: 1.5px dashed var(--dim); }
.q-clock { font: 500 13px/1 var(--mono); color: var(--dim); letter-spacing: .04em; }
.pair { display: flex; align-items: flex-start; justify-content: center; gap: 16px; }
.pair .who { display: grid; justify-items: center; gap: 6px; font-size: 14px; font-weight: 600; width: 118px; }
.pair .who .av { width: 64px; height: 64px; }
.pair .who small { font-weight: 400; color: var(--dim); font-size: 13px; }
.pair .who .rd { font: 500 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: 4px 7px; border-radius: 4px; border: 1px dashed var(--line-strong); color: var(--dim); }
.pair .who .rd.ok { border: 1px solid var(--host-line); background: var(--host-bg); color: var(--host); }
.pair .pbar { width: 44px; height: 2px; background: var(--line-strong); margin-top: 32px; }
.btn-big { min-height: 58px; padding: 0 40px; font-size: 19px; }

/* the signal: wait (yellow, pause bars, top lamp, pulsing) / go (green, arrow, bottom lamp, solid) */
.signal { --lc: #b98a08; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(16px, 4vw, 30px); align-items: center; padding: clamp(16px, 3vw, 26px); border-radius: 24px; border: 2px solid var(--lc); position: relative; overflow: hidden; background: var(--panel); }
.signal::before { content: ""; position: absolute; inset: 0; background: var(--lc); opacity: .1; pointer-events: none; }
.signal[data-light="green"] { --lc: #4f8a12; }
.signal[data-light="linked"] { --lc: var(--accent); }
.signal[data-light="failed"] { --lc: var(--seal); }
:root[data-theme="dark"] .signal { --lc: #f5c518; }
:root[data-theme="dark"] .signal[data-light="green"] { --lc: #8fd63f; }
:root[data-theme="dark"] .signal[data-light="linked"] { --lc: var(--accent); }
:root[data-theme="dark"] .signal[data-light="failed"] { --lc: var(--seal); }
.housing { position: relative; display: grid; gap: 12px; padding: 12px; border-radius: 80px; background: #1b1830; box-shadow: inset 0 0 0 2px rgba(255,255,255,.07), 0 16px 30px -14px rgba(0,0,0,.7); }
.lamp { width: clamp(80px, 21vw, 112px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; position: relative; background: #262243; color: rgba(255,255,255,.2); box-shadow: inset 0 0 0 2px rgba(255,255,255,.08); }
.lamp svg { width: 46%; height: 46%; }
.lamp .on { position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center; opacity: 0; transform: scale(.84); transition: opacity .28s cubic-bezier(.2,.7,.2,1), transform .28s cubic-bezier(.2,.7,.2,1); color: #1b1830; }
.lamp.wait .on { background: #f5c518; box-shadow: 0 0 34px 4px rgba(245,197,24,.55), inset 0 -8px 16px rgba(0,0,0,.12); }
.lamp.go .on { background: #7dcb2f; box-shadow: 0 0 34px 4px rgba(125,203,47,.6), inset 0 -8px 16px rgba(0,0,0,.12); }
.lamp .i-main, .lamp .i-link { place-items: center; width: 100%; height: 100%; }
.lamp .i-main { display: grid; }
.lamp .i-link { display: none; }
[data-light="yellow"] .lamp.wait .on, [data-light="green"] .lamp.go .on, [data-light="linked"] .lamp .on { opacity: 1; transform: none; }
[data-light="linked"] .lamp.wait .on { background: #7dcb2f; box-shadow: 0 0 34px 4px rgba(125,203,47,.6); }
[data-light="linked"] .lamp .i-main { display: none; }
[data-light="linked"] .lamp .i-link { display: grid; }
[data-light="yellow"] .lamp.wait::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid #f5c518; animation: ring 1.8s cubic-bezier(.2,.7,.2,1) infinite; }
[data-light="green"] .lamp.go::after, [data-light="linked"] .lamp.go::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 3px solid #7dcb2f; animation: burst .32s cubic-bezier(.2,.7,.2,1) forwards; }
@keyframes burst { from { opacity: .9; transform: scale(.9); } to { opacity: 0; transform: scale(1.5); } }
/* Session ended: neutral (not the failure red), both lamps dark, a stop square in the label */
.signal[data-light="ended"], :root[data-theme="dark"] .signal[data-light="ended"] { --lc: var(--mute); border-style: dashed; }
.signal[data-light="ended"]::before { opacity: .05; }
[data-light="ended"] .lamp { opacity: .6; }
.sig-k > .ico { width: 1.05em; height: 1.05em; display: inline-grid; }
.sig-k > .ico svg { width: 100%; height: 100%; }
.ended-sum { display: grid; gap: 8px 20px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.ended-sum div { display: grid; gap: 4px; min-width: 0; }
.ended-sum dt { font: 600 12px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.ended-sum dd { margin: 0; color: var(--ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; overflow-wrap: anywhere; }
[data-light="failed"] .housing::after { content: ""; position: absolute; left: 50%; top: 50%; width: 3px; height: 86%; background: var(--seal); transform: translate(-50%, -50%) rotate(28deg); border-radius: 2px; }
.sig-k { font: 700 clamp(13px, 3.4vw, 15px)/1 var(--mono); letter-spacing: .16em; color: var(--lc); display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid var(--lc); border-radius: 6px; padding: 6px 9px; }
.signal h3 { font: 700 clamp(23px, 5.6vw, 38px)/1.08 var(--serif); margin-top: 12px; position: relative; }
.signal p.s { color: var(--mute); font-size: 15px; margin-top: 10px; position: relative; }
.signal p.s b { color: var(--ink); }
.signal .q-clock { display: block; margin-top: 12px; position: relative; }
.sig-code { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; }
.sig-code .with { font-size: 14px; color: var(--mute); display: inline-flex; align-items: center; gap: 8px; }

@media (max-width: 560px) {
  .signal { grid-template-columns: minmax(0, 1fr); justify-items: start; }
  .housing { grid-auto-flow: column; }
  .lamp { width: 84px; }
}
details.share { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
details.share summary { cursor: pointer; padding: 11px 14px; font-size: 14px; font-weight: 600; }
details.share > div { padding: 0 14px 14px; display: grid; gap: 10px; }
.unfurl { background: #313338; color: #dbdee1; border-radius: 10px; padding: 14px; font: 15px/1.4 "Segoe UI", system-ui, sans-serif; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; }
.unfurl .av { width: 36px; height: 36px; }
.unfurl .who { font-weight: 600; color: #f2f3f5; }
.unfurl .who small { font-weight: 400; color: #949ba4; font-size: 12px; margin-left: 6px; }
.unfurl .uf-link { color: #00a8fc; overflow-wrap: anywhere; }
.uf-embed { margin-top: 6px; background: #2b2d31; border-left: 4px solid #8f80ff; border-radius: 4px; padding: 10px 12px 12px; display: grid; gap: 5px; max-width: 440px; }
.uf-embed small { color: #b5bac1; font-size: 12px; }
.uf-embed .uf-title { color: #00a8fc; font-weight: 600; }
.uf-embed p { font-size: 14px; color: #dbdee1; }


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; transition-delay: 0s !important; }
  html { scroll-behavior: auto; }
}

/* ================= production additions ================= */
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px; text-decoration: none; font-weight: 600; }
.skip:focus { top: 12px; }
.ico { display: inline-grid; place-items: center; flex: none; }
.ico svg { width: 100%; height: 100%; display: block; }
.icon-btn .ico { width: 17px; height: 17px; }
.search .ico { position: absolute; left: 13px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--dim); pointer-events: none; }
.discord .ico { width: 16px; height: 16px; }
.btn .ico { width: 16px; height: 16px; }
.copy .ico { width: 14px; height: 14px; }
.kofi-btn { color: var(--seal); text-decoration: none; }
.kofi-btn:hover { color: var(--seal); }
.lbl-wide { display: none; }
@media (min-width: 980px) { .lbl-wide { display: flex; } }
.live-dot.off { background: var(--dim); }
.live-dot.off::after { display: none; }
.mode { font: 500 12px/1 var(--mono); color: var(--dim); letter-spacing: .04em; white-space: nowrap; }
.mode.poll { color: var(--wait); }
.toast { white-space: normal; max-width: min(560px, calc(100vw - 32px)); text-align: center; border-radius: 18px; }
.noscript { max-width: 640px; margin: 24px auto; padding: 0 16px; }
.chips { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent 100%); }

/* launch-night banner */
.event { position: relative; z-index: 11; background: var(--btn); color: var(--on-btn); }
.event-in { max-width: var(--max); margin: 0 auto; padding: 9px var(--gutter); display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; font-size: 14px; }
.event b { font-weight: 700; }
.event .cd { font: 700 14px/1 var(--mono); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.event .tag { font: 700 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; border: 1.5px solid currentColor; border-radius: 5px; padding: 4px 6px; }
.event.live .tag { background: #7dcb2f; color: #14210a; border-color: #7dcb2f; }
.event a { color: inherit; margin-left: auto; font-weight: 600; }

/* status on cards: in game uses the mockup's "playing" look; closed is greyed */
[data-status="closed"] .pill { color: var(--dim); background: transparent; border-color: var(--line-strong); }
[data-status="closed"] .pill i { border: 1.5px solid currentColor; }
.room[data-status="closed"] { opacity: .62; box-shadow: none; }
[data-status="closed"] .code span { background: transparent; color: var(--dim); border: 1.5px solid var(--line); }
.rc-region { font-size: 13px; color: var(--dim); }

/* Active: both players on the card */
.players { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.player { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; max-width: 100%; border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px 3px 3px; background: var(--panel-2); color: var(--ink); font-size: 14px; font-weight: 600; text-align: left; }
.player:hover { border-color: var(--line-strong); }
.player .av { width: 28px; height: 28px; }
.player span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.player small { font-weight: 400; color: var(--dim); font-size: 12px; white-space: nowrap; }
.player.anon { border-style: dashed; background: transparent; color: var(--mute); font-weight: 500; cursor: default; }
.players .vs { color: var(--dim); display: inline-grid; place-items: center; width: 18px; height: 18px; }
.room.act { cursor: pointer; }
.act-meta { font-size: 13px; color: var(--dim); }

/* profile: typed name, switches, Discord */
.name-row { display: flex; gap: 8px; flex-wrap: wrap; }
.name-row .field { flex: 1 1 180px; min-width: 0; border-radius: 12px; min-height: 46px; font-size: 17px; font-weight: 600; }
.err { font-size: 13px; color: var(--seal); }
.ok-hint { font-size: 13px; color: var(--host); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; font-size: 14px; color: var(--mute); }
.switch b { color: var(--ink); font-weight: 600; display: block; }
.switch button[role="switch"] { flex: none; width: 46px; height: 28px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--panel-2); position: relative; padding: 0; transition: background .2s var(--ease), border-color .2s; }
.switch button[role="switch"]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--dim); transition: transform .2s var(--ease), background .2s; }
.switch button[aria-checked="true"] { background: var(--host-bg); border-color: var(--host-line); }
.switch button[aria-checked="true"]::after { transform: translateX(18px); background: var(--host); }
.dbox { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 12px; }
.dbox .row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dbox .row .spacer { flex: 1; }
.dcode { font: 700 clamp(30px, 8vw, 40px)/1 var(--mono); letter-spacing: .18em; text-align: center; padding: 8px 0 2px; }
.dcmd { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
.dcmd code { font: 500 15px/1 var(--mono); background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; }
.center { text-align: center; }
.muted { color: var(--mute); font-size: 14px; }
dialog.small { width: min(400px, calc(100vw - 32px)); }
.pcard { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 8px 0 4px; }
.pcard .av { width: 88px; height: 88px; }
.pcard h3 { font: 700 24px/1.15 var(--serif); }
.pcard .dname { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--mute); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }
.pcard .dname .ico { width: 15px; height: 15px; }

/* in-page notes (the tab is visible; a system notification is used when it is hidden) */
.notes { position: fixed; z-index: 40; top: 66px; right: 16px; width: min(372px, calc(100% - 24px)); display: grid; gap: 10px; pointer-events: none; }
.note-card { pointer-events: auto; background: color-mix(in srgb, var(--panel) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line-strong); border-radius: 16px; padding: 12px 14px; box-shadow: 0 18px 40px -18px rgba(0,0,0,.65); display: grid; gap: 5px; font-size: 14px; color: var(--mute); }
.note-card .sn-h { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--dim); }
.note-card .sn-h img { width: 16px; height: 16px; border-radius: 4px; }
.note-card .x { margin-left: auto; border: 0; background: none; color: var(--dim); padding: 0 4px; font-size: 18px; line-height: 1; min-width: 28px; min-height: 28px; }
.note-card b.t { color: var(--ink); font-weight: 600; }
.note-card .acts, .pingbox .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.note-card .acts button, .pingbox .acts button { min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--ink); font-size: 13px; font-weight: 500; }
.note-card .acts button:hover, .pingbox .acts button:hover { background: var(--panel-2); }
@media (max-width: 680px) { .notes { left: 12px; right: 12px; width: auto; top: 62px; } }

/* game picker: a wrapped, series-grouped grid (no horizontal scroller) */
.pick { display: grid; gap: 14px; }
.games.compact { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 12px 10px; }
.games.compact .game b { font-size: 12px; }
.game[aria-pressed="true"] img { box-shadow: 0 0 0 3px var(--ink), 0 12px 20px -10px rgba(0,0,0,.6); transform: translateY(-3px); }
.game .q { font: 500 11px/1.2 var(--mono); color: var(--host); }
@media (max-width: 420px) { .games.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* claim (Already hosting?) */
.claim { display: grid; gap: 10px; background: var(--panel); border: 1px dashed var(--line-strong); border-radius: 12px; padding: 12px 14px; font-size: 14px; color: var(--mute); }
.claim .field { font: 700 20px/1 var(--mono); letter-spacing: .3em; text-transform: uppercase; max-width: 190px; border-radius: 10px; }

/* share preview: the real per-game card */
.og-img { margin-top: 6px; width: 100%; height: auto; aspect-ratio: 1200 / 630; border-radius: 6px; background: #1e1f22; }

/* trade editor: preset tags and level, no free text */
.erow select, .erow input[type="number"] { min-height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: 13px; padding: 0 8px; margin-top: 4px; }
.erow .meta { display: flex; gap: 6px; flex-wrap: wrap; }
.erow input[type="number"] { width: 78px; }

/* linked: the soft Ko-fi line */
.kofi-soft { font-size: 14px; color: var(--mute); text-align: center; }
.foot .kofi-line { color: var(--mute); font-size: 14px; }
.foot .kofi-line a { color: var(--accent-ink); }

/* this match is not yours, or a room that ended */
.gone { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 10px 0; }
.gone .m { width: 96px; height: 96px; border-radius: 50%; background: var(--moon); }
.gone h3 { font: 700 22px/1.2 var(--serif); }
.gone p { color: var(--mute); max-width: 40ch; }
details.troubles { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
details.troubles summary { cursor: pointer; padding: 11px 14px; font-size: 14px; font-weight: 600; }
details.troubles ul { margin: 0; padding: 0 14px 14px 32px; display: grid; gap: 8px; font-size: 14px; color: var(--mute); }
details.troubles b { color: var(--ink); }
.recode { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 14px; color: var(--mute); justify-content: center; }
.linkish { border: 0; background: none; padding: 0; color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; font-size: 14px; }

/* phone header: mark, two numbers, three round buttons; nothing may push off-screen */
@media (max-width: 560px) {
  .bar { gap: 8px; }
  .bar-mark span { display: none; }
  .live { gap: 10px; }
  .icon-btn { width: 34px; height: 34px; }
  .event-in { padding-top: 7px; padding-bottom: 7px; gap: 6px 12px; font-size: 13px; }
  .event .when { display: none; }
}
@media (max-width: 400px) { .live .live-item + .live-item { display: none; } }
/* icons arrive wrapped in .ico: size the wrapper, let the svg fill it */
.search .ico svg, .lamp .ico svg, .btn .ico svg, .copy .ico svg, .icon-btn .ico svg { position: static; transform: none; width: 100%; height: 100%; }
.lamp > .ico, .lamp .i-main .ico, .lamp .i-link .ico { width: 46%; height: 46%; }
.copy.done .ico { color: var(--host); }
/* a dialog never scrolls as a whole (scrollIntoView/focus would shift its head off-screen) */
dialog { overflow: clip; }
.dbox .ico { width: 18px; height: 18px; color: var(--mute); }
.tp-head { flex-wrap: wrap; }
.tp-head b { min-width: 3em; }
.types { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 20px, #000 calc(100% - 28px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 20px, #000 calc(100% - 28px), transparent 100%); }
