@import url('https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@600;700;800&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* ============================================================================
   DESIGN SYSTEM — "Compatibility Log"
   Grounded in the actual subject: sideloading Android ports of console/PC
   games. The vernacular is the developer-options / APK-install / spec-sheet
   world of Android itself — signal green like a passing build, monospace
   like a log, condensed industrial type like a hardware nameplate. Every
   game is presented as a verified compatibility record, not a marketing tile.
   ============================================================================ */

:root {
  /* ---- Surfaces: a single cool-neutral ramp, each step ~+4% lightness so
     stacked panels stay legible without borders doing all the work. ---- */
  --bg: #0A0A0C;
  --bg-elevated: #0F0F12;
  --surface: #141418;
  --surface-2: #1B1B21;
  --surface-3: #26262E;

  /* ---- Ink ---- */
  --ink: #F4F5F7;
  --ink-dim: #A9AEB8;
  --ink-faint: #767C88;   /* AA (4.5:1) on --bg and --surface */

  /* ---- Primary accent: signal green ---- */
  --amber: #44D62C;
  --amber-bright: #6BF04F;
  --amber-deep: #2AA615;
  --amber-soft: rgba(68, 214, 44, 0.10);
  --amber-line: rgba(68, 214, 44, 0.32);
  --amber-glow: rgba(68, 214, 44, 0.30);
  --on-amber: #06210A;   /* text sitting on a solid green fill */

  /* ---- Secondary accents ---- */
  --accent-orange: #FF6A1A;
  --accent-purple: #A855F7;
  --accent-blue: #3B82F6;

  --ok: #44D62C;
  --danger: #F0555B;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);

  /* ---- Type ---- */
  --font-display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  /* ---- Spacing scale (used for rhythm between page sections) ---- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;

  /* ---- Elevation ---- */
  --shadow-card: 0 10px 24px -14px rgba(0, 0, 0, 0.8);
  --shadow-raised: 0 18px 40px -20px rgba(0, 0, 0, 0.85);
  --shadow-pop: 0 32px 70px -20px rgba(0, 0, 0, 0.75);
  --shadow-amber: 0 12px 28px -10px var(--amber-glow);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --shell: 1240px;
  --gutter: 2rem;

  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

@property --pct {
  syntax: '<number>';
  inherits: true;
  initial-value: 0;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg);
  background-image:
    /* a soft green wash behind the masthead so the page has a light source */
    radial-gradient(120% 60% at 50% -10%, rgba(68, 214, 44, 0.09) 0%, transparent 60%),
    linear-gradient(180deg, rgba(10, 10, 12, 0.35) 0%, rgba(10, 10, 12, 0.92) 55%, var(--bg) 100%),
    url('/bg2-2.png');
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-size: 100% 720px, 100% 100%, cover;
  background-position: top center, top center, top center;
  background-attachment: scroll, scroll, fixed;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--amber); color: var(--on-amber); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--amber-deep); }

/* Decorative glow blobs removed — see design notes: an ambient dual-orb
   glow is the templated "dark UI" default. Depth here comes from the
   masthead wash above instead. */
.bg-glow, .bg-glow-2 { display: none; }

/* Shared page shell so rails, grid and the trust band all align to the
   same left/right edge instead of each defining their own max-width. */
.container,
.rail-section .rail-inner,
.features-section {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Full-bleed bars (header, footer) can't use the wrapper above — they
   need to span the viewport so their background/border reach the edges.
   They instead take
     padding-inline: max(--gutter, (100% - --shell) / 2)
   which centres their *contents* on the same shell without needing an
   extra wrapper element — which matters, because the static legal pages
   under public/legal/ hand-roll their own header and footer markup. */

/* ----------------------------------------------------------------------
   Header
   ---------------------------------------------------------------------- */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(10, 10, 12, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--border);
  padding-block: 0.85rem;
  padding-inline: max(var(--gutter), calc((100% - var(--shell)) / 2));
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* A hairline of brand colour under the sticky bar — reads as a status
   strip rather than another grey divider. */
header::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--amber-line) 22%, var(--amber-line) 78%, transparent);
  opacity: 0.7;
  pointer-events: none;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  text-transform: uppercase;
  flex-shrink: 0;
  line-height: 1;
}

.logo i { color: var(--amber); font-size: 1.1rem; }

.logo img {
  height: 2.1rem;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(68, 214, 44, 0.35));
  transition: var(--transition);
}

.logo:hover img { transform: translateY(-1px) scale(1.04); }

.logo span {
  color: var(--amber);
  font-weight: 800;
  text-shadow: 0 0 18px var(--amber-glow);
}

.build-tag {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--amber);
  background: var(--amber-soft);
  border: 1px solid var(--amber-line);
  border-radius: var(--radius-pill);
  padding: 0.22rem 0.6rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: center;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.nav-links a {
  position: relative;
  color: var(--ink-dim);
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition);
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
  border: 1px solid transparent;
}

.nav-links a:hover {
  color: var(--ink);
  background-color: var(--surface);
}

/* The current page gets an underline rather than a filled pill, so the
   Admin button stays the only strongly-outlined control up here. */
.nav-links a.active {
  color: var(--ink);
  background-color: var(--surface);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 0.95rem;
  right: 0.95rem;
  bottom: 0.25rem;
  height: 2px;
  border-radius: 2px;
  background: var(--amber);
  box-shadow: 0 0 10px var(--amber-glow);
}

.nav-links a.active i { color: var(--amber); }

.admin-btn {
  border: 1px solid var(--border-strong) !important;
  font-family: var(--font-mono);
  font-size: 0.78rem !important;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.01em;
}

.admin-btn:hover {
  background-color: var(--amber) !important;
  color: var(--on-amber) !important;
  border-color: var(--amber) !important;
  box-shadow: var(--shadow-amber);
}

/* ----------------------------------------------------------------------
   Navbar search — replaces the old hero search bar. Lives in the header
   (app/root.jsx) via SearchContext, so it's available on every page and
   filters the homepage grid live without round-tripping through the URL.
   ---------------------------------------------------------------------- */
.nav-search {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 480px;
  margin-inline: auto;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 0.6rem 1.15rem;
  transition: var(--transition);
}

.nav-search:hover { border-color: rgba(255, 255, 255, 0.22); }

.nav-search:focus-within {
  border-color: var(--amber-line);
  box-shadow: 0 0 0 3px var(--amber-soft);
  background: rgba(0, 0, 0, 0.6);
}

.nav-search i {
  color: var(--ink-faint);
  font-size: 0.85rem;
  transition: var(--transition);
  flex-shrink: 0;
}

.nav-search:focus-within i { color: var(--amber); }

.nav-search input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.9rem;
}

.nav-search input::placeholder { color: var(--ink-faint); }

/* ----------------------------------------------------------------------
   Search page (app/routes/search.jsx) — larger standalone version of the
   navbar search box, plus a submit button since results are a real
   server-side query rather than a live client filter.
   ---------------------------------------------------------------------- */
.search-page-form {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 0.75rem 1.35rem;
  margin-top: 1.5rem;
  transition: var(--transition);
}

.search-page-form:focus-within {
  border-color: var(--amber-line);
  box-shadow: 0 0 0 3px var(--amber-soft);
  background: rgba(0, 0, 0, 0.6);
}

.search-page-form i { color: var(--ink-faint); flex-shrink: 0; }
.search-page-form:focus-within i { color: var(--amber); }

.search-page-form input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.search-page-form input::placeholder { color: var(--ink-faint); }

.search-page-submit {
  flex-shrink: 0;
  background: var(--amber);
  color: #0A0A0C;
  border: none;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition);
}

.search-page-submit:hover { box-shadow: var(--shadow-amber); }

/* ----------------------------------------------------------------------
   Section headers — title, a gradient rule that eats the free space, then
   the "See more" affordance. Mirrors the reference layout and keeps every
   band on the page visually parallel.
   ---------------------------------------------------------------------- */
.section-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  white-space: nowrap;
}

.section-title::before { display: none; }

.section-title i { font-size: 1.05rem; }

.rail-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.rail-header .section-title { margin-bottom: 0; }

.rail-header::before {
  content: '';
  order: 1;
  flex: 1 1 auto;
  height: 1px;
  min-width: 1.5rem;
  background: linear-gradient(90deg, var(--amber-line), rgba(168, 85, 247, 0.28) 55%, transparent);
}

.rail-header .see-more-link { order: 2; }

.see-more-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: none;
  border: none;
  color: var(--ink-dim);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  padding: 0.3rem 0;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.see-more-link:hover { color: var(--amber); }
.see-more-link i { font-size: 0.7rem; transition: transform 0.22s var(--ease-out); }
.see-more-link:hover i { transform: translateX(3px); }

/* ----------------------------------------------------------------------
   Rails — "Newly Added" / "Most Popular" horizontal-scroll strips above
   the main filterable grid. Reuses .game-card so a title never looks
   different depending on which section it's found in.
   ---------------------------------------------------------------------- */
.rail-section { padding: 1.25rem 0; }

.rail-section:first-child { padding-top: 2.75rem; }

/* Wraps the scroller + its arrow buttons so the arrows can sit over the
   edges of the strip without being clipped by the scroll container. */
.rail-viewport { position: relative; }

.games-rail {
  display: flex;
  gap: 1.35rem;
  overflow-x: auto;
  /* overflow-x:auto makes the block axis clip too, so the card's hover
     lift + glow would be sliced off at the top edge. The padding gives
     it room; the negative margin keeps the rail visually where it was. */
  padding-top: 12px;
  margin-top: -12px;
  padding-bottom: 0.75rem;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

/* Edge fades — only applied once the rail actually overflows (see the
   has-overflow / is-scrolled / is-end logic in app/routes/home.jsx), so a
   cut-off card reads as "more to scroll" rather than as a layout bug,
   and a short rail is left alone. */
.games-rail.has-overflow {
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 48px), transparent 100%);
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 48px), transparent 100%);
}

.games-rail.has-overflow.is-scrolled {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 48px, #000 calc(100% - 48px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 48px, #000 calc(100% - 48px), transparent 100%);
}

.games-rail.has-overflow.is-scrolled.is-end {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 48px, #000 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 48px, #000 100%);
}

.games-rail::-webkit-scrollbar { display: none; }

.games-rail .game-card {
  flex: 0 0 176px;
  width: 176px;
  scroll-snap-align: start;
}

.rail-nav {
  position: absolute;
  top: calc(50% - 1.4rem);
  transform: translateY(-50%);
  z-index: 3;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: rgba(16, 16, 20, 0.9);
  backdrop-filter: blur(8px);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: var(--transition);
  box-shadow: var(--shadow-card);
}

.rail-nav:hover {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--on-amber);
}

.rail-nav[hidden] { display: none; }
.rail-nav--prev { left: -14px; }
.rail-nav--next { right: -14px; }

/* ----------------------------------------------------------------------
   Category tiles
   ---------------------------------------------------------------------- */
.categories-rail {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.categories-rail::-webkit-scrollbar { display: none; }

.category-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1 0 118px;
  min-height: 96px;
  padding: 0.9rem 0.75rem;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  color: var(--ink);
  gap: 0.55rem;
  font-family: var(--font-body);
  overflow: hidden;
  scroll-snap-align: start;
}

/* Hover lights the tile from the top edge in its own icon colour, using
   currentColor set per-tile by the inline icon style. */
.category-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 50% 0%, rgba(255, 255, 255, 0.07), transparent 70%);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.category-card:hover,
.category-card.active {
  border-color: var(--amber-line);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}

.category-card:hover::before,
.category-card.active::before { opacity: 1; }

.category-card i {
  font-size: 1.55rem;
  transition: var(--transition);
  filter: saturate(0.85);
}

.category-card:hover i,
.category-card.active i {
  transform: scale(1.08);
  filter: saturate(1.2) drop-shadow(0 0 12px currentColor);
}

.category-card span {
  font-size: 0.83rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.25;
  color: var(--ink-dim);
  transition: var(--transition);
}

.category-card:hover span,
.category-card.active span { color: var(--ink); }

/* ----------------------------------------------------------------------
   Main content
   ---------------------------------------------------------------------- */
.container {
  padding-bottom: 5rem;
}

.toolbar-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  padding-top: 1.5rem;
}

.toolbar-row .section-title { margin-bottom: 0; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.filter-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-faint);
  text-transform: lowercase;
  letter-spacing: 0.03em;
}

.filter-label::before { content: '// '; color: var(--ink-faint); }

.filter-select {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--surface);
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-faint) 50%), linear-gradient(135deg, var(--ink-faint) 50%, transparent 50%);
  background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  border: 1px solid var(--border-strong);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 0.55rem 2.1rem 0.55rem 0.8rem;
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  transition: var(--transition);
  min-width: 150px;
}

.filter-select:hover { border-color: rgba(255, 255, 255, 0.24); }

.filter-select:focus {
  border-color: var(--amber-line);
  box-shadow: 0 0 0 3px var(--amber-soft);
}

.filter-select option { background: var(--surface); color: var(--ink); }

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 2rem 1.35rem;
}

/* ----------------------------------------------------------------------
   Game Card — a compatibility record, not a poster tile
   ---------------------------------------------------------------------- */
.game-card {
  background: transparent;
  border: none;
  overflow: visible;
  transition: transform 0.25s var(--ease-out);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
  gap: 0.6rem;
  color: inherit;
  /* Load-bearing. A flex/grid item defaults to min-width:auto, i.e. it refuses
     to be narrower than its own min-content — and .game-title is nowrap, so a
     long title makes that min-content the full width of the string. Combined
     with the rail's flex-shrink:0 that let one long-titled card render wider
     (and, via aspect-ratio, taller) than every other card in the row. */
  min-width: 0;
}

.game-card:hover { transform: translateY(-6px); }

.game-image-wrapper {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  isolation: isolate;
}

/* Bottom scrim: keeps overlaid badges legible on bright cover art and
   gives every tile the same weighted base regardless of the artwork. */
.game-image-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.28) 0%, transparent 32%, transparent 62%, rgba(0, 0, 0, 0.55) 100%);
  pointer-events: none;
  transition: opacity 0.22s ease;
  opacity: 0.85;
}

.game-card:hover .game-image-wrapper {
  border-color: var(--amber-line);
  box-shadow: var(--shadow-raised), 0 0 0 1px var(--amber-line), 0 0 28px -12px var(--amber-glow);
}

.game-card:hover .game-image-wrapper::after { opacity: 1; }

.game-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s var(--ease-out), filter 0.3s ease;
  filter: saturate(0.92);
}

.game-card:hover .game-image {
  transform: scale(1.07);
  filter: saturate(1.05);
}

.card-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  background: rgba(10, 10, 12, 0.78);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border-strong);
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.22rem 0.55rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.02em;
}

/* Official vs. fan-made port indicator. On cards it floats over the image
   (mirroring .card-tag on the opposite corner); everywhere else (modal,
   detail page) it sits inline next to the category badge. */
.port-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.port-type-badge--official {
  color: var(--ok);
  background: var(--amber-soft);
  border: 1px solid var(--amber-line);
}

.port-type-badge--unofficial {
  color: var(--ink-dim);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
}

.game-image-wrapper .port-type-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  background-color: rgba(10, 10, 12, 0.78);
  backdrop-filter: blur(6px);
}

.modal-badge-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.game-details {
  padding: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.15rem;
  min-width: 0;
}

.game-title {
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  transition: color 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.005em;
}

.game-card:hover .game-title { color: var(--amber); }

.game-version {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-faint);
  line-height: 1.4;
}

.game-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.game-meta-left {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-dim);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.game-meta-left i { color: var(--ink-faint); }

/* Integrity Ring — the signature element. Reads a rating (0-10) as a
   verification percentage rather than a star count, in keeping with the
   "port integrity" framing. Pure CSS conic-gradient + animated custom
   property; degrades to an instant jump on browsers without @property. */
.integrity-ring {
  --pct: 0;
  --size: 44px;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: conic-gradient(var(--amber) calc(var(--pct) * 1%), var(--surface-3) 0);
  display: grid;
  place-items: center;
  position: relative;
  flex-shrink: 0;
  transition: --pct 1.1s var(--ease-out);
  box-shadow: 0 0 20px -6px var(--amber-glow);
}

.integrity-ring::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--surface);
}

.integrity-ring.integrity-ring--modal { --size: 66px; }
.integrity-ring.integrity-ring--modal::before { inset: 6px; }

.integrity-value {
  position: relative;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.7rem;
  color: var(--ink);
  z-index: 1;
  letter-spacing: -0.02em;
}

.integrity-ring--modal .integrity-value { font-size: 1rem; }

.no-rating-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.65rem;
  letter-spacing: 0.03em;
}

/* ----------------------------------------------------------------------
   Modal / Game Detail shared components
   ---------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 6, 8, 0.88);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 1.5rem;
}

.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal-content {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-pop);
  transform: scale(0.97);
  transition: transform 0.25s var(--ease-out);
  display: flex;
  flex-direction: column;
}

.modal-overlay.active .modal-content { transform: scale(1); }

.modal-close {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  background: rgba(16, 16, 20, 0.8);
  border: 1px solid var(--border-strong);
  color: var(--ink);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.1rem;
  transition: var(--transition);
  z-index: 10;
}

.modal-close:hover { background: var(--amber); color: var(--on-amber); }

.modal-banner {
  width: 100%;
  height: 280px;
  position: relative;
  background-color: var(--surface-2);
}

.modal-banner img { width: 100%; height: 100%; object-fit: cover; }

.modal-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, var(--surface) 100%);
}

.modal-body,
.game-page-card .modal-body { padding: 1.75rem 2rem 2rem; }

/* Standalone /game/:slug page (app/routes/game.jsx). Reuses the .modal-*
   classes above so it matches the homepage modal look exactly. */
.game-page-wrap {
  max-width: 940px;
  margin: 2rem auto;
  padding: 0 1.5rem 5rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink-dim);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
  transition: var(--transition);
}

.back-link:hover { color: var(--amber); }

.game-page-card {
  background: linear-gradient(180deg, var(--surface), var(--bg-elevated));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-pop);
}

.detail-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ink-faint);
  margin-bottom: 1.25rem;
}

.detail-breadcrumb a { color: var(--ink-dim); transition: var(--transition); }
.detail-breadcrumb a:hover { color: var(--amber); }
.detail-breadcrumb-sep { color: var(--ink-faint); }
.detail-breadcrumb-current { color: var(--ink); }

/* ----------------------------------------------------------------------
   Detail header — icon + identity + install CTA sit above the fold
   together (Uptodown/APKPure-style), instead of the CTA being buried
   below a full-width banner image.
   ---------------------------------------------------------------------- */
.detail-header {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 1.75rem;
  padding: 2.25rem 2rem 2rem;
  border-bottom: 1px solid var(--border);
  background: radial-gradient(90% 140% at 0% 0%, rgba(68, 214, 44, 0.07), transparent 60%);
}

.detail-icon {
  width: 112px;
  height: 112px;
  flex-shrink: 0;
  border-radius: 24px;
  object-fit: cover;
  background-color: var(--surface-2);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-raised);
}

.detail-identity {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.detail-title {
  font-size: 2.15rem;
  margin: 0;
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--ok);
  background: var(--amber-soft);
  border: 1px solid var(--amber-line);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.detail-rating-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.detail-rating-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
  text-transform: lowercase;
}

.detail-cta {
  flex-shrink: 0;
  text-align: center;
}

.detail-cta .cta-subtext { justify-content: center; margin-top: 0.6rem; }

/* Description — collapsed by default past a length threshold, expanded
   in place rather than truncated forever. */
.description-section { margin-bottom: 1.75rem; }
.description-section .game-description { margin-bottom: 0.6rem; }

.read-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  transition: var(--transition);
}

.read-more-btn:hover { filter: brightness(1.2); }
.read-more-btn i { font-size: 0.7rem; }

/* ----------------------------------------------------------------------
   Screenshot lightbox
   ---------------------------------------------------------------------- */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 6, 8, 0.95);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1100;
  padding: 3rem 1.5rem;
}

.lightbox-img {
  max-width: min(90vw, 1100px);
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-pop);
}

.lightbox-close,
.lightbox-nav {
  background: rgba(22, 22, 27, 0.92);
  border: 1px solid var(--border-strong);
  color: var(--ink);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: var(--transition);
  position: absolute;
}

.lightbox-close {
  top: 1.25rem;
  right: 1.5rem;
  width: 42px;
  height: 42px;
  font-size: 1.2rem;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  font-size: 1.1rem;
}

.lightbox-close:hover,
.lightbox-nav:hover { background: var(--amber); color: var(--on-amber); border-color: var(--amber); }

.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }

.lightbox-counter {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-dim);
  background: rgba(22, 22, 27, 0.92);
  border: 1px solid var(--border-strong);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
}

/* ----------------------------------------------------------------------
   Related games
   ---------------------------------------------------------------------- */
.related-section {
  max-width: 940px;
  margin: 3rem auto 0;
  padding: 0 1.5rem;
}

.related-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

.modal-header-info {
  margin-top: -3.5rem;
  position: relative;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.modal-title {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 0.95;
  color: var(--ink);
  flex: 1;
  min-width: 200px;
}

.modal-badge {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--amber);
  border: 1px solid var(--amber-line);
  background: var(--amber-soft);
  padding: 0.28rem 0.65rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

a.modal-badge:hover { background: rgba(68, 214, 44, 0.2); border-color: var(--amber); }

.rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  color: var(--ink);
  font-size: 0.85rem;
}

.game-description {
  color: var(--ink-dim);
  margin-bottom: 1.75rem;
  line-height: 1.78;
  font-size: 0.97rem;
  max-width: 68ch;
}

/* Screenshots — framed like device captures */
.screenshots-section { margin-bottom: 2rem; }

.screenshots-title,
.specs-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
  margin-bottom: 0.85rem;
}

.screenshots-wrapper {
  display: flex;
  gap: 0.85rem;
  overflow-x: auto;
  padding-bottom: 0.85rem;
  scroll-snap-type: x mandatory;
}

.screenshots-wrapper::-webkit-scrollbar { height: 6px; }
.screenshots-wrapper::-webkit-scrollbar-track { background: var(--surface-2); border-radius: 3px; }
.screenshots-wrapper::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 3px; }
.screenshots-wrapper::-webkit-scrollbar-thumb:hover { background: var(--amber-deep); }

.screenshot-item {
  flex: 0 0 288px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  scroll-snap-align: start;
  transition: var(--transition);
}

.screenshot-item:hover {
  border-color: var(--amber-line);
  box-shadow: 0 0 24px -12px var(--amber-glow);
}

.screenshot-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
  transition: transform 0.4s var(--ease-out);
}

.screenshot-item:hover img { transform: scale(1.05); }

/* Specs — a data readout, not an icon grid */
.specs-grid {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.25rem 1.25rem;
  margin-bottom: 2rem;
  font-family: var(--font-mono);
  font-size: 0.84rem;
}

.spec-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.spec-item:last-child { border-bottom: none; }

.spec-label { color: var(--ink-faint); text-transform: lowercase; }
.spec-label::before { content: '// '; color: var(--ink-faint); }

.spec-value {
  color: var(--ink);
  font-weight: 500;
  text-align: right;
  word-break: break-word;
}

.spec-value-link {
  text-decoration: none;
  transition: var(--transition);
}

.spec-value-link:hover,
.spec-value-link:focus-visible {
  color: var(--amber);
  text-decoration: underline;
}

/* CTA — an install action, not a glowing pill */
.cta-container { text-align: left; }

.download-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  background: linear-gradient(180deg, var(--amber-bright), var(--amber) 55%, var(--amber-deep));
  color: var(--on-amber);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.005em;
  padding: 0.95rem 2.1rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-amber);
  transition: var(--transition);
}

.download-cta-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 16px 34px -10px var(--amber-glow);
}

.download-cta-btn:active { transform: translateY(0); }
.download-cta-btn i { font-size: 1.1rem; }

.cta-subtext {
  margin-top: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ok);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  letter-spacing: 0.02em;
}

/* Empty State */
.no-games {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  color: var(--ink-dim);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.no-games i { font-size: 2.5rem; margin-bottom: 1rem; color: var(--amber); opacity: 0.7; }

/* Infinite scroll sentinel */
.lazy-sentinel {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  margin-top: 2.5rem;
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-faint);
}

.lazy-sentinel i { color: var(--amber); }

/* ----------------------------------------------------------------------
   /games — the full listing behind each rail's "See more"
   ---------------------------------------------------------------------- */
.games-list-page { padding-top: 2.5rem; }
.games-list-page .detail-breadcrumb { margin-bottom: 1rem; }
.games-list-page .toolbar-row { padding-top: 0; }

.page-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: 3rem;
}

.page-pagination-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.page-pagination-btn:hover { border-color: var(--amber-line); color: var(--amber); }
.page-pagination-btn.is-disabled { opacity: 0.3; pointer-events: none; }

.page-pagination-numbers {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.page-pagination-number {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 36px;
  height: 36px;
  padding: 0 0.4rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-dim);
  border: 1px solid transparent;
  transition: var(--transition);
}

.page-pagination-number:hover { border-color: var(--border-strong); color: var(--ink); background: var(--surface); }

.page-pagination-number.is-active {
  background: var(--amber);
  color: var(--on-amber);
  font-weight: 700;
  border-color: var(--amber);
  box-shadow: 0 0 18px -6px var(--amber-glow);
}

.page-pagination-ellipsis {
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 0 0.2rem;
}

/* ----------------------------------------------------------------------
   Legal pages (DMCA / Terms / Privacy)
   ---------------------------------------------------------------------- */
.legal-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 3.5rem 2rem 5rem;
}

.legal-page h1 {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.6rem;
}

.legal-page .legal-updated {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-faint);
  margin-bottom: 2.5rem;
}

.legal-page h2 {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--amber);
  margin: 2.25rem 0 1rem;
}

.legal-page p, .legal-page li {
  color: var(--ink-dim);
  line-height: 1.75;
  font-size: 0.95rem;
}

.legal-page p { margin-bottom: 1rem; }
.legal-page ul, .legal-page ol { padding-left: 1.4rem; margin-bottom: 1.25rem; }
.legal-page li { margin-bottom: 0.5rem; }
.legal-page strong { color: var(--ink); font-weight: 600; }
.legal-page a { color: var(--amber); text-decoration: underline; text-underline-offset: 3px; }

.legal-callout {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  margin: 1.5rem 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-dim);
  line-height: 1.65;
}

.legal-callout strong { color: var(--ink); }

/* ----------------------------------------------------------------------
   Trust band + Footer
   ---------------------------------------------------------------------- */
.features-section {
  margin: 4rem auto 0;
  padding-block: 1.75rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  background: linear-gradient(180deg, var(--surface), rgba(20, 20, 24, 0.4));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.25rem 1.25rem 0.25rem 0;
  border-right: 1px solid var(--border);
}

.feature-item:last-child { border-right: none; padding-right: 0; }

.feature-item i {
  font-size: 1.45rem;
  color: var(--amber);
  flex-shrink: 0;
  filter: drop-shadow(0 0 10px var(--amber-glow));
}

.feature-text strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.15rem;
  line-height: 1.3;
}

.feature-text span {
  display: block;
  font-size: 0.76rem;
  color: var(--ink-dim);
  line-height: 1.4;
}

/* Flex rather than a 3-column grid: the React layout renders
   copyright / socials / links, but the static pages under public/legal/
   render only copyright / links. space-between handles both — the middle
   slot simply disappears when it isn't there. */
footer {
  margin-top: 2.5rem;
  padding-block: 1.75rem 3rem;
  padding-inline: max(var(--gutter), calc((100% - var(--shell)) / 2));
  border-top: 1px solid var(--border);
  color: var(--ink-dim);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.85rem;
}

footer > p:first-child { color: var(--ink-faint); margin-right: auto; }
footer > p:first-child a,
footer a.brand { color: var(--amber); }

.footer-socials {
  display: flex;
  gap: 0.7rem;
  margin-inline: auto;
}

.footer-socials a {
  background: var(--surface-2);
  border: 1px solid var(--border);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--ink-dim);
  transition: var(--transition);
}

.footer-socials a:hover {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--on-amber);
  transform: translateY(-2px);
  box-shadow: var(--shadow-amber);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
}

.footer-links a {
  color: var(--ink-dim);
  font-size: 0.85rem;
  transition: var(--transition);
}

.footer-links a:hover { color: var(--amber); }
.footer-links a::after { content: none; }

/* ----------------------------------------------------------------------
   Responsive
   ---------------------------------------------------------------------- */
@media (max-width: 1100px) {
  :root { --gutter: 1.5rem; }
  .nav-search { max-width: 340px; }
  .build-tag { display: none; }
  /* Below this the trust band wraps to two rows, where a per-item right
     border lands mid-row and reads as a stray line. */
  .feature-item { border-right: none; padding-right: 0; }
}

@media (max-width: 900px) {
  header { flex-wrap: wrap; row-gap: 0.65rem; }
  .nav-search { order: 3; flex-basis: 100%; max-width: none; margin: 0; }
  .nav-links { margin-left: auto; }
  .detail-header { gap: 1.25rem; }
  .detail-cta { width: 100%; text-align: left; }
  .detail-cta .download-cta-btn { width: 100%; }
  footer {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }
  footer > p:first-child { margin-right: 0; }
  .footer-socials { margin-inline: 0; }
  .footer-links { margin-left: 0; justify-content: center; }
  .feature-item { border-right: none; padding-right: 0; }
}

@media (max-width: 768px) {
  :root { --gutter: 1.25rem; }
  header { padding: 0.75rem var(--gutter); }
  .logo { font-size: 1.45rem; }
  .logo img { height: 1.8rem; }
  .nav-links a { padding: 0.5rem 0.7rem; font-size: 0.85rem; }
  .admin-btn { font-size: 0.72rem !important; padding: 0.5rem 0.7rem; }

  .rail-section:first-child { padding-top: 1.75rem; }
  .rail-section { padding: 0.85rem 0; }
  .section-title { font-size: 1.15rem; }
  .rail-header { gap: 0.85rem; }
  .rail-nav { display: none; }
  .games-rail { gap: 1rem; }
  .games-rail .game-card { flex-basis: 148px; }
  .category-card { flex-basis: 104px; min-height: 88px; }

  .games-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1.5rem 1rem; }
  .toolbar-row { align-items: stretch; flex-direction: column; }
  .filter-bar { gap: 0.6rem; }
  .filter-group { flex: 1 1 30%; }
  .filter-select { min-width: 0; width: 100%; }

  .game-page-wrap { padding: 0 1.25rem 4rem; margin-top: 1.25rem; }
  .related-section { padding: 0 1.25rem; }
  .modal-title { font-size: 1.85rem; }
  .modal-banner { height: 190px; }
  .modal-header-info { margin-top: -2.25rem; }
  .modal-body, .game-page-card .modal-body { padding: 1.5rem 1.25rem 1.75rem; }
  .download-cta-btn { width: 100%; }

  .detail-header {
    flex-direction: column;
    align-items: stretch;
    padding: 1.5rem 1.25rem;
  }
  .detail-icon { width: 84px; height: 84px; border-radius: 18px; }
  .detail-title { font-size: 1.65rem; }
  .screenshot-item { flex-basis: 240px; }
  .spec-item { flex-direction: column; align-items: flex-start; gap: 0.2rem; }
  .spec-value { text-align: left; }

  .lightbox-overlay { padding: 5.5rem 0.75rem 2rem; }
  .lightbox-nav { width: 40px; height: 40px; font-size: 0.95rem; }
  .lightbox-prev { left: 0.5rem; }
  .lightbox-next { right: 0.5rem; }
  .lightbox-close { top: 0.75rem; right: 0.75rem; }

  .features-section { margin-top: 2.5rem; }
  .features-grid { padding: 1.25rem; gap: 1rem; }
  .legal-page { padding: 2.5rem 1.25rem 3.5rem; }
  .legal-page h1 { font-size: 1.9rem; }
  .page-pagination { gap: 0.75rem; }
}

@media (max-width: 480px) {
  .games-grid { grid-template-columns: repeat(2, 1fr); }
  .games-rail .game-card { flex-basis: 136px; }
  .filter-group { flex-basis: 100%; }
  .footer-links { gap: 1rem; }
}

/* Respect reduced motion: no ring fill sweep, no lift */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .games-rail { scroll-behavior: auto; }
  .integrity-ring { transition: none; }
  .game-card:hover,
  .category-card:hover,
  .download-cta-btn:hover,
  .footer-socials a:hover { transform: none; }
  .game-card:hover .game-image { transform: none; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
