/* ==========================================================================
   Cat Arcade - core design system
   Light-first with a dark theme, driven entirely by custom properties.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
  /* Colour - light theme */
  --bg: #fffaf5;
  --bg-alt: #fff3e8;
  --surface: #ffffff;
  --surface-2: #fff6ee;
  --surface-3: #ffeddd;
  --ink: #2b1d14;
  --ink-2: #6b5445;
  --ink-3: #8a7365;
  --line: #f0e0d1;
  --line-strong: #e2cdb8;

  --primary: #b8431a;
  --primary-hover: #9b3714;
  --primary-ink: #ffffff;
  --brand: #ff8a4c;
  --brand-soft: #ffe3cf;

  --accent: #1f7a6f;
  --accent-soft: #d6f0ec;
  --violet: #6b4ea8;
  --violet-soft: #ece5fa;
  --blue: #2a6fb0;
  --blue-soft: #dceaf7;
  --gold: #8a6100;
  --gold-soft: #fbeec6;

  --ok: #1f6f43;
  --warn: #8a5a00;
  --focus: #1b4ed8;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(58, 36, 20, 0.06), 0 1px 3px rgba(58, 36, 20, 0.05);
  --shadow-md: 0 2px 6px rgba(58, 36, 20, 0.07), 0 8px 20px rgba(58, 36, 20, 0.07);
  --shadow-lg: 0 6px 16px rgba(58, 36, 20, 0.09), 0 18px 44px rgba(58, 36, 20, 0.1);

  /* Radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --r-pill: 999px;

  /* Spacing scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 88px;

  /* Type */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  --container: 1240px;
  --measure: 72ch;
  --header-h: 68px;
}

:root[data-theme="dark"] {
  --bg: #15100c;
  --bg-alt: #1b1410;
  --surface: #1f1813;
  --surface-2: #261d17;
  --surface-3: #30241c;
  --ink: #f8efe6;
  --ink-2: #cbb5a3;
  --ink-3: #a68f7d;
  --line: #3a2c23;
  --line-strong: #4a382c;

  --primary: #ff9a5e;
  --primary-hover: #ffb183;
  --primary-ink: #24160d;
  --brand: #ff9a5e;
  --brand-soft: #3d2718;

  --accent: #63d3c3;
  --accent-soft: #14332f;
  --violet: #b9a3f0;
  --violet-soft: #2a2140;
  --blue: #86bdf0;
  --blue-soft: #16293a;
  --gold: #f0c65a;
  --gold-soft: #3a2e10;

  --ok: #6fd39a;
  --warn: #f0c65a;
  --focus: #93b4ff;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 10px 34px rgba(0, 0, 0, 0.55);
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

img,
svg,
canvas {
  max-width: 100%;
}

/* Several components set an explicit display, which would otherwise override
   the hidden attribute the filters and panels rely on. */
[hidden] {
  display: none !important;
}

img {
  height: auto;
  display: block;
}

h1,
h2,
h3,
h4 {
  line-height: 1.2;
  margin: 0 0 var(--s-3);
  font-weight: 750;
  letter-spacing: -0.015em;
  color: var(--ink);
}

h1 {
  font-size: clamp(1.85rem, 1.25rem + 2.2vw, 2.9rem);
}
h2 {
  font-size: clamp(1.4rem, 1.15rem + 1.05vw, 1.95rem);
  margin-top: var(--s-6);
}
h3 {
  font-size: clamp(1.13rem, 1.03rem + 0.45vw, 1.35rem);
  margin-top: var(--s-5);
}
h4 {
  font-size: 1.03rem;
  margin-top: var(--s-4);
}

p {
  margin: 0 0 var(--s-4);
}

a {
  color: var(--primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

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

ul,
ol {
  margin: 0 0 var(--s-4);
  padding-left: 1.35em;
}

li {
  margin-bottom: var(--s-2);
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.1em 0.38em;
}

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

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

::selection {
  background: var(--brand-soft);
  color: var(--ink);
}

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

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--s-4);
  z-index: 100;
  background: var(--primary);
  color: var(--primary-ink);
  padding: var(--s-3) var(--s-4);
  border-radius: 0 0 var(--r-md) var(--r-md);
  font-weight: 650;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
  color: var(--primary-ink);
}

main:focus {
  outline: none;
}

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

.config-value {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--gold-soft);
  color: var(--gold);
  border: 1px dashed currentColor;
  border-radius: 6px;
  padding: 0.1em 0.45em;
}

/* --------------------------------------------------------------------------
   3. Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  font: inherit;
  font-weight: 650;
  line-height: 1.2;
  padding: 0.7em 1.25em;
  border-radius: var(--r-pill);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.16s ease, border-color 0.16s ease,
    color 0.16s ease, transform 0.16s ease;
  touch-action: manipulation;
  min-height: 44px;
}

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

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

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--ink-3);
}

.btn-sm {
  font-size: 0.92rem;
  padding: 0.5em 1em;
  min-height: 40px;
}

.btn-lg {
  font-size: 1.05rem;
  padding: 0.85em 1.6em;
  min-height: 52px;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--primary);
  text-decoration: underline;
  cursor: pointer;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.icon-btn:hover {
  background: var(--surface-2);
  border-color: var(--ink-3);
  color: var(--ink);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle .icon-moon {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

/* --------------------------------------------------------------------------
   4. Header & navigation
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--line);
}

@supports not (backdrop-filter: blur(10px)) {
  .site-header {
    background: var(--bg);
  }
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}

.brand:hover {
  color: var(--ink);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-weight: 800;
  font-size: 1.16rem;
  letter-spacing: -0.02em;
}

.brand-tag {
  font-size: 0.72rem;
  color: var(--ink-3);
  letter-spacing: 0.01em;
}

.primary-nav {
  margin-left: auto;
}

.primary-nav ul {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  list-style: none;
  margin: 0;
  padding: 0;
}

.primary-nav li {
  margin: 0;
  position: relative;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.55em 0.8em;
  border-radius: var(--r-md);
  color: var(--ink-2);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  background: none;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}

.nav-link:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.nav-link[aria-current="page"] {
  color: var(--primary);
  background: var(--brand-soft);
}

.nav-link .chev {
  width: 11px;
  height: 8px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  transition: transform 0.18s ease;
}

.nav-toggle-sub[aria-expanded="true"] .chev {
  transform: rotate(180deg);
}

.subnav {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 250px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--s-2);
  display: none;
  flex-direction: column;
  gap: 2px;
  list-style: none;
  margin: 0;
  z-index: 60;
}

.subnav.is-open {
  display: flex;
}

.subnav a {
  display: block;
  padding: 0.55em 0.75em;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 550;
}

.subnav a:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.subnav a[aria-current="page"] {
  color: var(--primary);
  background: var(--brand-soft);
}

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

.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0 10px;
  margin-left: auto;
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-md);
  cursor: pointer;
}

.burger-bar {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-burger[aria-expanded="true"] .burger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-burger[aria-expanded="true"] .burger-bar:nth-child(2) {
  opacity: 0;
}
.nav-burger[aria-expanded="true"] .burger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   5. Breadcrumbs, page heads, sections
   -------------------------------------------------------------------------- */

.breadcrumbs {
  padding: var(--s-4) 0 0;
  font-size: 0.87rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumbs li {
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--ink-3);
}

.breadcrumbs li + li::before {
  content: "/";
  color: var(--line-strong);
}

.breadcrumbs a {
  color: var(--ink-2);
  text-decoration: none;
}

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

.page-head {
  padding: var(--s-6) 0 var(--s-4);
  max-width: var(--measure);
}

.kicker {
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 var(--s-2);
}

.page-sub {
  font-size: 1.1rem;
  color: var(--ink-2);
  margin: 0;
}

.section {
  margin: var(--s-8) 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-5);
}

.section-head h2 {
  margin: 0;
}

.section-sub {
  margin: var(--s-2) 0 0;
  color: var(--ink-2);
  font-size: 0.98rem;
  max-width: 62ch;
}

.section-link {
  flex-shrink: 0;
  font-weight: 650;
  font-size: 0.93rem;
  text-decoration: none;
  white-space: nowrap;
}

.section-link:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   6. Layout with sidebar
   -------------------------------------------------------------------------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-7);
  padding-bottom: var(--s-8);
}

.layout-main {
  min-width: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
  min-width: 0;
}

.sidebar-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-4) var(--s-5);
  box-shadow: var(--shadow-sm);
}

.sidebar-title {
  font-size: 0.79rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin: 0 0 var(--s-3);
  font-weight: 750;
}

.link-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.link-list li {
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.link-list li:last-child {
  border-bottom: 0;
}

.link-list a {
  display: block;
  padding: 0.6em 0;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 550;
}

.link-list a:hover {
  color: var(--primary);
}

.spec-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-2) var(--s-4);
  margin: 0;
  font-size: 0.93rem;
}

.spec-list dt {
  color: var(--ink-3);
  font-weight: 600;
}

.spec-list dd {
  margin: 0;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   7. Hero
   -------------------------------------------------------------------------- */

.hero {
  background: linear-gradient(180deg, var(--bg-alt), var(--bg));
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  display: grid;
  gap: var(--s-6);
  padding-block: var(--s-7) var(--s-8);
  align-items: center;
}

.hero-copy h1 {
  margin-bottom: var(--s-4);
}

.hero-text {
  font-size: 1.12rem;
  color: var(--ink-2);
  max-width: 56ch;
  margin-bottom: var(--s-5);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-bottom: var(--s-5);
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3) var(--s-5);
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.92rem;
  color: var(--ink-2);
  font-weight: 600;
}

.hero-points li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.hero-points li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  flex-shrink: 0;
}

.hero-svg {
  width: 100%;
  height: auto;
  max-width: 460px;
  margin-inline: auto;
  display: block;
  filter: drop-shadow(0 12px 28px rgba(80, 45, 20, 0.16));
}

/* --------------------------------------------------------------------------
   8. Cards - games, categories, articles
   -------------------------------------------------------------------------- */

.game-grid {
  display: grid;
  gap: var(--s-5);
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
}

.game-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.game-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}

.game-card-media {
  display: block;
  aspect-ratio: 4 / 3;
  background: var(--surface-3);
  overflow: hidden;
}

.game-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: var(--s-4);
  gap: var(--s-2);
}

.game-card-title {
  font-size: 1.1rem;
  margin: 0;
}

.game-card-title a {
  color: var(--ink);
  text-decoration: none;
}

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

.game-card-text {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.92rem;
  line-height: 1.55;
  flex: 1;
}

.badge {
  display: inline-block;
  align-self: flex-start;
  margin: 0;
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.3em 0.7em;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  color: var(--ink-2);
}

.badge-runner {
  background: var(--brand-soft);
  color: var(--primary);
}
.badge-platform {
  background: var(--accent-soft);
  color: var(--accent);
}
.badge-adventure {
  background: var(--blue-soft);
  color: var(--blue);
}
.badge-puzzle {
  background: var(--violet-soft);
  color: var(--violet);
}
.badge-collection {
  background: var(--gold-soft);
  color: var(--gold);
}
.badge-one-tap,
.badge-skill {
  background: var(--surface-3);
  color: var(--ink-2);
}

.game-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  margin: 0;
  font-size: 0.83rem;
  color: var(--ink-3);
}

.game-meta-sep {
  color: var(--line-strong);
}

.difficulty {
  font-weight: 700;
}

.difficulty-easy {
  color: var(--ok);
}
.difficulty-medium {
  color: var(--warn);
}
.difficulty-hard {
  color: var(--primary);
}

.game-card-actions {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-2);
}

.game-card-actions .btn {
  flex: 1;
}

.fav-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  cursor: pointer;
  padding: 0;
  color: var(--ink-3);
}

.fav-btn svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linejoin: round;
}

.fav-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.fav-btn[aria-pressed="true"] {
  color: var(--primary);
  border-color: var(--primary);
}

.fav-btn[aria-pressed="true"] svg {
  fill: currentColor;
}

.fav-strip {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-4) var(--s-5);
  margin-bottom: var(--s-5);
}

.fav-strip-items {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.fav-strip-items a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.45em 0.9em;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.9rem;
}

.fav-strip-items a:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Category cards */

.cat-grid {
  display: grid;
  gap: var(--s-4);
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.cat-card {
  display: flex;
  gap: var(--s-4);
  padding: var(--s-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.cat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
  color: var(--ink);
}

.cat-card-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: var(--r-md);
  background: var(--brand-soft);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cat-card-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cat-card-cat-runner-games .cat-card-icon {
  background: var(--brand-soft);
  color: var(--primary);
}
.cat-card-cat-jumping-games .cat-card-icon {
  background: var(--accent-soft);
  color: var(--accent);
}
.cat-card-cat-adventure-games .cat-card-icon {
  background: var(--blue-soft);
  color: var(--blue);
}
.cat-card-cat-puzzle-games .cat-card-icon {
  background: var(--violet-soft);
  color: var(--violet);
}
.cat-card-cat-game-guides .cat-card-icon {
  background: var(--gold-soft);
  color: var(--gold);
}

.cat-card-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.cat-card-title {
  font-weight: 750;
  font-size: 1.05rem;
}

.cat-card-text {
  color: var(--ink-2);
  font-size: 0.9rem;
  line-height: 1.5;
}

.cat-card-meta {
  font-size: 0.78rem;
  color: var(--ink-3);
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Article cards */

.post-grid {
  display: grid;
  gap: var(--s-5);
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.post-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  height: 100%;
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.post-card-media {
  display: block;
  aspect-ratio: 40 / 21;
  background: var(--surface-3);
  overflow: hidden;
}

.post-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-4);
  flex: 1;
}

.post-card-title {
  font-size: 1.06rem;
  margin: 0;
}

.post-card-title a {
  color: var(--ink);
  text-decoration: none;
}

.post-card-title a:hover {
  color: var(--primary);
}

.post-card-text {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.9rem;
  line-height: 1.55;
  flex: 1;
}

.post-meta {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-3);
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
}

/* Mini cards - related games */

.mini-card-grid {
  display: grid;
  gap: var(--s-3);
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.mini-card {
  display: flex;
  gap: var(--s-3);
  align-items: center;
  padding: var(--s-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.mini-card:hover {
  border-color: var(--primary);
  background: var(--surface-2);
  color: var(--ink);
}

.mini-card img {
  width: 76px;
  height: 57px;
  border-radius: var(--r-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.mini-card-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.mini-card-title {
  font-weight: 700;
  font-size: 0.97rem;
}

.mini-card-text {
  font-size: 0.83rem;
  color: var(--ink-2);
  line-height: 1.45;
}

/* Tip list */

.tip-list {
  display: grid;
  gap: var(--s-3);
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.tip-list li {
  margin: 0;
}

.tip-list a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  padding: var(--s-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--ink);
  transition: background-color 0.18s ease;
}

.tip-list a:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.tip-title {
  font-weight: 700;
  font-size: 0.98rem;
}

.tip-text {
  font-size: 0.86rem;
  color: var(--ink-2);
  line-height: 1.5;
}

/* Cluster chips */

.cluster-grid {
  display: grid;
  gap: var(--s-3);
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.cluster-chip {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--s-4);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.cluster-chip:hover {
  border-color: var(--primary);
  background: var(--surface);
  color: var(--ink);
}

.cluster-title {
  font-weight: 700;
  font-size: 0.96rem;
}

.cluster-text {
  font-size: 0.85rem;
  color: var(--ink-2);
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   9. Prose / article typography
   -------------------------------------------------------------------------- */

.prose {
  max-width: var(--measure);
}

.prose-wide {
  max-width: 78ch;
}

.prose .lead {
  font-size: 1.16rem;
  line-height: 1.6;
  color: var(--ink);
  font-weight: 500;
}

.prose h2 {
  margin-top: var(--s-7);
  padding-top: var(--s-2);
}

.prose h2:first-child {
  margin-top: var(--s-5);
}

.prose ul li::marker {
  color: var(--brand);
}

.prose ol li::marker {
  color: var(--primary);
  font-weight: 700;
}

.def-list {
  margin: 0 0 var(--s-5);
  display: grid;
  gap: var(--s-3);
}

.def-list dt {
  font-weight: 750;
  color: var(--ink);
}

.def-list dd {
  margin: 4px 0 0;
  padding-left: var(--s-4);
  border-left: 3px solid var(--brand-soft);
  color: var(--ink-2);
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0 0 var(--s-5);
  display: grid;
  gap: var(--s-3);
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: var(--s-4) var(--s-4) var(--s-4) 60px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--ink-2);
  margin: 0;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: var(--s-4);
  top: var(--s-4);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--primary);
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-title {
  display: block;
  font-weight: 750;
  color: var(--ink);
  margin-bottom: 3px;
}

.callout {
  margin: 0 0 var(--s-5);
  padding: var(--s-4) var(--s-5);
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: var(--r-md);
}

.callout-title {
  font-weight: 750;
  color: var(--ink);
  margin: 0 0 var(--s-2);
}

.callout p:last-child {
  margin: 0;
  color: var(--ink-2);
}

.notice {
  padding: var(--s-4);
  background: var(--gold-soft);
  border: 1px solid var(--gold);
  border-color: color-mix(in srgb, var(--gold) 35%, transparent);
  border-radius: var(--r-md);
  color: var(--ink);
  margin: var(--s-4) 0;
}

.table-wrap {
  overflow-x: auto;
  margin: 0 0 var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 460px;
  font-size: 0.93rem;
}

th,
td {
  text-align: left;
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

thead th {
  background: var(--surface-2);
  font-weight: 750;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-2);
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.takeaways {
  margin: var(--s-7) 0;
  padding: var(--s-5) var(--s-6);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--r-md);
}

.takeaways h2 {
  margin-top: 0;
  font-size: 1.25rem;
}

.takeaways ul {
  margin: 0;
}

.takeaways li {
  color: var(--ink-2);
}

.cta-card {
  margin: var(--s-7) 0 0;
  padding: var(--s-6);
  background: linear-gradient(135deg, var(--brand-soft), var(--surface-2));
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  text-align: center;
}

.cta-card h2 {
  margin-top: 0;
}

.cta-card p {
  color: var(--ink-2);
  max-width: 52ch;
  margin-inline: auto;
}

/* FAQ */

.faq {
  margin: var(--s-7) 0;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  margin-bottom: var(--s-3);
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  padding: var(--s-4) var(--s-5);
  font-weight: 700;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
  align-items: flex-start;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 1.35rem;
  line-height: 1;
  color: var(--primary);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  content: "\2212";
}

.faq-item summary:hover {
  background: var(--surface-2);
}

.faq-answer {
  padding: 0 var(--s-5) var(--s-4);
  color: var(--ink-2);
}

.faq-answer p:last-child {
  margin: 0;
}

/* Table of contents */

.toc {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-4) var(--s-5);
  margin: var(--s-5) 0 var(--s-6);
  max-width: var(--measure);
}

.toc-heading {
  font-size: 0.79rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin: 0 0 var(--s-3);
  font-weight: 750;
}

.toc ol {
  margin: 0;
  padding-left: 1.2em;
  columns: 2;
  column-gap: var(--s-6);
}

.toc li {
  margin-bottom: 6px;
  break-inside: avoid;
}

.toc a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.92rem;
}

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

.sidebar-toc .toc {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
}

.sidebar-toc .toc-heading {
  display: none;
}

.sidebar-toc .toc ol {
  columns: 1;
}

/* Article chrome */

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-5);
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--line);
}

.article-byline,
.article-dates {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-2);
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
}

.article-hero {
  margin: 0 0 var(--s-6);
}

.article-hero img {
  width: 100%;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  aspect-ratio: 40 / 21;
  object-fit: cover;
}

.author-box {
  display: flex;
  gap: var(--s-5);
  padding: var(--s-5);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  margin: var(--s-7) 0;
  max-width: var(--measure);
}

.author-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  flex-shrink: 0;
  background: var(--surface);
}

.author-kicker {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  font-weight: 750;
  margin: 0 0 3px;
}

.author-name {
  margin: 0;
  font-weight: 800;
  font-size: 1.06rem;
}

.author-name a {
  color: var(--ink);
  text-decoration: none;
}

.author-name a:hover {
  color: var(--primary);
}

.author-role {
  margin: 0 0 var(--s-2);
  font-size: 0.87rem;
  color: var(--ink-3);
}

.author-bio {
  margin: 0 0 var(--s-2);
  font-size: 0.92rem;
  color: var(--ink-2);
}

.author-links {
  margin: 0;
  font-size: 0.88rem;
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
}

.author-profile {
  display: flex;
  gap: var(--s-5);
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--s-5);
}

.author-profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--line-strong);
  background: var(--surface);
}

.author-profile-lead {
  font-size: 1.12rem;
  color: var(--ink);
  margin: 0;
  max-width: 48ch;
}

.social-placeholders {
  margin-top: var(--s-5);
  padding: var(--s-4) var(--s-5);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface-2);
}

.social-placeholders-title {
  font-weight: 750;
  margin: 0 0 var(--s-2);
}

.social-placeholders p:last-child {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-2);
}

/* --------------------------------------------------------------------------
   10. Forms, filters, search
   -------------------------------------------------------------------------- */

.field {
  margin-bottom: var(--s-4);
}

.field label,
.search-form label {
  display: block;
  font-weight: 650;
  font-size: 0.92rem;
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="search"],
select,
textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  padding: 0.68em 0.9em;
  border-radius: var(--r-md);
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  min-height: 46px;
}

textarea {
  resize: vertical;
  min-height: 140px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--primary);
}

.field-hint {
  margin: 5px 0 0;
  font-size: 0.85rem;
  color: var(--ink-3);
}

.field-error {
  margin: 5px 0 0;
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 650;
}

.form-status {
  margin: var(--s-3) 0 0;
  font-size: 0.92rem;
  font-weight: 650;
}

.contact-grid {
  display: grid;
  gap: var(--s-6);
  margin-top: var(--s-5);
  align-items: start;
}

.contact-form,
.contact-aside {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-5) var(--s-6);
}

.contact-aside h2 {
  margin-top: 0;
}

.contact-aside h3 {
  font-size: 1rem;
}

.contact-email {
  font-size: 0.95rem;
}

.directory-controls {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  margin-bottom: var(--s-5);
  padding: var(--s-5);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

.field-search {
  margin: 0;
  max-width: 420px;
}

.filter-row,
.search-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.search-filters {
  margin-bottom: var(--s-4);
}

.filter-btn {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  padding: 0.45em 1em;
  min-height: 40px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease,
    border-color 0.16s ease;
}

.filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-btn.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-ink);
}

.filter-count,
.search-count {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-3);
}

.empty-state {
  padding: var(--s-6);
  text-align: center;
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
  color: var(--ink-2);
}

.search-form {
  margin-bottom: var(--s-4);
  max-width: 640px;
}

.search-row {
  display: flex;
  gap: var(--s-2);
}

.search-row input {
  flex: 1;
}

.search-results {
  display: grid;
  gap: var(--s-3);
  margin-bottom: var(--s-5);
}

.result {
  display: block;
  padding: var(--s-4) var(--s-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.result:hover {
  border-color: var(--primary);
  background: var(--surface-2);
  color: var(--ink);
}

.result-head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.result-title {
  font-weight: 750;
  font-size: 1.02rem;
}

.result-text {
  color: var(--ink-2);
  font-size: 0.91rem;
  margin: 0 0 4px;
}

.result-url {
  font-size: 0.8rem;
  color: var(--ink-3);
  font-family: var(--font-mono);
}

.result mark {
  background: var(--brand-soft);
  color: var(--ink);
  border-radius: 3px;
  padding: 0 2px;
}

/* --------------------------------------------------------------------------
   11. Sitemap, 404
   -------------------------------------------------------------------------- */

.sitemap-grid {
  display: grid;
  gap: var(--s-6);
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  padding-bottom: var(--s-8);
}

.sitemap-group h2 {
  margin-top: 0;
  font-size: 1.1rem;
  padding-bottom: var(--s-2);
  border-bottom: 2px solid var(--brand);
}

.notfound {
  text-align: center;
  padding: var(--s-7) 0 var(--s-6);
  max-width: 620px;
  margin-inline: auto;
}

.notfound-art {
  max-width: 300px;
  margin: 0 auto var(--s-5);
}

.notfound .search-form {
  margin-inline: auto;
  text-align: left;
}

.notfound-actions {
  display: flex;
  gap: var(--s-3);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--s-5);
}

/* --------------------------------------------------------------------------
   12. Ad slots
   -------------------------------------------------------------------------- */

.ad-slot {
  margin: var(--s-7) 0;
  padding: var(--s-3);
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  text-align: center;
}

.ad-label {
  margin: 0 0 var(--s-2);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 700;
}

.ad-unit {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ad-slot-sidebar {
  margin: 0;
}

.ad-slot-sidebar .ad-unit {
  min-height: 250px;
}

/* --------------------------------------------------------------------------
   13. Footer & cookie banner
   -------------------------------------------------------------------------- */

.site-footer {
  margin-top: var(--s-9);
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
  padding-top: var(--s-7);
}

.footer-grid {
  display: grid;
  gap: var(--s-6);
  padding-bottom: var(--s-6);
}

.footer-brand .brand {
  margin-bottom: var(--s-4);
}

.footer-about {
  color: var(--ink-2);
  font-size: 0.91rem;
  max-width: 44ch;
  margin-bottom: var(--s-3);
}

.footer-heading {
  font-size: 0.79rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  font-weight: 750;
  margin: 0 0 var(--s-3);
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col li {
  margin-bottom: var(--s-2);
}

.footer-col a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.92rem;
}

.footer-col a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-3);
  padding-block: var(--s-4) var(--s-5);
  border-top: 1px solid var(--line);
  font-size: 0.87rem;
  color: var(--ink-3);
}

.footer-bottom p {
  margin: 0;
}

.footer-bottom-links {
  display: flex;
  gap: var(--s-4);
  flex-wrap: wrap;
}

.footer-bottom-links a {
  color: var(--ink-2);
  text-decoration: none;
}

.footer-bottom-links a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.cookie-banner {
  position: fixed;
  left: var(--s-4);
  right: var(--s-4);
  bottom: var(--s-4);
  z-index: 80;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--s-4) var(--s-5);
  max-width: 880px;
  margin-inline: auto;
}

.cookie-inner {
  display: flex;
  gap: var(--s-4);
  align-items: center;
  flex-wrap: wrap;
}

.cookie-text {
  margin: 0;
  font-size: 0.89rem;
  color: var(--ink-2);
  flex: 1;
  min-width: 260px;
}

.cookie-actions {
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   14. Motion preferences
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .game-card:hover,
  .post-card:hover,
  .cat-card:hover {
    transform: none;
  }
}

@media print {
  .site-header,
  .site-footer,
  .cookie-banner,
  .ad-slot,
  .sidebar,
  .game-shell,
  .breadcrumbs {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }
}
