/* =====================================================================
   Playbay components — Aqua Gloss
   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.
   Spec and the component map: docs/design/aqua-gloss/STYLEGUIDE.md.
   Page agents edit ONLY their own "@area" block near the end (WORK-SPLIT.md).
   ===================================================================== */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--pb-bg); color: var(--pb-text);
  font-family: var(--pb-font); font-size: var(--pb-text-body); line-height: var(--pb-leading-body);
  font-weight: var(--pb-weight-regular); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
/* The sky: one fixed layer behind every page (no pattern, no motion). */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--pb-sky); }
a { color: inherit; }
a:hover { color: var(--pb-accent-hover); }
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; }
[tabindex="-1"]:focus { outline: none; } /* containers that receive focus programmatically (main, dialogs, sheets) */
::selection { background: var(--pb-sky-300); color: var(--pb-text); }
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-7); border-radius: var(--pb-radius-pill); background: var(--pb-surface-raised); color: var(--pb-text); font-weight: var(--pb-weight-bold); box-shadow: var(--pb-shadow-float); }
.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); font-size: var(--pb-text-body); line-height: 1.65; }
.pb-prose p + p { margin-top: var(--pb-space-6); }
.pb-link { color: var(--pb-accent); font-weight: var(--pb-weight-medium); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.pb-link:hover { color: var(--pb-accent-hover); text-decoration-thickness: 2px; }
.pb-link svg.pb-icon { width: var(--pb-icon-sm); height: var(--pb-icon-sm); margin-left: var(--pb-space-1); vertical-align: -2px; }
.pb-text-live { color: var(--pb-live); font-weight: var(--pb-weight-medium); }
.pb-note { font-size: var(--pb-text-sm); color: var(--pb-text-muted); font-weight: var(--pb-weight-medium); }
/* 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-7); --min: 240px; }
.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; overflow-wrap: anywhere; 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-sky-200); border-top-color: var(--pb-accent); animation: pb-spin 800ms linear infinite; }
@media (prefers-reduced-motion: reduce) { .pb-spinner { animation-duration: 2400ms; } }
kbd, .pb-kbd {
  display: inline-block; min-width: 26px; padding: 1px var(--pb-space-4); margin: 0 1px; border-radius: var(--pb-radius-sm);
  font: var(--pb-weight-bold) var(--pb-text-md)/1.6 var(--pb-font); text-align: center; color: var(--pb-text); vertical-align: 1px;
  background: var(--pb-chrome); border: 1px solid var(--pb-border-strong); box-shadow: 0 2px 0 var(--pb-border-strong), var(--pb-shadow-chip);
}

/* ---------- 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-bold); color: var(--pb-text); border-radius: var(--pb-radius-sm); }
.pb-disclosure > summary:hover { color: var(--pb-accent); }
.pb-disclosure__body { padding-top: var(--pb-space-6); }
.pb-disclosure--quiet > summary { font-weight: var(--pb-weight-medium); font-size: var(--pb-text-sm); color: var(--pb-text-muted); }
.pb-disclosure--quiet .pb-disclosure__body { padding-top: var(--pb-space-4); }

/* ---------- Glass: every panel-like surface shares one recipe ----------
   In-flow panels and cards: bright frosted white with a white rim and a soft blue shadow.
   Floating layers (header, tab bar, menus, panels, dialogs, sheets, toasts) also blur what is behind them. */
.pb-panel, .pb-spot, .pb-empty, .pb-auth__card, .pb-wait, .pb-catcard, .pb-stat, .pb-table-wrap, .pb-guide-path, .pb-hero__media, .pb-embed__media, .pb-footer {
  background: var(--pb-glass); border: 1px solid var(--pb-border-glass); box-shadow: var(--pb-shadow-panel);
}
.pb-header__in, .pb-tabbar, .pb-menu, .pb-catpanel, .pb-dialog, .pb-sheet, .pb-toast {
  background: var(--pb-glass-strong); border: 1px solid var(--pb-border-glass); box-shadow: var(--pb-shadow-float);
  -webkit-backdrop-filter: var(--pb-glass-blur); backdrop-filter: var(--pb-glass-blur);
}

/* ---------- Logo (owner rule: the original mark and wordmark, on a white glass pill) ---------- */
.pb-logo {
  position: relative; isolation: isolate; display: inline-flex; align-items: center; gap: 11px; flex: none;
  padding: 6px 18px 6px 6px; border-radius: var(--pb-radius-pill); text-decoration: none; color: var(--pb-logo-ink);
  background: linear-gradient(180deg, var(--pb-white) 0%, var(--pb-white) 50%, var(--pb-sky-50) 51%, var(--pb-white) 100%);
  border: 1px solid var(--pb-white); box-shadow: 0 0 0 1px var(--pb-border), var(--pb-shadow-control); transition: box-shadow var(--pb-dur) var(--pb-ease);
}
.pb-logo:hover { color: var(--pb-logo-ink); box-shadow: 0 0 0 1px var(--pb-border-strong), var(--pb-shadow-control-hover); }
.pb-logo svg { width: 38px; height: 38px; flex: none; }
.pb-logo__text { display: inline-flex; flex-direction: column; gap: 2px; }
.pb-logo__word { font-family: var(--pb-font-logo); font-weight: 800; font-stretch: var(--pb-stretch-wide); font-size: var(--pb-logo-md); line-height: 1; letter-spacing: -0.01em; }
.pb-logo__by { font-family: var(--pb-font-logo); font-weight: 600; font-size: var(--pb-logo-by); color: var(--pb-logo-muted); letter-spacing: 0.02em; line-height: 1; }
.pb-logo--lg { padding: 10px 28px 10px 10px; gap: var(--pb-space-7); }
.pb-logo--lg svg { width: 58px; height: 58px; }
.pb-logo--lg .pb-logo__word { font-size: var(--pb-logo-lg); }
.pb-logo--lg .pb-logo__by { font-size: var(--pb-text-sm); }
svg.pb-icon--brand { stroke: none; width: var(--pb-icon-sm); height: var(--pb-icon-sm); }

/* ---------- Orb: a glossy coloured ball around one icon ---------- */
.pb-orb {
  --orb: var(--pb-orb-aqua);
  position: relative; display: inline-grid; place-items: center; flex: none; width: var(--pb-orb-md); height: var(--pb-orb-md); border-radius: 50%;
  color: var(--pb-white);
  background: radial-gradient(circle at 50% 115%, color-mix(in srgb, var(--orb) 45%, var(--pb-white)) 0%, transparent 55%), linear-gradient(180deg, color-mix(in srgb, var(--orb) 78%, var(--pb-white)) 0%, var(--orb) 100%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--orb) 70%, var(--pb-ink-900)), var(--pb-shadow-orb);
}
.pb-orb::before { content: ""; position: absolute; left: 14%; right: 14%; top: 5%; height: 44%; border-radius: 50%; background: var(--pb-gloss-soft); pointer-events: none; }
.pb-orb svg.pb-icon { position: relative; width: 52%; height: 52%; stroke-width: 2.2; filter: var(--pb-shadow-icon); }
.pb-orb--sm { width: var(--pb-orb-sm); height: var(--pb-orb-sm); }
.pb-orb--md { width: var(--pb-orb-md); height: var(--pb-orb-md); }
.pb-orb--lg { width: var(--pb-orb-lg); height: var(--pb-orb-lg); }
.pb-orb--xl { width: var(--pb-orb-xl); height: var(--pb-orb-xl); }
.pb-orb--xl svg.pb-icon { width: 44%; height: 44%; }
.pb-orb--aqua { --orb: var(--pb-orb-aqua); } .pb-orb--live { --orb: var(--pb-orb-live); } .pb-orb--pink { --orb: var(--pb-orb-pink); } .pb-orb--gold { --orb: var(--pb-orb-gold); }
.pb-orb--violet { --orb: var(--pb-orb-violet); } .pb-orb--teal { --orb: var(--pb-orb-teal); } .pb-orb--slate { --orb: var(--pb-orb-slate); } .pb-orb--red { --orb: var(--pb-orb-red); }
.pb-orb--cat-action { --orb: var(--pb-cat-action); } .pb-orb--cat-adventure { --orb: var(--pb-cat-adventure); } .pb-orb--cat-obby { --orb: var(--pb-cat-obby); } .pb-orb--cat-rpg { --orb: var(--pb-cat-rpg); }
.pb-orb--cat-simulation { --orb: var(--pb-cat-simulation); } .pb-orb--cat-tycoon { --orb: var(--pb-cat-tycoon); } .pb-orb--cat-sandbox { --orb: var(--pb-cat-sandbox); } .pb-orb--cat-survival { --orb: var(--pb-cat-survival); }
.pb-orb--cat-horror { --orb: var(--pb-cat-horror); } .pb-orb--cat-shooter { --orb: var(--pb-cat-shooter); } .pb-orb--cat-fighting { --orb: var(--pb-cat-fighting); } .pb-orb--cat-racing { --orb: var(--pb-cat-racing); }
.pb-orb--cat-sports { --orb: var(--pb-cat-sports); } .pb-orb--cat-strategy { --orb: var(--pb-cat-strategy); } .pb-orb--cat-tower-defense { --orb: var(--pb-cat-tower-defense); } .pb-orb--cat-puzzle { --orb: var(--pb-cat-puzzle); }
.pb-orb--cat-party { --orb: var(--pb-cat-party); } .pb-orb--cat-social { --orb: var(--pb-cat-social); } .pb-orb--cat-board { --orb: var(--pb-cat-board); } .pb-orb--cat-rhythm { --orb: var(--pb-cat-rhythm); }
.pb-orb--cat-arcade { --orb: var(--pb-cat-arcade); } .pb-orb--cat-educational { --orb: var(--pb-cat-educational); } .pb-orb--cat-other { --orb: var(--pb-cat-other); }

/* ---------- Tooltip: words for icon-only things (data-tip; the words are also in aria) ---------- */
.pb-tip { position: relative; }
.pb-tip::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); z-index: 30; transform: translate(-50%, 4px);
  padding: 5px 10px; border-radius: var(--pb-radius-pill); background: linear-gradient(180deg, var(--pb-tip-1), var(--pb-tip-2));
  color: var(--pb-white); font: var(--pb-weight-bold) var(--pb-text-sm)/1.3 var(--pb-font); white-space: nowrap; text-shadow: none;
  pointer-events: none; opacity: 0; box-shadow: var(--pb-shadow-tip); transition: opacity var(--pb-dur-fast) var(--pb-ease), transform var(--pb-dur-fast) var(--pb-ease);
}
.pb-tip:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
@media (hover: hover) { .pb-tip:hover::after { opacity: 1; transform: translate(-50%, 0); } }
.pb-devices > .pb-tip:last-child::after { left: auto; right: -4px; transform: translate(0, 4px); }
.pb-devices > .pb-tip:last-child:focus-visible::after { transform: none; }
@media (hover: hover) { .pb-devices > .pb-tip:last-child:hover::after { transform: none; } }

/* ---------- Button: gel (primary, go, danger), chrome (secondary), quiet (ghost) ---------- */
.pb-btn {
  position: relative; isolation: isolate; 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: 1px solid transparent; border-radius: var(--pb-radius-pill);
  font-size: var(--pb-text-base); font-weight: var(--pb-weight-bold); line-height: 1; text-decoration: none; white-space: nowrap;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform var(--pb-dur-fast) var(--pb-ease), filter var(--pb-dur) var(--pb-ease), box-shadow var(--pb-dur) var(--pb-ease), background-color var(--pb-dur) var(--pb-ease);
}
/* The gloss: one highlight in the top 42%, never across the label's middle. */
.pb-btn--primary::before, .pb-btn--go::before, .pb-btn--danger::before, .pb-btn--secondary::before {
  content: ""; position: absolute; left: 8%; right: 8%; top: 1px; height: 42%; z-index: -1; pointer-events: none;
  border-radius: var(--pb-radius-pill) var(--pb-radius-pill) 60% 60% / var(--pb-radius-pill) var(--pb-radius-pill) 40% 40%; background: var(--pb-gloss);
}
.pb-btn--secondary::before { background: var(--pb-gloss-soft); opacity: .7; }
.pb-btn--primary {
  color: var(--pb-on-accent); border-color: var(--pb-gel-edge); text-shadow: var(--pb-gel-text-shadow); box-shadow: var(--pb-shadow-gel);
  background: radial-gradient(120% 90% at 50% 125%, var(--pb-gel-glow) 0%, transparent 50%), linear-gradient(180deg, var(--pb-gel-1) 0%, var(--pb-gel-2) 49%, var(--pb-gel-3) 51%, var(--pb-gel-4) 100%);
}
.pb-btn--go {
  color: var(--pb-on-accent); border-color: var(--pb-go-edge); text-shadow: var(--pb-gel-text-shadow); box-shadow: var(--pb-shadow-go);
  background: radial-gradient(120% 90% at 50% 125%, var(--pb-go-glow) 0%, transparent 50%), linear-gradient(180deg, var(--pb-go-1) 0%, var(--pb-go-2) 49%, var(--pb-go-3) 51%, var(--pb-go-4) 100%);
}
.pb-btn--danger {
  color: var(--pb-on-danger); border-color: var(--pb-red-edge); text-shadow: var(--pb-gel-text-shadow); box-shadow: var(--pb-shadow-red);
  background: radial-gradient(120% 90% at 50% 125%, var(--pb-red-glow) 0%, transparent 50%), linear-gradient(180deg, var(--pb-red-1) 0%, var(--pb-red-2) 49%, var(--pb-red-3) 51%, var(--pb-red-4) 100%);
}
.pb-btn--primary:hover, .pb-btn--go:hover, .pb-btn--danger:hover { color: var(--pb-on-accent); filter: brightness(1.06) saturate(1.06); }
.pb-btn--primary:hover { box-shadow: var(--pb-shadow-gel), var(--pb-halo); }
.pb-btn--go:hover { box-shadow: var(--pb-shadow-go), var(--pb-halo-go); }
.pb-btn--secondary { color: var(--pb-text); border-color: var(--pb-border-strong); background: var(--pb-chrome); box-shadow: var(--pb-shadow-control); }
.pb-btn--secondary:hover { color: var(--pb-text); background: var(--pb-chrome-hover); box-shadow: var(--pb-shadow-control-hover); }
.pb-btn--secondary[aria-pressed="true"] { color: var(--pb-accent-hover); border-color: var(--pb-accent); background: var(--pb-selected-fill); }
.pb-btn--secondary[aria-pressed="true"] svg.pb-icon { color: var(--pb-like); fill: var(--pb-like); }
.pb-btn--ghost { background: transparent; color: var(--pb-text-muted); }
.pb-btn--ghost:hover { background: var(--pb-surface-hover); color: var(--pb-text); }
.pb-btn:active { transform: translateY(1px) scale(.98); filter: brightness(.96); }
.pb-btn--sm { min-height: var(--pb-control-sm); padding: 0 var(--pb-space-7); font-size: var(--pb-text-md); gap: var(--pb-space-3); }
.pb-btn--sm svg.pb-icon { width: var(--pb-icon-sm); height: var(--pb-icon-sm); }
.pb-btn--lg { min-height: var(--pb-control-lg); padding: 0 30px; font-size: var(--pb-text-lg); gap: var(--pb-space-5); }
.pb-btn--lg svg.pb-icon { width: 22px; height: 22px; }
.pb-btn--block { width: 100%; }
.pb-btn--icon { width: var(--pb-control-md); padding: 0; border-radius: 50%; }
.pb-btn--icon.pb-btn--sm { width: var(--pb-control-sm); }
.pb-btn--icon.pb-btn--lg { width: var(--pb-control-lg); }
.pb-btn--go svg.pb-icon, .pb-btn--primary svg.pb-icon { filter: var(--pb-shadow-icon); }
.pb-btn:disabled, .pb-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; filter: saturate(.6); transform: none; }
.pb-btn[aria-busy="true"] { color: transparent; text-shadow: none; pointer-events: none; opacity: 1; filter: none; }
.pb-btn[aria-busy="true"] > * { visibility: hidden; }
.pb-btn[aria-busy="true"]::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--pb-on-accent); border-color: var(--pb-on-accent) transparent var(--pb-on-accent) transparent;
  animation: pb-spin 800ms linear infinite;
}
.pb-btn.pb-tip[aria-busy="true"]::after { left: auto; right: auto; bottom: auto; padding: 0; background: none; box-shadow: none; opacity: 1; transform: none; transition: none; }
.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; border-radius: 50%; } .pb-btn--collapse.pb-btn--sm { width: var(--pb-control-sm); } .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: 20px; height: 20px; padding: 0 6px; border-radius: var(--pb-radius-pill);
  background: linear-gradient(180deg, var(--pb-pink-400), var(--pb-pink-700)); color: var(--pb-white);
  font-size: var(--pb-text-2xs); font-weight: var(--pb-weight-black); line-height: 1; font-variant-numeric: tabular-nums; box-shadow: var(--pb-shadow-chip);
}
.pb-badge--dot { min-width: 10px; width: 10px; height: 10px; padding: 0; border-radius: 50%; box-shadow: 0 0 0 2px var(--pb-white); }

/* ---------- Tag (genre / search tags; always a link to results) ---------- */
.pb-tags { display: flex; flex-wrap: wrap; gap: var(--pb-space-4); }
.pb-tag {
  display: inline-flex; align-items: center; gap: var(--pb-space-3); min-height: 34px; padding: 0 var(--pb-space-7); border-radius: var(--pb-radius-pill);
  background: var(--pb-tag-fill); color: var(--pb-accent-hover); border: 1px solid var(--pb-border-strong); box-shadow: var(--pb-shadow-chip);
  font-size: var(--pb-text-md); font-weight: var(--pb-weight-bold); text-decoration: none;
}
.pb-tag svg.pb-icon { width: var(--pb-icon-sm); height: var(--pb-icon-sm); }
a.pb-tag:hover { border-color: var(--pb-accent); color: var(--pb-accent-hover); }
.pb-tag[aria-pressed="true"] { color: var(--pb-on-accent); border-color: var(--pb-gel-edge); text-shadow: var(--pb-gel-text-shadow); background: linear-gradient(180deg, var(--pb-gel-1) 0%, var(--pb-gel-2) 49%, var(--pb-gel-3) 51%, var(--pb-gel-4) 100%); }
button.pb-tag { cursor: pointer; font-family: inherit; }
button.pb-tag:hover { border-color: var(--pb-accent); }

/* ---------- Toggle chip (on/off filters: players, devices) ---------- */
.pb-togglechip {
  display: inline-flex; align-items: center; gap: var(--pb-space-3); min-height: var(--pb-control-sm); padding: 0 var(--pb-space-7) 0 var(--pb-space-5);
  border-radius: var(--pb-radius-pill); border: 1px solid var(--pb-border-strong); background: var(--pb-chip-fill); box-shadow: var(--pb-shadow-chip);
  color: var(--pb-text-muted); font-size: var(--pb-text-md); font-weight: var(--pb-weight-bold); cursor: pointer;
}
.pb-togglechip:hover { border-color: var(--pb-accent); color: var(--pb-text); }
.pb-togglechip[aria-pressed="true"] { color: var(--pb-on-accent); border-color: var(--pb-gel-edge); text-shadow: var(--pb-gel-text-shadow); background: linear-gradient(180deg, var(--pb-gel-1) 0%, var(--pb-gel-2) 49%, var(--pb-gel-3) 51%, var(--pb-gel-4) 100%); box-shadow: var(--pb-shadow-gel); }
@media (pointer: coarse) { .pb-togglechip { min-height: var(--pb-control-md); } }

/* ---------- Content label (moderated declarations; not tags) ---------- */
.pb-label {
  display: inline-flex; align-items: center; gap: var(--pb-space-4); min-height: 36px; padding: var(--pb-space-3) var(--pb-space-6) var(--pb-space-3) var(--pb-space-5);
  border-radius: var(--pb-radius); background: var(--pb-surface-raised); border: 1px solid var(--pb-border); color: var(--pb-text);
  font-size: var(--pb-text-md); font-weight: var(--pb-weight-bold);
}
.pb-label svg.pb-icon { width: var(--pb-icon-md); height: var(--pb-icon-md); color: var(--pb-accent); }
.pb-label--warning { color: var(--pb-warning); background: var(--pb-warning-soft); border-color: var(--pb-warning-glow); }
.pb-label--warning svg.pb-icon { color: 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); font-weight: var(--pb-weight-bold); color: var(--pb-text-muted); }
.pb-status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--pb-ink-500); flex: none; box-shadow: var(--pb-shadow-chip); }
.pb-status--live { color: var(--pb-live); }
.pb-status--live::before { background: var(--pb-live-glow); }
.pb-status--warning { color: var(--pb-warning); }
.pb-status--warning::before { background: var(--pb-warning-glow); }
.pb-status--danger { color: var(--pb-danger); }
.pb-status--danger::before { background: var(--pb-danger-fill); }
.pb-status--info { color: var(--pb-info); }
.pb-status--info::before { background: var(--pb-accent-bright); }
.pb-status--accent { color: var(--pb-accent); }
.pb-status--accent::before { background: var(--pb-accent); }

/* ---------- 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); font-weight: var(--pb-weight-medium); }
.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); color: var(--pb-accent); }
.pb-fact--strong { color: var(--pb-text); font-weight: var(--pb-weight-bold); }

/* ---------- Stat chips (icon + number; words in the tooltip) and device icons ---------- */
.pb-stat-chip {
  display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 var(--pb-space-5) 0 var(--pb-space-4); border-radius: var(--pb-radius-pill);
  background: var(--pb-chip-fill); border: 1px solid var(--pb-border); box-shadow: var(--pb-shadow-chip);
  font-size: var(--pb-text-md); font-weight: var(--pb-weight-black); color: var(--pb-text); font-variant-numeric: tabular-nums; line-height: 1;
}
.pb-stat-chip svg.pb-icon { width: 17px; height: 17px; stroke-width: 2.1; }
.pb-stat-chip--live svg.pb-icon { color: var(--pb-text-subtle); }
.pb-stat-chip--live-on { background: var(--pb-live-fill); border-color: var(--pb-live-glow); color: var(--pb-live); }
.pb-stat-chip--live-on svg.pb-icon { color: var(--pb-live); }
.pb-stat-chip--room svg.pb-icon { color: var(--pb-accent-bright); }
.pb-stat-chip--like svg.pb-icon { color: var(--pb-like); }
.pb-stat-chip--plays svg.pb-icon { color: var(--pb-accent-bright); }
.pb-stat-chip--lg { height: 38px; padding: 0 var(--pb-space-7) 0 var(--pb-space-5); font-size: var(--pb-text-body); gap: var(--pb-space-3); }
.pb-stat-chip--lg svg.pb-icon { width: 20px; height: 20px; }
.pb-devices { display: inline-flex; align-items: center; gap: var(--pb-space-1); color: var(--pb-text-subtle); }
.pb-devices > span { display: inline-flex; }
.pb-devices svg.pb-icon { width: 17px; height: 17px; }
.pb-devices--lg svg.pb-icon { width: 21px; height: 21px; }

/* ---------- 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: 50%; color: var(--pb-on-identity); font-weight: var(--pb-weight-black); font-size: var(--pb-text-md); line-height: 1; overflow: visible;
  text-decoration: none; box-shadow: var(--pb-shadow-orb);
}
.pb-avatar::after { content: ""; position: absolute; left: 16%; right: 16%; top: 5%; height: 42%; border-radius: 50%; background: var(--pb-gloss); pointer-events: 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); }
.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); }
.pb-avatar--xl { width: var(--pb-avatar-xl); height: var(--pb-avatar-xl); font-size: var(--pb-text-4xl); }
.pb-avatar[data-presence="playing"], .pb-avatar[data-presence="online"] { box-shadow: 0 0 0 2px var(--pb-white), 0 0 0 4px var(--pb-live-glow); }
.pb-avatar[data-presence="offline"] { opacity: .6; }
.pb-avatars { display: inline-flex; }
.pb-avatars .pb-avatar { box-shadow: 0 0 0 2px var(--pb-white); }
.pb-avatars .pb-avatar + .pb-avatar { margin-left: -6px; }

/* ---------- Points (Shells) ---------- */
.pb-points { display: inline-flex; align-items: center; gap: var(--pb-space-3); font-weight: var(--pb-weight-black); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pb-points svg.pb-icon { color: var(--pb-orb-gold); }
.pb-points--lg { font-size: var(--pb-text-5xl); line-height: 1; gap: var(--pb-space-5); letter-spacing: -0.01em; }
.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-bold); color: var(--pb-text); }
.pb-field__hint { font-size: var(--pb-text-sm); color: var(--pb-text-muted); font-weight: var(--pb-weight-medium); }
.pb-field__error { font-size: var(--pb-text-sm); font-weight: var(--pb-weight-bold); 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-7); border-radius: var(--pb-radius);
  border: var(--pb-border-width) solid var(--pb-border-control); background: linear-gradient(180deg, var(--pb-sky-50), var(--pb-white) 40%);
  box-shadow: var(--pb-shadow-well); color: var(--pb-text); font-size: var(--pb-text-base); font-weight: var(--pb-weight-medium);
  transition: border-color var(--pb-dur-fast) var(--pb-ease), box-shadow var(--pb-dur-fast) var(--pb-ease);
}
.pb-textarea { padding: var(--pb-space-5) var(--pb-space-7); min-height: 120px; resize: vertical; line-height: var(--pb-leading-body); }
.pb-select { appearance: none; padding-right: 40px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--pb-text-muted) 50%), linear-gradient(135deg, var(--pb-text-muted) 50%, transparent 50%), linear-gradient(180deg, var(--pb-sky-50), var(--pb-white) 40%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%, 0 0; background-size: 5px 5px, 5px 5px, 100% 100%; background-repeat: no-repeat; }
.pb-input::placeholder, .pb-textarea::placeholder { color: var(--pb-text-subtle); font-weight: var(--pb-weight-medium); }
.pb-input:focus, .pb-select:focus, .pb-textarea:focus { outline: none; border-color: var(--pb-accent); box-shadow: var(--pb-shadow-well), var(--pb-halo); }
.pb-field[data-invalid] .pb-input, .pb-field[data-invalid] .pb-textarea, .pb-field[data-invalid] .pb-select { border-color: var(--pb-danger); background: var(--pb-danger-soft); }
.pb-input:disabled, .pb-select:disabled, .pb-textarea:disabled { opacity: .55; cursor: not-allowed; }
.pb-input-wrap { position: relative; }
.pb-input-wrap > svg.pb-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--pb-text-muted); pointer-events: none; }
/* Room for a leading icon only; a box with just a trailing button keeps its normal padding. */
.pb-input-wrap--lead > .pb-input { padding-left: 44px; }
.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; font-weight: var(--pb-weight-medium); }
.pb-check input { width: 20px; height: 20px; margin: 1px 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; opacity: .7; }
.pb-switch { display: flex; align-items: center; justify-content: space-between; gap: var(--pb-space-7); min-height: var(--pb-control-md); cursor: pointer; font-weight: var(--pb-weight-medium); }
.pb-switch input {
  appearance: none; width: 48px; height: 28px; border-radius: var(--pb-radius-pill); position: relative; cursor: pointer; flex: none; margin: 0;
  background: var(--pb-sky-200); border: 1px solid var(--pb-border-control); box-shadow: var(--pb-shadow-well); transition: background-color var(--pb-dur) var(--pb-ease);
}
.pb-switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--pb-chrome); box-shadow: var(--pb-shadow-control); transition: transform var(--pb-dur) var(--pb-ease); }
.pb-switch input:checked { border-color: var(--pb-gel-edge); background: linear-gradient(180deg, var(--pb-gel-1), var(--pb-gel-3)); }
.pb-switch input:checked::after { transform: translateX(20px); }
.pb-switch input:disabled { opacity: .5; cursor: not-allowed; }
.pb-otp { display: flex; gap: var(--pb-space-4); }
.pb-otp input { width: 48px; flex: 0 1 48px; min-width: 0; height: 56px; text-align: center; font-size: var(--pb-text-2xl); font-weight: var(--pb-weight-black); border-radius: var(--pb-radius); border: 1px solid var(--pb-border-control); background: var(--pb-white); box-shadow: var(--pb-shadow-well); }
.pb-otp input:focus { outline: none; border-color: var(--pb-accent); box-shadow: var(--pb-shadow-well), var(--pb-halo); }
.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-raised); border: 1px solid var(--pb-border); box-shadow: var(--pb-shadow-chip); cursor: pointer; transition: border-color var(--pb-dur-fast) var(--pb-ease); }
.pb-choice label:hover { border-color: var(--pb-border-strong); }
.pb-choice label:has(input:checked) { border-color: var(--pb-accent); box-shadow: 0 0 0 1px var(--pb-accent), var(--pb-halo); background: var(--pb-selected-fill); }
.pb-choice label:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.pb-choice input { accent-color: var(--pb-accent); width: 20px; height: 20px; margin: 0; flex: none; }
.pb-choice label > svg.pb-icon { color: var(--pb-accent); }
.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-black); 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-lg); border: 2px dashed var(--pb-border-strong); background: var(--pb-glass-well); text-align: center; color: var(--pb-text-muted); cursor: pointer; }
.pb-drop:hover { border-color: var(--pb-accent); }
.pb-drop > svg.pb-icon { width: var(--pb-icon-xl); height: var(--pb-icon-xl); color: var(--pb-accent); }
/* The chosen file (ui/app.js): its name and size; the dashed edge turns solid. */
.pb-drop[data-chosen] { border-style: solid; border-color: var(--pb-accent); }
.pb-drop__file { color: var(--pb-text); font-weight: var(--pb-weight-bold); overflow-wrap: anywhere; }
.pb-drop__file:empty { display: none; }
/* 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; min-width: 0; gap: var(--pb-space-4); padding: var(--pb-space-3) var(--pb-space-3) var(--pb-space-3) var(--pb-space-7); border-radius: var(--pb-radius); background: var(--pb-white); border: 1px solid var(--pb-border-control); box-shadow: var(--pb-shadow-well); }
.pb-copy code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--pb-font-mono); font-size: var(--pb-text-md); }
.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-3) 0; }

/* ---------- Tabs: a segmented control (sort, page sections) ---------- */
.pb-tabs {
  display: flex; gap: var(--pb-space-1); width: max-content; max-width: 100%; padding: var(--pb-space-2); overflow-x: auto; scrollbar-width: none;
  border-radius: var(--pb-radius-pill); background: var(--pb-glass-well); border: 1px solid var(--pb-border-glass); box-shadow: var(--pb-shadow-well);
}
.pb-tabs__tab {
  display: inline-flex; align-items: center; gap: var(--pb-space-3); flex: none; min-height: 38px; padding: 0 var(--pb-space-7);
  border: 0; border-radius: var(--pb-radius-pill); background: none; color: var(--pb-text-muted); text-decoration: none; cursor: pointer; white-space: nowrap;
  font-size: var(--pb-text-md); font-weight: var(--pb-weight-bold); line-height: 1;
}
.pb-tabs__tab svg.pb-icon { width: 17px; height: 17px; }
@media (max-width: 419px) { .pb-tabs__tab:has(svg.pb-icon) .pb-tabs__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } .pb-tabs__tab:has(svg.pb-icon) { padding: 0 var(--pb-space-6); } }
.pb-tabs__tab:hover { color: var(--pb-text); background: var(--pb-glass); }
.pb-tabs__tab[aria-selected="true"], .pb-tabs__tab[aria-current="page"] { color: var(--pb-text); background: var(--pb-chrome); box-shadow: var(--pb-shadow-control), 0 0 0 1px var(--pb-border); }
.pb-tabs__tab[aria-selected="true"] svg.pb-icon, .pb-tabs__tab[aria-current="page"] svg.pb-icon { color: var(--pb-accent-bright); }

/* ---------- Headings (Cardo for display, 19 px and up) ---------- */
.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-family: var(--pb-font-display); font-size: var(--pb-text-4xl); font-weight: var(--pb-weight-display); line-height: var(--pb-leading-tight); letter-spacing: var(--pb-tracking-display); text-wrap: balance; }
.pb-page-head__sub { margin-top: var(--pb-space-4); color: var(--pb-text-muted); max-width: var(--pb-readable); font-weight: var(--pb-weight-medium); }
/* Heading: titles inside content (cards, dialogs, wait screens). Page and section titles use their own heads. */
.pb-heading { font-family: var(--pb-font-display); font-weight: var(--pb-weight-display); font-size: var(--pb-text-xl); line-height: var(--pb-leading-snug); overflow-wrap: anywhere; }
.pb-heading--lg { font-size: var(--pb-text-2xl); line-height: var(--pb-leading-tight); letter-spacing: var(--pb-tracking-display); }
.pb-heading--xl { font-size: var(--pb-text-3xl); line-height: var(--pb-leading-tight); letter-spacing: var(--pb-tracking-display); }
.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-family: var(--pb-font-display); font-size: var(--pb-text-2xl); font-weight: var(--pb-weight-display); line-height: var(--pb-leading-snug); letter-spacing: -0.01em; }
.pb-section-head__title--sm { font-size: var(--pb-text-md); color: var(--pb-text-muted); font-weight: var(--pb-weight-black); }
.pb-section-head a { font-size: var(--pb-text-md); font-weight: var(--pb-weight-bold); }
.pb-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--pb-space-3); font-size: var(--pb-text-md); font-weight: var(--pb-weight-bold); color: var(--pb-text-muted); }
.pb-crumbs a { text-decoration: none; display: inline-flex; padding: var(--pb-space-2) var(--pb-space-5); border-radius: var(--pb-radius-pill); background: var(--pb-glass); border: 1px solid var(--pb-border-glass); }
.pb-crumbs a:hover { background: var(--pb-white); color: var(--pb-accent-hover); }
.pb-crumbs li { list-style: none; display: inline-flex; align-items: center; gap: var(--pb-space-3); }
.pb-crumbs li + li::before { content: "›"; color: var(--pb-text-subtle); font-weight: var(--pb-weight-black); }
.pb-crumbs ol { display: contents; }

/* ---------- Panel (a glass section) ---------- */
.pb-panel { border-radius: var(--pb-radius-lg); padding: var(--pb-space-9) 28px; min-width: 0; }
.pb-panel--flush { padding: 0; overflow: hidden; }
.pb-panel--outline { background: var(--pb-glass-well); box-shadow: var(--pb-shadow-well); border: 1px solid var(--pb-border-glass); }
.pb-panel__head { margin-bottom: var(--pb-space-6); }
.pb-panel__title { font-family: var(--pb-font-display); font-size: var(--pb-text-2xl); font-weight: var(--pb-weight-display); line-height: var(--pb-leading-snug); letter-spacing: -0.01em; }

/* ---------- Item (the one list-row primitive: people, rooms, notifications, releases, sessions) ---------- */
.pb-list { display: grid; }
.pb-list--gap { gap: var(--pb-space-3); }
.pb-list--divided > .pb-item + .pb-item { border-top: 1px solid var(--pb-border); }
.pb-item { position: relative; 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-raised); border: 1px solid var(--pb-border); border-radius: var(--pb-radius); box-shadow: var(--pb-shadow-chip); }
.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: 50%; background: var(--pb-selected-fill); border: 1px solid var(--pb-border); display: grid; place-items: center; color: var(--pb-accent); box-shadow: var(--pb-shadow-chip); }
.pb-item__title { font-weight: var(--pb-weight-bold); 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; color: var(--pb-accent-hover); }
.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); font-weight: var(--pb-weight-medium); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-item__meta--live { color: var(--pb-live); font-weight: var(--pb-weight-bold); }
.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; border-radius: var(--pb-radius-sm); }
.pb-item--unread .pb-item__title::after { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--pb-accent-bright); margin-left: var(--pb-space-4); vertical-align: middle; box-shadow: var(--pb-shadow-chip); }

/* ---------- Media frame (game pictures): never cropped, glossy rim, shine clipped to the picture ---------- */
.pb-thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--pb-radius-media); overflow: hidden; background: var(--pb-media-bg); isolation: isolate; }
.pb-thumb::after { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; pointer-events: none; background: var(--pb-media-gloss); box-shadow: var(--pb-media-rim); }
/* Game pictures: whole image (contain) over a blurred copy, so nothing is ever cut. */
.pb-media__bg, .pb-media__img { position: absolute; inset: 0; width: 100%; height: 100%; }
.pb-media__bg { object-fit: cover; filter: blur(18px) saturate(1.2); opacity: .85; transform: scale(1.2); }
.pb-media__img { object-fit: contain; transition: transform var(--pb-dur-slow) var(--pb-ease); }
/* The hover shine lives INSIDE the frame (overflow: hidden): it can never paint over a neighbour. */
.pb-thumb__shine { position: absolute; inset: 0; z-index: 3; pointer-events: none; background: var(--pb-shine); transform: translateX(-120%); }
.pb-thumb__corner { z-index: 4; position: absolute; left: 8px; top: 8px; display: flex; gap: var(--pb-space-2); }
.pb-thumb__empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--pb-sky-300); background: radial-gradient(circle at 50% 40%, var(--pb-aqua-600), var(--pb-media-bg) 70%); }
.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, Updating). Not a tag, not a button. */
.pb-chip { display: inline-block; padding: 2px var(--pb-space-4); border-radius: var(--pb-radius-pill); background: var(--pb-media-chip); color: var(--pb-white); font-size: var(--pb-text-xs); font-weight: var(--pb-weight-bold); line-height: 1.5; vertical-align: middle; }
.pb-chip--accent { color: var(--pb-on-accent); background: linear-gradient(180deg, var(--pb-gel-1), var(--pb-gel-3)); box-shadow: var(--pb-shadow-chip); }

/* ---------- Game card (listing unit) and the fluid card grid ---------- */
.pb-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--pb-card-min)), 1fr)); gap: clamp(14px, 1.5vw, 22px); }
.pb-card {
  position: relative; display: flex; flex-direction: column; padding: var(--pb-space-4) var(--pb-space-4) 0; min-width: 0; border-radius: var(--pb-radius-lg);
  background: var(--pb-glass-solid); border: 1px solid var(--pb-border-glass); box-shadow: var(--pb-shadow-panel);
  transition: transform var(--pb-dur) var(--pb-ease-pop), box-shadow var(--pb-dur) var(--pb-ease); cursor: pointer;
}
.pb-card:hover { z-index: 1; transform: translateY(-4px); box-shadow: var(--pb-shadow-hover); }
.pb-card:hover .pb-media__img { transform: scale(1.035); }
.pb-card__media { position: relative; }
.pb-card__play { position: absolute; right: 14px; top: -29px; z-index: 6; width: var(--pb-play-orb); height: var(--pb-play-orb); }
.pb-card__play svg.pb-icon { width: 24px; height: 24px; margin-left: 3px; fill: currentColor; stroke: none; }
.pb-card__play::before { left: 12%; right: 12%; top: 3%; height: 44%; border-radius: 50%; }
.pb-card__body { position: relative; display: flex; flex-direction: column; gap: var(--pb-space-5); min-height: 96px; padding: var(--pb-space-7) var(--pb-space-4) var(--pb-space-7); }
.pb-card__title { padding-right: 62px; font-family: var(--pb-font-display); font-size: var(--pb-text-xl); font-weight: var(--pb-weight-display); line-height: 1.1; letter-spacing: -0.005em; min-height: 2.2em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.pb-card__title a { text-decoration: none; }
.pb-card__title a::after { content: ""; position: absolute; inset: 0; }
.pb-card:has(.pb-card__title a:focus-visible) { outline: var(--pb-focus-ring) solid var(--pb-focus); outline-offset: 2px; }
.pb-card__title a:focus-visible { outline: none; }
.pb-card__stats { display: flex; align-items: center; gap: var(--pb-space-3); margin-top: auto; flex-wrap: wrap; }
.pb-card__stats .pb-devices { margin-left: auto; }
/* Chips and devices sit above the stretched link so their tooltips work; clicks on them still open the game (ui/app.js). */
.pb-card__stats > .pb-tip, .pb-card__stats .pb-devices { position: relative; z-index: 5; }
.pb-card--skeleton { cursor: default; }
.pb-card--skeleton:hover { transform: none; box-shadow: var(--pb-shadow-panel); }
.pb-card--skeleton .pb-skel--media { border-radius: var(--pb-radius-media); }

/* ---------- Game row (the creator's own games, and the row loading skeleton) ---------- */
.pb-rows { display: grid; gap: var(--pb-space-4); }
.pb-row {
  position: relative; display: grid; grid-template-columns: 176px minmax(0, 1fr) 150px 96px; 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-lg);
  background: var(--pb-glass-solid); border: 1px solid var(--pb-border-glass); box-shadow: var(--pb-shadow-panel);
  transition: box-shadow var(--pb-dur) var(--pb-ease), transform var(--pb-dur) var(--pb-ease);
}
.pb-row:hover { box-shadow: var(--pb-shadow-hover); }
.pb-row .pb-thumb { border-radius: var(--pb-radius); }
.pb-row__title { font-family: var(--pb-font-display); font-size: var(--pb-text-xl); font-weight: var(--pb-weight-display); 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-lg); }
.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__end { display: grid; gap: var(--pb-space-2); justify-items: end; font-size: var(--pb-text-sm); color: var(--pb-text-muted); }
.pb-row--manage { grid-template-columns: 176px minmax(0, 1fr) auto; }
.pb-row--manage .pb-row__end { position: relative; z-index: 1; }
.pb-row__chips { display: flex; flex-wrap: wrap; gap: var(--pb-space-4); margin-top: var(--pb-space-3); position: relative; z-index: 1; }

/* ---------- Game tile (small card: library, creator page, related) ---------- */
.pb-tile {
  position: relative; display: grid; gap: var(--pb-space-3); min-width: 0; padding: var(--pb-space-3) var(--pb-space-3) var(--pb-space-6); border-radius: var(--pb-radius-lg);
  background: var(--pb-glass-solid); border: 1px solid var(--pb-border-glass); box-shadow: var(--pb-shadow-panel); transition: transform var(--pb-dur) var(--pb-ease-pop), box-shadow var(--pb-dur) var(--pb-ease);
}
.pb-tile:hover { transform: translateY(-3px); box-shadow: var(--pb-shadow-hover); }
.pb-tile .pb-thumb { border-radius: var(--pb-radius); }
.pb-tile__title { padding: 0 var(--pb-space-3); font-family: var(--pb-font-display); font-size: var(--pb-text-xl); font-weight: var(--pb-weight-display); line-height: var(--pb-leading-snug); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: var(--pb-space-3); }
.pb-tile__title a { text-decoration: none; }
.pb-tile__title a::after { content: ""; position: absolute; inset: 0; border-radius: var(--pb-radius-lg); }
.pb-tile__meta { padding: 0 var(--pb-space-3); font-size: var(--pb-text-sm); color: var(--pb-text-muted); font-weight: var(--pb-weight-medium); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Spotlight (the featured game hero on Discover) ----------
   Glass in two columns (picture 1.32 : 1 words; the picture stops growing at 900 px on very wide screens). A blurred copy of the picture tints the glass from behind;
   the picture itself is shown whole. Nothing on it moves on its own. */
.pb-spot { position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0, min(56%, 900px)) minmax(0, 1fr); gap: clamp(18px, 2.4vw, 40px); padding: 14px; border-radius: var(--pb-radius-lg); }
.pb-spot__sky { position: absolute; inset: 0; z-index: -1; overflow: hidden; border-radius: inherit; pointer-events: none; }
.pb-spot__sky img { width: 100%; height: 100%; object-fit: cover; filter: blur(40px) saturate(1.4); opacity: .35; transform: scale(1.2); }
.pb-spot__media { position: relative; display: block; align-self: center; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; background: var(--pb-media-bg); box-shadow: var(--pb-shadow-control); }
.pb-spot__media::after { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; pointer-events: none; background: var(--pb-media-gloss); box-shadow: var(--pb-media-rim); }
.pb-spot__body { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: var(--pb-space-8); padding: var(--pb-space-6) clamp(4px, 1.6vw, 24px) var(--pb-space-6) 0; min-width: 0; }
.pb-spot__marks { display: flex; align-items: center; gap: var(--pb-space-5); }
.pb-spot__title { max-width: 100%; font-family: var(--pb-font-display); font-size: var(--pb-text-hero); font-weight: var(--pb-weight-display); line-height: 1; letter-spacing: var(--pb-tracking-display); text-wrap: balance; overflow-wrap: anywhere; }
.pb-spot__title a { color: inherit; text-decoration: none; }
.pb-spot__title a:hover { color: var(--pb-accent-hover); }
.pb-spot__stats { display: flex; flex-wrap: wrap; align-items: center; gap: var(--pb-space-3); }
.pb-spot__stats .pb-devices { margin-left: var(--pb-space-3); }
.pb-spot__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--pb-space-6); }
.pb-spot__friends { display: flex; align-items: center; gap: var(--pb-space-4); font-size: var(--pb-text-md); font-weight: var(--pb-weight-bold); color: var(--pb-live); }
.pb-spot-picker { display: flex; gap: var(--pb-space-5); max-width: 100%; margin: 0 calc(-1 * var(--pb-space-3)); padding: var(--pb-space-3); overflow-x: auto; scrollbar-width: none; }
.pb-spot-picker button { flex: none; width: 84px; padding: 0; border: 2px solid var(--pb-white); border-radius: var(--pb-radius-sm); overflow: hidden; cursor: pointer; opacity: .65; background: var(--pb-media-bg); box-shadow: var(--pb-shadow-control); transition: opacity var(--pb-dur) var(--pb-ease), transform var(--pb-dur) var(--pb-ease); }
.pb-spot-picker button .pb-thumb { border-radius: 0; }
.pb-spot-picker button[aria-current="true"] { opacity: 1; border-color: var(--pb-accent); box-shadow: var(--pb-halo), var(--pb-shadow-control); }
.pb-spot-picker button:hover { opacity: 1; transform: translateY(-2px); }

/* ---------- Category directory cards (/categories) ---------- */
.pb-subnav a .pb-badge { margin-left: auto; }
.pb-catcard {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: var(--pb-space-1) var(--pb-space-6); padding: var(--pb-space-7);
  border-radius: var(--pb-radius-lg); text-decoration: none; min-height: 84px; transition: transform var(--pb-dur) var(--pb-ease-pop), box-shadow var(--pb-dur) var(--pb-ease);
}
.pb-catcard:hover { transform: translateY(-2px); box-shadow: var(--pb-shadow-hover); color: var(--pb-text); }
.pb-catcard__icon { grid-row: span 2; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--pb-white); background: linear-gradient(180deg, var(--pb-gel-1), var(--pb-gel-3)); box-shadow: var(--pb-shadow-orb); }
.pb-catcard__icon svg.pb-icon { width: 22px; height: 22px; }
.pb-catcard__name { font-weight: var(--pb-weight-bold); font-size: var(--pb-text-lg); line-height: var(--pb-leading-snug); }
.pb-catcard__count { font-size: var(--pb-text-sm); color: var(--pb-text-muted); font-weight: var(--pb-weight-medium); }
.pb-catcard--empty { opacity: .7; }
.pb-catcard--empty .pb-catcard__icon { filter: saturate(.35); }

/* ---------- Categories panel (square, under the header; a sheet on phones) ---------- */
.pb-catpanel-scrim { position: fixed; inset: 0; z-index: calc(var(--pb-z-dialog) - 1); background: var(--pb-scrim-soft); }
.pb-catpanel {
  position: fixed; z-index: var(--pb-z-dialog); top: calc(var(--pb-header-h) - 6px); left: max(var(--pb-gutter), calc(50vw - var(--pb-catpanel-w) / 2));
  width: min(var(--pb-catpanel-w), calc(100vw - 2 * var(--pb-gutter))); min-height: min(var(--pb-catpanel-w), calc(100vw - 2 * var(--pb-gutter))); max-height: calc(100dvh - var(--pb-header-h) - 8px); overflow: auto;
  display: flex; flex-direction: column; gap: var(--pb-space-7); padding: var(--pb-space-8); border-radius: var(--pb-radius-xl); border-color: var(--pb-white);
  animation: pb-pop var(--pb-dur-slow) var(--pb-ease-pop);
}
@supports (anchor-name: --pb-cats) {
  .pb-nav__cats { anchor-name: --pb-cats; }
  .pb-catpanel { position-anchor: --pb-cats; top: calc(anchor(bottom) + 14px); left: max(var(--pb-gutter), min(calc(anchor(left) - 8px), calc(100vw - var(--pb-catpanel-w) - var(--pb-gutter)))); }
}
@keyframes pb-pop { from { opacity: 0; transform: scale(.96) translateY(-6px); } }
.pb-catpanel--inline { z-index: auto; max-height: none; overflow: hidden; animation: none; }
.pb-catpanel__head { display: flex; align-items: center; gap: var(--pb-space-5); }
.pb-catpanel__title { flex: 1; font-family: var(--pb-font-display); font-size: var(--pb-text-2xl); font-weight: var(--pb-weight-display); letter-spacing: -0.01em; line-height: 1.1; }
.pb-catpanel__tiles { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: minmax(68px, 1fr); gap: var(--pb-space-4); }
.pb-cattile {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 0; padding: var(--pb-space-3) var(--pb-space-2);
  border-radius: 18px; text-decoration: none; color: var(--pb-text-muted); background: linear-gradient(180deg, var(--pb-white), var(--pb-sky-50));
  border: 1px solid var(--pb-border-glass); box-shadow: var(--pb-shadow-chip), 0 3px 8px -4px var(--pb-gel-shadow), 0 0 0 1px var(--pb-border);
  transition: transform var(--pb-dur-fast) var(--pb-ease), box-shadow var(--pb-dur-fast) var(--pb-ease);
}
.pb-cattile:hover { color: var(--pb-text); transform: translateY(-2px); box-shadow: var(--pb-shadow-chip), 0 8px 16px -6px var(--pb-gel-shadow), 0 0 0 1px var(--pb-accent); }
.pb-cattile:active { transform: scale(.97); }
.pb-cattile[aria-current="true"] { color: var(--pb-accent-hover); background: var(--pb-selected-fill); box-shadow: var(--pb-shadow-chip), 0 0 0 2px var(--pb-accent), 0 6px 14px -6px var(--pb-gel-shadow); }
.pb-cattile__name { max-width: 100%; font-size: var(--pb-text-xs); font-weight: var(--pb-weight-bold); line-height: 1.1; text-align: center; overflow-wrap: anywhere; hyphens: auto; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pb-cattile__n {
  position: absolute; top: 5px; right: 6px; min-width: 20px; height: 19px; padding: 0 5px; border-radius: var(--pb-radius-pill); display: grid; place-items: center;
  font-size: var(--pb-text-2xs); font-weight: var(--pb-weight-black); font-variant-numeric: tabular-nums; color: var(--pb-on-accent); background: linear-gradient(180deg, var(--pb-gel-1), var(--pb-gel-3)); box-shadow: var(--pb-shadow-chip);
}
.pb-cattile .pb-orb { width: 34px; height: 34px; }
.pb-cattile--empty { opacity: .55; }
.pb-cattile--empty .pb-orb { filter: saturate(.35); }
.pb-cattile--empty .pb-cattile__n { color: var(--pb-text-muted); background: var(--pb-sky-100); }
.pb-cattile--empty:hover { opacity: 1; }
.pb-catpanel__filters { display: grid; grid-template-columns: auto 1fr; gap: var(--pb-space-5) var(--pb-space-6); align-items: center; padding: var(--pb-space-6) var(--pb-space-7); border-radius: var(--pb-radius-lg); background: var(--pb-glass-well); border: 1px solid var(--pb-border-glass); box-shadow: var(--pb-shadow-well); }
.pb-catpanel__label { display: flex; align-items: center; gap: var(--pb-space-3); font-size: var(--pb-text-xs); font-weight: var(--pb-weight-black); letter-spacing: .06em; text-transform: uppercase; color: var(--pb-text-muted); }
.pb-catpanel__label svg.pb-icon { width: var(--pb-icon-sm); height: var(--pb-icon-sm); }
/* The foot stays in view when the panel scrolls (short screens, phones). */
.pb-catpanel__foot {
  position: sticky; bottom: calc(-1 * var(--pb-space-8)); z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: var(--pb-space-5);
  margin: auto calc(-1 * var(--pb-space-8)) calc(-1 * var(--pb-space-8)); padding: var(--pb-space-5) var(--pb-space-8) var(--pb-space-8); background: var(--pb-sky-50); box-shadow: 0 -1px 0 var(--pb-border);
}

/* ---------- 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-family: var(--pb-font-display); font-size: var(--pb-text-2xl); font-weight: var(--pb-weight-display); 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-info-soft); border: 1px solid var(--pb-border-glass); box-shadow: inset 4px 0 0 var(--pb-info), var(--pb-shadow-chip);
}
.pb-notice > svg.pb-icon { color: var(--pb-info); margin-top: 2px; }
@media (max-width: 599px) { .pb-notice > div + div { grid-column: 2 / -1; } }
.pb-notice__title { font-weight: var(--pb-weight-black); }
.pb-notice__text { color: var(--pb-text-secondary); font-size: var(--pb-text-md); font-weight: var(--pb-weight-medium); }
.pb-notice--success { background: var(--pb-live-soft); box-shadow: inset 4px 0 0 var(--pb-live-glow), var(--pb-shadow-chip); } .pb-notice--success > svg.pb-icon { color: var(--pb-live); }
.pb-notice--warning { background: var(--pb-warning-soft); box-shadow: inset 4px 0 0 var(--pb-warning-glow), var(--pb-shadow-chip); } .pb-notice--warning > svg.pb-icon { color: var(--pb-warning); }
.pb-notice--danger { background: var(--pb-danger-soft); box-shadow: inset 4px 0 0 var(--pb-danger-fill), var(--pb-shadow-chip); } .pb-notice--danger > svg.pb-icon { color: var(--pb-danger); }

/* ---------- Empty / error / loading ---------- */
.pb-empty { display: grid; justify-items: start; gap: var(--pb-space-5); padding: var(--pb-space-11) var(--pb-space-10); border-radius: var(--pb-radius-lg); }
.pb-empty > svg.pb-icon {
  width: var(--pb-orb-xl); height: var(--pb-orb-xl); padding: 18px; border-radius: 50%; margin-bottom: var(--pb-space-3); stroke-width: 1.8;
  color: var(--pb-white); background: radial-gradient(circle at 50% 115%, var(--pb-gel-glow) 0%, transparent 55%), linear-gradient(180deg, var(--pb-gel-1), var(--pb-gel-3)); box-shadow: var(--pb-shadow-orb);
}
.pb-empty__title { font-family: var(--pb-font-display); font-size: var(--pb-text-2xl); font-weight: var(--pb-weight-display); line-height: var(--pb-leading-snug); }
.pb-empty__text { color: var(--pb-text-muted); max-width: var(--pb-readable); font-weight: var(--pb-weight-medium); }
.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; border-radius: var(--pb-radius); }
.pb-skel--title { height: 20px; width: 60%; }
.pb-skel--line { height: 12px; width: 80%; }
.pb-skel--cell { height: 12px; }
.pb-skel { background: var(--pb-skeleton); background-size: 200% 100%; border-radius: var(--pb-radius-sm); animation: pb-shimmer 1.4s ease-in-out infinite; }
@keyframes pb-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@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));
  border-radius: 20px; padding: var(--pb-space-3);
}
.pb-menu--inline { position: static; -webkit-backdrop-filter: none; backdrop-filter: none; }
.pb-menu-backdrop { position: fixed; inset: 0; z-index: var(--pb-z-menu); }
.pb-menu--header { position: fixed; top: calc(var(--pb-header-h) - 6px); right: max(var(--pb-gutter), calc((100vw - var(--pb-container)) / 2 + var(--pb-gutter))); }
.pb-menu--panel { width: 400px; padding: var(--pb-space-7); display: grid; gap: var(--pb-space-4); border-radius: var(--pb-radius-lg); }
.pb-menu__item { display: flex; align-items: center; gap: var(--pb-space-5); width: 100%; min-height: 42px; padding: 0 var(--pb-space-6); border: 0; background: none; border-radius: var(--pb-radius); text-align: left; text-decoration: none; cursor: pointer; color: var(--pb-text); font-weight: var(--pb-weight-bold); font-size: var(--pb-text-base); }
.pb-menu__item:hover { background: var(--pb-surface-hover); color: var(--pb-text); }
.pb-menu__item svg.pb-icon { color: var(--pb-accent); }
.pb-menu__item--danger, .pb-menu__item--danger svg.pb-icon { color: var(--pb-danger); }
.pb-menu__sep { height: 1px; background: var(--pb-border); margin: var(--pb-space-3) var(--pb-space-4); }
.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; border-radius: var(--pb-radius-lg); padding: var(--pb-space-9) 28px;
  display: grid; gap: var(--pb-space-7); animation: pb-pop var(--pb-dur-slow) var(--pb-ease-pop);
}
.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-family: var(--pb-font-display); font-size: var(--pb-text-2xl); font-weight: var(--pb-weight-display); line-height: var(--pb-leading-tight); letter-spacing: -0.01em; }
.pb-dialog__foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--pb-space-4); }
.pb-sheet {
  position: fixed; top: var(--pb-space-4); right: var(--pb-space-4); bottom: var(--pb-space-4); z-index: var(--pb-z-dialog); width: min(420px, calc(100% - 16px));
  border-radius: var(--pb-radius-lg); display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden;
}
.pb-sheet__head { display: flex; justify-content: space-between; align-items: center; gap: var(--pb-space-6); padding: var(--pb-space-7) var(--pb-space-7) 0 var(--pb-space-9); }
.pb-sheet__body { overflow: auto; padding: var(--pb-space-6) var(--pb-space-9) 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); }

.pb-toasts { position: fixed; z-index: var(--pb-z-toast); left: 50%; bottom: 28px; transform: translateX(-50%); display: grid; gap: var(--pb-space-4); width: min(460px, calc(100vw - 24px)); }
.pb-toast {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--pb-space-6); align-items: center; padding: var(--pb-space-4) var(--pb-space-6) var(--pb-space-4) var(--pb-space-4);
  border-radius: var(--pb-radius-pill); color: var(--pb-text); font-weight: var(--pb-weight-bold); animation: pb-rise var(--pb-dur-slow) var(--pb-ease-pop);
}
.pb-toast > svg.pb-icon { width: 36px; height: 36px; padding: 9px; border-radius: 50%; color: var(--pb-white); background: linear-gradient(180deg, var(--pb-go-1), var(--pb-go-3)); box-shadow: var(--pb-shadow-orb); }
.pb-toast .pb-btn--ghost { color: var(--pb-accent); }
/* Tones: the orb says what happened. Errors also get a red rim and red text, so they never read as success. */
.pb-toast--info > svg.pb-icon { background: linear-gradient(180deg, var(--pb-accent), var(--pb-accent-hover)); }
.pb-toast--warning > svg.pb-icon { background: var(--pb-warning-glow); color: var(--pb-warning); }
.pb-toast--error { color: var(--pb-danger); background: var(--pb-danger-soft); border: 2px solid var(--pb-danger-fill); }
.pb-toast--error > svg.pb-icon { background: linear-gradient(180deg, var(--pb-red-1), var(--pb-red-3)); box-shadow: var(--pb-shadow-red); }
.pb-toast--error .pb-btn--ghost { color: var(--pb-danger); }
/* Wide screens: bottom right, no wider than the side column, so the reading column (About this game,
   How to play) stays uncovered. Phones keep the full-width toast above the tab bar. */
@media (min-width: 900px) {
  .pb-toasts { left: auto; right: max(var(--pb-gutter), calc((100vw - var(--pb-container)) / 2 + var(--pb-gutter))); bottom: var(--pb-space-9); transform: none; width: min(var(--pb-aside-w), calc(100vw - 2 * var(--pb-gutter))); }
}
@keyframes pb-rise { from { opacity: 0; transform: translateY(16px); } }

/* ---------- Data display ---------- */
.pb-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--pb-space-5) var(--pb-space-9); margin: 0; }
.pb-kv dt { color: var(--pb-text-muted); font-size: var(--pb-text-md); font-weight: var(--pb-weight-bold); }
.pb-kv dd { margin: 0; overflow-wrap: anywhere; font-weight: var(--pb-weight-bold); }
.pb-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--pb-space-5); }
.pb-stat { border-radius: var(--pb-radius-lg); padding: var(--pb-space-7) var(--pb-space-8); display: grid; gap: var(--pb-space-2); }
.pb-stat__value { font-size: var(--pb-text-3xl); font-weight: var(--pb-weight-black); line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.pb-stat__label { font-size: var(--pb-text-sm); color: var(--pb-text-muted); font-weight: var(--pb-weight-bold); }
.pb-table-wrap { overflow-x: auto; border-radius: var(--pb-radius-lg); }
.pb-table { width: 100%; border-collapse: collapse; font-size: var(--pb-text-md); font-weight: var(--pb-weight-medium); }
.pb-table th { text-align: left; font-weight: var(--pb-weight-black); color: var(--pb-text-muted); font-size: var(--pb-text-sm); padding: var(--pb-space-6) var(--pb-space-7); border-bottom: 1px solid var(--pb-border-strong); 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 tbody tr:hover td { background: var(--pb-surface-hover); }
.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: 12px; border-radius: var(--pb-radius-pill); background: var(--pb-sky-100); box-shadow: var(--pb-shadow-well), 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); font-weight: var(--pb-weight-bold); }
.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); font-weight: var(--pb-weight-bold); }
.pb-steps li::before { content: counter(step); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--pb-chrome); border: 1px solid var(--pb-border-strong); font-weight: var(--pb-weight-black); font-size: var(--pb-text-sm); color: var(--pb-text); }
.pb-steps li + li { padding-left: var(--pb-space-4); border-left: 1px solid var(--pb-border-strong); }
.pb-steps li[aria-current="step"] { color: var(--pb-text); }
.pb-steps li[aria-current="step"]::before { color: var(--pb-on-accent); border-color: var(--pb-gel-edge); background: linear-gradient(180deg, var(--pb-gel-1), var(--pb-gel-3)); box-shadow: var(--pb-shadow-orb); }
.pb-steps li[data-done]::before { content: "✓"; color: var(--pb-on-accent); border-color: var(--pb-go-edge); background: linear-gradient(180deg, var(--pb-go-1), var(--pb-go-3)); }

/* ---------- App frame ---------- */
.pb-header { position: sticky; top: 0; z-index: var(--pb-z-header); padding: var(--pb-space-6) var(--pb-gutter) 0; }
/* A soft band of sky behind the floating bar so scrolled content fades under it. */
.pb-header::before { content: ""; position: absolute; inset: 0 0 -12px 0; z-index: -1; pointer-events: none; background: linear-gradient(180deg, var(--pb-sky-400), transparent); opacity: .55; -webkit-mask-image: linear-gradient(180deg, var(--pb-white) 55%, transparent); mask-image: linear-gradient(180deg, var(--pb-white) 55%, transparent); }
.pb-header__in {
  position: relative; max-width: var(--pb-container); margin: 0 auto; height: var(--pb-header-bar); padding: 0 var(--pb-space-6) 0 var(--pb-space-3);
  display: flex; align-items: center; gap: var(--pb-space-6); border-radius: var(--pb-radius-pill);
}
.pb-header__in::after { content: ""; position: absolute; inset: 0 0 50% 0; border-radius: var(--pb-radius-pill) var(--pb-radius-pill) 0 0 / var(--pb-header-bar) var(--pb-header-bar) 0 0; background: linear-gradient(180deg, var(--pb-border-glass), transparent); opacity: .5; pointer-events: none; }
.pb-header__in > * { position: relative; z-index: 1; }
.pb-header__in > .pb-logo { padding: 5px 16px 5px 5px; }
.pb-header__search { display: flex; align-items: center; gap: var(--pb-space-4); flex: 1; min-width: 0; max-width: 460px; margin-left: auto; }
.pb-header__search form { flex: 1; min-width: 0; }
.pb-header__search .pb-input { border-radius: var(--pb-radius-pill); border-color: var(--pb-border-strong); }
.pb-header__acts { display: flex; align-items: center; gap: var(--pb-space-4); position: relative; }
.pb-nav { display: flex; align-items: center; gap: var(--pb-space-2); }
.pb-nav__link {
  position: relative; display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 15px; border-radius: var(--pb-radius-pill); border: 1px solid transparent;
  background: none; text-decoration: none; cursor: pointer; white-space: nowrap; font-size: var(--pb-text-base); font-weight: var(--pb-weight-bold); color: var(--pb-text-muted);
  transition: background-color var(--pb-dur) var(--pb-ease), color var(--pb-dur) var(--pb-ease);
}
.pb-nav__link svg.pb-icon { width: var(--pb-icon-md); height: var(--pb-icon-md); }
.pb-nav__link:hover { color: var(--pb-text); background: var(--pb-glass); border-color: var(--pb-border-glass); }
.pb-nav__link[aria-current="page"] {
  isolation: isolate; color: var(--pb-on-accent); border-color: var(--pb-gel-edge); text-shadow: var(--pb-gel-text-shadow); box-shadow: var(--pb-shadow-gel);
  background: radial-gradient(120% 90% at 50% 125%, var(--pb-gel-glow) 0%, transparent 50%), linear-gradient(180deg, var(--pb-gel-1) 0%, var(--pb-gel-2) 49%, var(--pb-gel-3) 51%, var(--pb-gel-4) 100%);
}
.pb-nav__link[aria-current="page"]::before { content: ""; position: absolute; left: 8%; right: 8%; top: 1px; height: 42%; z-index: -1; border-radius: var(--pb-radius-pill); background: var(--pb-gloss); }
.pb-nav__link[aria-current="page"]:hover { color: var(--pb-on-accent); filter: brightness(1.06); }
.pb-nav__link .pb-badge { margin-left: var(--pb-space-1); }
.pb-nav__label { display: inline; }
.pb-nav__cats svg.pb-icon:last-child { width: 15px; height: 15px; transition: transform var(--pb-dur) var(--pb-ease); }
.pb-nav__cats[aria-expanded="true"] { color: var(--pb-accent-hover); background: var(--pb-white); border-color: var(--pb-accent); box-shadow: var(--pb-halo); }
.pb-nav__cats[aria-expanded="true"] svg.pb-icon:last-child { transform: rotate(180deg); }
.pb-hdr-btn {
  position: relative; display: grid; place-items: center; flex: none; width: var(--pb-control-md); height: var(--pb-control-md); padding: 0; border-radius: 50%;
  border: 1px solid var(--pb-border-strong); background: var(--pb-chrome); box-shadow: var(--pb-shadow-control); cursor: pointer; color: var(--pb-text); text-decoration: none;
}
.pb-hdr-btn:hover { background: var(--pb-chrome-hover); box-shadow: var(--pb-shadow-control-hover); }
.pb-hdr-btn--avatar { padding: 0; }
.pb-hdr-btn .pb-badge { position: absolute; top: -5px; right: -5px; }
.pb-hdr-btn .pb-badge--dot { top: 8px; right: 8px; }
/* Discord: Playbay's community, in its own colour so it reads at a glance. */
.pb-hdr-discord { color: var(--pb-white); background: var(--pb-discord); border-color: var(--pb-discord-hover); }
.pb-hdr-discord:hover { color: var(--pb-white); background: var(--pb-discord-hover); }
.pb-hdr-discord .pb-icon { width: 22px; height: 22px; }
.pb-hdr-discord--phone { display: none; }
.pb-hdr-cats { display: none; border-radius: var(--pb-radius); }
.pb-hdr-cats[aria-expanded="true"] { border-color: var(--pb-accent); box-shadow: var(--pb-halo); }
.pb-hdr-points { display: inline-flex; align-items: center; height: var(--pb-control-sm); padding: 0 var(--pb-space-7); border-radius: var(--pb-radius-pill); border: 1px solid var(--pb-border-strong); background: var(--pb-chrome); box-shadow: var(--pb-shadow-control); text-decoration: none; font-size: var(--pb-text-md); }
.pb-hdr-points__label { margin-left: var(--pb-space-2); color: var(--pb-text-muted); font-weight: var(--pb-weight-bold); }
.pb-hdr-points:hover { box-shadow: var(--pb-shadow-control-hover); color: var(--pb-text); }
.pb-tabbar { display: none; }
/* Creator guide (STYLEGUIDE 8.6): path cards, then glass step panels with gel numbers and framed screenshots */
.pb-guide-paths { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--pb-space-7); }
.pb-guide-path { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--pb-space-2) var(--pb-space-7); align-items: center; padding: var(--pb-space-8) var(--pb-space-9); border-radius: var(--pb-radius-lg); color: var(--pb-text); text-decoration: none; transition: box-shadow var(--pb-dur) var(--pb-ease), transform var(--pb-dur) var(--pb-ease-pop); }
.pb-guide-path:hover, .pb-guide-path:focus-visible { color: var(--pb-text); box-shadow: var(--pb-shadow-hover); transform: translateY(-2px); }
.pb-guide-path__icon {
  --orb: var(--pb-orb-aqua); position: relative; grid-row: span 2; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; color: var(--pb-white);
  background: radial-gradient(circle at 50% 115%, color-mix(in srgb, var(--orb) 45%, var(--pb-white)) 0%, transparent 55%), linear-gradient(180deg, color-mix(in srgb, var(--orb) 78%, var(--pb-white)) 0%, var(--orb) 100%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--orb) 70%, var(--pb-ink-900)), var(--pb-shadow-orb);
}
.pb-guide-path__icon--violet { --orb: var(--pb-orb-violet); }
.pb-guide-path__icon::before { content: ""; position: absolute; left: 14%; right: 14%; top: 5%; height: 42%; border-radius: 50%; background: var(--pb-gloss-soft); pointer-events: none; }
.pb-guide-path__icon svg.pb-icon { position: relative; width: var(--pb-icon-lg); height: var(--pb-icon-lg); filter: var(--pb-shadow-icon); }
.pb-guide-path__title { font-family: var(--pb-font-display); font-size: var(--pb-text-xl); font-weight: var(--pb-weight-display); line-height: var(--pb-leading-snug); }
.pb-guide-path__text { color: var(--pb-text-secondary); font-weight: var(--pb-weight-medium); }
.pb-guide-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--pb-space-7); }
.pb-guide-step { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--pb-space-9) var(--pb-space-10); align-items: start; }
.pb-guide-step--text { grid-template-columns: minmax(0, 1fr); }
.pb-guide-step__body { display: grid; gap: var(--pb-space-5); align-content: start; justify-items: start; min-width: 0; max-width: var(--pb-readable); }
.pb-guide-step__body > .pb-field, .pb-guide-step__body > .pb-copy { justify-self: stretch; }
.pb-guide-step__head { display: flex; align-items: center; gap: var(--pb-space-6); margin-bottom: var(--pb-space-2); }
.pb-guide-step__title { margin: 0; min-width: 0; font-family: var(--pb-font-display); font-weight: var(--pb-weight-display); font-size: var(--pb-text-2xl); line-height: var(--pb-leading-snug); }
.pb-guide-step__text { margin: 0; color: var(--pb-text-secondary); font-size: var(--pb-text-body); line-height: 1.6; }
.pb-shot { margin: 0; border-radius: var(--pb-radius-media); overflow: hidden; border: 4px solid var(--pb-white); box-shadow: 0 0 0 1px var(--pb-border), var(--pb-shadow-panel); background: var(--pb-media-bg); }
.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: var(--pb-space-5) auto var(--pb-space-8); width: calc(100% - 2 * var(--pb-gutter)); padding: var(--pb-space-6) var(--pb-space-8);
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--pb-space-4) var(--pb-space-8); border-radius: var(--pb-radius-pill);
  color: var(--pb-text-muted); font-size: var(--pb-text-md); font-weight: var(--pb-weight-bold);
}
.pb-footer a { text-decoration: none; }
.pb-footer a:hover { color: var(--pb-accent-hover); text-decoration: underline; }
.pb-footer .pb-disclosure__body { max-width: var(--pb-readable); }
.pb-community { display: inline-flex; gap: var(--pb-space-3); margin-left: auto; }
.pb-community__link { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--pb-text); border: 1px solid var(--pb-border-strong); background: var(--pb-chrome); box-shadow: var(--pb-shadow-control); }
.pb-community__link:hover, .pb-community__link:focus-visible { color: var(--pb-accent-hover); text-decoration: none; }
.pb-footer select { appearance: auto; min-height: 30px; padding: 0 var(--pb-space-3); border-radius: var(--pb-radius-pill); border: 1px solid var(--pb-border-strong); background: var(--pb-chrome); color: inherit; font-weight: var(--pb-weight-bold); cursor: pointer; }

.pb-main { max-width: var(--pb-container); margin: 0 auto; padding: var(--pb-space-7) var(--pb-gutter) var(--pb-space-11); min-height: calc(100vh - var(--pb-header-h) - 80px); }
.pb-layout { display: grid; gap: clamp(16px, 2vw, 28px); align-items: start; }
.pb-layout--aside { grid-template-columns: minmax(0, 1fr) var(--pb-aside-w); }
.pb-layout--detail { grid-template-columns: minmax(0, 1fr) var(--pb-aside-w); }
/* Owner decision 2026-10-03: side panels never stick or drift while the page scrolls. The class stays for old markup. */
.pb-layout__sticky { position: static; }
.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-6); border-radius: var(--pb-radius-pill); text-decoration: none; color: var(--pb-text-muted); font-weight: var(--pb-weight-bold); }
.pb-subnav a:hover { background: var(--pb-glass); color: var(--pb-text); }
.pb-subnav a[aria-current="page"] { background: var(--pb-chrome); color: var(--pb-text); box-shadow: var(--pb-shadow-control), 0 0 0 1px var(--pb-border); }
.pb-subnav a svg.pb-icon { color: var(--pb-accent-bright); }
.pb-subnav__label { font-size: var(--pb-text-xs); color: var(--pb-text-muted); font-weight: var(--pb-weight-black); letter-spacing: .06em; text-transform: uppercase; padding: var(--pb-space-7) var(--pb-space-6) var(--pb-space-3); }

/* ---------- Auth ---------- */
/* Full width up to 440 px, so every step (sign in, two-step code, reset…) keeps the same card width. */
.pb-auth { width: 100%; max-width: 440px; margin: var(--pb-space-10) auto; display: grid; gap: var(--pb-space-8); }
.pb-auth__brand { display: grid; place-items: center; }
.pb-auth__card { 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-family: var(--pb-font-display); font-size: var(--pb-text-3xl); font-weight: var(--pb-weight-display); line-height: var(--pb-leading-tight); letter-spacing: var(--pb-tracking-display); }
.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); font-weight: var(--pb-weight-bold); }
.pb-auth__or::before, .pb-auth__or::after { content: ""; height: 1px; background: var(--pb-border-strong); }
.pb-auth__foot { text-align: center; font-size: var(--pb-text-md); color: var(--pb-text-muted); font-weight: var(--pb-weight-medium); }

/* ---------- Game detail hero (STYLEGUIDE 8.3): stage + side panel; the side panel never sticks ---------- */
.pb-hero { min-width: 0; }
.pb-hero__media { padding: var(--pb-space-6); border-radius: var(--pb-radius-lg); min-width: 0; }
.pb-hero__pic { position: relative; aspect-ratio: 16 / 9; border-radius: var(--pb-radius-media); overflow: hidden; background: var(--pb-media-bg); isolation: isolate; }
.pb-hero__pic::after { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; pointer-events: none; background: var(--pb-media-gloss); box-shadow: var(--pb-media-rim); }
/* The one reflection in the product: a faint mirrored strip of the picture under the stage (wide screens only). */
.pb-hero__reflect {
  position: relative; height: 64px; margin: var(--pb-space-2) var(--pb-space-6) -40px; border-radius: var(--pb-radius-media); overflow: hidden; pointer-events: none;
  transform: scaleY(-1); opacity: .32; -webkit-mask-image: linear-gradient(to top, var(--pb-white) 0%, transparent 70%); mask-image: linear-gradient(to top, var(--pb-white) 0%, transparent 70%);
}
.pb-hero__mirror { position: absolute; left: 0; right: 0; bottom: 0; aspect-ratio: 16 / 9; background: var(--pb-media-bg); }
.pb-hero__side { display: grid; gap: var(--pb-space-8); align-content: start; padding: var(--pb-space-9); }
.pb-hero__title { font-family: var(--pb-font-display); font-size: clamp(var(--pb-text-3xl), 2.9vw, var(--pb-text-4xl)); font-weight: var(--pb-weight-display); line-height: var(--pb-leading-tight); letter-spacing: var(--pb-tracking-display); text-wrap: balance; overflow-wrap: anywhere; }
.pb-hero__skel { border-radius: var(--pb-radius-media); }
.pb-playbox { display: grid; gap: var(--pb-space-6); }
.pb-playbox__hint { margin-top: calc(-1 * var(--pb-space-2)); font-size: var(--pb-text-sm); font-weight: var(--pb-weight-medium); color: var(--pb-text-muted); text-align: center; text-wrap: pretty; }
.pb-playbox__pair { display: flex; flex-wrap: wrap; gap: var(--pb-space-5); }
.pb-playbox__pair > * { flex: 1 1 0; min-width: max-content; }

/* ---------- Game shell (fullscreen player): a calm bar, the game gets everything else ---------- */
.pb-shell { position: fixed; inset: 0; z-index: var(--pb-z-shell); background: var(--pb-media-bg); 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: 52px; padding: 0 var(--pb-space-5); background: var(--pb-glass-solid); border-bottom: 1px solid var(--pb-border-strong); box-shadow: var(--pb-shadow-chip); }
.pb-shell__title { font-family: var(--pb-font-display); font-weight: var(--pb-weight-display); font-size: var(--pb-text-xl); line-height: 1.1; 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); font-weight: var(--pb-weight-bold); white-space: nowrap; }
.pb-shell__spacer { flex: 1; }
/* Before the game's frame is there (launch, stopped): the empty-picture look, aqua light on navy. */
.pb-shell__stage { position: relative; overflow: hidden; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, var(--pb-aqua-600), var(--pb-media-bg) 70%); }
.pb-shell__frame { position: absolute; inset: 0; }
.pb-shell__frame iframe { display: block; width: 100%; height: 100%; border: 0; background: var(--pb-media-bg); color-scheme: dark; } /* games paint as before the light frame */
.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; }
/* The fullscreen "Game menu" button: it must fit the game's free top-right corner (150 × 52). */
.pb-shell__peek { position: absolute; top: var(--pb-space-4); right: var(--pb-space-4); z-index: 1; max-width: calc(var(--pb-game-corner-w) - var(--pb-space-4)); max-height: calc(var(--pb-game-corner-h) - var(--pb-space-4)); }
/* Tighter than a normal small button so every language's words fit whole (ellipsis stays as the last resort). */
.pb-shell__peek .pb-btn { max-width: 100%; overflow: hidden; padding: 0 var(--pb-space-5); gap: var(--pb-space-2); font-size: var(--pb-text-sm); }
.pb-shell__peek .pb-btn > span { overflow: hidden; text-overflow: ellipsis; }
.pb-wait { display: grid; gap: var(--pb-space-7); justify-items: center; text-align: center; max-width: 440px; padding: var(--pb-space-10); border-radius: var(--pb-radius-lg); }
.pb-wait__pos { font-size: var(--pb-text-5xl); font-weight: var(--pb-weight-black); line-height: 1; color: var(--pb-accent); font-variant-numeric: tabular-nums; }
.pb-wait > svg.pb-icon { width: var(--pb-icon-xl); height: var(--pb-icon-xl); color: var(--pb-accent); }
.pb-wait > .pb-spinner { width: var(--pb-icon-xl); height: var(--pb-icon-xl); }
/* Over the game (play shell): floating glass, so the game behind never shows through the words. */
.pb-wait--float { background: var(--pb-glass-strong); box-shadow: var(--pb-shadow-float); -webkit-backdrop-filter: var(--pb-glass-blur); backdrop-filter: var(--pb-glass-blur); }
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) { .pb-wait--float { background: var(--pb-glass-solid); } }

/* ---------- Character preview: a recessed sky well around the character canvas ---------- */
.pb-char { display: grid; place-items: center; border-radius: var(--pb-radius-lg); background: var(--pb-glass-well); box-shadow: var(--pb-shadow-well); border: 1px solid var(--pb-border-glass); padding: var(--pb-space-7); overflow: hidden; }
.pb-char canvas { display: block; max-width: 100%; height: auto; }
.pb-char--sm { padding: 0; border-radius: var(--pb-radius); }
.pb-swatch { display: block; width: 100%; height: 100%; border-radius: var(--pb-radius-sm); }

/* ---------- A game inside another site (itch.io, ADR-0130) ---------- */
.pb-embed { position: fixed; inset: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.pb-embed__bar { display: flex; align-items: center; gap: var(--pb-space-4); height: 52px; padding: 0 var(--pb-space-5) 0 var(--pb-space-4); background: var(--pb-glass-solid); border-bottom: 1px solid var(--pb-border-strong); box-shadow: var(--pb-shadow-chip); }
/* The mark and the word on a small white pill (owner rule: the logo always sits on white). */
.pb-embed__brand {
  display: inline-flex; align-items: center; gap: var(--pb-space-3); flex: none; padding: var(--pb-space-2) var(--pb-space-7) var(--pb-space-2) var(--pb-space-2);
  border-radius: var(--pb-radius-pill); color: var(--pb-logo-ink); text-decoration: none;
  background: linear-gradient(180deg, var(--pb-white) 0%, var(--pb-white) 50%, var(--pb-sky-50) 51%, var(--pb-white) 100%);
  border: 1px solid var(--pb-white); box-shadow: 0 0 0 1px var(--pb-border), var(--pb-shadow-control); transition: box-shadow var(--pb-dur) var(--pb-ease);
}
.pb-embed__brand:hover { color: var(--pb-logo-ink); box-shadow: 0 0 0 1px var(--pb-border-strong), var(--pb-shadow-control-hover); }
.pb-embed__brand .pb-logo__word { font-size: var(--pb-text-xl); }
/* Rows keep their full height in short frames (the picture frame clips its overflow, so it has no minimum of its own); the area scrolls instead. */
.pb-embed__main { display: grid; grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr); grid-auto-rows: max-content; gap: var(--pb-space-9); align-items: center; align-content: center; padding: var(--pb-space-9); overflow: auto; }
/* The stage: the whole picture in a glass frame, with the same gloss as every game picture. */
.pb-embed__media { position: relative; aspect-ratio: 16 / 9; border-radius: var(--pb-radius-lg); overflow: hidden; background-color: var(--pb-media-bg); border-width: 8px; }
.pb-embed__media::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: var(--pb-media-gloss); box-shadow: var(--pb-media-rim); }
/* No game yet (loading, unavailable): the empty-picture light inside the glass frame. */
.pb-embed__media:empty { background: radial-gradient(circle at 50% 40%, var(--pb-aqua-600), var(--pb-media-bg) 70%) padding-box, var(--pb-glass) border-box; }
.pb-embed__info { min-width: 0; }
.pb-embed__title { font-family: var(--pb-font-display); font-size: var(--pb-text-4xl); font-weight: var(--pb-weight-display); line-height: var(--pb-leading-tight); letter-spacing: var(--pb-tracking-display); text-wrap: balance; overflow-wrap: anywhere; }
.pb-embed__facts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--pb-space-3); }
.pb-embed__facts .pb-devices { margin-left: var(--pb-space-3); }
.pb-embed__text { color: var(--pb-text-secondary); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- How making a game works (creator page): a glass panel with gel numbered steps ---------- */
.pb-howto { display: grid; gap: var(--pb-space-7); }
.pb-howto__head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--pb-space-2) var(--pb-space-6); align-items: center; }
.pb-howto__title { font-family: var(--pb-font-display); font-size: var(--pb-text-2xl); font-weight: var(--pb-weight-display); line-height: var(--pb-leading-snug); }
.pb-howto__text { grid-column: 2; color: var(--pb-text-secondary); max-width: var(--pb-readable); font-weight: var(--pb-weight-regular); }
.pb-howto__steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--pb-space-6); }
.pb-howto__steps li { display: flex; gap: var(--pb-space-5); align-items: flex-start; padding: var(--pb-space-6); border-radius: var(--pb-radius); background: var(--pb-surface-raised); border: 1px solid var(--pb-border); box-shadow: var(--pb-shadow-chip); font-weight: var(--pb-weight-medium); color: var(--pb-text-secondary); }

/* =====================================================================
   Page-area blocks (docs/design/aqua-gloss/WORK-SPLIT.md).
   Each page agent adds rules ONLY between its own markers. Use new
   .pb-<area>-… or component modifier classes; never restyle a shared selector.
   ===================================================================== */
/* @area discover (agent A) */
/* List page head: an orb that says what the list is, next to the Cardo title. */
.pb-discover-head { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: var(--pb-space-7); min-width: 0; }
.pb-discover-head > .pb-page-head__sub { grid-column: 2; }
/* The bar over a game list: sort, active filters, count (pushed right). */
.pb-discover-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--pb-space-6); min-width: 0; }
.pb-discover-filters { display: flex; flex-wrap: wrap; gap: var(--pb-space-4); min-width: 0; }
.pb-discover-filter {
  display: inline-flex; align-items: center; gap: var(--pb-space-4); min-height: var(--pb-control-sm); max-width: 100%; padding: 0 var(--pb-space-3);
  border-radius: var(--pb-radius-pill); border: 1px solid color-mix(in srgb, var(--pb-accent) 40%, transparent); background: var(--pb-surface-raised);
  box-shadow: var(--pb-shadow-control); color: var(--pb-accent-hover); font-size: var(--pb-text-md); font-weight: var(--pb-weight-bold); line-height: 1.1;
  text-decoration: none; cursor: pointer; transition: box-shadow var(--pb-dur) var(--pb-ease);
}
.pb-discover-filter > span:not([class]) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-discover-filter:hover { color: var(--pb-accent-hover); box-shadow: var(--pb-shadow-control-hover), var(--pb-halo); }
.pb-discover-filter__x { display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--pb-surface-selected); }
.pb-discover-filter__x svg.pb-icon { width: 13px; height: 13px; stroke-width: 2.6; }
.pb-discover-filter:hover .pb-discover-filter__x { background: var(--pb-selected-fill); }
.pb-discover-count { display: inline-flex; align-items: center; gap: var(--pb-space-3); margin-left: auto; color: var(--pb-text-secondary); font-size: var(--pb-text-base); font-weight: var(--pb-weight-black); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pb-discover-count svg.pb-icon { color: var(--pb-accent-bright); }
/* Friends playing now: people side by side, as many columns as fit. */
.pb-discover-friends { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: var(--pb-space-4) var(--pb-space-7); }
@media (pointer: coarse) { .pb-discover-filter { min-height: var(--pb-control-md); } }
@media (prefers-reduced-motion: reduce) { .pb-spot-picker button, .pb-spot-picker button:hover { transform: none; transition: none; } }
/* @end area discover */
/* @area detail (agent B) */
/* Game page (STYLEGUIDE 8.3), creator landing and guide (8.6). The hero, guide and how-to blocks above are B's too. */
.pb-detail-head { display: flex; align-items: center; gap: var(--pb-space-5); font-family: var(--pb-font-display); font-size: var(--pb-text-2xl); font-weight: var(--pb-weight-display); line-height: var(--pb-leading-snug); letter-spacing: -0.01em; }
.pb-detail-head > span { min-width: 0; overflow-wrap: anywhere; }
.pb-detail-head--lg { font-size: var(--pb-text-3xl); line-height: var(--pb-leading-tight); }
.pb-detail-sec { display: grid; gap: var(--pb-space-6); align-content: start; }
.pb-detail-by { display: flex; align-items: center; gap: var(--pb-space-5); justify-self: start; font-weight: var(--pb-weight-bold); color: var(--pb-text-muted); text-decoration: none; }
.pb-detail-by b { color: var(--pb-text); font-weight: var(--pb-weight-black); }
a.pb-detail-by:hover b { color: var(--pb-accent-hover); text-decoration: underline; text-underline-offset: 3px; }
/* Fact tiles: two per row while there is room, one per row in the narrow tablet column. */
.pb-detail-facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: var(--pb-space-5); }
.pb-detail-fact { display: flex; align-items: center; gap: var(--pb-space-5); min-width: 0; padding: var(--pb-space-5) var(--pb-space-6); border-radius: var(--pb-radius-media); background: var(--pb-surface-raised); border: 1px solid var(--pb-border-glass); box-shadow: 0 0 0 1px var(--pb-border), var(--pb-shadow-chip); }
.pb-detail-fact__text { display: grid; gap: var(--pb-space-1); min-width: 0; }
.pb-detail-fact__value { font-size: var(--pb-text-lg); font-weight: var(--pb-weight-black); line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--pb-text); overflow-wrap: anywhere; }
.pb-detail-fact__value--text { font-size: var(--pb-text-base); overflow-wrap: normal; hyphens: auto; }
.pb-detail-fact__label { font-size: var(--pb-text-xs); font-weight: var(--pb-weight-bold); color: var(--pb-text-muted); line-height: 1.2; }
.pb-detail-kv { display: grid; margin: 0; }
.pb-detail-kv__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--pb-space-2) var(--pb-space-6); padding: var(--pb-space-5) 0; border-bottom: 1px solid var(--pb-border); }
.pb-detail-kv__row:first-child { padding-top: 0; }
.pb-detail-kv__row:last-child { border-bottom: 0; padding-bottom: 0; }
.pb-detail-kv dt { display: flex; align-items: center; gap: var(--pb-space-5); font-size: var(--pb-text-md); font-weight: var(--pb-weight-bold); color: var(--pb-text-muted); }
.pb-detail-kv dt svg.pb-icon { color: var(--pb-accent-bright); }
.pb-detail-kv dd { margin: 0 0 0 auto; min-width: 0; font-weight: var(--pb-weight-black); color: var(--pb-text); text-align: right; overflow-wrap: anywhere; }
.pb-detail-labels { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--pb-space-4); }
.pb-detail-label { display: flex; align-items: center; gap: var(--pb-space-5); padding: var(--pb-space-4) var(--pb-space-6) var(--pb-space-4) var(--pb-space-4); border-radius: var(--pb-radius); background: var(--pb-surface-raised); border: 1px solid var(--pb-border); box-shadow: var(--pb-shadow-chip); }
.pb-detail-label__text { display: grid; gap: var(--pb-space-1); min-width: 0; }
.pb-detail-label__text b { font-size: var(--pb-text-md); font-weight: var(--pb-weight-bold); color: var(--pb-text); }
.pb-detail-label__text span { font-size: var(--pb-text-sm); font-weight: var(--pb-weight-medium); color: var(--pb-text-muted); }
.pb-detail-label--warning { background: var(--pb-warning-soft); border-color: var(--pb-warning-glow); }
.pb-detail-label--warning .pb-detail-label__text b { color: var(--pb-warning); }
.pb-detail-tips { list-style: none; margin: 0; padding: 0; display: grid; }
.pb-detail-tips li { display: flex; align-items: flex-start; gap: var(--pb-space-6); padding: var(--pb-space-5) 0; font-weight: var(--pb-weight-medium); color: var(--pb-text); }
.pb-detail-tips li + li { border-top: 1px solid var(--pb-border); }
.pb-detail-tips svg.pb-icon { margin-top: 2px; color: var(--pb-accent-bright); }
.pb-detail-more { display: grid; gap: var(--pb-space-7); margin-top: var(--pb-space-6); }
.pb-detail-skel-btn { height: var(--pb-control-md); border-radius: var(--pb-radius-pill); }
/* Gel step numbers (guide steps, how-to steps): one highlight in the top 42 %. */
.pb-detail-num {
  position: relative; isolation: isolate; display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%;
  color: var(--pb-on-accent); text-shadow: var(--pb-gel-text-shadow); font-size: var(--pb-text-lg); font-weight: var(--pb-weight-black); line-height: 1; font-variant-numeric: tabular-nums;
  border: 1px solid var(--pb-gel-edge); box-shadow: var(--pb-shadow-orb);
  background: radial-gradient(120% 90% at 50% 125%, var(--pb-gel-glow) 0%, transparent 50%), linear-gradient(180deg, var(--pb-gel-1) 0%, var(--pb-gel-2) 49%, var(--pb-gel-3) 51%, var(--pb-gel-4) 100%);
}
.pb-detail-num::before { content: ""; position: absolute; left: 14%; right: 14%; top: 2px; height: 42%; z-index: -1; border-radius: 50%; background: var(--pb-gloss); pointer-events: none; }
.pb-detail-num--sm { width: 30px; height: 30px; font-size: var(--pb-text-md); }
@media (max-width: 1259px) {
  .pb-guide-step { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 899px) {
  .pb-hero__media { padding: var(--pb-space-4); }
  .pb-hero__reflect { display: none; }
  .pb-hero__side { gap: var(--pb-space-7); }
  .pb-detail-head--lg { font-size: var(--pb-text-2xl); }
  .pb-detail-more { margin-top: 0; }
  .pb-guide-paths, .pb-guide-step { grid-template-columns: minmax(0, 1fr); }
  .pb-guide-step__title { font-size: var(--pb-text-xl); }
  .pb-guide-step__text { font-size: var(--pb-text-md); }
  .pb-howto__steps { grid-template-columns: minmax(0, 1fr); }
  .pb-howto__text { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
  .pb-guide-path { padding: var(--pb-space-7); }
  .pb-guide-path__icon { width: 48px; height: 48px; }
}
/* @end area detail */
/* @area play (agent C) */
/* The game inside another site: one column in narrow frames, two lines of text in short ones. */
@media (max-width: 760px) {
  .pb-embed__main { grid-template-columns: minmax(0, 1fr); align-items: start; align-content: start; padding: var(--pb-space-6); gap: var(--pb-space-6); }
  .pb-embed__title { font-size: var(--pb-text-3xl); }
}
@media (max-height: 460px) { .pb-embed__text { -webkit-line-clamp: 2; } }
/* Short, wide frames (a landscape phone, a small itch.io frame): picture and panel side by side, so Play shows without scrolling. */
@media (max-height: 460px) and (min-width: 560px) {
  .pb-embed__main { grid-template-columns: minmax(0, 1fr) minmax(280px, 1.15fr); align-items: start; align-content: start; padding: var(--pb-space-6); gap: var(--pb-space-6); }
  .pb-embed__title { font-size: var(--pb-text-3xl); }
}
/* @end area play */
/* @area people (agent D) */
/* Character editor: in one column the preview comes first, where the form's hints say it is ("the preview above"). */
@media (max-width: 1060px) { .pb-people-editor > aside { order: -1; } }
/* @end area people */
/* @area money (agent E) */
/* Wallet hero: the balance in Shells on glass, its value, and the promotional / held parts. */
.pb-money-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--pb-space-8) var(--pb-space-10); }
.pb-money-hero__main { display: grid; justify-items: start; gap: var(--pb-space-4); min-width: 0; }
.pb-money-hero__label { margin: 0; font-size: var(--pb-text-md); font-weight: var(--pb-weight-black); color: var(--pb-text-muted); }
.pb-money-hero__usd { margin: 0; font-size: var(--pb-text-md); font-weight: var(--pb-weight-bold); color: var(--pb-text-muted); font-variant-numeric: tabular-nums; }
.pb-money-hero__parts { display: flex; flex-wrap: wrap; gap: var(--pb-space-5); margin: 0; }
.pb-money-hero__part {
  display: grid; align-content: space-between; gap: var(--pb-space-3); min-width: 0; max-width: 240px; padding: var(--pb-space-6) var(--pb-space-7);
  border-radius: var(--pb-radius); background: var(--pb-surface-raised); border: 1px solid var(--pb-border); box-shadow: var(--pb-shadow-chip);
}
.pb-money-hero__part dt { font-size: var(--pb-text-sm); font-weight: var(--pb-weight-bold); color: var(--pb-text-muted); overflow-wrap: anywhere; }
.pb-money-hero__part dd { margin: 0; font-size: var(--pb-text-xl); }
.pb-money-hero__end { grid-column: 1 / -1; }
/* Shop item card: the actions sit at the foot so a row of cards lines up. */
.pb-money-item { display: flex; flex-direction: column; gap: var(--pb-space-6); }
.pb-money-item--proposed { box-shadow: 0 0 0 2px var(--pb-accent), var(--pb-halo), var(--pb-shadow-panel); }
.pb-money-item__head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--pb-space-5); }
.pb-money-item__price { display: grid; justify-items: end; gap: var(--pb-space-1); }
.pb-money-item__usd { font-size: var(--pb-text-sm); font-weight: var(--pb-weight-bold); color: var(--pb-text-muted); font-variant-numeric: tabular-nums; }
.pb-money-item__foot { margin-top: auto; }
/* Long machine text (build output): a well that wraps anywhere. */
.pb-money-log {
  margin: 0; padding: var(--pb-space-6) var(--pb-space-7); border-radius: var(--pb-radius); background: var(--pb-glass-well); border: 1px solid var(--pb-border-glass); box-shadow: var(--pb-shadow-well);
  white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--pb-font-mono); font-size: var(--pb-text-sm); line-height: 1.5; color: var(--pb-text-secondary);
}
@media (max-width: 899px) {
  .pb-money-hero { grid-template-columns: minmax(0, 1fr); }
  .pb-money-hero__part { flex: 1 1 140px; max-width: none; }
}
/* @end area money */

/* ---------- Responsive (shared) ---------- */
@media (max-width: 1259px) {
  .pb-layout--detail, .pb-layout--aside { grid-template-columns: minmax(0, 1fr) 320px; }
  .pb-header__in { gap: var(--pb-space-4); }
  .pb-nav__link { padding: 0 var(--pb-space-6); }
  .pb-nav__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .pb-hdr-points__label { display: none; }
}
@media (max-width: 1060px) {
  .pb-layout--detail, .pb-layout--aside { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 899px) {
  .pb-header { padding: var(--pb-space-4) var(--pb-space-4) 0; }
  .pb-header__in { flex-wrap: wrap; height: auto; padding: var(--pb-space-4); gap: var(--pb-space-4); border-radius: 26px; }
  .pb-header__in::after { border-radius: 26px 26px 0 0 / 26px 26px 0 0; }
  .pb-header__in > .pb-logo { padding: 4px 14px 4px 4px; gap: var(--pb-space-5); }
  .pb-logo svg { width: 34px; height: 34px; }
  .pb-logo__word { font-size: 23px; }
  .pb-logo__by { font-size: var(--pb-text-2xs); }
  .pb-header__acts { margin-left: auto; gap: var(--pb-space-3); }
  .pb-header__search { order: 3; flex: 1 1 100%; max-width: none; margin: 0; }
  .pb-hdr-cats { display: grid; }
  .pb-hdr-discord--phone { display: grid; }
  .pb-hdr-discord--wide { display: none; }
  .pb-nav { display: none; }
  .pb-main { padding: var(--pb-space-6) var(--pb-gutter) calc(110px + env(safe-area-inset-bottom)); }
  .pb-layout, .pb-layout--aside, .pb-layout--detail { grid-template-columns: minmax(0, 1fr); gap: var(--pb-space-8); }
  .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); padding: var(--pb-space-4); gap: var(--pb-space-7); }
  .pb-spot__body { padding: 0 var(--pb-space-4) var(--pb-space-5); gap: var(--pb-space-6); }
  .pb-page-head__title { font-size: var(--pb-text-3xl); }
  .pb-spot-picker button { width: 72px; }
  .pb-panel { padding: var(--pb-space-8); }
  .pb-row { grid-template-columns: 120px minmax(0, 1fr); gap: var(--pb-space-6); padding-right: var(--pb-space-4); }
  .pb-row--manage .pb-row__end { display: grid; grid-column: 1 / -1; justify-items: start; }
  .pb-row__title { font-size: var(--pb-text-lg); }
  .pb-footer { border-radius: var(--pb-radius-lg); margin-bottom: calc(96px + env(safe-area-inset-bottom)); padding: var(--pb-space-7) var(--pb-space-8); }
  .pb-community { margin-left: 0; }
  .pb-tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: var(--pb-space-4); right: var(--pb-space-4); bottom: calc(var(--pb-space-4) + env(safe-area-inset-bottom));
    z-index: var(--pb-z-tabbar); padding: var(--pb-space-3); border-radius: var(--pb-radius-lg);
  }
  .pb-tabbar__link { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 54px; border-radius: 18px; text-decoration: none; color: var(--pb-text-muted); font-size: var(--pb-text-xs); font-weight: var(--pb-weight-bold); }
  .pb-tabbar__link svg.pb-icon { width: 22px; height: 22px; }
  .pb-tabbar__link[aria-current="page"] { color: var(--pb-accent-hover); background: linear-gradient(180deg, var(--pb-white), var(--pb-sky-100)); box-shadow: var(--pb-shadow-chip), 0 0 0 1px var(--pb-border-strong); }
  .pb-tabbar__link .pb-badge { position: absolute; top: 4px; left: calc(50% + 6px); }
  .pb-toasts { bottom: calc(96px + env(safe-area-inset-bottom)); }
  .pb-item--wrap-trail { grid-template-columns: auto minmax(0, 1fr); row-gap: var(--pb-space-3); }
  .pb-item--wrap-trail > .pb-item__trail { grid-column: 1 / -1; }
  .pb-item--wrap-trail .pb-switch { width: 100%; }
  .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); }
  .pb-sheet { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 88vh; border-radius: var(--pb-radius-lg) var(--pb-radius-lg) 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .pb-sheet__head { padding: var(--pb-space-7) var(--pb-space-6) 0 var(--pb-space-8); }
  .pb-sheet__body { padding: var(--pb-space-6) var(--pb-space-8) var(--pb-space-9); }
  .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-menu--header { right: var(--pb-space-4); top: calc(var(--pb-header-h) + 34px); }
  .pb-menu--panel { width: min(400px, calc(100vw - 16px)); }
  .pb-catpanel-scrim { background: var(--pb-scrim); }
  .pb-catpanel {
    top: auto; left: var(--pb-space-4); right: var(--pb-space-4); bottom: calc(var(--pb-space-4) + env(safe-area-inset-bottom)); width: auto; min-height: 0;
    max-height: calc(100dvh - 16px); padding: var(--pb-space-7); border-radius: 28px; gap: var(--pb-space-6); animation-name: pb-rise;
  }
  .pb-catpanel__tiles { flex: none; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(76px, auto); gap: 7px; }
  .pb-catpanel__filters { grid-template-columns: minmax(0, 1fr); gap: var(--pb-space-3); padding: var(--pb-space-5) var(--pb-space-6); }
  .pb-catpanel__foot { bottom: calc(-1 * var(--pb-space-7)); margin: auto calc(-1 * var(--pb-space-7)) calc(-1 * var(--pb-space-7)); padding: var(--pb-space-5) var(--pb-space-7) var(--pb-space-7); }
  .pb-cards { gap: var(--pb-space-7); }
}
@media (max-width: 899px) and (min-width: 600px) {
  .pb-catpanel { left: 50%; right: auto; width: min(560px, calc(100vw - 16px)); transform: translateX(-50%); animation: none; }
}
@media (max-width: 420px) {
  .pb-header__acts .pb-btn--sm { padding: 0 var(--pb-space-5); font-size: var(--pb-text-sm); }
  .pb-header__in > .pb-logo { padding: 4px 12px 4px 4px; }
  .pb-logo__word { font-size: 21px; }
  .pb-logo svg { width: 30px; height: 30px; }
}

/* ---------- Motion: hover shine, reduced motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .pb-card:hover .pb-thumb__shine, .pb-tile:hover .pb-thumb__shine, .pb-row:hover .pb-thumb__shine { transform: translateX(120%); transition: transform var(--pb-dur-shine) ease; }
}
@media (prefers-reduced-motion: reduce) {
  .pb-card, .pb-card:hover, .pb-tile:hover, .pb-catcard:hover, .pb-guide-path:hover, .pb-cattile:hover { transform: none; }
  .pb-card:hover .pb-media__img { transform: none; }
  .pb-catpanel, .pb-dialog, .pb-toast { animation: none; }
}

/* The inline panel (styleguide) ignores every placement rule above, on every screen size. */
.pb-catpanel.pb-catpanel--inline { position: relative; inset: auto; transform: none; margin: 0; }

/* ---------- Glass fallback: no backdrop blur → solid bright panels (same look, no see-through) ---------- */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .pb-header__in, .pb-tabbar, .pb-menu, .pb-catpanel, .pb-dialog, .pb-sheet, .pb-toast { background: var(--pb-glass-solid); }
}
