/* ==========================================================================
   Ninja Arcade — Global design system
   Dark-first arcade interface with an ink/parchment light theme.
   Author: Ninja Arcade editorial team
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */

:root {
  /* Surfaces — dark is the default experience */
  --c-bg: #0c0e13;
  --c-bg-alt: #11141b;
  --c-surface: #161a23;
  --c-surface-2: #1d222d;
  --c-border: #272d3a;
  --c-border-strong: #39414f;

  /* Text */
  --c-text: #e9ecf3;
  --c-text-soft: #b6bdcc;
  --c-muted: #8b93a5;

  /* Brand accents — ember red / lantern orange */
  --c-accent: #e23b3b;
  --c-accent-hover: #f05050;
  --c-accent-soft: rgba(226, 59, 59, 0.14);
  --c-ember: #ff8a3d;
  --c-jade: #37b88a;
  --c-ink: #f3ead6;

  /* Difficulty chips */
  --c-easy: #37b88a;
  --c-medium: #e8a33d;
  --c-hard: #e23b3b;

  /* Typography */
  --font-sans: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Semibold", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  --font-mono: "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;

  /* Spacing scale */
  --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;

  /* Radii + elevation */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.45);

  /* Layout */
  --wrap: 1200px;
  --wrap-narrow: 760px;
  --header-h: 64px;

  --transition: 160ms ease;
}

/* Light theme — ink on parchment, still high contrast */
:root[data-theme="light"] {
  --c-bg: #f6f2e9;
  --c-bg-alt: #efe9dc;
  --c-surface: #ffffff;
  --c-surface-2: #f7f3ea;
  --c-border: #ddd4c2;
  --c-border-strong: #c3b7a0;

  --c-text: #1b1d22;
  --c-text-soft: #3d424d;
  --c-muted: #61677a;

  --c-accent: #c22a2a;
  --c-accent-hover: #a82020;
  --c-accent-soft: rgba(194, 42, 42, 0.1);
  --c-ember: #c2621a;
  --c-jade: #1f7d5c;

  --c-easy: #1f7d5c;
  --c-medium: #9a6a12;
  --c-hard: #c22a2a;

  --shadow-sm: 0 1px 2px rgba(40, 30, 10, 0.08);
  --shadow-md: 0 6px 18px rgba(40, 30, 10, 0.1);
  --shadow-lg: 0 18px 44px rgba(40, 30, 10, 0.14);
}

/* --------------------------------------------------------------------------
   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) + 1rem);
}

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Subtle ink wash so the dark theme is not a flat block of grey */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(226, 59, 59, 0.10), transparent 60%),
    radial-gradient(700px 420px at 95% 0%, rgba(255, 138, 61, 0.07), transparent 55%);
}

:root[data-theme="light"] body::before {
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(194, 42, 42, 0.07), transparent 60%),
    radial-gradient(700px 420px at 95% 0%, rgba(194, 98, 26, 0.06), transparent 55%);
}

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

a {
  color: var(--c-accent);
  text-decoration: none;
}
a:hover { color: var(--c-accent-hover); text-decoration: underline; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: 1.22;
  margin: 0 0 var(--sp-3);
  letter-spacing: -0.015em;
  font-weight: 700;
}

h1 { font-size: clamp(1.9rem, 1.35rem + 2.3vw, 3rem); }
h2 { font-size: clamp(1.45rem, 1.15rem + 1.3vw, 2.05rem); }
h3 { font-size: clamp(1.15rem, 1.02rem + 0.6vw, 1.4rem); }
h4 { font-size: 1.08rem; }

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

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

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: 0.1em 0.38em;
}

pre {
  margin: 0 0 var(--sp-5);
  padding: var(--sp-4);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-left: 3px solid var(--c-ember);
  border-radius: var(--r-md);
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.6;
}
pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
  color: var(--c-text);
  white-space: pre;
}

blockquote {
  margin: var(--sp-5) 0;
  padding: var(--sp-4) var(--sp-5);
  border-left: 3px solid var(--c-accent);
  background: var(--c-surface);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  color: var(--c-text-soft);
}
blockquote p:last-child { margin-bottom: 0; }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 var(--sp-5);
  font-size: 0.95rem;
}
th, td {
  text-align: left;
  padding: var(--sp-3);
  border-bottom: 1px solid var(--c-border);
}
th { background: var(--c-surface-2); font-weight: 700; }

/* Focus visibility is non-negotiable for keyboard players */
:focus-visible {
  outline: 3px solid var(--c-ember);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

::selection { background: var(--c-accent-soft); }

/* --------------------------------------------------------------------------
   3. Layout helpers
   -------------------------------------------------------------------------- */

.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-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-bottom: var(--sp-5);
}
.section-head h2 { margin: 0; }
.section-head .link-more { font-weight: 600; font-size: 0.95rem; }

.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-ember);
  margin-bottom: var(--sp-2);
}

.lede {
  font-size: 1.12rem;
  color: var(--c-text-soft);
  max-width: 68ch;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--c-accent);
  color: #fff;
  padding: var(--sp-3) var(--sp-4);
  border-radius: 0 0 var(--r-md) 0;
  font-weight: 700;
}
.skip-link:focus {
  left: 0;
  text-decoration: none;
  color: #fff;
}

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

/* --------------------------------------------------------------------------
   4. Buttons, chips, badges
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-family: var(--font-display);
  font-size: 0.97rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.82em 1.35em;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), transform var(--transition), color var(--transition);
  touch-action: manipulation;
  min-height: 44px;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--c-accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover { background: var(--c-accent-hover); color: #fff; }

.btn--ghost {
  background: transparent;
  border-color: var(--c-border-strong);
  color: var(--c-text);
}
.btn--ghost:hover { border-color: var(--c-accent); color: var(--c-accent); background: var(--c-accent-soft); }

.btn--subtle {
  background: var(--c-surface-2);
  border-color: var(--c-border);
  color: var(--c-text);
}
.btn--subtle:hover { border-color: var(--c-border-strong); color: var(--c-text); }

.btn--sm { padding: 0.6em 1em; font-size: 0.88rem; min-height: 38px; }
.btn--block { width: 100%; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.34em 0.7em;
  border-radius: var(--r-pill);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  color: var(--c-text-soft);
}
.chip--cat { color: var(--c-ember); border-color: rgba(255, 138, 61, 0.3); background: rgba(255, 138, 61, 0.1); }
:root[data-theme="light"] .chip--cat { background: rgba(194, 98, 26, 0.1); }

.chip--easy { color: var(--c-easy); border-color: currentColor; background: transparent; }
.chip--medium { color: var(--c-medium); border-color: currentColor; background: transparent; }
.chip--hard { color: var(--c-hard); border-color: currentColor; background: transparent; }

/* --------------------------------------------------------------------------
   5. Header + navigation
   -------------------------------------------------------------------------- */

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

.header-inner {
  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);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.brand:hover { color: var(--c-text); text-decoration: none; }
.brand__mark { width: 34px; height: 34px; flex-shrink: 0; }
.brand__name { line-height: 1.1; }
.brand__name span { display: block; font-size: 0.62rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--c-muted); }

.nav { margin-left: auto; }
.nav__list {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__list a {
  display: block;
  padding: 0.5rem 0.7rem;
  border-radius: var(--r-sm);
  color: var(--c-text-soft);
  font-size: 0.92rem;
  font-weight: 600;
}
.nav__list a:hover { color: var(--c-text); background: var(--c-surface); text-decoration: none; }
.nav__list a[aria-current="page"] { color: var(--c-accent); background: var(--c-accent-soft); }

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

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text-soft);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  touch-action: manipulation;
}
.icon-btn:hover { color: var(--c-accent); border-color: var(--c-accent); }
.icon-btn svg { width: 19px; height: 19px; }

.nav-toggle { display: none; }

/* Dropdown for the Games menu */
.nav__item--has-menu { position: relative; }
.nav__submenu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 250px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-2);
  list-style: none;
  margin: 0;
  display: none;
}
.nav__item--has-menu:hover .nav__submenu,
.nav__item--has-menu:focus-within .nav__submenu { display: block; }
.nav__submenu a { font-weight: 500; font-size: 0.9rem; }

/* --------------------------------------------------------------------------
   6. Breadcrumbs
   -------------------------------------------------------------------------- */

.breadcrumbs {
  padding-block: var(--sp-3);
  font-size: 0.85rem;
  color: var(--c-muted);
  border-bottom: 1px solid var(--c-border);
  background: var(--c-bg-alt);
}
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.breadcrumbs li { margin: 0; display: flex; gap: 0.4rem; align-items: center; }
.breadcrumbs li + li::before { content: "/"; color: var(--c-border-strong); }
.breadcrumbs a { color: var(--c-text-soft); }
.breadcrumbs [aria-current="page"] { color: var(--c-muted); }

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

.hero {
  position: relative;
  padding-block: var(--sp-8) var(--sp-7);
  overflow: hidden;
  border-bottom: 1px solid var(--c-border);
}
.hero__inner {
  display: grid;
  /* minmax(0, …) is required: grid items default to min-width:auto, so the
     hero illustration's intrinsic 520px would otherwise set the track width
     and push the whole hero past the viewport on small screens. */
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: var(--sp-7);
  align-items: center;
}
.hero__inner > * { min-width: 0; }
.hero h1 { margin-bottom: var(--sp-4); }
.hero__tagline {
  font-family: var(--font-display);
  color: var(--c-ember);
  font-size: 0.82rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: var(--sp-3);
}
.hero__text { font-size: 1.15rem; color: var(--c-text-soft); margin-bottom: var(--sp-5); max-width: 56ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-bottom: var(--sp-5); }
.hero__stats {
  display: flex;
  gap: var(--sp-6);
  flex-wrap: wrap;
  padding-top: var(--sp-4);
  border-top: 1px solid var(--c-border);
}
.hero__stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--c-text);
  line-height: 1.2;
}
.hero__stat span { font-size: 0.82rem; color: var(--c-muted); }
.hero__art { width: 100%; max-width: 100%; height: auto; }

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

.card {
  display: flex;
  flex-direction: column;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  position: relative;
}
.card:hover {
  border-color: var(--c-border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card__thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--c-surface-2);
  border-bottom: 1px solid var(--c-border);
  overflow: hidden;
}
.card__thumb svg, .card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.card__body {
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: var(--sp-2);
}
.card__meta { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.card__title {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
}
.card__title a { color: var(--c-text); }
.card__title a:hover { color: var(--c-accent); text-decoration: none; }
.card__desc {
  font-size: 0.92rem;
  color: var(--c-text-soft);
  margin: 0;
  flex: 1;
}
.card__foot {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}
.card__foot .btn { flex: 1; }

.fav-btn {
  width: 40px; height: 40px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
  background: transparent;
  color: var(--c-muted);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  touch-action: manipulation;
}
.fav-btn:hover { color: var(--c-accent); border-color: var(--c-accent); }
.fav-btn[aria-pressed="true"] { color: var(--c-accent); border-color: var(--c-accent); background: var(--c-accent-soft); }
.fav-btn svg { width: 18px; height: 18px; }

/* Category tiles */
.cat-card {
  display: block;
  padding: var(--sp-5);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  color: var(--c-text);
  transition: border-color var(--transition), transform var(--transition);
  height: 100%;
}
.cat-card:hover { border-color: var(--c-accent); transform: translateY(-2px); text-decoration: none; color: var(--c-text); }
.cat-card__icon { width: 44px; height: 44px; margin-bottom: var(--sp-3); color: var(--c-accent); }
.cat-card h3 { margin-bottom: var(--sp-2); font-size: 1.12rem; }
.cat-card p { margin: 0 0 var(--sp-3); font-size: 0.92rem; color: var(--c-text-soft); }
.cat-card__count { font-size: 0.8rem; color: var(--c-muted); font-weight: 600; }

/* Article cards */
.post-card { display: flex; flex-direction: column; gap: var(--sp-2); }
.post-card__thumb {
  aspect-ratio: 1200 / 630;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--c-border);
  background: var(--c-surface-2);
}
.post-card h3 { font-size: 1.05rem; margin: 0; }
.post-card h3 a { color: var(--c-text); }
.post-card h3 a:hover { color: var(--c-accent); text-decoration: none; }
.post-card p { font-size: 0.9rem; color: var(--c-text-soft); margin: 0; }
.post-meta { font-size: 0.8rem; color: var(--c-muted); display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; }

/* Compact list used in sidebars and related blocks */
.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li { border-bottom: 1px solid var(--c-border); margin: 0; }
.link-list li:last-child { border-bottom: 0; }
.link-list a {
  display: block;
  padding: var(--sp-3) 0;
  color: var(--c-text);
  font-size: 0.93rem;
  font-weight: 600;
}
.link-list a:hover { color: var(--c-accent); text-decoration: none; }
.link-list span { display: block; font-weight: 400; font-size: 0.82rem; color: var(--c-muted); }

/* --------------------------------------------------------------------------
   9. Panels, callouts, FAQ
   -------------------------------------------------------------------------- */

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

.callout {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-left: 3px solid var(--c-ember);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: var(--sp-4) var(--sp-5);
  margin: var(--sp-5) 0;
}
.callout h3, .callout h4 { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }

.faq-item {
  border: 1px solid var(--c-border);
  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: 1rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.3rem;
  color: var(--c-accent);
  line-height: 1;
  flex-shrink: 0;
}
.faq-item[open] summary::after { content: "\2212"; }
.faq-item__body { padding: 0 var(--sp-4) var(--sp-4); color: var(--c-text-soft); }
.faq-item__body p:last-child { margin-bottom: 0; }

/* Key takeaways */
.takeaways { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); padding: var(--sp-5); margin: var(--sp-6) 0; }
.takeaways h2 { font-size: 1.2rem; margin-bottom: var(--sp-3); }
.takeaways ul { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   10. Article layout
   -------------------------------------------------------------------------- */

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: var(--sp-7);
  align-items: start;
  padding-block: var(--sp-6) var(--sp-8);
}

.prose { max-width: 72ch; font-size: 1.04rem; }
.prose h2 { margin-top: var(--sp-7); scroll-margin-top: 90px; }
.prose h3 { margin-top: var(--sp-5); scroll-margin-top: 90px; }
.prose ul li, .prose ol li { margin-bottom: var(--sp-2); }
.prose img { border-radius: var(--r-md); margin: var(--sp-5) 0; }

.article-header { padding-block: var(--sp-6) var(--sp-4); }
.article-header h1 { margin-bottom: var(--sp-3); }
.article-header .post-meta { margin-bottom: var(--sp-4); }

.toc {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-6);
}
.toc h2 { font-size: 1rem; margin: 0 0 var(--sp-3); text-transform: uppercase; letter-spacing: 0.1em; color: var(--c-muted); }
.toc ol { margin: 0; padding-left: 1.2rem; }
.toc li { margin-bottom: var(--sp-1); }
.toc a { color: var(--c-text-soft); font-size: 0.94rem; }
.toc a:hover { color: var(--c-accent); }

.sidebar { position: sticky; top: calc(var(--header-h) + var(--sp-4)); display: flex; flex-direction: column; gap: var(--sp-5); }
.sidebar h2, .sidebar h3 { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--c-muted); margin-bottom: var(--sp-3); }

.author-box {
  display: flex;
  gap: var(--sp-4);
  align-items: flex-start;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  margin: var(--sp-6) 0;
}
.author-box__avatar { width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0; overflow: hidden; border: 2px solid var(--c-accent); }
.author-box h3 { margin: 0 0 var(--sp-1); font-size: 1.05rem; }
.author-box__role { font-size: 0.85rem; color: var(--c-ember); font-weight: 600; margin-bottom: var(--sp-2); }
.author-box p { font-size: 0.92rem; color: var(--c-text-soft); margin-bottom: var(--sp-2); }

.source-list { font-size: 0.9rem; color: var(--c-text-soft); }

/* --------------------------------------------------------------------------
   11. Ad slots — clearly labelled, never near game controls
   -------------------------------------------------------------------------- */

.ad-slot {
  display: block;
  margin: var(--sp-6) auto;
  max-width: 100%;
  text-align: center;
  border: 1px dashed var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-bg-alt);
  padding: var(--sp-3);
  min-height: 100px;
  color: var(--c-muted);
}
.ad-slot__label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-muted);
  margin-bottom: var(--sp-2);
}
.ad-slot--leaderboard { min-height: 110px; }
.ad-slot--rect { min-height: 260px; }

/* --------------------------------------------------------------------------
   12. Forms + search
   -------------------------------------------------------------------------- */

.field { margin-bottom: var(--sp-4); }
.field label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: var(--sp-2);
}
.field .hint { font-size: 0.83rem; color: var(--c-muted); margin-top: var(--sp-1); }

input[type="text"],
input[type="email"],
input[type="search"],
select,
textarea {
  width: 100%;
  font: inherit;
  font-size: 0.97rem;
  color: var(--c-text);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 0.7rem 0.85rem;
  min-height: 44px;
  transition: border-color var(--transition);
}
input:focus, select:focus, textarea:focus { border-color: var(--c-accent); }
textarea { min-height: 150px; resize: vertical; line-height: 1.6; }

.search-box { position: relative; display: flex; gap: var(--sp-2); }
.search-box input { padding-left: 2.6rem; }
.search-box__icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--c-muted);
  pointer-events: none;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
}
.filter-btn {
  font: inherit;
  font-size: 0.87rem;
  font-weight: 600;
  padding: 0.5rem 0.95rem;
  min-height: 40px;
  border-radius: var(--r-pill);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text-soft);
  cursor: pointer;
  transition: all var(--transition);
  touch-action: manipulation;
}
.filter-btn:hover { border-color: var(--c-border-strong); color: var(--c-text); }
.filter-btn[aria-pressed="true"] { background: var(--c-accent); border-color: var(--c-accent); color: #fff; }

.empty-state {
  text-align: center;
  padding: var(--sp-7) var(--sp-4);
  border: 1px dashed var(--c-border);
  border-radius: var(--r-lg);
  color: var(--c-text-soft);
}
.empty-state svg { width: 70px; height: 70px; margin: 0 auto var(--sp-4); color: var(--c-muted); }

/* --------------------------------------------------------------------------
   13. Footer
   -------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--c-border);
  background: var(--c-bg-alt);
  padding-block: var(--sp-7) var(--sp-5);
  margin-top: var(--sp-8);
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(4, minmax(0, 1fr));
  gap: var(--sp-6);
  margin-bottom: var(--sp-6);
}
.footer-grid > * { min-width: 0; }
.footer-brand p { font-size: 0.9rem; color: var(--c-text-soft); margin-top: var(--sp-3); max-width: 34ch; }
.footer-col h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-text);
  margin-bottom: var(--sp-3);
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: var(--sp-2); }
.footer-col a { color: var(--c-text-soft); font-size: 0.89rem; }
.footer-col a:hover { color: var(--c-accent); }

.footer-bottom {
  border-top: 1px solid var(--c-border);
  padding-top: var(--sp-4);
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--c-muted);
}
.footer-bottom p { margin: 0; }
.footer-bottom nav { display: flex; gap: var(--sp-4); flex-wrap: wrap; }
.footer-bottom a { color: var(--c-muted); }

/* --------------------------------------------------------------------------
   14. Cookie / consent bar
   -------------------------------------------------------------------------- */

.consent {
  position: fixed;
  left: var(--sp-4);
  right: var(--sp-4);
  bottom: var(--sp-4);
  z-index: 150;
  max-width: 680px;
  margin-inline: auto;
  background: var(--c-surface);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-4) var(--sp-5);
  display: none;
  gap: var(--sp-4);
  align-items: center;
  flex-wrap: wrap;
}
.consent[data-visible="true"] { display: flex; }
.consent p { margin: 0; font-size: 0.88rem; color: var(--c-text-soft); flex: 1; min-width: 240px; }
.consent__actions { display: flex; gap: var(--sp-2); }

/* --------------------------------------------------------------------------
   15. 404 + misc
   -------------------------------------------------------------------------- */

.page-404 { text-align: center; padding-block: var(--sp-8); }
.page-404 svg { width: min(260px, 60vw); height: auto; margin: 0 auto var(--sp-5); }
.page-404 h1 { margin-bottom: var(--sp-3); }

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

.notice {
  background: var(--c-accent-soft);
  border: 1px solid var(--c-accent);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  font-size: 0.92rem;
  margin-bottom: var(--sp-5);
}
.notice p:last-child { margin-bottom: 0; }

.updated-note { font-size: 0.85rem; color: var(--c-muted); }

/* --------------------------------------------------------------------------
   16. 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;
  }
  .card:hover, .btn:hover, .cat-card:hover { transform: none; }
}
