/* ═══════════════════════════════════════════════════════════════
   NIGHTMARE 317  ─  Dark Horror / Nightmare Theme
   Color Palette:
     #200000  (dominant dark blood-black)
     #400000  (dark crimson)
     #402000  (dark ember/amber)
     #FF0000  (bright blood red – primary accent)
     #E00000  (deep red – secondary accent)
     White    (high-contrast text)
     #FFD700  (gold/yellow – warm highlight accent)
   ═══════════════════════════════════════════════════════════════ */

:root{
  /* ── Backgrounds ── */
  --bg0:#0a0000;
  --bg1:#120200;
  --panel:#1a0200;
  --panel2:#200000;
  --border:#400000;
  --border2:#551000;

  /* ── Text ── */
  --text:#f0e6e0;
  --muted:#b8948a;
  --dim:#8a6050;

  /* ── Accent palette ── */
  --accent:#FF0000;
  --accent2:#E00000;
  --accent3:#400000;
  --accent-gold:#FFD700;
  --accent-amber:#402000;
  --glow: rgba(255,0,0,.30);
  --glow-gold: rgba(255,215,0,.20);

  /* ── Shadows ── */
  --shadow: 0 18px 55px rgba(0,0,0,.70), 0 0 80px rgba(255,0,0,.06);
  --shadow2: 0 10px 28px rgba(0,0,0,.50);

  /* ── Radii ── */
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 10px;

  --max: 1240px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background: var(--bg0);
  color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  line-height:1.65;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
  min-height: 100vh;
  isolation: isolate;
}

/* ── Fixed background – nightmare fog/embers ── */
body::before{
  content:"";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1200px 900px at 25% -10%, rgba(255,0,0,.10), transparent 55%),
    radial-gradient(1200px 900px at 85% 0%, rgba(64,0,0,.16), transparent 55%),
    radial-gradient(900px 700px at 55% 15%, rgba(64,32,0,.08), transparent 60%),
    radial-gradient(600px 600px at 50% 80%, rgba(255,0,0,.04), transparent 50%),
    linear-gradient(180deg, var(--bg1) 0%, var(--bg0) 65%);
  background-repeat: no-repeat;
}

/* ── Vignette overlay ── */
body::after{
  content:"";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(0,0,0,.45) 100%);
}

/* ── Custom scrollbars (nightmare themed) ── */
/* Firefox */
*{
  scrollbar-width: thin;
  scrollbar-color: #400000 #0a0000;
}
/* WebKit / Chromium / Edge */
::-webkit-scrollbar{
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track{
  background: #0a0000;
  border-left: 1px solid rgba(255,0,0,.06);
}
::-webkit-scrollbar-thumb{
  background: linear-gradient(180deg, #500000 0%, #300000 100%);
  border-radius: 6px;
  border: 2px solid #0a0000;
}
::-webkit-scrollbar-thumb:hover{
  background: linear-gradient(180deg, #700000 0%, #400000 100%);
  box-shadow: 0 0 8px rgba(255,0,0,.20);
}
::-webkit-scrollbar-thumb:active{
  background: linear-gradient(180deg, #900000 0%, #500000 100%);
}
::-webkit-scrollbar-corner{
  background: #0a0000;
}

a{color:inherit}

.skip-link{
  position:absolute; left:-999px; top:10px;
  background:rgba(26,2,0,.95);
  border:1px solid rgba(255,0,0,.18);
  color:var(--text);
  padding:10px 12px;
  border-radius:10px;
}
.skip-link:focus{left:10px; z-index:9999}

/* ═══════════════════════════════════════════
   TOP BAR
   ═══════════════════════════════════════════ */
.topbar{
  position:sticky;
  top:0;
  z-index:50;
  backdrop-filter: blur(16px);
  background: linear-gradient(180deg, rgba(10,0,0,.94) 0%, rgba(10,0,0,.70) 100%);
  border-bottom: 1px solid rgba(255,0,0,.12);
  box-shadow: 0 2px 20px rgba(0,0,0,.4), 0 0 40px rgba(255,0,0,.04);
}
.topbar__inner{
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 18px;
  display:flex;
  align-items:center;
  gap:14px;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
  min-width: 220px;
}
.brand__mark{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: radial-gradient(circle at 30% 25%, rgba(255,0,0,.18), transparent 60%),
              linear-gradient(180deg, rgba(64,0,0,.30), rgba(32,0,0,.18));
  border: 1px solid rgba(255,0,0,.30);
  box-shadow: 0 0 28px var(--glow), 0 0 8px rgba(255,0,0,.15);
  display:grid;
  place-items:center;
}
.brand__mark img{width:22px;height:22px}
.brand__name{
  font-weight:900;
  letter-spacing:.4px;
  color:#fff;
  text-shadow: 0 0 12px rgba(255,0,0,.25);
}
.brand__tag{display:block; font-size:12px; color:var(--dim); margin-top:-2px}

.nav-toggle{
  display:none;
  border:1px solid rgba(255,0,0,.18);
  background: rgba(255,0,0,.06);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  cursor:pointer;
}
.nav-toggle:hover{border-color: rgba(255,0,0,.40); box-shadow:0 0 0 4px rgba(255,0,0,.10)}

.top-actions{margin-left:auto; display:flex; gap:10px; align-items:center}

/* ═══════════════════════════════════════════
   PILLS (buttons / links)
   ═══════════════════════════════════════════ */
.pill{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  color: var(--muted);
  text-decoration:none;
  font-size: 13px;
  font-weight: 650;
  transition: all .22s ease;
}
.pill--primary{
  color: #fff;
  border-color: rgba(255,0,0,.35);
  background: linear-gradient(180deg, rgba(255,0,0,.18), rgba(128,0,0,.10));
  box-shadow: 0 0 24px rgba(255,0,0,.14), inset 0 1px 0 rgba(255,100,100,.08);
  text-shadow: 0 0 8px rgba(255,0,0,.30);
}
.pill--primary:hover{
  border-color: rgba(255,0,0,.55);
  background: linear-gradient(180deg, rgba(255,0,0,.26), rgba(128,0,0,.16));
  box-shadow: 0 0 36px rgba(255,0,0,.22), 0 0 60px rgba(255,0,0,.08);
  color: #fff;
}

.pill--secondary{
  color: #fff;
  border-color: rgba(255,215,0,.18);
  background:
    radial-gradient(220px 120px at 30% 35%, rgba(64,32,0,.22), transparent 62%),
    linear-gradient(180deg, rgba(64,32,0,.14), rgba(12,2,0,.12));
  box-shadow: 0 0 18px rgba(255,215,0,.06);
}
.pill--secondary:hover{
  border-color: rgba(255,215,0,.35);
  box-shadow: 0 0 28px rgba(255,215,0,.12);
  color: #fff;
}

.pill:hover{border-color: rgba(255,0,0,.40); color:#fff}

.pill-btn{cursor:pointer; font-family:inherit}

.kbd{
  display:inline-flex;
  align-items:center;
  gap:4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,0,0,.06);
  border: 1px solid rgba(255,0,0,.15);
  color: rgba(255,255,255,.75);
}

/* ═══════════════════════════════════════════
   LAYOUT SHELL
   ═══════════════════════════════════════════ */
.shell{
  max-width: var(--max);
  margin: 0 auto;
  padding: 22px 18px 70px;
  display:grid;
  grid-template-columns: 280px minmax(0, 1fr) 260px;
  gap: 18px;
}

.sidebar,
.toc,
.content__panel{
  background: linear-gradient(180deg, rgba(26,2,0,.94), rgba(14,1,0,.94));
  border: 1px solid rgba(255,0,0,.10);
  border-radius: var(--radius);
  box-shadow: var(--shadow2), 0 0 40px rgba(255,0,0,.03);
}

/* ═══════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════ */
.sidebar{
  position: sticky;
  top: 76px;
  height: calc(100dvh - 96px);
  overflow:auto;
  padding: 14px;
}
.sidebar__group{margin: 10px 0 14px}
.sidebar__title{
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 6px 10px;
}
/* Utility: extra top margin for sidebar titles used in price-guide etc. */
.sidebar__title.sidebar__title--spaced{margin-top:14px}

.nav-list{list-style:none; margin:0; padding:0}
.nav-list a{
  display:flex;
  gap:10px;
  align-items:center;
  text-decoration:none;
  padding: 10px 10px;
  border-radius: 12px;
  color: var(--muted);
  border: 1px solid transparent;
  transition: all .18s ease;
}
.nav-list a:hover{
  background: rgba(255,0,0,.06);
  color: #fff;
  border-color: rgba(255,0,0,.18);
  text-shadow: 0 0 8px rgba(255,0,0,.15);
}
.nav-list a[aria-current="page"]{
  background: linear-gradient(180deg, rgba(255,0,0,.12), rgba(128,0,0,.08));
  border-color: rgba(255,0,0,.28);
  color:#fff;
  text-shadow: 0 0 8px rgba(255,0,0,.20);
}

/* ═══════════════════════════════════════════
   CONTENT AREA
   ═══════════════════════════════════════════ */
.content{min-width:0}

/* ── Content panel top gap ── */
.content__panel--gap{margin-top: 18px}

.hero{
  border-radius: var(--radius);
  overflow:hidden;
  background:
    radial-gradient(900px 500px at 30% 20%, rgba(255,0,0,.14), transparent 55%),
    radial-gradient(900px 500px at 80% 20%, rgba(64,0,0,.10), transparent 55%),
    radial-gradient(600px 300px at 50% 60%, rgba(64,32,0,.08), transparent 55%),
    linear-gradient(180deg, rgba(32,0,0,.65), rgba(10,0,0,.90));
  border:1px solid rgba(255,0,0,.12);
  box-shadow: var(--shadow), 0 0 80px rgba(255,0,0,.06);
  position:relative;
}
.hero::before{
  content:"";
  position:absolute;
  inset:-2px;
  background:
    radial-gradient(circle at 20% 25%, rgba(255,0,0,.12), transparent 40%),
    radial-gradient(circle at 75% 25%, rgba(224,0,0,.08), transparent 45%),
    linear-gradient(90deg, rgba(255,0,0,.06), transparent 30%, rgba(64,32,0,.06));
  pointer-events:none;
}
/* Nightmare crack/texture overlay on hero */
.hero::after{
  content:"";
  position:absolute;
  inset:0;
  background:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 120px,
      rgba(255,0,0,.02) 120px,
      rgba(255,0,0,.02) 121px
    ),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 80px,
      rgba(255,0,0,.015) 80px,
      rgba(255,0,0,.015) 81px
    );
  pointer-events:none;
  opacity: .6;
}
.hero__inner{position:relative; padding: 28px 26px; z-index: 1}
.hero__title{
  margin:0;
  font-size: 32px;
  letter-spacing: .3px;
  line-height:1.1;
  color:#fff;
  text-shadow: 0 0 20px rgba(255,0,0,.35), 0 2px 4px rgba(0,0,0,.5);
}
.hero__sub{margin: 10px 0 0; color: var(--muted); font-size: 14px; max-width: 64ch}
.hero__cta{margin-top: 16px; display:flex; gap:10px; flex-wrap:wrap}

.content__panel{padding: 24px}
.breadcrumbs{color: var(--dim); font-size: 12px; margin-bottom: 10px}
.breadcrumbs a{color: var(--dim); text-decoration:none}
.breadcrumbs a:hover{color:var(--accent-gold); text-shadow: 0 0 6px rgba(255,215,0,.15)}

h1{
  margin: 0 0 10px;
  font-size: 30px;
  letter-spacing: .2px;
  line-height:1.15;
  color:#fff;
  text-shadow: 0 0 14px rgba(255,0,0,.20);
}
.lede{margin: 0 0 16px; color: var(--muted); font-size: 15px}
/* Utility: lede with no top margin */
.lede--flush{margin-top:0}

h2{
  margin: 28px 0 10px;
  font-size: 18px;
  letter-spacing: .5px;
  text-transform: uppercase;
  color:#fff;
  text-shadow: 0 0 10px rgba(255,0,0,.18);
}
/* Utility: h2 with no top margin */
h2.h2--flush{margin-top:0}

h3{margin: 18px 0 8px; font-size: 16px; color:#fff}
p{margin: 0 0 12px}

.content__panel a{
  color: var(--accent-gold);
  text-decoration-color: rgba(255,215,0,.40);
  text-underline-offset: 3px;
  transition: all .18s ease;
}
.content__panel a:hover{
  text-decoration-color: rgba(255,215,0,.80);
  text-shadow: 0 0 8px rgba(255,215,0,.15);
}

.meta-row{display:flex; flex-wrap:wrap; gap:10px; margin: 12px 0 0}
.chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  border:1px solid rgba(255,0,0,.14);
  background: rgba(255,0,0,.04);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 650;
}
.chip strong{color:#fff}
.chip--accent{border-color: rgba(255,0,0,.28); background: rgba(255,0,0,.08)}

/* ═══════════════════════════════════════════
   CARDS / GRID
   ═══════════════════════════════════════════ */
.grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
  margin-top: 14px;
}
.card{
  grid-column: span 6;
  background:
    radial-gradient(300px 200px at 20% 15%, rgba(255,0,0,.04), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  border:1px solid rgba(255,0,0,.10);
  border-radius: var(--radius-sm);
  padding: 16px;
  transition: all .22s ease;
}
.card:hover{
  border-color: rgba(255,0,0,.22);
  box-shadow: 0 0 30px rgba(255,0,0,.06), 0 8px 20px rgba(0,0,0,.20);
}
.card--wide{grid-column: span 12}
.card__title{margin:0 0 8px; font-weight: 850; letter-spacing:.2px}
.card__title a{text-decoration:none; color:#fff}
.card__title a:hover{
  text-decoration: underline;
  text-decoration-color: rgba(255,0,0,.7);
  text-shadow: 0 0 10px rgba(255,0,0,.20);
}
.card__desc{margin:0; color: var(--muted); font-size: 13px}
.tag-row{margin-top: 10px; display:flex; flex-wrap:wrap; gap:8px}
.tag{
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.08);
  color: var(--dim);
}
.tag--hot{
  border-color: rgba(255,215,0,.30);
  color: rgba(255,215,0,.95);
  background: rgba(255,215,0,.06);
  text-shadow: 0 0 6px rgba(255,215,0,.15);
}

ul,ol{margin: 0 0 12px 18px}
li{margin: 6px 0; color: var(--muted)}
li strong{color:#fff}

code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: .95em;
  background: rgba(255,0,0,.06);
  border: 1px solid rgba(255,0,0,.12);
  padding: 2px 6px;
  border-radius: 8px;
  color: #ffcccc;
}

/* ═══════════════════════════════════════════
   CALLOUTS
   ═══════════════════════════════════════════ */
.callout{
  border-radius: var(--radius-xs);
  border:1px solid rgba(255,0,0,.14);
  padding: 14px 14px;
  background: rgba(255,0,0,.04);
  margin: 14px 0;
}
.callout__title{margin:0 0 6px; font-weight: 900; letter-spacing:.2px; color:#fff}
.callout p{margin:0; color: var(--muted); font-size: 14px}
/* Utility for callout paragraphs with no bottom margin */
.callout p:last-child{margin-bottom:0}
.callout--tip{
  border-color: rgba(48, 255, 164, .20);
  background: rgba(48,255,164,.04);
}
.callout--warn{
  border-color: rgba(255, 169, 41, .22);
  background: rgba(255,169,41,.05);
}
.callout--danger{
  border-color: rgba(255, 0, 0, .30);
  background: rgba(255,0,0,.06);
  box-shadow: 0 0 20px rgba(255,0,0,.04);
}
.callout--info{
  border-color: rgba(255,215,0,.18);
  background: rgba(255,215,0,.04);
}
/* Callout spacing helper */
.callout--spaced{margin-top:14px}

/* ═══════════════════════════════════════════
   VOTE SYSTEM
   ═══════════════════════════════════════════ */
.vote-grid{align-items:start}
.vote-card{grid-column: span 6}
.vote-card--wide{grid-column: span 12}
.vote-card--wide h2{margin: 0 0 10px}
.vote-entry{display:grid; gap:12px}
.vote-label{font-weight:800; color:#fff}
.vote-desc{margin-bottom:12px; color:var(--muted)}
.vote-input{
  width:100%;
  padding:12px 14px;
  border-radius:12px;
  border:1px solid rgba(255,0,0,.18);
  background: rgba(0,0,0,.25);
  color:#fff;
  outline:none;
  transition: all .18s ease;
}
.vote-input:focus{
  border-color: rgba(255,0,0,.45);
  box-shadow:0 0 0 4px rgba(255,0,0,.10), 0 0 20px rgba(255,0,0,.06);
}
.vote-input.is-invalid{border-color: rgba(255,0,0,.65)}
.vote-error{
  color:#ff5555;
  font-size:12px;
  margin-bottom:10px;
  display:none;
}
.vote-actions{display:flex; gap:10px; flex-wrap:wrap; margin-top:10px}
.vote-sites[hidden], .vote-entry[hidden]{display:none}

/* Vote timer */
.vote-timer-status{
  color:#fff;
  font-size:24px;
  font-weight:800;
  letter-spacing:1px;
  text-shadow: 0 0 12px rgba(255,0,0,.20);
}
.vote-timer-subtext{
  margin-top:8px;
  color:var(--dim);
  font-size:13px;
  line-height:1.6;
}
.vote-progress-track{
  margin-top:18px;
  width:100%;
  height:12px;
  background:#100000;
  border:1px solid rgba(255,0,0,.18);
  border-radius:999px;
  overflow:hidden;
}
.vote-progress-bar{
  width:0%;
  height:100%;
  background:linear-gradient(90deg,#E00000 0%,#FF0000 50%,#FF4400 100%);
  transition:width 0.8s linear;
  box-shadow: 0 0 8px rgba(255,0,0,.30);
}
.vote-progress-meta{
  margin-top:10px;
  display:flex;
  justify-content:space-between;
  gap:12px;
  color:var(--dim);
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:0.7px;
}

.vote-leaderboard-shell{
  margin-top:14px;
  padding:16px;
  border-radius: var(--radius-sm);
  border:1px solid rgba(255,0,0,.10);
  background:
    radial-gradient(800px 300px at 20% 10%, rgba(255,0,0,.08), transparent 55%),
    linear-gradient(180deg, rgba(8,0,0,.92), rgba(4,0,0,.98));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02);
  display:grid;
  place-items:center;
}
.vote-leaderboard{width:220px; height:150px; border:0; background:transparent}

/* ═══════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════ */
.table-wrap{
  overflow:auto;
  border-radius: var(--radius-sm);
  border:1px solid rgba(255,0,0,.12);
  background: rgba(255,0,0,.02);
}
table{border-collapse:collapse; width:100%; min-width: 640px}
th,td{padding: 12px 12px; border-bottom: 1px solid rgba(255,0,0,.08); text-align:left; vertical-align:top}
th{
  color: rgba(255,255,255,.92);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
  background: rgba(64,0,0,.18);
  text-shadow: 0 0 6px rgba(255,255,255,.10);
}
td{color: var(--muted); font-size: 14px}
tr:hover td{background: rgba(255,0,0,.03)}

/* ═══════════════════════════════════════════
   SERVER STATISTICS
   ═══════════════════════════════════════════ */
.stats-section{margin: 6px 0 10px}
.stats-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 14px;
}
.stat-card{
  position:relative;
  overflow:hidden;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,0,0,.14);
  background:
    radial-gradient(320px 200px at 30% 20%, rgba(255,0,0,.06), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.005));
  padding: 20px 16px 18px;
  text-align:center;
  transition: border-color .22s ease, box-shadow .22s ease, transform .22s ease;
}
.stat-card:hover{
  border-color: rgba(255,0,0,.30);
  box-shadow: 0 0 40px rgba(255,0,0,.10), 0 8px 24px rgba(0,0,0,.30);
  transform: translateY(-2px);
}
.stat-card--highlight{
  border-color: rgba(255,0,0,.28);
  background:
    radial-gradient(400px 250px at 50% 30%, rgba(255,0,0,.14), transparent 55%),
    linear-gradient(180deg, rgba(64,0,0,.12), rgba(32,0,0,.06));
  box-shadow: 0 0 50px rgba(255,0,0,.08);
}
.stat-card--accent{
  border-color: rgba(255,215,0,.16);
  background:
    radial-gradient(300px 180px at 50% 40%, rgba(64,32,0,.14), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.005));
}
.stat-card__icon{
  font-size: 28px;
  margin-bottom: 8px;
  filter: saturate(1.3);
}
.stat-card__value{
  font-size: clamp(18px, 4vw, 26px);
  font-weight: 900;
  letter-spacing: .3px;
  color: #fff;
  line-height: 1.1;
  text-shadow: 0 0 18px rgba(255,0,0,.35);
  word-break: break-word;
  overflow-wrap: break-word;
}
/* Smaller value text for "Online Since" stat */
.stat-card__value--small{font-size:20px}

.stat-card__label{
  margin-top: 6px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ── Live pulse dot ── */
.stat-card__pulse{
  position:absolute;
  top:12px;
  right:12px;
  width:10px;
  height:10px;
  border-radius:50%;
  background: #ff2020;
  box-shadow: 0 0 12px rgba(255,32,32,.60);
  animation: pulse-glow 2s ease-in-out infinite;
}
.stat-card__pulse::after{
  content:"";
  position:absolute;
  inset:-4px;
  border-radius:50%;
  border:2px solid rgba(255,32,32,.40);
  animation: pulse-ring 2s ease-out infinite;
}
@keyframes pulse-ring{
  0%{transform:scale(.8); opacity:1}
  100%{transform:scale(1.8); opacity:0}
}
@keyframes pulse-glow{
  0%,100%{box-shadow: 0 0 8px rgba(255,32,32,.50)}
  50%{box-shadow: 0 0 20px rgba(255,32,32,.80)}
}

/* Animated shimmer on load */
.stat-card__value[data-loaded]{
  animation: stat-pop .4s cubic-bezier(.22,1,.36,1) both;
}
@keyframes stat-pop{
  0%{opacity:0; transform:translateY(6px)}
  100%{opacity:1; transform:translateY(0)}
}

@media (max-width: 860px){
  .stats-grid{grid-template-columns: repeat(2, 1fr)}
}
@media (max-width: 520px){
  .stats-grid{grid-template-columns: 1fr}
}

/* ═══════════════════════════════════════════
   DIVIDER
   ═══════════════════════════════════════════ */
.divider{
  height:1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,0,0,.12) 30%, rgba(255,0,0,.12) 70%, transparent 100%);
  margin: 18px 0;
}

/* ═══════════════════════════════════════════
   PAGE NAV (prev/next)
   ═══════════════════════════════════════════ */
.page-nav{
  display:flex;
  gap: 12px;
  justify-content: space-between;
  align-items: stretch;
  margin-top: 18px;
}
.page-nav a{
  flex:1;
  display:flex;
  flex-direction:column;
  gap:4px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,0,0,.10);
  background: rgba(255,0,0,.03);
  text-decoration:none;
  transition: all .18s ease;
}
.page-nav a:hover{
  border-color: rgba(255,0,0,.28);
  background: rgba(255,0,0,.06);
  box-shadow: 0 0 20px rgba(255,0,0,.06);
}
.page-nav__kicker{font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim)}
.page-nav__title{font-weight: 900; color:#fff; text-shadow: 0 0 6px rgba(255,0,0,.12)}
.page-nav__hint{font-size: 12px; color: var(--muted)}

/* ═══════════════════════════════════════════
   TABLE OF CONTENTS
   ═══════════════════════════════════════════ */
.toc{
  position: sticky;
  top: 76px;
  height: calc(100dvh - 96px);
  overflow:auto;
  padding: 14px;
}
.toc__title{font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin: 6px 10px}
.toc__empty{color: var(--dim); font-size: 13px; margin: 10px}
.toc ul{list-style:none; padding:0; margin: 0}
.toc a{
  display:block;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration:none;
  color: var(--muted);
  border: 1px solid transparent;
  font-size: 13px;
  transition: all .18s ease;
}
.toc a:hover{
  background: rgba(255,0,0,.05);
  border-color: rgba(255,0,0,.15);
  color:#fff;
}
.toc a[data-depth="3"]{padding-left: 22px; color: var(--dim)}
.toc a.is-active{
  background: rgba(255,0,0,.07);
  border-color: rgba(255,0,0,.22);
  color:#fff;
  text-shadow: 0 0 6px rgba(255,0,0,.15);
}

/* ═══════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════ */
.footer{
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 18px 36px;
  color: var(--dim);
  font-size: 13px;
}
.footer__inner{
  border-top: 1px solid rgba(255,0,0,.10);
  padding-top: 18px;
  display:flex;
  gap: 14px;
  align-items:center;
  justify-content: space-between;
  flex-wrap:wrap;
}
.footer a{color: var(--muted); text-decoration:none; transition: all .18s ease}
.footer a:hover{
  color:var(--accent-gold);
  text-decoration: underline;
  text-decoration-color: rgba(255,215,0,.50);
  text-shadow: 0 0 8px rgba(255,215,0,.12);
}

/* ═══════════════════════════════════════════
   SEARCH MODAL
   ═══════════════════════════════════════════ */
.search-modal{
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 82px 12px 22px;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(12px);
}
.search-modal.is-open{display:flex}

.search-panel{
  width: min(820px, 100%);
  border-radius: 18px;
  border: 1px solid rgba(255,0,0,.16);
  background: linear-gradient(180deg, rgba(26,2,0,.96), rgba(10,0,0,.96));
  box-shadow: 0 30px 90px rgba(0,0,0,.70), 0 0 60px rgba(255,0,0,.06);
  overflow: hidden;
}
.search-panel__top{
  padding: 14px 14px;
  border-bottom: 1px solid rgba(255,0,0,.10);
  display:flex;
  align-items:center;
  gap: 12px;
}
.search-input,
.guide-search{
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,0,0,.18);
  background: rgba(0,0,0,.25);
  color: #fff;
  outline: none;
  transition: all .18s ease;
}
.search-input:focus,
.guide-search:focus{
  border-color: rgba(255,0,0,.40);
  box-shadow:0 0 0 4px rgba(255,0,0,.08), 0 0 20px rgba(255,0,0,.06);
}
.search-hint{color: var(--dim); font-size: 12px; white-space: nowrap}

.search-results{max-height: min(58vh, 520px); overflow:auto; padding: 8px 10px 12px}
.search-item{
  display:block;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid transparent;
  text-decoration:none;
  transition: all .18s ease;
}
.search-item:hover{
  border-color: rgba(255,0,0,.20);
  background: rgba(255,0,0,.04);
}
.search-item__title{font-weight: 900; color:#fff}
.search-item__desc{color: var(--muted); font-size: 13px; margin-top: 4px}
.search-item__meta{margin-top: 8px; display:flex; gap:8px; flex-wrap:wrap}
.search-item__tag{
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,0,0,.12);
  color: var(--dim);
}
.search-empty{padding: 14px 12px; color: var(--dim)}

/* ═══════════════════════════════════════════
   GUIDE SEARCH (inline on hub page)
   ═══════════════════════════════════════════ */
.guide-search-label{
  display:block;
  font-weight:800;
  margin-bottom:8px;
  color:#fff;
}

/* ═══════════════════════════════════════════
   ALREADY-VOTED PAGE HELPERS
   ═══════════════════════════════════════════ */
.already-voted-card{margin-top:24px; padding:24px}
.already-voted-card h2{margin-top:0}
.already-voted-card ul{margin:12px 0 0; line-height:2}
.back-link-center{margin-top:28px; text-align:center}

/* ═══════════════════════════════════════════
   UTILITY SPACING CLASSES
   (replace common inline margin/padding)
   ═══════════════════════════════════════════ */
.mt-0{margin-top:0}
.mt-sm{margin-top:14px}
.mt-md{margin-top:24px}
.mt-lg{margin-top:28px}
.mb-0{margin-bottom:0}
.text-center{text-align:center}
.text-muted{color:var(--muted)}

/* ═══════════════════════════════════════════
   NIGHTMARE AMBIENT ANIMATION
   (subtle pulsing red glow on the page edge)
   ═══════════════════════════════════════════ */
@keyframes nightmare-breathe{
  0%,100%{opacity:.4}
  50%{opacity:.7}
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 1040px){
  .shell{grid-template-columns: 280px minmax(0,1fr);}
  .toc{display:none}
}

@media (max-width: 860px){
  .nav-toggle{display:inline-flex}
  .brand{min-width:auto}
  .shell{grid-template-columns: minmax(0,1fr);}
  .sidebar{
    position: fixed;
    inset: 62px 0 0 0;
    height: auto;
    border-radius: 0;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
    z-index: 60;
  }
  body.nav-open .sidebar{
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 520px){
  .hero__title{font-size: 26px}
  .content__panel{padding: 18px}
  .card{grid-column: span 12}
  .vote-leaderboard{width:100%; max-width:220px}
}

@media (prefers-reduced-motion: reduce){
  *{scroll-behavior:auto !important; transition:none !important; animation:none !important}
}
