/* CheatCrest. One stylesheet, mobile-first. Spacing only comes from the --sp-* scale. */

:root {
  color-scheme: dark;

  --bg: #0f1117;
  --surface: #161922;
  --surface-2: #1d2130;
  --border: #262b3a;
  --border-strong: #3a4156;
  --text: #e9ecf3;
  --muted: #8b93a7;
  --accent: #22c55e;
  --accent-2: #4ade80;
  --accent-ink: #07130b;
  --accent-line: rgb(34 197 94 / 0.55);
  --danger: #f87171;

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;

  --r-sm: 10px;
  --r-md: 12px;
  --r-lg: 14px;

  --gutter: var(--sp-4);
  --header-h: 97px;
  --container: 1360px;

  --font-ui: Inter, "Inter Fallback", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Space Grotesk", "Space Grotesk Fallback", Inter, system-ui, sans-serif;

  --ease: cubic-bezier(0.2, 0, 0, 1);
}

/* Metric-matched fallbacks keep text from reflowing when the web fonts arrive. */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial"), local("Roboto");
  size-adjust: 107%;
}

@font-face {
  font-family: "Space Grotesk Fallback";
  src: local("Arial"), local("Roboto");
  size-adjust: 102%;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--font-ui);
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
dl,
dd,
ol,
ul {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: var(--font-head);
  font-weight: 600;
  letter-spacing: -0.01em;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.catalog:focus,
.game-main:focus {
  outline: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  top: var(--sp-2);
  left: var(--sp-2);
  z-index: 30;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.site-header.is-scrolled {
  background: rgb(15 17 23 / 0.97);
  border-bottom-color: var(--border);
}

@supports (backdrop-filter: blur(12px)) {
  .site-header.is-scrolled {
    background: rgb(15 17 23 / 0.82);
    backdrop-filter: blur(12px);
  }
}

.site-header__inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "brand nav"
    "search search";
  align-items: center;
  padding-bottom: var(--sp-2);
}

.site-header__inner--bare {
  grid-template-areas: "brand brand";
  padding-bottom: 0;
}

.wordmark {
  grid-area: brand;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  height: 48px;
  border-radius: var(--r-sm);
  font: 600 18px/1 var(--font-head);
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: color 0.16s var(--ease);
}

.wordmark:hover {
  color: var(--accent-2);
}

.site-nav {
  grid-area: nav;
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-1);
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding-inline: var(--sp-2);
  border-radius: var(--r-sm);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.16s var(--ease), background-color 0.16s var(--ease);
}

.site-nav a:hover {
  background: var(--surface-2);
  color: var(--text);
}

.site-nav a[aria-current] {
  color: var(--text);
}

.search {
  grid-area: search;
  position: relative;
  min-width: 0;
}

.search__icon {
  position: absolute;
  top: var(--sp-3);
  left: var(--sp-2);
  color: var(--muted);
  pointer-events: none;
}

.search__input {
  width: 100%;
  height: 40px;
  padding: 0 var(--sp-3) 0 var(--sp-6);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: 16px;
  transition: border-color 0.16s var(--ease), background-color 0.16s var(--ease);
}

.search__input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.search__input:hover {
  border-color: var(--border-strong);
}

.search__input:focus-visible {
  border-color: var(--accent);
  outline-offset: 0;
  outline-width: 1px;
}

@media (min-width: 960px) {
  :root {
    --gutter: var(--sp-6);
    --header-h: 65px;
  }

  .site-header__inner {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "brand search nav";
    column-gap: var(--sp-6);
    height: 64px;
    padding-bottom: 0;
  }

  .site-header__inner--bare {
    grid-template-columns: auto;
    grid-template-areas: "brand";
  }

  .search {
    max-width: 480px;
    width: 100%;
  }

  .search__input {
    font-size: 14px;
  }

  .site-nav {
    gap: var(--sp-2);
  }

  .site-nav a {
    min-height: 40px;
    padding-inline: var(--sp-3);
  }
}

/* Hero */

.hero {
  display: grid;
  gap: var(--sp-4);
  padding-block: var(--sp-5) var(--sp-4);
}

.hero__title {
  font-size: clamp(1.875rem, 1.45rem + 2vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.hero__lede {
  max-width: 56ch;
  margin-top: var(--sp-3);
  color: var(--muted);
  font-size: 16px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  padding-top: var(--sp-4);
}

.stat {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  min-height: 48px;
}

.stat + .stat {
  padding-left: var(--sp-4);
  border-left: 1px solid var(--border);
}

.stat dt {
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.stat dd {
  min-height: 28px;
  font: 600 20px/28px var(--font-head);
  letter-spacing: -0.01em;
}

@media (min-width: 960px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: var(--sp-7);
    padding-block: var(--sp-7) var(--sp-6);
  }

  .hero__lede {
    font-size: 18px;
  }

  .stats {
    grid-template-columns: repeat(3, 120px);
    padding-top: 0;
    border-top: 0;
  }

  .stat dd {
    min-height: 32px;
    font-size: 24px;
    line-height: 32px;
    letter-spacing: -0.02em;
  }
}

/* Filter bar */

.catalog {
  flex: 1;
  min-height: calc(100vh - var(--header-h));
  scroll-margin-top: var(--header-h);
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "pills pills"
    "title sort";
  align-items: center;
  column-gap: var(--sp-4);
  row-gap: var(--sp-3);
  padding-block: var(--sp-2) var(--sp-4);
}

.pills-wrap {
  grid-area: pills;
  position: relative;
  min-width: 0;
}

.pills {
  display: flex;
  gap: var(--sp-2);
  margin-inline: calc(var(--gutter) * -1);
  padding: var(--sp-1) var(--gutter);
  overflow-x: auto;
  scroll-padding-inline: var(--sp-7);
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.pills::-webkit-scrollbar {
  display: none;
}

.pill {
  flex: none;
  height: 36px;
  padding-inline: var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease), background-color 0.16s var(--ease);
}

.pill:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.pill[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

.pill[aria-pressed="true"]:hover {
  border-color: var(--accent-2);
  background: var(--accent-2);
}

.pill--skeleton {
  width: 72px;
  border-color: transparent;
  background: var(--surface-2);
  cursor: default;
  animation: sk-pulse 1.6s ease-in-out infinite;
}

.pills-nav {
  display: none;
}

.sort {
  grid-area: sort;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.sort__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.sort__select {
  appearance: none;
  height: 40px;
  padding: 0 var(--sp-6) 0 var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%238b93a7' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='m2.5 4.5 3.5 3.5 3.5-3.5'/%3E%3C/svg%3E") no-repeat right var(--sp-3) center;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.16s var(--ease);
}

.sort__select:hover {
  border-color: var(--border-strong);
}

.results-title {
  grid-area: title;
  min-width: 0;
}

.results-title h2 {
  overflow: hidden;
  font-size: 18px;
  line-height: 24px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.results-title__count {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@media (min-width: 480px) {
  .sort__label {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
    color: var(--muted);
    font-size: 14px;
    white-space: nowrap;
  }
}

@media (min-width: 960px) {
  .filter-bar {
    row-gap: var(--sp-4);
  }

  .pills {
    margin-inline: calc(var(--sp-1) * -1);
    padding-inline: var(--sp-1);
  }

  .results-title {
    display: flex;
    align-items: baseline;
    gap: var(--sp-3);
  }

  .results-title h2 {
    flex: none;
    max-width: 60%;
  }
}

@media (hover: hover) and (pointer: fine) {
  .pills-nav:not([hidden]) {
    position: absolute;
    top: var(--sp-1);
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--surface-2);
    color: var(--text);
    box-shadow: 0 0 0 var(--sp-2) var(--bg);
    cursor: pointer;
    transition: border-color 0.16s var(--ease);
  }

  .pills-nav:hover {
    border-color: var(--border-strong);
  }

  .pills-nav--prev {
    left: 0;
  }

  .pills-nav--next {
    right: 0;
  }
}

/* Game cards */

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-4);
}

@media (min-width: 600px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grid--related {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  transition: transform 0.16s var(--ease), border-color 0.16s var(--ease);
}

.card:not(.card--skeleton):focus-within {
  border-color: var(--accent-line);
}

@media (hover: hover) {
  .card:not(.card--skeleton):hover {
    border-color: var(--accent-line);
    transform: translateY(-2px);
  }
}

.card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 11px;
  text-decoration: none;
}

.media {
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
}

.media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card__cover {
  aspect-ratio: 16 / 9;
  border-radius: 11px 11px 0 0;
}

.tile {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #f4f6fb;
  font: 600 32px/1 var(--font-head);
  letter-spacing: 0.02em;
}

.card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: var(--sp-3);
}

.card__name {
  overflow: hidden;
  font: 600 16px/24px var(--font-head);
  letter-spacing: -0.005em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.card__publisher {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  min-height: 24px;
  margin-top: var(--sp-2);
}

.card__plays {
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chip {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

a.chip {
  text-decoration: none;
  transition: color 0.16s var(--ease), background-color 0.16s var(--ease);
}

a.chip:hover {
  background: var(--border);
  color: var(--text);
}

/* Skeletons */

.sk,
.sk-bar {
  background: var(--surface-2);
  animation: sk-pulse 1.6s ease-in-out infinite;
}

.sk-bar {
  display: inline-block;
  height: 0.7em;
  border-radius: var(--r-sm);
  vertical-align: middle;
}

.sk-bar--full { width: 100%; }
.sk-bar--70 { width: 70%; }
.sk-bar--45 { width: 45%; }
.sk-bar--30 { width: 30%; }
.sk-bar--stat { width: 56px; }
.sk-bar--crumb { width: 160px; }
.sk-bar--meta { width: 88px; }

@keyframes sk-pulse {
  50% {
    opacity: 0.5;
  }
}

/* Catalog states and pagination */

.state {
  max-width: 560px;
  padding-block: var(--sp-7);
}

.state__title {
  font-size: 20px;
  line-height: 28px;
}

.state__body {
  margin-top: var(--sp-2);
  color: var(--muted);
}

.state__action {
  margin-top: var(--sp-5);
}

.state--error .state__title {
  color: var(--danger);
}

.load-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  padding-block: var(--sp-6) var(--sp-4);
}

.load-more__count {
  color: var(--muted);
  font-size: 13px;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 44px;
  padding: var(--sp-2) var(--sp-5);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: background-color 0.16s var(--ease), border-color 0.16s var(--ease), color 0.16s var(--ease);
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn--primary:hover {
  background: var(--accent-2);
}

.btn--secondary {
  border-color: var(--border);
  background: var(--surface-2);
  color: var(--text);
}

.btn--secondary:hover {
  border-color: var(--border-strong);
  background: var(--border);
}

.btn--block {
  width: 100%;
}

.btn-placeholder {
  display: block;
  width: 100%;
  height: 44px;
  border-radius: var(--r-sm);
}

/* Game page */

.game-page {
  flex: 1;
  padding-block: var(--sp-4) var(--sp-7);
}

.breadcrumb ol {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--muted);
  font-size: 13px;
  line-height: 24px;
  white-space: nowrap;
}

.breadcrumb li {
  flex: none;
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: var(--sp-2);
  color: var(--border-strong);
}

.breadcrumb li:not(:first-child):not([aria-current]) {
  display: flex;
  max-width: 40%;
  min-width: 0;
}

.breadcrumb li + li::before {
  flex: none;
}

.breadcrumb li[aria-current] {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
}

.breadcrumb a {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: var(--r-sm);
  text-underline-offset: 3px;
  text-decoration: none;
  transition: color 0.16s var(--ease);
}

.breadcrumb a:hover {
  color: var(--text);
  text-decoration: underline;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-6);
  margin-top: var(--sp-4);
}

.game-head {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  column-gap: var(--sp-4);
  row-gap: var(--sp-4);
}

.game-head__icon {
  width: 96px;
  height: 96px;
  border-radius: var(--r-lg);
}

.game-head__icon .tile {
  font-size: 32px;
}

.game-head__name {
  font-size: 24px;
  line-height: 32px;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.game-head__publisher {
  margin-top: var(--sp-1);
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
  overflow-wrap: anywhere;
}

.game-head__publisher a {
  border-radius: var(--r-sm);
  color: var(--text);
  text-decoration: none;
  transition: color 0.16s var(--ease);
}

.game-head__publisher a:hover {
  color: var(--accent-2);
}

.game-meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-4);
  min-height: 24px;
  color: var(--muted);
  font-size: 14px;
}

.game-meta li {
  max-width: 100%;
  line-height: 24px;
}

.game-meta .chip {
  display: block;
}

.game-meta strong {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.game-head__action {
  grid-column: 1 / -1;
}

.game-section {
  margin-top: var(--sp-6);
}

.game-section h2,
.related h2 {
  font-size: 20px;
  line-height: 28px;
}

/* Reserves room for a typical summary plus tags, so loading never pushes Details down. */
.game-about {
  min-height: 120px;
  margin-top: var(--sp-3);
}

.game-summary {
  max-width: 68ch;
}

.game-summary .sk-bar {
  display: block;
  margin-top: var(--sp-2);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}

.info-table {
  width: 100%;
  margin-top: var(--sp-3);
  border-collapse: collapse;
  border-top: 1px solid var(--border);
  font-size: 14px;
}

.info-table tr {
  border-bottom: 1px solid var(--border);
}

.info-table th,
.info-table td {
  height: 44px;
  padding-block: var(--sp-2);
  vertical-align: middle;
  text-align: left;
}

.info-table th {
  width: 40%;
  padding-right: var(--sp-4);
  color: var(--muted);
  font-weight: 400;
}

.info-table td {
  font-weight: 500;
  overflow-wrap: anywhere;
}

.info-table .is-missing {
  color: var(--muted);
  font-weight: 400;
}

.panel {
  padding: var(--sp-5);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.panel__title {
  font-size: 18px;
  line-height: 24px;
  overflow-wrap: anywhere;
}

.panel__action {
  margin-top: var(--sp-4);
}

.panel__list {
  display: grid;
  gap: var(--sp-3);
  margin-top: var(--sp-5);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
}

.panel__list li {
  position: relative;
  padding-left: var(--sp-4);
}

.panel__list li::before {
  content: "";
  position: absolute;
  top: var(--sp-2);
  left: 0;
  width: var(--sp-1);
  height: var(--sp-1);
  border-radius: 50%;
  background: var(--muted);
}

.related {
  margin-top: var(--sp-7);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--border);
}

.related .grid {
  margin-top: var(--sp-4);
}

.game-layout--solo {
  grid-template-columns: minmax(0, 1fr);
}

.game-state {
  max-width: 560px;
  padding-block: var(--sp-7);
}

.game-state h1 {
  font-size: 30px;
  line-height: 36px;
  letter-spacing: -0.02em;
}

.game-state--error h1 {
  color: var(--danger);
}

@media (min-width: 960px) {
  .game-page {
    padding-top: var(--sp-5);
  }

  .game-layout:not(.game-layout--solo) {
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: var(--sp-7);
    align-items: start;
  }

  .game-layout {
    margin-top: var(--sp-5);
  }

  .game-aside {
    position: sticky;
    top: calc(var(--header-h) + var(--sp-4));
  }

  .game-head {
    grid-template-columns: 128px minmax(0, 1fr);
    column-gap: var(--sp-5);
  }

  .game-head__icon {
    width: 128px;
    height: 128px;
  }

  .game-head__icon .tile {
    font-size: 40px;
  }

  .game-head__name {
    font-size: 36px;
    line-height: 40px;
  }

  .game-head__publisher {
    margin-top: var(--sp-2);
    font-size: 16px;
  }

  .game-head__action {
    display: none;
  }

  .game-about {
    min-height: 96px;
  }

  .game-summary {
    font-size: 17px;
  }
}

/* Footer */

.site-footer {
  margin-top: var(--sp-8);
  padding-block: var(--sp-5);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.game-page + .site-footer {
  margin-top: 0;
}

/* Motion preferences */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .card:not(.card--skeleton):hover {
    transform: none;
  }
}

/* ---------- Cheat panel ---------- */

.cheat { display: flex; flex-direction: column; gap: var(--sp-4); }

.cheat-head { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }

.cheat-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
}
.cheat-badge--ready { background: rgb(34 197 94 / .12); border-color: var(--accent-line); color: var(--accent-2); }

.cheat-list { margin: 0; padding-left: 18px; color: var(--text); display: flex; flex-direction: column; gap: 6px; }

.cheat-note {
  margin: 0; padding: var(--sp-3) var(--sp-4);
  background: var(--surface-2); border-left: 3px solid var(--accent-line);
  border-radius: var(--r-sm); color: var(--muted); font-size: 14px;
}

.cheat-hint { margin: 0; color: var(--muted); font-size: 13px; }
.cheat-hint a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 2px; }
.cheat-hint--ok { color: var(--accent-2); }

.cheat .btn-row { display: flex; gap: var(--sp-3); flex-wrap: wrap; margin-top: var(--sp-1); }

.btn--small { padding: 8px 14px; font-size: 13px; }

.cheat-console {
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); padding: var(--sp-4);
}
.cheat-console > summary {
  cursor: pointer; font-weight: 600; color: var(--text); list-style: none;
  display: flex; align-items: center; gap: 8px;
}
.cheat-console > summary::-webkit-details-marker { display: none; }
.cheat-console > summary::before { content: "+"; color: var(--accent-2); font-weight: 700; }
.cheat-console[open] > summary::before { content: "\2212"; }

.cheat-steps { margin: var(--sp-3) 0 0; padding-left: 20px; color: var(--muted); font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.cheat-steps a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 2px; }
.cheat-steps code, .cheat-steps kbd {
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 5px;
  padding: 1px 6px; font-size: 12px; color: var(--text);
}
.cheat-steps strong { color: var(--text); }

.code-wrap { margin: var(--sp-3) 0 var(--sp-3); }
.code {
  margin: 0; max-height: 320px; overflow: auto;
  background: #0a0c11; border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: var(--sp-3); color: #cbd5e1;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre; tab-size: 2;
}
.code code { font: inherit; }

/* ---------- Language switcher ---------- */

.header-tools { display: flex; align-items: center; gap: var(--sp-4); }

.lang__select {
  appearance: none;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 8px 28px 8px 10px;
  font: 600 12px/1 Inter, system-ui, sans-serif;
  letter-spacing: .06em;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='none' stroke='%238b93a7' stroke-width='1.6' stroke-linecap='round' d='M1 1l4 4 4-4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 9px center;
}
.lang__select:hover { border-color: var(--accent-line); }
.lang__select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 720px) {
  .header-tools { gap: var(--sp-2); }
  .site-nav { display: none; }
}

/* ---------- Hero eyebrow ---------- */

.hero__eyebrow {
  margin: 0 0 var(--sp-3);
  font: 600 12px/1 Inter, system-ui, sans-serif;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-2);
}

/* ---------- How it works ---------- */

.howto { padding-bottom: var(--sp-7); }

.howto__title {
  font-size: 22px;
  letter-spacing: -.01em;
  margin: 0 0 var(--sp-4);
}

.howto__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-3);
}
@media (max-width: 780px) { .howto__list { grid-template-columns: 1fr; } }

.step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.step__art {
  width: 56px;
  height: 56px;
  border-radius: var(--r-md);
  background: rgb(34 197 94 / .10);
  border: 1px solid var(--accent-line);
  display: grid;
  place-items: center;
  color: var(--accent-2);
  margin-bottom: var(--sp-2);
}
.step__art svg { width: 34px; height: 34px; }

.step__num {
  position: absolute;
  top: var(--sp-3);
  right: var(--sp-3);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--muted);
  font: 600 11px/22px Inter, system-ui, sans-serif;
  text-align: center;
}

.step h3 { margin: 0; font-size: 15px; }
.step p { margin: 0; color: var(--muted); font-size: 14px; }

.howto__note {
  margin: var(--sp-3) 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- RTL ---------- */

html[dir="rtl"] .site-nav,
html[dir="rtl"] .search__icon { order: 0; }
html[dir="rtl"] .hero,
html[dir="rtl"] .step { text-align: right; }
html[dir="rtl"] .step__num { right: auto; left: var(--sp-3); }
html[dir="rtl"] .lang__select { background-position: left 9px center; padding: 8px 10px 8px 28px; }

/* Header layout with language switcher */
.header-tools { justify-self: end; }
@media (max-width: 960px) {
  .site-header__inner { grid-template-columns: minmax(0, 1fr) auto; }
  .site-nav a { padding-inline: var(--sp-2); font-size: 13px; }
  .header-tools { gap: var(--sp-2); }
}

/* ---------- Install page ---------- */

.install-page { padding-top: var(--sp-6); padding-bottom: var(--sp-8); }

.install-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: var(--sp-6);
  align-items: start;
}
@media (max-width: 900px) { .install-grid { grid-template-columns: 1fr; } }

.install-title { font-size: 38px; line-height: 1.1; letter-spacing: -.02em; margin: 0 0 var(--sp-3); }
.install-lede { color: var(--muted); font-size: 16px; max-width: 60ch; margin: 0 0 var(--sp-5); }

.install-shot {
  margin: 0 0 var(--sp-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-3);
}
.install-shot svg { width: 100%; height: auto; display: block; border-radius: var(--r-md); }
.install-shot figcaption { color: var(--muted); font-size: 13px; margin-top: var(--sp-3); }

.install-h2 { font-size: 20px; margin: var(--sp-6) 0 var(--sp-3); }

.steps-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.steps-list li { display: flex; gap: var(--sp-3); align-items: flex-start; }
.steps-list span {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: rgb(34 197 94 / .14); border: 1px solid var(--accent-line);
  color: var(--accent-2); font: 600 12px/26px Inter, sans-serif; text-align: center;
}
.steps-list p { margin: 2px 0 0; color: var(--text); }

.faq { border-bottom: 1px solid var(--border); padding: var(--sp-3) 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { color: var(--muted); margin: var(--sp-2) 0 0; }

.install-side { position: sticky; top: var(--sp-5); }
.install-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--sp-4);
  display: flex; flex-direction: column; gap: var(--sp-3);
}
.install-card__label { margin: 0; font: 600 11px/1 Inter, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-2); }
.install-card__version { margin: 0; color: var(--muted); font-size: 12px; }
.install-card .btn { width: 100%; }
.install-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.install-facts { margin: 0; padding-left: 16px; color: var(--muted); font-size: 12px; display: flex; flex-direction: column; gap: 4px; }

.nav-install {
  font: 600 13px/1 Inter, sans-serif;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  background: rgb(34 197 94 / .12);
  border: 1px solid var(--accent-line);
  color: var(--accent-2);
}
.nav-install:hover { background: rgb(34 197 94 / .2); }

/* Header grid: brand | search | nav | tools */
@media (min-width: 961px) {
  .site-header__inner {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "brand search nav tools";
  }
  .header-tools { grid-area: tools; }
}
@media (max-width: 960px) {
  .site-header__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand tools" "search search";
  }
  .site-nav { display: none; }
  .header-tools { grid-area: tools; }
}
