/* ============================================================
   WEBERS GUTE FREUNDE — LORE TRACKER
   RPG Adventure Log Stylesheet
   ============================================================ */

/* ── Self-hosted fonts (kein Google CDN) ───────────────────── */
@font-face {
  font-family: 'Press Start 2P';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/PressStart2P-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Press Start 2P';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/PressStart2P-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'VT323';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/VT323-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'VT323';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/VT323-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg:          #090806;
  --bg2:         #0f0c08;
  --surface:     #17120d;
  --surface2:    #201a12;
  --surface3:    #2c2318;

  --primary:     #c8a84b;
  --primary-dim: #7a6028;
  --accent:      #4ecdc4;
  --accent2:     #f7c59f;
  --gold:        #ffd700;
  --danger:      #e94560;

  --text:        #e8ddd0;
  --text-dim:    #9a8878;
  --text-bright: #fff8ee;
  --border:      #362818;
  --border-bright: #5a4030;

  --cat-running-gag:    #57c7a5;
  --cat-segment:        #5b8edb;
  --cat-character-lore: #a66fd1;
  --cat-event:          #d4a017;
  --cat-catchphrase:    #d47535;
  --cat-lore:           #c44569;

  --font-pixel: 'Press Start 2P', monospace;
  --font-body:  'VT323', 'Courier New', monospace;
  --controls-height: 0px;

  --pixel-1: 4px;
  --pixel-2: 8px;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Base ──────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  image-rendering: pixelated;
}

/* CRT scanlines + vignette */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 40%, transparent 25%, rgba(0,0,0,0.65) 100%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 3px,
      rgba(0, 0, 0, 0.07) 3px,
      rgba(0, 0, 0, 0.07) 4px
    );
  pointer-events: none;
  z-index: 9999;
}

/* Subtle background grid */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(200,168,75,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(200,168,75,0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--primary);
  border: 2px solid var(--bg);
}

/* ── Layout ────────────────────────────────────────────────── */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Header ────────────────────────────────────────────────── */
#site-header {
  position: relative;
  z-index: 10;
  padding: 40px 0 32px;
  border-bottom: 4px solid var(--primary);
  background: linear-gradient(180deg, rgba(200,168,75,0.10) 0%, transparent 100%);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 32px;
}

.logo-wrap svg {
  display: block;
  filter: drop-shadow(0 0 14px rgba(200,168,75,0.55));
}

.header-text {
  flex: 1;
}

.header-text h1,
.header-text .site-brand {
  font-family: var(--font-pixel);
  font-size: clamp(14px, 2.5vw, 22px);
  line-height: 1.5;
  color: var(--text-bright);
  text-shadow: 0 0 20px var(--primary), 3px 3px 0 var(--primary-dim);
  letter-spacing: 2px;
  animation: glitch 7s linear infinite;
  margin: 0;
}

.header-text .tagline {
  margin-top: 12px;
  font-size: 8px;
  color: var(--accent);
  letter-spacing: 3px;
  text-shadow: 0 0 8px var(--accent);
}

.header-meta {
  display: flex;
  gap: 20px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.header-badge {
  font-size: 7px;
  color: var(--text-dim);
  background: var(--surface2);
  border: 2px solid var(--border);
  padding: 4px 10px;
  letter-spacing: 1px;
}

.header-badge span {
  color: var(--accent2);
}

/* Blinking cursor animation */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 12px;
  background: var(--primary);
  vertical-align: middle;
  animation: blink 1s step-end infinite;
  margin-left: 4px;
}

/* ── Header Actions (CTAs) ─────────────────────────────────── */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.btn-cta-primary {
  font-family: var(--font-body);
  font-size: 20px;
  letter-spacing: 1px;
  color: var(--bg);
  background: var(--primary);
  padding: 9px 18px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.12s;
  white-space: nowrap;
}
.btn-cta-primary:hover { background: var(--accent); }

.btn-cta-secondary {
  font-family: var(--font-body);
  font-size: 18px;
  letter-spacing: 1px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 8px 16px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.btn-cta-secondary:hover {
  color: var(--primary);
  border-color: var(--primary);
}

/* ── Controls Bar ──────────────────────────────────────────── */
#controls {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg2);
  border-bottom: 3px solid var(--border);
  padding: 14px 0;
}

#filter-toggle {
  display: none;
}

.controls-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 7px;
  color: var(--text-dim);
  letter-spacing: 2px;
  min-width: 64px;
  flex-shrink: 0;
}

.filter-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Filter buttons */
.filter-btn {
  font-family: var(--font-pixel);
  font-size: 7px;
  padding: 6px 10px;
  background: var(--surface);
  color: var(--text-dim);
  border: 2px solid var(--border);
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 0.1s;
  position: relative;
}

.filter-btn:hover {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--border-bright);
}

.filter-btn.active {
  background: var(--primary);
  color: var(--text-bright);
  border-color: var(--primary);
  text-shadow: 1px 1px 0 var(--primary-dim);
  animation: btn-punch 0.2s ease-out;
}

.filter-btn[data-cat].active {
  background: var(--cat-color, var(--primary));
  border-color: var(--cat-color, var(--primary));
}

/* Search */
#search-input {
  font-family: var(--font-pixel);
  font-size: 8px;
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--border);
  padding: 8px 14px;
  width: 260px;
  outline: none;
  letter-spacing: 1px;
}

#search-input::placeholder { color: var(--text-dim); }

#search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(78, 205, 196, 0.2);
}

/* ── Stats bar ─────────────────────────────────────────────── */
#stats-bar {
  padding: 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

#result-count {
  font-size: 7px;
  color: var(--text-dim);
  letter-spacing: 2px;
}

#result-count strong {
  color: var(--accent);
}

.submit-btn {
  font-family: var(--font-pixel);
  font-size: 7px;
  padding: 8px 16px;
  background: transparent;
  color: var(--gold);
  border: 2px solid var(--gold);
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 0.1s;
}

.submit-btn:hover {
  background: var(--gold);
  color: var(--bg);
}

/* ── Lore Grid ─────────────────────────────────────────────── */
#lore-grid {
  position: relative;
  z-index: 1;
  padding: 24px 0 48px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

/* ── Lore Card ─────────────────────────────────────────────── */
.lore-card {
  background: linear-gradient(150deg, var(--surface) 0%, var(--bg2) 100%);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s, border-color 0.1s;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* RPG item frame — corner brackets */
.lore-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(var(--cat-color, var(--primary)), var(--cat-color, var(--primary))) 0 0 / 14px 2px no-repeat,
    linear-gradient(var(--cat-color, var(--primary)), var(--cat-color, var(--primary))) 0 0 / 2px 14px no-repeat,
    linear-gradient(var(--cat-color, var(--primary)), var(--cat-color, var(--primary))) 100% 0 / 14px 2px no-repeat,
    linear-gradient(var(--cat-color, var(--primary)), var(--cat-color, var(--primary))) 100% 0 / 2px 14px no-repeat,
    linear-gradient(var(--cat-color, var(--primary)), var(--cat-color, var(--primary))) 0 100% / 14px 2px no-repeat,
    linear-gradient(var(--cat-color, var(--primary)), var(--cat-color, var(--primary))) 0 100% / 2px 14px no-repeat,
    linear-gradient(var(--cat-color, var(--primary)), var(--cat-color, var(--primary))) 100% 100% / 14px 2px no-repeat,
    linear-gradient(var(--cat-color, var(--primary)), var(--cat-color, var(--primary))) 100% 100% / 2px 14px no-repeat;
  pointer-events: none;
  z-index: 1;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.lore-card:hover {
  transform: translateY(-3px);
  border-color: var(--cat-color, var(--border-bright));
  box-shadow:
    0 8px 0 0 var(--bg),
    0 8px 0 1px var(--cat-color, var(--border)),
    0 0 24px rgba(0,0,0,0.6);
}

.lore-card:hover::before {
  opacity: 1;
}

.card-inner {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

/* Category badge */
.cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 6px;
  padding: 3px 8px;
  color: var(--bg);
  background: var(--cat-color, var(--border));
  letter-spacing: 1px;
}

.cat-badge svg {
  flex-shrink: 0;
  display: block;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

/* Episode pills on card */
.ep-pills {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.ep-pill {
  font-size: 6px;
  padding: 3px 6px;
  background: var(--surface2);
  color: var(--text-dim);
  border: 1px solid var(--border);
  letter-spacing: 1px;
}

/* Card title */
.card-title {
  font-size: 10px;
  line-height: 1.6;
  color: var(--text-bright);
  letter-spacing: 0px;
}

/* Card description */
.card-desc {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text);
  line-height: 1.45;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card footer */
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  gap: 8px;
  flex-wrap: wrap;
}

.first-ep-tag {
  font-size: 6px;
  color: var(--gold);
  letter-spacing: 1px;
}

.unconfirmed-tag {
  font-size: 6px;
  color: var(--danger);
  letter-spacing: 1px;
  border: 1px solid var(--danger);
  padding: 2px 5px;
}

.card-detail-btn {
  font-size: 6px;
  font-family: var(--font-pixel);
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  letter-spacing: 1px;
  padding: 0;
}

.card-detail-btn:hover { color: var(--text-bright); }

.footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Tags on card */
.card-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.tag {
  font-size: 6px;
  padding: 2px 6px;
  background: var(--surface3);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

/* ── Empty State ───────────────────────────────────────────── */
#empty-state {
  display: none;
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}

#empty-state .empty-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 20px;
  opacity: 0.4;
}

#empty-state p {
  font-size: 9px;
  letter-spacing: 1px;
}

/* ── Modal ─────────────────────────────────────────────────── */
#modal-overlay {
  display: flex;
  position: fixed;
  inset: 0;
  background: rgba(9, 8, 6, 0.92);
  z-index: 100;
  padding: 20px;
  overflow-y: auto;
  align-items: flex-start;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s;
}

#modal-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

#modal-box {
  background: var(--surface);
  border: 3px solid var(--primary);
  max-width: 740px;
  width: 100%;
  margin: auto;
  position: relative;
  box-shadow: 8px 8px 0 var(--primary-dim), 0 0 60px rgba(200,168,75,0.18);
  transform: scale(0.95) translateY(12px);
  transition: transform 0.22s cubic-bezier(0.34, 1.26, 0.64, 1);
}

#modal-overlay.open #modal-box {
  transform: scale(1) translateY(0);
}

/* Pixel corner accents */
#modal-box::before,
#modal-box::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--primary);
}
#modal-box::before { top: -3px; left: -3px; }
#modal-box::after  { bottom: -3px; right: -3px; }

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 2px solid var(--border);
  background: var(--surface2);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-header-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.modal-header-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

#modal-close {
  font-family: var(--font-pixel);
  font-size: 10px;
  background: var(--surface3);
  color: var(--text);
  border: 2px solid var(--border);
  padding: 12px 16px;
  cursor: pointer;
  flex-shrink: 0;
  letter-spacing: 1px;
  transition: all 0.1s;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#modal-close:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.modal-title {
  font-size: clamp(10px, 2vw, 14px);
  color: var(--text-bright);
  line-height: 1.5;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.5);
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.modal-section-label {
  font-size: 7px;
  color: var(--text-dim);
  letter-spacing: 3px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.modal-description {
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--text);
  line-height: 1.55;
}

/* Episodes in modal */
.modal-episodes {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.modal-ep-badge {
  font-size: 7px;
  padding: 5px 12px;
  background: var(--surface2);
  color: var(--accent);
  border: 2px solid var(--border-bright);
  letter-spacing: 1px;
}

.modal-ep-badge.first-ep {
  border-color: var(--gold);
  color: var(--gold);
}

/* Quotes */
.quotes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quote-item {
  background: var(--bg2);
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  position: relative;
}

.quote-text {
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--text);
  line-height: 1.5;
  font-style: italic;
}

.quote-meta {
  font-size: 6px;
  color: var(--text-dim);
  margin-top: 6px;
  letter-spacing: 1px;
}

.quote-meta .ep-ref {
  color: var(--accent);
}

/* Related entries */
.related-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.related-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface2);
  border: 2px solid var(--border);
  padding: 10px 14px;
  cursor: pointer;
  transition: border-color 0.1s, background 0.1s;
}

.related-item:hover {
  border-color: var(--primary);
  background: var(--surface3);
}

.related-item .cat-dot {
  width: 8px;
  height: 8px;
  background: var(--cat-color, var(--border));
  flex-shrink: 0;
}

.related-item .related-title {
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--text);
  flex: 1;
}

.related-item .related-arrow {
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--text-dim);
}

/* Tags in modal */
.modal-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.modal-tag {
  font-size: 6px;
  padding: 3px 8px;
  background: var(--surface3);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

/* Unconfirmed notice */
.unconfirmed-notice {
  background: rgba(233, 69, 96, 0.1);
  border: 2px solid var(--danger);
  padding: 10px 14px;
  font-size: 16px;
  color: var(--danger);
  letter-spacing: 0.5px;
  line-height: 1.7;
}

/* ── Submit Modal ───────────────────────────────────────────── */
#submit-overlay {
  display: flex;
  position: fixed;
  inset: 0;
  background: rgba(9, 8, 6, 0.92);
  z-index: 100;
  padding: 20px;
  overflow-y: auto;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s;
}

#submit-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

#submit-box {
  background: var(--surface);
  border: 3px solid var(--gold);
  max-width: 580px;
  width: 100%;
  box-shadow: 8px 8px 0 rgba(255, 215, 0, 0.2);
  transform: scale(0.95) translateY(12px);
  transition: transform 0.22s cubic-bezier(0.34, 1.26, 0.64, 1);
}

#submit-overlay.open #submit-box {
  transform: scale(1) translateY(0);
}

.submit-header {
  padding: 18px 22px;
  background: var(--surface2);
  border-bottom: 2px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.submit-header h2 {
  font-size: 10px;
  color: var(--gold);
  letter-spacing: 1px;
}

.submit-close-btn {
  font-family: var(--font-pixel);
  font-size: 10px;
  background: var(--surface3);
  color: var(--text);
  border: 2px solid var(--border);
  padding: 6px 10px;
  cursor: pointer;
}

.submit-close-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.submit-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 7px;
  color: var(--text-dim);
  letter-spacing: 2px;
}

.form-input,
.form-select,
.form-textarea {
  font-family: var(--font-body);
  font-size: 18px;
  background: var(--bg2);
  color: var(--text);
  border: 2px solid var(--border);
  padding: 8px 12px;
  outline: none;
  width: 100%;
  letter-spacing: 0.5px;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--gold);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 2;
}

.form-select option {
  background: var(--surface2);
}

.form-hint {
  font-size: 6px;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.form-submit-btn {
  font-family: var(--font-pixel);
  font-size: 8px;
  padding: 12px 20px;
  background: var(--gold);
  color: var(--bg);
  border: none;
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 0.1s;
  align-self: flex-end;
}

.form-submit-btn:hover {
  background: var(--text-bright);
  box-shadow: 4px 4px 0 var(--gold);
}

/* ── Footer ────────────────────────────────────────────────── */
#site-footer {
  position: relative;
  z-index: 1;
  border-top: 4px solid var(--border);
  padding: 24px 0;
  background: var(--bg2);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-text {
  font-size: 7px;
  color: var(--text-dim);
  letter-spacing: 1px;
  line-height: 2;
}

.footer-text a {
  color: var(--accent);
  text-decoration: none;
}

.footer-pixel-art {
  opacity: 0.4;
}

/* ── Pixel divider ─────────────────────────────────────────── */
.pixel-divider {
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    var(--primary) 0px,
    var(--primary) 8px,
    transparent 8px,
    transparent 12px,
    var(--accent) 12px,
    var(--accent) 20px,
    transparent 20px,
    transparent 24px
  );
  opacity: 0.85;
  margin: 0;
}

/* ── Card entrance animation ───────────────────────────────── */
@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.lore-card {
  animation: cardIn 0.2s ease-out both;
}

/* Stagger via nth-child (up to 50 cards, capped at 0.6s) */
.lore-card:nth-child(1)  { animation-delay: 0.00s; }
.lore-card:nth-child(2)  { animation-delay: 0.03s; }
.lore-card:nth-child(3)  { animation-delay: 0.06s; }
.lore-card:nth-child(4)  { animation-delay: 0.09s; }
.lore-card:nth-child(5)  { animation-delay: 0.12s; }
.lore-card:nth-child(6)  { animation-delay: 0.15s; }
.lore-card:nth-child(7)  { animation-delay: 0.18s; }
.lore-card:nth-child(8)  { animation-delay: 0.21s; }
.lore-card:nth-child(9)  { animation-delay: 0.24s; }
.lore-card:nth-child(10) { animation-delay: 0.27s; }
.lore-card:nth-child(11) { animation-delay: 0.30s; }
.lore-card:nth-child(12) { animation-delay: 0.33s; }
.lore-card:nth-child(13) { animation-delay: 0.36s; }
.lore-card:nth-child(14) { animation-delay: 0.39s; }
.lore-card:nth-child(15) { animation-delay: 0.42s; }
.lore-card:nth-child(16) { animation-delay: 0.45s; }
.lore-card:nth-child(17) { animation-delay: 0.48s; }
.lore-card:nth-child(18) { animation-delay: 0.51s; }
.lore-card:nth-child(19) { animation-delay: 0.54s; }
.lore-card:nth-child(n+20) { animation-delay: 0.57s; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 700px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .header-text h1,
  .header-text .site-brand { font-size: 16px; }

  #lore-grid {
    grid-template-columns: 1fr;
  }

  #search-input { width: 100%; }

  .filter-label { min-width: auto; }

  #filter-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--primary);
    font-family: var(--font-body);
    font-size: 20px;
    letter-spacing: 1px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.1s, border-color 0.1s;
  }
  #filter-toggle:hover {
    background: var(--surface);
    border-color: var(--primary);
  }

  .filter-active-hint {
    font-size: 16px;
    color: var(--accent);
    opacity: 0;
    transition: opacity 0.15s;
  }
  .filter-active-hint.visible { opacity: 1; }

  #filter-toggle.is-open {
    margin-bottom: 12px;
  }

  .controls-inner {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.28s ease;
    gap: 8px;
  }
  #controls.open .controls-inner {
    max-height: 600px;
  }
}

@media (max-width: 480px) {
  .modal-body  { padding: 16px; }
  .modal-header { padding: 14px 16px; }
}

/* ── View Tabs Bar ─────────────────────────────────────────── */
.view-tabs-bar {
  background: var(--bg2);
  border-bottom: 3px solid var(--border);
  position: sticky;
  top: var(--controls-height, 0px);
  z-index: 19;
}

.view-tabs-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
}

.view-tabs {
  display: flex;
}

.view-tab {
  font-family: var(--font-pixel);
  font-size: 9px;
  padding: 14px 22px;
  background: transparent;
  color: var(--text-dim);
  border: none;
  border-right: 2px solid var(--border);
  border-bottom: 3px solid transparent;
  margin-bottom: -3px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: color 0.1s, background 0.1s, border-color 0.1s;
}

.view-tab:hover:not(.active) {
  color: var(--text);
  background: var(--surface);
}

.view-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--bg);
}

.view-search-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding-right: 8px;
}

/* ── Grid / Network view containers ───────────────────────── */
#grid-view  { display: block; }
#graph-view {
  display: none;
  position: relative;
  width: 100%;
  height: calc(100vh - 260px);
  min-height: 460px;
  background-color: var(--bg2);
  background-image: radial-gradient(circle, rgba(200,168,75,0.15) 1px, transparent 1px);
  background-size: 28px 28px;
  border: 2px solid var(--border);
  margin-bottom: 24px;
  overflow: hidden;
}

#network-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: default;
}

/* Graph tooltip */
#graph-tooltip {
  position: absolute;
  background: var(--surface2);
  border: 2px solid var(--primary);
  padding: 10px 14px;
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--text-bright);
  pointer-events: none;
  display: none;
  max-width: 220px;
  z-index: 10;
  line-height: 1.8;
  box-shadow: 4px 4px 0 var(--primary-dim);
}

#graph-tooltip strong {
  color: var(--accent);
  display: block;
  margin-bottom: 4px;
}

/* Graph legend */
#graph-legend {
  position: absolute;
  bottom: 12px;
  right: 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  pointer-events: none;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-pixel);
  font-size: 6px;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
}


/* Connection count badge on cards */
.links-count {
  font-size: 7px;
  color: var(--accent);
  letter-spacing: 1px;
  opacity: 0.8;
}

/* Stats bar in network mode */
#stats-bar { min-height: 36px; }

/* ── Focus visible (keyboard navigation) ──────────────────── */
.lore-card:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.related-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.filter-btn:focus-visible,
.view-tab:focus-visible,
.submit-btn:focus-visible,
#modal-close:focus-visible,
.submit-close-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#search-input:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(78, 205, 196, 0.25);
  outline: none;
}

/* ── Image Gallery ─────────────────────────────────────────── */

.image-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0 18px;
  flex-wrap: wrap;
}

.image-filter-bar .filter-label {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--text-dim);
  letter-spacing: 1px;
  white-space: nowrap;
}

#image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  padding-bottom: 48px;
}

.image-thumb {
  cursor: pointer;
  background: var(--surface);
  border: 2px solid var(--border);
  transition: border-color 0.12s;
}

.image-thumb:hover,
.image-thumb:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.image-thumb-inner {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--bg);
}

.image-thumb-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.18s;
}

.image-thumb:hover .image-thumb-inner img {
  transform: scale(1.04);
}

.image-ep-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: rgba(9,8,6,0.88);
  color: var(--accent);
  font-family: var(--font-pixel);
  font-size: 6px;
  padding: 3px 6px;
  letter-spacing: 0.5px;
  pointer-events: none;
}

.image-thumb-caption {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-dim);
  padding: 7px 10px 9px;
  letter-spacing: 0.5px;
  line-height: 1.35;
}

.image-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 72px 20px;
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--text-dim);
  letter-spacing: 1px;
  line-height: 2.4;
}

.image-empty span {
  display: block;
  font-size: 20px;
  margin-bottom: 18px;
  color: var(--border);
}

.image-empty-hint {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-dim);
  margin-top: 12px;
  letter-spacing: 0.5px;
  line-height: 1.6;
}

.image-empty-hint em {
  color: var(--accent);
  font-style: normal;
}

/* ── Lightbox ──────────────────────────────────────────────── */

#lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6,5,3,0.95);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

#lightbox-overlay.open {
  display: flex;
}

#lightbox-box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw;
}

#lightbox-close {
  position: absolute;
  top: -38px;
  right: 0;
  background: none;
  border: 2px solid var(--border);
  color: var(--text);
  font-family: var(--font-pixel);
  font-size: 7px;
  padding: 6px 10px;
  cursor: pointer;
}

#lightbox-close:hover {
  border-color: var(--primary);
  color: var(--primary);
}

#lightbox-content {
  border: 2px solid var(--border);
  background: var(--surface);
}

#lightbox-img {
  display: block;
  max-width: 88vw;
  max-height: 68vh;
  object-fit: contain;
}

#lightbox-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-top: 2px solid var(--border);
}

#lightbox-ep {
  font-family: var(--font-pixel);
  font-size: 6px;
  color: var(--accent);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 3px 6px;
  white-space: nowrap;
}

#lightbox-caption {
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--text);
  letter-spacing: 0.5px;
  margin: 0;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(9,8,6,0.85);
  border: 2px solid var(--border);
  color: var(--text);
  font-family: var(--font-pixel);
  font-size: 9px;
  padding: 10px 14px;
  cursor: pointer;
  z-index: 2;
  align-items: center;
  justify-content: center;
}

#lightbox-prev { left:  -56px; }
#lightbox-next { right: -56px; }

@media (max-width: 700px) {
  #lightbox-prev { left:  8px; }
  #lightbox-next { right: 8px; }
}

.lightbox-nav:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Cassette reel spin ────────────────────────────────────── */
@keyframes reel-spin {
  to { transform: rotate(360deg); }
}

.reel-left,
.reel-right {
  transform-box: fill-box;
  transform-origin: center;
  animation: reel-spin 3s linear infinite;
}

/* ── H1 glitch ─────────────────────────────────────────────── */
@keyframes glitch {
  0%, 88%, 100% {
    text-shadow: 0 0 20px var(--primary), 3px 3px 0 var(--primary-dim);
    transform: none;
  }
  89% {
    text-shadow: -4px 0 var(--accent), 4px 0 var(--primary);
    transform: translateX(3px);
  }
  90% {
    text-shadow: 3px 0 var(--accent), -3px 0 var(--primary);
    transform: translateX(-2px);
  }
  91% {
    text-shadow: 0 0 20px var(--primary), 3px 3px 0 var(--primary-dim);
    transform: none;
  }
  92% {
    text-shadow: -2px 0 #a8ff78, 2px 0 var(--primary), 0 0 20px var(--primary);
    transform: skewX(2deg);
  }
  93%, 100% {
    text-shadow: 0 0 20px var(--primary), 3px 3px 0 var(--primary-dim);
    transform: none;
  }
}

/* ── Status LED ─────────────────────────────────────────────── */
@keyframes led-pulse {
  0%, 100% { opacity: 1;   text-shadow: 0 0 6px #2ed573, 0 0 14px #2ed573; }
  50%       { opacity: 0.25; text-shadow: none; }
}

.status-live::before {
  content: '●';
  color: #2ed573;
  margin-right: 5px;
  display: inline-block;
  animation: led-pulse 2s ease-in-out infinite;
}

/* ── Filter button punch ────────────────────────────────────── */
@keyframes btn-punch {
  0%   { transform: scale(1); }
  35%  { transform: scale(0.88); }
  65%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}

/* Character filter active color */
.filter-btn[data-char].active {
  background: var(--cat-color, var(--primary));
  border-color: var(--cat-color, var(--primary));
  color: var(--bg);
}

/* ── Card: top accent + scanline sweep ─────────────────────── */
.lore-card {
  border-top-color: var(--cat-color, var(--border));
}

.lore-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(255,255,255,0.045) 50%,
    transparent 100%
  );
  transform: translateY(-110%);
  pointer-events: none;
  z-index: 2;
  transition: transform 0s;
}

.lore-card:hover::after {
  transform: translateY(110%);
  transition: transform 0.55s ease;
}

/* Enhanced hover glow */
.lore-card:hover {
  box-shadow:
    0 8px 0 0 var(--bg),
    0 8px 0 1px var(--cat-color, var(--border)),
    0 0 32px rgba(0,0,0,0.7),
    inset 0 0 20px rgba(0,0,0,0.2);
}

/* ── Quote decorative mark ──────────────────────────────────── */
.quote-item::before {
  content: '\201C';
  position: absolute;
  top: -6px;
  left: 10px;
  font-family: var(--font-body);
  font-size: 72px;
  line-height: 1;
  color: var(--accent);
  opacity: 0.12;
  pointer-events: none;
  user-select: none;
}

/* ── Reduce motion ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .reel-left, .reel-right      { animation: none; }
  .header-text h1               { animation: none; }
  .status-live::before          { animation: none; }
  .lore-card::after             { transition: none; }
  #modal-box, #submit-box       { transition: none; }
  #modal-overlay, #submit-overlay { transition: none; }
}

/* ── RPG Adventure Log — Typography System ──────────────────── */

/* Press Start 2P: display moments only */
.header-text h1,
.filter-label,
.modal-section-label {
  font-family: var(--font-pixel);
}

/* VT323 for all functional UI */
.filter-btn, .view-tab, .submit-btn, .submit-close-btn,
#search-input, #modal-close, .card-detail-btn,
.form-submit-btn, .form-label, .form-hint,
#graph-tooltip, .legend-item,
.image-ep-badge, .image-empty, #lightbox-ep, .lightbox-nav,
.quote-meta, .related-title, .related-arrow,
.header-badge, .header-text .tagline,
.modal-ep-badge, .modal-tag, .tag,
.ep-pill, .cat-badge, .card-title,
.first-ep-tag, .unconfirmed-tag, .links-count,
.footer-text, #result-count,
.submit-header h2 {
  font-family: var(--font-body);
}

/* Size calibration for VT323 */
.filter-btn        { font-size: 17px; letter-spacing: 0.5px; padding: 7px 12px; }
.view-tab          { font-size: 20px; padding: 12px 22px; }
.submit-btn        { font-size: 17px; }
.submit-close-btn  { font-size: 17px; }
#search-input      { font-size: 18px; letter-spacing: 0.5px; }
#modal-close       { font-size: 17px; }
.card-title        { font-size: 20px; line-height: 1.3; }
.card-desc         { font-size: 17px; }
.cat-badge         { font-size: 14px; padding: 3px 10px; }
.ep-pill           { font-size: 13px; padding: 3px 8px; }
.first-ep-tag      { font-size: 15px; }
.unconfirmed-tag   { font-size: 14px; }
.links-count       { font-size: 15px; }
.card-detail-btn   { font-size: 15px; }
.form-submit-btn   { font-size: 18px; }
.form-label        { font-size: 16px; }
.form-hint         { font-size: 13px; }
#graph-tooltip     { font-size: 15px; line-height: 1.65; }
.legend-item       { font-size: 14px; letter-spacing: 0.5px; }
.modal-ep-badge    { font-size: 16px; padding: 5px 14px; }
.modal-tag         { font-size: 14px; }
.tag               { font-size: 13px; }
.header-badge      { font-size: 15px; padding: 5px 12px; }
.header-text .tagline { font-size: 18px; }
#result-count      { font-size: 15px; }
.footer-text       { font-size: 15px; line-height: 1.7; }
.related-title     { font-size: 16px; }
.related-arrow     { font-size: 16px; }
.lightbox-nav      { font-size: 20px; }
#lightbox-ep       { font-size: 15px; }
#lightbox-caption  { font-size: 18px; }
.quote-meta        { font-size: 14px; }
.submit-header h2  { font-size: 20px; }
.image-thumb-caption { font-size: 16px; }
.image-empty       { font-size: 16px; line-height: 2; }
.modal-description { font-size: 18px; }
.quote-text        { font-size: 18px; }
#empty-state p     { font-size: 16px; }

/* Active filter — gold glow */
.filter-btn.active {
  box-shadow: 0 0 10px rgba(200,168,75,0.35);
}

/* ══════════════════════════════════════════════════════════════
   EPISODE PAGES  (oli-kahn.html, rudy-big-dick.html, …)
   ══════════════════════════════════════════════════════════════ */

.ep-page-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 36px 20px 100px;
}

/* ── Breadcrumb ─────────────────────────────────────────────── */
.ep-breadcrumb {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text-dim);
  margin: 0 0 32px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ep-breadcrumb a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.12s;
}
.ep-breadcrumb a:hover { color: var(--primary); }
.ep-breadcrumb-sep { opacity: 0.35; }

/* ── Episode Hero ───────────────────────────────────────────── */
.ep-page-hero {
  background: var(--surface);
  border: 2px solid var(--border);
  padding: 30px 32px 24px;
  margin-bottom: 32px;
  position: relative;
}
.ep-page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(var(--primary), var(--primary)) 0    0    / 16px 2px no-repeat,
    linear-gradient(var(--primary), var(--primary)) 0    0    / 2px 16px no-repeat,
    linear-gradient(var(--primary), var(--primary)) 100% 0    / 16px 2px no-repeat,
    linear-gradient(var(--primary), var(--primary)) 100% 0    / 2px 16px no-repeat,
    linear-gradient(var(--primary), var(--primary)) 0    100% / 16px 2px no-repeat,
    linear-gradient(var(--primary), var(--primary)) 0    100% / 2px 16px no-repeat,
    linear-gradient(var(--primary), var(--primary)) 100% 100% / 16px 2px no-repeat,
    linear-gradient(var(--primary), var(--primary)) 100% 100% / 2px 16px no-repeat;
  pointer-events: none;
  opacity: 0.45;
}

.ep-number-label {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--text-dim);
  letter-spacing: 3px;
  margin: 0 0 12px;
}

.ep-page-title {
  font-family: var(--font-body);
  font-size: 42px;
  color: var(--text);
  margin: 0 0 22px;
  font-weight: 400;
  line-height: 1.15;
}

.ep-hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ep-lore-count-badge {
  font-family: var(--font-body);
  font-size: 17px;
  color: var(--bg);
  background: var(--primary);
  padding: 6px 16px;
  flex-shrink: 0;
}

.ep-spotify-btn {
  font-family: var(--font-body);
  font-size: 17px;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 6px 16px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.12s, color 0.12s;
}
.ep-spotify-btn:hover {
  background: var(--accent);
  color: var(--bg);
}
.ep-coming-soon {
  font-family: var(--font-body);
  font-size: 17px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 6px 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  opacity: 0.5;
  cursor: default;
}

/* ── Summary paragraph ──────────────────────────────────────── */
.ep-summary {
  font-family: var(--font-body);
  font-size: 19px;
  color: var(--text-dim);
  line-height: 1.7;
  margin: 0 0 44px;
}

/* ── Section heading ────────────────────────────────────────── */
.ep-section-h2 {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--primary);
  letter-spacing: 2px;
  margin: 0 0 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.ep-section-h2::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Lore entry cards ───────────────────────────────────────── */
.ep-entries-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 60px;
}

.ep-lore-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-left-width: 4px;
  padding: 20px 24px;
}

.ep-lore-card[data-cat="running-gag"]    { border-left-color: #57c7a5; }
.ep-lore-card[data-cat="segment"]        { border-left-color: #5b8edb; }
.ep-lore-card[data-cat="character-lore"] { border-left-color: #a66fd1; }
.ep-lore-card[data-cat="event"]          { border-left-color: #d4a017; }
.ep-lore-card[data-cat="catchphrase"]    { border-left-color: #d47535; }
.ep-lore-card[data-cat="lore"]           { border-left-color: #c44569; }

.ep-entry-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.ep-cat-badge {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--bg);
  padding: 3px 10px;
  flex-shrink: 0;
  margin-top: 3px;
}
.ep-cat-badge.running-gag    { background: #57c7a5; }
.ep-cat-badge.segment        { background: #5b8edb; }
.ep-cat-badge.character-lore { background: #a66fd1; }
.ep-cat-badge.event          { background: #d4a017; }
.ep-cat-badge.catchphrase    { background: #d47535; }
.ep-cat-badge.lore           { background: #c44569; }

.ep-entry-title {
  font-family: var(--font-body);
  font-size: 26px;
  color: var(--text);
  margin: 0;
  font-weight: 400;
  line-height: 1.2;
}

.ep-unconfirmed-badge {
  font-family: var(--font-pixel);
  font-size: 6px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 2px 6px;
  letter-spacing: 1px;
  margin-top: 3px;
  flex-shrink: 0;
}

.ep-entry-desc {
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--text-dim);
  line-height: 1.65;
  margin: 0 0 12px;
}
.ep-entry-desc:last-child { margin-bottom: 0; }

.ep-entry-quotes {
  border-left: 2px solid var(--border);
  padding-left: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.ep-entry-quotes blockquote {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  color: var(--text);
  font-style: italic;
  line-height: 1.55;
}
.ep-entry-quotes blockquote::before { content: '„'; }
.ep-entry-quotes blockquote::after  { content: '"'; }

/* ── Back-to-guide link at bottom ───────────────────────────── */
.ep-back-footer {
  border-top: 1px solid var(--border);
  padding-top: 28px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.ep-back-link {
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.12s;
}
.ep-back-link:hover { color: var(--primary); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .ep-page-hero    { padding: 20px 16px; }
  .ep-page-title   { font-size: 28px; }
  .ep-lore-card    { padding: 16px; }
  .ep-entry-title  { font-size: 20px; }
  .ep-summary      { font-size: 17px; }
  .ep-entry-desc   { font-size: 16px; }
}

/* ── RPG Item Rarity — shimmer on rare/legendary cards ──────── */
@keyframes rarity-shimmer {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 1; }
}

.lore-card[data-cat="lore"]::before,
.lore-card[data-cat="character-lore"]::before {
  animation: rarity-shimmer 2.8s ease-in-out infinite;
}

.lore-card[data-cat="lore"]:hover::before,
.lore-card[data-cat="character-lore"]:hover::before {
  animation: none;
  opacity: 1;
}

/* Modal title — VT323 needs bigger clamp than Press Start 2P */
.modal-title { font-size: clamp(20px, 3vw, 28px); }

/* Responsive type adjustments */
@media (max-width: 700px) {
  body           { font-size: 15px; }
  .filter-btn    { font-size: 15px; padding: 6px 10px; }
  .view-tab      { font-size: 18px; padding: 10px 16px; }
  .card-title    { font-size: 18px; }
  .header-badge  { font-size: 13px; }
  .modal-title   { font-size: 20px; }
}
