/*
 * Playgrid discovery dashboard.
 *
 * The artwork, game engines, modal, and player chrome keep their own styles.
 * This file owns the homepage shell and its rendered catalog surfaces only.
 */
:root {
  color-scheme: dark;
  --ui-bg: #070d1b;
  --ui-bg-deep: #050a15;
  --ui-surface: #101c31;
  --ui-surface-2: #142640;
  --ui-surface-3: #1b3150;
  --ui-line: #2a4563;
  --ui-line-strong: #486784;
  --ui-text: #f3f7ff;
  --ui-muted: #a9bad0;
  --ui-dim: #7188a4;
  --ui-accent: #8af0cb;
  --ui-accent-strong: #5bd5aa;
  --ui-accent-fill: #8af0cb;
  --ui-on-accent: #082a22;
  --ui-violet: #b3a9ff;
  --ui-violet-strong: #8f7ff0;
  --ui-focus: #d9d1ff;
  --ui-danger: #ffb8b0;
  --ui-halo: rgba(138, 240, 203, 0.15);
  --ui-violet-halo: rgba(179, 169, 255, 0.15);
  --ui-grid: rgba(160, 191, 220, 0.09);
  --ui-topbar-bg: rgba(6, 13, 28, 0.92);
  --ui-topbar-text: #f3f7ff;
  --ui-topbar-muted: #a9bad0;
  --ui-control-bg: rgba(20, 38, 64, 0.82);
  --ui-hero-bg: #132641;
  --ui-hero-bg-2: #0b1629;
  --ui-shelf-bg: #14253d;
  --ui-shelf-card: #1c3452;
  --ui-shelf-text: #f3f7ff;
  --ui-shelf-muted: #b7c9df;
  --ui-shadow: 0 24px 60px rgba(0, 3, 15, 0.36);
  --ui-panel-shadow: 0 18px 44px rgba(0, 4, 18, 0.17);
  --ui-card-shadow: 0 11px 26px rgba(0, 4, 18, 0.17), 0 2px 0 rgba(126, 170, 206, 0.08) inset;
  --ui-radius-xl: 1.5rem;
  --ui-radius-lg: 1.05rem;
  --ui-radius-md: 0.78rem;
  --ui-radius-sm: 0.58rem;
  --ui-max: 1320px;
}

html[data-theme="light"] {
  color-scheme: light;
  --ui-bg: #edf3fa;
  --ui-bg-deep: #e3edf7;
  --ui-surface: #ffffff;
  --ui-surface-2: #f4f8fc;
  --ui-surface-3: #e6eef7;
  --ui-line: #c4d2e1;
  --ui-line-strong: #8fa6bd;
  --ui-text: #14233a;
  --ui-muted: #4d6178;
  --ui-dim: #6d8298;
  --ui-accent: #126c53;
  --ui-accent-strong: #0b5844;
  --ui-accent-fill: #bfeedd;
  --ui-on-accent: #092e25;
  --ui-violet: #5a4ba7;
  --ui-violet-strong: #4b3c94;
  --ui-focus: #5141a2;
  --ui-danger: #9b4541;
  --ui-halo: rgba(18, 108, 83, 0.13);
  --ui-violet-halo: rgba(90, 75, 167, 0.13);
  --ui-grid: rgba(68, 99, 130, 0.12);
  --ui-topbar-bg: rgba(248, 251, 255, 0.94);
  --ui-topbar-text: #14233a;
  --ui-topbar-muted: #526982;
  --ui-control-bg: rgba(255, 255, 255, 0.86);
  --ui-hero-bg: #f9fbff;
  --ui-hero-bg-2: #e7eff8;
  --ui-shelf-bg: #e6eef8;
  --ui-shelf-card: #f8fbff;
  --ui-shelf-text: #14233a;
  --ui-shelf-muted: #50677f;
  --ui-shadow: 0 24px 60px rgba(38, 71, 105, 0.17);
  --ui-panel-shadow: 0 18px 44px rgba(38, 71, 105, 0.11);
  --ui-card-shadow: 0 11px 26px rgba(38, 71, 105, 0.12), 0 2px 0 rgba(255, 255, 255, 0.72) inset;
}

html,
body {
  min-width: 320px;
}

body.arcade-page,
html[data-theme="dark"] body.arcade-page,
html[data-theme="light"] body.arcade-page {
  color: var(--ui-text);
  background-color: var(--ui-bg);
  background-image:
    radial-gradient(ellipse 58rem 34rem at 5% -5%, var(--ui-halo), transparent 70%),
    radial-gradient(ellipse 36rem 32rem at 100% 20%, var(--ui-violet-halo), transparent 70%),
    linear-gradient(180deg, var(--ui-bg-deep), var(--ui-bg) 34rem, var(--ui-bg));
}

body.arcade-page::before {
  display: none;
}

.site-shell {
  position: relative;
  z-index: 0;
  overflow: clip;
  isolation: isolate;
}

.site-shell::before {
  position: absolute;
  z-index: -2;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.32;
  background-image:
    linear-gradient(90deg, transparent 0 49.8%, var(--ui-grid) 50%, transparent 50.2%),
    linear-gradient(0deg, transparent 0 49.8%, var(--ui-grid) 50%, transparent 50.2%);
  background-size: 7rem 7rem;
  mask-image: linear-gradient(180deg, black, transparent 42rem);
}

.site-shell :is(.hero-section, .content-section, .favorites-panel, .site-footer, .topbar-inner, .ticker-track) {
  min-width: 0;
}

.site-shell :is(.hero-section, .content-section, .favorites-panel, .site-footer) {
  width: min(var(--ui-max), calc(100% - 2.5rem));
  margin-inline: auto;
}

.site-shell :is(button, input, select) {
  min-width: 0;
}

.site-shell :is(h1, h2, h3, p) {
  overflow-wrap: anywhere;
}

/* Shared focus and keyboard affordances. */
.site-shell :is(a, button, input, select):focus-visible,
.skip-link:focus-visible {
  outline: 3px solid var(--ui-focus);
  outline-offset: 3px;
}

.site-shell .search-form input:focus-visible {
  outline: none;
}

.skip-link {
  z-index: 50;
  color: var(--ui-on-accent);
  background: var(--ui-accent-fill);
}

/* Header: a compact console rail. */
.site-shell .topbar {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid var(--ui-line);
  color: var(--ui-topbar-text);
  background: var(--ui-topbar-bg);
  box-shadow: 0 10px 30px rgba(0, 4, 18, 0.1);
  backdrop-filter: blur(18px) saturate(1.16);
}

.site-shell .topbar-inner {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: clamp(1rem, 2.4vw, 2.35rem);
  max-width: var(--ui-max);
  min-height: 76px;
  padding: 0.85rem clamp(1.25rem, 3vw, 2.25rem);
}

.site-shell .brand {
  min-width: 0;
  min-height: 44px;
  gap: 0.65rem;
}

.site-shell .brand-mark {
  filter: drop-shadow(0 4px 10px var(--ui-halo));
}

.site-shell .brand-mark svg {
  width: 37px;
  height: 37px;
}

.site-shell .brand-word {
  min-width: 0;
  color: inherit;
  font-size: 1.42rem;
  font-weight: 850;
  letter-spacing: -0.07em;
}

.site-shell .brand-stamp {
  margin-left: 0;
  color: var(--ui-topbar-muted);
  font-size: 0.54rem;
  letter-spacing: 0.1em;
  transform: none;
}

.site-shell .primary-nav {
  justify-content: center;
  gap: clamp(0.8rem, 1.8vw, 1.9rem);
  min-width: 0;
  max-width: 100%;
  font-size: 0.76rem;
  font-weight: 700;
}

.site-shell .primary-nav a {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 44px;
  color: var(--ui-topbar-muted);
}

.site-shell .primary-nav a:is(:hover, :focus-visible) {
  color: var(--ui-topbar-text);
}

.site-shell .primary-nav a::after {
  background: var(--ui-accent);
}

.site-shell .header-tools {
  min-width: 0;
  gap: 0.5rem;
}

.site-shell .search-form {
  width: clamp(10.75rem, 18vw, 16rem);
  min-width: 0;
  min-height: 46px;
  border-color: var(--ui-line-strong);
  border-radius: 0.72rem;
  color: var(--ui-topbar-muted);
  background: var(--ui-control-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.site-shell .search-form:focus-within {
  border-color: var(--ui-accent);
  outline: 3px solid var(--ui-focus);
  outline-offset: 2px;
  background: var(--ui-surface);
}

.site-shell .search-form input {
  min-height: 44px;
  color: var(--ui-topbar-text);
  font-size: 0.8rem;
}

.site-shell .search-form input::placeholder {
  color: var(--ui-topbar-muted);
}

.site-shell .search-submit {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 0.58rem;
  color: var(--ui-on-accent);
  background: var(--ui-accent-fill);
}

.site-shell .search-submit:is(:hover, :focus-visible) {
  background: var(--ui-accent);
  transform: translateX(2px);
}

.site-shell :is(.theme-toggle, .sound-toggle) {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-color: var(--ui-line-strong);
  border-radius: 0.72rem;
  color: var(--ui-topbar-muted);
  background: var(--ui-control-bg);
}

.site-shell .sound-toggle[data-audio="muted"] {
  color: var(--ui-danger);
}

.site-shell :is(.theme-toggle, .sound-toggle):is(:hover, :focus-visible) {
  border-color: var(--ui-accent);
  color: var(--ui-accent);
  background: var(--ui-surface);
  transform: translateY(-2px);
}

/* Hero: portal card, layered floor, halo, and status chips. */
.site-shell .hero-section {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.84fr) minmax(0, 1.16fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5.25rem);
  min-height: 0;
  padding-top: clamp(2.5rem, 4.5vw, 4.5rem);
  padding-bottom: clamp(2rem, 4vw, 3.75rem);
}

.site-shell .hero-section::before {
  position: absolute;
  z-index: -1;
  top: 8%;
  left: -12%;
  width: 54%;
  aspect-ratio: 1;
  pointer-events: none;
  content: "";
  border-radius: 50%;
  background: radial-gradient(circle, var(--ui-halo), transparent 64%);
  filter: blur(12px);
}

.site-shell .hero-section::after {
  position: absolute;
  z-index: -1;
  right: 4%;
  bottom: -11%;
  width: 66%;
  height: 32%;
  pointer-events: none;
  content: "";
  opacity: 0.32;
  background-image: linear-gradient(var(--ui-grid) 1px, transparent 1px), linear-gradient(90deg, var(--ui-grid) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(0deg, transparent, black 60%);
  transform: perspective(380px) rotateX(68deg);
  transform-origin: center bottom;
}

.site-shell .hero-copy {
  min-width: 0;
  max-width: 37rem;
}

.site-shell .eyebrow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  color: var(--ui-accent);
  font-size: 0.67rem;
  font-weight: 820;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
}

.site-shell .eyebrow-dot,
.site-shell .status-dot {
  flex: 0 0 auto;
  background: var(--ui-accent);
  box-shadow: 0 0 0 4px var(--ui-halo), 0 0 16px var(--ui-accent);
}

.site-shell .hero-copy h1 {
  max-width: 11ch;
  color: var(--ui-text);
  font-size: clamp(3.5rem, 6vw, 6rem);
  font-weight: 870;
  letter-spacing: -0.08em;
  line-height: 0.94;
}

.site-shell .hero-copy h1 span,
.site-shell :is(.section-heading h2, .local-play-copy h2) em {
  color: var(--ui-violet);
  font-style: normal;
  text-shadow: 0 0 24px var(--ui-violet-halo);
}

.site-shell .hero-lede {
  max-width: 31rem;
  margin-top: 1.45rem;
  color: var(--ui-muted);
  font-size: clamp(0.98rem, 1.25vw, 1.12rem);
  line-height: 1.65;
}

.site-shell .hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.8rem;
}

.site-shell .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 46px;
  padding: 0.7rem 1.05rem;
  border: 1px solid var(--ui-line-strong);
  border-radius: 0.72rem;
  color: var(--ui-text);
  background: var(--ui-surface);
  font-size: 0.79rem;
  font-weight: 800;
  line-height: 1.2;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.12);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease;
}

.site-shell .button:is(:hover, :focus-visible) {
  border-color: var(--ui-accent);
  background: var(--ui-surface-2);
  box-shadow: 0 9px 24px var(--ui-halo), 0 3px 0 rgba(0, 0, 0, 0.13);
  transform: translateY(-3px);
}

.site-shell .button--lime {
  border-color: var(--ui-accent-fill);
  color: var(--ui-on-accent);
  background: var(--ui-accent-fill);
}

.site-shell .button--lime:is(:hover, :focus-visible) {
  border-color: var(--ui-accent);
  color: var(--ui-on-accent);
  background: var(--ui-accent);
}

.site-shell .hero-actions .button--lime,
.site-shell .hero-actions .button--ghost {
  border-color: var(--ui-line-strong);
}

.site-shell .hero-actions .button--lime {
  border-color: var(--ui-accent-fill);
  color: var(--ui-on-accent);
  background: var(--ui-accent-fill);
}

.site-shell .hero-actions .button--lime:is(:hover, :focus-visible) {
  color: var(--ui-on-accent);
  background: var(--ui-accent);
}

.site-shell .button--ghost {
  border-color: transparent;
  color: var(--ui-accent);
  background: transparent;
  box-shadow: none;
}

.site-shell .button--ghost:is(:hover, :focus-visible) {
  color: var(--ui-text);
  background: var(--ui-surface-2);
  box-shadow: none;
}

.site-shell .hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.25rem;
  color: var(--ui-muted);
  font-size: 0.75rem;
  font-weight: 650;
}

.site-shell .hero-stats span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0.38rem 0.62rem;
  border: 1px solid var(--ui-line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--ui-surface) 72%, transparent);
}

.site-shell .hero-stats span + span::before {
  display: none;
}

.site-shell .hero-stats strong {
  margin-right: 0.25rem;
  color: var(--ui-text);
  font-size: 0.8rem;
  font-weight: 850;
}

.site-shell .hero-spotlight-frame {
  min-width: 0;
  margin: 0;
  padding: clamp(0.7rem, 1.2vw, 1.05rem);
  border: 1px solid var(--ui-line);
  border-radius: 1.6rem;
  background:
    radial-gradient(circle at 50% 35%, var(--ui-halo), transparent 55%),
    linear-gradient(145deg, var(--ui-surface-2), var(--ui-surface));
  box-shadow: 0 30px 70px rgba(0, 4, 18, 0.28), 0 1px 0 rgba(255, 255, 255, 0.07) inset;
}

.site-shell .hero-spotlight-frame > .hero-card-topline {
  padding: 0.1rem 0.25rem 0;
  color: var(--ui-muted);
}

.site-shell .hero-spotlight-frame > .hero-card-topline .feature-label {
  color: var(--ui-accent);
}

.site-shell .hero-spotlight-frame > .hero-card-topline .feature-score {
  color: var(--ui-muted);
}

.site-shell .hero-spotlight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
}

@media (max-width: 960px) {
  .site-shell .hero-spotlight-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (min-width: 1160px) {
  .site-shell .hero-section {
    grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
    gap: clamp(1.5rem, 3vw, 3.5rem);
  }
}

.site-shell .hero-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(0.9rem, 1.3vw, 1.25rem);
  border: 1px solid var(--ui-line-strong);
  border-radius: 1.35rem;
  color: var(--ui-text);
  background:
    radial-gradient(circle at 100% 0, var(--ui-violet-halo), transparent 38%),
    linear-gradient(145deg, var(--ui-hero-bg), var(--ui-hero-bg-2) 72%);
  box-shadow: var(--ui-shadow), 0 1px 0 rgba(255, 255, 255, 0.08) inset;
  isolation: isolate;
  transform: none;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.site-shell .hero-card--spotlight h2 {
  font-size: clamp(1.35rem, 1.8vw, 1.75rem);
  font-weight: 850;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin: 0.25rem 0 0.35rem;
}

.site-shell .hero-card--spotlight .hero-art {
  aspect-ratio: 16 / 10;
  max-height: 220px;
  border-radius: 0.85rem;
  margin-bottom: 0.75rem;
}

.site-shell .hero-card--spotlight .hero-card-description {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 1rem;
  color: var(--ui-muted);
  font-size: 0.82rem;
  line-height: 1.45;
  min-height: 2.4rem;
}

.site-shell .hero-card--spotlight .hero-card-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0;
}

.site-shell .status-dot--meadow {
  background: #facc15 !important;
  box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.22), 0 0 16px #facc15 !important;
}

.site-shell .hero-card::before {
  display: none;
}

.site-shell .hero-card::after {
  display: none;
}

.site-shell .hero-card:is(:hover, :focus-within) {
  border-color: var(--ui-accent-strong);
  box-shadow: 0 18px 45px rgba(0, 3, 15, 0.35);
  transform: translateY(-2px);
}

.site-shell .hero-card-topline {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.8rem;
  color: var(--ui-muted);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transform: translateZ(20px);
}

.site-shell .hero-card .feature-label,
.site-shell .hero-card .feature-score {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 28px;
  max-width: 100%;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--ui-line-strong);
  border-radius: 999px;
  background: rgba(10, 23, 42, 0.34);
}

.site-shell .hero-card .feature-label {
  color: var(--ui-accent);
}

.site-shell .hero-card .feature-score {
  color: var(--ui-muted);
  overflow-wrap: anywhere;
}

.site-shell .hero-card .feature-score .status-dot {
  width: 0.4rem;
  height: 0.4rem;
  box-shadow: 0 0 0 3px var(--ui-halo), 0 0 12px var(--ui-accent);
}

html[data-theme="light"] .site-shell .hero-card :is(.feature-label, .feature-score) {
  background: rgba(229, 239, 248, 0.9);
}

.site-shell .hero-art {
  min-height: clamp(205px, 23vw, 300px);
  border: 1px solid rgba(205, 231, 242, 0.22);
  border-radius: 0.95rem;
  background-color: #0d1d2f;
  background-image:
    radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--accent) 48%, transparent), transparent 24%),
    linear-gradient(180deg, rgba(31, 88, 109, 0.32), transparent 46%),
    radial-gradient(circle at 82% 76%, color-mix(in srgb, var(--accent-2) 72%, transparent), transparent 46%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), inset 0 -32px 60px rgba(2, 10, 21, 0.42), 0 14px 28px rgba(0, 2, 12, 0.27);
  transform: translateZ(24px);
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.site-shell .hero-card:is(:hover, :focus-within) .hero-art {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), inset 0 -32px 60px rgba(2, 10, 21, 0.32), 0 20px 36px rgba(0, 2, 12, 0.34);
  transform: translateZ(34px) scale(1.008);
}

.site-shell .hero-card .hero-art::before {
  z-index: 0;
  inset: -18%;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 35%, rgba(159, 239, 224, 0.28), transparent 50%);
  filter: blur(7px);
}

.site-shell .hero-card .hero-art::after {
  z-index: 1;
  inset: auto -12% -38%;
  height: 72%;
  opacity: 0.68;
  border: 0;
  border-top: 1px solid rgba(138, 240, 203, 0.32);
  border-radius: 50% 50% 0 0;
  background-image:
    linear-gradient(rgba(138, 240, 203, 0.24) 1px, transparent 1px),
    linear-gradient(90deg, rgba(138, 240, 203, 0.2) 1px, transparent 1px);
  background-size: 30px 21px;
  transform: perspective(250px) rotateX(60deg) scale(1.34);
  transform-origin: center top;
}

.site-shell .hero-art > .art-depth-lines {
  z-index: 2;
  opacity: 0.35;
}

.site-shell .hero-art > .art-3d-ring {
  z-index: 3;
  filter: drop-shadow(0 0 14px var(--ui-accent));
}

.site-shell .hero-art > .art-glyph,
.site-shell .hero-art > .art-caption,
.site-shell .hero-art > .art-lockup {
  z-index: 4;
}

.site-shell .hero-card-content {
  position: relative;
  z-index: 6;
  padding: 0.95rem 0.35rem 0.15rem;
  transform: translateZ(18px);
}

.site-shell .hero-card .card-kicker {
  color: var(--ui-accent);
}

.site-shell .hero-card h2 {
  color: var(--ui-text);
  font-size: clamp(2.15rem, 3.3vw, 3.5rem);
  font-weight: 870;
  letter-spacing: -0.07em;
  line-height: 0.98;
}

.site-shell .hero-card-content > p:not(.card-kicker) {
  max-width: 38rem;
  margin-top: 0.75rem;
  color: var(--ui-muted);
  font-size: 0.84rem;
  line-height: 1.58;
}

.site-shell .hero-card-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.site-shell .hero-card-actions .button--lime {
  color: var(--ui-on-accent);
  background: var(--ui-accent-fill);
}

.site-shell .hero-card-actions .button--lime:is(:hover, :focus-visible) {
  color: var(--ui-on-accent);
  background: var(--ui-accent);
}

.site-shell .favorite-toggle {
  display: inline-grid;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid var(--ui-line-strong);
  border-radius: 0.72rem;
  color: var(--ui-text);
  background: rgba(255, 255, 255, 0.04);
}

.site-shell .favorite-toggle:is(:hover, :focus-visible) {
  border-color: var(--ui-accent);
  color: var(--ui-accent);
  background: var(--ui-halo);
  transform: translateY(-2px);
}

.site-shell .favorite-toggle.is-favorite {
  border-color: var(--ui-accent);
  color: var(--ui-on-accent);
  background: var(--ui-accent-fill);
}

/* Three actual routes into the dashboard, not decorative status badges. */
.site-shell .dashboard-shortcuts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  width: min(var(--ui-max), calc(100% - 2.5rem));
  margin: 0 auto clamp(2rem, 4vw, 3rem);
}

.site-shell .dashboard-shortcuts a {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
  min-height: 94px;
  padding: 1rem;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-lg);
  color: var(--ui-text);
  background: linear-gradient(150deg, var(--ui-surface-2), var(--ui-surface));
  box-shadow: var(--ui-card-shadow);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.site-shell .dashboard-shortcuts a:is(:hover, :focus-visible) {
  border-color: var(--ui-accent);
  box-shadow: var(--ui-panel-shadow);
  transform: translateY(-4px);
}

.site-shell .dashboard-shortcuts a > span:nth-child(2) {
  min-width: 0;
}

.site-shell .dashboard-shortcuts .shortcut-symbol {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--ui-line-strong);
  border-radius: 0.8rem;
  color: var(--ui-accent);
  background: var(--ui-halo);
  font-size: 1.4rem;
}

.site-shell .dashboard-shortcuts small,
.site-shell .dashboard-shortcuts strong {
  display: block;
  line-height: 1.35;
}

.site-shell .dashboard-shortcuts small {
  color: var(--ui-muted);
  font-size: 0.74rem;
}

.site-shell .dashboard-shortcuts strong {
  margin-top: 0.22rem;
  color: var(--ui-text);
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.site-shell .dashboard-shortcuts .shortcut-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ui-accent);
  font-size: 1.2rem;
  transition: transform 180ms ease;
}

.site-shell .dashboard-shortcuts a:is(:hover, :focus-visible) .shortcut-arrow {
  transform: translate(3px, -3px);
}

/* Bulletin strip. It wraps instead of forcing a max-content rail on phones. */
.site-shell .ticker {
  overflow: hidden;
  border-top: 1px solid var(--ui-line);
  border-bottom: 1px solid var(--ui-line);
  color: var(--ui-muted);
  background: linear-gradient(90deg, var(--ui-surface-2), var(--ui-surface), var(--ui-surface-2));
}

.site-shell .ticker-track {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem clamp(0.65rem, 2vw, 1.5rem);
  width: min(var(--ui-max), calc(100% - 2.5rem));
  margin-inline: auto;
  padding: 0.82rem 0;
  font-size: 0.66rem;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-shell .ticker-track b {
  color: var(--ui-violet);
  font-size: 0.8rem;
}

/* Elevated dashboard panels. */
.site-shell .content-section {
  position: relative;
  padding-top: clamp(3.8rem, 6vw, 5.5rem);
}

.site-shell :is(.category-section, .discover-section, .featured-3d-section, .quick-pick-section, .recent-section, .local-play-section) {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-top: clamp(1.35rem, 3vw, 2.5rem);
  padding: clamp(1.35rem, 3vw, 2.35rem);
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-xl);
  background:
    linear-gradient(135deg, rgba(138, 240, 203, 0.04), transparent 38%),
    linear-gradient(180deg, color-mix(in srgb, var(--ui-surface) 96%, transparent), var(--ui-surface-2));
  box-shadow: var(--ui-panel-shadow);
}

.site-shell :is(.category-section, .discover-section, .featured-3d-section, .quick-pick-section, .recent-section, .local-play-section)::before {
  position: absolute;
  z-index: -1;
  top: 0;
  right: 0;
  width: 40%;
  height: 100%;
  pointer-events: none;
  content: "";
  opacity: 0.42;
  background: linear-gradient(90deg, transparent, var(--ui-violet-halo));
  mask-image: linear-gradient(90deg, transparent, black);
}

.site-shell .section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.45rem;
}

.site-shell .section-heading > div {
  min-width: 0;
}

.site-shell :is(.section-heading h2, .favorites-intro h2, .local-play-copy h2) {
  color: var(--ui-text);
  font-size: clamp(2.1rem, 4vw, 4rem);
  font-weight: 870;
  letter-spacing: -0.075em;
  line-height: 1.02;
  text-wrap: balance;
}

.site-shell .section-note {
  max-width: 22rem;
  margin: 0 0 0.15rem;
  color: var(--ui-muted);
  font-size: 0.84rem;
  font-weight: 580;
  line-height: 1.55;
}

/* Category and filter chips. */
.site-shell .category-rail {
  display: flex;
  gap: 0.55rem;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 0.2rem 0.15rem 0.8rem;
  scrollbar-color: var(--ui-line-strong) transparent;
  scrollbar-width: thin;
}

.site-shell .category-pill {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0.58rem;
  min-height: 50px;
  padding: 0.38rem 0.85rem 0.38rem 0.38rem;
  border: 1px solid var(--ui-line);
  border-radius: 0.8rem;
  color: var(--ui-text);
  background: var(--ui-surface);
  font-size: 0.78rem;
  font-weight: 760;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.08);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.site-shell .category-pill:is(:hover, :focus-visible) {
  border-color: var(--ui-accent);
  background: var(--ui-surface-3);
  box-shadow: 0 8px 18px var(--ui-halo);
  transform: translateY(-3px);
}

.site-shell .category-pill.is-active {
  border-color: var(--ui-accent);
  color: var(--ui-on-accent);
  background: var(--ui-accent-fill);
  box-shadow: 0 7px 18px var(--ui-halo), 0 3px 0 rgba(0, 0, 0, 0.12);
}

.site-shell .category-pill small {
  color: var(--ui-muted);
  font-size: 0.72rem;
}

.site-shell .category-pill.is-active small {
  color: var(--ui-on-accent);
}

.site-shell .pill-icon {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(15, 29, 47, 0.12);
  border-radius: 0.55rem;
  color: var(--ui-text);
  background: var(--ui-surface-3);
  font-size: 0.96rem;
  font-weight: 850;
}

.site-shell .category-pill.is-active .pill-icon {
  color: var(--ui-on-accent);
  background: rgba(255, 255, 255, 0.55);
}

.site-shell .filter-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem 0.9rem;
  margin-bottom: 1.2rem;
  padding: 0.72rem 0;
  border-top: 1px solid var(--ui-line);
  border-bottom: 1px solid var(--ui-line);
}

.site-shell .filter-status,
.site-shell .sort-control {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ui-muted);
  font-size: 0.77rem;
  font-weight: 680;
}

.site-shell .filter-status {
  margin-right: auto;
}

.site-shell .filter-status .status-dot {
  width: 0.42rem;
  height: 0.42rem;
  box-shadow: 0 0 0 3px var(--ui-halo);
}

.site-shell .active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  min-width: 0;
}

.site-shell .filter-chip {
  min-width: 44px;
  min-height: 44px;
  padding: 0.38rem 0.72rem;
  border: 1px solid var(--ui-line);
  border-radius: 999px;
  color: var(--ui-muted);
  background: var(--ui-surface);
  font-size: 0.76rem;
  font-weight: 750;
  transition: transform 180ms ease, border-color 180ms ease, color 180ms ease, background 180ms ease;
}

.site-shell .filter-chip:is(:hover, :focus-visible) {
  border-color: var(--ui-accent);
  color: var(--ui-text);
  background: var(--ui-surface-3);
  transform: translateY(-2px);
}

.site-shell .filter-chip.is-active {
  border-color: var(--ui-accent);
  color: var(--ui-on-accent);
  background: var(--ui-accent-fill);
}

.site-shell .sort-control {
  position: relative;
  margin-left: auto;
}

.site-shell :is(.sort-control select, .leaderboard-toolbar select) {
  min-width: 0;
  min-height: 44px;
  height: 44px;
  padding: 0.55rem 2rem 0.55rem 0.72rem;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-sm);
  color: var(--ui-text);
  background: var(--ui-surface);
  font-size: 0.78rem;
}

.site-shell .sort-control select {
  appearance: none;
}

.site-shell .sort-control svg {
  position: absolute;
  right: 0.62rem;
  pointer-events: none;
}

.site-shell :is(.sort-control select, .leaderboard-toolbar select):focus-visible {
  border-color: var(--ui-accent);
  outline: 3px solid var(--ui-focus);
  outline-offset: 2px;
  box-shadow: none;
}

/* Catalog cards: layered shells with a small amount of perspective. */
.site-shell .game-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.site-shell .game-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-lg);
  background: var(--ui-surface);
  box-shadow: var(--ui-card-shadow);
  perspective: 1000px;
  transform-style: preserve-3d;
  transition: transform 190ms ease, border-color 190ms ease, box-shadow 190ms ease;
}

.site-shell .game-tile::before {
  position: absolute;
  z-index: 0;
  top: 0;
  right: 12%;
  left: 12%;
  height: 1px;
  pointer-events: none;
  content: "";
  background: linear-gradient(90deg, transparent, var(--ui-accent), transparent);
  opacity: 0.45;
}

.site-shell .game-tile::after {
  position: absolute;
  z-index: 0;
  right: -35%;
  bottom: -48%;
  width: 72%;
  aspect-ratio: 1;
  pointer-events: none;
  content: "";
  border-radius: 50%;
  background: radial-gradient(circle, var(--ui-violet-halo), transparent 68%);
  opacity: 0;
  transition: opacity 190ms ease;
}

.site-shell .game-tile:is(:hover, :focus-within) {
  z-index: 2;
  border-color: var(--ui-accent-strong);
  box-shadow: 0 23px 42px rgba(0, 4, 18, 0.26), 0 2px 0 rgba(255, 255, 255, 0.08) inset;
  transform: translateY(-6px) rotateX(1.2deg);
}

.site-shell .game-tile:focus-within {
  outline: 3px solid var(--ui-focus);
  outline-offset: 3px;
}

.site-shell .game-tile:is(:hover, :focus-within)::after {
  opacity: 1;
}

.site-shell .game-tile > .game-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  width: 100%;
  border: 0;
  border-radius: 0;
  color: var(--ui-text);
  background: transparent;
  text-align: left;
  box-shadow: none;
  transform: none;
}

.site-shell .game-tile > .game-card:is(:hover, :focus-visible) {
  border-radius: 0;
  box-shadow: none;
  outline: none;
  transform: none;
}

.site-shell .game-tile > .game-card .game-art {
  min-height: 180px;
  border: 0;
  border-bottom: 1px solid var(--ui-line);
  border-radius: 0;
  transform: translateZ(16px);
  transition: transform 190ms ease, filter 190ms ease;
}

.site-shell .game-tile:is(:hover, :focus-within) > .game-card .game-art {
  filter: saturate(1.08) brightness(1.04);
  transform: translateZ(25px) scale(1.012);
}

.site-shell .game-card-copy {
  display: flex;
  flex-direction: column;
  min-height: 7.35rem;
  padding: 0.95rem 1rem 0.85rem;
}

.site-shell .card-kicker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.site-shell .card-category-badge {
  display: inline-flex;
  align-items: center;
  color: var(--ui-accent);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-shell .card-dim-badge,
.site-shell .dimension-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.42rem;
  border: 1px solid var(--ui-line-strong);
  border-radius: 999px;
  color: var(--ui-text);
  background: var(--ui-surface-2);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-transform: uppercase;
}

.site-shell .card-kicker {
  display: block;
  margin-bottom: 0.52rem;
  color: var(--ui-violet);
  font-size: 0.66rem;
  font-weight: 810;
  letter-spacing: 0.1em;
  line-height: 1.35;
  text-transform: uppercase;
}

.site-shell .game-card-copy strong,
.site-shell .game-card-title {
  display: block;
  color: var(--ui-text);
  font-size: 1.12rem;
  font-weight: 820;
  letter-spacing: -0.04em;
  line-height: 1.2;
  margin-bottom: 0.32rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-shell .game-card-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  min-height: 2.3rem;
  color: var(--ui-muted);
  font-size: 0.81rem;
  font-weight: 500;
  line-height: 1.42;
}

.site-shell .card-meta {
  display: block;
  margin-top: 0.55rem;
  color: var(--ui-dim);
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.35;
}

.site-shell .game-card-actions {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 54px;
  padding: 0.48rem 0.75rem 0.52rem 1rem;
  border-top: 1px solid var(--ui-line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--ui-surface-2) 58%, transparent), var(--ui-surface));
}

.site-shell .button--play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 36px;
  padding: 0.4rem 1.05rem;
  border: 0;
  border-radius: var(--ui-radius-sm);
  background: var(--ui-accent-fill);
  color: var(--ui-on-accent);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.site-shell .button--play:is(:hover, :focus-visible) {
  background: var(--ui-accent-strong);
  box-shadow: 0 4px 14px var(--ui-halo);
  transform: translateY(-1px);
}

.site-shell .btn-play-icon {
  display: inline-block;
  flex-shrink: 0;
}

.site-shell .text-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0 0.25rem;
  border: 0;
  color: var(--ui-accent);
  background: transparent;
  font-size: 0.82rem;
  font-weight: 820;
}

.site-shell .text-button span,
.site-shell .quick-arrow,
.site-shell .recent-arrow,
.site-shell .favorite-star {
  color: var(--ui-accent);
  transition: transform 180ms ease;
}

.site-shell .text-button:is(:hover, :focus-visible) span,
.site-shell .game-tile:is(:hover, :focus-within) .text-button span {
  transform: translate(2px, -2px);
}

.site-shell .icon-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-sm);
  color: var(--ui-muted);
  background: var(--ui-surface);
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease, transform 160ms ease;
}

.site-shell .icon-button:is(:hover, :focus-visible) {
  border-color: #ffd166;
  color: #ffd166;
  background: rgba(255, 209, 102, 0.12);
  transform: translateY(-1px);
}

.site-shell .icon-button.is-favorite {
  border-color: #ffd166;
  color: #ffd166;
  background: rgba(255, 209, 102, 0.16);
}

.site-shell .empty-state {
  padding: 3rem 1.25rem;
  border: 1px dashed var(--ui-line-strong);
  border-radius: var(--ui-radius-lg);
  color: var(--ui-text);
  background: var(--ui-surface-2);
  text-align: center;
}

.site-shell .empty-mark {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--ui-violet);
  font-size: 3rem;
  font-weight: 850;
  line-height: 1;
}

.site-shell .empty-state h3 {
  color: var(--ui-text);
  font-size: 1.35rem;
  font-weight: 820;
}

.site-shell .empty-state p {
  margin: 0.5rem auto 1rem;
  color: var(--ui-muted);
  font-size: 0.82rem;
}

/* Generated art keeps the existing poster geometry, with a console frame added. */
.site-shell .game-art {
  position: relative;
  display: grid;
  overflow: hidden;
  place-items: center;
  color: var(--ink, #101728);
  background-color: var(--accent);
  background-image:
    linear-gradient(135deg, transparent 48%, rgba(16, 23, 40, 0.13) 48% 50%, transparent 50%),
    radial-gradient(circle at 20% 20%, rgba(255, 253, 248, 0.38), transparent 28%),
    radial-gradient(circle at 80% 80%, var(--accent-2), transparent 43%);
  isolation: isolate;
}

.site-shell .game-art::before {
  z-index: 5;
  inset: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(8, 20, 35, 0.14);
}

.site-shell .game-art::after {
  z-index: 4;
  inset: 0;
  opacity: 0.18;
  border: 0;
  background-image: repeating-linear-gradient(90deg, transparent 0 13px, rgba(7, 18, 32, 0.18) 14px 15px);
  mix-blend-mode: multiply;
}

.site-shell .game-art--3d,
.site-shell .game-art--webgl {
  color: #f7fbff;
  background-color: #0b142b;
  background-image:
    linear-gradient(180deg, rgba(89, 232, 255, 0.14), transparent 42%),
    linear-gradient(122deg, transparent 0 48%, rgba(89, 232, 255, 0.32) 48.5% 49%, transparent 49.5%),
    linear-gradient(302deg, transparent 0 58%, rgba(255, 111, 117, 0.28) 58.5% 59%, transparent 59.5%),
    radial-gradient(circle at 50% 42%, var(--accent), transparent 16%),
    radial-gradient(circle at 78% 72%, var(--accent-2), transparent 46%);
}

.site-shell .game-art--webgl::after {
  opacity: 0.2;
  background-image:
    linear-gradient(rgba(114, 246, 223, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(114, 246, 223, 0.16) 1px, transparent 1px),
    repeating-linear-gradient(90deg, transparent 0 13px, rgba(7, 18, 32, 0.14) 14px 15px);
  background-size: 30px 30px, 30px 30px, auto;
  mix-blend-mode: screen;
}

.site-shell .game-art--relic-rush {
  background-color: #0b3027;
  background-image:
    radial-gradient(ellipse at 50% 30%, rgba(255, 199, 107, 0.65), transparent 43%),
    linear-gradient(180deg, #0b3027, #397359 55%, #102c25);
}

.site-shell .game-art--ruin-vault {
  background-color: #6b3524;
  background-image: radial-gradient(circle at 52% 20%, rgba(255, 225, 145, 0.72), transparent 22%), linear-gradient(180deg, #7a3b2b, #d18442 55%, #42251f);
}

.site-shell .game-art--skyline-leap {
  background-color: #080b2b;
  background-image: radial-gradient(circle at 68% 21%, rgba(148, 219, 255, 0.35), transparent 22%), linear-gradient(180deg, #10174e, #3a216a 56%, #090d2c);
}

/* The 3D showcase gets a deeper floor and denser card treatment. */
.site-shell .featured-3d-section {
  background:
    linear-gradient(180deg, rgba(71, 110, 165, 0.18), transparent 42%),
    linear-gradient(135deg, color-mix(in srgb, var(--ui-violet) 8%, var(--ui-surface)), var(--ui-surface-2));
}

.site-shell .section-heading--3d .eyebrow {
  color: var(--ui-accent);
}

.site-shell .featured-3d-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.site-shell .featured-3d-grid .game-tile > .game-card .game-art {
  min-height: 225px;
}

.site-shell .featured-3d-grid .game-card-copy {
  min-height: 7.4rem;
}

/* Quick picks, recents, and shelf cards are also rendered after load. */
.site-shell .quick-pick-section,
.site-shell .recent-section {
  padding-bottom: clamp(1.6rem, 3vw, 2.4rem);
}

.site-shell .quick-pick-grid,
.site-shell .recent-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.site-shell .quick-pick-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
  min-height: 105px;
  padding: 1rem 1.1rem;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-md);
  color: var(--ui-text);
  background: var(--ui-surface);
  text-align: left;
  box-shadow: var(--ui-card-shadow);
  transition: transform 190ms ease, border-color 190ms ease, background 190ms ease, box-shadow 190ms ease;
}

.site-shell .quick-pick-card:is(:hover, :focus-visible) {
  border-color: var(--ui-accent);
  background: var(--ui-surface-3);
  box-shadow: 0 18px 34px rgba(0, 4, 18, 0.22);
  transform: translateY(-5px) rotateX(1deg);
}

.site-shell .quick-number {
  color: var(--ui-violet);
  font-size: 0.72rem;
  font-weight: 820;
  letter-spacing: 0.1em;
}

.site-shell .quick-copy {
  min-width: 0;
}

.site-shell .quick-copy strong {
  display: block;
  color: var(--ui-text);
  font-size: 1.05rem;
  font-weight: 820;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.site-shell .quick-copy small,
.site-shell :is(.recent-card, .favorite-card) small {
  display: block;
  color: var(--ui-muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.site-shell .quick-pick-card:is(:hover, :focus-visible) .quick-arrow,
.site-shell :is(.recent-card, .favorite-card):is(:hover, :focus-visible) :is(.recent-arrow, .favorite-star) {
  transform: translate(2px, -2px);
}

.site-shell :is(.recent-card, .favorite-card) {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  padding: 0.62rem;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-md);
  color: var(--ui-text);
  background: var(--ui-surface);
  text-align: left;
  box-shadow: var(--ui-card-shadow);
  transition: transform 190ms ease, border-color 190ms ease, background 190ms ease, box-shadow 190ms ease;
}

.site-shell :is(.recent-card, .favorite-card):is(:hover, :focus-visible) {
  border-color: var(--ui-accent);
  color: var(--ui-text);
  background: var(--ui-surface-3);
  box-shadow: 0 17px 32px rgba(0, 4, 18, 0.2);
  transform: translateY(-4px);
}

.site-shell :is(.recent-card, .favorite-card) > span:not(.game-art) {
  min-width: 0;
}

.site-shell :is(.recent-card, .favorite-card) strong {
  display: block;
  color: var(--ui-text);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.site-shell .mini-art {
  width: 58px;
  min-height: 58px;
  border: 0;
  border-radius: 0.62rem;
}

.site-shell .mini-art::before {
  inset: 0.35rem;
  border-radius: 0.4rem;
}

.site-shell .mini-art::after {
  opacity: 0.12;
}

.site-shell .mini-art .art-glyph {
  font-size: 1.7rem;
}

.site-shell .mini-art .art-caption,
.site-shell .mini-art .art-lockup {
  display: none;
}

.site-shell .recent-empty,
.site-shell .favorites-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 1.15rem;
  border: 1px dashed var(--ui-line-strong);
  border-radius: var(--ui-radius-md);
  color: var(--ui-muted);
  background: var(--ui-surface-2);
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.45;
}

/* Shelf panel: a stable dark-console block in dark mode, pale glass in light. */
.site-shell .favorites-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: start;
  gap: clamp(2rem, 5vw, 5rem);
  margin-top: clamp(2.8rem, 6vw, 5.5rem);
  padding: clamp(1.4rem, 3.5vw, 3.35rem);
  border: 1px solid var(--ui-line-strong);
  border-radius: var(--ui-radius-xl);
  color: var(--ui-shelf-text);
  background:
    radial-gradient(circle at 13% 10%, var(--ui-violet-halo), transparent 44%),
    linear-gradient(135deg, color-mix(in srgb, var(--ui-accent) 8%, var(--ui-shelf-bg)), var(--ui-shelf-bg));
  box-shadow: var(--ui-shadow);
}

.site-shell .favorites-intro,
.site-shell .favorites-content {
  min-width: 0;
}

.site-shell .favorites-intro .eyebrow {
  color: var(--ui-accent);
}

.site-shell .favorites-intro h2 {
  color: var(--ui-shelf-text);
  font-size: clamp(2.25rem, 4.1vw, 4.25rem);
}

.site-shell .favorites-intro h2 em {
  color: var(--ui-violet);
  font-style: normal;
}

.site-shell .favorites-intro > p:not(.eyebrow) {
  max-width: 27rem;
  color: var(--ui-shelf-muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.site-shell .button--outline-light {
  border-color: var(--ui-line-strong);
  color: var(--ui-shelf-text);
  background: transparent;
}

.site-shell .button--outline-light:is(:hover, :focus-visible) {
  border-color: var(--ui-accent);
  color: var(--ui-on-accent);
  background: var(--ui-accent-fill);
}

.site-shell .favorites-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.72rem;
  border-bottom: 1px solid var(--ui-line-strong);
  color: var(--ui-shelf-text);
  font-size: 0.74rem;
  font-weight: 760;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.site-shell .favorites-count {
  color: var(--ui-shelf-muted);
  font-size: 0.66rem;
}

.site-shell .favorites-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  padding-top: 0.85rem;
}

.site-shell .favorites-grid .favorite-card {
  border-color: var(--ui-line-strong);
  color: var(--ui-shelf-text);
  background: var(--ui-shelf-card);
}

.site-shell .favorites-grid .favorite-card:is(:hover, :focus-visible) {
  border-color: var(--ui-accent);
  color: var(--ui-shelf-text);
  background: color-mix(in srgb, var(--ui-shelf-card) 78%, var(--ui-accent));
}

.site-shell .favorites-grid .favorite-card strong {
  color: var(--ui-shelf-text);
}

.site-shell .favorites-grid .favorite-card small {
  color: var(--ui-shelf-muted);
}

.site-shell .favorite-star {
  font-size: 1.05rem;
}

/* Local leaderboard. */
.site-shell .local-play-section {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 6rem);
  padding-bottom: clamp(3rem, 6vw, 5.5rem);
}

.site-shell .local-play-copy,
.site-shell .leaderboard-panel {
  min-width: 0;
}

.site-shell .local-play-copy > p:not(.eyebrow) {
  max-width: 29rem;
  color: var(--ui-muted);
  font-size: 0.85rem;
  line-height: 1.55;
}

.site-shell .local-play-copy > .leaderboard-local-note {
  padding-left: 0.8rem;
  border-left: 2px solid var(--ui-violet);
}

.site-shell .leaderboard-panel {
  padding: clamp(1rem, 2vw, 1.45rem);
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-lg);
  color: var(--ui-text);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow);
}

.site-shell .leaderboard-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  align-items: center;
  gap: 0.7rem;
}

.site-shell .leaderboard-toolbar label {
  color: var(--ui-text);
  font-size: 0.76rem;
  font-weight: 760;
  letter-spacing: 0.04em;
}

.site-shell .leaderboard-toolbar select {
  width: 100%;
}

.site-shell .leaderboard-status,
.site-shell .leaderboard-panel .leaderboard-empty {
  color: var(--ui-muted);
  font-size: 0.72rem;
}

.site-shell .leaderboard-list {
  display: grid;
  gap: 0.45rem;
  margin: 0.8rem 0 0;
  padding: 0;
  list-style: none;
}

.site-shell .leaderboard-panel .leaderboard-row {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.62rem 0.7rem;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-sm);
  color: var(--ui-text);
  background: var(--ui-surface-2);
}

.site-shell .leaderboard-panel .leaderboard-row--current {
  border-color: var(--ui-accent);
  background: var(--ui-surface-3);
  box-shadow: 0 0 0 1px var(--ui-halo);
}

.site-shell .leaderboard-panel :is(.leaderboard-rank, .leaderboard-score) {
  color: var(--ui-accent);
  font-weight: 800;
}

.site-shell .leaderboard-panel .leaderboard-result {
  color: var(--ui-muted);
  font-size: 0.72rem;
}

/* Footer. */
.site-shell .site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 105px;
  padding: 2rem 0;
  border-top: 1px solid var(--ui-line);
  color: var(--ui-muted);
  font-size: 0.74rem;
}

.site-shell .footer-brand {
  min-width: 0;
}

.site-shell .footer-brand .brand-word {
  margin-right: 0.6rem;
  color: var(--ui-text);
}

.site-shell .footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem 1rem;
}

.site-shell .footer-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0.35rem 0;
}

.site-shell .text-link {
  min-height: 44px;
}

.site-shell .footer-links a:is(:hover, :focus-visible) {
  color: var(--ui-accent);
}

/* app.js appends legacy rules after page load; these scoped selectors keep the
   rendered discovery layer on the dashboard palette without touching the player. */
html[data-theme="dark"] .site-shell .game-tile > .game-card,
html[data-theme="dark"] .site-shell .quick-pick-card,
html[data-theme="dark"] .site-shell .recent-card,
html[data-theme="dark"] .site-shell .favorite-card,
html[data-theme="dark"] .site-shell .empty-state {
  color: var(--ui-text);
  background: var(--ui-surface);
}

html[data-theme="dark"] .site-shell .game-tile > .game-card {
  background: transparent;
}

html[data-theme="dark"] .site-shell .category-pill {
  color: var(--ui-text);
  background: var(--ui-surface);
}

html[data-theme="dark"] .site-shell .category-pill:is(:hover, :focus-visible) {
  color: var(--ui-text);
  background: var(--ui-surface-3);
}

html[data-theme="dark"] .site-shell .category-pill.is-active,
html[data-theme="dark"] .site-shell .category-pill.is-active:is(:hover, :focus-visible) {
  color: var(--ui-on-accent);
  background: var(--ui-accent-fill);
}

html[data-theme="dark"] .site-shell .quick-pick-card:is(:hover, :focus-visible),
html[data-theme="dark"] .site-shell .recent-card:is(:hover, :focus-visible),
html[data-theme="dark"] .site-shell .favorite-card:is(:hover, :focus-visible) {
  color: var(--ui-text);
  background: var(--ui-surface-3);
}

html[data-theme="dark"] .site-shell :is(.section-note, .hero-lede, .card-meta, .quick-copy small, .recent-card small, .favorite-card small, .empty-state p, .local-play-copy > p:last-child) {
  color: var(--ui-muted);
}

html[data-theme="dark"] .site-shell .favorites-grid .favorite-card {
  color: var(--ui-shelf-text);
  background: var(--ui-shelf-card);
}

html[data-theme="dark"] .site-shell .favorites-grid .favorite-card small {
  color: var(--ui-shelf-muted);
}

/* Responsive fallback: stack the console, then collapse every dashboard rail. */
@media (max-width: 1120px) {
  .site-shell .topbar-inner {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.65rem 1rem;
  }

  .site-shell .header-tools {
    justify-content: flex-end;
  }

  .site-shell .primary-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 0.3rem;
    scrollbar-width: thin;
  }

  .site-shell .hero-section {
    gap: 2rem;
  }

  .site-shell .game-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .site-shell .hero-section {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
    min-height: 0;
  }

  .site-shell .hero-copy,
  .site-shell .hero-card {
    width: 100%;
    max-width: none;
  }

  .site-shell .hero-copy h1 {
    max-width: 12ch;
    font-size: clamp(3.6rem, 10vw, 5.8rem);
  }

  .site-shell .featured-3d-grid,
  .site-shell .game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-shell .quick-pick-grid,
  .site-shell .recent-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-shell .favorites-panel,
  .site-shell .local-play-section {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-shell .dashboard-shortcuts {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 680px) {
  .site-shell .topbar-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.62rem;
    padding: 0.8rem 1rem;
  }

  .site-shell .header-tools {
    grid-column: 1;
    grid-row: 2;
    justify-content: stretch;
    width: 100%;
  }

  .site-shell .search-form {
    flex: 1 1 auto;
    width: auto;
  }

  .site-shell .primary-nav {
    grid-column: 1;
    grid-row: 3;
    width: calc(100% + 2rem);
    margin-inline: -1rem;
    padding: 0.3rem 1rem 0.4rem;
    white-space: nowrap;
  }

  .site-shell :is(.hero-section, .content-section, .favorites-panel, .site-footer) {
    width: calc(100% - 2rem);
  }

  .site-shell .dashboard-shortcuts {
    width: calc(100% - 2rem);
    gap: 0.6rem;
  }

  .site-shell .dashboard-shortcuts a {
    min-height: 72px;
    padding: 0.65rem;
  }

  .site-shell :is(.category-section, .discover-section, .featured-3d-section, .quick-pick-section, .recent-section, .local-play-section) {
    padding: 1.2rem;
    border-radius: 1.15rem;
  }

  .site-shell .hero-section {
    gap: 1.8rem;
    padding-top: 2.1rem;
    padding-bottom: 2rem;
  }

  .site-shell .hero-copy h1 {
    max-width: none;
    font-size: clamp(3rem, 12.5vw, 4.7rem);
  }

  .site-shell .section-heading,
  .site-shell .section-heading--compact {
    display: block;
  }

  .site-shell .section-note {
    max-width: 31rem;
    margin-top: 0.65rem;
  }

  .site-shell .filter-status,
  .site-shell .active-filters,
  .site-shell .sort-control {
    flex: 1 0 100%;
  }

  .site-shell .sort-control {
    justify-content: space-between;
    margin-left: 0;
  }

  .site-shell .sort-control select {
    width: min(100%, 18rem);
  }

  .site-shell .site-footer {
    display: block;
  }

  .site-shell .footer-links {
    justify-content: flex-start;
    margin-top: 0.75rem;
  }
}

@media (max-width: 560px) {
  .site-shell .hero-card {
    transform: none;
  }

  .site-shell .hero-card:is(:hover, :focus-within) {
    transform: translateY(-3px);
  }

  .site-shell .hero-art {
    min-height: 190px;
  }

  .site-shell .hero-actions .button {
    width: 100%;
  }

  .site-shell .featured-3d-grid,
  .site-shell .game-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-shell .favorites-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-shell .leaderboard-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-shell .leaderboard-toolbar select {
    width: 100%;
  }

  .site-shell .ticker-track {
    gap: 0.4rem 0.75rem;
    width: calc(100% - 2rem);
    text-align: center;
  }

  .site-shell .ticker-track b:nth-of-type(2) {
    display: none;
  }
}

@media (max-width: 430px) {
  .site-shell .brand-stamp {
    display: none;
  }

  .site-shell .primary-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.15rem;
    overflow: visible;
    white-space: normal;
  }

  .site-shell .primary-nav a {
    display: grid;
    min-height: 44px;
    place-items: center;
    padding: 0.35rem 0.1rem;
    font-size: 0.7rem;
    text-align: center;
  }

  .site-shell .hero-card-topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-shell .hero-card .feature-score {
    max-width: 100%;
  }

  .site-shell .hero-card h2 {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .site-shell .hero-card-actions {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .site-shell .hero-card-actions .button--lime {
    flex: 1 1 calc(100% - 3.4rem);
  }

  .site-shell .quick-pick-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding-inline: 0.85rem;
  }

  .site-shell :is(.recent-card, .favorite-card) {
    grid-template-columns: 50px minmax(0, 1fr) auto;
  }

  .site-shell .mini-art {
    width: 50px;
    min-height: 50px;
  }

  .site-shell .mini-art .art-glyph {
    font-size: 1.45rem;
  }

  .site-shell .leaderboard-panel .leaderboard-row {
    grid-template-columns: 1.4rem minmax(0, 1fr) auto;
    gap: 0.38rem;
  }

  .site-shell .leaderboard-panel .leaderboard-result {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-shell *,
  .site-shell *::before,
  .site-shell *::after {
    scroll-behavior: auto;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .site-shell :is(.hero-card, .game-tile, .quick-pick-card, .recent-card, .favorite-card, .dashboard-shortcuts a, .button, .icon-button, .category-pill) {
    transform: none !important;
  }
}

/* Shared renderer contract overlay. Game packs keep their own visual language;
 * this remains readable and honest when a canvas/WebGL surface cannot run. */
#game-stage [data-renderer-state] { position: relative; }
#game-stage [data-renderer-status] {
  position: absolute;
  z-index: 5000;
  inset: 0;
  display: grid;
  place-content: center;
  gap: .65rem;
  max-width: 100%;
  padding: clamp(1rem, 4vw, 2rem);
  color: #f4f8ff;
  background: rgba(5, 10, 24, .94);
  text-align: center;
  text-wrap: balance;
}
#game-stage [data-renderer-status][hidden] { display: none !important; }
#game-stage [data-renderer-status] strong { color: #b9f6d7; font-size: clamp(1rem, 2vw, 1.35rem); }
#game-stage [data-renderer-status] span { max-width: 38rem; color: #c5d3e7; font-size: .8rem; line-height: 1.55; }
#game-stage [data-renderer-status] button {
  min-height: 44px;
  margin: .25rem auto 0;
  padding: .65rem 1rem;
  border: 1px solid #8af0cb;
  border-radius: .55rem;
  color: #082a22;
  background: #8af0cb;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
#game-stage [data-renderer-status] button:focus-visible { outline: 3px solid #d9d1ff; outline-offset: 3px; }

/* Shared presentation contract: catalog surfaces are ready for depth without
   making the discovery page depend on JavaScript or remote artwork. */
:root {
  --ui-depth-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 20px 42px rgba(0, 3, 15, 0.22);
  --ui-surface-highlight: linear-gradient(135deg, rgba(255, 255, 255, 0.07), transparent 42%);
  --ui-focus-ring: rgba(217, 209, 255, 0.38);
}

html[data-theme="light"] {
  --ui-depth-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset, 0 20px 42px rgba(38, 71, 105, 0.14);
  --ui-surface-highlight: linear-gradient(135deg, rgba(255, 255, 255, 0.82), transparent 46%);
  --ui-focus-ring: rgba(81, 65, 162, 0.2);
}

.site-shell .hero-spotlight-frame {
  border-color: color-mix(in srgb, var(--ui-line) 86%, var(--ui-violet) 14%);
  background:
    radial-gradient(circle at 50% 25%, var(--ui-halo), transparent 56%),
    linear-gradient(145deg, var(--ui-surface-2), var(--ui-surface));
  transform: none;
}

.site-shell .hero-card {
  transform: none;
}

.site-shell .hero-card:is(:hover, :focus-within) {
  transform: translateY(-2px);
}

.site-shell .game-tile {
  border-color: color-mix(in srgb, var(--ui-line) 84%, var(--ui-violet) 16%);
}

.site-shell .game-tile:is(:hover, :focus-within) {
  transform: translate3d(0, -6px, 0) rotateX(1.2deg) rotateY(-0.35deg);
}

.site-shell .featured-3d-grid .game-tile {
  transform: rotateX(0.6deg);
}

.site-shell .featured-3d-grid .game-tile:is(:hover, :focus-within) {
  transform: translate3d(0, -7px, 0) rotateX(1.4deg) rotateY(-0.6deg);
}

.site-shell :is(.game-art--3d, .game-art--webgl) {
  transform-style: preserve-3d;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07), inset 0 -34px 64px rgba(2, 10, 21, 0.4), 0 16px 30px rgba(0, 2, 12, 0.22);
}

.site-shell :is(.button, .category-pill, .filter-chip, .icon-button, .favorite-toggle, .search-submit, .theme-toggle, .sound-toggle, .footer-links a) {
  min-block-size: 44px;
  touch-action: manipulation;
}

.site-shell :is(a, button, input, select) {
  touch-action: manipulation;
}

.site-shell :is(a, button, input, select):focus-visible {
  outline: 3px solid var(--ui-focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--ui-focus-ring);
}

.site-shell .search-form input:focus-visible {
  outline: none;
  box-shadow: none;
}

.site-shell .game-tile:focus-within {
  outline: 3px solid var(--ui-focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--ui-focus-ring), var(--ui-depth-shadow), var(--ui-card-shadow);
}

/* Keep the catalog comfortable in short landscape viewports as well as on
   narrow phones; the game grid's existing breakpoints still choose columns. */
@media (max-height: 560px) and (orientation: landscape) {
  .site-shell .hero-section {
    min-height: 0;
    gap: 1.25rem;
    padding-block: 1.5rem;
  }

  .site-shell .hero-copy h1 {
    font-size: clamp(2.7rem, 8vw, 4.8rem);
  }

  .site-shell .hero-lede {
    margin-top: 0.8rem;
    line-height: 1.45;
  }

  .site-shell .hero-actions {
    margin-top: 1rem;
  }

  .site-shell .hero-art {
    min-height: max(180px, min(44vw, 230px));
  }

  .site-shell .content-section {
    padding-top: 2rem;
  }
}

@media (max-width: 740px) {
  .site-shell :is(.category-section, .discover-section, .featured-3d-section, .quick-pick-section, .recent-section, .local-play-section) {
    padding: clamp(1rem, 4vw, 1.35rem);
  }

  .site-shell .hero-spotlight-frame {
    padding: 0.55rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-shell *,
  .site-shell *::before,
  .site-shell *::after {
    animation: none !important;
    transition-duration: 0s !important;
  }

  .site-shell :is(.hero-card, .game-tile, .featured-3d-grid .game-tile, .quick-pick-card, .recent-card, .favorite-card, .dashboard-shortcuts a, .button, .category-pill, .filter-chip, .icon-button, .favorite-toggle):is(:hover, :focus-within, :focus-visible) {
    transform: none !important;
  }
}
