/* ==========================================================================
   Welcome to Elderfield Guide — theme
   90s hand-drawn suburban-horror neighborhood site × old pixel RPG interface
   Shell = illustrated neighborhood comic / Components = in-game pixel UI
   ========================================================================== */

:root {
  /* --- backgrounds (never pure black) --- */
  --bg-deep: #111016;
  --bg-night: #181620;
  --bg-panel: #22202a;
  --bg-panel-alt: #292632;

  /* --- purple identity --- */
  --purple-dark: #3f2b52;
  --purple: #755097;
  --purple-light: #a98bc1;
  --lavender-line: #91839f;

  /* --- moon yellow --- */
  --moon-yellow: #e7dd52;
  --warm-yellow: #d6b83d;

  /* --- horror red --- */
  --blood-red: #a63f43;
  --blood-red-dark: #6f2e34;

  /* --- text --- */
  --text-main: #eeeaf0;
  --text-muted: #aaa3ad;
  --text-dim: #77717c;

  /* --- border / structure --- */
  --border-ink: #09080b;
  --border-mid: #6f6578;
  --border-inset: #19171e;

  /* --- legacy aliases (template rules reference these) --- */
  --paper: #22202a;
  --paper-edge: #6f6578;
  --sand: #111016;
  --sand-deep: #181620;
  --ink: #eeeaf0;
  --ink-soft: #aaa3ad;
  --ink-faint: #77717c;
  --line: #3a3542;
  --ocean: #755097;
  --ocean-dark: #a98bc1;
  --ocean-light: #91839f;
  --forest: #755097;
  --forest-dark: #a98bc1;
  --sunset: #d6b83d;
  --sunset-dark: #e7dd52;
  --clay: #a63f43;
  --yellow: #e7dd52;
  --bg-card: #22202a;
  --border-color: #6f6578;
  --text-muted-legacy: #aaa3ad;
  --shadow-soft: 0 0 0 1px var(--border-ink), 0 6px 0 rgba(9, 8, 11, 0.55);
  --shadow-lift: 0 0 0 1px var(--border-ink), 0 8px 0 rgba(9, 8, 11, 0.6);

  /* --- typography --- */
  --font-head: 'Special Elite', 'Courier New', serif;
  --font-body: 'IBM Plex Mono', 'Courier New', monospace;
  --font-pixel: 'VT323', 'IBM Plex Mono', monospace;
  --font-hand: 'Special Elite', 'Courier New', serif;

  /* --- shape language: square > rounded --- */
  --radius-sm: 2px;
  --radius-md: 3px;
  --border-organic: 2px;

  /* --- RPG dialogue-box border recipe --- */
  --box-frame:
    inset 0 0 0 2px var(--border-inset),
    0 0 0 1px var(--border-ink);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text-main);
  background-color: var(--bg-deep);
  background-image:
    radial-gradient(circle at 50% -10%, #272030 0%, #141218 55%, #0e0d11 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-size: cover, 180px 180px;
  background-attachment: fixed, fixed;
  line-height: 1.7;
  font-size: 16px;
  overflow-x: clip;
}

/* CRT scanline + vignette — barely perceptible, analog not cyberpunk */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(255, 255, 255, 0.012) 3px,
    rgba(255, 255, 255, 0.012) 4px
  );
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9997;
  background: radial-gradient(ellipse at 50% 40%, transparent 45%, rgba(9, 8, 11, 0.55) 100%);
}

/* ---------- decorative background motifs ---------- */
.bg-doodle {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  user-select: none;
  color: var(--purple-dark);
  opacity: 0.5;
}
.bg-doodle svg { display: block; }
.bg-doodle--moon { top: 6%; right: 4%; }
.bg-doodle--tower { bottom: 8%; left: 2%; opacity: 0.35; }
@media (max-width: 1100px) { .bg-doodle { display: none; } }

/* ---------- links ---------- */
a { color: var(--purple-light); text-decoration: none; }
a:hover { color: var(--moon-yellow); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.2;
  color: var(--text-main);
  letter-spacing: 0.02em;
}
h1 {
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
  font-weight: 700;
  margin: 0 0 0.75rem;
  color: var(--moon-yellow);
  text-transform: uppercase;
  text-shadow: 2px 2px 0 #111, -1px 0 #111, 1px 1px 0 #111;
}
h2 {
  font-size: clamp(1.3rem, 2.4vw, 1.6rem);
  font-weight: 700;
  margin: 2.4rem 0 0.9rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border-mid);
  box-shadow: 0 1px 0 var(--border-inset);
}
h3 { font-size: 1.12rem; margin: 1.7rem 0 0.55rem; color: var(--purple-light); }
h4 { font-size: 1rem; margin: 1.1rem 0 0.4rem; }

/* small decorative section label: // NEIGHBORHOOD REPORT */
.section-label,
.eyebrow {
  display: block;
  font-family: var(--font-pixel);
  font-size: 1.02rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--purple-light);
  margin-bottom: 0.25rem;
}

p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1.1rem 1.4rem; }
li { margin-bottom: 0.35rem; }
strong { font-weight: 700; color: #fff; }
em { font-style: italic; }
code {
  font-family: var(--font-body);
  background: #0d0c11;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  padding: 0.08rem 0.35rem;
  font-size: 0.86em;
  color: var(--moon-yellow);
  word-break: break-all;
}
.hand { font-family: var(--font-hand); color: var(--warm-yellow); }

/* ---------- layout ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.2rem 3rem; position: relative; z-index: 1; }

.content-wrapper {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr) 164px;
  gap: 2rem;
  padding: 1.8rem 0 0;
  align-items: start;
}

/* ---------- header: local notice board / game menu ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--bg-deep);
  border-bottom: 3px double var(--lavender-line);
  box-shadow: 0 4px 0 rgba(9, 8, 11, 0.6);
}
.nav-card {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1.2rem;
  min-height: 62px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--moon-yellow);
  white-space: nowrap;
  text-transform: uppercase;
  text-shadow: 1px 1px 0 #111;
  letter-spacing: 0.02em;
}
.brand:hover { color: var(--moon-yellow); text-decoration: none; }
.brand-mark { display: inline-flex; color: var(--purple-light); }
.brand-text em { font-style: normal; color: var(--purple-light); }

.header-nav { display: flex; gap: 0.1rem; flex-wrap: wrap; margin-left: auto; }
.header-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  text-decoration: none;
  color: var(--text-muted);
  font-family: var(--font-pixel);
  font-size: 1.02rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.32rem 0.6rem;
  border: 1px solid transparent;
  border-radius: 0;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.header-nav a:hover {
  color: var(--text-main);
  background: rgba(117, 80, 151, 0.18);
  border-color: var(--lavender-line);
  text-decoration: none;
}
.header-nav a.active {
  color: var(--moon-yellow);
  background: var(--purple-dark);
  border-color: var(--lavender-line);
}

.search-toggle {
  background: var(--bg-night);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 2px var(--border-inset);
  width: 2.1rem;
  height: 2.1rem;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--purple-light);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.18s;
}
.search-toggle:hover { color: var(--moon-yellow); border-color: var(--purple-light); }

.search-panel {
  display: none;
  background: var(--bg-night);
  border-bottom: 3px double var(--lavender-line);
  padding: 1rem 1.2rem 1.2rem;
}
.search-panel.open { display: block; }
.search-panel label {
  font-family: var(--font-pixel);
  font-size: 1rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: block;
  margin-bottom: 0.5rem;
}
.search-panel input {
  width: 100%;
  background: #111015;
  border: 1px solid #716a79;
  box-shadow: inset 0 0 0 2px var(--border-inset);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 1.05rem;
  font-family: var(--font-body);
  padding: 0.6rem 0.7rem;
  outline: none;
}
.search-panel input::placeholder { color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; }
.search-panel input:focus { border-color: var(--purple-light); }
.search-result {
  display: block;
  padding: 0.5rem 0.15rem;
  border-bottom: 1px solid var(--border-mid);
  color: var(--text-main);
  font-size: 0.9rem;
  text-decoration: none;
}
.search-result:hover { background: rgba(117, 80, 151, 0.14); text-decoration: none; }
.search-result .sr-cat {
  display: block;
  font-family: var(--font-pixel);
  font-size: 0.9rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.menu-toggle {
  display: none;
  background: var(--bg-night);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  color: var(--purple-light);
  font-size: 1.3rem;
  padding: 0 0.5rem;
  cursor: pointer;
  margin-left: auto;
}

/* ---------- breadcrumb ---------- */
.breadcrumb {
  font-family: var(--font-pixel);
  font-size: 1rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0.9rem 0 0.2rem;
  margin-bottom: 0.4rem;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--purple-light); text-decoration: none; }
.breadcrumb .crumb-sep { color: var(--purple-dark); }

/* ---------- hero: illustrated neighborhood poster ---------- */
.hero {
  display: grid;
  grid-template-columns: 45fr 55fr;
  gap: 2rem;
  align-items: center;
  padding: 2.2rem 0 1.2rem;
}
.hero-eyebrow {
  font-family: var(--font-pixel);
  font-size: 1.05rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--purple-light);
  margin-bottom: 0.35rem;
}
.hero h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); margin-bottom: 0.5rem; }
.hero-tagline { font-size: 1.02rem; color: var(--text-muted); margin-bottom: 1.3rem; max-width: 34rem; }
.hero-ctas { display: flex; gap: 0.7rem; flex-wrap: wrap; }

.hero-art { position: relative; }
.hero-frame {
  background: var(--bg-panel);
  border: 2px solid var(--border-mid);
  border-radius: var(--radius-sm);
  box-shadow: var(--box-frame), 0 8px 0 rgba(9, 8, 11, 0.55);
  padding: 0.5rem;
}
.hero-frame img {
  width: 100%;
  display: block;
  border: 1px solid var(--border-inset);
  border-radius: 0;
  filter: saturate(0.92) contrast(1.04);
}
.hero-caption {
  font-family: var(--font-body);
  font-size: 0.76rem;
  color: var(--text-dim);
  padding: 0.45rem 0.15rem 0.1rem;
}

/* ---------- buttons: pixel / comic rectangular ---------- */
.hero-btn, .btn {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-sm);
  border: 2px solid #9783a4;
  background: #694d7c;
  color: #f3eef7;
  box-shadow: inset 0 0 0 2px #3a2b45, 0 3px 0 #2a1f33;
  transition: transform 0.15s ease, background 0.15s ease;
}
.hero-btn:hover, .btn:hover {
  background: var(--purple);
  color: #fff;
  text-decoration: none;
  transform: translateY(1px);
  box-shadow: inset 0 0 0 2px #3a2b45, 0 2px 0 #2a1f33;
}
.btn--secondary {
  background: #191722;
  border-color: var(--border-mid);
  color: var(--purple-light);
  box-shadow: inset 0 0 0 2px var(--border-inset), 0 3px 0 #09080b;
}
.btn--secondary:hover { background: var(--purple-dark); color: var(--text-main); }

/* ---------- game info bar ---------- */
.game-info-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0;
  background: var(--bg-panel);
  border: 2px solid var(--border-mid);
  border-radius: var(--radius-sm);
  box-shadow: var(--box-frame);
  margin: 1.5rem 0 0.6rem;
}
.info-cell { text-align: center; padding: 0.85rem 0.6rem; border-right: 1px solid var(--border-mid); }
.info-cell:last-child { border-right: 0; }
.info-cell .label,
.info-cell small {
  display: block;
  font-family: var(--font-pixel);
  font-size: 0.98rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 0.1rem;
}
.info-cell .value { font-family: var(--font-body); font-weight: 600; font-size: 0.9rem; color: var(--moon-yellow); }

/* ---------- cards: neighborhood report / inventory panels ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; margin: 1.2rem 0 0.6rem; }
.card {
  background: #211f27;
  border: 1px solid #746c7c;
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 2px var(--border-inset), 0 4px 0 rgba(9, 8, 11, 0.5);
  padding: 1rem 1.05rem;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.card:hover { transform: translateY(-2px); border-color: var(--purple-light); background: var(--bg-panel-alt); }
.card h3 { margin: 0.15rem 0 0.4rem; font-size: 1.02rem; color: var(--text-main); }
.card h3 a { color: var(--text-main); }
.card h3 a:hover { color: var(--moon-yellow); text-decoration: none; }
.card p { font-size: 0.86rem; color: var(--text-muted); margin-bottom: 0.6rem; }
.card-icon { display: inline-flex; color: var(--purple-light); margin-bottom: 0.3rem; }
.card-link {
  font-family: var(--font-pixel);
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--moon-yellow);
}
.card-link:hover { text-decoration: none; color: #fff; }

/* card with cover image */
.card--media { padding: 0; overflow: hidden; }
.card--media .card-thumb {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid #746c7c;
  background: #0d0c11;
}
.card--media .card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.85) contrast(1.05);
  transition: filter 0.2s ease;
}
.card--media:hover .card-thumb img { filter: saturate(0.95) contrast(1.06) brightness(1.05); }
.card--media .card-body { padding: 0.85rem 1rem 1rem; }
.card-tag {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 0.95rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--purple-light);
  border: 1px solid var(--purple-dark);
  background: rgba(63, 43, 82, 0.35);
  padding: 0.05rem 0.45rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.35rem;
}

/* compact category tiles */
.entry-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem; margin: 1.2rem 0 0.6rem; }
.entry-card {
  background: #211f27;
  border: 1px solid #746c7c;
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 2px var(--border-inset);
  padding: 0.85rem 0.95rem;
  text-decoration: none;
  color: var(--text-main);
  display: block;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.entry-card:hover { transform: translateY(-2px); border-color: var(--purple-light); background: var(--bg-panel-alt); color: var(--text-main); text-decoration: none; }
.entry-card .card-icon { font-size: 1.4rem; margin-bottom: 0.1rem; }
.entry-card h3 { margin: 0.15rem 0 0.25rem; color: var(--moon-yellow); font-size: 0.98rem; }
.entry-card p { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0; }

/* ---------- callouts: RPG dialogue boxes ---------- */
.tip-box, .warning-box, .info-box, .secret-box, .fact-box {
  position: relative;
  background: #1b1a20;
  border: 2px solid var(--border-mid);
  border-radius: var(--radius-sm);
  box-shadow: var(--box-frame);
  padding: 0.9rem 1.1rem 0.95rem;
  margin: 1.2rem 0;
  font-size: 0.92rem;
}
.tip-box { border-color: var(--purple); }
.info-box { border-color: var(--purple); }
.warning-box { border-color: var(--blood-red-dark); }
.important-box { border-color: var(--warm-yellow); }
.secret-box { border-color: var(--purple-dark); background: #191622; }
.fact-box { border-color: var(--lavender-line); background: var(--bg-panel); }

.tip-box strong, .warning-box strong, .info-box strong, .secret-box strong,
.important-box strong, .fact-box strong {
  display: block;
  font-family: var(--font-pixel);
  font-size: 1.05rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}
.tip-box strong, .info-box strong { color: var(--purple-light); }
.warning-box strong { color: #d98a8c; }
.important-box strong { color: var(--moon-yellow); }
.secret-box strong { color: #c6a8e0; }
.fact-box strong { color: var(--lavender-line); }
.tip-box p:last-child, .warning-box p:last-child, .info-box p:last-child,
.secret-box p:last-child, .important-box p:last-child, .fact-box p:last-child { margin-bottom: 0; }

/* ---------- sidebar: small in-game menu ---------- */
.sidebar { position: sticky; top: 84px; max-height: calc(100vh - 104px); overflow-y: auto; scrollbar-width: thin; }
.nav-section {
  background: var(--bg-panel);
  border: 1px solid #746c7c;
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 2px var(--border-inset);
  padding: 0.8rem 0.9rem;
  margin-bottom: 0.9rem;
  font-size: 0.84rem;
}
.nav-section h3 {
  font-family: var(--font-pixel);
  font-size: 1rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--lavender-line);
  border-bottom: 1px solid var(--border-mid);
  padding-bottom: 0.35rem;
  margin: 0 0 0.5rem;
}
.nav-section ul { list-style: none; margin: 0; }
.nav-section li { margin-bottom: 0.25rem; }
.nav-section a { text-decoration: none; color: var(--text-muted); font-size: 0.84rem; }
.nav-section a:hover { color: var(--moon-yellow); text-decoration: none; }

/* ---------- article body ---------- */
.main-content { min-width: 0; max-width: 820px; }
.main-content img {
  max-width: 100%;
  height: auto;
  border: 2px solid var(--border-mid);
  border-radius: var(--radius-sm);
  box-shadow: 0 5px 0 rgba(9, 8, 11, 0.55);
  margin: 0.9rem 0 0.3rem;
  filter: saturate(0.9) contrast(1.04);
}
.img-caption {
  font-family: var(--font-pixel);
  font-size: 1rem;
  letter-spacing: 0.03em;
  color: var(--text-dim);
  margin: 0 0 1.3rem;
}
.page-intro { font-size: 1.02rem; color: var(--text-muted); }
.last-updated {
  font-family: var(--font-pixel);
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid #2f2a36;
}
.game-divider {
  text-align: center;
  color: var(--purple-dark);
  letter-spacing: 0.6em;
  margin: 1.6rem 0;
  font-size: 0.9rem;
}
.quick-answer {
  background: var(--bg-panel);
  border: 2px solid var(--lavender-line);
  border-radius: var(--radius-sm);
  box-shadow: var(--box-frame);
  padding: 0.9rem 1.1rem;
  margin: 0 0 1.3rem;
}
.quick-answer strong {
  display: block;
  font-family: var(--font-pixel);
  font-size: 1.05rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--moon-yellow);
  margin-bottom: 0.25rem;
}
.quick-answer p:last-child { margin-bottom: 0; }
.jump-links { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.9rem 0 1.4rem; }
.jump-links a {
  font-size: 0.78rem;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  padding: 0.16rem 0.55rem;
  color: var(--text-muted);
  background: #1b1a20;
}
.jump-links a:hover { color: var(--moon-yellow); border-color: var(--purple-light); text-decoration: none; }

/* ---------- tables: game inventory UI ---------- */
.table-scroll { margin: 1.2rem 0; overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  background: #1b1a20;
  border: 2px solid var(--border-mid);
  border-radius: var(--radius-sm);
  border-spacing: 0;
}
th {
  background: #39313f;
  color: var(--moon-yellow);
  font-family: var(--font-pixel);
  font-size: 1.02rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  padding: 0.5rem 0.7rem;
  text-align: left;
  border-bottom: 2px solid var(--border-mid);
}
td { padding: 0.5rem 0.7rem; border-top: 1px solid #2f2a36; vertical-align: top; color: var(--text-muted); }
tr:nth-child(even) td { background: #211f27; }
td strong { color: var(--text-main); }
.ach-icon { width: 40px; height: 40px; border-radius: var(--radius-sm); object-fit: cover; border: 1px solid var(--border-mid); }

/* ---------- recipe / item panel (heavier pixel UI) ---------- */
.recipe-panel {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  background: #16151c;
  border: 2px solid var(--border-mid);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 2px var(--border-inset);
  padding: 0.9rem 1rem;
  margin: 1.2rem 0;
}
.recipe-panel .recipe-icon {
  width: 96px; height: 96px;
  border: 2px solid var(--purple-dark);
  background: #0d0c11;
  display: grid; place-items: center;
  color: var(--purple-light);
}
.recipe-panel h3 { margin: 0 0 0.25rem; color: var(--moon-yellow); }
.recipe-panel .stat-line { font-size: 0.86rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.recipe-panel .ingredients { margin: 0; list-style: none; }
.recipe-panel .ingredients li { font-size: 0.86rem; color: var(--purple-light); }

/* ---------- FAQ ---------- */
details.faq-item {
  background: #1b1a20;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 2px var(--border-inset);
  padding: 0.7rem 1rem;
  margin-bottom: 0.6rem;
}
details.faq-item summary {
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
  list-style: none;
}
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item summary::before { content: '☾ '; color: var(--purple-light); }
details.faq-item[open] summary { color: var(--moon-yellow); }
details.faq-item p { font-size: 0.9rem; color: var(--text-muted); margin: 0.55rem 0 0.15rem; }

/* ---------- video embed ---------- */
.video-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border: 2px solid var(--border-mid);
  border-radius: var(--radius-sm);
  box-shadow: 0 5px 0 rgba(9, 8, 11, 0.55);
  margin: 1.2rem 0 0.3rem;
}
.video-wrap iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
.video-source { font-size: 0.78rem; color: var(--text-dim); margin-bottom: 1.3rem; }

/* ---------- related / cross-links ---------- */
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.9rem; margin: 1.1rem 0 0.8rem; }

/* ---------- footer nightscape ---------- */
.site-footer {
  background: #0f0e13;
  border-top: 3px double var(--lavender-line);
  margin-top: 2rem;
  padding: 0 1.2rem 1.6rem;
}
.footer-scape { display: block; width: 100%; max-width: 1200px; margin: 0 auto; height: auto; }
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 2.2rem;
  justify-content: space-between;
  padding-top: 1.2rem;
}
.footer-col { min-width: 150px; }
.footer-col strong {
  display: block;
  font-family: var(--font-pixel);
  font-size: 1rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--lavender-line);
  margin-bottom: 0.45rem;
}
.footer-col a { display: block; font-size: 0.83rem; color: var(--text-muted); padding: 0.13rem 0; }
.footer-col a:hover { color: var(--moon-yellow); text-decoration: none; }
.footer-copy {
  max-width: 1200px;
  margin: 1.3rem auto 0;
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
  border-top: 1px solid #2a2631;
  padding-top: 1rem;
}
.footer-copy strong { color: var(--text-muted); }

/* ---------- tags ---------- */
.tag {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.05rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-mid);
  margin-left: 0.3rem;
  vertical-align: middle;
  color: var(--text-muted);
}
.tag--common { border-color: #4d6b4a; color: #9dc39a; }
.tag--rare { border-color: var(--warm-yellow); color: var(--moon-yellow); }
.tag--ultra { border-color: var(--blood-red); color: #d98a8c; }
.tag--hidden { border-color: var(--purple); color: var(--purple-light); }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 3.5rem 0; }
.notfound .big { font-size: 4rem; color: var(--purple-light); }
.notfound h1 { margin: 0.6rem 0; }

/* ---------- responsive ---------- */
@media (max-width: 1240px) and (min-width: 861px) {
  .content-wrapper { grid-template-columns: 232px minmax(0, 1fr); }
  .ad-rail { display: none; }
}
@media (max-width: 860px) {
  .content-wrapper { grid-template-columns: minmax(0, 1fr); }
  .related-links { display: none; }
  .sidebar { position: static; max-height: none; overflow: visible; }
  .main-content { max-width: 100%; }
  .main-content table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: minmax(0, 1fr); padding-top: 1.4rem; }
  .hero-art { order: 2; max-width: 520px; }
  .hero h1 { font-size: clamp(1.8rem, 7vw, 2.4rem); }
  .recipe-panel { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .entry-grid { grid-template-columns: minmax(0, 1fr); }
  .menu-toggle { display: block; }
  .header-nav { display: none; width: 100%; flex-direction: column; padding: 0.5rem 0 0.2rem; gap: 0.1rem; }
  .header-nav.open { display: flex; }
  .nav-card { padding-bottom: 0.6rem; }
  .game-info-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .info-cell:nth-child(2n) { border-right: 0; }
  body { font-size: 15.5px; }
}

/* ---------- anchor jump precision + permalinks ---------- */
h2[id], h3[id] { position: relative; scroll-margin-top: 88px; }
.anchor-link {
  position: absolute;
  margin-left: 0.4rem;
  opacity: 0;
  color: var(--purple-light);
  text-decoration: none;
  font-weight: normal;
  font-size: 0.8em;
  transition: opacity 0.15s;
}
h2[id]:hover .anchor-link, h3[id]:hover .anchor-link, .anchor-link:focus { opacity: 1; }

/* ============ AD LAYOUT STANDARD ============ */
.ad-slot { text-align: center; margin: 1.5rem auto; padding: 0.5rem 0; max-width: 100%; overflow: hidden; }
.ad-rail { position: sticky; top: 84px; align-self: start; height: fit-content; }
.ad-leader {
  position: sticky;
  top: 70px;
  z-index: 50;
  max-width: 760px;
  margin: 0 auto;
  background: var(--bg-panel);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  padding: 0.15rem 1.9rem 0.15rem 0.15rem;
}
.ad-leader img { margin: 0; border: none; filter: none; box-shadow: none; }
.ad-leader .ad-leader-close {
  position: absolute;
  top: 0.15rem;
  right: 0.3rem;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
}
.ad-leader .ad-leader-close:hover { color: var(--moon-yellow); }
.ad-leader.ad-leader-hidden { display: none !important; }
.ad-leader-mobile { display: none; }
.ad-container { max-width: 728px; margin: 0 auto; }
.ad-float { position: fixed; top: 80px; z-index: 90; }
.ad-float-left { left: max(8px, calc((100vw - 1200px) / 2 - 176px)); }
.ad-float-right { right: max(8px, calc((100vw - 1200px) / 2 - 176px)); }
@media (max-width: 1440px) { .ad-float-left, .ad-float-right { display: none; } }
@media (max-width: 768px) {
  .ad-leader { top: 64px; max-width: 100%; margin: 0 auto; }
  .ad-leader .ad-container { display: none; }
  .ad-leader-mobile { display: block; max-width: 100%; overflow: hidden; }
  .ad-container, .sidebar-ad { max-width: 100%; overflow: hidden; }
}
.ad-container::before,
.sidebar-ad::before,
.ad-slot::before,
.ad-leader-mobile::before {
  content: "Advertisement";
  display: block;
  font-family: var(--font-pixel);
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 0.3rem;
}
