/* ==========================================================================
   Retro Arcade Hub — Global design system
   Dark arcade-cabinet aesthetic with modern, readable typography.
   Retro styling is applied to decorative chrome (headings, buttons, score
   readouts); body copy uses a highly legible system font stack.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Surfaces — deep navy/near-black arcade cabinet interior */
  --c-bg:            #0b0d1a;
  --c-bg-alt:        #11142a;
  --c-surface:       #171a35;
  --c-surface-2:     #1f2344;
  --c-surface-3:     #2a2f57;
  --c-line:          #313765;
  --c-line-soft:     #262b52;

  /* Text — kept well above WCAG AA on every surface above */
  --c-text:          #eef1ff;
  --c-text-soft:     #b9c0e6;
  --c-text-mute:     #8f97c4;

  /* Neon accents */
  --c-cyan:          #4ad9ff;
  --c-cyan-deep:     #1aa7cc;
  --c-green:         #58f2a4;
  --c-yellow:        #ffd166;
  --c-amber:         #ffc857;
  --c-orange:        #ff8a3d;
  --c-magenta:       #ff5fc8;
  --c-violet:        #a97bff;
  --c-red:           #ff5d6c;

  /* Semantic roles */
  --c-primary:       var(--c-cyan);
  --c-primary-ink:   #04202b;
  --c-accent:        var(--c-magenta);
  --c-focus:         #ffd166;

  /* Category colours (used for badges, cards, thumbnails) */
  --cat-classic:     #ffc857;
  --cat-space:       #4ad9ff;
  --cat-platform:    #58f2a4;
  --cat-racing:      #ff8a3d;
  --cat-puzzle:      #a97bff;
  --cat-survival:    #ff5fc8;

  /* Difficulty colours */
  --diff-easy:       #58f2a4;
  --diff-medium:     #ffc857;
  --diff-hard:       #ff8a3d;
  --diff-expert:     #ff5d6c;

  /* Type */
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Chakra Petch", "Segoe UI Semibold", system-ui, sans-serif;
  --font-pixel: "Courier New", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --fs-xs:   0.78rem;
  --fs-sm:   0.875rem;
  --fs-base: 1rem;
  --fs-md:   1.075rem;
  --fs-lg:   1.25rem;
  --fs-xl:   1.5rem;
  --fs-2xl:  1.875rem;
  --fs-3xl:  2.35rem;
  --fs-4xl:  3rem;

  /* Space */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;

  /* Shape */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;
  --r-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, .45);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, .55);
  --glow-cyan: 0 0 0 1px rgba(74, 217, 255, .35), 0 0 22px rgba(74, 217, 255, .18);

  --wrap: 1200px;
  --wrap-narrow: 760px;
  --header-h: 62px;

  --ease: cubic-bezier(.4, 0, .2, 1);
  --dur: 180ms;
}

/* --------------------------------------------------------------------------
   2. Reset / base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Subtle pixel-grid texture — decorative only, very low contrast so it never
   interferes with text legibility. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(74, 217, 255, .028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74, 217, 255, .028) 1px, transparent 1px);
  background-size: 44px 44px;
}

body > * { position: relative; z-index: 1; }

img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .005em;
  margin: 0 0 var(--sp-4);
  color: var(--c-text);
}

h1 { font-size: clamp(1.85rem, 1.2rem + 2.6vw, var(--fs-4xl)); letter-spacing: -.01em; }
h2 { font-size: clamp(1.45rem, 1.1rem + 1.5vw, var(--fs-2xl)); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

p { margin: 0 0 var(--sp-4); }
p:last-child { margin-bottom: 0; }

a { color: var(--c-cyan); text-decoration: none; }
a:hover { color: #8ee8ff; text-decoration: underline; }

ul, ol { margin: 0 0 var(--sp-4); padding-left: 1.35rem; }
li { margin-bottom: var(--sp-2); }
li:last-child { margin-bottom: 0; }

strong { color: #fff; font-weight: 650; }

code, kbd, samp {
  font-family: var(--font-pixel);
  font-size: .92em;
}

kbd {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid var(--c-line);
  border-bottom-width: 2px;
  border-radius: var(--r-sm);
  background: var(--c-surface-2);
  color: var(--c-text);
  font-size: .82em;
  line-height: 1.5;
  white-space: nowrap;
}

hr { border: 0; border-top: 1px solid var(--c-line-soft); margin: var(--sp-6) 0; }

/* --------------------------------------------------------------------------
   3. Accessibility utilities
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -100px;
  z-index: 200;
  padding: var(--sp-3) var(--sp-5);
  background: var(--c-cyan);
  color: var(--c-primary-ink);
  font-weight: 700;
  border-radius: var(--r-md);
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: var(--sp-3); text-decoration: none; }

/* --------------------------------------------------------------------------
   4. Layout primitives
   -------------------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--sp-4); }
.wrap--narrow { max-width: var(--wrap-narrow); }

.section { padding-block: var(--sp-7); }
.section--tight { padding-block: var(--sp-6); }
.section--alt { background: var(--c-bg-alt); border-block: 1px solid var(--c-line-soft); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}
.section-head h2 { margin: 0; }
.section-head p { color: var(--c-text-soft); margin: 0; max-width: 62ch; }
.section-head__text { flex: 1 1 340px; }

.stack > * + * { margin-top: var(--sp-4); }

.grid {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.grid--wide { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* --------------------------------------------------------------------------
   5. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: var(--c-surface-2);
  color: var(--c-text);
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease),
              border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }

.btn--primary {
  background: linear-gradient(135deg, var(--c-cyan), #2bb7e0);
  color: var(--c-primary-ink);
  box-shadow: var(--glow-cyan);
}
.btn--primary:hover { background: linear-gradient(135deg, #6fe4ff, #35c6ef); color: var(--c-primary-ink); }

.btn--accent {
  background: linear-gradient(135deg, var(--c-magenta), #d63fa4);
  color: #2b0420;
}
.btn--accent:hover { color: #2b0420; }

.btn--ghost { background: transparent; border-color: var(--c-line); color: var(--c-text); }
.btn--ghost:hover { border-color: var(--c-cyan); background: rgba(74, 217, 255, .08); color: var(--c-text); }

.btn--sm { padding: var(--sp-2) var(--sp-4); min-height: 38px; font-size: var(--fs-xs); }
.btn--block { width: 100%; }

/* --------------------------------------------------------------------------
   6. Badges & pills
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  border: 1px solid currentColor;
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1.7;
  white-space: nowrap;
}
.badge--classic  { color: var(--cat-classic); }
.badge--space    { color: var(--cat-space); }
.badge--platform { color: var(--cat-platform); }
.badge--racing   { color: var(--cat-racing); }
.badge--puzzle   { color: var(--cat-puzzle); }
.badge--survival { color: var(--cat-survival); }

.badge--easy   { color: var(--diff-easy); }
.badge--medium { color: var(--diff-medium); }
.badge--hard   { color: var(--diff-hard); }
.badge--expert { color: var(--diff-expert); }

.badge--solid {
  border-color: transparent;
  background: var(--c-surface-3);
  color: var(--c-text-soft);
}

.tag-list { display: flex; flex-wrap: wrap; gap: var(--sp-2); list-style: none; padding: 0; margin: 0; }
.tag-list li { margin: 0; }
.tag {
  display: inline-block;
  padding: 8px 12px;
  line-height: 1.15;
  border-radius: var(--r-pill);
  background: var(--c-surface-2);
  border: 1px solid var(--c-line-soft);
  color: var(--c-text-soft);
  font-size: var(--fs-xs);
  text-decoration: none;
}
a.tag:hover { border-color: var(--c-cyan); color: var(--c-cyan); text-decoration: none; }

/* --------------------------------------------------------------------------
   7. Header / navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(11, 13, 26, .93);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--c-line-soft);
}

.site-header__bar {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  color: var(--c-text);
  text-decoration: none;
  flex: 0 0 auto;
}
.brand:hover { text-decoration: none; color: var(--c-text); }
.brand__mark {
  width: 34px; height: 34px;
  flex: 0 0 34px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--c-magenta), var(--c-violet) 45%, var(--c-cyan));
  display: grid;
  place-items: center;
  font-family: var(--font-pixel);
  font-weight: 700;
  font-size: 15px;
  color: #0b0d1a;
  box-shadow: 0 0 16px rgba(169, 123, 255, .35);
}
.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.06rem;
  letter-spacing: .02em;
  line-height: 1.1;
}
.brand__name span { display: block; font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: var(--c-text-mute); font-weight: 600; }

.nav { margin-left: auto; }
.nav__list {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__list li { margin: 0; }
.nav__link {
  display: block;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  color: var(--c-text-soft);
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.nav__link:hover { background: var(--c-surface-2); color: var(--c-text); text-decoration: none; }
.nav__link[aria-current="page"] { color: var(--c-cyan); background: rgba(74, 217, 255, .1); }

.header-actions { display: flex; align-items: center; gap: var(--sp-2); flex: 0 0 auto; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  background: var(--c-surface);
  color: var(--c-text-soft);
  cursor: pointer;
  padding: 0;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.icon-btn:hover { color: var(--c-cyan); border-color: var(--c-cyan); }
.icon-btn svg { width: 19px; height: 19px; }

.nav-toggle { display: none; }

/* Mobile drawer */
@media (max-width: 900px) {
  .nav-toggle { display: inline-grid; }
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    margin: 0;
    background: var(--c-bg-alt);
    border-bottom: 1px solid var(--c-line);
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility var(--dur);
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0; padding: var(--sp-3) var(--sp-4) var(--sp-5); }
  .nav__link { padding: var(--sp-3) var(--sp-3); font-size: var(--fs-md); border-radius: var(--r-md); }
  .nav__list li + li { border-top: 1px solid var(--c-line-soft); }
}

/* --------------------------------------------------------------------------
   8. Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: var(--sp-7) var(--sp-7);
  background:
    radial-gradient(900px 420px at 15% -10%, rgba(169, 123, 255, .22), transparent 62%),
    radial-gradient(760px 380px at 88% 8%, rgba(74, 217, 255, .18), transparent 60%),
    linear-gradient(180deg, #0e1128, var(--c-bg));
  border-bottom: 1px solid var(--c-line-soft);
}

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

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
  padding: 4px 12px;
  border: 1px solid rgba(74, 217, 255, .4);
  border-radius: var(--r-pill);
  background: rgba(74, 217, 255, .08);
  color: var(--c-cyan);
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.hero h1 { margin-bottom: var(--sp-4); }
.hero h1 .accent {
  background: linear-gradient(100deg, var(--c-cyan), var(--c-violet) 55%, var(--c-magenta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lede { font-size: var(--fs-md); color: var(--c-text-soft); max-width: 60ch; margin-bottom: var(--sp-5); }
.hero__cta { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-bottom: var(--sp-5); }

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-5);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--c-line-soft);
  list-style: none;
  margin: 0;
  padding-left: 0;
}
.hero__stats li { margin: 0; }
.hero__stats b {
  display: block;
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  color: var(--c-cyan);
  line-height: 1.1;
}
.hero__stats span { font-size: var(--fs-xs); color: var(--c-text-mute); text-transform: uppercase; letter-spacing: .1em; }

/* Arcade cabinet decorative panel */
.cabinet {
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--c-surface), #0e1026);
  padding: var(--sp-4);
  box-shadow: var(--shadow-lg);
}
.cabinet__screen {
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--c-line);
  background: #05060f;
  aspect-ratio: 4 / 3;
}
.cabinet__screen img, .cabinet__screen svg { width: 100%; height: 100%; object-fit: cover; }
.cabinet__panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--c-line-soft);
  font-family: var(--font-pixel);
  font-size: var(--fs-xs);
  color: var(--c-text-mute);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.cabinet__dots { display: flex; gap: 6px; }
.cabinet__dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--c-surface-3); }
.cabinet__dots i:nth-child(1) { background: var(--c-magenta); }
.cabinet__dots i:nth-child(2) { background: var(--c-amber); }
.cabinet__dots i:nth-child(3) { background: var(--c-green); }

/* --------------------------------------------------------------------------
   9. Game cards
   -------------------------------------------------------------------------- */
.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--c-line-soft);
  border-radius: var(--r-lg);
  background: var(--c-surface);
  overflow: hidden;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.game-card:hover, .game-card:focus-within {
  transform: translateY(-4px);
  border-color: var(--c-line);
  box-shadow: var(--shadow-md);
}

.game-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--c-bg-alt);
  overflow: hidden;
}
.game-card__media img { width: 100%; height: 100%; object-fit: cover; }

.game-card__fav {
  position: absolute;
  top: var(--sp-2);
  right: var(--sp-2);
  z-index: 2;
  width: 38px; height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--c-line);
  border-radius: 50%;
  background: rgba(11, 13, 26, .78);
  backdrop-filter: blur(4px);
  color: var(--c-text-soft);
  cursor: pointer;
  padding: 0;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.game-card__fav:hover { color: var(--c-magenta); border-color: var(--c-magenta); transform: scale(1.08); }
.game-card__fav[aria-pressed="true"] { color: var(--c-magenta); border-color: var(--c-magenta); }
.game-card__fav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.game-card__fav[aria-pressed="true"] svg { fill: currentColor; }

.game-card__body { display: flex; flex-direction: column; flex: 1; padding: var(--sp-4); gap: var(--sp-3); }
.game-card__meta { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.game-card__title { font-size: var(--fs-lg); margin: 0; }
.game-card__title a { color: var(--c-text); text-decoration: none; }
.game-card__title a:hover { color: var(--c-cyan); }
/* Make the whole card clickable while keeping the favourite button usable. */
.game-card__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.game-card__desc { margin: 0; font-size: var(--fs-sm); color: var(--c-text-soft); }
.game-card__foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--c-line-soft);
  font-size: var(--fs-xs);
  color: var(--c-text-mute);
}
.game-card__best { font-family: var(--font-pixel); color: var(--c-amber); letter-spacing: .04em; }

.game-card--compact .game-card__media { aspect-ratio: 16 / 10; }

/* --------------------------------------------------------------------------
   10. Category cards
   -------------------------------------------------------------------------- */
.cat-card {
  position: relative;
  display: block;
  padding: var(--sp-5);
  border: 1px solid var(--c-line-soft);
  border-left: 3px solid var(--cat-color, var(--c-cyan));
  border-radius: var(--r-lg);
  background: var(--c-surface);
  color: var(--c-text);
  text-decoration: none;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
}
.cat-card:hover { transform: translateY(-3px); background: var(--c-surface-2); color: var(--c-text); text-decoration: none; }
.cat-card h3 { margin: 0 0 var(--sp-2); font-size: var(--fs-lg); color: var(--cat-color, var(--c-cyan)); }
.cat-card p { margin: 0 0 var(--sp-3); font-size: var(--fs-sm); color: var(--c-text-soft); }
.cat-card__count { font-family: var(--font-pixel); font-size: var(--fs-xs); color: var(--c-text-mute); letter-spacing: .08em; text-transform: uppercase; }

/* --------------------------------------------------------------------------
   11. Panels, prose, FAQ
   -------------------------------------------------------------------------- */
.panel {
  border: 1px solid var(--c-line-soft);
  border-radius: var(--r-lg);
  background: var(--c-surface);
  padding: var(--sp-5);
}
.panel--flush { padding: 0; overflow: hidden; }

.prose { color: var(--c-text-soft); }
.prose h2 { margin-top: var(--sp-7); color: var(--c-text); }
.prose h3 { margin-top: var(--sp-6); color: var(--c-text); }
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose p, .prose li { font-size: var(--fs-md); }
.prose a { text-decoration: underline; text-underline-offset: 2px; }
.prose > ul, .prose > ol { margin-bottom: var(--sp-5); }
.prose blockquote {
  margin: var(--sp-5) 0;
  padding: var(--sp-4) var(--sp-5);
  border-left: 3px solid var(--c-violet);
  background: var(--c-surface);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  color: var(--c-text);
}
.prose blockquote p:last-child { margin-bottom: 0; }

.table-wrap { overflow-x: auto; margin-bottom: var(--sp-5); -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); min-width: 420px; }
th, td { padding: var(--sp-3); text-align: left; border-bottom: 1px solid var(--c-line-soft); vertical-align: top; }
th { font-family: var(--font-display); color: var(--c-text); background: var(--c-surface-2); font-weight: 700; }
td { color: var(--c-text-soft); }
tbody tr:last-child td { border-bottom: 0; }

.faq-item {
  border: 1px solid var(--c-line-soft);
  border-radius: var(--r-md);
  background: var(--c-surface);
  margin-bottom: var(--sp-3);
  overflow: hidden;
}
.faq-item > summary {
  padding: var(--sp-4);
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-md);
  color: var(--c-text);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after {
  content: "+";
  font-family: var(--font-pixel);
  font-size: 1.35rem;
  line-height: 1;
  color: var(--c-cyan);
  flex: 0 0 auto;
}
.faq-item[open] > summary::after { content: "\2212"; }
.faq-item > summary:hover { background: var(--c-surface-2); }
.faq-item__body { padding: 0 var(--sp-4) var(--sp-4); color: var(--c-text-soft); }

/* Feature / benefit list */
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-4); }
.feature-list li { margin: 0; padding-left: 1.9rem; position: relative; color: var(--c-text-soft); }
.feature-list li::before {
  content: "\25B8";
  position: absolute;
  left: 0; top: 0;
  color: var(--c-green);
  font-size: 1.1em;
}
.feature-list b { display: block; color: var(--c-text); font-family: var(--font-display); }

/* --------------------------------------------------------------------------
   12. Breadcrumbs
   -------------------------------------------------------------------------- */
.breadcrumb { padding-block: var(--sp-4) 0; }
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  list-style: none;
  margin: 0; padding: 0;
  font-size: var(--fs-xs);
  color: var(--c-text-mute);
}
.breadcrumb li { margin: 0; display: flex; align-items: center; gap: var(--sp-2); }
.breadcrumb li + li::before { content: "/"; color: var(--c-line); }
/* Breadcrumbs are navigation, not prose, so the links get a real tap area
   rather than the ~20px a bare inline link would have. */
.breadcrumb a {
  color: var(--c-text-mute);
  display: inline-block;
  padding: 7px 4px;
  border-radius: var(--r-sm);
}
.breadcrumb a:hover { color: var(--c-cyan); background: var(--c-surface); }
.breadcrumb [aria-current="page"] { padding: 7px 4px; display: inline-block; }
.breadcrumb [aria-current="page"] { color: var(--c-text-soft); }

/* --------------------------------------------------------------------------
   13. Forms & controls
   -------------------------------------------------------------------------- */
label { display: block; margin-bottom: var(--sp-2); font-family: var(--font-display); font-size: var(--fs-sm); font-weight: 600; color: var(--c-text); }

input[type="text"], input[type="email"], input[type="search"], select, textarea {
  width: 100%;
  padding: var(--sp-3);
  min-height: 44px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  background: var(--c-bg-alt);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
}
input::placeholder, textarea::placeholder { color: var(--c-text-mute); }
input:focus, select:focus, textarea:focus { border-color: var(--c-cyan); outline-offset: 0; }
textarea { min-height: 150px; resize: vertical; }
select {
  appearance: none;
  padding-right: 2.2rem;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%238f97c4' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.field { margin-bottom: var(--sp-4); }
.field__error { display: none; margin-top: var(--sp-2); font-size: var(--fs-sm); color: var(--c-red); }
.field.is-invalid input, .field.is-invalid textarea { border-color: var(--c-red); }
.field.is-invalid .field__error { display: block; }

.form-note {
  padding: var(--sp-4);
  border: 1px dashed var(--c-line);
  border-radius: var(--r-md);
  background: var(--c-bg-alt);
  font-size: var(--fs-sm);
  color: var(--c-text-soft);
}

.form-status { margin-top: var(--sp-4); font-size: var(--fs-sm); }
.form-status:empty { margin-top: 0; }

/* Search box */
.searchbar { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.searchbar input { flex: 1 1 240px; }

/* Filter bar */
.filters {
  display: grid;
  gap: var(--sp-4);
  padding: var(--sp-4);
  border: 1px solid var(--c-line-soft);
  border-radius: var(--r-lg);
  background: var(--c-surface);
  margin-bottom: var(--sp-5);
}
.filters__row { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: end; }
.filters__group { flex: 1 1 190px; min-width: 0; }
.filters__group label { margin-bottom: var(--sp-2); }
.filters__chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip {
  padding: var(--sp-2) var(--sp-4);
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--c-line);
  border-radius: var(--r-pill);
  background: var(--c-bg-alt);
  color: var(--c-text-soft);
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.chip:hover { color: var(--c-text); border-color: var(--c-cyan); }
.chip[aria-pressed="true"] { background: rgba(74, 217, 255, .12); border-color: var(--c-cyan); color: var(--c-cyan); }

.results-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  font-size: var(--fs-sm);
  color: var(--c-text-mute);
}

.empty-state {
  padding: var(--sp-7) var(--sp-5);
  text-align: center;
  border: 1px dashed var(--c-line);
  border-radius: var(--r-lg);
  color: var(--c-text-soft);
}
.empty-state h2,
.empty-state h3 { color: var(--c-text); font-size: var(--fs-xl); }

/* --------------------------------------------------------------------------
   14. Ad slots — clearly labelled, never disguised as UI
   -------------------------------------------------------------------------- */
.ad-slot {
  display: block;
  margin: var(--sp-6) auto;
  padding: var(--sp-3);
  max-width: 970px;
  min-height: 100px;
  border: 1px dashed var(--c-line-soft);
  border-radius: var(--r-md);
  background: var(--c-bg-alt);
  text-align: center;
}
.ad-slot::before {
  content: "Advertisement";
  display: block;
  margin-bottom: var(--sp-2);
  font-size: 0.68rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--c-text-mute);
}
.ad-slot--inline { max-width: 100%; min-height: 90px; }

/* --------------------------------------------------------------------------
   15. Author box / E-E-A-T
   -------------------------------------------------------------------------- */
.author-box {
  display: flex;
  gap: var(--sp-4);
  align-items: flex-start;
  padding: var(--sp-5);
  border: 1px solid var(--c-line-soft);
  border-radius: var(--r-lg);
  background: var(--c-surface);
}
.author-box img {
  width: 72px; height: 72px;
  flex: 0 0 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--c-line);
}
.author-box__name { margin: 0 0 2px; font-size: var(--fs-md); }
.author-box__role { margin: 0 0 var(--sp-3); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .1em; color: var(--c-cyan); }
.author-box p { font-size: var(--fs-sm); color: var(--c-text-soft); }

.byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-4);
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--c-line-soft);
  font-size: var(--fs-sm);
  color: var(--c-text-mute);
}
.byline img { width: 34px; height: 34px; border-radius: 50%; }
.byline__who { display: flex; align-items: center; gap: var(--sp-2); }
/* Give the author link a real tap area — it sits in a navigation-like row
   rather than inside a sentence. */
.byline a { display: inline-block; padding: 6px 4px; border-radius: var(--r-sm); }
.byline a:hover { background: var(--c-surface); }

.notice {
  padding: var(--sp-4);
  border-left: 3px solid var(--c-amber);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  background: rgba(255, 200, 87, .07);
  font-size: var(--fs-sm);
  color: var(--c-text-soft);
}
.notice--info { border-left-color: var(--c-cyan); background: rgba(74, 217, 255, .07); }
.notice strong { color: var(--c-text); }

/* --------------------------------------------------------------------------
   16. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: var(--sp-8);
  padding-top: var(--sp-7);
  background: #080a16;
  border-top: 1px solid var(--c-line-soft);
  color: var(--c-text-mute);
  font-size: var(--fs-sm);
}
.site-footer__grid {
  display: grid;
  gap: var(--sp-6);
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  padding-bottom: var(--sp-6);
}
.site-footer__brand { grid-column: 1 / -1; max-width: 46ch; }
@media (min-width: 960px) { .site-footer__brand { grid-column: span 2; } }
.site-footer h3 {
  font-size: var(--fs-xs);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--c-text);
  margin-bottom: var(--sp-3);
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: var(--sp-2); }
.site-footer a { color: var(--c-text-mute); }
.site-footer a:hover { color: var(--c-cyan); }
.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  justify-content: space-between;
  align-items: center;
  padding-block: var(--sp-4);
  border-top: 1px solid var(--c-line-soft);
  font-size: var(--fs-xs);
}

/* --------------------------------------------------------------------------
   17. 404
   -------------------------------------------------------------------------- */
.gameover {
  text-align: center;
  padding-block: var(--sp-8);
}
.gameover h1 {
  font-family: var(--font-pixel);
  font-size: clamp(2rem, 1rem + 6vw, 3.6rem);
  color: var(--c-red);
  letter-spacing: .04em;
  text-shadow: 0 0 24px rgba(255, 93, 108, .4);
}
.gameover__actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); justify-content: center; margin-top: var(--sp-5); }

/* --------------------------------------------------------------------------
   18. Misc helpers
   -------------------------------------------------------------------------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-5 { margin-top: var(--sp-5); }
.mt-6 { margin-top: var(--sp-6); }
.muted { color: var(--c-text-mute); }
.lead { font-size: var(--fs-md); color: var(--c-text-soft); }
.is-hidden { display: none !important; }

.pill-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 16px);
  z-index: 200;
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-pill);
  background: var(--c-surface-3);
  border: 1px solid var(--c-line);
  color: var(--c-text);
  font-size: var(--fs-sm);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility var(--dur);
}
.toast.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* --------------------------------------------------------------------------
   19. Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .game-card:hover, .btn:hover, .cat-card:hover { transform: none; }
}
