/* =====================================================================
   Playbay components — Harbor Night
   One definition per component. Naming: .pb-<component>,
   .pb-<component>__<part>, .pb-<component>--<variant>.
   Uses tokens only: no raw colours, font names or type sizes here.
   Pages never add CSS; they compose these classes.
   ===================================================================== */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--pb-bg); color: var(--pb-text);
  font-family: var(--pb-font); font-size: var(--pb-text-base); line-height: var(--pb-leading-body);
  font-weight: var(--pb-weight-regular);
}
a { color: inherit; }
a:hover { color: var(--pb-text); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, p { margin: 0; }
:focus-visible { outline: var(--pb-focus-ring) solid var(--pb-focus); outline-offset: 2px; border-radius: var(--pb-radius-sm); }
[tabindex="-1"]:focus { outline: none; } /* containers that receive focus programmatically (main, dialogs, sheets) */
::selection { background: var(--pb-accent); color: var(--pb-on-accent); }
svg.pb-icon { width: var(--pb-icon-md); height: var(--pb-icon-md); stroke-width: 2; flex: none; }

/* ---------- Utilities (the complete list) ---------- */
.pb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pb-skip:focus { position: fixed; z-index: var(--pb-z-toast); left: var(--pb-space-6); top: var(--pb-space-6); width: auto; height: auto; clip: auto; padding: var(--pb-space-4) var(--pb-space-6); border-radius: var(--pb-radius-sm); background: var(--pb-accent); color: var(--pb-on-accent); }
.pb-stack { display: flex; flex-direction: column; gap: var(--gap, var(--pb-space-7)); }
.pb-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, var(--pb-space-4)); }
.pb-split { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--pb-space-6); }
.pb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--min, 220px)), 1fr)); gap: var(--gap, var(--pb-space-7)); }
.pb-muted { color: var(--pb-text-muted); }
.pb-small { font-size: var(--pb-text-sm); }
.pb-num { font-variant-numeric: tabular-nums; }
.pb-prose { max-width: var(--pb-readable); color: var(--pb-text-secondary); }
.pb-prose p + p { margin-top: var(--pb-space-6); }
.pb-link { color: var(--pb-text); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.pb-link:hover { text-decoration-color: var(--pb-accent); }
.pb-text-live { color: var(--pb-live); }
.pb-note { font-size: var(--pb-text-sm); color: var(--pb-text-muted); }
/* stack / cluster / grid spacing steps (the only allowed spacings between blocks) */
.pb-stack--hair { --gap: var(--pb-space-3); }
.pb-stack--tight { --gap: var(--pb-space-4); }
.pb-stack--snug { --gap: var(--pb-space-5); }
.pb-stack--roomy { --gap: var(--pb-space-8); }
.pb-stack--loose { --gap: var(--pb-space-9); }
.pb-stack--xloose { --gap: var(--pb-space-10); }
.pb-cluster--tight { --gap: var(--pb-space-2); }
.pb-cluster--center { justify-content: center; }
.pb-split--end { align-items: flex-end; }
.pb-split > h2, .pb-split > h3 { margin: 0; }
.pb-grid--xs { --min: 120px; } .pb-grid--sm { --min: 160px; } .pb-grid--lg { --min: 280px; } .pb-grid--xl { --min: 300px; }
.pb-grid--dense { --gap: var(--pb-space-4); }
.pb-grid--tiles { --gap: var(--pb-space-8) var(--pb-space-7); }
.pb-grid--middle { align-items: center; }
.pb-center { display: grid; place-items: center; min-height: 60vh; }
.pb-tabpanel { min-width: 0; }
.pb-linklist { margin: 0; padding-left: var(--pb-space-8); }
.pb-log { margin: 0; white-space: pre-wrap; font-family: var(--pb-font-mono); font-size: var(--pb-text-sm); color: var(--pb-text-secondary); }
.pb-spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--pb-border-strong); border-top-color: var(--pb-accent); animation: pb-spin 800ms linear infinite; }
@media (prefers-reduced-motion: reduce) { .pb-spinner { animation-duration: 2400ms; } }

/* ---------- Fieldset and disclosure ---------- */
.pb-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.pb-fieldset > legend { padding: 0; margin-bottom: var(--pb-space-4); }
.pb-disclosure > summary { cursor: pointer; font-weight: var(--pb-weight-medium); }
.pb-disclosure > summary:hover { color: var(--pb-text); }
.pb-disclosure__body { padding-top: var(--pb-space-6); }
.pb-disclosure--quiet > summary { font-weight: var(--pb-weight-regular); font-size: var(--pb-text-sm); color: var(--pb-text-muted); }
.pb-disclosure--quiet .pb-disclosure__body { padding-top: var(--pb-space-4); }

/* ---------- Logo ---------- */
.pb-logo { display: inline-flex; align-items: center; gap: var(--pb-space-5); text-decoration: none; color: var(--pb-text); }
.pb-logo__word { font-weight: var(--pb-weight-black); font-stretch: var(--pb-stretch-wide); font-size: var(--pb-logo-md); line-height: 1; letter-spacing: -0.01em; }
.pb-logo--lg .pb-logo__word { font-size: var(--pb-logo-lg); }
.pb-logo--lg svg { width: 58px; height: 58px; }
svg.pb-icon--brand { stroke: none; width: var(--pb-icon-sm); height: var(--pb-icon-sm); }
.pb-logo__text { display: inline-flex; flex-direction: column; gap: var(--pb-space-1); }
.pb-logo__by { font-size: var(--pb-text-2xs); font-weight: var(--pb-weight-medium); color: var(--pb-text-muted); letter-spacing: 0.02em; line-height: 1; }
.pb-logo--lg .pb-logo__by { font-size: var(--pb-text-sm); }

/* ---------- Button ---------- */
.pb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--pb-space-4);
  min-height: var(--pb-control-md); padding: 0 var(--pb-space-8); border: 0; border-radius: var(--pb-radius);
  font-size: var(--pb-text-base); font-weight: var(--pb-weight-bold); line-height: 1; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background-color var(--pb-dur-fast) var(--pb-ease);
}
.pb-btn--primary { background: var(--pb-accent); color: var(--pb-on-accent); }
.pb-btn--primary:hover { background: var(--pb-accent-hover); color: var(--pb-on-accent); }
.pb-btn--secondary { background: transparent; color: var(--pb-text); box-shadow: inset 0 0 0 var(--pb-border-width) var(--pb-text-muted); }
.pb-btn--secondary:hover { background: var(--pb-surface-raised); }
.pb-btn--secondary[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--pb-accent); }
.pb-btn--secondary[aria-pressed="true"] svg.pb-icon { color: var(--pb-accent); fill: var(--pb-accent); }
.pb-btn--ghost { background: transparent; color: var(--pb-text-secondary); }
.pb-btn--ghost:hover { background: var(--pb-surface-raised); color: var(--pb-text); }
.pb-btn--danger { background: var(--pb-danger-fill); color: var(--pb-on-danger); }
.pb-btn--danger:hover { filter: brightness(1.08); color: var(--pb-on-danger); }
.pb-btn--sm { min-height: var(--pb-control-sm); padding: 0 var(--pb-space-6); font-size: var(--pb-text-md); }
.pb-btn--lg { min-height: var(--pb-control-lg); padding: 0 var(--pb-space-10); font-size: var(--pb-text-lg); }
.pb-btn--block { width: 100%; }
.pb-btn--icon { width: var(--pb-control-md); padding: 0; }
.pb-btn--icon.pb-btn--sm { width: var(--pb-control-sm); }
.pb-btn:disabled, .pb-btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.pb-btn[aria-busy="true"] { color: transparent; position: relative; pointer-events: none; }
.pb-btn[aria-busy="true"]::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--pb-on-accent) transparent var(--pb-on-accent) transparent;
  animation: pb-spin 800ms linear infinite;
}
.pb-btn--secondary[aria-busy="true"]::after, .pb-btn--ghost[aria-busy="true"]::after { border-color: var(--pb-text) transparent var(--pb-text) transparent; }
@keyframes pb-spin { to { transform: rotate(360deg); } }
@media (max-width: 899px) { .pb-btn--collapse { width: var(--pb-control-md); padding: 0; } .pb-btn--collapse > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }
@media (pointer: coarse) { .pb-btn--sm { min-height: var(--pb-control-md); } .pb-btn--icon.pb-btn--sm { width: var(--pb-control-md); } }

/* ---------- Badge (counts) ---------- */
.pb-badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--pb-radius-sm);
  background: var(--pb-accent); color: var(--pb-on-accent); font-size: var(--pb-text-2xs); font-weight: var(--pb-weight-bold); line-height: 1;
}
.pb-badge--dot { min-width: 9px; width: 9px; height: 9px; padding: 0; border-radius: 50%; box-shadow: 0 0 0 2px var(--pb-surface); }

/* ---------- Tag (genre / search tags; always a link to results) ---------- */
.pb-tags { display: flex; flex-wrap: wrap; gap: var(--pb-space-3); }
.pb-tag {
  display: inline-flex; align-items: center; gap: var(--pb-space-2); padding: 3px 8px; border-radius: var(--pb-radius-sm);
  background: var(--pb-surface-raised); color: var(--pb-text-secondary); font-size: var(--pb-text-sm); text-decoration: none;
}
a.pb-tag:hover { background: var(--pb-border); color: var(--pb-text); }
.pb-tag[aria-pressed="true"] { background: var(--pb-accent); color: var(--pb-on-accent); }
button.pb-tag { border: 0; cursor: pointer; }

/* ---------- Content label (moderated declarations; not tags) ---------- */
.pb-label {
  display: inline-flex; align-items: center; gap: var(--pb-space-3); padding: 3px 8px; border-radius: var(--pb-radius-sm);
  font-size: var(--pb-text-sm); color: var(--pb-text-secondary); box-shadow: inset 0 0 0 1px var(--pb-border-strong);
}
.pb-label svg.pb-icon { width: var(--pb-icon-sm); height: var(--pb-icon-sm); }
.pb-label--warning { color: var(--pb-warning); box-shadow: inset 0 0 0 1px var(--pb-warning); }

/* ---------- Status (dot + words; never colour alone) ---------- */
.pb-status { display: inline-flex; align-items: center; gap: var(--pb-space-3); font-size: var(--pb-text-md); color: var(--pb-text-muted); }
.pb-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--pb-text-subtle); flex: none; }
.pb-status--live { color: var(--pb-live); }
.pb-status--live::before { background: var(--pb-live); }
.pb-status--warning { color: var(--pb-warning); }
.pb-status--warning::before { background: var(--pb-warning); }
.pb-status--danger { color: var(--pb-danger); }
.pb-status--danger::before { background: var(--pb-danger); }
.pb-status--info { color: var(--pb-info); }
.pb-status--info::before { background: var(--pb-info); }
.pb-status--accent { color: var(--pb-accent); }
.pb-status--accent::before { background: var(--pb-accent); }

/* ---------- Facet group (browse filters) ---------- */
.pb-facet { padding: 0 var(--pb-space-5); display: grid; gap: var(--pb-space-3); }
/* ---------- Fact (icon + short text) ---------- */
.pb-facts { display: flex; flex-wrap: wrap; gap: var(--pb-space-3) var(--pb-space-7); color: var(--pb-text-muted); font-size: var(--pb-text-md); }
.pb-fact { display: inline-flex; align-items: center; gap: var(--pb-space-3); }
.pb-fact svg.pb-icon { width: var(--pb-icon-sm); height: var(--pb-icon-sm); }
.pb-fact--strong { color: var(--pb-text); font-weight: var(--pb-weight-medium); }

/* ---------- Avatar ---------- */
.pb-avatar {
  position: relative; display: inline-grid; place-items: center; flex: none; width: var(--pb-avatar-md); height: var(--pb-avatar-md);
  border-radius: var(--pb-radius); color: var(--pb-on-identity); font-weight: var(--pb-weight-bold); font-size: var(--pb-text-md); line-height: 1; overflow: visible;
  text-decoration: none;
}
button.pb-avatar { border: 0; cursor: pointer; padding: 0; }
.pb-avatar--c1 { background: var(--pb-id-1); }
.pb-avatar--c2 { background: var(--pb-id-2); }
.pb-avatar--c3 { background: var(--pb-id-3); }
.pb-avatar--c4 { background: var(--pb-id-4); }
.pb-avatar--c5 { background: var(--pb-id-5); }
.pb-avatar--c6 { background: var(--pb-id-6); }
.pb-avatar--c7 { background: var(--pb-id-7); }
.pb-avatar--c8 { background: var(--pb-id-8); }
.pb-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.pb-avatar--xs { width: var(--pb-avatar-xs); height: var(--pb-avatar-xs); font-size: var(--pb-text-2xs); border-radius: var(--pb-radius-sm); }
.pb-avatar--sm { width: var(--pb-avatar-sm); height: var(--pb-avatar-sm); font-size: var(--pb-text-xs); }
.pb-avatar--lg { width: var(--pb-avatar-lg); height: var(--pb-avatar-lg); font-size: var(--pb-text-2xl); border-radius: var(--pb-radius-lg); }
.pb-avatar--xl { width: var(--pb-avatar-xl); height: var(--pb-avatar-xl); font-size: var(--pb-text-4xl); border-radius: var(--pb-radius-lg); }
.pb-avatar[data-presence="playing"], .pb-avatar[data-presence="online"] { box-shadow: 0 0 0 2px var(--pb-bg), 0 0 0 4px var(--pb-live); }
.pb-avatar[data-presence="offline"] { opacity: .6; }
.pb-avatars { display: inline-flex; }
.pb-avatars .pb-avatar { box-shadow: 0 0 0 2px var(--pb-surface); }
.pb-avatars .pb-avatar + .pb-avatar { margin-left: -6px; }

/* ---------- Points ---------- */
.pb-points { display: inline-flex; align-items: center; gap: var(--pb-space-3); font-weight: var(--pb-weight-medium); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pb-points svg.pb-icon { color: var(--pb-accent); }
.pb-points--lg { font-size: var(--pb-text-4xl); font-weight: var(--pb-weight-black); font-stretch: var(--pb-stretch-narrow); line-height: 1; gap: var(--pb-space-5); }
.pb-points--lg svg.pb-icon { width: var(--pb-icon-xl); height: var(--pb-icon-xl); }

/* ---------- Form fields ---------- */
.pb-field { display: grid; gap: var(--pb-space-3); min-width: 0; }
.pb-field__label { font-size: var(--pb-text-md); font-weight: var(--pb-weight-medium); color: var(--pb-text-secondary); }
.pb-field__hint { font-size: var(--pb-text-sm); color: var(--pb-text-muted); }
.pb-field__error { font-size: var(--pb-text-sm); color: var(--pb-danger); display: flex; gap: var(--pb-space-3); align-items: center; }
.pb-field__error svg.pb-icon { width: var(--pb-icon-sm); height: var(--pb-icon-sm); }
.pb-field__row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--pb-space-6); }
.pb-input, .pb-select, .pb-textarea {
  width: 100%; min-height: var(--pb-control-md); padding: 0 var(--pb-space-6); border-radius: var(--pb-radius);
  border: var(--pb-border-width) solid var(--pb-border-control); background: var(--pb-bg-sunken); color: var(--pb-text);
}
.pb-textarea { padding: var(--pb-space-5) var(--pb-space-6); min-height: 120px; resize: vertical; line-height: var(--pb-leading-body); }
.pb-select { appearance: none; padding-right: 36px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--pb-text-muted) 50%), linear-gradient(135deg, var(--pb-text-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.pb-input::placeholder, .pb-textarea::placeholder { color: var(--pb-text-subtle); }
.pb-input:focus, .pb-select:focus, .pb-textarea:focus { outline: none; border-color: var(--pb-accent); box-shadow: 0 0 0 1px var(--pb-accent); }
.pb-field[data-invalid] .pb-input, .pb-field[data-invalid] .pb-textarea, .pb-field[data-invalid] .pb-select { border-color: var(--pb-danger); }
.pb-input:disabled { opacity: .55; }
.pb-input-wrap { position: relative; }
.pb-input-wrap > svg.pb-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--pb-text-muted); pointer-events: none; }
.pb-input-wrap > .pb-input { padding-left: 38px; }
.pb-input-wrap > .pb-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.pb-input-wrap--trail > .pb-input { padding-right: 52px; }
.pb-check { display: flex; align-items: flex-start; gap: var(--pb-space-5); min-height: 36px; padding: var(--pb-space-3) 0; cursor: pointer; }
.pb-check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--pb-accent); flex: none; }
.pb-check__text { display: grid; gap: var(--pb-space-1); }
.pb-check__hint { font-size: var(--pb-text-sm); color: var(--pb-text-muted); }
.pb-check:has(input:disabled) { cursor: default; }
.pb-switch { display: flex; align-items: center; justify-content: space-between; gap: var(--pb-space-7); min-height: var(--pb-control-md); cursor: pointer; }
.pb-switch input { appearance: none; width: 44px; height: 26px; border-radius: 13px; background: var(--pb-border-strong); position: relative; cursor: pointer; flex: none; margin: 0; transition: background-color var(--pb-dur) var(--pb-ease); }
.pb-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--pb-text); transition: transform var(--pb-dur) var(--pb-ease); }
.pb-switch input:checked { background: var(--pb-accent); }
.pb-switch input:checked::after { transform: translateX(18px); background: var(--pb-on-accent); }
.pb-otp { display: flex; gap: var(--pb-space-4); }
.pb-otp input { width: 48px; height: 56px; text-align: center; font-size: var(--pb-text-2xl); font-weight: var(--pb-weight-bold); border-radius: var(--pb-radius); border: 1px solid var(--pb-border-control); background: var(--pb-bg-sunken); }
.pb-otp input:focus { outline: none; border-color: var(--pb-accent); box-shadow: 0 0 0 1px var(--pb-accent); }
.pb-choice { display: grid; gap: var(--pb-space-4); }
.pb-choice label { display: flex; align-items: center; gap: var(--pb-space-6); padding: var(--pb-space-6) var(--pb-space-7); border-radius: var(--pb-radius); background: var(--pb-surface); box-shadow: inset 0 0 0 1px var(--pb-border); cursor: pointer; }
.pb-choice label:has(input:checked) { box-shadow: inset 0 0 0 2px var(--pb-accent); background: var(--pb-surface-raised); }
.pb-choice input { accent-color: var(--pb-accent); width: 18px; height: 18px; margin: 0; flex: none; }
.pb-choice__main { flex: 1; display: grid; gap: var(--pb-space-1); }
.pb-choice__main b { font-weight: var(--pb-weight-bold); }
.pb-choice__main span { font-size: var(--pb-text-sm); color: var(--pb-text-muted); }
.pb-choice__end { font-weight: var(--pb-weight-bold); white-space: nowrap; }
.pb-drop { display: grid; place-items: center; gap: var(--pb-space-4); padding: var(--pb-space-9); border-radius: var(--pb-radius); border: 1px dashed var(--pb-border-control); background: var(--pb-bg-sunken); text-align: center; color: var(--pb-text-muted); }
/* Tag picker: chosen tags, a filter field and suggestions from the registry. */
.pb-tagpicker { display: grid; gap: var(--pb-space-4); }
.pb-copy { display: flex; align-items: center; gap: var(--pb-space-4); padding: var(--pb-space-3) var(--pb-space-3) var(--pb-space-3) var(--pb-space-6); border-radius: var(--pb-radius); background: var(--pb-bg-sunken); border: 1px solid var(--pb-border-control); }
.pb-copy code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: inherit; font-weight: var(--pb-weight-medium); letter-spacing: .02em; }
.pb-copy--block { align-items: flex-start; }
.pb-copy--block code { white-space: pre-wrap; overflow-wrap: anywhere; text-overflow: clip; line-height: 1.5; padding: var(--pb-space-2) 0; font-weight: var(--pb-weight-regular); letter-spacing: 0; }

/* ---------- Tabs ---------- */
.pb-tabs { display: flex; gap: var(--pb-space-1); border-bottom: 1px solid var(--pb-border); overflow-x: auto; scrollbar-width: none; }
.pb-tabs__tab {
  display: inline-flex; align-items: center; gap: var(--pb-space-3); padding: var(--pb-space-5) var(--pb-space-7) var(--pb-space-6);
  border: 0; background: none; color: var(--pb-text-muted); text-decoration: none; cursor: pointer; white-space: nowrap;
  font-size: var(--pb-text-lg); font-weight: var(--pb-weight-bold); font-stretch: var(--pb-stretch-condensed); line-height: 1;
  box-shadow: inset 0 -3px 0 transparent;
}
.pb-tabs__tab:hover { color: var(--pb-text); }
.pb-tabs__tab[aria-selected="true"], .pb-tabs__tab[aria-current="page"] { color: var(--pb-text); box-shadow: inset 0 -3px 0 var(--pb-accent); }

/* ---------- Headings ---------- */
.pb-page { display: flex; flex-direction: column; gap: var(--pb-space-9); min-width: 0; }
.pb-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--pb-space-7); }
.pb-page-head__title { font-size: var(--pb-text-4xl); font-weight: var(--pb-weight-black); font-stretch: var(--pb-stretch-narrow); line-height: var(--pb-leading-tight); text-wrap: balance; }
.pb-page-head__sub { margin-top: var(--pb-space-4); color: var(--pb-text-muted); max-width: var(--pb-readable); }
/* Heading: titles inside content (cards, dialogs, wait screens). Page and section titles use their own heads. */
.pb-heading { font-weight: var(--pb-weight-bold); font-stretch: var(--pb-stretch-condensed); font-size: var(--pb-text-xl); line-height: var(--pb-leading-snug); overflow-wrap: anywhere; }
.pb-heading--lg { font-size: var(--pb-text-2xl); font-weight: var(--pb-weight-black); font-stretch: var(--pb-stretch-narrow); line-height: var(--pb-leading-tight); }
.pb-heading--xl { font-size: var(--pb-text-3xl); font-weight: var(--pb-weight-black); font-stretch: var(--pb-stretch-narrow); line-height: var(--pb-leading-tight); }
.pb-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--pb-space-6); margin-bottom: var(--pb-space-6); }
.pb-section-head__title { font-size: var(--pb-text-2xl); font-weight: var(--pb-weight-bold); font-stretch: var(--pb-stretch-condensed); line-height: var(--pb-leading-snug); }
.pb-section-head__title--sm { font-size: var(--pb-text-base); color: var(--pb-text-muted); font-weight: var(--pb-weight-bold); font-stretch: var(--pb-stretch-condensed); }
.pb-section-head a { font-size: var(--pb-text-md); font-weight: var(--pb-weight-medium); }
.pb-crumbs { display: flex; flex-wrap: wrap; gap: var(--pb-space-3); font-size: var(--pb-text-md); color: var(--pb-text-muted); margin-bottom: var(--pb-space-6); }
.pb-crumbs a { text-decoration: none; }
.pb-crumbs a:hover { text-decoration: underline; }
.pb-crumbs li { list-style: none; display: inline-flex; gap: var(--pb-space-3); }
.pb-crumbs li + li::before { content: "/"; color: var(--pb-text-subtle); }
.pb-crumbs ol { display: contents; }

/* ---------- Panel ---------- */
.pb-panel { background: var(--pb-surface); border-radius: var(--pb-radius); padding: var(--pb-space-7); min-width: 0; }
.pb-panel--flush { padding: 0; overflow: hidden; }
.pb-panel--outline { background: transparent; box-shadow: inset 0 0 0 1px var(--pb-border); }
.pb-panel__head { margin-bottom: var(--pb-space-4); }
.pb-panel__title { font-size: var(--pb-text-xl); font-weight: var(--pb-weight-bold); font-stretch: var(--pb-stretch-condensed); line-height: var(--pb-leading-snug); margin-bottom: var(--pb-space-4); }

/* ---------- Item (the one list-row primitive: people, rooms, notifications, releases, sessions) ---------- */
.pb-list { display: grid; }
.pb-list--gap { gap: var(--pb-space-2); }
.pb-list--divided > .pb-item + .pb-item { border-top: 1px solid var(--pb-border); }
.pb-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--pb-space-6); padding: var(--pb-space-5) 0; min-width: 0; }
.pb-list--gap > .pb-item { padding: var(--pb-space-5) var(--pb-space-6); background: var(--pb-surface); border-radius: var(--pb-radius); }
.pb-item--nolead { grid-template-columns: minmax(0, 1fr) auto; }
.pb-item__lead { display: flex; }
.pb-item__lead--icon { width: var(--pb-avatar-md); height: var(--pb-avatar-md); border-radius: var(--pb-radius); background: var(--pb-surface-raised); display: grid; place-items: center; color: var(--pb-text-secondary); }
.pb-item__title { font-weight: var(--pb-weight-medium); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-item__title a { text-decoration: none; }
.pb-item__name { all: unset; cursor: pointer; border-radius: var(--pb-radius-sm); }
.pb-item__name:hover { text-decoration: underline; }
.pb-item__name:focus-visible { outline: var(--pb-focus-ring) solid var(--pb-focus); outline-offset: 2px; }
.pb-item__title a:hover { text-decoration: underline; }
.pb-item__meta { font-size: var(--pb-text-sm); color: var(--pb-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-item__meta--live { color: var(--pb-live); }
.pb-item__meta--wrap { white-space: normal; }
.pb-item__trail { display: flex; align-items: center; gap: var(--pb-space-3); }
.pb-item__body, .pb-row__body, .pb-pcard__who { min-width: 0; }
.pb-item__lead .pb-thumb { width: 96px; }
.pb-item[data-unread]::before { content: ""; position: absolute; }
.pb-item--unread .pb-item__title::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--pb-accent); margin-left: var(--pb-space-4); vertical-align: middle; }

/* ---------- Thumbnail ---------- */
.pb-thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--pb-radius-sm); overflow: hidden; background: var(--pb-bg-sunken); }
.pb-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pb-thumb__corner { position: absolute; left: 6px; top: 6px; display: flex; gap: var(--pb-space-2); }
.pb-thumb__empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--pb-text-subtle); background: linear-gradient(135deg, var(--pb-night-800), var(--pb-night-900)); }
.pb-thumb__empty svg.pb-icon { width: 34%; max-width: 64px; height: auto; aspect-ratio: 1; stroke-width: 1.5; }
/* Chip: tiny fact on top of media or next to a name (Sample, New, Owned). Not a tag, not a button. */
.pb-chip { display: inline-block; padding: 2px 6px; border-radius: 3px; background: var(--pb-media-chip); color: var(--pb-text-secondary); font-size: var(--pb-text-xs); font-weight: var(--pb-weight-medium); line-height: 1.4; vertical-align: middle; }
.pb-chip--accent { background: var(--pb-accent); color: var(--pb-on-accent); }

/* ---------- Game row (main list unit) ---------- */
.pb-rows { display: grid; gap: var(--pb-space-2); }
.pb-row {
  position: relative; display: grid; grid-template-columns: 176px minmax(0, 1fr) 140px 84px; gap: var(--pb-space-7); align-items: center;
  padding: var(--pb-space-3) var(--pb-space-7) var(--pb-space-3) var(--pb-space-3); border-radius: var(--pb-radius); background: var(--pb-surface);
}
.pb-row:hover { background: var(--pb-surface-raised); }
.pb-row__title { font-size: var(--pb-text-xl); font-weight: var(--pb-weight-bold); font-stretch: var(--pb-stretch-condensed); line-height: var(--pb-leading-snug); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-row__title a { text-decoration: none; }
.pb-row__title a::after { content: ""; position: absolute; inset: 0; border-radius: var(--pb-radius); }
.pb-row__title a:focus-visible { outline: none; }
.pb-row__title a:focus-visible::after { outline: var(--pb-focus-ring) solid var(--pb-focus); outline-offset: 2px; }
.pb-row__meta { font-size: var(--pb-text-sm); color: var(--pb-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-row__line { font-size: var(--pb-text-sm); color: var(--pb-text-secondary); margin-top: var(--pb-space-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-row__players { display: grid; gap: var(--pb-space-1); font-size: var(--pb-text-sm); color: var(--pb-text-muted); }
.pb-row__end { display: grid; gap: var(--pb-space-2); justify-items: end; font-size: var(--pb-text-sm); color: var(--pb-text-muted); }
.pb-row__compact { display: none; }
.pb-row--manage { grid-template-columns: 176px minmax(0, 1fr) auto; }
.pb-row__chips { display: flex; flex-wrap: wrap; gap: var(--pb-space-4); margin-top: var(--pb-space-2); }

/* ---------- Game tile (grids: library, creator page, related) ---------- */
.pb-tile { position: relative; display: grid; gap: var(--pb-space-3); min-width: 0; }
.pb-tile__title { font-size: var(--pb-text-lg); font-weight: var(--pb-weight-bold); font-stretch: var(--pb-stretch-condensed); line-height: var(--pb-leading-snug); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: var(--pb-space-2); }
.pb-tile__title a { text-decoration: none; }
.pb-tile__title a::after { content: ""; position: absolute; inset: 0; }
.pb-tile:hover .pb-thumb { box-shadow: 0 0 0 2px var(--pb-text-muted); }
.pb-tile__meta { font-size: var(--pb-text-sm); color: var(--pb-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Spotlight (one featured game) ---------- */
.pb-spot { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); background: var(--pb-surface); border-radius: var(--pb-radius); overflow: hidden; }
.pb-spot__media { position: relative; min-height: 320px; background: var(--pb-bg-sunken); }
.pb-spot__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pb-spot__body { display: flex; flex-direction: column; gap: var(--pb-space-6); padding: var(--pb-space-8) var(--pb-space-9); min-width: 0; }
.pb-spot__kicker { font-size: var(--pb-text-md); color: var(--pb-text-muted); }
.pb-spot__title { font-size: var(--pb-text-4xl); font-weight: var(--pb-weight-black); font-stretch: var(--pb-stretch-narrow); line-height: var(--pb-leading-tight); text-wrap: balance; }
.pb-spot__title a { color: inherit; text-decoration: none; }
.pb-spot__title a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.pb-spot__text { color: var(--pb-text-secondary); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.pb-spot__actions { margin-top: auto; }
.pb-spot-picker { display: flex; gap: var(--pb-space-4); margin-top: var(--pb-space-5); overflow-x: auto; scrollbar-width: none; }
.pb-spot-picker button { flex: none; width: 120px; padding: 0; border: 0; border-radius: var(--pb-radius-sm); overflow: hidden; cursor: pointer; opacity: .55; background: none; }
.pb-spot-picker button[aria-current="true"] { opacity: 1; box-shadow: 0 0 0 2px var(--pb-accent); }
.pb-spot-picker button:hover { opacity: 1; }

/* ---------- Category navigation (side list) and directory cards ---------- */
.pb-catnav { display: grid; gap: var(--pb-space-1); }
.pb-catnav__item {
  display: flex; align-items: center; gap: var(--pb-space-5); min-height: 36px; padding: 0 var(--pb-space-5); border: 0; background: none;
  border-radius: var(--pb-radius); text-align: left; text-decoration: none; cursor: pointer; color: var(--pb-text);
}
.pb-catnav__item:hover { background: var(--pb-surface); }
.pb-catnav__item[aria-current="true"] { background: var(--pb-surface-raised); box-shadow: inset 3px 0 0 var(--pb-accent); font-weight: var(--pb-weight-medium); }
.pb-catnav__item svg.pb-icon { color: var(--pb-text-muted); width: 17px; height: 17px; }
.pb-subnav a .pb-badge { margin-left: auto; }
.pb-catnav__count { margin-left: auto; color: var(--pb-text-muted); font-size: var(--pb-text-sm); font-variant-numeric: tabular-nums; }
.pb-catnav__item--empty { color: var(--pb-text-muted); }
.pb-catcard {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: var(--pb-space-2) var(--pb-space-6); padding: var(--pb-space-7);
  border-radius: var(--pb-radius); background: var(--pb-surface); text-decoration: none; min-height: 84px;
}
.pb-catcard:hover { background: var(--pb-surface-raised); }
.pb-catcard__icon { grid-row: span 2; width: 44px; height: 44px; border-radius: var(--pb-radius); display: grid; place-items: center; background: var(--pb-surface-raised); color: var(--pb-accent); }
.pb-catcard__icon svg.pb-icon { width: var(--pb-icon-lg); height: var(--pb-icon-lg); }
.pb-catcard__name { font-weight: var(--pb-weight-bold); font-size: var(--pb-text-lg); font-stretch: var(--pb-stretch-condensed); line-height: var(--pb-leading-snug); }
.pb-catcard__count { font-size: var(--pb-text-sm); color: var(--pb-text-muted); }
.pb-catcard--empty .pb-catcard__icon { color: var(--pb-text-subtle); }

/* ---------- Player card (opens from any player name, roster entry or avatar) ---------- */
.pb-pcard { display: grid; gap: var(--pb-space-7); }
.pb-pcard__head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--pb-space-7); align-items: center; }
.pb-pcard__name { font-size: var(--pb-text-2xl); font-weight: var(--pb-weight-black); font-stretch: var(--pb-stretch-narrow); line-height: var(--pb-leading-tight); overflow-wrap: anywhere; }
.pb-pcard__actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--pb-space-4); }
.pb-pcard__actions .pb-btn:only-child, .pb-pcard__actions .pb-btn--wide { grid-column: 1 / -1; }
.pb-pcard__safety { display: flex; flex-wrap: wrap; gap: var(--pb-space-2); border-top: 1px solid var(--pb-border); padding-top: var(--pb-space-5); }

/* ---------- Notice (inline banner) ---------- */
.pb-notice { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--pb-space-6); align-items: start; padding: var(--pb-space-6) var(--pb-space-7); border-radius: var(--pb-radius); background: var(--pb-surface); box-shadow: inset 3px 0 0 var(--pb-info); }
.pb-notice > svg.pb-icon { color: var(--pb-info); margin-top: 2px; }
.pb-notice__title { font-weight: var(--pb-weight-bold); }
.pb-notice__text { color: var(--pb-text-secondary); font-size: var(--pb-text-md); }
.pb-notice--success { box-shadow: inset 3px 0 0 var(--pb-live); } .pb-notice--success > svg.pb-icon { color: var(--pb-live); }
.pb-notice--warning { box-shadow: inset 3px 0 0 var(--pb-warning); } .pb-notice--warning > svg.pb-icon { color: var(--pb-warning); }
.pb-notice--danger { box-shadow: inset 3px 0 0 var(--pb-danger); } .pb-notice--danger > svg.pb-icon { color: var(--pb-danger); }

/* ---------- Empty / error / loading ---------- */
.pb-empty { display: grid; justify-items: start; gap: var(--pb-space-4); padding: var(--pb-space-10) var(--pb-space-9); border-radius: var(--pb-radius); background: var(--pb-surface); }
.pb-empty > svg.pb-icon { width: var(--pb-icon-xl); height: var(--pb-icon-xl); color: var(--pb-text-muted); margin-bottom: var(--pb-space-3); }
.pb-empty__title { font-size: var(--pb-text-2xl); font-weight: var(--pb-weight-bold); font-stretch: var(--pb-stretch-condensed); line-height: var(--pb-leading-snug); }
.pb-empty__text { color: var(--pb-text-muted); max-width: var(--pb-readable); }
.pb-empty__actions { margin-top: var(--pb-space-4); }
.pb-empty--center { justify-items: center; text-align: center; }
.pb-skel--media { aspect-ratio: 16 / 9; }
.pb-skel--title { height: 18px; width: 55%; }
.pb-skel--line { height: 12px; width: 80%; }
.pb-skel--cell { height: 12px; }
.pb-skel { background: var(--pb-surface-raised); border-radius: var(--pb-radius-sm); animation: pb-pulse 1.4s ease-in-out infinite; }
@keyframes pb-pulse { 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .pb-skel { animation: none; } }

/* ---------- Floating layers: menu, dialog, sheet, toast ---------- */
.pb-menu {
  position: absolute; z-index: var(--pb-z-menu); min-width: 260px; max-width: min(380px, calc(100vw - 24px));
  background: var(--pb-surface-raised); border-radius: var(--pb-radius); box-shadow: var(--pb-shadow-float), inset 0 0 0 1px var(--pb-border-strong);
  padding: var(--pb-space-3);
}
.pb-menu--inline { position: static; }
.pb-menu-backdrop { position: fixed; inset: 0; z-index: var(--pb-z-menu); }
.pb-menu--header { position: fixed; top: calc(var(--pb-header-h) - 4px); right: max(12px, calc((100vw - var(--pb-container)) / 2 + 12px)); }
.pb-menu--panel { width: 380px; padding: var(--pb-space-6); display: grid; gap: var(--pb-space-4); }
.pb-menu__item { display: flex; align-items: center; gap: var(--pb-space-5); width: 100%; min-height: 40px; padding: 0 var(--pb-space-5); border: 0; background: none; border-radius: var(--pb-radius-sm); text-align: left; text-decoration: none; cursor: pointer; color: var(--pb-text); }
.pb-menu__item:hover { background: var(--pb-border); }
.pb-menu__item svg.pb-icon { color: var(--pb-text-muted); }
.pb-menu__item--danger { color: var(--pb-danger); }
.pb-menu__sep { height: 1px; background: var(--pb-border-strong); margin: var(--pb-space-3) 0; }
.pb-menu__head { padding: var(--pb-space-5); display: flex; gap: var(--pb-space-5); align-items: center; }

.pb-scrim { position: fixed; inset: 0; z-index: var(--pb-z-dialog); background: var(--pb-scrim); display: grid; place-items: center; padding: var(--pb-gutter); }
.pb-dialog {
  width: min(480px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--pb-surface); border-radius: var(--pb-radius-lg);
  box-shadow: var(--pb-shadow-float), inset 0 0 0 1px var(--pb-border); padding: var(--pb-space-9);
  display: grid; gap: var(--pb-space-7);
}
.pb-dialog--wide { width: min(720px, 100%); }
.pb-dialog__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--pb-space-6); }
.pb-dialog__title { font-size: var(--pb-text-2xl); font-weight: var(--pb-weight-black); font-stretch: var(--pb-stretch-narrow); line-height: var(--pb-leading-tight); }
.pb-dialog__foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--pb-space-4); }
.pb-sheet {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: var(--pb-z-dialog); width: min(400px, 100%); background: var(--pb-surface);
  box-shadow: var(--pb-shadow-float); display: grid; grid-template-rows: auto minmax(0, 1fr); border-left: 1px solid var(--pb-border);
}
.pb-sheet__head { display: flex; justify-content: space-between; align-items: center; gap: var(--pb-space-6); padding: var(--pb-space-6) var(--pb-space-6) 0 var(--pb-space-8); }
.pb-sheet__body { overflow: auto; padding: var(--pb-space-6) var(--pb-space-8) var(--pb-space-9); }
.pb-sheet__foot { display: flex; flex-wrap: wrap; gap: var(--pb-space-4); margin-top: var(--pb-space-10); padding-top: var(--pb-space-7); border-top: 1px solid var(--pb-border); }
.pb-sheet-scrim { position: fixed; inset: 0; z-index: calc(var(--pb-z-dialog) - 1); background: var(--pb-scrim); }
@media (max-width: 899px) {
  .pb-sheet { top: auto; left: 0; width: 100%; max-height: 85vh; border-left: 0; border-radius: var(--pb-radius-lg) var(--pb-radius-lg) 0 0; }
  .pb-scrim { place-items: end center; padding: 0; }
  .pb-dialog { border-radius: var(--pb-radius-lg) var(--pb-radius-lg) 0 0; width: 100%; max-height: 90vh; padding: var(--pb-space-8) var(--pb-gutter) calc(var(--pb-space-8) + env(safe-area-inset-bottom)); }
}

.pb-toasts { position: fixed; z-index: var(--pb-z-toast); left: 50%; bottom: var(--pb-space-9); transform: translateX(-50%); display: grid; gap: var(--pb-space-4); width: min(440px, calc(100vw - 32px)); }
.pb-toast { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--pb-space-6); align-items: center; padding: var(--pb-space-6) var(--pb-space-6) var(--pb-space-6) var(--pb-space-7); border-radius: var(--pb-radius); background: var(--pb-night-100); color: var(--pb-night-900); box-shadow: var(--pb-shadow-float); font-weight: var(--pb-weight-medium); }
.pb-toast svg.pb-icon { color: var(--pb-night-700); }
.pb-toast .pb-btn--ghost { color: var(--pb-night-900); }
.pb-toast .pb-btn--ghost:hover { background: var(--pb-night-200); }
@media (max-width: 899px) { .pb-toasts { bottom: calc(80px + env(safe-area-inset-bottom)); } }

/* ---------- Data display ---------- */
.pb-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--pb-space-4) var(--pb-space-9); margin: 0; }
.pb-kv dt { color: var(--pb-text-muted); font-size: var(--pb-text-md); }
.pb-kv dd { margin: 0; overflow-wrap: anywhere; }
.pb-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--pb-space-4); }
.pb-stat { background: var(--pb-surface); border-radius: var(--pb-radius); padding: var(--pb-space-7); display: grid; gap: var(--pb-space-2); }
.pb-stat__value { font-size: var(--pb-text-3xl); font-weight: var(--pb-weight-black); font-stretch: var(--pb-stretch-narrow); line-height: 1; font-variant-numeric: tabular-nums; }
.pb-stat__label { font-size: var(--pb-text-sm); color: var(--pb-text-muted); }
.pb-table-wrap { overflow-x: auto; border-radius: var(--pb-radius); background: var(--pb-surface); }
.pb-table { width: 100%; border-collapse: collapse; font-size: var(--pb-text-md); }
.pb-table th { text-align: left; font-weight: var(--pb-weight-medium); color: var(--pb-text-muted); font-size: var(--pb-text-sm); padding: var(--pb-space-5) var(--pb-space-7); border-bottom: 1px solid var(--pb-border); white-space: nowrap; }
.pb-table td { padding: var(--pb-space-5) var(--pb-space-7); border-bottom: 1px solid var(--pb-border); vertical-align: middle; }
.pb-table tr:last-child td { border-bottom: 0; }
.pb-table .pb-table__num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pb-progress { display: grid; gap: var(--pb-space-3); }
.pb-progress__bar { height: 10px; border-radius: 5px; background: var(--pb-bg-sunken); box-shadow: inset 0 0 0 1px var(--pb-border); overflow: hidden; }
.pb-progress__svg { display: block; width: 100%; height: 100%; }
.pb-progress__fill { fill: var(--pb-accent); }
.pb-progress__label { display: flex; justify-content: space-between; font-size: var(--pb-text-sm); color: var(--pb-text-muted); }
.pb-steps { display: flex; gap: var(--pb-space-4); list-style: none; padding: 0; margin: 0 0 var(--pb-space-9); counter-reset: step; flex-wrap: wrap; }
.pb-steps li { counter-increment: step; display: flex; align-items: center; gap: var(--pb-space-4); color: var(--pb-text-muted); font-size: var(--pb-text-md); }
.pb-steps li::before { content: counter(step); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--pb-border-strong); font-weight: var(--pb-weight-bold); font-size: var(--pb-text-sm); }
.pb-steps li + li { padding-left: var(--pb-space-4); border-left: 1px solid var(--pb-border); }
.pb-steps li[aria-current="step"] { color: var(--pb-text); font-weight: var(--pb-weight-medium); }
.pb-steps li[aria-current="step"]::before { background: var(--pb-accent); color: var(--pb-on-accent); box-shadow: none; }
.pb-steps li[data-done]::before { content: "✓"; background: var(--pb-surface-raised); color: var(--pb-live); }

/* ---------- App frame ---------- */
.pb-header { position: sticky; top: 0; z-index: var(--pb-z-header); background: var(--pb-surface); border-bottom: 1px solid var(--pb-border); }
.pb-header__in { max-width: var(--pb-container); margin: 0 auto; height: var(--pb-header-h); padding: 0 var(--pb-gutter); display: flex; align-items: center; gap: var(--pb-space-10); }
.pb-header__search { margin-left: auto; width: 320px; }
.pb-header__acts { display: flex; align-items: center; gap: var(--pb-space-2); position: relative; }
.pb-nav { display: flex; height: 100%; }
.pb-nav__link {
  display: flex; align-items: center; gap: var(--pb-space-3); padding: 0 var(--pb-space-7); height: 100%; text-decoration: none;
  font-size: var(--pb-text-lg); font-weight: var(--pb-weight-medium); font-stretch: var(--pb-stretch-condensed); color: var(--pb-text-muted);
  box-shadow: inset 0 -3px 0 transparent;
}
.pb-nav__link:hover { color: var(--pb-text); }
.pb-nav__link[aria-current="page"] { color: var(--pb-text); box-shadow: inset 0 -3px 0 var(--pb-accent); }
.pb-hdr-btn { position: relative; display: grid; place-items: center; width: var(--pb-control-md); height: var(--pb-control-md); border: 0; background: none; border-radius: var(--pb-radius); cursor: pointer; color: var(--pb-text); text-decoration: none; }
.pb-hdr-btn:hover { background: var(--pb-surface-raised); }
.pb-hdr-btn .pb-badge { position: absolute; top: 6px; right: 4px; }
.pb-hdr-btn .pb-badge--dot { top: 10px; right: 10px; }
.pb-hdr-points { display: inline-flex; align-items: center; height: 40px; padding: 0 var(--pb-space-6); border-radius: var(--pb-radius); background: var(--pb-bg); box-shadow: inset 0 0 0 1px var(--pb-border); text-decoration: none; margin-right: var(--pb-space-3); }
.pb-hdr-points__label { margin-left: var(--pb-space-2); }
.pb-hdr-points:hover { box-shadow: inset 0 0 0 1px var(--pb-text-muted); }
.pb-tabbar { display: none; }
/* Creator guide */
.pb-guide-paths { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--pb-space-6); margin-bottom: var(--pb-space-11); }
.pb-guide-path { display: grid; grid-template-columns: auto 1fr; gap: var(--pb-space-2) var(--pb-space-6); align-items: center; padding: var(--pb-space-8); border-radius: var(--pb-radius-lg); background: var(--pb-surface); border: 1px solid var(--pb-border); color: var(--pb-text); text-decoration: none; transition: border-color .15s, transform .15s; }
.pb-guide-path:hover, .pb-guide-path:focus-visible { border-color: var(--pb-accent); transform: translateY(-2px); }
.pb-guide-path__icon { grid-row: span 2; display: grid; place-items: center; width: 52px; height: 52px; border-radius: var(--pb-radius); background: var(--pb-accent-soft); color: var(--pb-accent); }
.pb-guide-path__icon svg.pb-icon { width: var(--pb-icon-lg); height: var(--pb-icon-lg); }
.pb-guide-path__title { font-size: var(--pb-text-xl); font-weight: var(--pb-weight-bold); }
.pb-guide-path__text { color: var(--pb-text-secondary); }
.pb-guide-steps { list-style: none; margin: 0 0 var(--pb-space-12); padding: 0; display: grid; gap: var(--pb-space-11); }
.pb-guide-step { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--pb-space-9); align-items: start; }
.pb-guide-step--text { grid-template-columns: minmax(0, 1fr); max-width: var(--pb-readable); }
.pb-guide-step__body { display: grid; gap: var(--pb-space-5); align-content: start; justify-items: start; padding-top: var(--pb-space-4); }
.pb-guide-step__body > .pb-field, .pb-guide-step__body > .pb-copy { justify-self: stretch; }
.pb-guide-step__n { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--pb-accent); color: var(--pb-on-accent); font-weight: var(--pb-weight-black); font-size: var(--pb-text-lg); }
.pb-guide-step__title { margin: 0; font-size: var(--pb-text-2xl); line-height: 1.15; }
.pb-guide-step__text { margin: 0; color: var(--pb-text-secondary); font-size: var(--pb-text-lg); line-height: 1.55; }
.pb-shot { margin: 0; border-radius: var(--pb-radius-lg); overflow: hidden; border: 1px solid var(--pb-border-strong); box-shadow: var(--pb-shadow-float); background: var(--pb-bg-sunken); }
.pb-shot a { display: block; cursor: zoom-in; }
.pb-shot img { display: block; width: 100%; height: auto; }
.pb-shot--narrow { max-width: 560px; }
.pb-footer { max-width: var(--pb-container); margin: 0 auto; padding: var(--pb-space-8) var(--pb-gutter) var(--pb-space-11); display: flex; flex-wrap: wrap; gap: var(--pb-space-4) var(--pb-space-8); color: var(--pb-text-muted); font-size: var(--pb-text-sm); border-top: 1px solid var(--pb-border); }
.pb-footer .pb-disclosure__body { max-width: var(--pb-readable); }
.pb-community { display: inline-flex; gap: var(--pb-space-4); }
.pb-community__link { color: var(--pb-text-muted); display: inline-flex; }
.pb-community__link:hover, .pb-community__link:focus-visible { color: var(--pb-text); }
.pb-footer select { background: transparent; border: 0; color: inherit; text-decoration: underline; cursor: pointer; padding: 0; }

.pb-main { max-width: var(--pb-container); margin: 0 auto; padding: var(--pb-space-9) var(--pb-gutter) var(--pb-space-12); min-height: calc(100vh - var(--pb-header-h) - 80px); }
.pb-layout { display: grid; gap: var(--pb-space-10); align-items: start; }
.pb-layout--discover { grid-template-columns: var(--pb-side-w) minmax(0, 1fr) var(--pb-aside-w); }
.pb-layout--side { grid-template-columns: var(--pb-side-w) minmax(0, 1fr); }
.pb-layout--aside { grid-template-columns: minmax(0, 1fr) var(--pb-aside-w); }
.pb-layout--detail { grid-template-columns: minmax(0, 1fr) 360px; }
.pb-layout__sticky { position: sticky; top: calc(var(--pb-header-h) + var(--pb-space-9)); }
.pb-narrow { max-width: 460px; margin: 0 auto; }
.pb-medium { max-width: 820px; }
.pb-subnav { display: grid; gap: var(--pb-space-1); }
.pb-subnav a { display: flex; align-items: center; gap: var(--pb-space-5); min-height: 40px; padding: 0 var(--pb-space-5); border-radius: var(--pb-radius); text-decoration: none; color: var(--pb-text-secondary); }
.pb-subnav a:hover { background: var(--pb-surface); color: var(--pb-text); }
.pb-subnav a[aria-current="page"] { background: var(--pb-surface-raised); color: var(--pb-text); box-shadow: inset 3px 0 0 var(--pb-accent); font-weight: var(--pb-weight-medium); }
.pb-subnav a svg.pb-icon { color: var(--pb-text-muted); }
.pb-subnav__label { font-size: var(--pb-text-sm); color: var(--pb-text-muted); font-weight: var(--pb-weight-bold); font-stretch: var(--pb-stretch-condensed); padding: var(--pb-space-7) var(--pb-space-5) var(--pb-space-3); }

/* ---------- Auth ---------- */
.pb-auth { max-width: 420px; margin: var(--pb-space-10) auto; display: grid; gap: var(--pb-space-8); }
/* Brand on light paper (print, partner pages): re-points the text token so the logo's foam quarters turn Night. */
.pb-on-paper { --pb-text: var(--pb-night-900); color: var(--pb-night-900); background: var(--pb-night-100); }
.pb-auth__brand { display: grid; place-items: center; }
.pb-auth__card { background: var(--pb-surface); border-radius: var(--pb-radius-lg); padding: var(--pb-space-10) var(--pb-space-9); display: grid; gap: var(--pb-space-7); }
.pb-auth__title { font-size: var(--pb-text-3xl); font-weight: var(--pb-weight-black); font-stretch: var(--pb-stretch-narrow); line-height: var(--pb-leading-tight); }
.pb-auth__or { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--pb-space-6); color: var(--pb-text-muted); font-size: var(--pb-text-sm); }
.pb-auth__or::before, .pb-auth__or::after { content: ""; height: 1px; background: var(--pb-border); }
.pb-auth__foot { text-align: center; font-size: var(--pb-text-md); color: var(--pb-text-muted); }

/* ---------- Game detail hero ---------- */
.pb-hero { display: grid; gap: var(--pb-space-7); }
.pb-hero__media { position: relative; aspect-ratio: 16 / 9; border-radius: var(--pb-radius); overflow: hidden; background: var(--pb-bg-sunken); }
.pb-hero__media img { width: 100%; height: 100%; object-fit: cover; }
.pb-hero__title { font-size: var(--pb-text-5xl); font-weight: var(--pb-weight-black); font-stretch: var(--pb-stretch-narrow); line-height: var(--pb-leading-tight); text-wrap: balance; }
.pb-playbox { display: grid; gap: var(--pb-space-7); }

/* ---------- Game shell (fullscreen player) ---------- */
.pb-shell { position: fixed; inset: 0; z-index: var(--pb-z-shell); background: var(--pb-bg-sunken); display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
.pb-shell__bar { display: flex; align-items: center; gap: var(--pb-space-4); height: 48px; padding: 0 var(--pb-space-4); background: var(--pb-night-950); border-bottom: 1px solid var(--pb-border); }
.pb-shell__title { font-weight: var(--pb-weight-bold); font-stretch: var(--pb-stretch-condensed); font-size: var(--pb-text-lg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pb-shell__room { font-size: var(--pb-text-sm); color: var(--pb-text-muted); white-space: nowrap; }
.pb-shell__spacer { flex: 1; }
.pb-shell__stage { position: relative; overflow: hidden; display: grid; place-items: center; }
.pb-shell__frame { position: absolute; inset: 0; }
.pb-shell__frame iframe { display: block; width: 100%; height: 100%; border: 0; background: var(--pb-night-950); }
.pb-shell__overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: var(--pb-gutter); background: var(--pb-scrim); overflow: auto; }
.pb-shell__overlay[hidden], .pb-shell__peek[hidden] { display: none; }
.pb-shell--immersive { grid-template-rows: 0 minmax(0, 1fr); }
.pb-shell--immersive .pb-shell__bar { overflow: hidden; height: 0; border: 0; }
.pb-shell__peek { position: absolute; top: var(--pb-space-4); right: var(--pb-space-4); z-index: 1; }
.pb-wait { display: grid; gap: var(--pb-space-7); justify-items: center; text-align: center; max-width: 420px; padding: var(--pb-space-10); background: var(--pb-surface); border-radius: var(--pb-radius-lg); }
.pb-wait__pos { font-size: var(--pb-text-5xl); font-weight: var(--pb-weight-black); font-stretch: var(--pb-stretch-narrow); line-height: 1; color: var(--pb-accent); }

/* ---------- Character preview ---------- */
.pb-char { display: grid; place-items: center; aspect-ratio: 3 / 4; border-radius: var(--pb-radius); background: var(--pb-bg-sunken); overflow: hidden; }
.pb-char svg { width: 70%; height: auto; }
.pb-chartile { display: grid; gap: var(--pb-space-3); text-decoration: none; }
.pb-chartile__name { font-weight: var(--pb-weight-medium); }
.pb-swatch { display: block; width: 100%; height: 100%; border-radius: var(--pb-radius-sm); }
.pb-swatches { display: flex; flex-wrap: wrap; gap: var(--pb-space-4); }
.pb-swatches button { width: 36px; height: 36px; border-radius: var(--pb-radius); border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px var(--pb-border-strong); }
.pb-swatches button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--pb-bg), 0 0 0 4px var(--pb-accent); }

/* ---------- Responsive ---------- */
@media (max-width: 1259px) {
  .pb-layout--discover { grid-template-columns: var(--pb-side-w) minmax(0, 1fr); }
  .pb-layout--discover > .pb-layout__aside { grid-column: 1; grid-row: 2; }
  .pb-layout--discover > .pb-layout__main { grid-column: 2; grid-row: 1 / span 2; }
  .pb-layout--discover .pb-layout__sticky { position: static; }
  .pb-layout--detail { grid-template-columns: minmax(0, 1fr) 320px; }
  .pb-header__search { width: 220px; }
  .pb-header__in { gap: var(--pb-space-7); }
}
@media (max-width: 899px) {
  .pb-header__in { flex-wrap: wrap; height: auto; padding: var(--pb-space-5) var(--pb-gutter); gap: var(--pb-space-5); }
  .pb-header__acts { margin-left: auto; }
  .pb-header__search { order: 3; width: 100%; margin: 0; }
  .pb-nav, .pb-hdr-points__label { display: none; }
  .pb-main { padding: var(--pb-space-7) var(--pb-gutter) calc(96px + env(safe-area-inset-bottom)); }
  .pb-layout, .pb-layout--discover, .pb-layout--side, .pb-layout--aside, .pb-layout--detail { grid-template-columns: minmax(0, 1fr); gap: var(--pb-space-8); }
  .pb-layout--discover > .pb-layout__aside, .pb-layout--discover > .pb-layout__main { grid-column: auto; grid-row: auto; }
  .pb-layout--discover > .pb-layout__side { order: 1; } .pb-layout--discover > .pb-layout__main { order: 2; } .pb-layout--discover > .pb-layout__aside { order: 3; }
  .pb-layout__sticky { position: static; }
  .pb-catnav--scroll { display: flex; overflow-x: auto; gap: var(--pb-space-3); margin: 0 calc(var(--pb-gutter) * -1); padding: 0 var(--pb-gutter) var(--pb-space-2); scrollbar-width: none; }
  .pb-catnav--scroll .pb-catnav__item { flex: none; background: var(--pb-surface); min-height: 40px; white-space: nowrap; }
  .pb-catnav--scroll .pb-catnav__count { margin-left: var(--pb-space-2); }
  .pb-hide-phone { display: none !important; }
  .pb-subnav--scroll { display: flex; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--pb-gutter) * -1); padding: 0 var(--pb-gutter); }
  .pb-subnav--scroll a { flex: none; white-space: nowrap; }
  .pb-subnav--scroll .pb-subnav__label { display: none; }
  .pb-spot { grid-template-columns: minmax(0, 1fr); }
  .pb-spot__media { min-height: 0; aspect-ratio: 16 / 9; }
  .pb-spot__body { padding: var(--pb-space-7); }
  .pb-spot__title, .pb-page-head__title { font-size: var(--pb-text-3xl); }
  .pb-hero__title { font-size: var(--pb-text-4xl); }
  .pb-spot-picker button { width: 92px; }
  .pb-row { grid-template-columns: 120px minmax(0, 1fr); gap: var(--pb-space-6); padding-right: var(--pb-space-4); }
  .pb-row__players, .pb-row__end, .pb-row__line { display: none; }
  .pb-row__compact { display: block; font-size: var(--pb-text-sm); color: var(--pb-text-muted); margin-top: var(--pb-space-1); }
  .pb-row__title { font-size: var(--pb-text-lg); }
  .pb-footer { display: none; }
  .pb-guide-paths, .pb-guide-step { grid-template-columns: minmax(0, 1fr); }
  .pb-guide-steps { gap: var(--pb-space-10); }
  .pb-guide-step__title { font-size: var(--pb-text-xl); }
  .pb-guide-step__text { font-size: var(--pb-text-md); }
  .pb-tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; inset: auto 0 0 0; z-index: var(--pb-z-tabbar);
    background: var(--pb-surface); border-top: 1px solid var(--pb-border); padding: var(--pb-space-2) var(--pb-space-2) calc(var(--pb-space-2) + env(safe-area-inset-bottom));
  }
  .pb-tabbar__link { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 54px; text-decoration: none; color: var(--pb-text-muted); font-size: var(--pb-text-xs); font-weight: var(--pb-weight-medium); }
  .pb-tabbar__link[aria-current="page"] { color: var(--pb-accent); }
  .pb-tabbar__link .pb-badge { position: absolute; top: 4px; left: calc(50% + 6px); }
  .pb-kv { grid-template-columns: minmax(0, 1fr); gap: var(--pb-space-1) 0; }
  .pb-kv dd { margin-bottom: var(--pb-space-5); }
  .pb-auth { margin-top: var(--pb-space-4); }
  .pb-auth__card { padding: var(--pb-space-8) var(--pb-space-7); }
}
