/* ==========================================================================
   Dark Stories — Official Eeriecast Submission Forum
   Gothic, elegant, candle-lit. All iconography is pixel art (see pixel.js).
   ========================================================================== */

:root {
  --ink: #0c0a10;            /* page depths */
  --ink-2: #120f18;          /* raised surfaces */
  --ink-3: #1a1522;          /* cards */
  --ink-4: #241c30;          /* hover / inputs */
  --line: #2e2438;           /* hairlines */
  --line-soft: #251d30;
  --parchment: #e2d9c4;      /* primary text */
  --parchment-dim: #a99f8c;  /* secondary text */
  --parchment-faint: #6f6758;
  --blood: #a31226;          /* primary accent */
  --blood-bright: #c93445;
  --ember: #e8681f;
  --gold: #c9a24b;
  --gold-soft: #8a7a4e;
  --spectral: #7a8fb8;       /* ghostly blue */
  --venom: #5fe0a8;          /* eldritch green */
  --violet: #7a2a8f;

  --font-display: "Cinzel Decorative", serif;
  --font-head: "Cinzel", serif;
  --font-title: "Playfair Display", Georgia, serif; /* striking, true lowercase */
  --font-body: "Crimson Pro", Georgia, serif;
  --font-pixel: "Press Start 2P", monospace;

  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lift: 0 16px 44px rgba(0, 0, 0, 0.6);
  --ease-lurk: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; overflow-x: clip; max-width: 100%; }

body {
  background:
    radial-gradient(ellipse 120% 60% at 50% -10%, #1c1426 0%, transparent 60%),
    radial-gradient(ellipse 80% 50% at 85% 110%, #14101e 0%, transparent 60%),
    var(--ink);
  color: var(--parchment);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

::selection { background: var(--blood); color: #fff; }

/* ---- Atmosphere -------------------------------------------------------- */
.fog-layer {
  position: fixed; inset: -20%; pointer-events: none; z-index: 0; opacity: 0.5;
  background:
    radial-gradient(ellipse 40% 30% at 20% 30%, rgba(122, 143, 184, 0.05), transparent 70%),
    radial-gradient(ellipse 50% 35% at 75% 60%, rgba(122, 42, 143, 0.04), transparent 70%),
    radial-gradient(ellipse 35% 25% at 50% 85%, rgba(163, 18, 38, 0.04), transparent 70%);
}
.fog-a { animation: fog-drift-a 90s ease-in-out infinite alternate; }
.fog-b {
  background:
    radial-gradient(ellipse 45% 30% at 70% 20%, rgba(201, 162, 75, 0.03), transparent 70%),
    radial-gradient(ellipse 40% 30% at 25% 75%, rgba(122, 143, 184, 0.04), transparent 70%);
  animation: fog-drift-b 120s ease-in-out infinite alternate;
}
@keyframes fog-drift-a { from { transform: translate(-3%, -2%) scale(1); } to { transform: translate(3%, 2%) scale(1.08); } }
@keyframes fog-drift-b { from { transform: translate(3%, 1%) scale(1.05); } to { transform: translate(-2%, -3%) scale(1); } }

.vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  box-shadow: inset 0 0 18vw 4vw rgba(0, 0, 0, 0.55);
}

@media (prefers-reduced-motion: reduce) {
  .fog-a, .fog-b { animation: none; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* Mobile compositing: animated fixed layers + backdrop blur + huge blurred
   shadows overload phone GPUs and make text shimmer during momentum scroll. */
@media (hover: none), (max-width: 900px) {
  .fog-a, .fog-b { animation: none; will-change: auto; }
  .fog-b { display: none; }
  .vignette {
    box-shadow: none;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.35), transparent 12%, transparent 88%, rgba(0, 0, 0, 0.35));
  }
  .site-header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(12, 10, 16, 0.98);
  }
}

/* ---- Pixel art --------------------------------------------------------- */
.px { image-rendering: pixelated; display: inline-block; vertical-align: middle; }

/* ---- Header ------------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0.75rem 1.75rem;
  background: linear-gradient(to bottom, rgba(12, 10, 16, 0.97), rgba(12, 10, 16, 0.88));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 0.85rem; text-decoration: none; min-width: 0; }
.brand-moon { display: grid; place-items: center; filter: drop-shadow(0 0 8px rgba(233, 223, 184, 0.35)); animation: moon-glow 6s ease-in-out infinite; }
@keyframes moon-glow {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(233, 223, 184, 0.25)); }
  50% { filter: drop-shadow(0 0 12px rgba(233, 223, 184, 0.5)); }
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-title {
  font-family: var(--font-display); font-weight: 900; font-size: 1.5rem;
  color: var(--parchment); letter-spacing: 0.04em;
  text-shadow: 0 0 18px rgba(163, 18, 38, 0.45), 0 2px 4px rgba(0,0,0,0.8);
}
.brand-sub {
  font-family: var(--font-head); font-size: 0.62rem; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--gold-soft);
}

.main-nav { display: flex; align-items: center; gap: 0.35rem; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.main-nav a, .main-nav button {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-family: var(--font-head); font-size: 0.82rem; letter-spacing: 0.08em;
  color: var(--parchment-dim); text-decoration: none; text-transform: uppercase;
  padding: 0.5rem 0.8rem; border-radius: 3px;
  border: 1px solid transparent; background: none; cursor: pointer;
  transition: color 0.25s, background 0.25s, border-color 0.25s;
}
.main-nav a:hover, .main-nav button:hover { color: var(--parchment); background: var(--ink-3); }
.main-nav a.active { color: var(--gold); border-color: var(--line); background: var(--ink-2); }
.main-nav .nav-cta {
  color: #f5eee0; background: linear-gradient(160deg, #7e1220, var(--blood));
  border: 1px solid #c0333f55;
  box-shadow: 0 2px 12px rgba(163, 18, 38, 0.35);
}
.main-nav .nav-cta:hover { background: linear-gradient(160deg, #96182a, var(--blood-bright)); color: #fff; }
.nav-badge-chip { display: inline-grid; place-items: center; }

.nav-burger { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 3px; padding: 0.55rem 0.5rem; cursor: pointer; }
.nav-burger span { display: block; width: 22px; height: 2px; background: var(--parchment-dim); margin: 4px 0; transition: 0.3s; }

@media (max-width: 900px) {
  .nav-burger { display: block; }
  .main-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--ink-2); border-bottom: 1px solid var(--line);
    padding: 0.5rem 1rem 1rem;
  }
  .main-nav.open { display: flex; animation: menu-drop 0.3s var(--ease-lurk); }
  .main-nav a, .main-nav button { padding: 0.8rem; border-bottom: 1px solid var(--line-soft); border-radius: 0; }
  @keyframes menu-drop { from { opacity: 0; transform: translateY(-8px); } }
  .brand-sub { display: none; }
}

/* ---- Reading progress --------------------------------------------------- */
.reading-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; pointer-events: none; opacity: 0; transition: opacity 0.4s; }
.reading-progress.on { opacity: 1; }
.reading-progress .bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--blood), var(--ember));
  box-shadow: 0 0 10px rgba(232, 104, 31, 0.6);
}

/* ---- Layout ------------------------------------------------------------- */
.view { position: relative; z-index: 2; max-width: 1180px; margin: 0 auto; padding: 2rem 1.5rem 5rem; min-height: 60vh; outline: none; }
.view-enter { animation: view-in 0.5s var(--ease-lurk); }
@keyframes view-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.page-title { font-family: var(--font-head); font-weight: 600; font-size: 2rem; letter-spacing: 0.05em; margin-bottom: 0.35rem; }
.page-sub { color: var(--parchment-dim); margin-bottom: 1.75rem; font-size: 1.05rem; }

.ornament { display: flex; align-items: center; gap: 1rem; margin: 1.25rem 0; color: var(--gold-soft); }
.ornament::before, .ornament::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); }

/* ---- Hero --------------------------------------------------------------- */
.hero { text-align: center; padding: 6.5rem 1rem 2.5rem; position: relative; }
.hero-bats { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.hero-bats .px { position: absolute; opacity: 0; animation: bat-flit 14s linear infinite; }
.hero-bats .px:nth-child(2) { animation-delay: 5s; animation-duration: 18s; }
.hero-bats .px:nth-child(3) { animation-delay: 9s; animation-duration: 11s; }
@keyframes bat-flit {
  0% { opacity: 0; transform: translate(-10vw, 70px) scale(0.8); }
  8% { opacity: 0.7; }
  45% { transform: translate(40vw, 10px) scale(1); }
  80% { opacity: 0.6; }
  100% { opacity: 0; transform: translate(85vw, 50px) scale(0.7); }
}
.hero h1 {
  position: relative; display: inline-block;
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(2.4rem, 6vw, 4.2rem); letter-spacing: 0.03em;
  text-shadow: 0 0 30px rgba(163, 18, 38, 0.5), 0 4px 10px rgba(0,0,0,0.9);
  animation: title-flicker 9s linear infinite;
}
/* the persona's signature, leaning over the title's shoulder */
.hero-owner {
  position: absolute; top: -0.55em; left: -0.4em;
  transform: rotate(-6deg); transform-origin: left bottom;
  font-family: var(--font-title); font-style: italic; font-weight: 600;
  font-size: clamp(0.85rem, 1.8vw, 1.25rem); letter-spacing: 0.04em;
  color: var(--gold); text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  white-space: nowrap; pointer-events: none;
}
@keyframes title-flicker {
  0%, 100% { opacity: 1; } 92% { opacity: 1; } 92.5% { opacity: 0.75; }
  93% { opacity: 1; } 95.5% { opacity: 1; } 96% { opacity: 0.85; } 96.5% { opacity: 1; }
}
.hero .tagline {
  font-family: var(--font-head); text-transform: uppercase; letter-spacing: 0.35em;
  color: var(--gold-soft); font-size: 0.85rem; margin-top: 0.75rem;
}
.hero .hero-desc { max-width: 620px; margin: 1.25rem auto 0; color: var(--parchment-dim); font-size: 1.12rem; font-style: italic; }
.hero-actions { margin-top: 1.75rem; display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap; }

/* ---- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-head); font-size: 0.88rem; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.7rem 1.4rem; border-radius: 3px; cursor: pointer; text-decoration: none;
  border: 1px solid var(--line); color: var(--parchment); background: var(--ink-3);
  transition: transform 0.25s var(--ease-lurk), box-shadow 0.25s, background 0.25s, border-color 0.25s;
}
.btn:hover { transform: translateY(-2px); background: var(--ink-4); box-shadow: var(--shadow-card); }
.btn:active { transform: translateY(0); }
.btn-blood {
  background: linear-gradient(160deg, #7e1220, var(--blood)); border-color: #c0333f55; color: #f5eee0;
  box-shadow: 0 2px 14px rgba(163, 18, 38, 0.35);
}
.btn-blood:hover { background: linear-gradient(160deg, #96182a, var(--blood-bright)); box-shadow: 0 6px 22px rgba(163, 18, 38, 0.5); color: #fff; }
.btn-gold { border-color: var(--gold-soft); color: var(--gold); }
.btn-gold:hover { background: rgba(201, 162, 75, 0.08); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--parchment-dim); }
.btn-ghost:hover { color: var(--parchment); background: var(--ink-3); box-shadow: none; }
.btn-danger { border-color: #6e2a2a; color: #d98080; }
.btn-danger:hover { background: rgba(163, 18, 38, 0.12); }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.75rem; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

/* ---- Toolbar: sorts, time window & categories ---------------------------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin: 1.5rem 0 1.25rem; }

/* ---- toolbar v3: everything is a quiet dropdown box ---- */
@keyframes tb-drop-in { from { opacity: 0; transform: translateY(-6px); } }
.toolbar-v3 { justify-content: flex-start; gap: 0.6rem; margin: 1.4rem 0 1.1rem; }
.tb-drop { position: relative; min-width: 0; }
.tb-btn {
  display: inline-flex; align-items: center; gap: 0.55rem;
  background: rgba(226, 217, 196, 0.02);
  border: 1px solid var(--line-soft); border-radius: 6px;
  padding: 0.5rem 0.75rem; cursor: pointer; max-width: 100%;
  transition: border-color 0.25s, background 0.25s;
}
.tb-btn:hover { border-color: var(--line); background: rgba(226, 217, 196, 0.045); }
.tb-drop.open .tb-btn { border-color: var(--gold-soft); background: rgba(201, 162, 75, 0.05); }
.tb-label {
  font-family: var(--font-head); font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--parchment-faint);
}
.tb-val {
  display: inline-flex; align-items: center; gap: 0.4rem; min-width: 0;
  font-family: var(--font-head); font-size: 0.76rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--parchment); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tb-val .px { opacity: 0.75; flex: none; }
.tb-drop.open .tb-val { color: var(--gold); }
.tb-caret { opacity: 0.45; flex: none; transition: transform 0.3s var(--ease-lurk); }
.tb-drop.open .tb-caret { transform: rotate(180deg); opacity: 0.8; }
.tb-staff .tb-btn { border-color: rgba(122, 155, 90, 0.35); }
.tb-staff .tb-label { color: var(--venom); opacity: 0.85; }
.tb-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 45; min-width: 200px;
  background: linear-gradient(165deg, var(--ink-3), var(--ink-2));
  border: 1px solid var(--line); border-radius: 6px; padding: 0.4rem;
  box-shadow: var(--shadow-lift);
  animation: tb-drop-in 0.22s var(--ease-lurk);
}
.tb-menu button {
  display: flex; align-items: center; gap: 0.5rem; width: 100%;
  font-family: var(--font-head); font-size: 0.76rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--parchment-dim); background: none; border: none; border-radius: 4px;
  padding: 0.55rem 0.7rem; cursor: pointer; text-align: left; transition: 0.2s;
}
.tb-menu button:hover { color: var(--parchment); background: rgba(226, 217, 196, 0.05); }
.tb-menu button.on { color: var(--gold); }
.tb-spacer { display: inline-block; width: 16px; flex: none; }
@media (max-width: 720px) {
  /* Two-up grid of dropdowns; min-width:0 everywhere so nothing props the viewport. */
  .toolbar-v3 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
  .tb-btn { width: 100%; justify-content: space-between; padding: 0.5rem 0.6rem; }
  .tb-label { display: none; } /* the value labels itself */
  .tb-val { font-size: 0.68rem; letter-spacing: 0.05em; }
  .tb-menu { left: 0; right: 0; min-width: 0; }
}

/* tooltips */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(calc(-50% + var(--tipx, 0px))) translateY(4px);
  background: #060509; color: var(--parchment); font-family: var(--font-body); font-size: 0.85rem;
  letter-spacing: 0; text-transform: none; white-space: nowrap;
  border: 1px solid var(--line); border-radius: 4px; padding: 0.4rem 0.7rem;
  opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s; z-index: 40;
  box-shadow: var(--shadow-card);
}
[data-tip]::before {
  content: ""; position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--line);
  opacity: 0; transition: opacity 0.25s; z-index: 40;
}
[data-tip]:hover::after { opacity: 1; transform: translateX(calc(-50% + var(--tipx, 0px))) translateY(0); }
[data-tip]:hover::before { opacity: 1; }
/* Tooltips are a pointer affordance — on touch screens they overflow edges and
   stick, so hover tips are off. Passive info badges instead reveal theirs on
   tap via .tip-open (JS clamps them to the viewport). */
@media (hover: none) {
  [data-tip]::after, [data-tip]::before { display: none; }
  [data-tip].tip-open::after, [data-tip].tip-open::before { display: block; opacity: 1; }
  [data-tip].tip-open::after { transform: translateX(calc(-50% + var(--tipx, 0px))) translateY(0); }
}
/* The floating story rail hugs the right edge: its tips open to the left. */
.story-nav [data-tip]::after {
  left: auto; right: calc(100% + 10px); bottom: auto; top: 50%;
  transform: translateY(-50%);
}
.story-nav [data-tip]:hover::after { transform: translateY(-50%); }
.story-nav [data-tip]::before { display: none; }

/* ---- Story cards -------------------------------------------------------- */
/* full-width rows, reddit-style: one story per line, compact vertical rhythm */
.story-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.65rem; }
.story-grid > * { min-width: 0; }

/* ---- Story vote rail (left of the card; horizontal variant in the reader) */
/* the base card is a flex COLUMN — a voting card flips to a row so the rail
   sits on the left, and .card-main takes over the column rhythm inside */
.story-card.has-vote { flex-direction: row; gap: 0.95rem; align-items: stretch; }
.story-card .card-main { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.story-card.has-vote .card-main { flex: 1; }
.sv-rail {
  flex: none; align-self: center;
  display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
  padding: 0.3rem 0.15rem; min-width: 34px;
}
.sv-btn {
  display: grid; place-items: center; width: 30px; height: 26px;
  background: none; border: none; border-radius: 5px; cursor: pointer;
  transition: background 0.2s;
}
.sv-btn .px { opacity: 0.4; transition: opacity 0.2s, filter 0.2s; }
.sv-btn:hover { background: rgba(226, 217, 196, 0.06); }
.sv-btn:hover .px { opacity: 0.9; }
.sv-up.on .px { opacity: 1; filter: drop-shadow(0 0 6px rgba(201, 162, 75, 0.9)) sepia(1) saturate(2.4) hue-rotate(-12deg) brightness(1.15); }
.sv-down.on .px { opacity: 1; filter: drop-shadow(0 0 6px rgba(163, 18, 38, 0.9)) sepia(1) saturate(3) hue-rotate(-50deg); }
.sv-score {
  font-family: var(--font-head); font-size: 0.82rem; letter-spacing: 0.04em;
  color: var(--parchment-dim); min-width: 2ch; text-align: center;
  transition: color 0.25s;
}
.sv-score.pos { color: var(--gold-soft); }
.sv-score.neg { color: var(--blood-bright); }
.sv-btn.sv-pop { animation: svPop 0.45s var(--ease-lurk); }
@keyframes svPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.5); }
  100% { transform: scale(1); }
}
.sv-score.sv-flash-up { animation: svFlashUp 0.8s ease; }
.sv-score.sv-flash-down { animation: svFlashDown 0.8s ease; }
@keyframes svFlashUp {
  25% { color: var(--gold); text-shadow: 0 0 14px rgba(201, 162, 75, 0.9); transform: translateY(-3px); }
  100% { transform: translateY(0); }
}
@keyframes svFlashDown {
  25% { color: var(--blood-bright); text-shadow: 0 0 14px rgba(163, 18, 38, 0.9); transform: translateY(3px); }
  100% { transform: translateY(0); }
}
/* reader: horizontal pill under the byline, fuller box after the story */
.sv-rail.sv-h {
  flex-direction: row; gap: 0.3rem; padding: 0.15rem 0.5rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(226, 217, 196, 0.02);
}
/* hover highlights on the end buttons echo the pill's rounded ends */
.sv-rail.sv-h .sv-btn:first-child { border-radius: 999px 6px 6px 999px; }
.sv-rail.sv-h .sv-btn:last-child { border-radius: 6px 999px 999px 6px; }
.sv-rail.sv-h .sv-score { min-width: 3ch; }
/* inline slots that hold the reader's vote pills (meta row + action row) */
.sv-slot { display: inline-flex; align-items: center; }
.sv-slot:empty { display: none; }

.story-card {
  position: relative; display: flex; flex-direction: column; gap: 0.4rem;
  background: linear-gradient(165deg, var(--ink-3), var(--ink-2));
  border: 1px solid var(--line); border-radius: 6px; padding: 0.85rem 1.25rem 0.7rem;
  cursor: pointer; /* overflow stays visible so tooltips can escape the card */
  transition: transform 0.3s var(--ease-lurk), box-shadow 0.3s, border-color 0.3s, background 0.3s;
  animation: card-in 0.45s var(--ease-lurk) backwards;
}
.story-card:hover { z-index: 6; }
/* rows glide right a touch instead of lifting */
.story-grid > .story-card:hover { transform: translateX(4px); }
.story-card:nth-child(2n) { animation-delay: 0.06s; }
.story-card:nth-child(3n) { animation-delay: 0.12s; }
@keyframes card-in { from { opacity: 0; transform: translateY(16px); } }
.story-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: #43324f; }
.story-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(90deg, transparent, var(--blood), transparent);
  opacity: 0; transition: opacity 0.35s;
}
.story-card:hover::before { opacity: 1; }

.story-card .card-top { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; min-height: 18px; }

/* quiet category line: colored small caps, no box */
.cat-mini {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-family: var(--font-head); font-size: 0.64rem; letter-spacing: 0.18em; text-transform: uppercase;
}
.cat-mini .px { opacity: 0.8; }
.cat-mini.spiritual { color: #8fa0cc; }
.cat-mini.creatures { color: #b8926c; }
.cat-mini.human { color: #c07878; }
.cat-mini.other { color: #8cc4a2; }
.cat-mini.creepypasta { color: #a586c4; }
.cat-mini.announcements { color: var(--gold); }
.cat-mini.help { color: var(--parchment-dim); }

/* flags as bare marks, not boxes */
.card-flags { display: inline-flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; justify-content: flex-end; }
.card-modtools { flex-wrap: wrap; justify-content: flex-end; }
/* clickable meta stats (whisper count jumps to comments) */
.meta-stats .m-link { cursor: pointer; transition: color 0.2s; }
.meta-stats .m-link:hover { color: var(--gold-soft); }
.flag-ico { display: inline-grid; place-items: center; cursor: help; opacity: 0.9; }
.story-card h3 {
  font-family: var(--font-title); font-weight: 600; font-size: 1.28rem; line-height: 1.3;
  color: var(--parchment); transition: color 0.3s; letter-spacing: 0.01em;
}
.card-title-link { color: inherit; text-decoration: none; }
.card-title-link:hover { text-decoration: underline; text-decoration-color: var(--gold-soft); text-underline-offset: 3px; }
.story-card:hover h3 { color: #f2e6c8; }
.story-card .excerpt {
  color: var(--parchment-faint); font-size: 0.95rem; line-height: 1.55; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  max-width: 88ch; /* full-width rows: keep the excerpt a readable measure */
}
.picks-strip .story-card .excerpt { -webkit-line-clamp: 3; max-width: none; }

.card-meta {
  display: flex; align-items: baseline; justify-content: space-between; gap: 0.8rem;
  color: var(--parchment-faint); font-size: 0.82rem;
  border-top: 1px solid var(--line-soft); padding-top: 0.65rem; min-width: 0;
}
.card-meta .m { display: inline-flex; align-items: center; gap: 0.3rem; }
.card-meta .meta-stats { display: inline-flex; align-items: center; gap: 0.85rem; flex-shrink: 0; }
.card-meta .card-age { opacity: 0.75; }
.card-meta .author-link {
  color: var(--parchment-dim); text-decoration: none; font-style: italic;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.card-meta .author-link:hover { color: var(--gold); }

.tag-cat {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--font-head); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 0.22rem 0.6rem; border-radius: 3px; border: 1px solid;
}
.tag-cat.spiritual { color: #a9b8dd; border-color: #3a4468; background: rgba(122, 143, 184, 0.08); }
.tag-cat.creatures { color: #c9a179; border-color: #5c4630; background: rgba(109, 74, 52, 0.15); }
.tag-cat.human { color: #d08585; border-color: #6e3030; background: rgba(163, 18, 38, 0.1); }
.tag-cat.other { color: #9fd6b4; border-color: #2f5c42; background: rgba(95, 224, 168, 0.06); }
.tag-cat.creepypasta { color: #b493d6; border-color: #4d3268; background: rgba(122, 42, 143, 0.1); }

.flag-pick {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-family: var(--font-pixel); font-size: 0.5rem; color: var(--gold);
  padding: 0.3rem 0.55rem; border: 1px solid var(--gold-soft); border-radius: 3px;
  background: rgba(201, 162, 75, 0.08);
  text-shadow: 0 0 8px rgba(201, 162, 75, 0.5);
}
.flag-reviewed {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-family: var(--font-pixel); font-size: 0.5rem; color: var(--venom);
  padding: 0.3rem 0.55rem; border: 1px solid #2f5c42; border-radius: 3px;
  background: rgba(95, 224, 168, 0.06);
}

/* editors picks strip */
/* Responsive grid (not a scroll strip): tooltips escape freely, staff tools
   stay inside the card, and mobile stacks naturally. */
.picks-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 1rem; padding: 0.5rem 0.25rem 1rem; }
.picks-strip .story-card { border-color: #4d3f22; background: linear-gradient(165deg, #221a2c, #171220); }

.section-head { display: flex; align-items: center; gap: 0.75rem; margin: 2.25rem 0 1rem; flex-wrap: wrap; row-gap: 0.6rem; }
.section-head h2 { font-family: var(--font-head); font-weight: 600; font-size: 1.35rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--parchment); }
.section-head .rule { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }

/* ---- Pagination --------------------------------------------------------- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 0.4rem; margin: 2.25rem 0 0.5rem; }
.pagination button {
  font-family: var(--font-head); font-size: 0.85rem; min-width: 40px;
  color: var(--parchment-dim); background: var(--ink-2); border: 1px solid var(--line);
  border-radius: 3px; padding: 0.45rem 0.7rem; cursor: pointer; transition: 0.25s;
}
.pagination button:hover { color: var(--parchment); border-color: var(--gold-soft); }
.pagination button.current { color: var(--gold); border-color: var(--gold); pointer-events: none; }
.pagination button[disabled] { opacity: 0.35; pointer-events: none; }
.pagination .page-info { color: var(--parchment-faint); font-size: 0.85rem; margin: 0 0.5rem; }

/* ---- Story reader ------------------------------------------------------- */
.reader { max-width: 760px; margin: 0 auto; }
.reader-head { text-align: center; padding: 1.5rem 0 0.5rem; }
.reader-head h1 { font-family: var(--font-title); font-weight: 700; font-size: clamp(1.9rem, 4.5vw, 3rem); line-height: 1.18; margin: 0.9rem 0 0.7rem; letter-spacing: 0.01em; }
.reader-byline { color: var(--parchment-dim); font-size: 1.05rem; font-style: italic; }
.reader-byline .byline-age { color: var(--parchment-faint); font-size: 0.9rem; margin-left: 0.45rem; }
.reader-byline a { color: var(--gold); text-decoration: none; }
.reader-byline a:hover { text-decoration: underline; }
.reader-meta { display: flex; justify-content: center; gap: 1.4rem; flex-wrap: wrap; color: var(--parchment-faint); font-size: 0.9rem; margin-top: 0.9rem; }
.reader-meta .m { display: inline-flex; align-items: center; gap: 0.4rem; }

.reader-badgebar { display: flex; justify-content: center; margin-top: 0.75rem; }
.unclaimed-note { color: var(--parchment-faint); font-size: 0.85rem; font-style: italic; margin-top: 0.5rem; line-height: 1.5; }
.author-unclaimed { cursor: help; border-bottom: 1px dotted var(--parchment-faint); }

.story-body {
  margin: 2rem 0; font-size: 1.18rem; line-height: 1.85; color: #d9d1bd;
  /* novel-set text: clean justified blocks with hyphenation */
  text-align: justify; text-justify: inter-word; hyphens: auto; overflow-wrap: break-word;
  position: relative;
}

/* staff copy button: rests at the top-right of the text, appears on hover */
.copy-float {
  position: absolute; top: -0.6rem; right: 0; z-index: 5;
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--font-head); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--parchment-dim); background: var(--ink-2);
  border: 1px solid var(--line); border-radius: 4px; padding: 0.4rem 0.75rem; cursor: pointer;
  opacity: 0; transform: translateY(-3px);
  transition: opacity 0.25s, transform 0.25s var(--ease-lurk), border-color 0.25s;
}
.story-body:hover .copy-float { opacity: 1; transform: translateY(0); }
.copy-float:hover { color: var(--gold); border-color: var(--gold-soft); }
@media (hover: none) { .copy-float { opacity: 0.6; transform: none; } }
.story-body p { margin-bottom: 1.35rem; }
.story-body p:first-of-type::first-letter {
  font-family: var(--font-display); font-size: 3.6em; float: left; line-height: 0.8;
  padding: 0.08em 0.12em 0 0; color: var(--blood-bright);
  text-shadow: 0 0 16px rgba(163, 18, 38, 0.5);
}

.reader-actions {
  display: flex; align-items: center; justify-content: center; gap: 0.6rem; flex-wrap: wrap;
  padding: 1.25rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}

.react-btn {
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 0.4rem 0.85rem; cursor: pointer; color: var(--parchment-dim);
  font-family: var(--font-body); font-size: 0.95rem;
  transition: transform 0.25s var(--ease-lurk), border-color 0.25s, background 0.25s;
}
.react-btn:hover { transform: translateY(-2px) scale(1.04); border-color: var(--gold-soft); }
.react-btn.on { border-color: var(--blood-bright); background: rgba(163, 18, 38, 0.14); color: var(--parchment); }
.react-btn.pop .px { animation: react-pop 0.45s var(--ease-lurk); }
@keyframes react-pop { 40% { transform: scale(1.6) rotate(-8deg); } }

.fav-btn.on { border-color: var(--gold); background: rgba(201, 162, 75, 0.1); color: var(--gold); }

/* One quiet line of icon tools for the owner/staff — card quick-tool language */
.staff-bar {
  display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; justify-content: center;
  margin: 0.9rem auto 0; padding: 0.45rem 0.8rem; width: fit-content; max-width: 100%;
  border: 1px solid var(--line); border-radius: 6px; background: rgba(226, 217, 196, 0.02);
}
.ob-btn {
  display: grid; place-items: center; width: 32px; height: 30px;
  background: none; border: 1px solid transparent; border-radius: 5px;
  cursor: pointer; opacity: 0.65;
  transition: opacity 0.2s, border-color 0.2s, background 0.2s;
}
.ob-btn:hover { opacity: 1; border-color: var(--gold-soft); }
.ob-btn.on { opacity: 1; border-color: var(--gold); background: rgba(201, 162, 75, 0.12); }
.ob-btn.ob-danger:hover { border-color: var(--blood-bright); background: rgba(163, 18, 38, 0.14); }
.ob-sep { width: 1px; height: 20px; background: var(--line); margin: 0 0.3rem; flex: none; }

/* ---- Comments ----------------------------------------------------------- */
.comments { margin-top: 2.5rem; }
.comment {
  display: flex; gap: 0.6rem; padding: 0.7rem 0.25rem 0.6rem;
  animation: card-in 0.45s var(--ease-lurk) backwards;
}
.comment-thread { border-bottom: 1px solid var(--line-soft); }
.comment-thread .comment-thread, .c-children .comment-thread { border-bottom: none; }
.comment .c-avatar { flex-shrink: 0; padding-top: 0.1rem; }
.comment .c-avatar .avatar, .comment .c-avatar .px { width: 26px; height: 26px; }
.comment .c-head { display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap; min-height: 26px; }
.comment .c-user { font-family: var(--font-head); font-size: 0.92rem; color: var(--gold); text-decoration: none; }
.comment .c-user:hover { text-decoration: underline; }
.comment .c-time { color: var(--parchment-faint); font-size: 0.76rem; }
.comment .c-body { margin: 0.2rem 0 0.3rem; color: #d3cab6; white-space: pre-wrap; word-break: break-word; font-size: 0.97rem; line-height: 1.55; }
.comment .c-body a { color: var(--gold); }
.comment .c-tools { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.c-act {
  background: none; border: none; cursor: pointer; padding: 0.15rem 0;
  font-family: var(--font-head); font-size: 0.7rem; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--parchment-faint); transition: color 0.2s;
}
.c-act:hover { color: var(--parchment); }
.c-act-danger:hover { color: var(--blood-bright); }
.comment.pending { opacity: 0.75; border-left: 3px solid var(--ember); padding-left: 0.8rem; }

/* mini formatting bar for whisper textareas */
.fmt-bar { display: flex; gap: 0.25rem; margin-bottom: 0.35rem; }
.fmt-bar button {
  display: grid; place-items: center; min-width: 28px; height: 26px;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 4px;
  color: var(--parchment-dim); cursor: pointer; font-family: var(--font-body); font-size: 0.85rem;
  transition: border-color 0.2s, color 0.2s;
}
.fmt-bar button:hover { color: var(--gold); border-color: var(--gold-soft); }
.pending-note { font-family: var(--font-pixel); font-size: 0.5rem; color: var(--ember); }

.comment-form textarea {
  width: 100%; min-height: 110px; resize: vertical;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 6px;
  color: var(--parchment); font-family: var(--font-body); font-size: 1.05rem; padding: 0.9rem 1rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.comment-form textarea:focus { outline: none; border-color: var(--blood); box-shadow: 0 0 0 3px rgba(163, 18, 38, 0.15); }
.comment-form .form-row { display: flex; justify-content: space-between; align-items: center; margin-top: 0.6rem; gap: 1rem; }

/* ---- Forms -------------------------------------------------------------- */
.panel {
  background: linear-gradient(165deg, var(--ink-3), var(--ink-2));
  border: 1px solid var(--line); border-radius: 8px;
  padding: 2rem 2.25rem; box-shadow: var(--shadow-card);
}
.panel-narrow { max-width: 460px; margin: 2rem auto; }
.panel-wide { max-width: 820px; margin: 0 auto; }

.field { margin-bottom: 1.25rem; }
.field label { display: block; font-family: var(--font-head); font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--parchment-dim); margin-bottom: 0.45rem; }
.field input[type="text"], .field input[type="email"], .field input[type="password"],
.field input[type="number"], .field input[type="date"], .field select, .field textarea {
  width: 100%; background: var(--ink); border: 1px solid var(--line); border-radius: 5px;
  color: var(--parchment); font-family: var(--font-body); font-size: 1.05rem;
  padding: 0.75rem 0.9rem; transition: border-color 0.3s, box-shadow 0.3s;
}
.field select { cursor: pointer; }
.field select option { background: var(--ink-2); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--blood); box-shadow: 0 0 0 3px rgba(163, 18, 38, 0.15);
}
.field textarea { min-height: 320px; resize: vertical; line-height: 1.7; }
.field .hint { font-size: 0.85rem; color: var(--parchment-faint); margin-top: 0.35rem; }
.field-inline { display: flex; align-items: flex-start; gap: 0.65rem; }
.field-inline input[type="checkbox"] { margin-top: 0.35rem; width: 17px; height: 17px; accent-color: var(--blood); cursor: pointer; }
.field-inline label { text-transform: none; letter-spacing: 0; font-family: var(--font-body); font-size: 0.95rem; margin: 0; cursor: pointer; }
.field-inline a { color: var(--gold); }

.form-error {
  display: none; background: rgba(163, 18, 38, 0.12); border: 1px solid #6e2a2a; border-radius: 5px;
  color: #e59a9a; padding: 0.8rem 1rem; margin-bottom: 1.2rem; font-size: 0.95rem;
}
.form-error.show { display: block; animation: shake 0.4s; }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.word-counter { text-align: right; font-size: 0.85rem; color: var(--parchment-faint); font-variant-numeric: tabular-nums; }
.counter-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 0.35rem; flex-wrap: wrap; }
.structure-hint { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; }
.structure-hint.good { color: #7fd492; }
.structure-hint.bad { color: var(--blood-bright); animation: shake 0.4s; }
.chars-needed { color: var(--ember); }
.draft-note { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.82rem; color: var(--parchment-faint); }
.draft-note a { color: var(--parchment-dim); }

/* ---- Auth pages --------------------------------------------------------- */
.auth-switch { text-align: center; margin-top: 1.25rem; color: var(--parchment-dim); font-size: 0.95rem; }
.auth-switch a { color: var(--gold); }

/* ---- Profile ------------------------------------------------------------ */
/* Profile hero: one framed card with a gold hairline and a ringed portrait */
.profile-head {
  display: flex; gap: 1.75rem; align-items: center; flex-wrap: wrap;
  padding: 1.75rem 1.75rem 1.5rem; margin-top: 0.5rem;
  background: linear-gradient(165deg, rgba(122, 42, 143, 0.06), var(--ink-2) 45%, var(--ink-3));
  border: 1px solid var(--line); border-radius: 10px;
  position: relative; overflow: hidden;
}
.profile-head::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
}
.profile-sigil {
  width: 104px; height: 104px; display: grid; place-items: center; flex: none;
  background: var(--ink); border: 1px solid var(--line); border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 3px var(--ink-2), 0 0 0 4px var(--line),
    0 0 28px rgba(201, 162, 75, 0.12), inset 0 0 24px rgba(0, 0, 0, 0.5);
}
.profile-sigil img.av-big { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.av-add {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.3rem;
  background: none; border: 2px dashed rgba(201, 162, 75, 0.45); border-radius: 50%;
  cursor: pointer; color: var(--gold-soft);
  transition: color 0.25s, border-color 0.25s, box-shadow 0.25s;
  animation: av-pulse 3.2s ease-in-out infinite;
}
.av-add .px { opacity: 0.55; }
.av-add-label { font-family: var(--font-head); font-size: 0.48rem; letter-spacing: 0.12em; text-transform: uppercase; padding: 0 0.4rem; }
.av-add:hover { color: var(--gold); border-color: var(--gold); animation: none; box-shadow: inset 0 0 18px rgba(201, 162, 75, 0.15); }
@keyframes av-pulse { 50% { box-shadow: inset 0 0 20px rgba(201, 162, 75, 0.18); border-color: rgba(201, 162, 75, 0.75); } }
.profile-id h1 { font-family: var(--font-head); font-size: 2.15rem; font-weight: 700; letter-spacing: 0.02em; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.6); }
.profile-id .role-line { display: flex; align-items: center; gap: 0.65rem; margin-top: 0.4rem; flex-wrap: wrap; }
.profile-bio { color: var(--parchment-dim); font-style: italic; max-width: 560px; margin-top: 0.5rem; }

.badge-plate {
  display: inline-flex; align-items: center; gap: 0.6rem;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 6px;
  padding: 0.45rem 0.85rem;
}
.badge-plate .badge-name { font-family: var(--font-pixel); font-size: 0.55rem; line-height: 1.6; }
.badge-plate .badge-tier { font-size: 0.75rem; color: var(--parchment-faint); display: block; font-family: var(--font-body); }
.badge-t1 .badge-name { color: #c6c1b0; }
.badge-t2 .badge-name { color: #cf9a58; }
.badge-t3 .badge-name { color: #aab2c6; }
.badge-t4 .badge-name { color: var(--gold); text-shadow: 0 0 10px rgba(201,162,75,0.5); }
.badge-t5 .badge-name { color: #b366cc; text-shadow: 0 0 10px rgba(122,42,143,0.7); }
.badge-editor .badge-name { color: #6d8fc9; }
.badge-admin .badge-name { color: #c94f5c; text-shadow: 0 0 10px rgba(163,18,38,0.6); }
.badge-plate.badge-t5 { border-color: #4a1a5c; box-shadow: 0 0 18px rgba(122, 42, 143, 0.25); }
.badge-plate.badge-t4 { border-color: #4d3f22; }
.badge-plate.badge-admin { border-color: #5c1017; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.9rem; margin: 1.5rem 0; }
.stat-box {
  background: linear-gradient(165deg, var(--ink-2), var(--ink-3));
  border: 1px solid var(--line); border-radius: 8px;
  padding: 1rem 1.1rem; text-align: center;
  transition: transform 0.3s var(--ease-lurk), border-color 0.3s, box-shadow 0.3s;
}
.stat-box:hover { transform: translateY(-3px); border-color: var(--gold-soft); box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35); }
.stat-box .n { font-family: var(--font-head); font-size: 1.8rem; font-weight: 700; color: var(--gold); display: block; font-variant-numeric: tabular-nums; text-shadow: 0 0 20px rgba(201, 162, 75, 0.15); }
.stat-box .l { font-family: var(--font-head); font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--parchment-faint); }

.badge-progress { background: var(--ink-2); border: 1px solid var(--line); border-radius: 6px; padding: 1.25rem 1.4rem; margin: 1rem 0 2rem; }
.badge-progress .bp-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.8rem; }
.badge-progress .bp-track { height: 10px; background: var(--ink); border: 1px solid var(--line-soft); border-radius: 999px; overflow: hidden; }
.badge-progress .bp-fill { height: 100%; background: linear-gradient(90deg, var(--blood), var(--ember), var(--gold)); border-radius: 999px; transition: width 1.2s var(--ease-lurk); box-shadow: 0 0 12px rgba(232, 104, 31, 0.5); }
.badge-progress .bp-legend { display: flex; justify-content: space-between; margin-top: 0.6rem; font-size: 0.8rem; color: var(--parchment-faint); }
.badge-ladder { display: flex; gap: 0.9rem; flex-wrap: wrap; margin-top: 1rem; }
.badge-ladder .rung { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; opacity: 0.35; filter: grayscale(0.9); transition: 0.4s; width: 86px; text-align: center; }
.badge-ladder .rung.earned { opacity: 1; filter: none; }
.badge-ladder .rung .rn { font-family: var(--font-pixel); font-size: 0.42rem; line-height: 1.7; color: var(--parchment-dim); }
.badge-ladder .rung .rs { font-size: 0.72rem; color: var(--parchment-faint); }

.profile-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin: 1.5rem 0; overflow-x: auto; }
.profile-tabs button {
  font-family: var(--font-head); font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase;
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--parchment-dim); padding: 0.75rem 1.2rem; cursor: pointer; white-space: nowrap; transition: 0.25s;
}
.profile-tabs button:hover { color: var(--parchment); }
.profile-tabs button.active { color: var(--gold); border-bottom-color: var(--blood); }

.row-list { display: flex; flex-direction: column; }
.row-item {
  display: flex; align-items: center; gap: 1rem; padding: 0.9rem 0.6rem;
  border-bottom: 1px solid var(--line-soft); cursor: pointer; transition: background 0.25s;
  animation: card-in 0.4s var(--ease-lurk) backwards;
}
.row-item:hover { background: var(--ink-2); }
.row-item .r-main { flex: 1; min-width: 0; }
.row-item .r-title { font-family: var(--font-title); font-size: 1.08rem; font-weight: 600; color: var(--parchment); }
.row-item .r-sub { color: var(--parchment-faint); font-size: 0.85rem; margin-top: 0.15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-item .r-side { color: var(--parchment-faint); font-size: 0.82rem; text-align: right; flex-shrink: 0; }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--parchment-faint); }
.empty-state .px { opacity: 0.5; margin-bottom: 1rem; }
.empty-state p { font-style: italic; }

/* ---- Search page -------------------------------------------------------- */
.search-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 1rem 1.25rem; }
.sg-wide { grid-column: 1 / -1; }
.sg-pair { display: flex; gap: 0.5rem; min-width: 0; }
.sg-pair select { flex: 1.2; min-width: 0; }
.sg-pair input { flex: 1; min-width: 0; }
.search-foot { display: flex; justify-content: flex-end; margin-top: 1.1rem; }
@media (max-width: 720px) {
  /* compact two-column filter sheet instead of a tall stack */
  .search-panel { padding: 1rem 0.9rem; }
  .search-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem 0.7rem; }
  .sg-wide, .sg-checkline { grid-column: 1 / -1; }
  .search-bar { margin-bottom: 1rem; }
  .search-bar input { font-size: 1rem; padding: 0.7rem 0.9rem; min-width: 0; }
  .search-grid .field label { font-size: 0.68rem; letter-spacing: 0.06em; }
  .search-grid select, .search-grid input { font-size: 0.92rem; padding: 0.55rem 0.6rem; }
  .s-cat-chip { padding: 0.32rem 0.7rem; font-size: 0.66rem; gap: 0.3rem; }
  .search-foot { justify-content: stretch; }
  .search-foot .btn { width: 100%; justify-content: center; }
}
.s-cats { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.s-cat-chip {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-family: var(--font-head); font-size: 0.76rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--parchment-dim); border: 1px solid var(--line); border-radius: 999px;
  padding: 0.4rem 0.9rem; cursor: pointer; transition: 0.2s; user-select: none;
}
.s-cat-chip input { position: absolute; opacity: 0; pointer-events: none; }
.s-cat-chip:hover { color: var(--parchment); border-color: var(--gold-soft); }
.s-cat-chip:has(input:checked) {
  color: var(--gold); border-color: var(--gold);
  background: linear-gradient(180deg, rgba(201, 162, 75, 0.12), rgba(201, 162, 75, 0.04));
}
.search-bar { display: flex; gap: 0.6rem; margin-bottom: 1.5rem; }
.search-bar input {
  flex: 1; background: var(--ink); border: 1px solid var(--line); border-radius: 5px;
  color: var(--parchment); font-family: var(--font-body); font-size: 1.15rem; padding: 0.85rem 1.1rem;
}
.search-bar input:focus { outline: none; border-color: var(--blood); box-shadow: 0 0 0 3px rgba(163, 18, 38, 0.15); }

/* ---- Categories page ---------------------------------------------------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 1.2rem; }
.cat-card {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.8rem;
  background: linear-gradient(165deg, var(--ink-3), var(--ink-2));
  border: 1px solid var(--line); border-radius: 8px; padding: 2rem 1.4rem; cursor: pointer;
  transition: transform 0.35s var(--ease-lurk), box-shadow 0.35s, border-color 0.35s;
}
.cat-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lift); border-color: var(--gold-soft); }
.cat-card h3 { font-family: var(--font-head); font-size: 1.25rem; letter-spacing: 0.08em; text-transform: uppercase; }
.cat-card p { color: var(--parchment-dim); font-size: 0.92rem; font-style: italic; }
.cat-card .cat-count { font-family: var(--font-pixel); font-size: 0.5rem; color: var(--parchment-faint); }

/* ---- Mod / Admin -------------------------------------------------------- */
.mod-card { background: var(--ink-2); border: 1px solid var(--line); border-left: 3px solid var(--ember); border-radius: 6px; padding: 1.1rem 1.3rem; margin-bottom: 1rem; }
.mod-card .m-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; color: var(--parchment-faint); font-size: 0.85rem; }
.mod-card .m-body { margin: 0.6rem 0 0.8rem; white-space: pre-wrap; }
.mod-card .m-flag { color: var(--ember); font-family: var(--font-pixel); font-size: 0.5rem; }
.mod-card .m-actions { display: flex; gap: 0.6rem; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.admin-table th {
  font-family: var(--font-head); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--parchment-faint); text-align: left; padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--line);
}
.admin-table td { padding: 0.65rem 0.7rem; border-bottom: 1px solid var(--line-soft); }
.admin-table tr:hover td { background: var(--ink-2); }
.admin-table select {
  background: var(--ink); color: var(--parchment); border: 1px solid var(--line);
  border-radius: 4px; padding: 0.3rem 0.5rem; font-family: var(--font-body); cursor: pointer;
}
.role-pill { font-family: var(--font-pixel); font-size: 0.45rem; padding: 0.25rem 0.5rem; border-radius: 3px; border: 1px solid; }
.role-writer { color: var(--parchment-dim); border-color: var(--line); }
.role-editor { color: #6d8fc9; border-color: #31518c; }
.role-admin { color: #c94f5c; border-color: #8c1f2c; }
.banned-pill { color: var(--ember); border-color: var(--ember); font-family: var(--font-pixel); font-size: 0.45rem; padding: 0.25rem 0.5rem; border-radius: 3px; border: 1px solid; }

/* ---- Terms -------------------------------------------------------------- */
.terms-doc { max-width: 780px; margin: 0 auto; }
.terms-doc h2 { font-family: var(--font-head); font-size: 1.15rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); margin: 2rem 0 0.75rem; }
.terms-doc p, .terms-doc li { color: var(--parchment-dim); margin-bottom: 0.8rem; }
.terms-doc ul { padding-left: 1.5rem; margin-bottom: 1rem; }

/* ---- Modal -------------------------------------------------------------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: rgba(6, 5, 9, 0.86);
  padding: 1rem; overflow: hidden; /* nothing inside may widen the viewport */
  /* no backdrop-filter here: blur + fade animation causes a first-paint flicker */
  animation: fade-in 0.2s ease-out;
}
@keyframes fade-in { from { opacity: 0; } }
.modal {
  background: linear-gradient(165deg, var(--ink-3), var(--ink-2));
  border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-lift);
  width: 100%; max-width: 480px; padding: 1.75rem 2rem;
  min-width: 0; max-height: 88vh; overflow-y: auto; overflow-x: hidden;
  overflow-wrap: break-word;
  animation: modal-in 0.35s var(--ease-lurk);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(18px) scale(0.97); } }
@keyframes sheet-in { from { opacity: 0.4; transform: translateY(6%); } }
.modal h3 { font-family: var(--font-head); font-size: 1.3rem; margin-bottom: 0.75rem; }
.modal p { color: var(--parchment-dim); margin-bottom: 1.4rem; }
.modal .modal-actions { display: flex; justify-content: flex-end; gap: 0.7rem; }

/* ---- Welcome modal ------------------------------------------------------- */
.welcome-modal { max-width: 520px; text-align: center; }
.welcome-modal h3 { overflow-wrap: break-word; font-size: clamp(1.15rem, 4.5vw, 1.6rem) !important; }
.welcome-modal .welcome-badges { display: flex; justify-content: center; gap: 0.7rem; margin: 1.25rem 0 1.5rem; }
.welcome-modal .welcome-badges .px { filter: drop-shadow(0 0 8px rgba(201, 162, 75, 0.25)); animation: card-in 0.6s var(--ease-lurk) backwards; }
.welcome-modal .welcome-badges .px:nth-child(2) { animation-delay: 0.08s; }
.welcome-modal .welcome-badges .px:nth-child(3) { animation-delay: 0.16s; }
.welcome-modal .welcome-badges .px:nth-child(4) { animation-delay: 0.24s; }
.welcome-modal .welcome-badges .px:nth-child(5) { animation-delay: 0.32s; }

/* ---- Toasts ------------------------------------------------------------- */
#toast-root { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 120; display: flex; flex-direction: column; gap: 0.6rem; }
.toast {
  display: flex; align-items: center; gap: 0.7rem;
  background: var(--ink-3); border: 1px solid var(--line); border-left: 3px solid var(--gold);
  border-radius: 6px; padding: 0.85rem 1.2rem; box-shadow: var(--shadow-lift);
  font-size: 0.95rem; max-width: 360px;
  animation: toast-in 0.4s var(--ease-lurk);
}
.toast.err { border-left-color: var(--blood-bright); }
.toast.leaving { animation: toast-out 0.35s forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(30px); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(30px); } }

/* ---- Skeletons ---------------------------------------------------------- */
.skel { position: relative; overflow: hidden; background: var(--ink-3); border-radius: 6px; min-height: 180px; border: 1px solid var(--line-soft); }
.skel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(226, 217, 196, 0.05) 50%, transparent 70%);
  animation: shimmer 1.6s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ---- Footer ------------------------------------------------------------- */
.site-footer { position: relative; z-index: 2; border-top: 1px solid var(--line); background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.35)); margin-top: 3rem; }
.footer-inner { max-width: 1180px; margin: 0 auto; padding: 2.5rem 1.5rem 3rem; text-align: center; }
.footer-brand { margin-bottom: 0.75rem; animation: candle-flicker 4s ease-in-out infinite; }
@keyframes candle-flicker {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(245, 195, 59, 0.4)); }
  30% { filter: drop-shadow(0 0 10px rgba(245, 195, 59, 0.6)); }
  55% { filter: drop-shadow(0 0 4px rgba(245, 195, 59, 0.3)); }
  75% { filter: drop-shadow(0 0 9px rgba(245, 195, 59, 0.55)); }
}
.footer-line { font-family: var(--font-head); font-size: 0.85rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--parchment-dim); }
.footer-links { margin-top: 0.8rem; font-size: 0.9rem; }
.footer-links a { color: var(--parchment-dim); text-decoration: none; }
.footer-links a:hover { color: var(--gold); }
.dot-sep { display: inline-block; width: 4px; height: 4px; background: var(--gold-soft); border-radius: 50%; margin: 0 0.7rem; vertical-align: middle; }
.footer-fine { margin-top: 1rem; font-size: 0.8rem; color: var(--parchment-faint); font-style: italic; }

/* ---- Hero sky: painted night, baked once, drift on the compositor -------- */
.hero-sky {
  position: absolute; top: -6.5rem; bottom: -0.5rem; left: 50%;
  width: 100vw; max-width: 100vw; transform: translateX(-50%);
  pointer-events: none; overflow: hidden;
}
.sky-canvas {
  position: absolute; top: 0; left: 0; height: 100%; width: 100%;
  /* crop anchored near the moon (x=64% of the painting) so it never crops out */
  object-fit: cover; object-position: 64% top;
}
.sky-drift {
  /* keep the clouds' painted proportions: scale by height, never squash.
     min-width only matters on ultrawide screens, where a mild stretch is
     invisible; on phones width:auto wins and the shapes stay true. */
  height: 100%; width: auto; min-width: 200%; max-width: none;
  object-fit: fill; will-change: transform;
}
.sky-far { animation: sky-drift 240s linear infinite; opacity: 0.9; }
.sky-near { animation: sky-drift 130s linear infinite; }
@keyframes sky-drift { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .sky-drift { animation: none; } }
.hero h1, .hero .tagline, .hero .hero-desc, .hero-actions { position: relative; z-index: 1; }

/* ---- Notification bell --------------------------------------------------- */
.bell-btn { position: relative; }
.bell-dot {
  position: absolute; top: 0; right: 0;
  background: var(--blood-bright); color: #fff; font-family: var(--font-pixel);
  font-size: 0.42rem; line-height: 1; padding: 0.22rem 0.3rem; border-radius: 999px;
  border: 1px solid #0c0a10; animation: bell-pulse 2.5s ease-in-out infinite;
}
@keyframes bell-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }

.modal-notif { max-width: 560px; padding: 1.25rem 1.25rem 0.75rem; }
.notif-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.notif-head h3 { display: flex; align-items: center; gap: 0.5rem; margin: 0; }
.notif-list { max-height: 60vh; overflow-y: auto; margin: 0 -0.5rem; }
.notif-row {
  display: flex; align-items: center; gap: 0.8rem; padding: 0.8rem 0.6rem;
  border-bottom: 1px solid var(--line-soft); cursor: pointer; transition: background 0.2s;
  border-left: 3px solid transparent;
}
.notif-row:hover { background: var(--ink-4); }
.notif-row.unread { border-left-color: var(--blood-bright); background: rgba(163, 18, 38, 0.05); }
.notif-row .n-icon { flex-shrink: 0; }
.notif-row .n-text { flex: 1; font-size: 0.95rem; color: var(--parchment-dim); }
.notif-row .n-text strong { color: var(--gold); font-weight: 600; }
.notif-row .n-time { display: block; font-size: 0.75rem; color: var(--parchment-faint); margin-top: 0.15rem; }
.notif-row .n-del { background: none; border: none; cursor: pointer; opacity: 0.4; padding: 0.3rem; transition: opacity 0.2s; }
.notif-row .n-del:hover { opacity: 1; }

/* ---- Staff quick tools on cards ------------------------------------------
   Inline in the flags row (never overlaying the flag icons, so their
   tooltips stay hoverable); fade in on card hover without reflow. */
.card-modtools {
  display: inline-flex; gap: 0.35rem; align-items: center;
  margin-left: 0.5rem; padding-left: 0.6rem; border-left: 1px solid var(--line-soft);
  opacity: 0; transition: opacity 0.25s;
}
.story-card:hover .card-modtools { opacity: 1; }
.mt-btn {
  display: grid; place-items: center; width: 26px; height: 26px;
  background: var(--ink); border: 1px solid var(--line); border-radius: 4px;
  cursor: pointer; transition: border-color 0.2s, background 0.2s; opacity: 0.7;
}
.mt-btn:hover { border-color: var(--gold-soft); opacity: 1; }
.mt-btn.on { border-color: var(--gold); background: rgba(201, 162, 75, 0.12); opacity: 1; }
.mt-btn.mt-danger:hover { border-color: var(--blood-bright); background: rgba(163, 18, 38, 0.14); }

/* ---- Pinned & announcements ---------------------------------------------- */
.flag-pinned { color: var(--blood-bright); border-color: #6e2a2a; background: rgba(163, 18, 38, 0.1); text-shadow: none; }
.story-card.is-pinned { border-color: #5c2430; background: linear-gradient(165deg, #241520, #16101c); }
.tag-cat.announcements { color: var(--gold); border-color: var(--gold-soft); background: rgba(201, 162, 75, 0.1); }
.story-card.is-announcement { border-color: #4d3f22; }
.story-card.is-announcement::before { background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: 1; }

/* staff-only: reviewed stories read differently at a glance */
.story-card.is-reviewed {
  background: linear-gradient(165deg, #16211b, #131a20);
  border-color: #29473a;
}
.story-card.is-reviewed:hover { border-color: #3a6b52; }
.story-card.is-reviewed::before { background: linear-gradient(90deg, transparent, var(--venom), transparent); }

/* ---- Share bar ------------------------------------------------------------ */
.share-bar {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem; flex-wrap: wrap;
  padding: 1rem 0; border-bottom: 1px solid var(--line);
}
.share-bar .share-label {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-family: var(--font-head); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--parchment-faint); margin-right: 0.5rem;
}

/* ---- Reaction names ------------------------------------------------------- */
.react-btn .rname { font-family: var(--font-head); font-size: 0.72rem; letter-spacing: 0.05em; }
@media (max-width: 640px) { .react-btn .rname { display: none; } }

/* ---- Comment deep-link flash ---------------------------------------------- */
.comment-flash { animation: comment-flash-anim 2.5s ease-out; }
@keyframes comment-flash-anim {
  0%, 30% { background: rgba(163, 18, 38, 0.18); }
  100% { background: transparent; }
}

/* ---- Charts --------------------------------------------------------------- */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 1.1rem; margin: 1rem 0 1.5rem; }
.chart-card {
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 6px;
  padding: 1.1rem 1.25rem; transition: border-color 0.3s;
}
.chart-card:hover { border-color: #43324f; }
.cc-title {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-head); font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--parchment-dim); margin-bottom: 0.9rem;
}
.cc-sub { margin-left: auto; font-size: 0.7rem; letter-spacing: 0.05em; text-transform: none; color: var(--parchment-faint); font-family: var(--font-body); }
.chart-bars { display: flex; flex-direction: column; gap: 0.55rem; }
.cb-row { display: grid; grid-template-columns: 128px 1fr 56px; align-items: center; gap: 0.6rem; }
.cb-label { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; color: var(--parchment-dim); overflow: hidden; }
.cb-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-track { height: 14px; background: var(--ink); border: 1px solid var(--line-soft); border-radius: 4px; overflow: hidden; }
.cb-fill {
  display: block; height: 100%; background: var(--gold); border-radius: 3px 4px 4px 3px;
  transition: width 0.9s var(--ease-lurk); box-shadow: 0 0 8px rgba(201, 162, 75, 0.25);
}
.cb-value { font-size: 0.82rem; color: var(--parchment-faint); text-align: right; font-variant-numeric: tabular-nums; }
.chart-area { width: 100%; height: auto; display: block; }
.cg-line { stroke: var(--line-soft); stroke-width: 1; }
.cg-ylabel { fill: var(--parchment-faint); font-size: 10px; text-anchor: end; font-family: var(--font-body); }
.cg-xlabel { fill: var(--parchment-faint); font-size: 10px; font-family: var(--font-body); }
.cg-hit { fill: transparent; cursor: pointer; }
.cg-dot { opacity: 0; transition: opacity 0.15s; pointer-events: none; }
.cg-pt:hover .cg-dot { opacity: 1; }
.cg-tip { opacity: 0; transition: opacity 0.15s; pointer-events: none; }
.cg-pt:hover .cg-tip, .cg-pt.show .cg-tip { opacity: 1; }
.cg-pt.show .cg-dot { opacity: 1; }
.cg-tip rect { fill: #060509; stroke: var(--gold-soft); stroke-width: 1; }
.cg-tip text { fill: var(--parchment); font-size: 13.5px; font-weight: 600; font-family: var(--font-body); text-anchor: middle; }

/* ---- Banner carousel ------------------------------------------------------ */
.banner-strip { display: flex; align-items: center; gap: 0.35rem; margin: 0 0 1.35rem; position: relative; min-width: 0; max-width: 100%; }
.banner-arrow {
  flex-shrink: 0; display: grid; place-items: center; width: 30px; height: 38px;
  background: none; border: none; cursor: pointer; opacity: 0.4; transition: opacity 0.2s;
}
.banner-arrow:hover { opacity: 0.9; }
.banner-arrow[disabled] { opacity: 0.15; pointer-events: none; }
.banner-slide {
  flex: 1; display: flex; align-items: center; gap: 0.8rem; min-height: 50px; min-width: 0;
  background: rgba(226, 217, 196, 0.02);
  border: 1px solid var(--line-soft); border-left: 3px solid var(--gold-soft);
  border-radius: 4px; padding: 0.65rem 1.1rem;
  animation: banner-in 0.5s var(--ease-lurk); position: relative;
}
@keyframes banner-in { from { opacity: 0; transform: translateX(14px); } }
.banner-slide.linked { cursor: pointer; transition: border-color 0.25s, background 0.25s; }
.banner-slide.linked:hover { border-color: var(--line); border-left-color: var(--gold); background: rgba(226, 217, 196, 0.04); }
.banner-text {
  flex: 1; min-width: 0;
  font-family: var(--font-title); font-style: italic; font-weight: 500;
  font-size: 1.05rem; letter-spacing: 0.01em; color: var(--parchment);
}
.banner-go { opacity: 0.6; }
.banner-slide.linked:hover .banner-go { opacity: 1; }
.banner-del { background: none; border: none; cursor: pointer; opacity: 0.45; padding: 0.3rem; }
.banner-del:hover { opacity: 1; }
.banner-dots { position: absolute; bottom: -14px; left: 50%; transform: translateX(-50%); display: flex; gap: 5px; }
.banner-dots i { width: 5px; height: 5px; background: var(--line); border-radius: 50%; }
.banner-dots i.on { background: var(--gold); }

/* ---- Recommendation carousels on the reader -------------------------------- */
#recs-slot { margin-top: 2.5rem; }
.recs-strip {
  display: grid; grid-auto-flow: column; grid-auto-columns: 208px;
  gap: 0.7rem; overflow-x: auto; padding: 0.3rem 0.25rem 1rem;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  min-width: 0; max-width: 100%;
}
.mini-card {
  scroll-snap-align: start; min-width: 0;
  display: flex; flex-direction: column; gap: 0.4rem;
  background: linear-gradient(165deg, rgba(26, 21, 34, 0.7), rgba(18, 15, 24, 0.7));
  border: 1px solid var(--line-soft); border-radius: 6px;
  padding: 0.8rem 0.95rem 0.7rem; cursor: pointer;
  transition: transform 0.3s var(--ease-lurk), border-color 0.3s, background 0.3s;
}
.mini-card:hover { transform: translateY(-3px); border-color: #43324f; background: linear-gradient(165deg, var(--ink-3), var(--ink-2)); }
.mini-card .mc-top {
  display: flex; align-items: center; gap: 0.4rem;
  font-family: var(--font-head); font-size: 0.58rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--parchment-faint); opacity: 0.85;
}
.mini-card .mc-title {
  font-family: var(--font-title); font-size: 1.02rem; font-weight: 600; line-height: 1.3;
  color: var(--parchment); flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.5em;
}
.mini-card:hover .mc-title { color: #f2e6c8; }
.mini-card .mc-meta {
  display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem;
  font-size: 0.74rem; color: var(--parchment-faint);
}
.mini-card .mc-by { font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-card .mc-meta .m { display: inline-flex; align-items: center; gap: 0.3rem; flex-shrink: 0; }
.mini-card.mini-list { border-color: rgba(77, 63, 34, 0.6); }
.mini-card.mini-list:hover { border-color: var(--gold-soft); }
.mini-card.mini-list .mc-top { color: var(--gold-soft); }

/* staff category switcher */
.cat-switch {
  background: var(--ink); color: var(--parchment); border: 1px solid var(--line);
  border-radius: 4px; padding: 0.35rem 0.5rem; font-family: var(--font-head);
  font-size: 0.75rem; letter-spacing: 0.05em; cursor: pointer;
}
.cat-switch:focus { outline: none; border-color: var(--gold-soft); }

/* ---- Reading list promo rows ----------------------------------------------
   A slim one-line bar, deliberately unlike a story card: category-style
   kicker, name, essentials, quiet arrow. */
.promo-row {
  grid-column: 1 / -1;
  display: flex; align-items: baseline; gap: 0.9rem;
  background: rgba(201, 162, 75, 0.03);
  border: 1px solid var(--line); border-left: 3px solid var(--gold-soft); border-radius: 4px;
  padding: 0.55rem 1rem; cursor: pointer; min-width: 0;
  transition: border-color 0.3s, background 0.3s;
}
.promo-row:hover { border-color: var(--gold-soft); border-left-color: var(--gold); background: rgba(201, 162, 75, 0.06); }
.promo-row .pr-kicker {
  flex: none; display: inline-flex; align-items: center; gap: 0.45rem; align-self: center;
  font-family: var(--font-head); font-size: 0.64rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold-soft);
}
.promo-row .pr-kicker .px { opacity: 0.8; }
.promo-row .pr-name { font-family: var(--font-title); font-size: 1.02rem; font-weight: 600; color: var(--parchment); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.promo-row .pr-sub { flex: 1; min-width: 0; font-size: 0.82rem; color: var(--parchment-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.promo-row .pr-sub strong { color: var(--parchment-dim); }
.promo-row .pr-go { flex: none; align-self: center; opacity: 0.45; transition: opacity 0.3s, transform 0.3s; }
.promo-row:hover .pr-go { opacity: 0.9; transform: translateX(3px); }

/* ---- Reading list modal rows ----------------------------------------------- */
.rl-row {
  display: flex; align-items: center; gap: 0.7rem; width: 100%;
  background: var(--ink); border: 1px solid var(--line); border-radius: 5px;
  padding: 0.6rem 0.9rem; margin-bottom: 0.45rem; cursor: pointer; text-align: left;
  color: var(--parchment); font-family: var(--font-body); font-size: 1rem; transition: 0.2s;
}
.rl-row:hover { border-color: var(--gold-soft); }
.rl-row.in { border-color: #2f5c42; background: rgba(95, 224, 168, 0.05); }
.rl-row .rl-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-row .rl-meta { font-size: 0.8rem; color: var(--parchment-faint); }

/* ---- Badge celebration overlay --------------------------------------------- */
.celebration-overlay { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; }
.celebration-overlay.leaving { animation: cel-out 0.6s forwards; }
@keyframes cel-out { to { opacity: 0; } }
.celebration-veil {
  position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(12, 10, 16, 0.88), rgba(6, 5, 9, 0.97));
  animation: fade-in 0.8s;
}
.celebration-box { position: relative; text-align: center; padding: 2rem; animation: cel-rise 1s var(--ease-lurk); }
@keyframes cel-rise { from { opacity: 0; transform: translateY(40px) scale(0.9); } }
.celebration-rays {
  position: absolute; top: 34%; left: 50%; width: 420px; height: 420px;
  transform: translate(-50%, -50%);
  background: conic-gradient(from 0deg,
    transparent 0deg, rgba(201, 162, 75, 0.12) 10deg, transparent 20deg,
    transparent 45deg, rgba(201, 162, 75, 0.1) 55deg, transparent 65deg,
    transparent 90deg, rgba(201, 162, 75, 0.12) 100deg, transparent 110deg,
    transparent 135deg, rgba(201, 162, 75, 0.1) 145deg, transparent 155deg,
    transparent 180deg, rgba(201, 162, 75, 0.12) 190deg, transparent 200deg,
    transparent 225deg, rgba(201, 162, 75, 0.1) 235deg, transparent 245deg,
    transparent 270deg, rgba(201, 162, 75, 0.12) 280deg, transparent 290deg,
    transparent 315deg, rgba(201, 162, 75, 0.1) 325deg, transparent 335deg);
  border-radius: 50%; animation: cel-spin 26s linear infinite; pointer-events: none;
}
@keyframes cel-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.cel-spark {
  position: absolute; top: 34%; left: 50%; width: 5px; height: 5px;
  background: var(--gold); pointer-events: none;
  animation: cel-spark 2.6s ease-out infinite; animation-delay: var(--d);
  transform-origin: center;
}
@keyframes cel-spark {
  0% { opacity: 0; transform: rotate(var(--a)) translateY(0) scale(1); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(-150px) scale(0.3); }
}
.celebration-badge {
  position: relative; display: inline-block; margin-bottom: 1.25rem;
  filter: drop-shadow(0 0 30px rgba(201, 162, 75, 0.5));
  animation: cel-badge 2.8s ease-in-out infinite;
}
@keyframes cel-badge {
  0%, 100% { transform: translateY(0); filter: drop-shadow(0 0 22px rgba(201, 162, 75, 0.4)); }
  50% { transform: translateY(-8px); filter: drop-shadow(0 0 40px rgba(201, 162, 75, 0.65)); }
}
.celebration-kicker { font-family: var(--font-pixel); font-size: 0.6rem; color: var(--gold-soft); letter-spacing: 0.2em; margin-bottom: 0.7rem; }
.celebration-name {
  font-family: var(--font-display); font-weight: 900; font-size: clamp(1.8rem, 5vw, 2.8rem);
  color: var(--gold); text-shadow: 0 0 24px rgba(201, 162, 75, 0.5); margin-bottom: 0.5rem;
}
.celebration-tier { color: var(--parchment-dim); font-style: italic; margin-bottom: 1.75rem; }

/* ---- Custom scrollbars (site-wide, horizontal & vertical) ---------------- */
* {
  scrollbar-width: thin;                       /* Firefox */
  scrollbar-color: #43324f var(--ink);
}
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #3a2d47, #2e2438);
  border: 2px solid var(--ink);
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:horizontal { background: linear-gradient(90deg, #3a2d47, #2e2438); }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #5c4670, #43324f); }
::-webkit-scrollbar-thumb:active { background: var(--gold-soft); }
::-webkit-scrollbar-corner { background: var(--ink); }

/* ---- Reaction label reveal ------------------------------------------------
   The label floats ABOVE the button so revealing it never reflows the row
   (an inline expansion caused hover oscillation at button edges). */
.react-btn { position: relative; }
.react-btn .rlabel {
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #060509; border: 1px solid var(--line); border-radius: 4px;
  padding: 0.3rem 0.6rem; white-space: nowrap;
  font-family: var(--font-head); font-size: 0.7rem; letter-spacing: 0.06em; color: var(--parchment);
  opacity: 0; pointer-events: none; z-index: 30;
  transition: opacity 0.2s, transform 0.25s var(--ease-lurk);
  box-shadow: var(--shadow-card);
}
@media (hover: hover) {
  .react-btn:hover .rlabel { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.react-btn.armed { border-color: var(--gold); background: rgba(201, 162, 75, 0.1); }
.react-btn.armed .rlabel { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- Comment sorts --------------------------------------------------------- */
.section-head .csort { display: flex; gap: 0; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; background: var(--ink-2); }
.csort button {
  font-family: var(--font-head); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--parchment-faint); background: none; border: none; border-right: 1px solid var(--line-soft);
  padding: 0.4rem 0.75rem; cursor: pointer; transition: 0.2s;
}
.csort button:last-child { border-right: none; }
.csort button:hover { color: var(--parchment); }
.csort button.active { color: var(--gold); background: rgba(201, 162, 75, 0.08); }

/* ---- Story nav rail (long reads) -------------------------------------------- */
.story-nav {
  position: fixed; right: 1.1rem; bottom: 5.5rem; z-index: 40;
  display: flex; flex-direction: column; gap: 0.45rem;
  opacity: 0; transform: translateX(10px); pointer-events: none;
  transition: opacity 0.35s, transform 0.35s var(--ease-lurk);
}
.story-nav.show { opacity: 1; transform: none; pointer-events: auto; }
.story-nav button {
  display: grid; place-items: center; width: 42px; height: 42px;
  background: linear-gradient(165deg, var(--ink-3), var(--ink-2));
  border: 1px solid var(--line); border-radius: 6px; cursor: pointer;
  box-shadow: var(--shadow-card); transition: border-color 0.25s, transform 0.25s var(--ease-lurk);
}
.story-nav button:hover { border-color: var(--gold-soft); transform: translateY(-2px); }

/* ---- Rich text editor -------------------------------------------------------- */
.rte { border: 1px solid var(--line); border-radius: 6px; background: var(--ink); overflow: hidden; }
.rte-bar {
  display: flex; align-items: center; gap: 0.15rem; flex-wrap: wrap;
  padding: 0.45rem 0.6rem; background: var(--ink-2); border-bottom: 1px solid var(--line);
}
.rte-bar button {
  display: grid; place-items: center; min-width: 32px; height: 32px; padding: 0 0.5rem;
  background: none; border: 1px solid transparent; border-radius: 4px; cursor: pointer;
  color: var(--parchment-dim); font-family: var(--font-body); font-size: 0.95rem; transition: 0.2s;
}
.rte-bar button:hover { color: var(--parchment); border-color: var(--line); background: var(--ink-3); }
.rte-sep { width: 1px; height: 20px; background: var(--line); margin: 0 0.35rem; }
.rte-area {
  min-height: 320px; padding: 1rem 1.2rem; outline: none;
  color: var(--parchment); font-family: var(--font-body); font-size: 1.08rem; line-height: 1.7;
}
.rte-area:focus { box-shadow: inset 0 0 0 2px rgba(163, 18, 38, 0.25); }
.rte-area img { max-width: 100%; height: auto; border-radius: 4px; }
.rte-area a { color: var(--gold); }
.rte-area h3 { font-family: var(--font-head); font-size: 1.3rem; margin: 0.8rem 0 0.4rem; }
.rte-area blockquote { border-left: 3px solid var(--blood); margin: 0.8rem 0; padding: 0.3rem 0 0.3rem 1rem; color: var(--parchment-dim); font-style: italic; }
.rte-area hr { border: none; border-top: 1px solid var(--line); margin: 1.2rem 0; }

/* ---- HTML story bodies (announcements) ---------------------------------------- */
.story-body-html p:first-of-type::first-letter { all: unset; }
.story-body-html img { max-width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--line); margin: 0.5rem 0; }
.story-body-html a { color: var(--gold); }
.story-body-html h3 { font-family: var(--font-head); font-size: 1.45rem; margin: 1.4rem 0 0.6rem; color: var(--parchment); }
.story-body-html blockquote { border-left: 3px solid var(--blood); margin: 1rem 0; padding: 0.4rem 0 0.4rem 1.2rem; color: var(--parchment-dim); font-style: italic; }
.story-body-html hr { border: none; border-top: 1px solid var(--line); margin: 1.6rem 0; }
.story-body-html ul, .story-body-html ol { padding-left: 1.6rem; margin-bottom: 1.2rem; }

/* ---- Share modal ----------------------------------------------------------- */
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.share-grid .btn { justify-content: center; }
.share-grid .btn:first-child { grid-column: 1 / -1; }

/* ---- Mobile adaptation pass ----------------------------------------------- */
@media (max-width: 720px) {
  .view { padding: 1.25rem 0.9rem 4rem; }
  .hero { padding: 4.5rem 0.5rem 2rem; }

  /* comment sort control: full-width row under the Whispers title */
  .section-head .csort { width: 100%; }
  .csort button { flex: 1; padding: 0.45rem 0.3rem; font-size: 0.62rem; text-align: center; }

  /* strips and rows */
  .picks-strip { grid-template-columns: 1fr; }
  .promo-row { flex-wrap: wrap; padding: 0.6rem 0.9rem; gap: 0.35rem 0.7rem; }
  .promo-row .pr-sub { flex-basis: 100%; }
  .promo-row .pr-go { margin-left: auto; }
  .banner-slide { min-width: 0; padding: 0.6rem 0.8rem; }
  .banner-text { font-size: 0.92rem; }

  /* reader */
  .reader-actions { gap: 0.4rem; padding: 1rem 0; }
  .react-btn { padding: 0.35rem 0.65rem; font-size: 0.85rem; }
  .share-bar { gap: 0.4rem; }
  .share-bar .btn { flex: 1 1 40%; min-width: 0; justify-content: center; padding: 0.5rem 0.4rem; font-size: 0.7rem; }
  .story-body { font-size: 1.1rem; }
  .story-nav { right: 0.6rem; bottom: 4.2rem; }
  .story-nav button { width: 38px; height: 38px; }

  /* panels, profiles, charts */
  .panel { padding: 1.4rem 1.1rem; }
  .profile-head { gap: 1rem; }
  .profile-sigil { width: 72px; height: 72px; }
  .stat-row { grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 0.6rem; }
  .stat-box { padding: 0.75rem 0.5rem; }
  .stat-box .n { font-size: 1.3rem; }
  .cb-row { grid-template-columns: 92px 1fr 48px; gap: 0.45rem; }
  .cb-label { font-size: 0.78rem; }
  .badge-ladder { gap: 0.5rem; }
  .badge-ladder .rung { width: 72px; }

  /* modals */
  .modal { padding: 1.4rem 1.2rem; }
  .modal .modal-actions { flex-wrap: wrap; }

  /* notifications become a full-screen sheet on phones */
  .sheet-overlay { padding: 0; place-items: stretch; }
  .sheet-overlay .modal-notif {
    width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh;
    border: none; border-radius: 0; margin: 0;
    display: flex; flex-direction: column;
    padding: 0.9rem 0.9rem 0.4rem;
    animation: sheet-in 0.3s var(--ease-lurk);
  }
  .sheet-overlay .notif-head { padding-bottom: 0.6rem; border-bottom: 1px solid var(--line); margin-bottom: 0; }
  .sheet-overlay .notif-list { flex: 1; max-height: none; margin: 0 -0.4rem; }
  .sheet-overlay .notif-row { padding: 0.95rem 0.5rem; }
  .sheet-overlay .notif-row .n-del { opacity: 0.6; padding: 0.6rem; }
  .sheet-overlay .n-text { font-size: 1rem; }

  /* misc */
  .page-title { font-size: 1.55rem; }
  .reader-head h1 { font-size: clamp(1.5rem, 7vw, 2.2rem); }
  .flag-pick, .flag-reviewed { font-size: 0.44rem; }
  .card-modtools { opacity: 1; } /* no hover on touch — keep staff tools visible */
  .rte-area { min-height: 220px; padding: 0.8rem; }
  .rte-bar button { min-width: 30px; height: 30px; }
}

/* ---- Utility ------------------------------------------------------------ */
.hidden { display: none !important; }
.center { text-align: center; }
.mt-1 { margin-top: 0.75rem; } .mt-2 { margin-top: 1.5rem; } .mt-3 { margin-top: 2.5rem; }
a { color: var(--gold); }

/* ---- Reviewed seal: color carries which show it was reviewed for -------- */
.rev-seal { --rev-c: #e8e2d4; }
.rev-seal.rev-ue { --rev-c: #e0454f; }      /* Unexplained Encounters — red */
.rev-seal.rev-aitw { --rev-c: #5fe0a8; }    /* Alone in the Woods — green */
.rev-seal.rev-tftbr { --rev-c: #ece7db; }   /* Tales from the Break Room — white */
.flag-ico.rev-seal { border-bottom: 2px solid var(--rev-c); padding-bottom: 2px; }
.flag-reviewed.rev-seal {
  color: var(--rev-c);
  border-color: color-mix(in srgb, var(--rev-c) 45%, transparent);
  background: color-mix(in srgb, var(--rev-c) 9%, transparent);
}

/* ---- Reaction minis on story cards -------------------------------------- */
.card-react { opacity: 0.85; }
.card-react .px { opacity: 0.9; }

/* ---- Story tags --------------------------------------------------------- */
.tag-row { display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; justify-content: center; margin-top: 0.9rem; }
.tag-link {
  font-family: var(--font-body); font-style: italic; font-size: 0.92rem;
  letter-spacing: 0.02em; text-transform: lowercase;
  color: var(--parchment-faint); text-decoration: none; transition: color 0.2s;
}
.tag-link:hover { color: var(--gold); }

/* submit-form tag editor + suggestion cloud */
.label-soft { color: var(--parchment-faint); font-weight: normal; letter-spacing: 0; text-transform: none; }
.tag-editor {
  display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center;
  background: var(--ink); border: 1px solid var(--line); border-radius: 5px;
  padding: 0.45rem 0.6rem; cursor: text;
}
.tag-editor:focus-within { border-color: var(--gold-soft); }
.tag-editor input {
  flex: 1; min-width: 150px; background: none; border: none; outline: none;
  color: var(--parchment); font-family: var(--font-body); font-size: 0.95rem; padding: 0.25rem;
}
.tag-chip {
  display: inline-flex; align-items: center; gap: 0.25rem;
  background: rgba(201, 162, 75, 0.1); border: 1px solid var(--gold-soft); color: var(--gold);
  border-radius: 999px; padding: 0.18rem 0.3rem 0.18rem 0.7rem; font-size: 0.85rem;
}
.tag-chip button { background: none; border: none; color: inherit; cursor: pointer; font-size: 1.05rem; line-height: 1; padding: 0 0.3rem; opacity: 0.7; }
.tag-chip button:hover { opacity: 1; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.tag-suggest {
  background: var(--ink-3); border: 1px solid var(--line); border-radius: 999px;
  color: var(--parchment-dim); padding: 0.3rem 0.8rem; cursor: pointer; font-size: 0.85rem;
  font-family: var(--font-body); transition: 0.2s;
}
.tag-suggest:hover { color: var(--gold); border-color: var(--gold-soft); background: rgba(201, 162, 75, 0.06); }

/* ---- Moderation: all-whispers browser ----------------------------------- */
.mod-wsearch input {
  width: 100%; background: var(--ink); border: 1px solid var(--line); border-radius: 5px;
  color: var(--parchment); font-family: var(--font-body); font-size: 1rem;
  padding: 0.7rem 1rem; margin-bottom: 1rem;
}
.mod-wsearch input:focus { outline: none; border-color: var(--gold-soft); }
.mod-whisper .m-actions { margin-top: 0.6rem; }

/* ---- Notification bell beside the burger -------------------------------- */
.bell-slot { display: flex; align-items: center; }
.bell-slot .bell-btn {
  background: none; border: 1px solid transparent; border-radius: 3px;
  padding: 0.5rem 0.6rem; cursor: pointer; transition: background 0.25s;
}
.bell-slot .bell-btn:hover { background: var(--ink-3); }
@media (max-width: 900px) {
  .bell-slot { margin-left: auto; }
  .nav-burger { margin-left: 0; }
}

/* ---- Profile pictures ---------------------------------------------------- */
.avatar { border-radius: 50%; object-fit: cover; vertical-align: middle; border: 1px solid var(--line); background: var(--ink); }
.av-16 { width: 18px; height: 18px; margin-right: 0.4rem; }
.av-24 { width: 26px; height: 26px; margin-right: 0.45rem; }
.av-32 { width: 36px; height: 36px; }
.av-big { width: 96px; height: 96px; border-radius: 12px; border: 1px solid var(--gold-soft); box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5); }
.author-link .av-16 { position: relative; top: -1px; }
.c-avatar .av-32 { border-radius: 8px; }
@media (max-width: 720px) { .av-big { width: 72px; height: 72px; } }

/* ---- Polls --------------------------------------------------------------- */
.cat-mini.polls { color: #d4a7e8; }
.poll-box { display: flex; flex-direction: column; gap: 0.4rem; margin: 0.35rem 0 0.5rem; max-width: 560px; }
.poll-reader { margin: 1.5rem auto 0; width: 100%; }
.poll-opt {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
  background: rgba(226, 217, 196, 0.03); border: 1px solid var(--line); border-radius: 5px;
  padding: 0.55rem 0.85rem; cursor: pointer; overflow: hidden; text-align: left;
  color: var(--parchment-dim); font-family: var(--font-body); font-size: 0.95rem;
  transition: border-color 0.2s, color 0.2s;
}
.poll-opt:hover { border-color: var(--gold-soft); color: var(--parchment); }
.poll-opt.mine { border-color: var(--gold); color: var(--gold); }
.po-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, rgba(201, 162, 75, 0.16), rgba(201, 162, 75, 0.06));
  transition: width 0.5s var(--ease-lurk); pointer-events: none;
}
.poll-opt.mine .po-fill { background: linear-gradient(90deg, rgba(201, 162, 75, 0.28), rgba(201, 162, 75, 0.1)); }
.po-label { position: relative; display: inline-flex; align-items: center; gap: 0.4rem; min-width: 0; }
.po-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.po-pct { position: relative; flex: none; font-family: var(--font-head); font-size: 0.78rem; letter-spacing: 0.06em; color: var(--parchment-faint); }
.poll-opt.mine .po-pct { color: var(--gold); }
.poll-total { font-size: 0.8rem; color: var(--parchment-faint); font-style: italic; }
.poll-reader .poll-opt { padding: 0.75rem 1rem; font-size: 1.02rem; }

/* Closed polls: no longer votable — the results ARE the content now */
.poll-closed-head {
  display: inline-flex; align-items: center; gap: 0.4rem; align-self: flex-start;
  font-family: var(--font-head); font-size: 0.72rem; letter-spacing: 0.14em;
  color: var(--gold-soft); border: 1px solid var(--line); border-radius: 4px;
  padding: 0.2rem 0.55rem; background: rgba(201, 162, 75, 0.06);
}
.poll-box-closed .poll-opt { cursor: default; }
.poll-box-closed .poll-opt:hover { border-color: var(--line); color: var(--parchment-dim); }
.poll-box-closed .poll-opt.mine:hover { border-color: var(--gold); color: var(--gold); }
.poll-box-closed .po-fill { background: linear-gradient(90deg, rgba(201, 162, 75, 0.22), rgba(201, 162, 75, 0.08)); }
.poll-opt.winner { border-color: var(--gold); color: var(--parchment); }
.poll-opt.winner .po-fill { background: linear-gradient(90deg, rgba(201, 162, 75, 0.38), rgba(201, 162, 75, 0.14)); }
.poll-opt.winner .po-pct { color: var(--gold); font-size: 0.92rem; }
.poll-opt.winner:hover { border-color: var(--gold); color: var(--parchment); }
.poll-final { color: var(--gold-soft); font-style: normal; font-family: var(--font-head); font-size: 0.76rem; letter-spacing: 0.08em; }

/* poll builder on the submit form */
#poll-opts { display: flex; flex-direction: column; gap: 0.45rem; }

/* ---- Contests ------------------------------------------------------------- */
.cat-mini.contests { color: #e9cf7a; }

/* status strip on contest-post cards */
.contest-strip {
  display: flex; align-items: center; gap: 0.5rem; margin: 0.35rem 0 0.4rem;
  font-size: 0.84rem; color: var(--parchment-dim);
  border: 1px solid var(--line); border-left: 3px solid var(--gold-soft);
  border-radius: 4px; padding: 0.45rem 0.7rem; background: rgba(201, 162, 75, 0.04);
}
.cs-state { font-family: var(--font-head); font-size: 0.7rem; letter-spacing: 0.12em; margin-right: 0.35rem; }
.contest-strip .cs-vote {
  margin-left: auto; flex: none;
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: none; border: 1px solid var(--gold-soft); border-radius: 4px;
  font-family: var(--font-head); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold-soft); padding: 0.25rem 0.6rem; cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.contest-strip .cs-vote:hover { color: var(--gold); border-color: var(--gold); background: rgba(201, 162, 75, 0.08); }
.cs-up { color: #8fb0d8; }
.cs-open { color: #7fb87a; }
.cs-dark { color: #a08bc0; }
.cs-closed { color: var(--parchment-faint); }
.cs-decided { color: var(--gold); }

/* contest hub banner on the contest page */
.contest-box {
  margin: 1.4rem auto 0; max-width: 720px;
  border: 1px solid var(--line); border-radius: 8px; padding: 1.1rem 1.3rem;
  background: linear-gradient(165deg, rgba(201, 162, 75, 0.07), rgba(20, 14, 24, 0.4));
  display: flex; flex-direction: column; gap: 0.75rem;
}
.contest-box.is-dark { background: linear-gradient(165deg, rgba(90, 70, 130, 0.12), rgba(20, 14, 24, 0.5)); }
.contest-box.is-upcoming { background: linear-gradient(165deg, rgba(80, 100, 140, 0.1), rgba(20, 14, 24, 0.45)); }
.contest-box.is-decided { border-color: var(--gold-soft); }
.cb-prize { display: flex; align-items: center; gap: 0.8rem; }
.cb-prize .cb-label { display: block; font-family: var(--font-head); font-size: 0.68rem; letter-spacing: 0.16em; color: var(--gold-soft); }
.cb-prize strong { font-size: 1.08rem; color: var(--parchment); }
.cb-meta { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; font-size: 0.88rem; color: var(--parchment-dim); align-items: center; }
.cb-candles { display: inline-flex; align-items: center; gap: 0.25rem; color: var(--gold-soft); }
.cb-candles .cbc.spent { opacity: 0.25; filter: grayscale(1); }
.cb-cta { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; }
.cb-hint { font-size: 0.82rem; color: var(--parchment-faint); font-style: italic; }
.cb-mine { font-size: 0.88rem; color: var(--parchment-dim); }
.linklike { background: none; border: none; color: var(--gold-soft); cursor: pointer; font: inherit; text-decoration: underline; padding: 0; }
.linklike:hover { color: var(--gold); }

/* entries list: candle rail beside each card */
.contest-entries { margin-top: 2rem; }
.contest-entry-row { display: flex; gap: 0.7rem; align-items: stretch; min-width: 0; }
.contest-entry-row .story-card { flex: 1; min-width: 0; }
.contest-entry-row.is-first .story-card { border-color: var(--gold); }
/* The whole rail IS the vote button — one generous tap target. */
.candle-rail {
  flex: none; width: 52px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 0.4rem; padding: 0.55rem 0;
  font: inherit; color: inherit;
  border: 1px solid var(--line); border-radius: 6px; background: rgba(226, 217, 196, 0.02);
}
.candle-rail .px { opacity: 0.65; transition: opacity 0.2s; }
button.candle-rail {
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
button.candle-rail:hover:not(:disabled) { border-color: var(--gold-soft); background: rgba(201, 162, 75, 0.06); }
button.candle-rail:hover:not(:disabled) .px { opacity: 1; }
button.candle-rail:disabled { cursor: default; }
button.candle-rail:disabled .px { opacity: 0.3; }
.candle-rail.lit {
  border-color: var(--gold); background: rgba(201, 162, 75, 0.07);
  box-shadow: 0 0 14px rgba(201, 162, 75, 0.3), inset 0 0 10px rgba(201, 162, 75, 0.12);
}
.candle-rail.lit .px { opacity: 1; }
.candle-rail.is-mine .px { opacity: 0.55; }
.candle-n { font-family: var(--font-head); font-size: 0.78rem; letter-spacing: 0.05em; color: var(--parchment-dim); }
.candle-rail.lit .candle-n { color: var(--gold); }
.candle-n.sealed { color: var(--parchment-faint); font-style: italic; }
.dark-note {
  font-size: 0.88rem; color: #a08bc0; font-style: italic; margin: 0 0 1rem;
  display: flex; align-items: center; gap: 0.5rem;
}

/* podium */
.podium { display: grid; grid-template-columns: repeat(3, minmax(min(160px, 100%), 1fr)); gap: 0.8rem; margin-bottom: 1.6rem; }
.podium-spot {
  text-align: center; border: 1px solid var(--line); border-radius: 8px;
  padding: 1.1rem 0.8rem; cursor: pointer; transition: border-color 0.2s, transform 0.2s;
  background: rgba(226, 217, 196, 0.02);
}
.podium-spot:hover { transform: translateY(-3px); }
.podium-spot.p1 { border-color: var(--gold); background: linear-gradient(165deg, rgba(201, 162, 75, 0.12), rgba(20, 14, 24, 0.3)); order: 2; }
.podium-spot.p2 { order: 1; }
.podium-spot.p3 { order: 3; }
.ps-place { font-family: var(--font-head); font-size: 0.68rem; letter-spacing: 0.16em; color: var(--gold-soft); margin-top: 0.5rem; }
.podium-spot.p1 .ps-place { color: var(--gold); font-size: 0.78rem; }
.ps-title { font-family: var(--font-title); font-size: 1.02rem; color: var(--parchment); margin-top: 0.3rem; }
.podium-spot.p1 .ps-title { font-size: 1.18rem; }
.ps-author { font-size: 0.82rem; color: var(--parchment-dim); margin-top: 0.15rem; }
.ps-candles { font-size: 0.8rem; color: var(--gold-soft); margin-top: 0.45rem; display: inline-flex; align-items: center; gap: 0.3rem; }
@media (max-width: 720px) {
  .podium { grid-template-columns: 1fr; }
  .podium-spot.p1 { order: 1; } .podium-spot.p2 { order: 2; } .podium-spot.p3 { order: 3; }
}

/* admin payout box */
.payout-box { border: 1px dashed var(--gold-soft); border-radius: 6px; padding: 0.8rem 1rem; margin-bottom: 1.6rem; }
.pb-head { font-family: var(--font-head); font-size: 0.7rem; letter-spacing: 0.14em; color: var(--gold-soft); margin-bottom: 0.6rem; display: flex; align-items: center; gap: 0.4rem; }
.payout-row { display: flex; align-items: center; gap: 0.9rem; padding: 0.3rem 0; font-size: 0.9rem; flex-wrap: wrap; }
.pb-mail { color: var(--gold-soft); font-family: monospace; font-size: 0.84rem; margin-left: auto; }

/* card flags */
.flag-ico.flag-winner.gold { color: var(--gold); filter: drop-shadow(0 0 4px rgba(201, 162, 75, 0.5)); }
.flag-ico.flag-entered { opacity: 0.85; }

/* contest date pickers: native calendars, themed dark */
.date-pair { display: grid; grid-template-columns: repeat(2, minmax(min(180px, 100%), 1fr)); gap: 0 1rem; }
input[type="date"] { color-scheme: dark; }
input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer; opacity: 0.55;
  filter: invert(0.75) sepia(0.5) saturate(1.6) hue-rotate(-10deg);
}
input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }

/* reader: quiet "part of contest X" line under the meta */
.contest-line { margin-top: 0.6rem; }
.contest-line a {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-family: var(--font-head); font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--gold-soft); text-decoration: none;
  border-bottom: 1px solid transparent; padding-bottom: 2px;
  transition: color 0.25s, border-color 0.25s;
}
.contest-line a:hover { color: var(--gold); border-bottom-color: var(--gold-soft); }
.contest-line .px { opacity: 0.85; }

/* profile stat panel: Impact / Activity as a segmented pill */
.stat-panel { margin: 1.4rem 0 0.5rem; }
.stat-panel .stat-row { margin: 0 0 1.5rem; }
.stat-tabs {
  display: inline-flex; gap: 0.25rem; margin-bottom: 0.9rem; max-width: 100%;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 0.25rem;
}
.stat-tabs button {
  background: none; border: 1px solid transparent; border-radius: 999px;
  font-family: var(--font-head); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--parchment-faint); padding: 0.35rem 0.95rem; cursor: pointer; white-space: nowrap;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.stat-tabs button:hover { color: var(--parchment-dim); }
.stat-tabs button.active { color: var(--gold); border-color: var(--gold-soft); background: rgba(201, 162, 75, 0.1); }

/* entry designation on the submit form */
.entry-box {
  border: 1px solid var(--line); border-left: 3px solid var(--gold-soft); border-radius: 5px;
  padding: 0.8rem 1rem; background: rgba(201, 162, 75, 0.04);
}
.entry-box.entry-done { color: var(--parchment-dim); font-size: 0.92rem; display: flex; align-items: center; gap: 0.5rem; }
.entry-check { display: flex; align-items: flex-start; gap: 0.6rem; cursor: pointer; font-size: 0.95rem; }
.entry-check input { margin-top: 0.2rem; }

/* ---- Profile tab & admin browsers ---------------------------------------- */
.tbb-controls, .adm-controls { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.tbb-controls input, .adm-controls input {
  flex: 1; min-width: 200px; max-width: 420px;
  background: var(--ink); border: 1px solid var(--line); border-radius: 5px;
  color: var(--parchment); font-family: var(--font-body); font-size: 0.95rem; padding: 0.6rem 0.9rem;
}
.tbb-controls input:focus, .adm-controls input:focus { outline: none; border-color: var(--gold-soft); }
.tbb-controls select, .adm-controls select {
  max-width: 260px; cursor: pointer;
  background: var(--ink); border: 1px solid var(--line); border-radius: 5px;
  color: var(--parchment); font-family: var(--font-body); font-size: 0.95rem;
  padding: 0.6rem 0.9rem; transition: border-color 0.3s;
}
.tbb-controls select option, .adm-controls select option { background: var(--ink-2); }
.tbb-controls select:focus, .adm-controls select:focus { outline: none; border-color: var(--gold-soft); }
.tbb-count { font-size: 0.8rem; color: var(--parchment-faint); font-style: italic; white-space: nowrap; }
.tbb-head { font-family: var(--font-head); font-size: 1rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--parchment-dim); margin: 1.5rem 0 0.75rem; }
.tab-browse + .tbb-head { margin-top: 2.25rem; }

/* ---- Edit Profile & Account modals --------------------------------------- */
.ep-picture { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.1rem; flex-wrap: wrap; }
.ep-preview { flex: none; display: grid; place-items: center; width: 96px; height: 96px; background: var(--ink); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ep-preview .av-big { width: 96px; height: 96px; border: none; border-radius: 0; box-shadow: none; }
.ep-picbtns { display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start; min-width: 0; }
.acct-menu { display: flex; flex-direction: column; gap: 0.55rem; margin: 0.25rem 0 0.75rem; }
.acct-row {
  display: flex; flex-direction: column; gap: 0.2rem; align-items: flex-start; text-align: left;
  background: rgba(226, 217, 196, 0.03); border: 1px solid var(--line); border-radius: 6px;
  padding: 0.75rem 1rem; cursor: pointer; transition: border-color 0.2s, background 0.2s;
}
.acct-row:hover { border-color: var(--gold-soft); background: rgba(226, 217, 196, 0.05); }
.acct-row .ar-title { display: inline-flex; align-items: center; gap: 0.45rem; font-family: var(--font-head); font-size: 0.9rem; letter-spacing: 0.06em; color: var(--parchment); }
.acct-row .ar-sub { font-size: 0.82rem; color: var(--parchment-faint); font-style: italic; }
.acct-row.acct-danger { border-color: #4a1c22; }
.acct-row.acct-danger:hover { border-color: var(--blood-bright); background: rgba(163, 18, 38, 0.07); }
.acct-row.acct-danger .ar-title { color: #e0626e; }

/* email preference rows: checkbox + label text */
.pref-row { flex-direction: row; align-items: center; gap: 0.8rem; cursor: pointer; }
.pref-row input { flex: none; width: 17px; height: 17px; accent-color: var(--gold); cursor: pointer; }
.pref-row span { display: flex; flex-direction: column; gap: 0.15rem; }

/* ---- Threaded whispers: votes, collapse, replies ------------------------- */
.c-vote { display: flex; flex-direction: column; align-items: center; gap: 0; flex: none; width: 22px; padding-top: 0.1rem; }
.cv-btn { background: none; border: none; cursor: pointer; padding: 0.05rem 0.15rem; opacity: 0.35; transition: opacity 0.2s, transform 0.15s; line-height: 0; }
.cv-btn .px { width: 13px; height: 13px; }
.cv-btn:hover { opacity: 0.9; transform: scale(1.15); }
.cv-btn.on { opacity: 1; }
.cv-btn.up.on .px { filter: drop-shadow(0 0 4px rgba(201, 162, 75, 0.8)); }
.cv-btn.down.on .px { filter: drop-shadow(0 0 4px rgba(163, 18, 38, 0.8)); }
.cv-score { font-family: var(--font-head); font-size: 0.74rem; color: var(--parchment-faint); line-height: 1.1; }
.cv-score.pos { color: var(--gold); }
.cv-score.neg { color: var(--blood-bright); }
.c-collapse {
  background: none; border: none; border-radius: 3px;
  color: var(--parchment-faint); width: 16px; height: 16px; line-height: 1;
  cursor: pointer; font-size: 0.85rem; padding: 0; flex: none; transition: 0.2s; opacity: 0.55;
  order: 10; /* quiet, after the meta instead of crowding the name */
}
.c-collapse:hover { color: var(--gold); opacity: 1; }
.c-folded { display: none; font-size: 0.78rem; color: var(--parchment-faint); font-style: italic; }
.comment-thread.collapsed > .comment .c-body,
.comment-thread.collapsed > .comment .c-tools,
.comment-thread.collapsed > .comment .c-replyform,
.comment-thread.collapsed > .comment .c-vote,
.comment-thread.collapsed > .c-children { display: none; }
.comment-thread.collapsed > .comment .c-folded { display: inline; }
.c-children { margin-left: 2rem; padding-left: 0.85rem; border-left: 1px solid var(--line-soft); }
.c-children-flat { margin-left: 0; padding-left: 0; border-left: none; }
.c-replyform { margin-top: 0.6rem; }
.c-replyform textarea {
  width: 100%; min-height: 76px; background: var(--ink); border: 1px solid var(--line); border-radius: 5px;
  color: var(--parchment); font-family: var(--font-body); font-size: 0.98rem; padding: 0.65rem 0.85rem;
}
.c-replyform textarea:focus { outline: none; border-color: var(--gold-soft); }
.c-replyform .form-row { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.45rem; }
@media (max-width: 720px) {
  .c-children { margin-left: 0.7rem; padding-left: 0.6rem; }
  .c-vote { width: 26px; }
}
