/* =============================================================================
   lobby-zen.css — "Zen Minimal" lobby (design-workflow Stage 4, ui/zen-minimal)

   This is the lobby's *layout* stylesheet, not a skin on top of the old one.
   The first pass on this branch only redefined tokens and flattened chrome on
   top of lobby.css's card/sidebar structure, which left the old shapes intact
   (pill buttons, bezelled card, two-column grid) — the design read as the old
   lobby wearing grayscale. This file instead re-lays-out the screen to match
   client/lobby-bw-zen-mockup.html: one 640px column of paper, text-link
   actions, borderless list rows, and the online list as a line of prose.

   Scoping: every rule is written under `body.zen-lobby`, a class only
   index.html carries — lobby.css/main.css stay shared with room.html and the
   tournament pages, which keep their current look. Anything still structural
   in those files (grid columns, card padding) is neutralised here rather than
   edited there.

   The board/stones and all of server/ are untouched, per the ui/* locks.
   ============================================================================= */

body.zen-lobby {
  /* Colour/radius tokens now come from css/tokens.css (mode-aware). */
  --zen-col: 640px;

  background: var(--c-bg);
  color: var(--c-ink);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

/* ══ Top bar ══════════════════════════════════════════════════════════════
   Not a floating pill and not sticky — it sits on the paper as a first line
   of text, aligned to the same 640px column as everything below it. */
body.zen-lobby .topnav {
  position: static;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: auto;
  max-width: var(--zen-col);
  margin: 0 auto;
  padding: 48px 24px 0;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
body.zen-lobby .topnav__brand { gap: 10px; }
body.zen-lobby .topnav__logo { width: 18px; height: 18px; opacity: 0.8; border-radius: 0; }
body.zen-lobby .topnav__title {
  font-size: calc(14px * var(--fs-scale, 1));
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--c-ink-2);
}
body.zen-lobby .topnav__right { gap: 20px; }
body.zen-lobby .topnav__user,
body.zen-lobby .topnav__online {
  font-size: calc(12.5px * var(--fs-scale, 1));
  font-weight: 500;
  color: var(--c-ink-3);
  white-space: nowrap;
}
body.zen-lobby .topnav__badge {
  background: none;
  border: none;
  padding: 0;
  font-size: calc(14px * var(--fs-scale, 1));
  font-weight: 600;
  color: var(--c-ink-3);
  text-transform: lowercase;
  letter-spacing: 0;
}
/* The settings button settings-panel.js injects here — bare glyph, no pill. */
body.zen-lobby .topnav__btn {
  width: auto;
  height: auto;
  padding: 4px;
  background: var(--c-surface-2);
  border: none;
  border-radius: 0;
  box-shadow: none;
  color: var(--c-ink-2);
  font-size: calc(16px * var(--fs-scale, 1));
}
body.zen-lobby .topnav__btn:hover {
  background: color-mix(in srgb, var(--c-surface-2) 86%, var(--c-ink));
  box-shadow: none;
  transform: none;
  color: var(--c-ink);
}
body.zen-lobby .topnav__btn:active { transform: none; }

/* ══ Page shell ═══════════════════════════════════════════════════════════ */
body.zen-lobby .lobby-layout {
  display: block;          /* was: two-column grid + 260px sidebar rail */
  max-width: none;
  margin: 0;
}
body.zen-lobby .lobby {
  max-width: var(--zen-col);
  margin: 0 auto;
  padding: 60px 24px 100px;
}

/* ══ Hero ═════════════════════════════════════════════════════════════════ */
body.zen-lobby .zen-hero { margin-bottom: 44px; }
body.zen-lobby .zen-hero__eyebrow {
  display: block;
  margin-bottom: 12px;
  font-size: calc(14px * var(--fs-scale, 1));
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--c-ink-3);
}
body.zen-lobby .zen-hero__title {
  margin: 0;
  font-size: calc(32px * var(--fs-scale, 1));
  font-weight: 300;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--c-ink);
}
body.zen-lobby .zen-hero__title b { font-weight: 800; }

/* ══ Tabs ═════════════════════════════════════════════════════════════════
   Plain words. No icons, no underline, no rail — weight carries the state. */
body.zen-lobby .section-tabs {
  display: flex;
  gap: 28px;
  margin: 0 0 48px;
  border-bottom: none;
}
body.zen-lobby .section-tabs__btn {
  padding: 0;
  margin: 0;
  min-height: auto;
  border: none;
  border-bottom: none;
  background: none;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--c-ink-3);
  transition: color var(--duration-fast) var(--ease-out, ease);
}
body.zen-lobby .section-tabs__btn .icon { display: none; }
body.zen-lobby .section-tabs__btn:hover { color: var(--c-ink-2); }
body.zen-lobby .section-tabs__btn.is-active {
  color: var(--c-ink);
  font-weight: 700;
  border-bottom: none;
}

/* ══ Section actions ══════════════════════════════════════════════════════
   "Lịch sử" / "Tạo phòng" are text links with a glyph, never buttons. */
body.zen-lobby .section-actions {
  display: flex;
  gap: 24px;
  margin-bottom: 40px;
}
body.zen-lobby .link-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  background: var(--c-surface-2);
  border: none;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--c-ink-2);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out, ease), opacity var(--duration-fast) var(--ease-out, ease);
}
body.zen-lobby .link-action .icon { font-size: calc(16px * var(--fs-scale, 1)); }
body.zen-lobby .link-action:hover { color: var(--c-ink); }
body.zen-lobby .link-action--primary { color: var(--c-ink); }
body.zen-lobby .link-action--primary:hover { opacity: 0.6; }

/* ══ Room list ════════════════════════════════════════════════════════════
   Rows, not cards: a state bullet, the name over one meta line, and a text
   action on the right. The only rule is the hairline between rows. */
body.zen-lobby .room-list { display: flex; flex-direction: column; }

body.zen-lobby .room-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid var(--c-border);
}
body.zen-lobby .room-row__bullet {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--c-ink-3);
}
/* Filled ink = a game is running; hollow = both seats taken but not started;
   plain gray = open seat. Same three states the old badge spelled out. */
body.zen-lobby .room-row__bullet--playing { background: var(--c-ink); }
body.zen-lobby .room-row__bullet--ready {
  background: transparent;
  border: 1.5px solid var(--c-ink-2);
}
body.zen-lobby .room-row__body { flex: 1; min-width: 0; }
body.zen-lobby .room-row__name {
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--c-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.zen-lobby .room-row__meta {
  margin-top: 3px;
  font-size: var(--text-xs);
  color: var(--c-ink-3);
  /* A long host name must never push this line under the action on the
     right — it truncates instead, same as the name above it. */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Empty states read as another paragraph on the page, not as a centered
   placeholder card — everything else in this column is flush left. */
body.zen-lobby .room-list__empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 40px 0;
  background: none;
  border: none;
  text-align: left;
}
body.zen-lobby .room-list__empty-text { font-size: var(--text-md); font-weight: 500; color: var(--c-ink-2); }
body.zen-lobby .room-list__empty-sub { font-size: var(--text-xs); color: var(--c-ink-3); }

/* ══ Online line ══════════════════════════════════════════════════════════
   Replaces the sticky sidebar panel: who is here, read as a sentence. */
body.zen-lobby .online-line {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--c-border-light);
  font-size: var(--text-xs);
  line-height: 1.9;
  color: var(--c-ink-3);
}
body.zen-lobby .online-line__title {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--c-ink-2);
}
body.zen-lobby .online-line__title--action {
  cursor: pointer;
  width: fit-content;
  border-radius: 4px;
  outline-offset: 2px;
}
body.zen-lobby .online-line__title--action:hover { color: var(--c-ink); text-decoration: underline; }
body.zen-lobby .online-line b { font-weight: 500; color: var(--c-ink); }

/* ══ Tournaments tab ══════════════════════════════════════════════════════
   Same list language as the rooms. The filters and the live-matches panel
   are kept (they carry real function the mockup never modelled) but lose
   their boxes — text filters and hairline rows. */
body.zen-lobby .filter-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0;
  margin-bottom: 8px;
  background: none;
  border: none;
}
body.zen-lobby .filter-pill {
  padding: 0;
  background: var(--c-surface-2);
  border: none;
  border-radius: 0;
  font-size: var(--text-xs);
  font-weight: 600;   /* same weight in every state: 500->700 moved the neighbouring pills by 2-3px */
  color: var(--c-ink-3);
}
body.zen-lobby .filter-pill:hover { background: color-mix(in srgb, var(--c-surface-2) 86%, var(--c-ink)); color: var(--c-ink-2); }
body.zen-lobby .filter-pill.is-active {
  background: var(--c-surface-2);
  color: var(--c-ink);
  text-decoration: underline;   /* selected = colour + underline, not colour alone */
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}
body.zen-lobby .filter-select {
  padding: 4px 0;
  background: var(--c-surface-2);
  border: none;
  border-radius: 0;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--c-ink-2);
}

body.zen-lobby .tournament-grid {
  display: flex;
  flex-direction: column;
  gap: var(--card-gap);
  padding: 0;               /* was inset from the column by lobby.css */
}
/* Ticket (docs/knowledge/ui-ux/ticket-rows.md): raised surface + radius + card padding, 8px between tickets. */
body.zen-lobby .tournament-card {
  padding: var(--card-pad);
  gap: 4px;
  background: var(--c-surface-2);
  border: none;
  border-radius: var(--card-radius);
  box-shadow: none;
}
body.zen-lobby .tournament-card:hover {
  background: var(--c-hover);
  box-shadow: none;
  transform: none;
}
body.zen-lobby .tournament-card__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
}
body.zen-lobby .tournament-card__name { font-size: var(--text-md); font-weight: 500; }
/* Meta = one .rtag chip per fact (ticket-rows: no joined `a · b · c`); the gap spaces them. */
body.zen-lobby .tournament-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  font-size: var(--text-xs);
  color: var(--c-ink-3);
}
body.zen-lobby .tournament-card__status {
  gap: 6px;
  font-size: var(--text-xs);
  color: var(--c-ink-3);
}
body.zen-lobby .tournament-card__meta .icon,
body.zen-lobby .tournament-card__status .icon { font-size: calc(16px * var(--fs-scale, 1)); }
/* The ticket is already delimited by its own surface — an inner rule
   above the status line just fragments it. */
body.zen-lobby .tournament-card__status {
  display: inline-flex;   /* it is a segment of the meta line now, not a row */
  padding-top: 0;
  border-top: none;
  font-size: inherit;
  font-weight: 600;
  color: var(--c-ink-2);
}

/* The row's own actions read like the room list's "Tham gia" — text, right
   aligned, no pill. This is the one place the old design still shipped a
   full-width black button inside an otherwise flat row. */
body.zen-lobby .tournament-card__actions {
  flex-shrink: 0;
  justify-content: flex-end;
  gap: 20px;
  margin: 0;
  padding-top: 0;
  border-top: none;
}
body.zen-lobby .tournament-card__actions .btn,
body.zen-lobby .tournament-card__actions .btn-confirm,
body.zen-lobby .tournament-card__actions .btn-secondary {
  flex: 0 0 auto;
  width: auto;
  padding: 0;
  background: var(--c-surface-2) !important;
  border: none !important;
  border-radius: 0;
  box-shadow: none !important;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--c-ink) !important;
}
body.zen-lobby .tournament-card__actions .btn-secondary { color: var(--c-ink-2) !important; }
body.zen-lobby .tournament-card__actions .btn-secondary--danger { color: var(--c-ink-2) !important; }
body.zen-lobby .tournament-card__actions .btn:hover,
body.zen-lobby .tournament-card__actions .btn-secondary:hover {
  opacity: 0.6;
  background: color-mix(in srgb, var(--c-surface-2) 86%, var(--c-ink)) !important;
  transform: none;
}

body.zen-lobby .live-matches-panel {
  padding: 0 0 8px;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
}
body.zen-lobby .live-matches-panel__header {
  padding: 0 0 12px;
  background: none;
  border: none;
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.01em;
  color: var(--c-ink-3);
}
body.zen-lobby .live-match-row {
  padding: 14px 0;
  background: none;
  border: none;
  border-bottom: 1px solid var(--c-border);
  border-radius: 0;
}
body.zen-lobby .live-match-row:hover { background: none; border-color: var(--c-ink-3); }

body.zen-lobby .empty-tournaments {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 6px;
  padding: 40px 0;
  background: none;
  border: none;
  text-align: left;
}
body.zen-lobby .empty-tournaments .room-list__empty-text { margin-top: 0; }

/* Badges/chips inside tournament rows flatten to plain inline text. */
body.zen-lobby .badge,
body.zen-lobby .state-badge,
body.zen-lobby .rule-chip,
body.zen-lobby .rule-tag {
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  color: var(--c-ink-3);
}
body.zen-lobby .badge--live { color: var(--c-ink); }

/* ══ Buttons that remain real buttons (modals only) ═══════════════════════ */
body.zen-lobby .btn,
body.zen-lobby .btn-confirm,
body.zen-lobby .btn-secondary { box-shadow: none !important; }
body.zen-lobby .btn-confirm:hover,
body.zen-lobby .btn-secondary:hover { transform: none; box-shadow: none; }

body.zen-lobby .modal {
  border: 1px solid var(--c-border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
}
body.zen-lobby .modal__close { box-shadow: none; }
body.zen-lobby .pill-group input:checked + label {
  box-shadow: none;
  border: 1px solid var(--c-border);
}
body.zen-lobby .timer-input input:focus { box-shadow: 0 0 0 3px var(--c-brand-light); }

/* ══ Responsive ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  body.zen-lobby .topnav { padding: 28px 20px 0; gap: 16px; }
  body.zen-lobby .topnav__title { display: inline; }
  body.zen-lobby .topnav__brand { flex-shrink: 0; }
  body.zen-lobby .topnav__right { gap: 14px; min-width: 0; }
  body.zen-lobby .lobby { padding: 40px 20px 80px; }
  body.zen-lobby .zen-hero { margin-bottom: 32px; }
  body.zen-lobby .zen-hero__title { font-size: calc(26px * var(--fs-scale, 1)); }
  body.zen-lobby .section-tabs { margin-bottom: 32px; }
  body.zen-lobby .section-actions { margin-bottom: 28px; }
  body.zen-lobby .online-line { margin-top: 40px; }
}
@media (max-width: 480px) {
  /* The top bar gives way in a fixed order: the wordmark first (the logo mark
     still identifies the site), then the guest badge. The name, the online
     count and the settings glyph are what actually get used at this width. */
  body.zen-lobby .topnav__title { display: none; }
  body.zen-lobby .topnav__badge { display: none; }
  body.zen-lobby .topnav__user { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
  body.zen-lobby .zen-hero__title { font-size: calc(23px * var(--fs-scale, 1)); }
  body.zen-lobby .filter-row { flex-wrap: wrap; gap: 14px; }

  /* Narrow enough that the meta line has to wrap — let it wrap as prose
     under the name instead of squeezing itself beside the action. */
  body.zen-lobby .room-row__meta { white-space: normal; }
  body.zen-lobby .tournament-card__meta { line-height: 1.6; }
  /* An inline-flex span wraps as one indivisible block, which leaves a ragged
     second column mid-sentence — plain inline lets it wrap as prose. */
  body.zen-lobby .tournament-card__status { display: inline; }
  body.zen-lobby .tournament-card__status .icon { display: none; }
}

/* ══ Private chat (#159) ══════════════════════════════════════════════════ */
/* Online names in the lobby line: plain ink text, not link-blue. Only the
   pointer + hover underline hint that they're interactive (click → private
   chat; the "…and N others" span → online-users modal). */
.online-line__names .online-name {
  color: inherit;
  cursor: pointer;
  border-radius: 3px;
  outline-offset: 2px;
}
.online-line__names .online-name:hover { text-decoration: underline; }
.online-line__names .online-line__more { color: var(--c-ink-2); }

/* ── Online-users modal (Zen Minimal) ── */
#modal-online-users .modal { max-width: 400px; }
#modal-online-users .modal__header { align-items: center; }
.online-users-modal__title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.online-users-modal__title-wrap .icon { font-size: calc(20px * var(--fs-scale, 1)); color: var(--c-ink-2); flex-shrink: 0; }
.online-users-modal__title-wrap .modal__title { margin: 0; font-size: var(--text-md); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.online-users-modal__count {
  flex-shrink: 0;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--c-ink-2);
  background: var(--c-surface-2);
  border-radius: 999px;
  padding: 1px 8px;
  min-width: 20px;
  text-align: center;
}

.online-users-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}
.online-users-search__icon {
  position: absolute;
  left: 12px;
  font-size: calc(16px * var(--fs-scale, 1));
  color: var(--c-ink-3);
  pointer-events: none;
}
.online-users-search {
  flex: 1;
  padding: 10px 12px 10px 36px;
  border: 1px solid var(--c-border-light);
  border-radius: 10px;
  background: var(--c-surface-2);
  color: var(--c-ink);
  font: inherit;
  font-size: var(--text-sm);
  transition: border-color var(--duration-xfast) ease, box-shadow var(--duration-xfast) ease;
}
.online-users-search:focus {
  outline: none;
  border-color: var(--c-ink-3);
  box-shadow: 0 0 0 3px var(--c-brand-light);
  background: var(--c-surface);
}
.online-users-search-shortcut {
  position: absolute;
  right: 10px;
  font-size: var(--text-xs);
  font-family: inherit;
  color: var(--c-ink-3);
  border: 1px solid var(--c-border-light);
  border-radius: 5px;
  padding: 2px 6px;
  white-space: nowrap;
  background: var(--c-surface);
}
.online-users-search:focus ~ .online-users-search-shortcut { display: none; }

.online-users-list {
  list-style: none;
  margin: 0 -8px;
  padding: 0;
  max-height: 46vh;
  overflow-y: auto;
}
.online-users-list__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background var(--duration-xfast) ease;
}
.online-users-list__row:hover { background: var(--c-surface-2); }
.online-users-list__row:focus-visible { outline: 2px solid var(--c-brand); outline-offset: -2px; }
.online-users-list__row.is-self { cursor: default; }
.online-users-list__row.is-self:hover { background: none; }

.online-users-list__avatar {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 600;
  color: hsl(var(--h, 220), 42%, 34%);
  background: hsl(var(--h, 220), 46%, 92%);
}

.online-users-list__name-wrap {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: auto auto;
  justify-content: start;
  align-items: baseline;
  gap: 0 6px;
}
.online-users-list__name {
  grid-column: 1;
  color: var(--c-ink);
  font-size: var(--text-sm);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.online-users-list__tag {
  grid-column: 2;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.01em;
  color: var(--c-ink-3);
  border: 1px solid var(--c-border-light);
  border-radius: 4px;
  padding: 0 4px;
}
.online-users-list__meta {
  grid-column: 1 / -1;
  font-size: var(--text-xs);
  color: var(--c-success);
  display: flex;
  align-items: center;
  gap: 5px;
}
.online-users-list__meta::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.online-users-list__chat-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-surface-2);
  border: none;
  border-radius: 8px;
  color: var(--c-ink-3);
  font-size: calc(17px * var(--fs-scale, 1));
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--duration-xfast) ease, color var(--duration-xfast) ease, background var(--duration-xfast) ease;
}
.online-users-list__row:hover .online-users-list__chat-btn,
.online-users-list__row:focus-within .online-users-list__chat-btn { opacity: 1; }
.online-users-list__chat-btn:hover { color: var(--c-on-brand); background: var(--c-brand); }
@media (hover: none) {
  .online-users-list__chat-btn { opacity: 1; color: var(--c-ink-2); }
}

.online-users-list__empty { color: var(--c-ink-3); padding: 28px 4px; text-align: center; font-size: var(--text-sm); }


/* ── Floating chat windows ── */
#private-chat-container {
  position: fixed;
  right: 16px;
  bottom: 0;
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-end;
  gap: 12px;
  z-index: var(--z-chat);
  pointer-events: none;
}
.pm-window {
  pointer-events: auto;
  width: 300px;
  height: 380px;
  display: flex;
  flex-direction: column;
  background: var(--c-surface);
  border: 1px solid var(--c-border-light);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.pm-window--collapsed { height: auto; }
.pm-window--collapsed .pm-window__log,
.pm-window--collapsed .pm-notice,
.pm-window--collapsed .pm-input-row { display: none; }
.pm-window__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: var(--c-surface-2);
  border-bottom: 1px solid var(--c-border-light);
  cursor: pointer;
}
.pm-window__collapse { display: none; }
.pm-window__icon { font-size: calc(15px * var(--fs-scale, 1)); color: var(--c-ink-2); flex-shrink: 0; }
.pm-window__name { font-weight: 600; font-size: var(--text-sm); color: var(--c-ink); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-window__status { font-size: var(--text-xs); color: var(--c-success); }
.pm-window__status.is-offline { color: var(--c-ink-3); }
.pm-window__close {
  background: var(--c-surface-2);
  border: none;
  color: var(--c-ink-3);
  cursor: pointer;
  font-size: calc(14px * var(--fs-scale, 1));
  line-height: 1;
  padding: 2px 4px;
  border-radius: 5px;
}
.pm-window__close:hover { color: var(--c-ink); background: var(--c-border-light); }
.pm-window__log {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pm-msg { display: flex; }
.pm-msg--self { justify-content: flex-end; }
.pm-msg__bubble {
  max-width: 78%;
  padding: 6px 10px;
  border-radius: 12px;
  font-size: var(--text-sm);
  line-height: 1.4;
  background: var(--c-surface-2);
  color: var(--c-ink);
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.pm-msg--self .pm-msg__bubble { background: var(--c-brand); color: var(--c-on-brand); }
.pm-notice {
  padding: 6px 12px;
  font-size: var(--text-xs);
  color: var(--c-ink-3);
  background: var(--c-surface-2);
  display: flex;
  align-items: center;
  gap: 6px;
}
.pm-notice[hidden] { display: none; }
.pm-notice::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-ink-3);
}
.pm-input-row {
  display: flex;
  gap: 6px;
  padding: 8px;
  border-top: 1px solid var(--c-border-light);
}
.pm-input {
  flex: 1;
  border: 1px solid var(--c-border-light);
  border-radius: 8px;
  padding: 7px 9px;
  font: inherit;
  font-size: var(--text-sm);
  background: var(--c-surface-2);
  color: var(--c-ink);
}
.pm-input:disabled { opacity: 0.5; }
.pm-send-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-brand);
  color: var(--c-on-brand);
  border: none;
  border-radius: 8px;
  font-size: calc(15px * var(--fs-scale, 1));
  cursor: pointer;
}
.pm-send-btn .icon { width: 20px; height: 20px; }   /* #214: icon-only button = 20 */
.pm-window__close .icon { width: 16px; height: 16px; display: block; }
.pm-send-btn:disabled { opacity: 0.4; cursor: default; }

@media (max-width: 640px) {
  #private-chat-container {
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
  }
  .pm-window {
    width: 100%;
    border-radius: 0;
  }
  /* Only the newest (last-appended → visually topmost via column-reverse? no —
     column: last child is bottom). Keep the last window full, collapse the
     rest to their header bar. */
  .pm-window:not(:last-child) { height: auto; }
  .pm-window:not(:last-child) .pm-window__log,
  .pm-window:not(:last-child) .pm-notice,
  .pm-window:not(:last-child) .pm-input-row { display: none; }
}
body.zen-lobby .zen-hero__sub { margin: 6px 0 0; font-size: var(--text-sm); color: var(--c-ink-3); }
body.zen-lobby .zen-hero__sub[hidden] { display: none; }

/* ── Profile card (B220): click a name in the lobby ── */
.ucard { max-width: 360px; }
.ucard__body { display: flex; flex-direction: column; gap: 12px; }
.ucard__who { display: flex; align-items: center; gap: 12px; }
.ucard__avatar { width: 56px; height: 56px; font-size: calc(20px * var(--fs-scale, 1)); flex-shrink: 0; overflow: hidden; }
.ucard__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ucard__names { min-width: 0; }
.ucard__name { font-size: var(--text-md); font-weight: 700; color: var(--c-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ucard__sub { font-size: var(--text-xs); color: var(--c-ink-2); }
.ucard__ratings { display: flex; flex-wrap: wrap; gap: 6px; }
.ucard__chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--c-surface-2); font-size: var(--text-sm); color: var(--c-ink); }
.ucard__chip-k, .ucard__chip-r { font-size: var(--text-xs); color: var(--c-ink-2); }
.ucard__note { font-size: var(--text-sm); color: var(--c-ink-2); }
.ucard__note--err { color: var(--c-error); }
.ucard__hint { font-size: var(--text-xs); color: var(--c-ink-2); }
.ucard__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ucard__friend { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ucard__btn { min-height: 38px; padding: 8px 14px; border: 0; border-radius: 8px; font: inherit; font-size: var(--text-sm); font-weight: 600; cursor: pointer; background: var(--c-surface-2); color: var(--c-ink); }
.ucard__btn:hover { opacity: .8; }
.ucard__btn:disabled { opacity: .45; cursor: default; }
.ucard__btn--primary { background: var(--c-ink); color: var(--c-surface); }
.ucard__btn--ghost { background: var(--c-surface-2); border: 1px solid var(--c-border-light); }
@media (max-width: 860px) { .online-users-list__chat-btn, .pm-send-btn { width: 44px; height: 44px; } .ucard__btn { min-height: 44px; } }   /* B306: touch targets */
