/**
 * Urban Chat — Games page
 * Aligns Game Night with Live / Browse / Porch: cool blue-gray surface,
 * white cards, red section headers + gold underline.
 */

#page-games {
  color:  var(--uc-text);
  background: linear-gradient(180deg, var(--uc-surface-muted) 0%, var(--uc-surface-sunken) 100%);
  isolation: isolate;
  min-height: 100%;
  /* Trippy page chrome sets overflow:hidden — keep page scrollable */
  overflow-x: clip !important;
  overflow-y: visible !important;
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}

#page-games > main.container {
  position: relative;
  z-index: 1;
}

#page-games .uc-games-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

@media (min-width: 1024px) {
  #page-games .uc-games-layout {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
    gap: 1.5rem;
  }
}

@media (min-width: 1280px) {
  #page-games .uc-games-layout {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
    gap: 1.75rem;
  }
}

#page-games .uc-games-main,
#page-games .uc-games-rail,
#page-games .uc-panel-red {
  min-width: 0;
  border: 1px solid var(--uc-border) !important;
  border-radius: 1.25rem !important;
  overflow: hidden;
  background: linear-gradient(180deg, var(--uc-surface-raised) 0%, var(--uc-surface-muted) 100%) !important;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08) !important;
}

#page-games .uc-panel-red .section-header {
  background: linear-gradient(90deg, #b91c1c 0%, #7f1d1d 55%, #991b1b 100%) !important;
  border-bottom: 2px solid #facc15 !important;
  color: #fff !important;
  box-shadow: none !important;
  padding: 12px 16px !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 11px;
  font-weight: 900;
}

#page-games .uc-games-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

#page-games .uc-games-tab-btn {
  padding: 6px 12px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.22);
  color: rgba(255, 255, 255, 0.82);
  box-shadow: none;
}

#page-games .uc-games-tab-btn:hover {
  color: #fff;
  border-color: rgba(250, 204, 21, 0.55);
  background: rgba(0, 0, 0, 0.32);
}

#page-games .uc-games-tab-btn.is-active {
  background: #facc15;
  border-color: #facc15;
  color:  var(--uc-text);
  box-shadow: none;
}

#page-games .uc-games-tab-badge {
  background: #7f1d1d;
  border-color: rgba(0, 0, 0, 0.25);
  color: #fff;
  min-width: 16px;
  height: 16px;
  font-size: 8px;
}

#page-games .uc-games-tab-btn.is-active .uc-games-tab-badge {
  background: #991b1b;
  color: #fff;
}

/* Trust: dim the live-match count badge before the first games/feed fetch
   completes. The initial "·" loading dot is shown dimmed so the user
   doesn't mistake it for "0 active matches" when we simply don't know yet. */
#page-games .uc-games-tab-badge[data-loaded="0"] {
  opacity: 0.45;
}

/* Realtime energy: pulse the live-match count badge when the count increases
   so a new match starting feels alive. Brand-gold scale + glow, 600ms. */
#page-games .uc-games-tab-badge.uc-games-tab-badge-pulse {
  animation: uc-games-badge-pulse 0.6s ease-out;
}
@keyframes uc-games-badge-pulse {
  0%   { transform: scale(1);   box-shadow: 0 0 0 0 rgba(212,160,23,0.7); }
  40%  { transform: scale(1.4); box-shadow: 0 0 0 6px rgba(212,160,23,0); }
  100% { transform: scale(1);   box-shadow: 0 0 0 0 rgba(212,160,23,0); }
}
@media (prefers-reduced-motion: reduce) {
  #page-games .uc-games-tab-badge.uc-games-tab-badge-pulse {
    animation: none;
  }
}

/* Realtime energy (#384): pulse the online-neighbor count badge when the
   count increases so a neighbor coming online feels alive. Green scale +
   glow, 600ms — mirrors the live-match badge pulse (#380) in green. */
#page-games .uc-games-network-online.uc-games-online-pulse {
  animation: uc-games-online-pulse 0.6s ease-out;
}
@keyframes uc-games-online-pulse {
  0%   { transform: scale(1);   text-shadow: 0 0 0 rgba(134,239,172,0.7); }
  40%  { transform: scale(1.35); text-shadow: 0 0 8px rgba(134,239,172,0.9); }
  100% { transform: scale(1);   text-shadow: 0 0 0 rgba(134,239,172,0); }
}
@media (prefers-reduced-motion: reduce) {
  #page-games .uc-games-network-online.uc-games-online-pulse {
    animation: none;
  }
}

/* #531 — Realtime energy: pulse the online-neighbor count badge when the
   count decreases so a neighbor going offline feels visible, complementing
   the descending depart tone (#525). Muted-red dim + slight scale, 600ms —
   mirrors the green arrival pulse (#384) in red so the two presence cues
   read as a pair (green = arrived, red = departed). */
#page-games .uc-games-network-online.uc-games-online-depart-pulse {
  animation: uc-games-online-depart-pulse 0.6s ease-out;
}
@keyframes uc-games-online-depart-pulse {
  0%   { transform: scale(1);   text-shadow: 0 0 0 rgba(239,68,68,0); color: var(--uc-text-muted); }
  40%  { transform: scale(0.92); text-shadow: 0 0 8px rgba(239,68,68,0.7); color: #ef4444; }
  100% { transform: scale(1);   text-shadow: 0 0 0 rgba(239,68,68,0); color: var(--uc-text-muted); }
}
@media (prefers-reduced-motion: reduce) {
  #page-games .uc-games-network-online.uc-games-online-depart-pulse {
    animation: none;
  }
}

/* Realtime energy (#402): when a neighbor transitions from offline → online,
   pulse the row green so the arrival feels alive, complementing the count
   badge pulse (#384). One-shot green glow + scale, 700ms. */
#page-games .uc-games-player-row.uc-games-player-row-enter {
  animation: uc-games-player-row-enter 0.7s ease-out;
}
@keyframes uc-games-player-row-enter {
  0%   { box-shadow: 0 0 0 0 rgba(134,239,172,0); transform: scale(1); }
  25%  { box-shadow: 0 0 10px 2px rgba(134,239,172,0.7); transform: scale(1.02); }
  100% { box-shadow: 0 0 0 0 rgba(134,239,172,0); transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  #page-games .uc-games-player-row.uc-games-player-row-enter {
    animation: none;
  }
}

/* Realtime energy (#385): "LIVE NOW" badge on the featured hero when a live
   match exists for the currently featured game. Red brand accent + pulse so
   the user's eye is drawn to the fact that someone is already playing. */
#page-games .uc-games-live-now-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: #dc2626;
  border: 1px solid #fca5a5;
  border-radius: 3px;
  vertical-align: middle;
  animation: uc-games-live-now-pulse 1.6s ease-in-out infinite;
}
@keyframes uc-games-live-now-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.6); }
  50%      { box-shadow: 0 0 0 4px rgba(220,38,38,0); }
}
/* #502 — LIVE NOW badge is now a clickable button (role=button + onclick).
   Hover/focus states make it read as interactive, not just a passive label. */
#page-games .uc-games-live-now-badge:hover,
#page-games .uc-games-live-now-badge:focus-visible {
  background: #ef4444;
  border-color: #fff;
  outline: none;
  box-shadow: 0 0 6px rgba(252,165,165,0.7);
}
#page-games .uc-games-live-now-badge:focus-visible {
  outline: 2px solid #D4A017;
  outline-offset: 1px;
}
@media (prefers-reduced-motion: reduce) {
  #page-games .uc-games-live-now-badge {
    animation: none;
  }
}

/* Onboarding (#386): dismissible first-visit hint banner for the games-arena
   surface. Brand-gold accent, subtle entrance, dismissible via the × button.
   Only shows once per browser (persisted dismissal). */
#page-games .uc-games-first-visit-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
  padding: 8px 12px;
  background: linear-gradient(90deg, rgba(212,160,23,0.18) 0%, rgba(212,160,23,0.06) 100%);
  border: 1px solid rgba(212,160,23,0.5);
  border-radius: 6px;
  animation: uc-games-first-visit-enter 0.3s ease-out;
}
#page-games .uc-games-first-visit-hint-text {
  font-size: 11px;
  font-weight: 700;
  color: var(--uc-text);
  line-height: 1.4;
}
#page-games .uc-games-first-visit-hint-close {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--uc-border);
  border-radius: 4px;
  background: var(--uc-surface-raised);
  color: var(--uc-text-muted);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}
#page-games .uc-games-first-visit-hint-close:hover {
  border-color: rgba(212,160,23,0.7);
  color: var(--uc-text);
}
@keyframes uc-games-first-visit-enter {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  #page-games .uc-games-first-visit-hint {
    animation: none;
  }
}
/* #485: "Got it" confirmation toast shown after the first-visit hint is
   dismissed. Brand-gold pill, subtle scale-in + fade-out, auto-dismisses
   after 2s. Reinforces that the dismissal was registered. */
#page-games .uc-games-first-visit-toast {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  padding: 6px 14px;
  background: rgba(212,160,23,0.22);
  border: 1px solid rgba(212,160,23,0.6);
  border-radius: 999px;
  color: var(--uc-text);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  animation: uc-games-first-visit-toast-enter 0.25s ease-out;
}
/* #491: hover state reinforces clickability — brightens the gold border +
   background so the toast reads as interactive, matching the hint banner's
   × dismiss pattern. */
#page-games .uc-games-first-visit-toast:hover {
  background: rgba(212,160,23,0.32);
  border-color: rgba(212,160,23,0.8);
}
@keyframes uc-games-first-visit-toast-enter {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  #page-games .uc-games-first-visit-toast {
    animation: none;
  }
}

#page-games .uc-games-grid {
  padding: 18px 16px 20px !important;
  background: linear-gradient(180deg, var(--uc-surface-muted) 0%, var(--uc-surface-sunken) 100%) !important;
  background-image: none !important;
  color:  var(--uc-text) !important;
  border-radius: 0;
}

#page-games .uc-games-headline {
  margin-bottom: 4px;
}

#page-games .uc-games-headline h3,
#page-games .uc-games-grid h3 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 900;
  font-style: normal;
  letter-spacing: -0.01em;
  text-transform: none;
  color:  var(--uc-text) !important;
  text-shadow: none !important;
}

#page-games .uc-games-headline p,
#page-games .uc-games-grid > .uc-games-headline p,
#page-games .uc-games-arena-hint {
  margin: 6px 0 0;
  color: var(--uc-text-secondary) !important;
  font-size: 13px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  text-shadow: none !important;
}

#page-games .uc-games-arena-hint {
  margin-top: 16px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--uc-text-secondary) !important;
}

/* Featured breakout — platform red banner, not arcade grid */
#page-games .uc-games-hero {
  margin-top: 16px;
  border: 1px solid var(--uc-border) !important;
  border-radius: 14px !important;
  padding: 16px 18px !important;
  background:
    linear-gradient(115deg, rgba(127, 29, 29, 0.96) 0%, rgba(15, 23, 42, 0.94) 58%, rgba(30, 41, 59, 0.96) 100%) !important;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.14) !important;
}

#page-games .uc-games-hero-kicker {
  background: #facc15 !important;
  color: var(--uc-text-on-gold) !important;
  border-radius: 999px;
  font-size: 9px;
  letter-spacing: 0.1em;
}

#page-games .uc-games-hero-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #bbf7d0;
  margin-bottom: 4px;
}

#page-games .uc-live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
}

#page-games .uc-live-dot.uc-anim-pulse {
  animation: uc-games-pulse 1.6s ease-in-out infinite;
}

@keyframes uc-games-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5); }
  50% { opacity: 0.6; box-shadow: 0 0 0 4px rgba(74, 222, 128, 0); }
}

#page-games .uc-games-hero-title {
  margin-top: 4px !important;
  font-size: 1.65rem !important;
  font-style: normal !important;
  letter-spacing: 0.02em;
  color: #fff !important;
  text-shadow: none !important;
}

#page-games .uc-games-hero-copy {
  color: rgba(248, 250, 252, 0.88) !important;
  font-size: 13px;
  max-width: 56ch;
}

#page-games .uc-games-arrow {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
}

#page-games .uc-games-arrow:hover {
  border-color: #facc15;
  color: #facc15;
}

#page-games .uc-games-chip {
  border-radius: 999px !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  background: rgba(0, 0, 0, 0.28) !important;
  color: #f8fafc !important;
  font-size: 9px;
  letter-spacing: 0.08em;
}

#page-games .uc-games-hero-btn {
  border-radius: 999px !important;
  padding: 10px 16px !important;
  box-shadow: none !important;
  background: #facc15 !important;
  color: var(--uc-text-on-gold) !important;
  border: 1px solid #eab308;
}

#page-games .uc-games-hero-btn.is-alt {
  background: transparent !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
}

#page-games .uc-games-hero-btn.is-alt:hover {
  border-color: #facc15;
  color: #facc15;
}

/* #506 — Context-aware Play button subtitle. A small hint under the Play
   button that reflects the current play context (vs CPU / or challenge a
   neighbor / vs @name). Muted brand-gold so it reads as a helpful hint,
   not a second headline. */
#page-games .uc-games-hero-play-subtitle {
  margin: 4px 0 0 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(250, 204, 21, 0.7);
  text-transform: lowercase;
}
/* #509 — Realtime energy: brief gold flash on the Play subtitle when a
   neighbor comes online (offline→online transition) so the context change
   feels alive. The animation brightens + scales the subtitle briefly. */
#page-games .uc-games-hero-play-subtitle.uc-games-play-subtitle-pulse {
  animation: uc-games-subtitle-pulse 1.2s ease-out;
}
@keyframes uc-games-subtitle-pulse {
  0%   { color: rgba(250, 204, 21, 0.7); transform: scale(1); }
  20%  { color: #facc15; transform: scale(1.08); }
  100% { color: rgba(250, 204, 21, 0.7); transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  #page-games .uc-games-hero-play-subtitle.uc-games-play-subtitle-pulse {
    animation: none;
  }
}

#page-games .uc-games-dot {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.2);
}

#page-games .uc-games-dot.is-active {
  background: #facc15;
  border-color: #facc15;
}

/* Catalog cards — white surface cards like Live */
#page-games .uc-game-cards {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 640px) {
  #page-games .uc-game-cards {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1100px) {
  #page-games .uc-games-main .uc-game-cards {
    grid-template-columns: 1fr 1fr;
  }
}

#page-games .uc-game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px !important;
  border-radius: 14px !important;
  border: 2px solid var(--uc-border-strong) !important;
  background: var(--uc-surface) !important;
  color: var(--uc-text) !important;
  box-shadow: var(--uc-dna-shadow-soft, 3px 3px 0 rgba(0, 0, 0, 0.18)) !important;
  overflow: hidden;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

#page-games .uc-game-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--uc-primary), var(--uc-gold)) !important;
  pointer-events: none;
}

#page-games .uc-game-card--live::before {
  top: 12px;
  right: 12px;
  background: #dc2626;
  border: 1px solid #facc15;
  color: #fff;
  font-size: 8px;
  padding: 2px 7px;
}

/* Trust (#405): elapsed-time badge on live-match cards — shows how long the
   match has been running, derived from the real createdAt timestamp. Sits
   beside the LIVE label in the card top row. */
#page-games .uc-games-live-elapsed {
  margin-left: auto;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: var(--uc-gold, #d4a017);
  white-space: nowrap;
}

/* Onboarding (#408): "just started" highlight on live-match cards — matches
   with < 30s elapsed get a green glow border + a "NEW" accent so the user's
   eye is drawn to fresh matches they can join early. Distinct from the
   catalog .uc-game-card--new badge (which marks newly released games). */
#page-games .uc-game-card--live.uc-game-card--live-new {
  border-color: #22c55e !important;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.35), var(--uc-dna-shadow-hard, 6px 6px 0 rgba(0, 0, 0, 0.22)) !important;
}
#page-games .uc-game-card--live.uc-game-card--live-new .uc-game-card-top > .uc-game-mode::after {
  content: " · NEW";
  color: #22c55e;
  letter-spacing: 0.06em;
}

/* Trust (#412): "ending soon" indicator on live-match cards — matches running
   longer than 10m get a dimmer amber border + a "· ENDING" accent so the user
   knows which matches are likely near completion vs freshly started. Honest —
   derived from the real createdAt timestamp; toggled on the 1s tick. */
#page-games .uc-game-card--live.uc-game-card--live-ending {
  border-color: #b45309 !important;
  opacity: 0.82;
}
#page-games .uc-game-card--live.uc-game-card--live-ending .uc-games-live-elapsed {
  color: #b45309;
}
#page-games .uc-game-card--live.uc-game-card--live-ending .uc-game-card-top > .uc-game-mode::after {
  content: " · ENDING";
  color: #b45309;
  letter-spacing: 0.06em;
}
/* #508 — Context-aware UX: brief gold ring pulse on a live-match card when
   the user clicks the LIVE NOW badge on the hero, so the matching card is
   easy to spot after the auto-scroll. The ring fades out after 2s. */
#page-games .uc-game-card--live.uc-game-card--live-highlight {
  animation: uc-games-live-highlight 2s ease-out;
  scroll-margin-top: 80px;
}
@keyframes uc-games-live-highlight {
  0%   { box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.9); border-color: #facc15; }
  30%  { box-shadow: 0 0 0 6px rgba(250, 204, 21, 0.5); border-color: #facc15; }
  100% { box-shadow: 0 0 0 0 rgba(250, 204, 21, 0); border-color: inherit; }
}
@media (prefers-reduced-motion: reduce) {
  #page-games .uc-game-card--live.uc-game-card--live-highlight {
    animation: none;
    border-color: #facc15;
  }
}

/* #540 — Context-aware UX: a floating "jump back" button that appears after
   the LIVE NOW badge scrolls to + highlights a live-match card, so the user
   can easily find the highlighted card again if they scroll away. Brand-gold
   pill, fixed at the bottom-center of the games page, auto-dismisses after 8s
   or on click. Reuses the first-visit toast pill aesthetic. */
#page-games .uc-games-jump-back {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: rgba(212,160,23,0.92);
  border: 2px solid #facc15;
  border-radius: 999px;
  color: #1a0a08;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  animation: uc-games-jump-back-enter 0.25s ease-out;
}
#page-games .uc-games-jump-back::after {
  content: " (J) · Esc";
  font-size: 10px;
  font-weight: 700;
  opacity: 0.7;
}
#page-games .uc-games-jump-back-vel {
  position: absolute;
  bottom: 0;
  left: 2px;
  height: 2px;
  width: 0%;
  background: rgba(26,10,8,0.6);
  border-radius: 999px;
  transition: width 0.12s ease-out, background 0.12s ease-out;
  pointer-events: none;
}
/* #578 — Peak-velocity pulse: when the velocity bar reaches 100% (very fast
   scroll, 2+ px/ms), a brief gold glow pulses around the bar so the peak
   velocity moment is visually emphasized. The class is toggled from the
   scroll handler; the animation runs once + auto-resets on re-trigger via a
   forced reflow in JS. Reduced-motion disables the animation. */
#page-games .uc-games-jump-back-vel--peak {
  animation: uc-games-jump-back-vel-peak 0.4s ease-out;
}
@keyframes uc-games-jump-back-vel-peak {
  0%   { box-shadow: 0 0 0 0 rgba(250,204,21,0); }
  35%  { box-shadow: 0 0 8px 2px rgba(250,204,21,0.9); }
  100% { box-shadow: 0 0 0 0 rgba(250,204,21,0); }
}
#page-games .uc-games-jump-back:hover {
  background: rgba(250,204,21,1);
  border-color: #facc15;
}
@keyframes uc-games-jump-back-enter {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  #page-games .uc-games-jump-back {
    animation: none;
  }
  #page-games .uc-games-jump-back-vel {
    transition: none;
  }
  #page-games .uc-games-jump-back-vel--peak {
    animation: none;
  }
}

#page-games .uc-game-card--new::before {
  content: "NEW";
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  padding: 3px 8px;
  border: 1px solid #a16207;
  border-radius: 999px;
  background: #facc15;
  color: #111827;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.4;
}

/* #454 — Block Brawl "NEW FIGHTER" badge. Distinct from the catalog-wide
   --new::before "NEW" pill. Positioned at the top-left so it doesn't collide
   with the catalog NEW pill (top-right). Brand red background + gold border
   matches the UrbanChat DNA fighter aesthetic. The card also gets a subtle
   gold glow border to draw the eye. */
#page-games .uc-game-card--brawl-new {
  border-color: rgba(250, 204, 21, 0.45) !important;
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.18), var(--uc-dna-shadow-hard, 6px 6px 0 rgba(0, 0, 0, 0.22)) !important;
}
#page-games .uc-game-card-brawl-new-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 3px 8px;
  border: 1px solid #facc15;
  border-radius: 999px;
  background: #dc2626;
  color: #fef3c7;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1.4;
  text-transform: uppercase;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* #467 — manual dismiss × button inside the NEW FIGHTER badge. */
#page-games .uc-game-card-brawl-new-dismiss {
  pointer-events: auto;
  cursor: pointer;
  border: none;
  background: rgba(0, 0, 0, 0.25);
  color: #fef3c7;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  transition: background 0.15s;
}
#page-games .uc-game-card-brawl-new-dismiss:hover {
  background: rgba(0, 0, 0, 0.5);
}
#page-games .uc-game-card-brawl-new-dismiss:focus-visible {
  outline: 1px solid #facc15;
  outline-offset: 1px;
}

#page-games .uc-game-card:hover {
  transform: translateY(-2px);
  border-color: var(--uc-gold) !important;
  box-shadow: var(--uc-dna-shadow-hard, 6px 6px 0 rgba(0, 0, 0, 0.22)) !important;
  background: var(--uc-surface-raised) !important;
  color: var(--uc-text) !important;
}

#page-games .uc-game-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 22px;
  line-height: 1;
  padding-right: 52px;
  color: var(--uc-text) !important;
}

#page-games .uc-game-mode {
  font-size: 9px !important;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--uc-danger-text) !important;
  background: var(--uc-danger-surface) !important;
  border: 1px solid var(--uc-danger-border) !important;
  border-radius: 999px;
  padding: 3px 8px;
}

#page-games .uc-game-card .uc-link-gold,
#page-games .uc-game-card [class*="tracking-widest"] {
  color: var(--uc-gold) !important;
  margin-top: 2px !important;
}

#page-games .uc-game-card-title {
  margin: 2px 0 0;
  font-size: 15px !important;
  font-weight: 900;
  font-style: normal !important;
  letter-spacing: 0.01em;
  text-transform: none !important;
  color: var(--uc-text) !important;
  text-shadow: none !important;
}

/* Body blurb must beat legacy pale rgba(226,232,240) overrides (member.css / retro-chrome). */
#page-games .uc-game-card-copy,
#page-games .uc-game-card .uc-game-card-copy {
  flex: 1;
  margin-top: 2px;
  font-size: 12px !important;
  line-height: 1.45;
  font-weight: 500;
  opacity: 1 !important;
  color: var(--uc-text-secondary) !important;
  min-height: 2.6em;
}

#page-games .uc-game-card .uc-surface-btn,
#page-games .uc-game-card .uc-invite-btn {
  margin-top: 10px !important;
  border-radius: 999px !important;
  background: var(--uc-surface-raised) !important;
  border: 2px solid var(--uc-border-strong) !important;
  color: var(--uc-primary-ink) !important;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#page-games .uc-game-card:hover .uc-surface-btn,
#page-games .uc-game-card:hover .uc-invite-btn {
  background: var(--uc-primary) !important;
  border-color: var(--uc-primary-dark, var(--uc-primary)) !important;
  color: var(--uc-text-on-primary) !important;
}

#page-games .uc-game-card--guy::after { background: linear-gradient(90deg, #1d4ed8, #facc15) !important; }
#page-games .uc-game-card--girl::after { background: linear-gradient(90deg, #db2777, #facc15) !important; }
#page-games .uc-game-card--redflag::after { background: linear-gradient(90deg, #dc2626, #facc15) !important; }
#page-games .uc-game-card--culture::after { background: linear-gradient(90deg, #059669, #f59e0b, #facc15) !important; }
#page-games .uc-game-card--grade::after { background: linear-gradient(90deg, #b91c1c, #facc15) !important; }
#page-games .uc-game-card--animal::after { background: linear-gradient(90deg, #ca8a04, #facc15) !important; }
#page-games .uc-game-card--checkers::after { background: linear-gradient(90deg, #b91c1c, #111827, #facc15) !important; }
#page-games .uc-game-card--chess::after { background: linear-gradient(90deg, #111827, #64748b, #facc15) !important; }
#page-games .uc-game-card--dominoes::after { background: linear-gradient(90deg, #0f766e, #111827, #facc15) !important; }
#page-games .uc-game-card--uno::after { background: linear-gradient(90deg, #dc2626, #2563eb, #16a34a, #facc15) !important; }
#page-games .uc-game-card--ratchet::after { background: linear-gradient(90deg, #dc2626, #2563eb, #facc15) !important; }
#page-games .uc-game-card--brawl::after { background: linear-gradient(90deg, #06b6d4, #f59e0b, #facc15) !important; }
#page-games .uc-game-card--brawl { border-color: rgba(6, 182, 212, 0.30) !important; }
#page-games .uc-game-card--hoops3d::after,
#page-games .uc-game-card--cuppong::after,
#page-games .uc-game-card--cashblitz::after {
  background: linear-gradient(90deg, #0f766e, #facc15) !important;
}

#page-games .uc-game-card--guy { border-color: rgba(37, 99, 235, 0.28) !important; }
#page-games .uc-game-card--girl { border-color: rgba(219, 39, 119, 0.28) !important; }
#page-games .uc-game-card--redflag { border-color: rgba(220, 38, 38, 0.28) !important; }
#page-games .uc-game-card--culture { border-color: rgba(5, 150, 105, 0.35) !important; }

/* Right rail */
#page-games .uc-games-network-panel {
  height: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#page-games .uc-games-network-online {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #bbf7d0;
}

#page-games .uc-players-list {
  background: linear-gradient(180deg, var(--uc-surface-muted) 0%, var(--uc-surface-sunken) 100%);
  padding: 10px;
  max-height: 220px;
  overflow: auto;
  flex: 0 1 auto;
}

#page-games .uc-player-row,
#page-games .uc-games-player-row {
  background: linear-gradient(180deg, var(--uc-surface-raised) 0%, var(--uc-surface) 100%) !important;
  border: 1px solid var(--uc-border) !important;
  border-radius: 12px !important;
  margin-bottom: 8px;
  box-shadow: inset 2px 0 0 var(--uc-border) !important;
  color: var(--uc-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

#page-games .uc-player-row:hover,
#page-games .uc-games-player-row:hover {
  background: linear-gradient(180deg, var(--uc-surface-raised) 0%, var(--uc-surface) 100%) !important;
  border-color: var(--uc-gold-dim) !important;
  box-shadow: inset 2px 0 0 var(--uc-gold), 0 6px 14px var(--uc-wash-soft) !important;
  transform: translateY(-1px);
}

#page-games .uc-games-player-challenge {
  margin-left: auto;
  flex-shrink: 0;
  background: var(--uc-gold-dim, #d4a017) !important;
  color: #1a0a08 !important;
  border: 1px solid var(--uc-gold, #facc15) !important;
  border-radius: 8px !important;
  padding: 4px 12px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.14s ease, transform 0.14s ease, box-shadow 0.14s ease;
}

#page-games .uc-games-player-challenge:hover {
  background: var(--uc-gold, #facc15) !important;
  transform: scale(1.04);
  box-shadow: 0 2px 8px var(--uc-wash-soft);
}

/* #225: Game picker popover for the neighbor row Challenge button. */
.uc-games-challenge-picker {
  position: fixed;
  z-index: 9999;
  min-width: 180px;
  max-width: 260px;
  background: #1a0a08;
  border: 2px solid var(--uc-gold, #facc15);
  border-radius: 4px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.6);
  padding: 6px 0;
  display: flex;
  flex-direction: column;
}
.uc-games-challenge-picker-header {
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--uc-gold, #facc15);
  padding: 4px 12px 6px;
  border-bottom: 1px solid rgba(212, 160, 23, 0.3);
}
.uc-games-challenge-picker-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--uc-text, #e8e0d4);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.uc-games-challenge-picker-item:hover,
.uc-games-challenge-picker-item:focus-visible {
  background: rgba(212, 160, 23, 0.18);
  outline: none;
}

#page-games .uc-games-player-name {
  color: var(--uc-text);
  font-weight: 800;
  font-size: 12px;
}

#page-games .uc-games-player-status {
  font-size: 10px;
  font-weight: 700;
  color: var(--uc-text-muted);
}

#page-games .uc-games-player-status.is-online {
  color: var(--uc-success-text);
}

/* Realtime energy (#415): presence dot on each neighbor row's avatar — green
   for online, dim gray for offline — so the online/offline state reads at a
   glance without scanning the status text. Sits as a small badge on the
   avatar's bottom-right corner. */
#page-games .uc-player-avatar { position: relative; }
#page-games .uc-presence-dot {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid var(--uc-surface, #1c1917);
  pointer-events: none;
}
#page-games .uc-presence-dot.is-online {
  background: #22c55e;
  box-shadow: 0 0 4px rgba(34, 197, 94, 0.6);
}
#page-games .uc-presence-dot.is-offline {
  background: #78716c;
}
/* #433 — presence dot pulse on online transition. When a neighbor transitions
   from offline → online, the presence dot pulses green (scale + glow) so the
   arrival feels alive at the avatar level, complementing the row entrance pulse
   (#402). One-shot, 700ms — matches the row pulse duration. */
#page-games .uc-presence-dot.uc-presence-dot-enter {
  animation: uc-presence-dot-enter 0.7s ease-out;
}
@keyframes uc-presence-dot-enter {
  0%   { transform: scale(1); box-shadow: 0 0 4px rgba(34, 197, 94, 0.6); }
  30%  { transform: scale(1.8); box-shadow: 0 0 10px 3px rgba(34, 197, 94, 0.9); }
  100% { transform: scale(1); box-shadow: 0 0 4px rgba(34, 197, 94, 0.6); }
}
@media (prefers-reduced-motion: reduce) {
  #page-games .uc-presence-dot.uc-presence-dot-enter {
    animation: none;
  }
}

#page-games #games-network-empty {
  color:  var(--uc-text-muted) !important;
  padding: 12px 14px !important;
  background: var(--uc-surface-muted);
}

#page-games .uc-games-rail-section {
  padding: 12px 14px 4px;
  border-top: 1px solid var(--uc-border);
  background: transparent;
}

#page-games .uc-games-rail-label {
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color:  var(--uc-text-muted);
}

#page-games .uc-games-rail-empty {
  font-size: 11px;
  font-weight: 600;
  color:  var(--uc-text-muted);
  padding: 4px 0 8px;
}

/* Leaderboard boards — mock: maroon header, white rows, rank / name / pts */
#page-games .uc-lb-board {
  margin: 0 0 12px;
  border: 2px solid var(--uc-dna-border-strong, var(--uc-border));
  border-radius: 6px;
  background: var(--uc-surface-raised);
  box-shadow: var(--uc-dna-shadow-soft, 3px 3px 0 rgba(0, 0, 0, 0.25));
  overflow: hidden;
}

#page-games .uc-lb-board:last-child {
  margin-bottom: 4px;
}

#page-games .uc-lb-board__head {
  margin: 0;
  padding: 10px 12px;
  background: var(--uc-dna-header-red, var(--uc-primary));
  color: var(--uc-text-on-primary);
  border-bottom: 2px solid var(--uc-gold-dim);
  box-shadow: inset 0 -2px 0 var(--uc-gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
}

#page-games .uc-lb-board__list {
  padding: 0;
  background: var(--uc-surface-sunken);
}

#page-games .uc-lb-row {
  display: grid;
  grid-template-columns: 28px 28px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--uc-divider, var(--uc-border));
  font-size: 12px;
  color: var(--uc-text);
}

#page-games .uc-lb-row:last-child {
  border-bottom: 0;
}

#page-games .uc-lb-rank {
  color:  var(--uc-text-muted);
  font-weight: 700;
}

#page-games .uc-lb-av,
.uc-lb-av {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  max-width: 28px;
  max-height: 28px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #8b1a1a;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12);
}

#page-games .uc-lb-av img,
.uc-lb-av img {
  width: 28px !important;
  height: 28px !important;
  max-width: 28px !important;
  max-height: 28px !important;
  object-fit: cover;
  display: block;
}

/* Compact profile neighborhood skyline thumb in Top Neighborhoods board */
#page-games .uc-lb-row--hood .uc-lb-hood-thumb.profile-neighborhood-thumb {
  width: 28px;
  height: 28px;
  min-width: 28px;
  margin: 0;
  border-radius: 8px;
  flex-shrink: 0;
}

#page-games .uc-lb-row--hood .uc-lb-hood-thumb .profile-neighborhood-thumb-skyline {
  width: 18px;
  height: 18px;
  bottom: 2px;
}

#page-games .uc-lb-row--hood .uc-lb-hood-thumb .profile-neighborhood-thumb-initial {
  top: 2px;
  right: 3px;
  font-size: 8px;
}

#page-games .uc-lb-name {
  color: #8b1a1a;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#page-games .uc-lb-pts {
  color:  var(--uc-text);
  font-weight: 800;
  white-space: nowrap;
}

#page-games .uc-games-leaderboard-card,
#page-games .uc-games-results-card {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible;
}

#page-games .uc-games-results-header {
  display: none !important;
}

#page-games .uc-games-results-list {
  padding: 0 0 8px;
  color:  var(--uc-text-secondary);
  background: transparent;
}

#page-games .uc-games-network-search-wrap {
  margin-top: auto;
  border-top: 1px solid var(--uc-border);
  background: var(--uc-surface-muted);
}

#page-games .uc-games-network-search {
  background: var(--uc-surface-raised);
  border: 1px solid var(--uc-border);
  color:  var(--uc-text-secondary);
  border-radius: 999px;
  padding: 8px 12px;
}

#page-games .uc-games-network-search::placeholder {
  color:  var(--uc-text-muted);
}

#page-games .uc-games-result-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--uc-border);
  font-size: 11px;
}

#page-games .uc-games-result-row:last-child {
  border-bottom: 0;
}

#page-games .uc-games-result-time {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
  white-space: nowrap;
}

#page-games .uc-games-result-ago {
  font-size: 10px;
  color: var(--uc-text-muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}

@media (max-width: 1023px) {
  #page-games .uc-games-network-panel {
    min-height: 0;
  }

  #page-games .uc-players-list {
    max-height: 180px;
  }
}

/* Theme-safe gold labels (Heat body ink is white — never on yellow fills) */
#page-games .uc-games-hero-kicker,
#page-games .uc-games-hero-btn {
  color: var(--uc-text-on-gold) !important;
}
#page-games .uc-games-arena-hint,
#page-games .uc-games-rail-label,
#page-games .uc-games-rail-empty {
  color: var(--uc-text-muted) !important;
}

/* #641 — "PLAY VS CPU" ℹ info icon button + inline tooltip card.
   Mobile-accessible alternative to the desktop-only title tooltip (#121).
   Neo-brutalist brand styling (gold border, hard offset shadow, warm bg). */
#page-games .uc-games-status-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  padding: 0;
  border: 1px solid rgba(212,160,23,0.65);
  border-radius: 50%;
  background: transparent;
  color: #D4A017;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  vertical-align: middle;
  transition: border-color 0.15s, color 0.15s;
}
#page-games .uc-games-status-info-btn:hover,
#page-games .uc-games-status-info-btn:focus-visible {
  border-color: #facc15;
  color: #facc15;
  outline: none;
}
#page-games .uc-games-status-info-tooltip {
  display: block;
  margin-top: 6px;
  padding: 8px 10px;
  max-width: 220px;
  background: #1a0a08;
  border: 2px solid #D4A017;
  box-shadow: 3px 3px 0 #4d1108;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #f3e8d0;
  line-height: 1.45;
}
