:root {
  --bg: #0d0b12;
  --surface: #16131e;
  --card: #1a1726;
  --card-hover: #221e30;
  --text: #ede9fe;
  --text-muted: #a8a2c6;
  --accent: #c084fc;
  --accent-glow: rgba(192, 132, 252, 0.2);
  --accent-hover: #d8b4fe;
  --border: #2a2440;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  padding: 0 1rem;
  /* Stacking context so body::after { z-index: -1 } is trapped here and paints
     above body's bg but below content. Without it the pseudo escapes to the
     root SC and gets occluded by html's bg from critical CSS. */
  position: relative;
  z-index: 0;
}

/* LX mascot, bottom-right on every page. */
body::after {
  content: '';
  position: fixed;
  bottom: -5%;
  right: -5%;
  width: 500px;
  height: 600px;
  background: url('/LX.webp') no-repeat center;
  background-size: contain;
  opacity: 0.2;
  pointer-events: none;
  z-index: -1;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

html { scroll-behavior: smooth; overflow-x: hidden; }

/* Priority/AI badge on a card (home, game more-from, creator). Base position
   top-right; the -left variant below flips it. */
.card-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  z-index: 2;
}

/* AI badge (or any badge that should explicitly sit top-left) overrides the
   default `.card-badge { right: 0.5rem }` to anchor on the left side.
   Selector is `.card-badge.card-badge-left` (specificity 0,2,0) so it beats
   `.card-badge` regardless of cascade order. */
.card-badge.card-badge-left {
  right: auto;
  left: 0.5rem;
}

/* Creator links (game byline, "More from" heading, home-card byline) use the
   accent colour with no underline, matching the tag/event links. */
.creator-link {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

.creator-link:hover {
  color: var(--accent-hover);
}

.card-thumb-composite,
.more-creator-thumb-composite {
  width: 100%;
  height: 100%;
  background-size: 340% auto;
  background-position: center;
  background-repeat: no-repeat;
  transition: background-size 0.4s ease;
}

.file-card:hover .card-thumb-composite,
.more-creator-card:hover .more-creator-thumb-composite {
  background-size: 360% auto;
}

/* Dark gradient under every thumbnail container. Prevents the browser's
   default white empty-img rendering from flashing through while lazy-loaded
   thumbnails are still fetching. The img covers this once loaded. */
.card-thumb,
.ribbon-track img,
.more-creator-thumb {
  background: linear-gradient(135deg, var(--surface), var(--card));
}

.lang-toggle {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 100;
  padding: 0.3rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-family: inherit;
  border-radius: 1.5rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  text-decoration: none;
}

.lang-toggle:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* Honour the OS "reduce motion" setting site-wide: no smooth-scroll jumps. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
