/* Lobbo: paper and ink. Flat colour fills, near-black outlines, mint means "go".
   Focus rings stay big so the site is easy to drive with a controller. */

:root {
  color-scheme: light;
  --bg: #f5f6ff;
  --surface: #ffffff;
  --surface-2: #f2f4ff;
  --surface-3: #e2e7f7;
  --text: #11142b;
  --text-2: #414867;
  --muted: #687195;
  --edge: #11142b;
  --hair: #d5daf0;
  --outline: #11142b;
  --drop: #11142b;
  --go: #54e0b3;
  --go-hover: #7af0cb;
  --go-ink: #071629;
  --go-soft: #d9f8ed;
  --hot: #8b5cf6;
  --hot-soft: #ede5ff;
  --sun: #35c5f4;
  --sun-soft: #def6ff;
  --sky: #35c5f4;
  --sky-soft: #def6ff;
  --pink: #9b7bff;
  --pink-soft: #eee7ff;
  --danger: #d9381f;
  --danger-soft: #ffe1db;
  --discord: #5865f2;
  --discord-soft: #e4e7ff;
  --link: #5e3acb;
  --scrim: rgba(8, 10, 32, 0.55);
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2311142b' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");

  --radius: 10px;
  --radius-sm: 7px;
  --lift-sm: 2px 2px 0 var(--drop);
  --lift: 3px 3px 0 var(--drop);
  --lift-lg: 5px 5px 0 var(--drop);
  --header-h: 64px;
  --font: "Archivo Black", Segoe UI Variable Text, Segoe UI, system-ui, -apple-system, BlinkMacSystemFont, Roboto, Helvetica Neue, Arial, sans-serif;
  --font-display: "Archivo Black", Bahnschrift, DIN Alternate, DIN Condensed, Roboto Condensed, Arial Narrow, Segoe UI, system-ui, sans-serif;
  /* White lettering with a near-black outline, for text on game colours. */
  --stroke: -1px -1px 0 var(--outline), 1px -1px 0 var(--outline), -1px 1px 0 var(--outline), 1px 1px 0 var(--outline), 0 2px 0 var(--outline);
  /* The faint zig-zag that sits on every flat colour fill. */
  --zigzag:
    linear-gradient(135deg, rgba(255, 255, 255, 0.13) 25%, transparent 25%) -7px 0 / 14px 14px,
    linear-gradient(225deg, rgba(255, 255, 255, 0.13) 25%, transparent 25%) -7px 0 / 14px 14px,
    linear-gradient(315deg, rgba(255, 255, 255, 0.13) 25%, transparent 25%) 0 0 / 14px 14px,
    linear-gradient(45deg, rgba(255, 255, 255, 0.13) 25%, transparent 25%) 0 0 / 14px 14px;
}

/* Dark: the same ink and colour, with the paper turned off. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080a20;
  --surface: #10132d;
  --surface-2: #171b3a;
  --surface-3: #24294b;
  --text: #f5f6ff;
  --text-2: #c4c8df;
  --muted: #9299bd;
  --edge: #343958;
  --hair: #292e4b;
  --outline: #050617;
  --drop: #000;
  --go-soft: rgba(185, 243, 76, 0.12);
  --hot-soft: rgba(255, 91, 53, 0.16);
  --sun-soft: rgba(255, 205, 60, 0.13);
  --sky-soft: rgba(74, 168, 255, 0.14);
  --pink-soft: rgba(255, 111, 163, 0.15);
  --danger: #ff6a52;
  --danger-soft: rgba(255, 106, 82, 0.15);
  --discord-soft: rgba(88, 101, 242, 0.2);
  --link: #65d9f5;
  --scrim: rgba(0, 0, 0, 0.7);
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23f5f6ff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #080a20;
    --surface: #10132d;
    --surface-2: #171b3a;
    --surface-3: #24294b;
    --text: #f5f6ff;
    --text-2: #c4c8df;
    --muted: #9299bd;
    --edge: #343958;
    --hair: #292e4b;
    --outline: #050617;
    --drop: #000;
    --go-soft: rgba(185, 243, 76, 0.12);
    --hot-soft: rgba(255, 91, 53, 0.16);
    --sun-soft: rgba(255, 205, 60, 0.13);
    --sky-soft: rgba(74, 168, 255, 0.14);
    --pink-soft: rgba(255, 111, 163, 0.15);
    --danger: #ff6a52;
    --danger-soft: rgba(255, 106, 82, 0.15);
    --discord-soft: rgba(88, 101, 242, 0.2);
    --link: #65d9f5;
    --scrim: rgba(0, 0, 0, 0.7);
    --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23f5f6ff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  }
}

/* ---- Base ---------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 700; line-height: 1.1; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
/* Plain links inside text get an underline; links styled as buttons or cards have a class. */
a:not([class]) { color: var(--link); font-weight: 650; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 2px; }
a:not([class]):hover { color: var(--text); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
ul, ol { margin: 0; padding: 0; list-style: none; }
dl, dd { margin: 0; }
:focus-visible { outline: 3px solid var(--hot); outline-offset: 2px; }
::selection { background: var(--go); color: var(--go-ink); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border: 3px solid var(--bg); border-radius: 12px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
::-webkit-scrollbar-track { background: transparent; }

.icon { width: 18px; height: 18px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; top: -60px; left: 12px; z-index: 100; padding: 8px 14px; border: 2px solid var(--outline); border-radius: var(--radius-sm); background: var(--go); color: var(--go-ink); font-weight: 700; }
.skip-link:focus { top: 12px; }
.noscript { padding: 40px; text-align: center; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.fine { color: var(--muted); font-size: 12.5px; text-align: center; }
.hint { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--muted); font-size: 13px; }
.ok { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.ok .icon { padding: 2px; border: 2px solid var(--outline); border-radius: 50%; background: var(--go); color: var(--go-ink); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.row.center { justify-content: center; }
.row.end { justify-content: flex-end; }
.stack { display: grid; gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.label, .divider, .flabel, .preview-label {
  font: 700 12px/1.2 var(--font-display);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.divider { display: flex; align-items: center; gap: 12px; margin: 4px 0; color: var(--muted); }
.divider::before, .divider::after { content: ""; flex: 1; height: 2px; background: var(--hair); }

.spinner { display: inline-block; flex: none; width: 18px; height: 18px; border: 3px solid var(--surface-3); border-top-color: var(--text); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: 0.3; } }
.loading-block { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 80px 0; color: var(--muted); font-weight: 600; }

/* ---- Header ---------------------------------------------------------------- */

.header { position: sticky; top: 0; z-index: 30; border-bottom: 2px solid var(--edge); background: var(--surface); }
.header-inner { display: flex; align-items: center; gap: 22px; max-width: 1240px; height: var(--header-h); margin: 0 auto; padding: 0 24px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font: 700 26px/1 var(--font-display); letter-spacing: -0.01em; }
.brand-mark { width: 34px; height: 34px; }
.nav { display: flex; gap: 6px; }
.nav-link { padding: 8px 8px 6px; color: var(--text-2); font: 700 15px/1 var(--font-display); letter-spacing: 0.08em; text-transform: uppercase; }
.nav-link:hover { color: var(--text); }
/* A highlighter stroke under the current page. */
.nav-link.is-active { color: var(--text); background: linear-gradient(transparent 55%, var(--go) 55%, var(--go) 92%, transparent 92%); }
.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.live { display: inline-flex; align-items: center; gap: 8px; margin-right: 4px; color: var(--text-2); font: 700 13px/1 var(--font-display); letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.dot-live { display: inline-block; flex: none; width: 10px; height: 10px; border: 2px solid var(--outline); border-radius: 50%; background: var(--hot); animation: blink 1.8s ease-in-out infinite; }
.me-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 210px; padding: 2px 12px 2px 2px; border: 2px solid var(--edge); border-radius: 999px; background: var(--surface); color: var(--text); font-weight: 700; }
.me-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-chip:hover { background: var(--surface-2); }
.squads-btn { position: relative; }
.squads-btn .badge { position: absolute; top: -8px; right: -8px; }
.squads-pop {
  position: fixed;
  top: calc(var(--header-h) + 8px);
  right: max(16px, calc((100vw - 1240px) / 2 + 24px));
  z-index: 40;
  width: min(370px, calc(100vw - 32px));
  max-height: calc(100vh - var(--header-h) - 32px);
  padding: 14px;
  overflow-y: auto;
  border: 2px solid var(--edge);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--lift-lg);
}
.squads-pop h3 { margin-bottom: 10px; color: var(--muted); font-size: 12px; letter-spacing: 0.09em; text-transform: uppercase; }
.squads-pop ul { display: grid; gap: 4px; }
.squads-pop .muted { margin-bottom: 12px; }
.squad-link { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; color: var(--text); }
.squad-link:hover { background: var(--surface-2); }
.squad-text { display: grid; flex: 1; min-width: 0; }
.squad-text strong, .squad-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.squad-text small { color: var(--muted); }
.main { max-width: 1240px; margin: 0 auto; padding: 28px 24px 80px; outline: none; }
.offline-bar { display: none; position: fixed; top: 0; left: 50%; z-index: 60; padding: 6px 14px; transform: translateX(-50%); border: 2px solid var(--outline); border-top: 0; border-radius: 0 0 10px 10px; background: var(--sun); color: #11142b; font-size: 13px; font-weight: 700; }
.is-offline .offline-bar { display: block; }

/* Phones get a tab bar along the bottom instead of the header links. */
.tabbar { display: none; }

/* ---- Buttons --------------------------------------------------------------- */

.btn {
  --btn-bg: var(--surface);
  --btn-edge: var(--edge);
  --btn-text: var(--text);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 2px solid var(--btn-edge);
  border-radius: var(--radius-sm);
  background: var(--btn-bg);
  color: var(--btn-text);
  font-size: 14.5px;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
  box-shadow: var(--lift-sm);
  transition: transform 0.08s, box-shadow 0.08s, background-color 0.12s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: var(--lift); }
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--drop); }
.btn:disabled, .btn-disabled { cursor: not-allowed; opacity: 0.55; transform: none; box-shadow: none; }
.btn-primary { --btn-bg: var(--go); --btn-edge: var(--outline); --btn-text: var(--go-ink); }
.btn-primary:hover { --btn-bg: var(--go-hover); }
.btn-ghost { --btn-bg: transparent; box-shadow: none; }
.btn-ghost:hover { --btn-bg: var(--surface-2); transform: none; box-shadow: none; }
.btn-ghost:active { transform: translateY(1px); }
.btn-subtle { --btn-bg: var(--surface-3); --btn-edge: transparent; --btn-text: var(--text-2); box-shadow: none; }
.btn-subtle:hover { --btn-text: var(--text); transform: none; box-shadow: none; }
.btn-discord { --btn-bg: var(--discord); --btn-edge: var(--outline); --btn-text: #fff; }
.btn-danger { --btn-bg: var(--danger); --btn-edge: var(--outline); --btn-text: #fff; }
.btn-danger-ghost { --btn-bg: transparent; --btn-edge: var(--danger); --btn-text: var(--danger); box-shadow: none; }
.btn-danger-ghost:hover { --btn-bg: var(--danger-soft); transform: none; box-shadow: none; }
.btn-support { --btn-bg: var(--pink); --btn-edge: var(--outline); --btn-text: #11142b; }
.btn-disabled { --btn-bg: var(--surface-3); --btn-edge: transparent; --btn-text: var(--muted); }
.btn-sm { gap: 6px; height: 34px; padding: 0 12px; font-size: 13.5px; }
.btn-sm .icon { width: 16px; height: 16px; }
.btn-lg { height: 52px; padding: 0 22px; border-radius: 9px; font-size: 16.5px; box-shadow: var(--lift); }
.btn-lg:hover { box-shadow: 4px 4px 0 var(--drop); }
.btn-lg .icon { width: 20px; height: 20px; }
.btn-block { width: 100%; }
.btn.is-busy { color: transparent; pointer-events: none; }
.btn.is-busy::after { content: ""; position: absolute; width: 16px; height: 16px; border: 2.5px solid var(--btn-text); border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
.btn .spinner { width: 16px; height: 16px; border-color: rgba(0, 0, 0, 0.2); border-top-color: currentColor; }

.icon-btn { display: inline-grid; flex: none; place-items: center; width: 38px; height: 38px; border: 2px solid var(--edge); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-size: 20px; font-weight: 700; line-height: 1; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:disabled { cursor: not-allowed; opacity: 0.45; }
.icon-btn-danger:hover { border-color: var(--danger); color: var(--danger); }
.icon-btn.support-btn { color: var(--pink); }
.icon-btn.support-btn .icon { fill: none; }
.icon-btn.support-btn.is-supporter .icon { fill: currentColor; }
.link-btn { padding: 0; border: 0; background: none; color: var(--link); font-size: 13px; font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 2px; }
.link-btn:hover { color: var(--text); }

/* ---- Badges, pills, tags --------------------------------------------------------- */

.badge { display: inline-grid; place-items: center; min-width: 21px; height: 21px; padding: 0 6px; border: 2px solid var(--outline); border-radius: 999px; background: var(--surface-3); color: var(--text); font: 700 11.5px/1 var(--font-display); }
.badge-hot { background: var(--hot); color: #fff; }
.pill { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border: 2px solid var(--outline); border-radius: 999px; background: var(--surface-3); color: var(--text); font: 700 11.5px/1 var(--font-display); letter-spacing: 0.04em; text-transform: uppercase; }
.pill .icon { width: 12px; height: 12px; }
.pill-host { background: var(--sun); color: #11142b; }
.pill-ok { background: var(--go); color: var(--go-ink); }
.pill-invited { background: var(--sky); color: #071629; }
.vbadge, .sbadge { display: inline-grid; flex: none; place-items: center; width: 19px; height: 19px; margin-left: 5px; border: 2px solid var(--outline); border-radius: 50%; vertical-align: middle; }
.vbadge { background: var(--discord); color: #fff; }
.vbadge .icon { width: 10px; height: 10px; }
.sbadge { background: var(--pink); color: #11142b; }
.sbadge .icon { width: 10px; height: 10px; fill: currentColor; }
.rep { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; font: 700 13px/1 var(--font-display); }
.rep .icon { width: 14px; height: 14px; color: var(--sun); fill: currentColor; stroke: var(--outline); stroke-width: 2; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 650; white-space: nowrap; }
.tag .icon { width: 13px; height: 13px; }
.tag-soft { background: transparent; box-shadow: inset 0 0 0 1.5px var(--hair); }
.tag-warn { background: var(--sun); color: #11142b; box-shadow: inset 0 0 0 2px var(--outline); }
.tag-discord { background: var(--discord-soft); color: var(--text); }
.tag-discord .icon { color: var(--discord); }
.tag-boost { background: var(--hot); color: #fff; box-shadow: inset 0 0 0 2px var(--outline); }

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

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 5px 12px; border: 2px solid var(--edge); border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 700; }
.chip:hover { background: var(--surface-2); color: var(--text); }
.chip.is-on { border-color: var(--text); background: var(--text); color: var(--bg); }
.chip small { padding: 1px 6px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font: 700 11px/1.3 var(--font-display); }
.chip.is-on small { background: var(--go); color: var(--go-ink); }
.chip .icon { width: 15px; height: 15px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; border: 2px solid var(--edge); border-radius: 9px; background: var(--surface); }
.seg-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); font-size: 13px; font-weight: 700; }
.seg-btn:hover { color: var(--text); background: var(--surface-2); }
.seg-btn.is-on { background: var(--text); color: var(--bg); }
.seg-btn .icon { width: 16px; height: 16px; }
.field { display: grid; gap: 6px; }
.field > span { color: var(--text); font-size: 13.5px; font-weight: 700; }
.field em { color: var(--muted); font-style: normal; font-weight: 500; }
.field > small { color: var(--muted); font-size: 12.5px; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 2px solid var(--edge);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--surface);
  color: var(--text);
  transition: box-shadow 0.12s;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px var(--go), 0 0 0 5px var(--outline); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.85; }
input:disabled, textarea:disabled { opacity: 0.6; }
select { appearance: none; padding-right: 34px; background-image: var(--select-arrow); background-position: right 12px center; background-repeat: no-repeat; font-weight: 600; }
select option { background: var(--surface); color: var(--text); }
.switches { display: grid; gap: 2px; }
.switch-row { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.switch-row:hover { background: var(--surface-2); }
.switch-row > span { display: grid; gap: 1px; }
.switch-row strong { font-size: 14px; font-weight: 700; }
.switch-row small { color: var(--muted); font-size: 12.5px; }
.switch-row.compact { padding: 6px 4px; }
.switch { position: relative; flex: none; width: 44px; height: 26px; margin: 0; border: 2px solid var(--edge); border-radius: 999px; background: var(--surface-3); cursor: pointer; appearance: none; transition: background 0.15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border: 2px solid var(--outline); border-radius: 50%; background: var(--surface); transition: transform 0.15s; }
.switch:checked { border-color: var(--outline); background: var(--go); }
.switch:checked::after { transform: translateX(18px); }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--text); }
.check em { color: var(--muted); font-style: normal; }
.form-error { padding: 9px 12px; border: 2px solid var(--danger); border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger); font-size: 14px; font-weight: 700; }
.counter { justify-self: end; color: var(--muted); font-size: 12px; }
.search { position: relative; display: flex; flex: 1; align-items: center; }
.search > .icon { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.search input[type="search"] { padding-left: 38px; }
.search-lg input[type="search"] { min-height: 52px; padding-left: 44px; font-size: 17px; }
.search-lg > .icon { left: 15px; width: 20px; height: 20px; }

/* ---- Panels and pages ------------------------------------------------------------- */

.panel { padding: 20px; border: 2px solid var(--edge); border-radius: var(--radius); background: var(--surface); }
.panel:empty { display: none; }
.panel-title { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font: 700 15px/1.2 var(--font-display); letter-spacing: 0.08em; text-transform: uppercase; }
.panel-title .icon { width: 18px; height: 18px; }
.panel-title .muted { font-size: 14px; letter-spacing: 0.04em; }
.section-title { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font: 700 14px/1.2 var(--font-display); letter-spacing: 0.09em; text-transform: uppercase; }
.subhead { display: flex; align-items: center; gap: 8px; margin: 20px 0 10px; font: 700 13px/1.2 var(--font-display); letter-spacing: 0.08em; text-transform: uppercase; }
.callout { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; padding: 14px; border: 2px solid var(--hair); border-radius: var(--radius); background: var(--surface-2); }
.callout > .icon { width: 22px; height: 22px; margin-top: 1px; color: var(--muted); }
.callout > div { display: grid; gap: 2px; }
.callout span { color: var(--text-2); font-size: 14px; }
.callout-ok { border-color: var(--outline); background: var(--go-soft); }
.callout-ok > .icon { color: var(--text); }
.callout-warn { border-color: var(--sun); background: var(--sun-soft); }
.callout-warn > .icon { color: var(--text); }
.callout-wait { border-color: var(--sky); background: var(--sky-soft); }
.callout-wait > .icon { color: var(--text); }
.callout-invite { align-items: center; border-color: var(--outline); background: var(--sky-soft); }
.callout-invite .avatar { margin-top: 0; }
.center-panel { display: grid; justify-items: center; gap: 14px; max-width: 520px; margin: 40px auto; padding: 32px; text-align: center; }
.center-panel h1 { font-size: 30px; text-transform: uppercase; }
.page.narrow { display: grid; gap: 16px; max-width: 820px; margin: 0 auto; }
.page-head { display: grid; gap: 8px; margin-bottom: 8px; }
.page-head h1 { font-size: clamp(34px, 5vw, 48px); line-height: 0.95; letter-spacing: -0.005em; text-transform: uppercase; font-stretch: 75%; }
.page-head p { max-width: 60ch; color: var(--text-2); }
.back { display: inline-flex; align-items: center; gap: 4px; justify-self: start; color: var(--text-2); font: 700 13px/1 var(--font-display); letter-spacing: 0.08em; text-transform: uppercase; }
.back:hover { color: var(--text); }
.back .icon { width: 16px; height: 16px; }
.demo-note { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; padding: 8px 12px; border: 2px dashed var(--sky); border-radius: var(--radius-sm); background: var(--sky-soft); font-size: 13.5px; font-weight: 600; }

/* ---- The board ------------------------------------------------------------------- */

.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 32px 56px; margin: 12px 0 36px; }
.hero-copy { display: grid; justify-items: start; gap: 18px; max-width: 660px; }
.kicker { display: inline-block; padding: 5px 11px 4px; border: 2px solid var(--outline); border-radius: 999px; background: var(--sun); color: #11142b; font: 700 12.5px/1 var(--font-display); letter-spacing: 0.09em; text-transform: uppercase; }
.hero h1 { font-size: clamp(52px, 8.5vw, 104px); line-height: 0.88; letter-spacing: -0.01em; text-transform: uppercase; font-stretch: 75%; }
.hero-copy > p { max-width: 54ch; color: var(--text-2); font-size: 17px; line-height: 1.55; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }

/* The live numbers, printed like a scoreboard sticker. */
.scoreboard { display: grid; gap: 6px; min-width: 270px; margin-right: 8px; padding: 22px 26px 20px; border: 2px solid var(--outline); border-radius: 14px; background: #11142b; color: #f5f6ff; box-shadow: 7px 7px 0 var(--hot); transform: rotate(-2.5deg); }
.score-num { color: var(--go); font: 700 104px/0.85 var(--font-display); font-stretch: 75%; font-variant-numeric: tabular-nums; }
.score-label { font: 700 17px/1.1 var(--font-display); letter-spacing: 0.08em; text-transform: uppercase; }
.score-sub { display: flex; align-items: center; gap: 8px; color: #c4c8df; font-size: 13.5px; font-weight: 600; }

.board-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; margin-bottom: 22px; }
.board-head h1 { font-size: clamp(36px, 5vw, 52px); line-height: 0.9; text-transform: uppercase; font-stretch: 75%; }
.board-head p { margin-top: 8px; color: var(--text-2); font-weight: 600; }
.board-head .row { gap: 12px; }

.my-groups { margin-bottom: 26px; }
.my-groups:empty { display: none; }
.mine-row { display: flex; gap: 12px; padding: 2px 6px 8px 2px; overflow-x: auto; }
.mine { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; min-width: 240px; max-width: 320px; padding: 10px 12px 10px 18px; border: 2px solid var(--edge); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: inset 7px 0 0 var(--game), var(--lift-sm); transition: transform 0.08s, box-shadow 0.08s; }
.mine:hover { transform: translate(-1px, -1px); box-shadow: inset 7px 0 0 var(--game), var(--lift); }
.mine-text { display: grid; flex: 1; min-width: 0; }
.mine-text strong, .mine-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mine-text span { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.mine-count { font: 700 15px/1 var(--font-display); font-variant-numeric: tabular-nums; }

.board { display: grid; gap: 14px; min-width: 0; }
.shelf { display: flex; gap: 10px; padding: 2px 6px 10px 2px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
.shelf::-webkit-scrollbar, .mine-row::-webkit-scrollbar { height: 8px; }
.shelf::-webkit-scrollbar-thumb, .mine-row::-webkit-scrollbar-thumb { border-width: 2px; }
.gchip { display: inline-flex; flex: none; align-items: center; gap: 9px; height: 46px; padding: 0 10px 0 7px; border: 2px solid var(--edge); border-radius: var(--radius); background: var(--surface); color: var(--text); font-size: 14px; font-weight: 700; white-space: nowrap; box-shadow: var(--lift-sm); transition: transform 0.08s, box-shadow 0.08s; }
.gchip:first-child { padding-left: 14px; }
.gchip:hover { transform: translate(-1px, -1px); box-shadow: var(--lift); }
.gchip.is-on { border-color: var(--text); background: var(--text); color: var(--bg); }
.gchip .count { min-width: 24px; padding: 3px 7px 2px; border: 2px solid transparent; border-radius: 999px; background: var(--surface-3); color: var(--text); font: 700 12px/1.1 var(--font-display); text-align: center; }
.gchip.is-on .count { border-color: var(--outline); background: var(--go); color: var(--go-ink); }
.board-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.board-bar .search { flex: 1 1 280px; }
.board-bar select { width: auto; min-width: 150px; }
.filters-btn.is-open { --btn-bg: var(--text); --btn-text: var(--bg); --btn-edge: var(--text); }
.filters { display: none; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px 24px; padding: 18px 20px; border: 2px solid var(--edge); border-radius: var(--radius); background: var(--surface); }
.filters.is-open { display: grid; }
.fgroup { display: grid; align-content: start; gap: 8px; }
.fgroup-wide { grid-column: 1 / -1; }
.flabel { color: var(--muted); }
.fgroup .seg { display: flex; }
.fgroup .seg-btn { flex: 1; justify-content: center; padding: 0 8px; }
.fgroup .chip { min-height: 30px; padding: 3px 10px; font-size: 12.5px; }
.filters-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; grid-column: 1 / -1; padding-top: 4px; border-top: 2px solid var(--hair); }
.filters-foot .switches { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.result-count { min-height: 20px; margin: 2px 0 -2px; color: var(--muted); font: 700 13px/1.4 var(--font-display); letter-spacing: 0.06em; text-transform: uppercase; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 20px; }

/* ---- Group cards: a colour band for the game, then the details, then a torn-off stub ---- */

.gcard {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 2px solid var(--edge);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform 0.1s, box-shadow 0.1s;
}
.gcard:hover { transform: translate(-2px, -2px); box-shadow: var(--lift-lg); }
.gcard:focus-within { box-shadow: var(--lift-lg); }
.gcard-mine { box-shadow: 0 0 0 3px var(--go); }
.gcard-mine:hover { box-shadow: 0 0 0 3px var(--go), 7px 7px 0 var(--drop); }
.gcard-boosted { box-shadow: 0 0 0 3px var(--hot); }
.gcard-boosted:hover { box-shadow: 0 0 0 3px var(--hot), 7px 7px 0 var(--drop); }
.gcard-full .gcard-body, .gcard-full .gcard-foot { opacity: 0.75; }
.gcard-hit { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.gcard-hit:focus-visible { outline-offset: 3px; }
.gcard .btn, .gcard button { position: relative; z-index: 2; }
.gcard-band { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 12px; border-bottom: 2px solid var(--edge); border-radius: 8px 8px 0 0; background: var(--zigzag), var(--game); }
.gcard-game { flex: 1; min-width: 0; overflow: hidden; color: #fff; font: 700 15px/1.2 var(--font-display); letter-spacing: 0.06em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; text-shadow: var(--stroke); }
.gcard-body { display: grid; align-content: start; gap: 10px; padding: 14px 14px 14px; }
.gcard-title { font: 700 22px/1.1 var(--font-display); overflow-wrap: anywhere; }
.gcard-desc { display: -webkit-box; overflow: hidden; color: var(--text-2); font-size: 14px; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.gcard-foot { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 12px 14px; border-top: 2px dashed var(--hair); }
.gcard-host { display: flex; flex: 1; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; color: var(--text-2); font-size: 13px; font-weight: 700; }
.gcard-host-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-crown { width: 15px; height: 15px; color: var(--sun); fill: currentColor; stroke: var(--outline); stroke-width: 2; }
.skeleton { min-height: 228px; }
.skeleton:hover { transform: none; box-shadow: none; }
.skeleton .gcard-band { background: var(--surface-3); }
.skeleton span { display: block; height: 14px; margin: 0 14px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.skeleton span:nth-of-type(1) { width: 55%; height: 22px; margin-top: 16px; }
.skeleton span:nth-of-type(2) { width: 85%; margin-top: 12px; }
.skeleton span:nth-of-type(3) { width: 65%; margin-top: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { display: grid; grid-column: 1 / -1; justify-items: center; gap: 10px; padding: 48px 20px; border: 2px dashed var(--edge); border-radius: var(--radius); background: var(--surface); text-align: center; }
.empty-icon { display: grid; place-items: center; width: 60px; height: 60px; margin-bottom: 4px; border: 2px solid var(--outline); border-radius: 14px; background: var(--zigzag), var(--sun); color: #11142b; box-shadow: var(--lift); transform: rotate(-4deg); }
.empty-icon .icon { width: 28px; height: 28px; }
.empty h3 { font-size: 24px; text-transform: uppercase; font-stretch: 75%; }
.empty p { max-width: 460px; }
.empty-sm { padding: 26px 16px; border-width: 2px; }
.empty-sm h3 { font-size: 18px; }

/* Game tiles: flat colour, faint zig-zag, near-black outline, outlined lettering. */
.tile {
  --size: 44px;
  display: inline-grid;
  flex: none;
  place-items: center;
  width: var(--size);
  height: var(--size);
  border: 2px solid var(--outline);
  border-radius: 9px;
  background: var(--zigzag), var(--game);
  color: #fff;
  font: 700 15px/1 var(--font-display);
  letter-spacing: 0.02em;
  text-shadow: var(--stroke);
}
.tile-xs { --size: 28px; border-radius: 7px; font-size: 10px; text-shadow: 0 1px 0 var(--outline), 1px 0 0 var(--outline), -1px 0 0 var(--outline), 0 -1px 0 var(--outline); }
.tile-sm { --size: 36px; border-radius: 8px; font-size: 12.5px; }
.tile-lg { --size: 64px; border-radius: 13px; font-size: 21px; box-shadow: var(--lift); }
.tile-long { font-size: 0.82em; letter-spacing: -0.02em; }
.tile-xs.tile-long { font-size: 8.5px; }
.tile-sm.tile-long { font-size: 10.5px; }
.tile-lg.tile-long { font-size: 17px; }

.when { display: inline-flex; flex: none; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border: 2px solid var(--outline); border-radius: 999px; background: var(--surface); color: var(--text); font: 700 12.5px/1 var(--font-display); letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.when .icon { width: 14px; height: 14px; }
.when-now { background: var(--go); color: var(--go-ink); }
.pulse { width: 9px; height: 9px; border: 2px solid var(--outline); border-radius: 50%; background: var(--hot); animation: blink 1.8s ease-in-out infinite; }

.slots { display: flex; flex: none; align-items: center; }
.slots > .avatar { margin-right: -8px; }
.slot-empty { width: 30px; height: 30px; margin-right: -8px; border: 2px dashed var(--muted); border-radius: 50%; background: var(--surface-2); }
.slots-count { margin-left: 16px; font: 700 16px/1 var(--font-display); font-variant-numeric: tabular-nums; }

.avatar {
  --s: 36px;
  display: inline-grid;
  flex: none;
  place-items: center;
  width: var(--s);
  height: var(--s);
  border: 2px solid var(--outline);
  border-radius: 50%;
  background: var(--avatar, var(--surface-3));
  color: #fff;
  font: 700 calc(var(--s) * 0.38) / 1 var(--font-display);
  object-fit: cover;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}
.avatar-sm { --s: 30px; }
.avatar-md { --s: 38px; }
.avatar-lg { --s: 48px; }
.avatar-xl { --s: 92px; border-width: 3px; box-shadow: var(--lift); }
.avatar-empty { border: 2px dashed var(--muted); background: var(--surface-2); }
.presence { position: relative; display: inline-grid; flex: none; }
.presence::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 13px; height: 13px; border: 2px solid var(--outline); border-radius: 50%; background: var(--surface-3); }
.presence.is-online::after { background: var(--go); }

/* ---- Group page ------------------------------------------------------------------- */

.gpage { display: grid; gap: 18px; }
.gpage-head { display: grid; gap: 12px; }
.ghead { border: 2px solid var(--edge); border-radius: 12px; background: var(--surface); box-shadow: var(--lift-lg); }
.ghead-band { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 16px; border-bottom: 2px solid var(--edge); border-radius: 10px 10px 0 0; background: var(--zigzag), var(--game); }
.ghead-game { flex: 1; min-width: 0; overflow: hidden; color: #fff; font: 700 18px/1.2 var(--font-display); letter-spacing: 0.07em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; text-shadow: var(--stroke); }
.ghead-share { display: flex; flex-wrap: wrap; gap: 8px; }
.ghead-share .btn { --btn-bg: var(--surface); --btn-edge: var(--outline); box-shadow: var(--lift-sm); }
.ghead-body { display: grid; gap: 12px; padding: 18px 22px 22px; }
.ghead h1 { font-size: clamp(34px, 5vw, 56px); line-height: 0.92; text-transform: uppercase; font-stretch: 75%; overflow-wrap: anywhere; }
.ghead-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 14px; }
.status { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border: 2px solid var(--outline); border-radius: 999px; font: 700 12.5px/1 var(--font-display); letter-spacing: 0.05em; text-transform: uppercase; }
.status .icon { width: 14px; height: 14px; }
.status-boost { background: var(--hot); color: #fff; }
.status-open { background: var(--go); color: var(--go-ink); }
.status-full { background: var(--sun); color: #11142b; }
.status-live { background: var(--sky); color: #071629; }
.status-closed { background: var(--surface-3); color: var(--muted); }
.gpage-body { display: grid; grid-template-columns: minmax(0, 1fr) 400px; align-items: start; gap: 18px; }
.gpage-main { display: grid; gap: 16px; min-width: 0; }
.host-bar { display: flex; flex-wrap: wrap; gap: 10px; }
.join-form { display: grid; gap: 12px; }

.ready { display: grid; gap: 8px; margin-top: 14px; padding: 14px; border: 2px solid var(--sky); border-radius: var(--radius); background: var(--sky-soft); }
.callout + .ready, .ready:first-child { margin-top: 0; margin-bottom: 14px; }
.ready-head { display: flex; align-items: center; justify-content: space-between; }
.ready-head strong { display: flex; align-items: center; gap: 6px; font: 700 15px/1 var(--font-display); letter-spacing: 0.06em; text-transform: uppercase; }
.countdown { font: 700 24px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.ready-bar { height: 12px; overflow: hidden; border: 2px solid var(--outline); border-radius: 999px; background: var(--surface); }
.ready-bar span { display: block; height: 100%; background: var(--go); transition: width 0.3s; }

.dstate { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; padding: 14px; border: 2px solid var(--hair); border-radius: var(--radius); background: var(--surface-2); }
.dstate > .icon, .dstate > .spinner { flex: none; width: 22px; height: 22px; margin-top: 1px; }
.dstate > div { display: grid; gap: 2px; }
.dstate span { color: var(--text-2); font-size: 14px; }
.dstate-ok { border-color: var(--discord); background: var(--discord-soft); }
.dstate-ok > .icon { color: var(--discord); }
#g-party > .btn, #g-party > .callout { margin-bottom: 12px; }
.contacts { display: grid; gap: 12px; margin-top: 6px; }
.contacts-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.contacts-head h3 { display: flex; align-items: baseline; gap: 8px; font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; }
.contacts-head .muted { font-size: 13px; }
.share-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; padding: 12px 14px; border: 2px dashed var(--discord); border-radius: var(--radius); background: var(--discord-soft); }
.contacts .share-cta { margin-bottom: 0; }
.share-cta p { flex: 1; min-width: 200px; font-size: 14px; font-weight: 600; }
.contact-list { display: grid; gap: 6px; }
.contact-row { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.contact-name { flex: 0 1 auto; min-width: 0; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.contact-row .contact-line { flex: 1; width: auto; max-width: 260px; margin-left: auto; }
.contact-row > .muted { margin-left: auto; }
.contact-card { display: grid; gap: 6px; margin-top: 4px; padding: 10px; border: 2px solid var(--hair); border-radius: var(--radius); background: var(--surface-2); }
.contact-card-title { color: var(--muted); font-size: 12px; font-weight: 700; }
.contact-line { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 10px; border: 2px solid var(--edge); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-size: 13.5px; font-weight: 700; text-align: left; }
.contact-line span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-line .icon:last-child { width: 15px; height: 15px; color: var(--muted); }
.contact-line:hover { background: var(--surface-2); }
.contact-discord .icon:first-child { color: var(--discord); }

.members { display: grid; gap: 6px; }
.member { display: flex; align-items: center; gap: 10px; padding: 8px; border: 2px solid var(--hair); border-radius: var(--radius); background: var(--surface-2); }
.member-link { display: flex; flex: 1; align-items: center; gap: 10px; min-width: 0; color: var(--text); }
.member-link:hover strong { text-decoration: underline; text-decoration-thickness: 2px; }
.member-name { display: grid; gap: 3px; min-width: 0; }
.member-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-badges { display: flex; align-items: center; gap: 4px; }
.member-badges:empty { display: none; }
.member-badges .vbadge, .member-badges .sbadge { margin-left: 0; }
.member-badges .rep { margin-left: 2px; }
.member-empty { border-style: dashed; background: transparent; color: var(--muted); font-weight: 600; }
.member .icon-btn { width: 34px; height: 34px; }
.ready-dot { flex: none; width: 14px; height: 14px; border: 2px solid var(--outline); border-radius: 50%; background: var(--surface-3); }
.ready-dot.is-ready { background: var(--go); }
.ready-dot.is-not { background: var(--danger); }
.requests { display: grid; gap: 8px; }
.request { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border: 2px solid var(--outline); border-radius: var(--radius); background: var(--go-soft); }
.request-body { display: grid; flex: 1; gap: 4px; min-width: 0; }
.request-body a { color: var(--text); }
.request-note { color: var(--text-2); font-size: 14px; overflow-wrap: anywhere; }
.request-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.invites { display: grid; gap: 6px; }
.invite-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 2px dashed var(--sky); border-radius: var(--radius); }
.invite-text { display: grid; flex: 1; min-width: 0; }
.invite-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.desc { margin-bottom: 14px; font-size: 15px; overflow-wrap: anywhere; white-space: pre-wrap; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 14px; }
.facts > div { padding: 10px 12px; border: 2px solid var(--hair); border-radius: var(--radius-sm); background: var(--surface-2); }
.facts dt { color: var(--muted); font: 700 11.5px/1.3 var(--font-display); letter-spacing: 0.08em; text-transform: uppercase; }
.facts dd { font-size: 14px; font-weight: 700; }
#g-info .tags { margin-bottom: 12px; }
#g-info .tags:empty { display: none; }

.commends { display: grid; gap: 10px; margin-top: 12px; }
.commend-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px; border: 2px solid var(--hair); border-radius: var(--radius); background: var(--surface-2); }
.commend-row > strong { margin-right: auto; }
.commend-row .chips { width: 100%; }
.commend-list { display: grid; gap: 10px; }
.commend-list li { display: grid; grid-template-columns: 28px 150px minmax(0, 1fr) 32px; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.commend-icon { display: grid; place-items: center; width: 28px; height: 28px; border: 2px solid var(--outline); border-radius: 8px; background: var(--sun); color: #11142b; }
.commend-icon .icon { width: 15px; height: 15px; }
.commend-bar { height: 12px; overflow: hidden; border: 2px solid var(--outline); border-radius: 999px; background: var(--surface-2); }
.commend-bar span { display: block; height: 100%; background: var(--sun); }
.commend-list strong { font: 700 16px/1 var(--font-display); font-variant-numeric: tabular-nums; text-align: right; }

/* Chat */
.chat { position: sticky; top: calc(var(--header-h) + 16px); display: flex; flex-direction: column; height: calc(100vh - var(--header-h) - 32px); min-height: 460px; padding: 0; overflow: hidden; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 2px solid var(--edge); background: var(--surface-2); }
.chat-head .panel-title { margin: 0; }
.chat-log { display: flex; flex: 1; flex-direction: column; gap: 12px; padding: 14px 16px; overflow-y: auto; }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 2px solid var(--edge); background: var(--surface-2); }
.chat-form .btn { flex: none; width: 46px; height: 42px; padding: 0; }
.chat-locked { display: grid; flex: 1; place-content: center; justify-items: center; gap: 8px; padding: 30px; color: var(--text-2); text-align: center; }
.chat-locked > .icon { width: 30px; height: 30px; color: var(--muted); }
.msg { display: flex; align-items: flex-start; gap: 10px; }
.msg-body { display: grid; gap: 2px; min-width: 0; }
.msg-meta { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.msg-meta strong { font-weight: 800; }
.msg-meta time { color: var(--muted); font-size: 11.5px; }
.msg-body p { font-size: 14.5px; overflow-wrap: anywhere; white-space: pre-wrap; }
.msg-mine .msg-meta strong { padding: 0 4px; background: var(--go); color: var(--go-ink); }
.msg-system { justify-content: center; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; font-weight: 700; text-align: center; }
.msg-system span { padding: 3px 10px; border-radius: 999px; background: var(--surface-2); }
.msg-system time { opacity: 0.75; }

/* ---- Create ------------------------------------------------------------------- */

.create-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; align-items: start; gap: 24px; }
.create-form { display: grid; gap: 16px; }
.step { display: grid; gap: 14px; }
.step h2 { display: flex; align-items: center; gap: 10px; font-size: 17px; letter-spacing: 0.07em; text-transform: uppercase; }
.step-n { display: inline-grid; place-items: center; width: 30px; height: 30px; border: 2px solid var(--outline); border-radius: 8px; background: var(--go); color: var(--go-ink); font: 700 16px/1 var(--font-display); box-shadow: var(--lift-sm); }
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; max-height: 360px; padding: 2px 4px 4px 2px; overflow-y: auto; }
.game-opt { display: flex; align-items: center; gap: 10px; padding: 7px; border: 2px solid var(--hair); border-radius: var(--radius); background: var(--surface); color: var(--text); font-size: 13px; font-weight: 700; text-align: left; }
.game-opt .tile { --size: 34px; border-radius: 8px; font-size: 11.5px; }
.game-opt .tile-long { font-size: 9.5px; }
.game-opt span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-opt:hover { border-color: var(--edge); }
.game-opt.is-on { border-color: var(--outline); background: var(--go); color: var(--go-ink); box-shadow: var(--lift-sm); }
.stepper { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.stepper output { min-width: 44px; font: 700 30px/1 var(--font-display); font-variant-numeric: tabular-nums; text-align: center; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice { display: grid; gap: 4px; padding: 14px; border: 2px solid var(--edge); border-radius: var(--radius); background: var(--surface); color: var(--text); text-align: left; }
.choice .icon { width: 22px; height: 22px; margin-bottom: 4px; }
.choice small { color: var(--text-2); font-size: 13px; }
.choice:hover { background: var(--surface-2); }
.choice.is-on { border-color: var(--outline); background: var(--go); color: var(--go-ink); box-shadow: var(--lift); }
.choice.is-on small { color: var(--go-ink); }
.create-submit { display: grid; justify-items: end; gap: 10px; }
.create-preview { position: sticky; top: calc(var(--header-h) + 16px); display: grid; gap: 10px; }
.preview-label { color: var(--muted); }
.create-preview .gcard:hover { transform: none; box-shadow: none; }

/* ---- Players ------------------------------------------------------------------- */

.players-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; gap: 20px; }
.players-layout .panel { display: grid; gap: 14px; }
.players-layout .panel-title { margin-bottom: 0; }
.plist { display: grid; gap: 8px; }
.prow { display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 8px; border: 2px solid var(--hair); border-radius: var(--radius); background: var(--surface); }
.prow:hover { border-color: var(--edge); }
.prow-link { display: flex; flex: 1; align-items: center; gap: 12px; min-width: 0; color: var(--text); }
.prow-link:hover strong { text-decoration: underline; text-decoration-thickness: 2px; }
.prow-text { display: grid; gap: 2px; min-width: 0; }
.prow-text strong { display: flex; align-items: center; min-width: 0; font-size: 15px; }
.prow-text strong > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow-text small { overflow: hidden; color: var(--muted); font-size: 12.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.prow-text small b { color: var(--text-2); }
.prow .btn { flex: none; }
.pick-list { display: grid; gap: 8px; }
.pick { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border: 2px solid var(--edge); border-radius: var(--radius); background: var(--surface); color: var(--text); text-align: left; box-shadow: var(--lift-sm); }
.pick:hover { background: var(--surface-2); }
.pick > span { display: grid; flex: 1; min-width: 0; }
.pick small { color: var(--muted); font-weight: 600; }
.invite-search { margin-bottom: 2px; }
.invite-list { max-height: min(50vh, 420px); padding-right: 2px; overflow-y: auto; }

/* ---- Profiles ------------------------------------------------------------------- */

.profile-card { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; }
.profile-text { display: grid; flex: 1; gap: 8px; min-width: 220px; }
.profile-text h1 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: clamp(30px, 4vw, 40px); line-height: 1; text-transform: uppercase; font-stretch: 75%; overflow-wrap: anywhere; }
.profile-text h1 .vbadge, .profile-text h1 .sbadge { width: 24px; height: 24px; }
.profile-text h1 .vbadge .icon, .profile-text h1 .sbadge .icon { width: 13px; height: 13px; }
.profile-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--muted); font-size: 14px; font-weight: 600; }
.profile-meta .icon { width: 14px; height: 14px; }
.profile-meta > span + span::before { content: "·"; margin-right: 10px; }
.online-text { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.online-text::before { content: ""; width: 10px; height: 10px; border: 2px solid var(--outline); border-radius: 50%; background: var(--go); }
.played-with { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 2px dashed var(--edge); border-radius: var(--radius); font-size: 14px; }
.played-with b { font-weight: 800; }
.bio { color: var(--text-2); }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.blocked-list { display: grid; gap: 8px; }
.blocked-list li { display: flex; align-items: center; gap: 10px; }
.blocked-list a { flex: 1; color: var(--text); font-weight: 700; }

/* ---- Modal ------------------------------------------------------------------- */

.modal { width: min(480px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0; overflow: visible; border: 0; background: transparent; color: var(--text); }
.modal::backdrop { background: var(--scrim); }
.modal[open] { animation: pop 0.14s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }
.modal-card { display: grid; gap: 14px; max-height: calc(100vh - 32px); padding: 22px; overflow-y: auto; border: 2px solid var(--edge); border-radius: 12px; background: var(--surface); box-shadow: 7px 7px 0 var(--drop); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-head h2 { display: flex; align-items: center; gap: 10px; font-size: 24px; text-transform: uppercase; font-stretch: 75%; }
.modal-head h2 .icon { width: 22px; height: 22px; }
.modal-x { width: 34px; height: 34px; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.perks { display: grid; gap: 8px; font-size: 14px; font-weight: 600; }
.perks li { display: flex; align-items: center; gap: 10px; }
.perks .icon { width: 22px; height: 22px; padding: 3px; border: 2px solid var(--outline); border-radius: 6px; background: var(--go); color: var(--go-ink); }
.qm-game { display: flex; align-items: flex-end; gap: 14px; }
.qm-game .field { flex: 1; }

/* ---- Toasts ------------------------------------------------------------------- */

/* Top right, under the header, so they never cover the chat box or page actions. */
.toasts { position: fixed; top: calc(var(--header-h) + 12px); right: 16px; z-index: 50; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 12px 12px 12px; border: 2px solid var(--edge); border-radius: var(--radius); background: var(--surface); box-shadow: var(--lift); animation: toast-in 0.18s ease-out; pointer-events: auto; }
.toast-out { animation: toast-out 0.16s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(14px); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(10px); } }
.toast-icon { display: grid; flex: none; place-items: center; width: 30px; height: 30px; border: 2px solid var(--outline); border-radius: 8px; background: var(--surface-3); color: #11142b; }
.toast-icon .icon { width: 16px; height: 16px; }
.toast-info .toast-icon { background: var(--sky); }
.toast-success .toast-icon { background: var(--go); }
.toast-error .toast-icon { background: var(--danger); color: #fff; }
.toast-warn .toast-icon { background: var(--sun); }
.toast-body { display: grid; flex: 1; gap: 2px; min-width: 0; font-size: 14px; }
.toast-body span { color: var(--text-2); font-size: 13px; }
.toast-action { flex: none; }
.toast-close { display: grid; place-items: center; padding: 4px; border: 0; border-radius: 6px; background: none; color: var(--muted); }
.toast-close:hover { color: var(--text); }
.toast-close .icon { width: 16px; height: 16px; }

/* ---- Footer ---------------------------------------------------------------------- */

.footer { max-width: 1240px; margin: 0 auto; padding: 0 24px 40px; color: var(--muted); font-size: 12.5px; }
.footer p { padding-top: 16px; border-top: 2px solid var(--hair); }

/* ---- Responsive ------------------------------------------------------------------- */

.show-narrow { display: none; }

@media (max-width: 1100px) {
  .gpage-body, .create-layout { grid-template-columns: minmax(0, 1fr); }
  .chat { position: static; height: 70vh; min-height: 420px; }
  .create-preview { position: static; }
}

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .scoreboard { justify-self: start; min-width: 0; transform: rotate(-1.5deg); }
  .score-num { font-size: 76px; }
  .players-layout { grid-template-columns: minmax(0, 1fr); }
  .live { display: none; }
}

@media (max-width: 720px) {
  :root { --header-h: 58px; }
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .header-inner { gap: 10px; padding: 0 16px; }
  .brand { font-size: 23px; }
  .brand-mark { width: 30px; height: 30px; }
  .me-chip { padding: 2px; }
  .main { padding: 18px 16px 40px; }
  .nav, .hide-narrow { display: none; }
  .show-narrow { display: inline-flex; }
  .tabbar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-top: 2px solid var(--edge);
    background: var(--surface);
  }
  .tab { position: relative; display: grid; justify-items: center; gap: 3px; padding: 5px 0 4px; border: 0; border-radius: 8px; background: none; color: var(--text-2); font: 700 11px/1 var(--font-display); letter-spacing: 0.07em; text-transform: uppercase; }
  .tab .icon { width: 22px; height: 22px; }
  .tab.is-active { color: var(--text); background: var(--surface-3); }
  .tab-post .icon { width: 28px; height: 28px; margin-top: -3px; padding: 3px; border: 2px solid var(--outline); border-radius: 8px; background: var(--go); color: var(--go-ink); }
  .tab .badge { position: absolute; top: 0; left: calc(50% + 6px); }
  .footer { padding: 0 16px 24px; }
  .hero { margin-top: 4px; }
  .hero h1 { font-size: 58px; }
  .hero-copy > p { font-size: 15.5px; }
  .hero-cta { width: 100%; }
  .hero-cta .btn-lg { flex: 1 1 auto; height: 48px; padding: 0 14px; font-size: 15.5px; }
  .scoreboard { padding: 16px 20px; }
  .score-num { font-size: 64px; }
  .board-head .row { width: 100%; }
  .board-head .row .btn { flex: 1; }
  .board-bar .search { flex-basis: 100%; }
  .board-bar select { flex: 1 1 130px; min-width: 0; }
  .grid-2, .grid-3, .choice-grid { grid-template-columns: minmax(0, 1fr); }
  .ghead-band { padding: 10px 12px; }
  .ghead-body { padding: 16px; }
  .panel { padding: 16px; }
  .request { flex-wrap: wrap; }
  .request-actions { justify-content: flex-start; width: 100%; }
  .commend-list li { grid-template-columns: 28px minmax(0, 1fr) 70px 28px; }
  .toasts { right: 12px; left: 12px; width: auto; }
  .qm-game .tile { display: none; }
  .profile-card { gap: 16px; }
}

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