/* ============================================================
   WILD WEST GAMES — shared shell styles (V3, 2026-11-14)
   Built on wwg-tokens.css + wwg-ui.css (lobby.js injects both when a page hasn't linked them).
   Light first; dark follows the OS or data-theme. No navy, gold, Georgia or gradients.

   Page classes on <html> (set by lobby.js):
     wwg-shell      a game page (initLobby ran)
     wwg-hub        the home page: only the pane / sheets / toast apply, never page-wide rules
     wwg-legacy     the page didn't link wwg-ui.css itself (pre-V3 game): pinned dark,
                    #wwgGame stays hidden until play starts (V2 behaviour)
     wwg-ingame     #wwgGame.active — the game bar replaces the app bar + bottom bar
     wwg-pane-open  the Friends / Chat pane is open
     wwg-self       initLobby({mobileSelf:true}) — no bottom bar
     wwg-phone wwg-port wwg-land wwg-fullscreen wwg-rotate wwg-flow   phone engine (unchanged)
     wwg-fs         the browser's real full screen (Fullscreen API) is on
     wwg-standalone launched from the home screen (installed app)
   ============================================================ */

/* ---- V2 variable names, now mapped to tokens (pre-V3 games use these) ---------------- */
:root {
  --bg: var(--ag-bg);
  --bg-dark: var(--ag-chrome);
  --gold: var(--ag-accent);
  --gold-light: var(--ag-ink);
  --gold-dark: var(--ag-border-strong);
  --sky: var(--ag-accent);
  --green: var(--ag-success);
  --red: var(--ag-danger);
  --text: var(--ag-ink);
  --dim: var(--ag-muted);
  --surface: var(--ag-hover);
  --border: var(--ag-border);
  --font: var(--ag-font);
  --font-display: var(--ag-font-display);
  --wwg-gb-h: var(--ag-gamebar-h, 44px);
  --wwg-safe-t: env(safe-area-inset-top, 0px);
  --wwg-safe-b: env(safe-area-inset-bottom, 0px);
}
@media (orientation: landscape) and (max-height: 419.98px) {
  :root { --wwg-gb-h: 32px; }
}

/* ---- page-wide rules: game pages only (never the home page) -------------------------- */
:where(html:not(.wwg-hub)) * { margin: 0; padding: 0; box-sizing: border-box; }
:where(html:not(.wwg-hub)) body {
  font-family: var(--ag-font);
  background: var(--ag-bg);
  color: var(--ag-ink);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* shell elements: box model + truly hidden [hidden] */
.wwg-ui, .wwg-ui * { box-sizing: border-box; }
.wwg-ui[hidden], .wwg-ui [hidden] { display: none !important; }

/* ============================================================
   APP BAR (not playing)
   ============================================================ */
.wwg-appbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 600;
  height: calc(var(--ag-appbar-h) + var(--wwg-safe-t));
  padding: var(--wwg-safe-t) max(var(--ag-s-2), env(safe-area-inset-right, 0px)) 0 max(var(--ag-s-3), env(safe-area-inset-left, 0px));
  display: flex; align-items: center; gap: var(--ag-s-1);
  background: var(--ag-surface); color: var(--ag-ink);
  border-bottom: 1px solid var(--ag-border);
  font-family: var(--ag-font);
}
.wwg-brand {
  display: inline-flex; align-items: center; gap: 10px; min-height: var(--ag-touch); min-width: 0;
  color: var(--ag-ink); text-decoration: none;
  font-family: var(--ag-font-display); font-weight: 800; font-size: var(--ag-text-base); letter-spacing: -.01em; white-space: nowrap;
}
.wwg-brand img { width: 32px; height: 32px; flex: none; display: block; }
.wwg-brand__name { overflow: hidden; text-overflow: ellipsis; }
.wwg-appbar__spacer { flex: 1 1 auto; }
.wwg-appbar .ag-icon-btn { position: relative; }
.wwg-appbar__auth { display: flex; align-items: center; }
.wwg-wide { display: none !important; }
@media (min-width: 768px) {
  .wwg-wide { display: inline-grid !important; }
  .wwg-wide[hidden] { display: none !important; }
}
.wwg-avatar {
  display: inline-grid; place-items: center; flex: none;
  width: var(--ag-ctl-h); height: var(--ag-ctl-h); margin-left: var(--ag-s-1); padding: 0;
  border-radius: 50%; border: 1px solid var(--ag-border); background: var(--ag-chrome);
  font-size: 20px; line-height: 1; cursor: pointer; color: var(--ag-ink);
}
.wwg-avatar:hover { border-color: var(--ag-border-strong); }
@media (max-width: 767.98px) { .wwg-avatar { width: var(--ag-touch); height: var(--ag-touch); } }
.wwg-avatar:focus-visible, .wwg-tab:focus-visible, .wwg-menu__item:focus-visible, .wwg-link:focus-visible,
.wwg-listrow--btn:focus-visible, .wwg-listrow--link:focus-visible, .wwg-emoji__btn:focus-visible, .wwg-brand:focus-visible {
  outline: 2px solid var(--ag-focus); outline-offset: 2px;
}
.wwg-avatar--lg { width: 48px; height: 48px; font-size: 26px; margin: 0; cursor: default; }

/* notification badge (on icon buttons and tabs) */
.wwg-badge {
  position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: var(--ag-r-pill); background: var(--ag-danger); color: var(--ag-on-accent);
  font: 700 10px/16px var(--ag-font); text-align: center; pointer-events: none;
}

/* ============================================================
   BOTTOM BAR (phones, not playing)
   ============================================================ */
.wwg-bottombar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 600;
  height: calc(var(--ag-bottombar-h) + var(--wwg-safe-b)); padding-bottom: var(--wwg-safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--ag-surface); border-top: 1px solid var(--ag-border);
  font-family: var(--ag-font);
}
.wwg-bottombar--3 { grid-template-columns: repeat(3, 1fr); }
.wwg-bottombar--4 { grid-template-columns: repeat(4, 1fr); }   /* the new Android app: chat is native */
.wwg-tab {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: var(--ag-bottombar-h); padding: 0; margin: 0; border: 0; background: transparent;
  color: var(--ag-muted); text-decoration: none; cursor: pointer;
  font-family: var(--ag-font); font-size: var(--ag-text-xs); font-weight: 600;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.wwg-tab svg { width: 22px; height: 22px; }
.wwg-tab:hover { color: var(--ag-ink); }
.wwg-tab[aria-current] { color: var(--ag-accent-ink); }
.wwg-tab .wwg-badge { top: 5px; right: auto; left: calc(50% + 4px); }
@media (min-width: 768px) { .wwg-bottombar { display: none; } }
html.wwg-self .wwg-bottombar { display: none; }

/* ============================================================
   GAME BAR (playing, every width)
   ============================================================ */
.wwg-gamebar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 600;
  height: calc(var(--wwg-gb-h) + var(--wwg-safe-t));
  padding: var(--wwg-safe-t) max(var(--ag-s-1), env(safe-area-inset-right, 0px)) 0 max(var(--ag-s-1), env(safe-area-inset-left, 0px));
  display: none; align-items: center; gap: var(--ag-s-2);
  background: var(--ag-surface); color: var(--ag-ink); border-bottom: 1px solid var(--ag-border);
  font-family: var(--ag-font);
}
html.wwg-ingame .wwg-gamebar { display: flex; }
html.wwg-ingame .wwg-appbar, html.wwg-ingame .wwg-bottombar { display: none; }
.wwg-gamebar .wwg-gamebar__btn { width: var(--ag-touch); height: var(--ag-touch); }
.wwg-gamebar__name {
  flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--ag-font-display); font-weight: 700; font-size: var(--ag-text-base);
}
.wwg-turn {
  display: block; flex: 0 1 auto; min-width: 0; max-width: 40%;
  line-height: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wwg-turn:empty { display: none; }
/* Full-screen toggle (lobby.js shows it where the Fullscreen API works). An installed, home-screen
   launch is already full screen, so it never shows there. */
html.wwg-standalone .wwg-gamebar__fs { display: none; }
/* The icon itself shows the state (expand / collapse), so "on" keeps the bar's quiet look. */
.wwg-gamebar .wwg-gamebar__fs[aria-pressed="true"]:not(:hover):not(:active) { background: transparent; color: var(--ag-ink-2); }
/* phone landscape, short screens: a slim translucent strip */
@media (orientation: landscape) and (max-height: 419.98px) {
  .wwg-gamebar {
    background: color-mix(in srgb, var(--ag-surface) 80%, transparent);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); gap: var(--ag-s-1);
  }
  /* The strip stays 32px tall; each button keeps a 44 x 44 hit area that overhangs the strip. */
  .wwg-gamebar .wwg-gamebar__btn { position: relative; width: var(--ag-touch); height: 32px; overflow: visible; }
  .wwg-gamebar .wwg-gamebar__btn::before {
    content: ''; position: absolute; left: 0; right: 0; top: 50%; height: var(--ag-touch); transform: translateY(-50%);
  }
  .wwg-gamebar__name { font-size: var(--ag-text-md); }
  .wwg-turn { height: 22px; line-height: 20px; }
}

/* ============================================================
   GAME AREA
   ============================================================ */
#wwgGame {
  display: flex; flex-direction: column; align-items: center;
  width: 100%; min-height: 100vh; min-height: 100dvh;
  padding-top: calc(var(--ag-appbar-h) + var(--wwg-safe-t));
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  padding-bottom: var(--wwg-safe-b);
}
html.wwg-ingame #wwgGame { padding-top: calc(var(--wwg-gb-h) + var(--wwg-safe-t)); }
@media (max-width: 767.98px) {
  html:not(.wwg-ingame):not(.wwg-self) #wwgGame { padding-bottom: calc(var(--ag-bottombar-h) + var(--wwg-safe-b)); }
}
/* Pre-V3 games: the game area stays hidden until play starts (some keep fixed layers inside it). */
html.wwg-legacy #wwgGame:not(.active) { display: none; }
html.wwg-hub #wwgGame { display: none; }

.game-body {
  flex: 1; padding: 18px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; width: 100%;
}
@media (min-width: 600px) {
  .game-body { padding: 14px 12px; justify-content: flex-start; }
}
@media (max-width: 430px) {
  .game-body { padding: 12px 10px; }
}
:where(#wwgGame) canvas { max-width: 100%; touch-action: none; }
html.wwg-legacy canvas { border-radius: 12px; }

/* ============================================================
   SHEETS (start, waiting, menu, auth). Built on .ag-sheet from wwg-ui.css.
   ============================================================ */
.wwg-sheet { z-index: 950; }
.wwg-sheet .ag-sheet__panel { display: flex; flex-direction: column; gap: var(--ag-s-3); overflow-y: auto; overscroll-behavior: contain; }
.wwg-sheet .ag-sheet__panel > * { flex-shrink: 0; }
.wwg-sheet .ag-sheet__handle { margin: 0 auto var(--ag-s-1); flex: none; }
.wwg-sheet .ag-sheet__title { margin: 0; }
.wwg-sheet .ag-sheet__body { margin: 0; line-height: 1.45; }
.wwg-sheet .ag-sheet__actions { margin-top: var(--ag-s-1); }
.wwg-sheet--auth { z-index: 960; }

/* Start + waiting sheets sit under the app bar and above the bottom bar, so both stay usable. */
.wwg-sheet.wwg-start { z-index: 580; top: calc(var(--ag-appbar-h) + var(--wwg-safe-t)); }
.wwg-start .ag-sheet__panel { max-height: 100%; }
@media (max-width: 767.98px) {
  .wwg-sheet.wwg-start { bottom: calc(var(--ag-bottombar-h) + var(--wwg-safe-b)); }
  html.wwg-self .wwg-sheet.wwg-start { bottom: 0; }
  .wwg-start .ag-sheet__panel { max-height: min(70vh, 100%); max-height: min(70dvh, 100%); padding-bottom: var(--ag-s-4); }
}
@media (min-width: 768px) {
  .wwg-start .ag-sheet__panel { max-height: calc(100% - 8px); }
}
@media (min-width: 1200px) {
  html.wwg-pane-open .wwg-sheet.wwg-start { right: 360px; }
}
.wwg-start__head { display: flex; align-items: center; gap: var(--ag-s-3); }
.wwg-start__art {
  width: 64px; height: 64px; flex: none; object-fit: cover; border-radius: var(--ag-r-lg);
  background: var(--ag-chrome); border: 1px solid var(--ag-border);
}
.wwg-start__titles { min-width: 0; }
.wwg-start__title {
  margin: 0; font-family: var(--ag-font-display); font-size: var(--ag-text-lg); font-weight: 800;
  letter-spacing: -.01em; color: var(--ag-ink); line-height: 1.2;
}
.wwg-start__sub { margin: 2px 0 0; font-size: var(--ag-text-sm); color: var(--ag-muted); }
.wwg-start__row { display: flex; flex-direction: column; gap: 6px; }
#wwgStartOptions { display: flex; flex-direction: column; gap: var(--ag-s-3); }
#wwgStartOptions:empty { display: none; }
.wwg-start__note { margin: 0; font-size: var(--ag-text-sm); line-height: 1.45; color: var(--ag-muted); }
.wwg-start__note:empty { display: none; }
.wwg-start__join { display: flex; flex-direction: column; gap: 6px; padding-top: var(--ag-s-3); border-top: 1px solid var(--ag-border); }
.wwg-start__howto { align-self: center; }

/* Start + waiting sheet layout: the panel is a column of a scrolling body over a footer that holds
   the primary action, so Start is on screen at first paint however many option rows a game adds.
   The panel itself never scrolls; only .wwg-start__body does. */
.wwg-sheet .ag-sheet__panel.wwg-start__panel {
  display: flex; flex-direction: column; gap: 0; padding: 0; overflow: hidden;
}
.wwg-start__panel > .wwg-start__body {
  flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; gap: var(--ag-s-3);
  padding: var(--ag-s-2) var(--ag-s-4) var(--ag-s-3);
}
.wwg-start__body > * { flex-shrink: 0; }
.wwg-start__panel > .wwg-start__foot {
  flex: none; display: flex; flex-direction: column; gap: var(--ag-s-2);
  padding: var(--ag-s-3) var(--ag-s-4) calc(var(--ag-s-3) + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--ag-border); background: var(--ag-surface);
}
/* Waiting sheet: no footer strip while a guest has no Start game button. */
.wwg-start__panel > .wwg-start__foot:not(:has(> :not([hidden]):not(:empty))) { display: none; }
@media (min-width: 768px) {
  .wwg-start__panel > .wwg-start__body { padding: var(--ag-s-5) var(--ag-s-5) var(--ag-s-4); }
  .wwg-start__panel > .wwg-start__foot { padding: var(--ag-s-4) var(--ag-s-5) var(--ag-s-5); }
}
@media (max-height: 500px) and (orientation: landscape) {
  .wwg-start__art { width: 40px; height: 40px; border-radius: var(--ag-r); }
  .wwg-sheet .ag-sheet__panel { gap: var(--ag-s-2); }
  .wwg-sheet.wwg-start { padding: var(--ag-s-2) var(--ag-s-5); }
  .wwg-start .ag-sheet__panel { max-height: 100%; }
  .wwg-start__panel > .wwg-start__body { gap: var(--ag-s-2); padding: var(--ag-s-3) var(--ag-s-4) var(--ag-s-2); }
  .wwg-start__panel > .wwg-start__foot { padding: var(--ag-s-2) var(--ag-s-4) calc(var(--ag-s-2) + env(safe-area-inset-bottom, 0px)); }
}

/* code display + copy/share */
.wwg-codebox {
  display: flex; justify-content: center; padding: var(--ag-s-3);
  border-radius: var(--ag-r-lg); background: var(--ag-surface-alt); border: 1px solid var(--ag-border);
}
.wwg-code {
  font-family: var(--ag-font-display); font-weight: 800; font-size: var(--ag-text-2xl); line-height: 1.1;
  letter-spacing: .22em; padding-left: .22em; color: var(--ag-ink); font-variant-numeric: tabular-nums;
}
.wwg-seats { list-style: none; }
.wwg-chip--open { background: transparent; border-style: dashed; color: var(--ag-muted); }
.wwg-invites { display: flex; flex-direction: column; gap: 2px; }
.wwg-invites:empty { display: none; }

/* rows, inputs, small text */
.wwg-row { display: flex; flex-wrap: nowrap; align-items: center; gap: var(--ag-s-2); }
.wwg-row > .wwg-input { flex: 1 1 auto; }
.wwg-row--2 > * { flex: 1 1 0; min-width: 0; }
.wwg-field { display: flex; flex-direction: column; gap: 6px; }
.wwg-input {
  width: 100%; min-width: 0; height: var(--ag-touch); padding: 0 var(--ag-s-3); margin: 0;
  border: 1px solid var(--ag-border-strong); border-radius: var(--ag-r); background: var(--ag-surface); color: var(--ag-ink);
  font-family: var(--ag-font); font-size: 16px;
}
.wwg-input::placeholder { color: var(--ag-muted); opacity: 1; }
.wwg-input:focus { outline: 2px solid var(--ag-focus); outline-offset: -1px; border-color: transparent; }
.wwg-input--code { text-transform: uppercase; text-align: center; letter-spacing: .2em; font-weight: 700; }
.wwg-input--code::placeholder { letter-spacing: .2em; font-weight: 500; }
.wwg-input--area { height: 104px; padding: 10px var(--ag-s-3); resize: none; line-height: 1.4; }
.wwg-err { margin: 0; font-size: var(--ag-text-sm); font-weight: 600; color: var(--ag-danger-ink); }
.wwg-err:empty { display: none; }
.wwg-note { margin: 0; font-size: var(--ag-text-sm); color: var(--ag-muted); line-height: 1.45; }
.wwg-note:empty { display: none; }
.wwg-note--ok { color: var(--ag-success-ink); font-weight: 600; }
.wwg-note--warn { padding: var(--ag-s-3); border-radius: var(--ag-r); background: var(--ag-warning-bg); color: var(--ag-warning-ink); font-weight: 600; }
.wwg-empty { margin: 0; padding: 4px 0; font-size: var(--ag-text-sm); color: var(--ag-muted); }
.wwg-link {
  display: inline-flex; align-items: center; justify-content: center; min-height: var(--ag-touch);
  padding: 0 var(--ag-s-1); margin: 0; border: 0; background: none; cursor: pointer;
  font-family: var(--ag-font); font-size: var(--ag-text-md); font-weight: 600; color: var(--ag-accent-ink); text-decoration: none;
}
.wwg-link:hover { text-decoration: underline; }
@media (min-width: 768px) and (pointer: fine) { html:not(.wwg-phone) .wwg-link { min-height: var(--ag-ctl-h); } }

/* menu sheet rows */
.wwg-menu { display: flex; flex-direction: column; }
.wwg-menu__item {
  display: flex; align-items: center; gap: var(--ag-s-3); width: 100%; min-height: 48px;
  padding: 0 var(--ag-s-3); margin: 0; border: 0; border-radius: var(--ag-r); background: transparent;
  color: var(--ag-ink); text-align: left; cursor: pointer;
  font-family: var(--ag-font); font-size: var(--ag-text-base); font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}
.wwg-menu__item svg { width: 20px; height: 20px; flex: none; color: var(--ag-muted); }
.wwg-menu__item:hover { background: var(--ag-hover); }
.wwg-menu__item:active { background: var(--ag-press); }
.wwg-menu__label { display: flex; flex-direction: column; min-width: 0; }
.wwg-menu__label small { font-size: var(--ag-text-sm); font-weight: 500; color: var(--ag-muted); letter-spacing: .08em; }
.wwg-menu__theme {
  display: flex; align-items: center; justify-content: space-between; gap: var(--ag-s-3);
  padding: var(--ag-s-3) var(--ag-s-3) 0; border-top: 1px solid var(--ag-border);
}
.wwg-menu__themelabel { font-size: var(--ag-text-md); font-weight: 600; color: var(--ag-ink-2); }
.wwg-theme-seg { --ag-seg-w: 68px; }
.wwg-account { display: flex; align-items: center; gap: var(--ag-s-3); padding: 0 var(--ag-s-1) var(--ag-s-2); }
.wwg-account strong { display: block; font-family: var(--ag-font-display); font-size: var(--ag-text-lg); font-weight: 800; }
.wwg-account small { display: block; font-size: var(--ag-text-sm); color: var(--ag-muted); }
.wwg-howto { font-size: var(--ag-text-md); line-height: 1.55; color: var(--ag-ink-2); }
.wwg-howto p, .wwg-howto ul, .wwg-howto ol { margin: 0 0 var(--ag-s-2); }
.wwg-howto ul, .wwg-howto ol { padding-left: 1.25em; }
.wwg-howto h3 { margin: var(--ag-s-3) 0 var(--ag-s-1); font-family: var(--ag-font-display); font-size: var(--ag-text-base); color: var(--ag-ink); }

/* auth sheet */
.wwg-sheet__x { position: absolute; top: var(--ag-s-2); right: var(--ag-s-2); }
.wwg-auth__title { margin: 0; padding-right: 44px; font-family: var(--ag-font-display); font-size: var(--ag-text-xl); font-weight: 800; letter-spacing: -.01em; color: var(--ag-ink); }
.wwg-auth__lead { margin: -4px 0 0; font-size: var(--ag-text-md); color: var(--ag-muted); line-height: 1.45; }
.wwg-auth { display: flex; flex-direction: column; gap: var(--ag-s-3); }
.wwg-auth > div { display: flex; flex-direction: column; gap: var(--ag-s-3); }
.wwg-auth #wwgForgotPw { align-self: center; }
.wwg-auth__toggle { margin: 0; text-align: center; font-size: var(--ag-text-md); color: var(--ag-muted); }
.wwg-auth__toggle .wwg-link { padding: 0 2px; }
.wwg-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.wwg-radios { display: flex; flex-direction: column; }
.wwg-radio { display: flex; align-items: center; gap: 10px; min-height: var(--ag-touch); font-size: var(--ag-text-md); color: var(--ag-ink); cursor: pointer; }
.wwg-radio input { width: 18px; height: 18px; accent-color: var(--ag-accent); margin: 0; }
.wwg-emoji { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 4px; }
.wwg-emoji__btn, .wwg-emoji__more {
  height: var(--ag-touch); min-width: 0; padding: 0; margin: 0; border-radius: var(--ag-r);
  border: 2px solid transparent; background: var(--ag-chrome); color: var(--ag-ink); cursor: pointer;
  font-size: 22px; line-height: 1;
}
.wwg-emoji__more { font-family: var(--ag-font); font-size: var(--ag-text-xs); font-weight: 700; color: var(--ag-ink-2); }
.wwg-emoji__btn[aria-pressed="true"] { border-color: var(--ag-accent); background: var(--ag-accent-bg); }
@media (max-width: 380px) { .wwg-emoji__btn { font-size: 18px; } }

/* ============================================================
   RIGHT PANE — Friends (party lobby) + Chat
   One pane, 360px, under the app bar. Overlay with scrim below 1200px, docked from 1200px,
   full width under 768px (between the app bar and the bottom bar).
   ============================================================ */
.wwg-pane {
  position: fixed; top: calc(var(--ag-appbar-h) + var(--wwg-safe-t)); right: 0; bottom: 0; z-index: 650;
  width: 360px; max-width: 100%;
  display: flex; flex-direction: column;
  background: var(--ag-surface); color: var(--ag-ink); border-left: 1px solid var(--ag-border);
  box-shadow: var(--ag-shadow-lg); font-family: var(--ag-font);
  transform: translateX(100%); visibility: hidden;
  transition: transform .22s var(--ag-ease), visibility 0s linear .22s;
}
.wwg-pane.is-open { transform: none; visibility: visible; transition: transform .22s var(--ag-ease); }
.wwg-pane-scrim {
  position: fixed; inset: calc(var(--ag-appbar-h) + var(--wwg-safe-t)) 0 0 0; z-index: 640;
  background: var(--ag-scrim); opacity: 0; visibility: hidden; transition: opacity .2s var(--ag-ease), visibility 0s linear .2s;
}
html.wwg-pane-open .wwg-pane-scrim { opacity: 1; visibility: visible; transition: opacity .2s var(--ag-ease); }
@media (max-width: 767.98px) {
  .wwg-pane { width: 100%; border-left: 0; box-shadow: none; bottom: calc(var(--ag-bottombar-h) + var(--wwg-safe-b)); }
  html.wwg-self .wwg-pane { bottom: 0; }
  .wwg-pane-scrim { display: none; }
}
@media (min-width: 1200px) {
  .wwg-pane { box-shadow: none; }
  .wwg-pane-scrim { display: none; }
  html.wwg-pane-open:not(.wwg-ingame) body { padding-right: 360px; }
}
html.wwg-ingame .wwg-pane { top: calc(var(--wwg-gb-h) + var(--wwg-safe-t)); bottom: 0; }
@media (prefers-reduced-motion: reduce) { .wwg-pane, .wwg-pane-scrim { transition: none; } }

.wwg-pane__head {
  display: flex; align-items: center; gap: var(--ag-s-1); flex: none;
  height: 52px; padding: 0 var(--ag-s-2) 0 var(--ag-s-4); border-bottom: 1px solid var(--ag-border);
}
.wwg-pane__title { flex: 1; margin: 0; font-family: var(--ag-font-display); font-size: var(--ag-text-lg); font-weight: 800; }
.wwg-pane__view { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: var(--ag-s-4); display: flex; flex-direction: column; gap: var(--ag-s-5); }
.wwg-sec { display: flex; flex-direction: column; gap: 10px; }
.wwg-sec + .wwg-sec { padding-top: var(--ag-s-4); border-top: 1px solid var(--ag-border); }
.wwg-sec__title { margin: var(--ag-s-2) 0 0; font-family: var(--ag-font-display); font-size: var(--ag-text-base); font-weight: 700; color: var(--ag-ink); }
.wwg-sec__title:first-child { margin-top: 0; }
.wwg-sec__text { margin: 0; font-size: var(--ag-text-md); line-height: 1.45; color: var(--ag-muted); }
.wwg-sec__or { margin-top: var(--ag-s-2); }
.wwg-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.wwg-chips .ag-chip { height: 28px; }
.wwg-chip--btn { cursor: pointer; font-family: var(--ag-font); }
.wwg-chip--btn:hover { border-color: var(--ag-border-strong); }
@media (max-width: 767.98px) { .wwg-chips .wwg-chip--btn { height: var(--ag-touch); padding: 0 14px; } }
.wwg-dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ag-border-strong); }
.wwg-dot.is-on { background: var(--ag-success); }

.wwg-list { display: flex; flex-direction: column; gap: 2px; }
.wwg-listrow {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 6px var(--ag-s-2); margin: 0;
  border-radius: var(--ag-r); color: var(--ag-ink); font-family: var(--ag-font);
}
.wwg-listrow--btn, .wwg-listrow--link { border: 0; background: transparent; text-align: left; text-decoration: none; cursor: pointer; }
.wwg-listrow--btn:hover, .wwg-listrow--link:hover { background: var(--ag-hover); }
.wwg-listrow__main {
  display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0;
  font-size: var(--ag-text-md); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wwg-listrow__main small { font-size: var(--ag-text-xs); font-weight: 500; color: var(--ag-muted); overflow: hidden; text-overflow: ellipsis; }
.wwg-listrow__emoji { font-size: 22px; line-height: 1; flex: none; }
.wwg-listrow .ag-btn { flex: none; }
.wwg-check { cursor: pointer; }
.wwg-check input { width: 18px; height: 18px; accent-color: var(--ag-accent); flex: none; }
.wwg-count {
  flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--ag-r-pill);
  background: var(--ag-accent); color: var(--ag-on-accent); font: 700 var(--ag-text-xs)/20px var(--ag-font); text-align: center;
}

.wwg-gamegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.wwg-gamegrid__tile { width: auto; height: 76px; background: var(--ag-surface-alt); border: 1px solid var(--ag-border); }
.wwg-gamegrid__tile .ag-tile__icon { font-size: 24px; width: 28px; height: 28px; }

.wwg-chatlog {
  display: flex; flex-direction: column; gap: 4px; min-height: 64px; max-height: 200px; overflow-y: auto;
  padding: var(--ag-s-2) 10px; border-radius: var(--ag-r); background: var(--ag-surface-alt); border: 1px solid var(--ag-border);
  font-size: var(--ag-text-sm); line-height: 1.4; color: var(--ag-ink-2); word-break: break-word;
}
.wwg-chatlog:empty::before { content: 'No messages yet'; color: var(--ag-muted); }
.wwg-chatlog__msg b { color: var(--ag-ink); font-weight: 700; }
.wwg-chatbar { display: flex; gap: var(--ag-s-2); align-items: center; }
.wwg-chatbar .wwg-input { flex: 1 1 auto; }
.wwg-chatbar .ag-btn { flex: none; height: var(--ag-touch); }

/* chat view */
#wwgChatPanel.wwg-pane__view { padding: 0; gap: 0; overflow: hidden; }
.wwg-signin-note { padding: var(--ag-s-5) var(--ag-s-4); display: flex; flex-direction: column; align-items: center; gap: var(--ag-s-3); text-align: center; color: var(--ag-muted); font-size: var(--ag-text-md); }
.wwg-signin-note p { margin: 0; }
.wwg-chat__head { display: flex; align-items: center; gap: var(--ag-s-1); flex: none; min-height: 48px; padding: 2px var(--ag-s-2); border-bottom: 1px solid var(--ag-border); }
.wwg-chat__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: var(--ag-text-md); }
.wwg-chat__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: var(--ag-s-4); display: flex; flex-direction: column; gap: var(--ag-s-2); }
.wwg-chat__body .wwg-list { gap: 2px; }
#wwgChatList { display: flex; flex-direction: column; gap: var(--ag-s-2); }
.wwg-chat__new { margin-bottom: var(--ag-s-1); }
.wwg-chat__convo { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.wwg-chat__msgs { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: var(--ag-s-3) var(--ag-s-4); display: flex; flex-direction: column; gap: 6px; }
.wwg-chatbar--pane { flex: none; padding: var(--ag-s-2) var(--ag-s-3); border-top: 1px solid var(--ag-border); background: var(--ag-surface); }
.wwg-msg { max-width: 85%; padding: var(--ag-s-2) 10px; border-radius: var(--ag-r-lg); font-size: var(--ag-text-md); line-height: 1.35; word-wrap: break-word; }
.wwg-msg--mine { align-self: flex-end; background: var(--ag-accent); color: var(--ag-on-accent); border-bottom-right-radius: var(--ag-r-sm); }
.wwg-msg--theirs { align-self: flex-start; background: var(--ag-chrome); color: var(--ag-ink); border-bottom-left-radius: var(--ag-r-sm); }
.wwg-msg__from { display: block; font-size: var(--ag-text-xs); font-weight: 700; color: var(--ag-muted); margin-bottom: 2px; }
.wwg-msg__time { display: block; font-size: 11px; opacity: .7; margin-top: 2px; }
.wwg-msg--system { align-self: center; background: none; color: var(--ag-muted); font-size: var(--ag-text-xs); font-style: italic; }

/* chat v2 (CHG-0658): photos, videos, replies, reactions, typing, attachments, the kid safety sheet */
.wwg-convo__icon { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--ag-surface-alt); font-size: 18px; line-height: 1; }
.wwg-convo.is-unread .wwg-listrow__main { font-weight: 800; }
.wwg-convo.is-unread .wwg-listrow__main small { color: var(--ag-ink-2); }
.wwg-convo__muted { font-size: 12px; }
.wwg-count--at { margin-right: 2px; }
.wwg-msg { position: relative; }
.wwg-msg__text { white-space: pre-wrap; }
.wwg-msg a { color: inherit; text-decoration: underline; }
.wwg-msg__gone { font-style: italic; opacity: .75; }
.wwg-msg__reply {
  display: block; width: 100%; margin: 0 0 4px; padding: 4px 8px; border: 0; border-left: 3px solid currentColor; border-radius: 6px;
  background: rgba(0,0,0,.10); color: inherit; font: inherit; font-size: var(--ag-text-sm); text-align: left; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .9;
}
.wwg-msg__media { display: grid; gap: 4px; margin: 2px 0 4px; }
.wwg-msg__media--2, .wwg-msg__media--3, .wwg-msg__media--4 { grid-template-columns: 1fr 1fr; }
.wwg-msg__photo { display: block; line-height: 0; border-radius: var(--ag-r); overflow: hidden; background: rgba(0,0,0,.12); }
.wwg-msg__photo img { display: block; width: 100%; height: auto; max-height: 300px; object-fit: cover; }
.wwg-msg__media--2 .wwg-msg__photo img, .wwg-msg__media--3 .wwg-msg__photo img, .wwg-msg__media--4 .wwg-msg__photo img { aspect-ratio: 1; height: 100%; }
.wwg-msg__video { display: block; width: 100%; max-height: 320px; border-radius: var(--ag-r); background: #000; }
.wwg-msg__proc { display: block; padding: 18px 10px; border-radius: var(--ag-r); background: rgba(0,0,0,.14); font-size: var(--ag-text-sm); text-align: center; }
.wwg-msg__game { display: block; font-weight: 700; }
.wwg-msg__join { margin: 6px 0 2px; }
.wwg-msg__reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.wwg-react {
  padding: 1px 8px; border: 1px solid var(--ag-border); border-radius: 999px; background: var(--ag-surface); color: var(--ag-ink);
  font: 600 13px/1.6 var(--ag-font); cursor: pointer;
}
.wwg-react.is-mine { border-color: var(--ag-accent); box-shadow: inset 0 0 0 1px var(--ag-accent); }
.wwg-msg__time { display: flex; align-items: center; gap: 10px; }
.wwg-msg__more {
  margin-left: auto; padding: 0 2px; border: 0; background: none; color: inherit;
  font-size: 16px; line-height: 1; cursor: pointer;
}
.wwg-msg__more:hover, .wwg-msg__more:focus-visible { opacity: 1; }
.wwg-member { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wwg-member .ag-chip { flex: none; }
.wwg-msg.is-flash { box-shadow: 0 0 0 3px var(--ag-accent); transition: box-shadow .3s; }
.wwg-chat__older { align-self: center; flex: none; }
.wwg-chat__typing { flex: none; padding: 2px var(--ag-s-4) 4px; font-size: var(--ag-text-xs); font-style: italic; color: var(--ag-muted); }
.wwg-replybar {
  flex: none; display: flex; align-items: center; gap: 6px; padding: 2px var(--ag-s-2) 2px var(--ag-s-3);
  border-top: 1px solid var(--ag-border); background: var(--ag-surface-alt); font-size: var(--ag-text-sm); color: var(--ag-ink-2);
}
.wwg-replybar__txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wwg-attachstrip { flex: none; display: flex; gap: 6px; padding: 6px var(--ag-s-3); overflow-x: auto; border-top: 1px solid var(--ag-border); background: var(--ag-surface); }
.wwg-attach { position: relative; flex: none; width: 58px; height: 58px; border-radius: 8px; overflow: hidden; background: var(--ag-surface-alt); }
.wwg-attach img { display: block; width: 100%; height: 100%; object-fit: cover; }
.wwg-attach.is-uploading img { opacity: .45; }
.wwg-attach__spin {
  position: absolute; inset: 0; margin: auto; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; animation: wwgChatSpin .8s linear infinite;
}
@keyframes wwgChatSpin { to { transform: rotate(360deg); } }
.wwg-attach__x {
  position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(0,0,0,.7); color: #fff; font-size: 15px; line-height: 22px; cursor: pointer;
}
.wwg-chat__attach { flex: none; font-size: 19px; }
.wwg-chatbar--pane .ag-btn[disabled] { opacity: .55; }
.wwg-safety { list-style: none; margin: 0 0 var(--ag-s-3); padding: 0; display: grid; gap: 10px; }
.wwg-safety li { display: flex; gap: 10px; font-size: var(--ag-text-md); line-height: 1.4; color: var(--ag-ink); }
.wwg-reactpick { display: flex; gap: 6px; padding: 2px 0 10px; }
.wwg-reactpick__btn {
  flex: 1; padding: 8px 0; border: 1px solid var(--ag-border); border-radius: 12px; background: var(--ag-surface-alt);
  font-size: 26px; line-height: 1; cursor: pointer;
}
.wwg-reactpick__btn:hover { background: var(--ag-hover); }
/* browser notifications note (CHG-0658) */
.wwg-pushnote {
  display: flex; align-items: center; gap: var(--ag-s-2); padding: 8px 8px 8px 12px; margin-bottom: var(--ag-s-1);
  border: 1px solid var(--ag-border); border-radius: var(--ag-r); background: var(--ag-surface-alt); font-size: var(--ag-text-sm);
}
.wwg-pushnote__txt { flex: 1; min-width: 0; }
.wwg-pushnote .ag-btn { flex: none; }
.wwg-pushnote--on { color: var(--ag-muted); }

/* ============================================================
   INVITE CARD, TOAST, FAB
   ============================================================ */
.wwg-invite {
  position: fixed; z-index: 970; top: calc(var(--ag-appbar-h) + var(--wwg-safe-t) + var(--ag-s-3)); right: var(--ag-s-3);
  width: min(340px, calc(100% - 24px)); padding: var(--ag-s-4);
  display: none; flex-direction: column; gap: var(--ag-s-2);
  background: var(--ag-surface); color: var(--ag-ink); border: 1px solid var(--ag-border);
  border-radius: var(--ag-r-lg); box-shadow: var(--ag-shadow-lg); font-family: var(--ag-font);
}
.wwg-invite.is-open { display: flex; }
html.wwg-ingame .wwg-invite { top: calc(var(--wwg-gb-h) + var(--wwg-safe-t) + var(--ag-s-3)); }
.wwg-invite__title { font-family: var(--ag-font-display); font-weight: 800; font-size: var(--ag-text-base); }
.wwg-invite__msg { font-size: var(--ag-text-md); color: var(--ag-ink-2); margin-bottom: var(--ag-s-1); }

.wwg-toast {
  position: fixed; z-index: 980; left: 50%; bottom: calc(var(--ag-s-5) + var(--wwg-safe-b));
  max-width: calc(100% - 32px); padding: 10px var(--ag-s-4); border-radius: var(--ag-r-pill);
  background: var(--ag-ink); color: var(--ag-bg); font: 600 var(--ag-text-md)/1.3 var(--ag-font);
  box-shadow: var(--ag-shadow-md); pointer-events: none;
  opacity: 0; transform: translate(-50%, 8px); transition: opacity .18s var(--ag-ease), transform .18s var(--ag-ease);
}
.wwg-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 767.98px) {
  html:not(.wwg-ingame):not(.wwg-hub) .wwg-toast { bottom: calc(var(--ag-bottombar-h) + var(--ag-s-3) + var(--wwg-safe-b)); }
}

.wwg-fab {
  position: fixed; z-index: 10030; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--ag-s-4) + var(--wwg-safe-b)); border-radius: var(--ag-r-pill); box-shadow: var(--ag-shadow-lg);
}

/* Home page: the pane covers the full height above the page's own chrome. */
html.wwg-hub .wwg-pane { top: 0; bottom: 0; z-index: 10040; }
html.wwg-hub .wwg-pane-scrim { top: 0; z-index: 10039; }
html.wwg-hub .wwg-sheet { z-index: 10060; }
html.wwg-hub .wwg-toast { z-index: 10070; }
html.wwg-hub.wwg-pane-open .wwg-fab { display: none; }

/* ============================================================
   ROTATE PROMPT (phone, in game, wrong orientation) — neutral, with "Play anyway"
   ============================================================ */
.wwg-rotate-prompt { display: none; }
html.wwg-rotate.wwg-ingame .wwg-rotate-prompt {
  display: flex; position: fixed; inset: calc(var(--wwg-gb-h) + var(--wwg-safe-t)) 0 0 0; z-index: 590;
  align-items: center; justify-content: center; padding: var(--ag-s-5);
  background: var(--ag-bg); color: var(--ag-ink); font-family: var(--ag-font); text-align: center;
}
.wwg-rotate-card {
  display: flex; flex-direction: column; align-items: center; gap: var(--ag-s-3); max-width: 340px; width: 100%;
  padding: var(--ag-s-5); border-radius: var(--ag-r-xl); background: var(--ag-surface); border: 1px solid var(--ag-border); box-shadow: var(--ag-shadow-sm);
}
.wwg-rotate-icon { color: var(--ag-muted); transform-origin: 50% 50%; animation: wwgRotateHint 2.4s ease-in-out infinite; }
@keyframes wwgRotateHint { 0%,28%{transform:rotate(0)} 52%,80%{transform:rotate(-90deg)} 100%{transform:rotate(0)} }
@media (prefers-reduced-motion: reduce) { .wwg-rotate-icon { animation: none; } }
.wwg-rotate-prompt h2 { margin: 0; font-family: var(--ag-font-display); font-weight: 800; font-size: var(--ag-text-lg); line-height: 1.2; color: var(--ag-ink); }
.wwg-rotate-prompt p { margin: 0; font-size: var(--ag-text-md); color: var(--ag-muted); line-height: 1.5; }

/* ============================================================
   PHONE FULL-SCREEN ENGINE (unchanged contract; phone classes only)
   ============================================================ */
html.wwg-fullscreen #wwgGame {
  min-height: 0; height: 100vh; height: 100dvh; overflow: hidden;
  padding-top: calc(var(--wwg-gb-h) + var(--wwg-safe-t)); padding-bottom: 0;
}
html.wwg-fullscreen #wwgGame .game-body {
  position: relative; flex: 1; width: 100%; height: 100%; min-height: 0;
  padding: 0; overflow: hidden; display: flex; align-items: center; justify-content: center;
}
/* Games that render straight into #wwgGame (no .game-body) get a root that fills the screen. */
html.wwg-fullscreen:not(.wwg-flow) #wwgGame > * { flex: 1 1 auto; min-height: 0; width: 100%; }
/* Default fit for pre-V3 canvases (V3 boards size themselves with WwgKit.fitCanvas). */
html.wwg-fullscreen #wwgGame canvas:not(.ag-paper) {
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  margin: auto; border-radius: 0; box-shadow: none;
}
html.wwg-fullscreen #wh-home-picker { display: none !important; }

/* Flow-content games (quiz / word): fill the screen but scroll, in normal flow. */
html.wwg-fullscreen.wwg-flow #wwgGame { overflow-y: auto; -webkit-overflow-scrolling: touch; }
html.wwg-fullscreen.wwg-flow #wwgGame .game-body {
  display: block; height: auto; min-height: 100%; padding: 8px 10px 18px; overflow: visible;
}

/* Overlay bars/pills some pre-V3 games apply to their HUD + controls (phone full-screen only). */
html.wwg-fullscreen .wwg-ov-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 6;
  display: flex; align-items: center; gap: 8px;
  padding: 4px 8px; padding-top: calc(4px + var(--wwg-safe-t));
  background: var(--ag-scrim);
}
html.wwg-fullscreen .wwg-ov-bottom {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 6;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; padding-bottom: calc(6px + var(--wwg-safe-b));
  background: var(--ag-scrim);
}
html.wwg-fullscreen .wwg-ov-pill {
  background: var(--ag-surface); border: 1px solid var(--ag-border);
  border-radius: 10px; padding: 3px 10px;
}
/* Slack anchors for pre-V3 square-board games. */
html.wwg-fullscreen .wwg-slack-a, html.wwg-fullscreen .wwg-slack-b { position: absolute; z-index: 6; }
html.wwg-fullscreen.wwg-land .wwg-slack-a { left: 8px; top: 50%; transform: translateY(-50%); max-width: 26vw; }
html.wwg-fullscreen.wwg-land .wwg-slack-b { right: 8px; top: 50%; transform: translateY(-50%); max-width: 26vw; }
html.wwg-fullscreen.wwg-port .wwg-slack-a { top: calc(46px + var(--wwg-safe-t)); left: 50%; transform: translateX(-50%); }
html.wwg-fullscreen.wwg-port .wwg-slack-b { bottom: calc(10px + var(--wwg-safe-b)); left: 50%; transform: translateX(-50%); }

/* ============================================================
   PRE-V3 COMPONENT CLASSES (still used by unconverted games). Tokens only.
   Scoped off the home page, which has its own .btn.
   ============================================================ */
:where(html:not(.wwg-hub)) .btn {
  padding: 11px 24px; border-radius: var(--ag-r); border: none; min-height: var(--ag-ctl-h);
  font-size: 14px; font-weight: 600; cursor: pointer; transition: background-color .15s, color .15s;
  font-family: var(--ag-font); background: var(--ag-surface-alt); color: var(--ag-ink);
}
:where(html:not(.wwg-hub)) .btn-primary { background: var(--ag-accent); color: var(--ag-on-accent); }
:where(html:not(.wwg-hub)) .btn-primary:hover { background: var(--ag-accent-hover); }
:where(html:not(.wwg-hub)) .btn-gold { background: var(--ag-accent); color: var(--ag-on-accent); }
:where(html:not(.wwg-hub)) .btn-gold:hover { background: var(--ag-accent-hover); }
:where(html:not(.wwg-hub)) .btn-sm { padding: 7px 14px; font-size: 12px; }
@media (max-width: 767.98px) {
  :where(html:not(.wwg-hub)) .btn { min-height: var(--ag-touch); }
  :where(html:not(.wwg-hub)) .btn-sm { min-height: var(--ag-touch); min-width: var(--ag-touch); padding: 10px 14px; font-size: 13px; }
}
/* V2 lobby pieces some games reuse in their own screens */
:where(html:not(.wwg-hub)) .lobby-panel {
  background: var(--ag-surface); border: 1px solid var(--ag-border); border-radius: var(--ag-r-xl);
  padding: 24px; display: flex; flex-direction: column; gap: 14px; align-items: center; width: 100%; max-width: 410px;
  box-shadow: var(--ag-shadow-sm);
}
:where(html:not(.wwg-hub)) .lobby-title { font-family: var(--ag-font-display); font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; color: var(--ag-ink); letter-spacing: -.02em; }
:where(html:not(.wwg-hub)) .lobby-section-title { font-size: var(--ag-text-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ag-muted); }
:where(html:not(.wwg-hub)) .lobby-divider { width: 100%; height: 1px; background: var(--ag-border); }
:where(html:not(.wwg-hub)) .lobby-btn {
  width: 100%; min-height: var(--ag-touch); padding: 12px 24px; border: 1px solid transparent; border-radius: var(--ag-r);
  font-family: var(--ag-font); font-size: var(--ag-text-md); font-weight: 600; cursor: pointer;
}
:where(html:not(.wwg-hub)) .lobby-btn-primary { background: var(--ag-accent); color: var(--ag-on-accent); }
:where(html:not(.wwg-hub)) .lobby-btn-primary:hover { background: var(--ag-accent-hover); }
:where(html:not(.wwg-hub)) .lobby-btn-primary:disabled { opacity: .45; cursor: default; }
:where(html:not(.wwg-hub)) .lobby-btn-secondary { background: var(--ag-surface); color: var(--ag-ink); border-color: var(--ag-border-strong); }
:where(html:not(.wwg-hub)) .lobby-btn-secondary:hover { background: var(--ag-surface-alt); }
:where(html:not(.wwg-hub)) .lobby-input {
  width: 100%; height: var(--ag-touch); padding: 0 14px; border: 1px solid var(--ag-border-strong); border-radius: var(--ag-r);
  background: var(--ag-surface); color: var(--ag-ink); font-family: var(--ag-font); font-size: 16px; font-weight: 600;
  letter-spacing: .2em; text-align: center; text-transform: uppercase;
}
:where(html:not(.wwg-hub)) .lobby-input:focus { outline: 2px solid var(--ag-focus); outline-offset: -1px; }
:where(html:not(.wwg-hub)) .lobby-input::placeholder { color: var(--ag-muted); letter-spacing: .04em; text-transform: none; font-weight: 400; }
:where(html:not(.wwg-hub)) .lobby-error { color: var(--ag-danger-ink); font-size: var(--ag-text-sm); text-align: center; }
