/* =========================================================
   HEREDITA — Chalkboard
   -----------------------------------------------------------
   One rule runs through this whole file:

     SOLID line  = a real, finished thing
     DASHED line = a sketch — locked, unbuilt, coming soon
     ACCENT line = the thing you're on right now

   Dashes carry meaning here, so they are never decoration.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@600;700&family=Cabin:wght@400;500;600;700&family=Special+Elite&display=swap');

:root {
  /* Board */
  --board-1: #1e3a2a;
  --board-2: #16291f;
  --board-3: #0f2018;
  --board-4: #0a160f;
  --board-ink: #07110b;

  /* Chalk */
  --chalk:      #f4f1e6;
  --chalk-soft: #ddd8c6;
  --chalk-dim:  #a8b0a0;
  --chalk-ghost: rgba(244, 241, 230, 0.42);

  /* Coloured chalk — used sparingly, like the real box of it */
  --accent:      #d97a3d;
  --accent-soft: #ea9a63;
  --accent-deep: #a8511f;
  --chalk-blue:  #8fc2e0;
  --chalk-red:   #e08272;
  --chalk-gold:  #f0c661;

  /* Chalk tray */
  --wood-1: #6b4526;
  --wood-2: #3d2612;

  /* Line hierarchy */
  --rule:        1px solid rgba(244, 241, 230, 0.13);
  --rule-strong: 1px solid rgba(244, 241, 230, 0.26);
  --sketch:      2px dashed rgba(244, 241, 230, 0.38);

  /* Type */
  --font-display: 'Caveat', 'Segoe Script', cursive;
  --font-stamp:   'Special Elite', 'Courier New', monospace;
  --font-body:    'Cabin', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Shape */
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 18px;
  --maxw: 1180px;

  /* Depth */
  --lift-1: 0 1px 0 rgba(244,241,230,0.05) inset, 0 10px 24px -16px rgba(0,0,0,0.9);
  --lift-2: 0 1px 0 rgba(244,241,230,0.07) inset, 0 22px 44px -22px rgba(0,0,0,0.95);
  --lift-3: 0 28px 60px -24px rgba(0,0,0,0.95);

  /* Rhythm */
  --gap:  16px;
  --sec:  clamp(38px, 6vw, 66px);

  /* Stacking */
  --z-nav: 40;
  --z-menu: 60;
  --z-overlay: 80;
  --z-toast: 90;

  --ease: cubic-bezier(.22, .8, .2, 1);
}

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

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

/* Components below set `display` on elements that JS also toggles with the
   `hidden` attribute — which would otherwise lose to any class selector. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.62;
  color: var(--chalk-soft);
  background-color: var(--board-2);
  background-image:
    radial-gradient(ellipse 120% 80% at 22% 6%,  rgba(255,255,255,0.055), transparent 58%),
    radial-gradient(ellipse 90% 65% at 82% 96%,  rgba(0,0,0,0.5), transparent 70%),
    radial-gradient(ellipse 65% 45% at 50% 45%,  var(--board-1), var(--board-2) 58%, var(--board-3) 100%);
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;

  /* Sticky footer: short pages (chat, friends, settings) would otherwise
     leave the footer stranded halfway down the viewport. */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* width:100% matters — as a column flex item, `.container`'s `margin: 0 auto`
   would otherwise shrink main to its content width and collapse the grids. */
body > main { flex: 1 0 auto; width: 100%; }
body > .site-footer { flex: 0 0 auto; }

/* Slate grain. Fixed so it reads as the surface, not the content. */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  opacity: 0.3;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.5'/></svg>");
}

/* Ghosts of things wiped off the board */
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 22% 9% at 14% 24%, rgba(244,241,230,0.045), transparent 70%),
    radial-gradient(ellipse 16% 7% at 79% 13%, rgba(244,241,230,0.035), transparent 70%),
    radial-gradient(ellipse 26% 10% at 32% 86%, rgba(244,241,230,0.04), transparent 70%),
    radial-gradient(ellipse 18% 8% at 91% 74%, rgba(244,241,230,0.03), transparent 70%);
}

main, header, footer, section, .container { position: relative; z-index: 1; }


/* =========================================================
   TYPE
   Caveat writes. Special Elite stamps. Cabin explains.
   ========================================================= */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--chalk);
  margin: 0 0 .38em;
  line-height: 1.08;
  letter-spacing: 0.4px;
  text-shadow: 0 1px 0 rgba(0,0,0,0.3), 0 0 18px rgba(244,241,230,0.09);
}

h1 { font-size: clamp(2.4rem, 5.2vw, 3.9rem); }
h2 { font-size: clamp(1.85rem, 3.2vw, 2.6rem); }
h3 { font-size: clamp(1.3rem, 2vw, 1.65rem); }
h4 { font-size: 1.2rem; }

/* Exactly one hand-tilt per page, on the h1. Any more and it looks
   like a filter rather than a hand. */
h1.tilt-l { transform: rotate(-0.7deg); }
h1.tilt-r { transform: rotate(0.5deg); }
h2.tilt-l, h2.tilt-r, h3.tilt-l, h3.tilt-r { transform: none; }

p { margin: 0 0 1em; max-width: 68ch; }
p:last-child { margin-bottom: 0; }

/* A centred paragraph still has a 68ch measure, so the *block* has to be
   centred too — otherwise the text centres inside a box that's sitting off
   to the left. Covers both `.text-center p` and `p.text-center`. */
.text-center p,
p.text-center,
.text-center > * { margin-left: auto; margin-right: auto; }

strong { color: var(--chalk); font-weight: 600; }
em { color: var(--chalk); }

a {
  color: var(--chalk);
  text-decoration: none;
  border-bottom: 1px solid rgba(244,241,230,0.35);
  transition: color .18s, border-color .18s;
}
a:hover { color: var(--accent-soft); border-bottom-color: var(--accent); }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

code {
  font-family: var(--font-stamp);
  font-size: 0.92em;
  color: var(--accent-soft);
}

.muted  { color: var(--chalk-dim); }
.accent { color: var(--accent-soft); }

/* Typewritten metadata: dates, versions, statuses, section kickers. */
.kicker, .stamp, .version, .date, .badge, .cs-eta, .brand-tag {
  font-family: var(--font-stamp);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.kicker {
  display: block;
  color: var(--accent-soft);
  margin-bottom: 6px;
}


/* =========================================================
   LAYOUT
   ========================================================= */

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.stack > * + * { margin-top: 14px; }
.row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.spacer { flex: 1; }
.center { display: flex; align-items: center; justify-content: center; }
.text-center { text-align: center; }

.section-title {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  margin: var(--sec) 0 4px;
}
.section-title h1, .section-title h2 { margin: 0; }
.section-title .muted,
.section-title .see-all {
  font-family: var(--font-stamp);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.section-title .see-all { margin-left: auto; border-bottom-color: transparent; }
.section-title .see-all:hover { border-bottom-color: var(--accent); }

/* A chalk line drawn under section headings — the one signature flourish. */
.section-title::after {
  content: "";
  flex: 0 0 100%;
  height: 2px;
  margin-top: 10px;
  background: linear-gradient(90deg,
    rgba(244,241,230,0.34) 0%,
    rgba(244,241,230,0.14) 42%,
    transparent 78%);
  transform-origin: left center;
  transform: scaleX(var(--rule-scale, 1));
  transition: transform .7s var(--ease);
}
.section-title.reveal::after { --rule-scale: 0; }
.section-title.reveal.in::after { --rule-scale: 1; }


/* =========================================================
   CARDS
   Solid edge = finished. `.sketch` = not built yet.
   ========================================================= */

.chalk-card {
  position: relative;
  padding: 26px;
  border: var(--rule);
  border-radius: var(--r);
  background:
    linear-gradient(180deg, rgba(244,241,230,0.05), rgba(0,0,0,0.10) 40%, rgba(0,0,0,0.24)),
    rgba(10, 22, 15, 0.34);
  box-shadow: var(--lift-1);
  transition: border-color .25s var(--ease),
              box-shadow .25s var(--ease),
              transform .25s var(--ease),
              background .25s var(--ease);
}

.chalk-card.flat { background: rgba(0,0,0,0.22); box-shadow: none; }

/* Not built yet. Chalk outline, nothing filled in. */
.chalk-card.sketch,
.mode-card.disabled,
.coming-soon-tile,
.store-item.sketch {
  border: var(--sketch);
  background:
    repeating-linear-gradient(-45deg, rgba(244,241,230,0.028) 0 9px, transparent 9px 18px),
    rgba(0,0,0,0.2);
  box-shadow: none;
}

/* Interactive cards. Note the border-bottom reset — these are anchors, and
   the global link underline would otherwise cut across the card edge. */
a.chalk-card, button.chalk-card, .mode-card:not(.disabled) {
  cursor: pointer;
  border-bottom: var(--rule);
  text-align: left;
  color: inherit;
}
a.chalk-card { display: block; }
a.chalk-card:hover,
button.chalk-card:hover,
.mode-card:not(.disabled):hover,
.about-grid .chalk-card:hover,
.faq-grid .chalk-card:hover,
.update-entry:hover {
  transform: translateY(-3px);
  border-color: rgba(244,241,230,0.3);
  box-shadow: var(--lift-2);
}
a.chalk-card:active, .mode-card:not(.disabled):active {
  transform: translateY(-1px);
  transition-duration: .08s;
}
a.chalk-card:focus-visible, button.chalk-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.015em;
  color: var(--chalk);
  background: rgba(244,241,230,0.05);
  border: var(--rule-strong);
  border-radius: 10px;
  padding: 11px 22px;
  cursor: pointer;
  text-decoration: none;
  user-select: none;
  transition: background .16s, border-color .16s, color .16s, transform .12s, box-shadow .16s;
}
.btn:hover:not(:disabled):not([aria-disabled="true"]) {
  background: rgba(244,241,230,0.12);
  border-color: rgba(244,241,230,0.5);
  color: #fff;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn svg { width: 17px; height: 17px; flex: 0 0 auto; }

/* Primary — a painted key with a hard edge underneath, like a game button */
.btn-primary {
  color: var(--board-ink);
  background: linear-gradient(180deg, var(--accent-soft), var(--accent));
  border: 1px solid rgba(255, 220, 180, 0.55);
  box-shadow: 0 3px 0 var(--accent-deep), 0 12px 26px -12px rgba(217,122,61,0.85);
}
.btn-primary:hover:not(:disabled):not([aria-disabled="true"]) {
  color: var(--board-ink);
  background: linear-gradient(180deg, #f2ab77, var(--accent-soft));
  transform: translateY(-2px);
  box-shadow: 0 5px 0 var(--accent-deep), 0 18px 34px -12px rgba(217,122,61,0.95);
}
.btn-primary:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--accent-deep), 0 6px 14px -8px rgba(0,0,0,0.8);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--chalk-dim);
  padding: 9px 14px;
}
.btn-ghost:hover:not(:disabled) {
  background: rgba(244,241,230,0.07);
  border-color: transparent;
  color: var(--chalk);
}



/* Locked controls read as sketches too */
.btn.locked, .btn.emperor-locked, .tier-switch button.locked {
  border-style: dashed;
  opacity: 0.62;
  cursor: not-allowed;
}
.btn.locked:hover, .btn.emperor-locked:hover, .tier-switch button.locked:hover {
  transform: none;
  background: rgba(244,241,230,0.05);
}


/* =========================================================
   CHIPS, BADGES, STAMPS
   ========================================================= */

.badge, .lock-badge, .price-pill, .lock-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  padding: 3px 10px;
  border-radius: 999px;
  line-height: 1.5;
}

/* "Coming soon" everywhere reads as a sketch */
.badge, .lock-badge, .lock-pill {
  font-family: var(--font-stamp);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-soft);
  background: rgba(217,122,61,0.12);
  border: 1px dashed rgba(217,122,61,0.6);
}
.lock-pill { margin-left: 10px; vertical-align: middle; }


.price-pill {
  font-family: var(--font-stamp);
  font-size: 0.72rem;
  color: var(--chalk-dim);
  border: var(--rule);
}
.price-pill .coin, .coin-chip .coin {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 32%, #ffe9a8, var(--chalk-gold) 52%, #b8862a);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4);
  flex: 0 0 auto;
}



/* =========================================================
   TOP BAR
   The nav is the spine of the site, so it gets real chrome:
   icon tabs, and a chalk dash that slides to whatever you point at.
   ========================================================= */

.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: linear-gradient(180deg, rgba(7,17,11,0.96), rgba(7,17,11,0.86));
  backdrop-filter: blur(12px) saturate(1.15);
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
  border-bottom: 1px solid rgba(244,241,230,0.12);
  box-shadow: 0 1px 0 rgba(244,241,230,0.045), 0 14px 34px -24px #000;
}

.topbar-inner, .topbar .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 9px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

/* --- Brand --- */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: none;
  flex: 0 0 auto;
}
.brand:hover { color: var(--chalk); }
.brand-mark, .topbar .brand img {
  width: 34px; height: 34px;
  object-fit: contain;
  transition: transform .4s var(--ease);
}
.brand:hover .brand-mark { transform: rotate(-7deg) scale(1.07); }
.brand-text { display: flex; flex-direction: column; line-height: 1; gap: 3px; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.55rem;
  color: var(--chalk);
  line-height: 0.9;
}
.brand-tag {
  font-size: 0.55rem;
  color: var(--accent-soft);
  opacity: 0.85;
}

/* --- Tabs --- */
.primary-nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1px;
  flex: 1 1 auto;
  min-width: 0;
}

.nav-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border: none;
  border-bottom: none;
  border-radius: var(--r-sm);
  background: transparent;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.94rem;
  letter-spacing: 0.01em;
  color: var(--chalk-dim);
  cursor: pointer;
  white-space: nowrap;
  transition: color .18s, background .18s;
}
.nav-tab svg { width: 16px; height: 16px; flex: 0 0 auto; opacity: 0.55; transition: opacity .18s var(--ease), transform .3s var(--ease); }
.nav-tab:hover, .nav-tab:focus-visible { color: var(--chalk); background: rgba(244,241,230,0.07); }
.nav-tab:hover svg, .nav-tab:focus-visible svg { opacity: 1; transform: translateY(-1px); }
.nav-tab.active { color: var(--chalk); }
.nav-tab.active svg { opacity: 1; color: var(--accent-soft); }
.nav-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.nav-tab .caret {
  width: 11px; height: 11px;
  opacity: 0.55;
  transition: transform .28s var(--ease), opacity .18s;
}
.nav-group.open > .nav-tab .caret { transform: rotate(180deg); }
.nav-group.open > .nav-tab { color: var(--chalk); background: rgba(244,241,230,0.07); }

/* The sliding chalk dash. Follows the pointer, snaps back to the
   current page when you stop pointing at anything. */
.nav-marker {
  position: absolute;
  left: 0; bottom: -4px;
  height: 3px;
  width: 0;
  border-radius: 2px;
  pointer-events: none;
  opacity: 0;
  background: repeating-linear-gradient(90deg,
    var(--accent) 0 7px, rgba(217,122,61,0.22) 7px 11px);
  transition: transform .34s var(--ease),
              width .34s var(--ease),
              opacity .2s ease,
              background .2s ease;
}
.primary-nav.marker-live .nav-marker { opacity: 1; }
.primary-nav.marker-hover .nav-marker {
  background: repeating-linear-gradient(90deg,
    var(--chalk) 0 7px, rgba(244,241,230,0.18) 7px 11px);
}

/* --- Dropdown panels --- */
.nav-group { position: relative; display: flex; align-items: center; }

.nav-menu {
  position: absolute;
  top: calc(100% + 16px);
  left: 50%;
  min-width: 250px;
  padding: 7px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: var(--rule-strong);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, #172c20, #0b1a11);
  box-shadow: var(--lift-3), 0 0 0 1px rgba(0,0,0,0.5);
  z-index: var(--z-menu);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -8px) scale(0.97);
  transform-origin: top center;
  transition: opacity .18s ease, transform .26s var(--ease), visibility .26s;
}
.nav-group.open > .nav-menu {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0) scale(1);
}
.nav-menu.align-right {
  left: auto; right: 0;
  transform: translate(0, -8px) scale(0.97);
  transform-origin: top right;
}
.nav-group.open > .nav-menu.align-right { transform: translate(0, 0) scale(1); }

/* chalk notch pointing back at the tab */
.nav-menu::before {
  content: "";
  position: absolute;
  top: -7px;
  left: var(--notch, 50%);
  margin-left: -6px;
  width: 12px; height: 12px;
  transform: rotate(45deg);
  background: #172c20;
  border-left: var(--rule-strong);
  border-top: var(--rule-strong);
  border-top-left-radius: 3px;
}

.nav-menu a, .nav-menu button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--chalk-soft);
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s, transform .15s var(--ease);
}
.nav-menu a:hover, .nav-menu a:focus-visible,
.nav-menu button:hover, .nav-menu button:focus-visible {
  background: rgba(244,241,230,0.08);
  border-color: rgba(244,241,230,0.16);
  color: var(--chalk);
  outline: none;
  transform: translateX(2px);
}
.nav-menu a.active {
  color: var(--accent-soft);
  background: rgba(217,122,61,0.14);
  border-color: rgba(217,122,61,0.5);
}
.nav-menu .sp-icon, .nav-menu .mi-icon {
  width: 19px; height: 19px;
  flex: 0 0 19px;
  display: inline-flex; align-items: center; justify-content: center;
  opacity: 0.75;
}
.nav-menu .sp-icon svg, .nav-menu .mi-icon svg { width: 19px; height: 19px; }
.nav-menu a:hover .sp-icon, .nav-menu a:hover .mi-icon { opacity: 1; }
.nav-menu .sp-label { flex: 1; min-width: 0; line-height: 1.2; }
.nav-menu .sp-sub {
  display: block;
  font-size: 0.74rem;
  color: var(--chalk-dim);
  margin-top: 2px;
}
.nav-menu .menu-rule {
  height: 1px;
  margin: 5px 8px;
  background: rgba(244,241,230,0.12);
}
.nav-menu .menu-head {
  font-family: var(--font-stamp);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--chalk-dim);
  padding: 7px 12px 4px;
}

/* --- Right-hand cluster --- */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  margin-left: auto;
}

.coin-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px dashed rgba(240, 198, 97, 0.45);
  background: rgba(240, 198, 97, 0.09);
  color: var(--chalk-gold);
  font-family: var(--font-stamp);
  font-size: 0.78rem;
  cursor: default;
}
.coin-chip .soon {
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.6;
}

/* Name + tier + avatar, one control */
.user-chip, .player-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 4px 10px 4px 5px;
  border: var(--rule);
  border-radius: 999px;
  background: rgba(244,241,230,0.04);
  cursor: pointer;
  font-family: var(--font-body);
  transition: background .16s, border-color .16s;
}
.user-chip:hover, .nav-group.open > .user-chip {
  background: rgba(244,241,230,0.1);
  border-color: rgba(244,241,230,0.28);
}
.user-chip .avatar {
  width: 29px; height: 29px;
  flex: 0 0 29px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, var(--accent-soft), var(--accent-deep));
  color: var(--board-ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  border: 1px solid rgba(244,241,230,0.5);
  overflow: hidden;
}
.user-chip .avatar.countryball {
  background: none; border: none; padding: 0;
  width: 30px; height: 30px; flex-basis: 30px;
  overflow: visible;
}
.user-chip .avatar.countryball svg { width: 100%; height: 100%; display: block; }

.user-block {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  line-height: 1.1;
}
.user-block .name {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--chalk);
  max-width: 130px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-stamp);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.4;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid rgba(201,209,194,0.4);
  background: rgba(180,192,170,0.14);
  color: var(--chalk-dim);
  text-decoration: none;
  border-bottom-width: 1px;
}
.tier-badge[data-tier="regular"] {
  border-color: rgba(244,241,230,0.5);
  background: rgba(244,241,230,0.12);
  color: var(--chalk);
}
.tier-badge[data-tier="emperor"] {
  border-color: var(--chalk-gold);
  background: linear-gradient(135deg, rgba(240,198,97,0.3), rgba(217,122,61,0.3));
  color: #ffeec2;
  box-shadow: 0 0 14px rgba(240,198,97,0.28);
}
.tier-badge .crown {
  width: 11px; height: 11px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M3 19 5 8l5 4 2-7 2 7 5-4 2 11H3zm0 2h18v2H3z'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M3 19 5 8l5 4 2-7 2 7 5-4 2 11H3zm0 2h18v2H3z'/></svg>") center/contain no-repeat;
}

/* --- Hamburger --- */
.nav-toggle {
  display: none;
  width: 38px; height: 34px;
  padding: 0;
  border: var(--rule-strong);
  border-radius: var(--r-sm);
  background: transparent;
  cursor: pointer;
  position: relative;
  flex: 0 0 auto;
}
.nav-toggle span, .nav-toggle::before, .nav-toggle::after {
  content: "";
  position: absolute;
  left: 9px; right: 9px;
  height: 2px;
  border-radius: 2px;
  background: var(--chalk);
  transition: transform .3s var(--ease), opacity .18s;
}
.nav-toggle::before { top: 10px; }
.nav-toggle span    { top: 16px; }
.nav-toggle::after  { top: 22px; }
.topbar.menu-open .nav-toggle::before { transform: translateY(6px) rotate(45deg); }
.topbar.menu-open .nav-toggle span    { opacity: 0; }
.topbar.menu-open .nav-toggle::after  { transform: translateY(-6px) rotate(-45deg); }


/* =========================================================
   FOOTER
   ========================================================= */

.site-footer {
  margin-top: var(--sec);
  padding: 26px 24px 38px;
  border-top: var(--rule);
  background: rgba(7,17,11,0.55);
  color: var(--chalk-dim);
  font-size: 0.88rem;
}
.site-footer .footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center;
}
.site-footer .footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.site-footer a {
  color: var(--chalk-soft);
  font-size: 0.88rem;
  border-bottom-color: transparent;
}
.site-footer a:hover { border-bottom-color: var(--accent); }
.site-footer .footer-meta {
  margin-left: auto;
  font-family: var(--font-stamp);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  opacity: 0.75;
}


/* =========================================================
   FORMS
   ========================================================= */

input, select, textarea, button { font-family: inherit; font-size: inherit; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 15px; }
.field label {
  font-family: var(--font-stamp);
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--chalk-dim);
}

.field input, .field select,
.country-search, .settings-row select, .settings-row input[type="text"],
.chat-new-dm input, .chat-composer input, .text-input {
  font-family: var(--font-body);
  font-size: 0.98rem;
  color: var(--chalk);
  background: rgba(0,0,0,0.32);
  border: var(--rule-strong);
  border-radius: 10px;
  padding: 11px 14px;
  outline: none;
  width: 100%;
  transition: border-color .18s, background .18s, box-shadow .18s;
}
.field input::placeholder, .text-input::placeholder,
.country-search::placeholder, .chat-composer input::placeholder { color: var(--chalk-ghost); }

.field input:focus, .field select:focus,
.country-search:focus, .settings-row select:focus, .settings-row input:focus,
.chat-new-dm input:focus, .chat-composer input:focus, .text-input:focus {
  border-color: var(--accent);
  background: rgba(0,0,0,0.44);
  box-shadow: 0 0 0 3px rgba(217,122,61,0.2);
}
/* :user-invalid, not :invalid — an untouched empty required field (the date
   picker, "confirm password") is invalid from page load and shouldn't be
   scolding anyone before they've typed. */
.field input:user-invalid { border-color: var(--chalk-red); }
.field input:disabled, .chat-composer input:disabled { opacity: 0.5; cursor: not-allowed; }

.checkbox {
  display: flex; align-items: flex-start; gap: 10px;
  cursor: pointer;
  font-size: 0.92rem;
  color: var(--chalk-soft);
}
.checkbox input { appearance: none; -webkit-appearance: none; margin: 0; }
.checkbox .box {
  width: 21px; height: 21px; flex: 0 0 21px;
  margin-top: 1px;
  border: var(--rule-strong);
  border-radius: 5px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s;
}
.checkbox input:checked + .box { background: var(--accent); border-color: var(--accent-soft); }
.checkbox input:checked + .box::after {
  content: "";
  width: 11px; height: 6px;
  border-left: 2.5px solid var(--board-ink);
  border-bottom: 2.5px solid var(--board-ink);
  transform: rotate(-45deg) translate(1px, -1px);
}
.checkbox input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Segmented controls — auth tabs, country tabs, tier switch */
.auth-tabs, .country-tabs, .tier-switch {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: var(--rule);
  border-radius: 12px;
  background: rgba(0,0,0,0.28);
  margin-bottom: 18px;
}
.auth-tabs button, .country-tabs button, .tier-switch button {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--chalk-dim);
  cursor: pointer;
  transition: background .18s var(--ease), color .18s, border-color .18s;
}
.auth-tabs button:hover, .country-tabs button:hover, .tier-switch button:hover {
  color: var(--chalk);
  background: rgba(244,241,230,0.06);
}
.auth-tabs button.active, .country-tabs button.active, .tier-switch button.active {
  color: var(--chalk);
  background: rgba(244,241,230,0.11);
  border-color: rgba(244,241,230,0.2);
  box-shadow: 0 2px 8px -4px #000;
}
.tier-switch { margin: 8px 0 0; }
.tier-switch button[data-tier="emperor"].active {
  background: linear-gradient(135deg, rgba(240,198,97,0.28), rgba(217,122,61,0.28));
  border-color: var(--chalk-gold);
  color: #ffeec2;
}

.form-actions { display: flex; flex-direction: column; gap: 11px; margin-top: 4px; }
.form-actions .btn { width: 100%; }
.form-actions .row-or {
  position: relative;
  text-align: center;
  font-family: var(--font-stamp);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--chalk-dim);
  margin: 2px 0;
}
.form-actions .row-or::before, .form-actions .row-or::after {
  content: "";
  position: absolute; top: 50%;
  width: calc(50% - 26px); height: 1px;
  background: rgba(244,241,230,0.16);
}
.form-actions .row-or::before { left: 0; }
.form-actions .row-or::after  { right: 0; }

/* Toggle */
.toggle { position: relative; width: 48px; height: 26px; display: inline-block; flex: 0 0 auto; }
.toggle input { opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.toggle .track {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.5);
  border: var(--rule-strong);
  border-radius: 999px;
  transition: background .2s, border-color .2s;
}
.toggle .thumb {
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: var(--chalk-dim);
  border-radius: 50%;
  transition: transform .26s var(--ease), background .2s;
}
.toggle input:checked + .track { background: rgba(217,122,61,0.4); border-color: var(--accent); }
.toggle input:checked + .track + .thumb { transform: translateX(22px); background: var(--accent-soft); }
.toggle input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 3px; }


/* =========================================================
   AUTH LANDING
   ========================================================= */

.auth-wrap {
  display: grid;
  grid-template-columns: 1fr 460px;
  align-items: center;
  gap: clamp(28px, 6vw, 76px);
  padding: 48px 24px 40px;
  max-width: 1080px;
}

.auth-pitch { max-width: 520px; }
.auth-logo {
  width: clamp(230px, 26vw, 340px);
  display: block;
  margin: 0 0 6px -6px;
  filter: drop-shadow(0 12px 26px rgba(0,0,0,0.6));
  user-select: none;
}
.auth-tagline {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.6vw, 2.05rem);
  color: var(--chalk);
  margin: 0 0 22px;
  line-height: 1.2;
}
.auth-facts {
  list-style: none;
  padding: 0;
  margin: 22px 0 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
  border-top: var(--rule);
  padding-top: 20px;
}
.auth-facts li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--chalk-soft);
  font-size: 0.95rem;
}
.auth-facts svg {
  width: 19px; height: 19px;
  flex: 0 0 19px;
  margin-top: 2px;
  color: var(--accent-soft);
}
.auth-facts strong { display: block; color: var(--chalk); font-weight: 600; }

.auth-card { width: 100%; padding: 30px 28px; }
.auth-card h2 { font-size: 1.9rem; }
.auth-panel[hidden] { display: none; }

.auth-shot {
  margin-top: 26px;
  border: var(--rule-strong);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--lift-2);
  aspect-ratio: 16 / 8;
  background: url('../assets/screenshot-1945.png') center/cover no-repeat;
  position: relative;
}
.auth-shot::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(7,17,11,0.75));
}

@media (max-width: 900px) {
  .auth-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    padding-top: 34px;
  }
  .auth-pitch { max-width: 560px; }
  .auth-logo { margin: 0 auto 6px; }
  .auth-facts { text-align: left; }
  .auth-shot { display: none; }
  .auth-card { max-width: 460px; }
}


/* =========================================================
   HERO
   ========================================================= */

.hero-card {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 30px;
  align-items: center;
  padding: 34px;
  overflow: hidden;
  background:
    linear-gradient(115deg, rgba(217,122,61,0.16), rgba(0,0,0,0.28) 55%),
    linear-gradient(180deg, rgba(244,241,230,0.05), rgba(0,0,0,0.24)),
    rgba(10,22,15,0.4);
}
.hero-card .hero-text { min-width: 0; }
.hero-card .hero-text h1 { margin-bottom: 10px; }
.hero-card .hero-art {
  display: block;
  height: 178px;
  border: var(--rule-strong);
  border-bottom: none;
  border-radius: var(--r);
  background: url('../assets/screenshot-1945.png') center/cover no-repeat;
  box-shadow: var(--lift-2);
  cursor: pointer;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.hero-card .hero-art:hover {
  transform: scale(1.025) rotate(-0.8deg);
  box-shadow: var(--lift-3);
}

/* The tray the chalk actually sits in. Used once per page, under the hero. */
.chalk-tray {
  position: relative;
  height: 15px;
  margin: -1px auto 0;
  max-width: calc(100% - 26px);
  border-radius: 0 0 9px 9px;
  background: linear-gradient(180deg, var(--wood-1) 0%, #56361b 45%, var(--wood-2) 100%);
  box-shadow: 0 7px 16px -8px rgba(0,0,0,0.9), inset 0 1px 0 rgba(255,220,180,0.18);
}
.chalk-tray::before {
  content: "";
  position: absolute;
  left: 34px; top: -5px;
  width: 52px; height: 7px;
  border-radius: 3px;
  background: linear-gradient(180deg, #fdfaf0, #cfc9b4);
  box-shadow: 0 1px 2px rgba(0,0,0,0.5);
  transform: rotate(-0.7deg);
}
.chalk-tray::after {
  content: "";
  position: absolute;
  right: 40px; top: -7px;
  width: 34px; height: 9px;
  border-radius: 2px;
  background: linear-gradient(180deg, #5d6a76, #38424c);
  box-shadow: 0 1px 2px rgba(0,0,0,0.5);
  transform: rotate(0.6deg);
}

@media (max-width: 780px) {
  .hero-card { grid-template-columns: 1fr; padding: 24px; }
  .hero-card .hero-art { height: 150px; }
  .chalk-tray::after { display: none; }
}


/* =========================================================
   MODE CARDS
   ========================================================= */

.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
  gap: 16px;
  margin-top: 20px;
}

.chalk-card.mode-card {
  position: relative;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow: hidden;
}
.mode-card .mode-era {
  font-family: var(--font-stamp);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-soft);
  order: -1;
}
.mode-card h3 { margin: 0; position: relative; align-self: flex-start; }
.mode-card h3::after {
  content: "";
  position: absolute;
  left: 0; bottom: -3px;
  height: 2px; width: 100%;
  background: var(--accent);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .38s var(--ease);
}
.mode-card:not(.disabled):hover h3::after { transform: scaleX(1); }
.mode-card p { margin: 0; font-size: 0.94rem; color: var(--chalk-soft); }

.mode-card.disabled { cursor: not-allowed; }
.mode-card.disabled h3, .mode-card.disabled p { color: var(--chalk-dim); }
.mode-card.disabled .mode-era { color: var(--chalk-dim); }
.mode-card .mode-flag {
  position: absolute;
  top: 14px; right: 14px;
  font-family: var(--font-stamp);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--chalk-dim);
  border: 1px dashed rgba(244,241,230,0.35);
  border-radius: 3px;
  padding: 1px 7px;
  transform: rotate(3deg);
}


/* =========================================================
   FEATURE GRID (about / play)
   ========================================================= */

/* Capped at three so the feature sets stay balanced: Play's trio fills one
   row, About's six read as 3 + 3 rather than a stranded 4 + 2.

   Every auto-fit grid in this file wraps its track minimum in min(_, 100%).
   A bare minmax(300px, 1fr) refuses to go under 300px, so on a 320px phone
   the cards pushed 28px past the screen and the whole page scrolled
   sideways. Above 300px the two are the same number, so nothing else moves. */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 16px;
  margin-top: 20px;
}
.about-grid .chalk-card { padding: 22px; }
.about-grid h3 {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 1.35rem;
  margin: 0 0 8px;
}
.about-grid h3 .ico {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 34px; height: 34px;
  flex: 0 0 34px;
  border: var(--rule-strong);
  border-radius: 9px;
  color: var(--accent-soft);
  background: rgba(217,122,61,0.09);
  transition: transform .3s var(--ease), background .3s, border-color .3s;
}
.about-grid h3 .ico svg { width: 18px; height: 18px; }
.about-grid .chalk-card:hover h3 .ico {
  transform: rotate(-7deg);
  background: rgba(217,122,61,0.2);
  border-color: var(--accent);
}
.about-grid p { margin: 0; font-size: 0.94rem; }

.about-hero { text-align: center; padding: 46px 24px 12px; }
.about-hero p { margin-left: auto; margin-right: auto; }


/* =========================================================
   UPDATES
   ========================================================= */

.updates-strip {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 20px;
  margin-top: 18px;
  border-left: 3px solid var(--accent);
  text-decoration: none;
  flex-wrap: wrap;
}
.updates-strip .label {
  font-family: var(--font-stamp);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--accent-soft);
}
.updates-strip .muted { font-size: 0.93rem; }

.timeline { display: flex; flex-direction: column; gap: 18px; margin-top: 20px; }
.update-entry { padding: 24px; border-left: 3px solid rgba(217,122,61,0.55); }
.update-entry .meta {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 6px;
}
.update-entry .version {
  color: var(--accent-soft);
  border: 1px solid rgba(217,122,61,0.5);
  background: rgba(217,122,61,0.12);
  border-radius: 4px;
  padding: 1px 9px;
  font-size: 0.72rem;
}
.update-entry .date { color: var(--chalk-dim); font-size: 0.68rem; }
.update-entry .meta .muted { font-size: 0.86rem; text-transform: none; letter-spacing: 0; }
.update-entry h2 { font-size: 1.7rem; margin: 0 0 8px; }
.update-entry ul { padding-left: 20px; margin: 10px 0 0; }
.update-entry li { margin-bottom: 5px; font-size: 0.95rem; }
.update-entry li::marker { color: var(--accent); }


/* =========================================================
   PREVIEW SHOWCASE
   ========================================================= */

.preview-showcase {
  display: grid;
  grid-template-columns: 1fr 250px;
  gap: 18px;
  padding: 18px;
  margin-top: 20px;
}
.preview-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--r);
  overflow: hidden;
  background: #000;
  border: var(--rule-strong);
  box-shadow: var(--lift-2);
}
.preview-stage .slide {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0;
  transform: scale(1.05);
  transition: opacity .6s ease, transform 6.5s ease-out;
}
.preview-stage .slide.active { opacity: 1; transform: scale(1); }

.preview-stage .stage-overlay {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 30px 20px 16px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.88));
  pointer-events: none;
}
.preview-stage .stage-overlay .caption {
  font-family: var(--font-display);
  font-size: 1.55rem;
  color: var(--chalk);
  margin: 0 0 2px;
  line-height: 1.1;
  text-shadow: 0 2px 8px rgba(0,0,0,0.9);
}
.preview-stage .stage-overlay .sub {
  margin: 0;
  font-size: 0.85rem;
  color: var(--chalk-soft);
}
.preview-stage .tag-live {
  position: absolute; top: 12px; left: 12px;
  font-family: var(--font-stamp);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--board-ink);
  background: var(--accent);
  padding: 3px 9px;
  border-radius: 4px;
  pointer-events: none;
}
.preview-stage .stage-nav {
  position: absolute;
  top: 50%;
  width: 38px; height: 38px;
  transform: translateY(-50%);
  border: var(--rule-strong);
  border-radius: 50%;
  background: rgba(7,17,11,0.78);
  backdrop-filter: blur(4px);
  color: var(--chalk);
  font-size: 1.3rem;
  line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity .25s, background .18s, transform .18s;
  z-index: 3;
}
.preview-stage:hover .stage-nav,
.preview-stage:focus-within .stage-nav { opacity: 1; }
.preview-stage .stage-nav:hover {
  background: var(--accent);
  color: var(--board-ink);
  transform: translateY(-50%) scale(1.08);
}
.preview-stage .stage-nav.prev { left: 12px; }
.preview-stage .stage-nav.next { right: 12px; }

.preview-progress {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 3px;
  background: rgba(0,0,0,0.5);
  z-index: 2;
}
.preview-progress .bar {
  height: 100%; width: 0;
  background: var(--accent);
  transition: width 80ms linear;
}

.preview-thumbs {
  display: flex; flex-direction: column; gap: 9px;
  max-height: 100%;
  overflow-y: auto;
  padding-right: 4px;
}
.preview-thumbs .thumb {
  position: relative;
  flex: 0 0 auto;
  height: 64px;
  border-radius: var(--r-sm);
  border: var(--rule);
  background-size: cover; background-position: center;
  cursor: pointer;
  overflow: hidden;
  transition: transform .2s var(--ease), border-color .2s, box-shadow .2s;
}
.preview-thumbs .thumb::after {
  content: "";
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.5);
  transition: background .2s;
}
.preview-thumbs .thumb:hover { border-color: rgba(244,241,230,0.4); transform: translateX(-3px); }
.preview-thumbs .thumb:hover::after { background: rgba(0,0,0,0.18); }
.preview-thumbs .thumb.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--lift-1);
  transform: translateX(-5px);
}
.preview-thumbs .thumb.active::after { background: rgba(0,0,0,0.05); }
.preview-thumbs .thumb .label {
  position: absolute; left: 9px; right: 9px; bottom: 6px;
  z-index: 2;
  font-family: var(--font-stamp);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--chalk);
  text-shadow: 0 1px 4px rgba(0,0,0,1);
}
.preview-thumbs::-webkit-scrollbar { width: 6px; height: 6px; }
.preview-thumbs::-webkit-scrollbar-thumb { background: rgba(244,241,230,0.2); border-radius: 6px; }

/* Counter. Desktop has five thumbnails in view at all times, so it already
   knows where it is; on a phone the strip is scrolled and it doesn't. */
.preview-count { display: none; }

@media (max-width: 880px) {
  .preview-showcase { grid-template-columns: 1fr; }
  .preview-thumbs { flex-direction: row; overflow-x: auto; padding-bottom: 6px; }
  .preview-thumbs .thumb { flex: 0 0 132px; height: 74px; }
  .preview-thumbs .thumb:hover, .preview-thumbs .thumb.active { transform: translateY(-3px); }
}

/* --- Carousel on a phone -------------------------------------------------
   Landing here it was a 289px-wide 16:9 letterbox inside two layers of
   padding, with the only controls hidden behind :hover. On a touch screen
   that is a picture, not a carousel. So: bleed the stage to the card edge,
   give it a shape a phone can actually read, and put the controls on screen.
   ------------------------------------------------------------------------ */
@media (max-width: 620px) {
  .preview-showcase { padding: 0 0 14px; gap: 12px; overflow: hidden; }

  /* Edge to edge. The card's own border draws the frame, so the stage drops
     its border and its top corners follow the card's. */
  .preview-stage {
    aspect-ratio: 4 / 3;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    border: none;
    border-bottom: var(--rule-strong);
    box-shadow: none;
  }

  .preview-stage .stage-overlay { padding: 42px 16px 14px; }
  .preview-stage .stage-overlay .caption { font-size: 1.3rem; }
  .preview-stage .stage-overlay .sub { font-size: 0.78rem; }
  /* Shares the top row with the slide counter now, so it gives up some width. */
  .preview-stage .tag-live { top: 10px; left: 10px; font-size: 0.54rem; padding: 3px 7px; }

  .preview-thumbs { padding: 0 14px 4px; gap: 8px; }
  .preview-thumbs .thumb { flex: 0 0 118px; height: 66px; }
  .preview-thumbs .thumb .label { font-size: 0.56rem; }
}

/* Below 880 the card is already stacked, so the arrows come out from behind
   :hover and get sized for a thumb. Keyed to width rather than (hover: none)
   on purpose — plenty of touch devices report hover: hover, and hiding a
   carousel's only controls from them leaves the reel with no controls at all. */
@media (max-width: 880px) {
  .preview-stage .stage-nav {
    opacity: 1;
    width: 44px; height: 44px;
    font-size: 1.5rem;
    background: rgba(7,17,11,0.62);
    border-color: rgba(244,241,230,0.34);
    /* Lifted off centre so they clear the caption block underneath. */
    top: 42%;
  }
  .preview-stage .stage-nav.prev { left: 8px; }
  .preview-stage .stage-nav.next { right: 8px; }
  .preview-stage .stage-nav:active {
    background: var(--accent);
    color: var(--board-ink);
    transform: translateY(-50%) scale(0.94);
  }

  /* Where you are in the reel, since only two thumbs fit on screen. */
  .preview-count {
    display: block;
    position: absolute;
    top: 10px; right: 10px;
    z-index: 3;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(7,17,11,0.7);
    border: var(--rule);
    font-family: var(--font-stamp);
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    color: var(--chalk-soft);
    pointer-events: none;
  }

  /* Snap, so a flick lands on a thumbnail instead of halfway across one.
     The 6px scrollbar it replaces drew a grey stub under the strip on
     Android and nothing at all on iOS. */
  .preview-thumbs {
    scroll-snap-type: x mandatory;
    scroll-padding-left: 14px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .preview-thumbs::-webkit-scrollbar { display: none; }
  .preview-thumbs .thumb { scroll-snap-align: start; }
}

/* No hover on touch, so the thumbnail lift only ever means "this is the one". */
@media (hover: none) and (max-width: 880px) {
  .preview-stage .stage-nav:hover {
    background: rgba(7,17,11,0.62);
    color: var(--chalk);
    transform: translateY(-50%);
  }
  .preview-thumbs .thumb:hover { transform: none; border-color: rgba(244,241,230,0.13); }
  .preview-thumbs .thumb:hover::after { background: rgba(0,0,0,0.5); }
  .preview-thumbs .thumb.active { transform: none; }
  .preview-thumbs .thumb.active::after { background: rgba(0,0,0,0.05); }
}


/* =========================================================
   PLAY
   ========================================================= */

/* Launch panel — the copy holds one side, the actual board holds the other.
   A single centred button in an empty card is a poster, not a game page. */
.launch-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  align-items: stretch;
  padding: 0;
  margin-top: 26px;
  overflow: hidden;
}

.launch-copy {
  padding: clamp(28px, 3.4vw, 48px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.launch-copy h1 {
  margin: 0 0 12px;
  font-size: clamp(2.4rem, 4.2vw, 3.5rem);
}
.launch-copy .lede {
  font-size: 1.04rem;
  color: var(--chalk-soft);
  max-width: 40ch;
  margin: 0 0 28px;
}

.launch-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.btn-launch {
  font-size: 1.12rem;
  padding: 15px 34px;
  border-radius: 12px;
}
.btn-launch svg { width: 19px; height: 19px; }
.launch-note {
  font-family: var(--font-stamp);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: var(--chalk-dim);
}

/* Spec list, not a marketing stat bar */
.launch-spec {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px 28px;
  margin: 30px 0 0;
  padding-top: 22px;
  border-top: var(--rule);
}
.launch-spec div { min-width: 0; }
.launch-spec dt {
  font-family: var(--font-stamp);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--chalk-dim);
  margin-bottom: 3px;
}
.launch-spec dd {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--chalk);
}

/* The board itself, bled to the card edge */
.launch-plate {
  position: relative;
  min-height: 380px;
  overflow: hidden;
}
.launch-plate img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 60% center;
}
/* Fade the inner edge into the board so the plate reads as part of the card
   rather than a screenshot pasted on top of it. */
.launch-plate::before {
  content: "";
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg,
    rgba(10,22,15,0.97) 0%,
    rgba(10,22,15,0.55) 20%,
    rgba(10,22,15,0) 52%);
}
.launch-plate::after {
  content: "";
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(0deg, rgba(7,17,11,0.65), transparent 42%);
}
.plate-caption {
  position: absolute;
  right: 16px; bottom: 13px; z-index: 2;
  font-family: var(--font-stamp);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--chalk-soft);
  text-shadow: 0 1px 5px rgba(0,0,0,0.95);
}

@media (max-width: 900px) {
  .launch-panel { grid-template-columns: 1fr; }
  .launch-plate {
    order: -1;
    min-height: 0;
    aspect-ratio: 16 / 8;
  }
  .launch-plate::before {
    background: linear-gradient(0deg, rgba(10,22,15,0.95) 0%, rgba(10,22,15,0) 58%);
  }
}
@media (max-width: 520px) {
  .launch-spec { grid-template-columns: 1fr; gap: 13px; }
}



/* =========================================================
   STORE
   ========================================================= */

.store-featured {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 16px;
  margin-top: 20px;
}
.store-featured .featured-card {
  position: relative;
  padding: 24px;
  min-height: 218px;
  display: flex; flex-direction: column; gap: 10px;
  overflow: hidden;
  border: var(--sketch);
  background:
    linear-gradient(135deg, rgba(217,122,61,0.2), rgba(0,0,0,0.4)),
    rgba(10,22,15,0.4);
}
.store-featured .featured-card h3 { font-size: 1.6rem; margin: 0; }
.store-featured .featured-card p { font-size: 0.93rem; }
.store-featured .featured-card .glyph {
  position: absolute;
  right: -22px; bottom: -22px;
  width: 172px; height: 172px;
  opacity: 0.14;
  pointer-events: none;
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(216px, 100%), 1fr));
  gap: 16px;
  margin-top: 20px;
}
.store-item {
  position: relative;
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  border: var(--sketch);
  background: rgba(0,0,0,0.2);
}
.store-item .thumb {
  height: 124px;
  border-radius: var(--r-sm);
  border: var(--rule);
  background:
    repeating-linear-gradient(-45deg, rgba(244,241,230,0.03) 0 9px, transparent 9px 18px),
    linear-gradient(160deg, rgba(217,122,61,0.14), rgba(0,0,0,0.3));
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.store-item .thumb svg { width: 74%; height: 74%; }
.store-item h3 { margin: 0; font-size: 1.35rem; }
.store-item p { margin: 0; font-size: 0.88rem; color: var(--chalk-dim); min-height: 2.4em; }
.store-item .row-bottom {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-top: auto;
}


/* =========================================================
   MEMBERSHIP
   ========================================================= */

.tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(262px, 100%), 1fr));
  gap: 18px;
  margin-top: 22px;
  align-items: stretch;
}
.tier-card {
  position: relative;
  padding: 28px 24px;
  display: flex; flex-direction: column; gap: 12px;
  overflow: hidden;
}
.tier-card .tier-name { font-size: 2.3rem; margin: 0; line-height: 1; }
.tier-card .tier-tagline { color: var(--chalk-dim); font-size: 0.94rem; margin: 0; }
.tier-card .tier-price {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--chalk);
  margin: 4px 0 0;
  line-height: 1;
}
.tier-card .tier-price small {
  display: block;
  margin-top: 6px;
  font-family: var(--font-stamp);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--chalk-dim);
}
.tier-card ul {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex; flex-direction: column; gap: 9px;
  border-top: var(--rule);
  padding-top: 16px;
}
.tier-card ul li {
  position: relative;
  padding-left: 26px;
  font-size: 0.93rem;
  color: var(--chalk-soft);
}
.tier-card ul li::before {
  content: "";
  position: absolute; left: 0; top: 7px;
  width: 11px; height: 6px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}
.tier-card ul li.muted-perk { color: var(--chalk-dim); opacity: 0.6; }
.tier-card ul li.muted-perk::before {
  border: none;
  width: 10px; height: 2px;
  top: 11px;
  background: var(--chalk-dim);
  transform: none;
}
.tier-card .tier-cta { margin-top: auto; padding-top: 6px; }
.tier-card .tier-cta .btn { width: 100%; }

.tier-card.featured {
  border-color: rgba(217,122,61,0.6);
  background:
    linear-gradient(165deg, rgba(217,122,61,0.2), rgba(0,0,0,0.32)),
    rgba(10,22,15,0.4);
  box-shadow: var(--lift-2), 0 0 40px -18px rgba(217,122,61,0.7);
}
.tier-card .ribbon {
  position: absolute;
  top: 15px; right: -36px;
  padding: 3px 42px;
  transform: rotate(38deg);
  background: var(--accent);
  color: var(--board-ink);
  font-family: var(--font-stamp);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(0,0,0,0.55);
}
.tier-card .tier-name .badge-inline {
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
  font-family: var(--font-stamp);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--chalk-dim);
  border: var(--rule-strong);
  border-radius: 999px;
  padding: 2px 9px;
}
.btn.current-tier {
  background: rgba(217,122,61,0.14);
  border: 1px solid var(--accent);
  color: var(--accent-soft);
  box-shadow: none;
  cursor: default;
  pointer-events: none;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(278px, 100%), 1fr));
  gap: 16px;
  margin-top: 20px;
}
.faq-grid .chalk-card h3 { font-size: 1.3rem; margin: 0 0 6px; color: var(--accent-soft); }
.faq-grid p { margin: 0; font-size: 0.93rem; }


/* =========================================================
   AVATAR CUSTOMIZER
   ========================================================= */

.avatar-layout {
  display: grid;
  grid-template-columns: 288px 1fr 288px;
  gap: 18px;
  margin-top: 22px;
  align-items: start;
}
.avatar-col { padding: 18px; }
.avatar-col h3 { font-size: 1.4rem; margin: 0 0 12px; }
.country-search { margin-bottom: 10px; }
.country-tabs { margin-bottom: 12px; }

.country-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  max-height: 540px;
  overflow-y: auto;
  padding: 2px 6px 2px 2px;
}
.country-chip {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 6px 8px;
  min-height: 94px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: rgba(0,0,0,0.24);
  cursor: pointer;
  transition: transform .15s var(--ease), border-color .15s, background .15s;
}
.country-chip:hover {
  background: rgba(244,241,230,0.07);
  border-color: rgba(244,241,230,0.25);
  transform: translateY(-2px);
}
.country-chip.active {
  border-color: var(--accent);
  background: rgba(217,122,61,0.18);
  box-shadow: 0 0 0 1px var(--accent);
}
.country-chip.locked {
  border: var(--sketch);
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.6);
}
.country-chip.locked:hover { transform: none; background: rgba(0,0,0,0.24); }
.country-chip svg { flex: 0 0 auto; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.55)); }
.country-chip .name {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  text-align: center;
  line-height: 1.2;
  text-shadow: 0 1px 3px rgba(0,0,0,0.95);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 100%;
  word-break: break-word;
}
.country-grid::-webkit-scrollbar { width: 6px; }
.country-grid::-webkit-scrollbar-thumb { background: rgba(244,241,230,0.2); border-radius: 6px; }

.avatar-preview { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.avatar-preview .country-name { font-size: 2rem; margin: 0; }
.avatar-stage { width: min(340px, 74vw); aspect-ratio: 1; position: relative; }
.avatar-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.acc-section { margin-bottom: 16px; }
.acc-section h4 {
  font-family: var(--font-stamp);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--chalk-dim);
  margin: 0 0 7px;
}
.acc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.acc-tile {
  position: relative;
  aspect-ratio: 1;
  border: var(--rule);
  border-radius: var(--r-sm);
  background: rgba(0,0,0,0.26);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform .15s var(--ease), border-color .15s, background .15s;
}
.acc-tile:hover { transform: translateY(-2px); background: rgba(244,241,230,0.07); }
.acc-tile.active { border-color: var(--accent); background: rgba(217,122,61,0.18); }
.acc-tile.locked {
  border: var(--sketch);
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.6);
}
.acc-tile.locked:hover { transform: none; background: rgba(0,0,0,0.26); }
.acc-tile .acc-lock {
  position: absolute; right: 4px; top: 4px;
  width: 12px; height: 12px;
  color: var(--chalk-dim);
  filter: none;
}
.acc-tile .acc-lock svg { width: 12px; height: 12px; display: block; }
.acc-tile svg { width: 58%; height: 58%; }
.acc-tile .none-x { font-family: var(--font-stamp); font-size: 0.7rem; color: var(--chalk-dim); }

.coming-soon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(132px, 100%), 1fr));
  gap: 10px;
  margin-top: 14px;
}
.coming-soon-tile {
  aspect-ratio: 1 / 1.12;
  border-radius: var(--r-sm);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 7px;
  text-align: center;
  padding: 10px 6px;
}
.coming-soon-tile .silhouette {
  width: 50px; height: 50px;
  border-radius: 50%;
  border: var(--sketch);
  background: rgba(244,241,230,0.05);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--chalk-ghost);
}
.coming-soon-tile .cs-label { font-size: 0.82rem; color: var(--chalk-soft); line-height: 1.2; }
.coming-soon-tile .cs-eta { font-size: 0.6rem; color: var(--accent-soft); }

@media (max-width: 1000px) {
  .avatar-layout { grid-template-columns: 1fr; }
  .avatar-stage { width: min(270px, 68vw); }
  .country-grid { grid-template-columns: repeat(auto-fill, minmax(min(108px, 100%), 1fr)); max-height: 340px; }
}


/* =========================================================
   SETTINGS
   ========================================================= */

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(288px, 100%), 1fr));
  gap: 18px;
  margin-top: 22px;
}
.settings-card h3 { font-size: 1.45rem; margin: 0 0 4px; }
.settings-row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 0;
  border-top: var(--rule);
}
.settings-row:first-of-type { border-top: none; }
.settings-row .label { flex: 1; min-width: 0; }
.settings-row .label .key { display: block; font-size: 0.97rem; color: var(--chalk); font-weight: 600; }
.settings-row .label .desc { display: block; font-size: 0.85rem; color: var(--chalk-dim); }
.settings-row select, .settings-row input[type="text"] {
  width: auto;
  min-width: 150px;
  padding: 8px 12px;
  font-size: 0.9rem;
}


/* =========================================================
   TERMS
   ========================================================= */

.tos-doc { max-width: 840px; margin: 26px auto 0; padding: 34px clamp(22px, 4vw, 44px); }
.tos-doc h1 { font-size: clamp(2.1rem, 4vw, 3rem); }
.tos-doc h2 {
  margin-top: 34px;
  font-size: 1.7rem;
  padding-top: 14px;
  border-top: var(--rule);
}
.tos-doc h3 {
  margin-top: 20px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.01em;
  color: var(--accent-soft);
  text-shadow: none;
}
.tos-doc p, .tos-doc li { max-width: 74ch; font-size: 0.96rem; }
.tos-doc ul { padding-left: 20px; }
.tos-doc ul li { margin-bottom: 6px; }
.tos-doc .placeholder { font-style: italic; color: var(--chalk-dim); }

.tos-doc .tos-meta {
  display: flex; flex-wrap: wrap; gap: 4px 22px;
  margin: 0 0 8px;
  font-family: var(--font-stamp);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--chalk-dim);
}

.tos-toc { margin-top: 22px; padding: 18px 22px; }
.tos-toc h2 { margin: 0 0 10px; font-size: 1.35rem; border-top: none; padding-top: 0; }
.tos-toc ol { columns: 2; column-gap: 30px; padding-left: 20px; margin: 0; }
.tos-toc li { margin-bottom: 5px; break-inside: avoid; font-size: 0.92rem; }
.tos-toc a { border-bottom-color: transparent; }
.tos-toc a:hover { border-bottom-color: var(--accent); }
@media (max-width: 620px) { .tos-toc ol { columns: 1; } }

.tos-doc .legal-note {
  margin-top: 28px;
  padding: 18px 22px;
  border: 1px solid rgba(217,122,61,0.5);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
  background: rgba(217,122,61,0.08);
}
.tos-doc .legal-note .legal-tag {
  display: block;
  font-family: var(--font-stamp);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-soft);
  margin-bottom: 6px;
}


/* =========================================================
   CHAT / FRIENDS / SEARCH
   ========================================================= */

.chat-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 18px;
  margin-top: 22px;
  align-items: start;
}
.chat-sidebar { padding: 15px 13px; position: sticky; top: 78px; }
.chat-room-list { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-direction: column; gap: 3px; }
.chat-room-btn {
  width: 100%;
  display: flex; align-items: center; gap: 9px;
  text-align: left;
  padding: 8px 11px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--chalk-dim);
  font-size: 0.92rem;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.chat-room-btn:hover { background: rgba(244,241,230,0.07); color: var(--chalk); }
.chat-room-btn.active {
  background: rgba(217,122,61,0.16);
  border-color: var(--accent);
  color: var(--chalk);
}
.chat-room-btn .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--chalk-dim);
  flex: 0 0 auto;
}
.chat-room-btn.active .dot { background: var(--accent); box-shadow: 0 0 7px var(--accent); }
.chat-new-dm { display: flex; gap: 6px; margin-top: 10px; }
.chat-new-dm input { flex: 1; min-width: 0; padding: 8px 11px; font-size: 0.88rem; }
.chat-new-dm button { padding: 6px 13px; }

.chat-main {
  display: flex; flex-direction: column;
  height: calc(100vh - 150px);
  min-height: 500px;
  padding: 15px;
}
.chat-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-bottom: 11px; margin-bottom: 10px;
  border-bottom: var(--rule);
}
.chat-header .chat-me { font-size: 0.85rem; color: var(--chalk-dim); }
.chat-messages {
  flex: 1; min-height: 0;
  overflow-y: auto;
  padding: 6px 4px;
  display: flex; flex-direction: column; gap: 10px;
}
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(244,241,230,0.2); border-radius: 6px; }
.chat-msg { display: flex; flex-direction: column; max-width: 76%; align-self: flex-start; }
.chat-msg.me { align-self: flex-end; align-items: flex-end; }
.chat-from {
  font-family: var(--font-stamp);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-soft);
  padding: 0 4px 3px;
}
.chat-bubble {
  padding: 9px 13px;
  border: var(--rule);
  border-radius: var(--r);
  background: rgba(244,241,230,0.07);
  color: var(--chalk);
  font-size: 0.95rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.chat-msg.me .chat-bubble {
  background: rgba(217,122,61,0.2);
  border-color: rgba(217,122,61,0.55);
}
.chat-time { font-size: 0.68rem; color: var(--chalk-dim); padding: 3px 5px 0; }
.chat-composer {
  display: flex; gap: 8px;
  padding-top: 11px; margin-top: 8px;
  border-top: var(--rule);
}
.chat-composer input { flex: 1; min-width: 0; }

/* Friend / search result rows */
.fr-panel { padding: 16px 18px; }
.fr-panel + .fr-panel { margin-top: 14px; }
.rname { font-weight: 600; color: var(--chalk); }

@media (max-width: 800px) {
  .chat-layout { grid-template-columns: 1fr; }
  .chat-sidebar { position: static; }
  .chat-main { height: auto; min-height: 420px; }
}


/* =========================================================
   OVERLAYS
   ========================================================= */

.loading-overlay {
  position: fixed; inset: 0;
  z-index: var(--z-overlay);
  background: rgba(7,17,11,0.95);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 22px;
  text-align: center;
}
.loading-overlay.show { display: flex; }
.loading-overlay .spinner {
  width: 58px; height: 58px;
  border: 3px solid rgba(244,241,230,0.16);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay h2 { font-size: 2rem; margin: 0; }
.loading-overlay p { font-family: var(--font-stamp); font-size: 0.76rem; letter-spacing: 0.06em; }

.lightbox {
  position: fixed; inset: 0;
  z-index: var(--z-overlay);
  background: rgba(7,17,11,0.95);
  backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-out;
  animation: fade-in .22s ease;
}
.lightbox img {
  max-width: 92vw; max-height: 88vh;
  border: var(--rule-strong);
  border-radius: var(--r);
  box-shadow: var(--lift-3);
}
.lightbox .close {
  position: absolute; top: 18px; right: 22px;
  width: 42px; height: 42px;
  display: inline-flex; align-items: center; justify-content: center;
  border: var(--rule-strong);
  border-radius: 50%;
  background: rgba(0,0,0,0.4);
  color: var(--chalk);
  font-size: 1.2rem;
  cursor: pointer;
}
.lightbox .close:hover { background: var(--chalk); color: var(--board-ink); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.toast {
  position: fixed; left: 50%; bottom: 30px;
  z-index: var(--z-toast);
  transform: translateX(-50%) translateY(8px);
  padding: 12px 20px;
  border: var(--rule-strong);
  border-radius: 10px;
  background: rgba(7,17,11,0.96);
  color: var(--chalk);
  font-size: 0.92rem;
  box-shadow: var(--lift-2);
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s ease, transform .24s var(--ease);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }



/* =========================================================
   MOTION
   ========================================================= */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .55s ease, transform .55s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }
.reveal.delay-1 { transition-delay: .06s; }
.reveal.delay-2 { transition-delay: .12s; }
.reveal.delay-3 { transition-delay: .18s; }
.reveal.delay-4 { transition-delay: .24s; }

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1040px) {
  .nav-tab { padding: 9px 10px; font-size: 0.9rem; }
  .nav-tab svg { display: none; }
}

@media (max-width: 900px) {
  .topbar-inner, .topbar .inner { padding: 8px 16px; gap: 10px; }
  .nav-toggle { display: block; order: 3; }
  .brand { order: 1; }
  .topbar-right { order: 2; margin-left: auto; }

  /* The drawer. It hangs off the sticky bar, so it travels with it, and it
     is capped to the space actually below the bar rather than a flat 78vh —
     a landscape phone has about 250px there, not 600. */
  .primary-nav {
    order: 4;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 12px 16px;
    background: linear-gradient(180deg, #0d1c13, #0a160f);
    border-bottom: var(--rule-strong);
    border-radius: 0 0 var(--r-lg) var(--r-lg);
    box-shadow: var(--lift-3);
    /* 100% here is the topbar's own height — .primary-nav is absolutely
       positioned inside it — so this is "whatever is left below the bar".
       dvh second, for the browsers that have it: on mobile Safari the URL bar
       makes vh larger than what you can actually see. */
    max-height: calc(100vh - 100% - 8px);
    max-height: calc(100dvh - 100% - 8px);
    overflow-y: auto;
    overscroll-behavior: contain;
    /* Slide, don't squash. Animating max-height concertinas every row on the
       way down; this moves the finished panel into place instead. */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    transition: opacity .2s ease, transform .3s var(--ease), visibility .3s;
  }
  .topbar.menu-open .primary-nav {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  /* Everything behind the drawer goes quiet. Sits under --z-nav so the bar
     and the drawer stay above it, and taps land on <body> — which is what
     nav.js already treats as "outside", so it closes. */
  body.nav-open::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(4,10,7,0.6);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: scrim-in .22s ease both;
  }

  .nav-tab {
    justify-content: flex-start;
    padding: 13px 14px;
    font-size: 1rem;
    border-left: 3px solid transparent;
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
  }
  .nav-tab svg { display: inline-flex; width: 18px; height: 18px; }
  /* The sliding dash is desktop-only, so the current page needs its own mark
     down here — the same accent rule the rest of the site uses for "you are
     on this one". */
  .nav-tab.active {
    border-left-color: var(--accent);
    background: rgba(217,122,61,0.1);
  }
  .nav-marker { display: none; }

  /* Dropdowns become inline accordions — but only inside the drawer. The
     account menu lives in .topbar-right and must stay a real dropdown;
     unscoped, this rule dropped it into the header row as a static block
     and pushed the whole bar 300px tall. */
  .primary-nav .nav-group { display: block; }
  .primary-nav .nav-group > .nav-tab { width: 100%; }
  .primary-nav .nav-menu {
    position: static;
    transform: none;
    min-width: 0;
    margin: 2px 0 6px 17px;
    box-shadow: none;
    /* Transparent while collapsed. With max-height:0 the box is still 2px of
       border, and a tinted background there drew a stray rule under Social
       that looked like a divider nobody asked for. */
    background: transparent;
    max-height: 0;
    padding: 0 7px;
    overflow: hidden;
    visibility: visible;
    opacity: 1;
    border-color: transparent;
    transition: max-height .3s var(--ease), padding .3s var(--ease), border-color .2s, background .2s;
  }
  .primary-nav .nav-group.open > .nav-menu {
    transform: none;
    max-height: 340px;
    padding: 7px;
    background: rgba(0,0,0,0.28);
    border-color: rgba(244,241,230,0.16);
  }
  .primary-nav .nav-menu::before { display: none; }

  /* Account menu: still a dropdown, just sized for a thumb and kept inside
     the screen on a narrow one. */
  .topbar-right .nav-menu {
    min-width: 0;
    width: max-content;
    max-width: calc(100vw - 24px);
    top: calc(100% + 12px);
  }
  .topbar-right .nav-menu a,
  .topbar-right .nav-menu button { padding: 13px 12px; }

  .user-block .name { max-width: 88px; }
  .coin-chip .soon { display: none; }

  /* Thumb-sized. 38x34 is a mouse target. */
  .nav-toggle { width: 44px; height: 44px; }
  .nav-toggle span, .nav-toggle::before, .nav-toggle::after { left: 12px; right: 12px; }
  .nav-toggle::before { top: 15px; }
  .nav-toggle span    { top: 21px; }
  .nav-toggle::after  { top: 27px; }
  .topbar.menu-open .nav-toggle::before { transform: translateY(6px) rotate(45deg); }
  .topbar.menu-open .nav-toggle::after  { transform: translateY(-6px) rotate(-45deg); }
  .user-chip { min-height: 40px; }
}

@keyframes scrim-in { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 620px) {
  body { font-size: 16px; }
  .brand-name { font-size: 1.3rem; }
  .brand-mark, .topbar .brand img { width: 30px; height: 30px; }
  .coin-chip { padding: 4px 9px; font-size: 0.72rem; }
  .user-chip { padding: 3px 8px 3px 4px; }
  .user-block .name { max-width: 70px; font-size: 0.8rem; }
  .site-footer .footer-inner { flex-direction: column; align-items: flex-start; }
  .site-footer .footer-meta { margin-left: 0; }

  /* Label and control side by side leaves the label about 100px, so "See what
     each membership unlocks" ran to three lines against a 150px select.
     Stack them and both get the full width. */
  .settings-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .settings-row select,
  .settings-row input[type="text"] { width: 100%; min-width: 0; }
  .settings-row > .btn, .settings-row > a.btn { align-self: flex-start; }
}

/* Four things competed for a 375px header: mark, coin balance, player chip,
   hamburger. The coin balance is a 0 for a store that hasn't opened, so it
   is the one that goes — which buys back enough room to keep the wordmark. */
@media (max-width: 560px) {
  .coin-chip { display: none; }
  .topbar-inner, .topbar .inner { padding: 8px 12px; gap: 8px; }
}

@media (max-width: 360px) {
  .brand-text { display: none; }
}


/* =========================================================
   TOUCH
   Everything in here is gated on (hover: none), so a desktop
   with a mouse never sees any of it.
   ========================================================= */

@media (hover: none) {
  /* The grey flash Safari and Chrome paint over any tapped control. It fires
     on cards and nav rows too, which on a dark board looks like a rendering
     fault rather than feedback — the :active states below do the job. */
  a, button, .thumb, .chalk-card, .country-chip, .acc-tile,
  .nav-tab, .user-chip, .coin-chip, .checkbox {
    -webkit-tap-highlight-color: transparent;
  }

  /* :hover latches on after a tap and stays until you tap something else, so
     every card you touched keeps hovering. Hand the feedback to :active,
     which releases with your finger. */
  a.chalk-card:hover,
  button.chalk-card:hover,
  .mode-card:not(.disabled):hover,
  .about-grid .chalk-card:hover,
  .faq-grid .chalk-card:hover,
  .update-entry:hover,
  .country-chip:hover,
  .acc-tile:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--line, rgba(244,241,230,0.13));
  }
  a.chalk-card:active,
  button.chalk-card:active,
  .mode-card:not(.disabled):active,
  .country-chip:active,
  .acc-tile:active {
    transform: scale(0.985);
    background: rgba(244,241,230,0.07);
    transition-duration: .08s;
  }
  .country-chip.active:hover, .acc-tile.active:hover { border-color: var(--accent); }
  .nav-menu a:hover, .nav-menu button:hover { transform: none; }
  .btn:hover:not(:disabled):not([aria-disabled="true"]) { transform: none; }
  .btn:active:not(:disabled) { transform: translateY(1px) scale(0.99); }

  /* iOS zooms the whole page when you focus an input under 16px, then leaves
     you scrolled sideways. 0.98rem is 15.7px, which is just under the line. */
  .field input, .field select,
  .country-search, .settings-row select, .settings-row input[type="text"],
  .chat-new-dm input, .chat-composer input, .text-input {
    font-size: 16px;
  }

  /* Controls a finger has to hit. */
  .auth-tabs button, .country-tabs button, .tier-switch button { min-height: 46px; }
  .field input, .field select, .settings-row select,
  .settings-row input[type="text"], .country-search, .text-input { min-height: 46px; }
  .checkbox { padding: 6px 0; }
  .site-footer .footer-links { gap: 8px 22px; }
  .site-footer .footer-links a { padding: 6px 0; }

  /* Standalone controls that happen to be 20px-tall text links. Vertical
     padding on an inline element grows the hit box without moving the line,
     so nothing shifts — which is why this is safe here and not on links
     sitting inside a paragraph, where the boxes would overlap. */
  .section-title .see-all,
  .avatar-actions a { padding: 11px 4px; margin: -11px -4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .section-title.reveal::after { --rule-scale: 1; }
}
