/* =============================================================
   ZOMBIES // VAULT - map-specific layer on top of the prandor
   editorial base (styles.css). Default theme is dark; adds blood,
   aether, and element-115 themes + all component styling.
   ============================================================= */

:root {
  --accent:      #c0392b;   /* blood */
  --accent-soft: rgba(192,57,43,0.12);
  --aether:      #2aa9c4;   /* dark-aether cyan */
  --e115:        #8ddb3a;   /* element 115 green */
  --gold:        #d9a441;
  --chip-bg:     #f0f0f0;
}
[data-theme="dark"] {
  --accent:      #e0503f;
  --accent-soft: rgba(224,80,63,0.16);
  --chip-bg:     #1a1a1a;
}

/* Blood - high-contrast red/black for the deep-round grinder */
[data-theme="blood"] {
  --bg: #0c0606; --bg-alt: #140a0a; --black: #fff; --text: #ecd9d6;
  --dim: #8a5d57; --faint: #5a3b37; --muted: #341f1d; --rule: #2a1614;
  --accent: #ff4b35; --accent-soft: rgba(255,75,53,0.18); --chip-bg:#1c0e0d;
  --shadow: 0 1px 3px rgba(0,0,0,.5); --shadow-lg: 0 6px 20px rgba(0,0,0,.6);
}
/* Aether - dark-aether blue */
[data-theme="aether"] {
  --bg: #05080d; --bg-alt: #0a1018; --black: #fff; --text: #cfe3ee;
  --dim: #5d7c8a; --faint: #3a5060; --muted: #14222c; --rule: #122029;
  --accent: #36c6e6; --accent-soft: rgba(54,198,230,.16); --chip-bg:#0c1620;
  --shadow: 0 1px 3px rgba(0,0,0,.5); --shadow-lg: 0 6px 20px rgba(0,0,0,.6);
}
/* Element 115 - irradiated green */
[data-theme="e115"] {
  --bg: #060a05; --bg-alt: #0b110a; --black: #fff; --text: #d6eccf;
  --dim: #5f7c52; --faint: #3c5033; --muted: #18230f; --rule: #15240f;
  --accent: #9be34a; --accent-soft: rgba(155,227,74,.16); --chip-bg:#0e1709;
  --shadow: 0 1px 3px rgba(0,0,0,.5); --shadow-lg: 0 6px 20px rgba(0,0,0,.6);
}

body { background: var(--bg); color: var(--text); }
.theme-btn {
  background: none; border: 1px solid var(--rule); color: var(--dim);
  font-family: var(--mono); font-size: .72rem; padding: 4px 8px;
  border-radius: var(--radius); cursor: pointer; letter-spacing: .03em;
}
.theme-btn:hover { color: var(--accent); border-color: var(--accent); }
.sep { color: var(--accent); }

/* live visitor counter (in nav) */
.visit-counter { font-family: var(--mono); font-size: .68rem; color: var(--dim); display: inline-flex; align-items: center; gap: 5px; margin-left: 10px; white-space: nowrap; }
.visit-counter[hidden] { display: none; }
.visit-counter b { color: var(--accent); font-weight: 500; }
.visit-counter .vc-sep { opacity: .45; }
.vc-dot { width: 7px; height: 7px; border-radius: 50%; background: #2ecc71; box-shadow: 0 0 6px #2ecc71; animation: vc-pulse 2.2s ease-in-out infinite; flex: none; }
@keyframes vc-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@media (max-width: 700px) { .visit-counter .vc-total { display: none; } }
@media (max-width: 420px) { .visit-counter { display: none; } }

/* ---------- hero ---------- */
.hero { border-bottom: 1px solid var(--rule); }
.hero-inner { max-width: 1100px; margin: 0 auto; padding: 30px 24px 40px; }
.kicker {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .22em;
  color: var(--accent); margin: 0 0 14px; text-transform: uppercase;
}
.hero-title {
  font-size: clamp(2.4rem, 7vw, 4.6rem); line-height: .98; margin: 0 0 18px;
  font-weight: 700; letter-spacing: -.01em; color: var(--black);
}
.hero .lede { max-width: 720px; font-size: 1.05rem; line-height: 1.6; color: var(--dim); }
.hero .lede strong { color: var(--text); }
.hero-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.stat-chip {
  font-family: var(--mono); font-size: .78rem; border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 8px 12px; background: var(--bg-alt);
}
.stat-chip b { color: var(--accent); font-weight: 500; }

/* ---------- controls ---------- */
.controls { max-width: 1100px; margin: 0 auto; padding: 32px 24px 8px; }
.studio-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--rule); }
.studio-tab {
  font-family: var(--mono); font-size: .82rem; padding: 9px 16px; cursor: pointer;
  border: 1px solid var(--rule); border-radius: var(--radius); background: var(--bg-alt);
  color: var(--dim); letter-spacing: .02em;
}
.studio-tab:hover { color: var(--text); border-color: var(--accent); }
.studio-tab.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.controls-row { display: flex; gap: 12px; margin-bottom: 16px; }
.search {
  flex: 1; font-family: var(--sans); font-size: .95rem; padding: 11px 14px;
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--bg-alt); color: var(--text);
}
.search:focus { outline: none; border-color: var(--accent); }
.select {
  font-family: var(--mono); font-size: .8rem; padding: 0 12px;
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--bg-alt); color: var(--text); cursor: pointer;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip-row.sub { margin-bottom: 14px; }
.fchip {
  font-family: var(--mono); font-size: .74rem; padding: 6px 11px;
  border: 1px solid var(--rule); border-radius: 100px; background: var(--bg-alt);
  color: var(--dim); cursor: pointer; letter-spacing: .02em; user-select: none;
}
.fchip:hover { border-color: var(--accent); color: var(--text); }
.fchip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.fchip.story.on { background: var(--aether); border-color: var(--aether); }
.controls-meta {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  font-family: var(--mono); font-size: .76rem; color: var(--dim);
  padding-top: 4px; border-top: 1px solid var(--rule);
}
.result-count { color: var(--text); }
.toggle { display: flex; align-items: center; gap: 6px; cursor: pointer; }

/* ---------- map grid ---------- */
.grid-wrap { max-width: 1100px; margin: 0 auto; padding: 18px 24px 48px; }
.map-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 18px;
}
.map-card {
  border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden;
  background: var(--bg-alt); cursor: pointer; display: flex; flex-direction: column;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.map-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-lg); }
.map-thumb {
  aspect-ratio: 16/9; background: #000 center/cover no-repeat; position: relative;
  border-bottom: 1px solid var(--rule);
}
.map-thumb.placeholder {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); color: var(--faint); font-size: .72rem;
  background: repeating-linear-gradient(45deg, #111 0 10px, #161616 10px 20px);
}
.map-thumb .game-badge {
  position: absolute; top: 8px; left: 8px; font-family: var(--mono);
  font-size: .64rem; letter-spacing: .05em; padding: 3px 7px; border-radius: 4px;
  background: rgba(0,0,0,.72); color: #fff; backdrop-filter: blur(2px);
}
.map-thumb .beaten-flag {
  position: absolute; top: 8px; right: 8px; font-family: var(--mono);
  font-size: .62rem; padding: 3px 7px; border-radius: 4px;
  background: var(--accent); color: #fff; display: none;
}
.map-card.beaten .beaten-flag { display: block; }
.map-card.beaten { border-color: var(--accent); }
.map-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.map-name { font-size: 1.02rem; font-weight: 600; color: var(--black); line-height: 1.15; }
.map-sub { font-family: var(--mono); font-size: .7rem; color: var(--dim); }
.map-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.tag {
  font-family: var(--mono); font-size: .64rem; padding: 3px 7px; border-radius: 4px;
  border: 1px solid var(--rule); color: var(--dim);
}
.tag.story { color: var(--aether); border-color: color-mix(in srgb, var(--aether) 40%, transparent); }
.tag.ee { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.diff { font-weight: 500; }
.diff-Easy { color: var(--e115); }
.diff-Medium { color: var(--gold); }
.diff-Hard { color: var(--accent); }
.diff-Very.Hard, .diff-Very { color: #ff3b30; }

.empty-note { font-family: var(--mono); font-size: .85rem; color: var(--dim); text-align:center; padding: 40px; }
.empty-note code { background: var(--chip-bg); padding: 2px 6px; border-radius: 4px; }

/* ---------- bands (timeline / perks / stats / about) ---------- */
.band { max-width: 1100px; margin: 0 auto; padding: 44px 24px; border-top: 1px solid var(--rule); }
.band-title { font-size: 1.5rem; margin: 0 0 8px; color: var(--black); }
.band-sub { color: var(--dim); max-width: 720px; margin: 0 0 22px; line-height: 1.55; }

.timeline-wrap { display: flex; flex-direction: column; gap: 26px; }
.tl-game { }
.tl-game h3 { font-family: var(--mono); font-size: .82rem; letter-spacing: .04em; color: var(--accent); margin: 0 0 10px; }
.tl-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tl-map {
  font-family: var(--mono); font-size: .73rem; padding: 6px 10px; cursor: pointer;
  border: 1px solid var(--rule); border-radius: var(--radius); background: var(--bg-alt); color: var(--text);
}
.tl-map:hover { border-color: var(--accent); color: var(--accent); }
.tl-map .yr { color: var(--dim); }

.perk-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.perk-pill {
  font-family: var(--mono); font-size: .74rem; padding: 7px 12px; border-radius: 100px;
  border: 1px solid var(--rule); background: var(--bg-alt);
}
.perk-pill b { color: var(--accent); }
.perk-pill.perk-clickable { cursor: pointer; transition: border-color .12s, transform .12s; }
.perk-pill.perk-clickable:hover { border-color: var(--accent); transform: translateY(-1px); }
.perk-var { display: flex; gap: 12px; align-items: flex-start; }
.perk-var-img { height: 92px; width: auto; max-width: 130px; object-fit: contain; border-radius: 4px; background: #000; cursor: zoom-in; flex: none; }

.stats-wrap { display: block; }
.stat-headline { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 40px; }
.stat-big { border: 1px solid var(--rule); border-radius: var(--radius); padding: 22px 18px; background: var(--bg-alt); text-align: center; }
.stat-big-n { font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 700; color: var(--accent); line-height: 1; font-variant-numeric: tabular-nums; }
.stat-big-l { font-family: var(--mono); font-size: .7rem; color: var(--dim); margin-top: 8px; text-transform: uppercase; letter-spacing: .06em; }
.stats-section { margin-bottom: 34px; }
.stats-h { font-family: var(--mono); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; }
.bar-row { display: grid; grid-template-columns: 156px 1fr 44px; align-items: center; gap: 12px; margin: 7px 0; }
.bar-label { font-family: var(--mono); font-size: .74rem; color: var(--text); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-label .bar-sub { color: var(--dim); }
.bar-track { background: var(--muted); border-radius: 5px; height: 24px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; border-radius: 5px; transition: width 1.1s cubic-bezier(.2, .7, .2, 1); }
.bar-val { font-family: var(--mono); font-size: .76rem; color: var(--text); text-align: right; }
.prog-track { background: var(--muted); border-radius: 6px; height: 30px; overflow: hidden; }
.prog-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #ff7a4a); border-radius: 6px; transition: width 1.2s cubic-bezier(.2, .7, .2, 1); }
.prog-cap { font-family: var(--mono); font-size: .8rem; color: var(--dim); margin-top: 10px; }
.prog-cap b { color: var(--accent); }
@media (max-width: 560px) { .bar-row { grid-template-columns: 92px 1fr 36px; gap: 8px; } }

/* ---------- history / lore page ---------- */
.lore-body { max-width: 760px; margin: 0 auto; }
.lore-intro { font-size: 1.12rem; line-height: 1.6; color: var(--text); margin: 0 0 36px; }
.lore-sec { margin: 0 0 40px; }
.lore-sec h2 { font-size: 1.4rem; color: var(--black); margin: 0 0 14px; }
.lore-sec p { color: var(--dim); line-height: 1.7; margin: 0 0 14px; }
.lore-sec p strong { color: var(--text); }
.cast-table { display: grid; grid-template-columns: 1fr; gap: 0; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; margin: 18px 0; }
.cast-row { display: grid; grid-template-columns: 200px 1fr; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--rule); }
.cast-row:first-child { border-top: none; }
.cast-role { font-weight: 600; color: var(--black); }
.cast-name { font-family: var(--mono); font-size: .82rem; color: var(--accent); }
.cast-note { color: var(--dim); font-size: .9rem; grid-column: 1 / -1; margin-top: -4px; }
@media (max-width: 560px) { .cast-row { grid-template-columns: 1fr; gap: 2px; } }

.about-body p { color: var(--dim); line-height: 1.65; max-width: 720px; }
.about-meta { font-family: var(--mono); font-size: .74rem; color: var(--faint); }

/* ---------- footer ---------- */
.site-footer {
  max-width: 1100px; margin: 0 auto; padding: 28px 24px 60px;
  border-top: 1px solid var(--rule); display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 10px;
}
.footer-credit { font-weight: 700; letter-spacing: .02em; color: var(--black); }
.footer-dim { font-family: var(--mono); font-size: .7rem; color: var(--faint); }

/* ---------- detail drawer ---------- */
.detail-overlay {
  position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.62);
  backdrop-filter: blur(3px); display: flex; justify-content: flex-end;
}
.detail-overlay[hidden] { display: none; }  /* author display:flex would otherwise beat [hidden] */
.detail-panel {
  width: min(760px, 100%); height: 100%; overflow-y: auto; background: var(--bg);
  border-left: 1px solid var(--rule); box-shadow: -8px 0 40px rgba(0,0,0,.4);
  animation: slidein .18s ease;
}
@keyframes slidein { from { transform: translateX(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.detail-close {
  position: sticky; top: 0; float: right; margin: 14px; z-index: 2;
  font-family: var(--mono); font-size: .72rem; background: var(--bg-alt);
  border: 1px solid var(--rule); color: var(--dim); padding: 6px 10px;
  border-radius: var(--radius); cursor: pointer;
}
.detail-close:hover { color: var(--accent); border-color: var(--accent); }

.d-hero { position: relative; }
.d-hero img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; border-bottom: 1px solid var(--rule); }
.d-hero.placeholder { aspect-ratio: 16/9; background: repeating-linear-gradient(45deg,#111 0 12px,#161616 12px 24px); }
.d-head { padding: 22px 28px 6px; }
.d-game { font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; color: var(--accent); }
.d-name { font-size: 1.9rem; font-weight: 700; color: var(--black); margin: 6px 0 4px; }
.d-meta { font-family: var(--mono); font-size: .74rem; color: var(--dim); display: flex; flex-wrap: wrap; gap: 10px; }
.d-meta span::after { content: ""; }
.d-summary { padding: 12px 28px 4px; color: var(--text); line-height: 1.6; }

.d-actions { padding: 12px 28px; }
.beat-btn {
  font-family: var(--mono); font-size: .78rem; padding: 9px 16px; border-radius: var(--radius);
  border: 1px solid var(--accent); background: none; color: var(--accent); cursor: pointer;
}
.beat-btn.on { background: var(--accent); color: #fff; }

.d-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 24px; border-bottom: 1px solid var(--rule); position: sticky; top: 0; background: var(--bg); z-index: 1; }
.d-tab {
  font-family: var(--mono); font-size: .73rem; padding: 9px 12px; cursor: pointer;
  color: var(--dim); border-bottom: 2px solid transparent; background: none; border-top: none; border-left: none; border-right: none;
}
.d-tab.on { color: var(--accent); border-bottom-color: var(--accent); }
.d-tab:hover { color: var(--text); }
.d-pane { padding: 20px 28px 40px; display: none; }
.d-pane.on { display: block; }

.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 16px; font-size: .9rem; }
.kv dt { font-family: var(--mono); font-size: .72rem; color: var(--dim); padding-top: 2px; }
.kv dd { margin: 0; color: var(--text); line-height: 1.5; }

.sec-title { font-family: var(--mono); font-size: .76rem; letter-spacing: .06em; color: var(--accent); text-transform: uppercase; margin: 22px 0 12px; }
.sec-title:first-child { margin-top: 0; }

/* EE checklist */
.ee-prog { font-family: var(--mono); font-size: .74rem; color: var(--dim); margin-bottom: 12px; }
.ee-prog b { color: var(--accent); }
.step {
  display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--rule); cursor: pointer;
}
.step:hover { background: var(--accent-soft); }
.step-no {
  flex: none; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: center; font-family: var(--mono);
  font-size: .74rem; color: var(--dim);
}
.step.done .step-no { background: var(--accent); border-color: var(--accent); color: #fff; }
.step.done .step-title { text-decoration: line-through; color: var(--dim); }
.step-title { font-weight: 600; color: var(--text); }
.step-detail { font-size: .88rem; color: var(--dim); line-height: 1.5; margin-top: 3px; }
.step-loc { font-family: var(--mono); font-size: .7rem; color: var(--faint); margin-top: 4px; }

.item { padding: 12px 0; border-top: 1px solid var(--rule); }
.item:first-of-type { border-top: none; }
.item h4 { margin: 0 0 4px; font-size: .98rem; color: var(--black); }
.item .by { font-family: var(--mono); font-size: .72rem; color: var(--accent); }
.item p { margin: 5px 0 0; color: var(--dim); line-height: 1.55; font-size: .92rem; }
.cipher-text {
  font-family: var(--mono); font-size: .8rem; background: var(--chip-bg); padding: 8px 10px;
  border-radius: var(--radius); white-space: pre-wrap; word-break: break-word; margin: 6px 0; color: var(--text);
}
.empty-pane { font-family: var(--mono); font-size: .82rem; color: var(--faint); padding: 8px 0; }

@media (max-width: 640px) {
  .d-name { font-size: 1.5rem; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dt { margin-top: 8px; }
  .controls-row { flex-direction: column; }
}

/* ---------- animated image marquee (Box Vault / Skin Museum style) ---------- */
.marquee {
  overflow: hidden; position: relative; padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.mq-track { display: flex; gap: 16px; width: max-content; align-items: center; animation: mq-scroll 160s linear infinite; }
.mq-track.rev { animation-direction: reverse; animation-duration: 190s; margin-top: 14px; }
.marquee:hover .mq-track { animation-play-state: paused; }
.mq-track img {
  height: 84px; width: auto; object-fit: contain; border-radius: 3px; cursor: pointer;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.3)); transition: transform .12s;
}
.mq-track img:hover { transform: scale(1.06); }
@keyframes mq-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .mq-track { animation: none; } }

/* ---------- wonder weapon gallery ---------- */
.ww-controls { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.ww-controls .search { max-width: 360px; }
.ww-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.ww-card {
  border: 1px solid var(--rule); border-radius: var(--radius); background: var(--bg-alt);
  padding: 14px; cursor: pointer; text-align: center;
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
.ww-card:hover { border-color: var(--accent); box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.ww-thumb { height: 120px; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.ww-thumb img { max-height: 120px; max-width: 100%; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0,0,0,.4)); }
.ww-thumb.placeholder {
  width: 100%; border: 1px dashed var(--rule); border-radius: var(--radius);
  font-family: var(--mono); font-size: .66rem; color: var(--faint);
}
.ww-name { font-weight: 600; color: var(--black); font-size: .92rem; line-height: 1.15; }
.ww-type { font-family: var(--mono); font-size: .66rem; color: var(--dim); margin-top: 4px; }
.ww-origin { font-family: var(--mono); font-size: .64rem; color: var(--accent); margin-top: 6px; }

/* ---------- drawer image gallery ---------- */
.d-gallery { border-bottom: 1px solid var(--rule); background: #000; }
.d-gallery-main { position: relative; cursor: zoom-in; }
.d-gallery-main img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.d-gallery-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 12px;
  font-family: var(--mono); font-size: .68rem; color: #eee;
  background: linear-gradient(transparent, rgba(0,0,0,.75));
}
.d-thumbs { display: flex; gap: 6px; padding: 8px; overflow-x: auto; background: var(--bg-alt); }
.d-thumb {
  flex: none; width: 78px; height: 46px; object-fit: cover; border-radius: 4px; cursor: pointer;
  border: 2px solid transparent; opacity: .55; transition: opacity .12s;
}
.d-thumb:hover { opacity: 1; }
.d-thumb.on { border-color: var(--accent); opacity: 1; }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.92);
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  cursor: zoom-out; padding: 30px;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 96vw; max-height: 86vh; object-fit: contain; box-shadow: 0 10px 40px rgba(0,0,0,.6); }
.lightbox-cap { font-family: var(--mono); font-size: .8rem; color: #ddd; margin-top: 14px; }

/* ---------- cutscenes ---------- */
.cutscene-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 16px; }
.cs-card {
  border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden;
  background: var(--bg-alt); cursor: pointer;
  transition: transform .12s, border-color .12s, box-shadow .12s;
}
.cs-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-lg); }
.cs-thumb {
  aspect-ratio: 16/9; background: #000 center/cover no-repeat; position: relative;
  border-bottom: 1px solid var(--rule); display: flex; align-items: center; justify-content: center;
}
.cs-thumb::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.18); }
.cs-play { position: relative; z-index: 1; font-family: var(--mono); font-size: .74rem; color: #fff; background: var(--accent); padding: 8px 16px; border-radius: 100px; }
.cs-body { padding: 12px 14px; }
.cs-title { font-weight: 600; color: var(--black); font-size: .95rem; line-height: 1.2; }
.cs-meta { font-family: var(--mono); font-size: .68rem; color: var(--dim); margin-top: 5px; }

/* ---------- video (cutscene) modal ---------- */
.media-modal {
  position: fixed; inset: 0; z-index: 85; background: rgba(0,0,0,.9);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.media-modal[hidden] { display: none; }
.media-box { width: min(1000px, 100%); }
.media-box .detail-close { position: static; float: right; margin: 0 0 8px; }
.media-frame {
  position: relative; width: 100%; aspect-ratio: 16/9; background: #000; clear: both;
  border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden;
}
.media-frame iframe { width: 100%; height: 100%; border: 0; }
.media-cap { font-family: var(--mono); font-size: .76rem; color: #ddd; margin-top: 10px; }

/* ---------- jukebox ---------- */
.jukebox-open {
  position: fixed; left: 16px; bottom: 16px; z-index: 70; font-family: var(--mono);
  font-size: .74rem; padding: 9px 14px; border: 1px solid var(--accent); background: var(--bg-alt);
  color: var(--accent); border-radius: 100px; cursor: pointer; box-shadow: var(--shadow-lg);
}
.jukebox-open:hover { background: var(--accent); color: #fff; }
.jukebox {
  position: fixed; left: 16px; bottom: 16px; z-index: 71; width: 300px; background: var(--bg-alt);
  border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden;
}
.jukebox[hidden] { display: none; }
.jb-head { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-bottom: 1px solid var(--rule); }
.jb-brand { font-family: var(--mono); font-size: .72rem; letter-spacing: .04em; color: var(--text); }
.jb-x { background: none; border: 1px solid var(--rule); color: var(--dim); font-family: var(--mono); font-size: .66rem; padding: 3px 8px; border-radius: 4px; cursor: pointer; }
.jb-x:hover { color: var(--accent); border-color: var(--accent); }
.jb-now { padding: 10px 12px 8px; }
.jb-title { font-weight: 600; color: var(--black); font-size: .9rem; line-height: 1.2; }
.jb-sub { font-family: var(--mono); font-size: .68rem; color: var(--dim); margin-top: 3px; }
.jb-player { width: 100%; aspect-ratio: 16/9; background: #000; }
.jb-player iframe { width: 100%; height: 100%; border: 0; display: block; }
.jb-ctrls { display: flex; gap: 5px; padding: 9px 12px; flex-wrap: wrap; }
.jb-btn { font-family: var(--mono); font-size: .68rem; padding: 6px 10px; border: 1px solid var(--rule); background: var(--bg); color: var(--dim); border-radius: 4px; cursor: pointer; }
.jb-btn:hover { color: var(--accent); border-color: var(--accent); }
.jb-btn.jb-main { color: var(--accent); border-color: var(--accent); }
.jb-list-panel { max-height: 240px; overflow-y: auto; border-top: 1px solid var(--rule); }
.jb-row { padding: 8px 12px; border-bottom: 1px solid var(--rule); cursor: pointer; }
.jb-row:hover { background: var(--accent-soft); }
.jb-row.on .jb-row-t { color: var(--accent); }
.jb-row-t { font-size: .82rem; color: var(--text); }
.jb-row-sub { font-family: var(--mono); font-size: .64rem; color: var(--dim); margin-top: 2px; }
@media (max-width: 640px) { .jukebox { width: calc(100vw - 32px); } }
.jb-art { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-frame video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }

/* ---------- multi-page layout ---------- */
.nav-links a.on { color: var(--accent); }
.page-head { max-width: 1100px; margin: 0 auto; padding: 30px 24px 6px; }
.page-title { font-size: clamp(1.8rem, 5vw, 2.8rem); font-weight: 700; color: var(--black); margin: 6px 0 8px; line-height: 1; }
.page-sub { color: var(--dim); max-width: 720px; line-height: 1.55; margin: 0; }
.band-main { max-width: 1100px; margin: 0 auto; padding: 22px 24px 60px; }
.map-main { max-width: 860px; margin: 0 auto; padding: 22px 24px 64px; }
a.map-card { text-decoration: none; color: inherit; }
.map-main .d-head { padding: 22px 0 6px; }
.map-main .d-summary { padding: 12px 0 4px; }
.map-main .d-actions { padding: 14px 0; }
.map-main .d-tabs { padding: 4px 0; position: static; }
.map-main .d-pane { padding: 20px 0 30px; }
.map-main .d-gallery { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--rule); }

/* =============================================================
   modern touches - progressive enhancement, all safely degrading
   ============================================================= */
html { scroll-behavior: smooth; }
::selection { background: var(--accent); color: #fff; }

/* sticky, glassy nav */
.site-nav { position: sticky; top: 0; z-index: 50; }
@supports (backdrop-filter: blur(8px)) {
  .site-nav { backdrop-filter: blur(12px) saturate(1.15); background: color-mix(in srgb, var(--bg-alt) 76%, transparent); }
  [data-theme="dark"] .site-nav { background: rgba(15, 15, 15, 0.72); }
  [data-theme="blood"] .site-nav { background: rgba(20, 10, 10, 0.72); }
  [data-theme="aether"] .site-nav { background: rgba(10, 16, 24, 0.72); }
  [data-theme="e115"] .site-nav { background: rgba(11, 17, 10, 0.72); }
}
/* animated nav underline */
.nav-links a { position: relative; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -5px; height: 2px; width: 0;
  background: var(--accent); transition: width .2s ease;
}
.nav-links a:hover::after, .nav-links a.on::after { width: 100%; }

/* themed scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--muted) transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 7px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--faint); }

/* hero ambient glow */
.hero { position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; top: -45%; left: 50%; transform: translateX(-50%);
  width: 110%; height: 150%; pointer-events: none; z-index: 0;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 13%, transparent), transparent 72%);
}
.hero-inner { position: relative; z-index: 1; }

/* map thumb: gradient scrim for badge legibility + crisper hover */
.map-thumb { overflow: hidden; }
.map-thumb::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, transparent 58%, rgba(0,0,0,.38));
}
.map-thumb .game-badge, .map-thumb .beaten-flag { z-index: 2; }
.map-card { transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }

/* focus-visible for keyboard users */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
.map-card:focus-visible, .ww-card:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius);
}

/* reveal-on-scroll (only active once JS adds body.reveals) */
body.reveals .reveal { opacity: 0; transform: translateY(16px); }
body.reveals .reveal.in { opacity: 1; transform: none; transition: opacity .5s ease, transform .55s cubic-bezier(.2,.7,.2,1); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body.reveals .reveal { opacity: 1 !important; transform: none !important; }
}

/* scroll-to-top */
.to-top {
  position: fixed; right: 16px; bottom: 16px; z-index: 70; font-family: var(--mono);
  font-size: .72rem; padding: 9px 13px; border: 1px solid var(--rule); background: var(--bg-alt);
  color: var(--dim); border-radius: 100px; cursor: pointer; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .2s, transform .2s, color .15s, border-color .15s;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- nav "More" dropdown ---------- */
.nav-more { position: relative; }
.nav-more-btn { background: none; border: none; color: inherit; font: inherit; cursor: pointer; padding: 0; position: relative; }
.nav-more-btn .caret { font-size: .7em; opacity: .55; margin-left: 2px; }
.nav-more-btn.on, .nav-more-btn:hover { color: var(--accent); }
.nav-dropdown { position: absolute; right: 0; top: calc(100% + 12px); min-width: 170px; padding: 6px; background: var(--bg-alt); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; z-index: 60; }
.nav-dropdown[hidden] { display: none; }
.nav-dropdown a { padding: 8px 12px; border-radius: 4px; font-size: .85rem; }
.nav-dropdown a::after { display: none; }
.nav-dropdown a:hover { background: var(--accent-soft); color: var(--accent); }
.nav-dropdown a.on { color: var(--accent); }

/* ---------- generic info card grid (bestiary / characters / custom / consumables) ---------- */
.grid-controls { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.grid-controls .search { max-width: 360px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.card-grid.small { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 14px; }
.info-card { border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; background: var(--bg-alt); cursor: pointer; transition: transform .15s, border-color .15s, box-shadow .15s; }
.info-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-lg); }
.info-thumb { aspect-ratio: 3/4; background: #000 center/cover no-repeat; border-bottom: 1px solid var(--rule); }
.card-grid.small .info-thumb { aspect-ratio: 1/1; }
.info-thumb.placeholder { display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: .66rem; color: var(--faint); background: repeating-linear-gradient(45deg, #111 0 10px, #161616 10px 20px); }
.info-body { padding: 10px 12px; }
.info-name { font-weight: 600; color: var(--black); font-size: .92rem; line-height: 1.15; }
.info-meta { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; font-family: var(--mono); font-size: .66rem; }
.info-va { color: var(--dim); }
.danger { font-family: var(--mono); font-size: .64rem; padding: 2px 6px; border-radius: 4px; }
.danger-Low { color: #7ec850; } .danger-Medium { color: #d9a441; } .danger-High { color: var(--accent); } .danger-Extreme { color: #ff3b30; }

/* ---------- black market platforms ---------- */
.bm-platforms { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 24px; }
.platform-pill { font-family: var(--mono); font-size: .72rem; padding: 8px 12px; border: 1px solid var(--rule); border-radius: 100px; background: var(--bg-alt); color: var(--dim); text-decoration: none; }
.platform-pill:hover { border-color: var(--accent); color: var(--text); }
.platform-pill b { color: var(--accent); }

/* ---------- storyline beats ---------- */
.era-span { font-family: var(--mono); font-size: .72rem; color: var(--accent); letter-spacing: .04em; margin: -6px 0 12px; }
.beats { list-style: none; counter-reset: beat; padding: 0; margin: 16px 0 0; }
.beats li { counter-increment: beat; position: relative; padding: 0 0 20px 42px; border-left: 2px solid var(--rule); margin-left: 13px; }
.beats li::before { content: counter(beat); position: absolute; left: -15px; top: -2px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-family: var(--mono); font-size: .74rem; display: flex; align-items: center; justify-content: center; }
.beats li:last-child { border-left-color: transparent; }
.beat-t { display: block; font-weight: 600; color: var(--black); margin-bottom: 4px; }
.beat-d { display: block; color: var(--dim); line-height: 1.55; font-size: .92rem; }

/* ---------- play-today link cards ---------- */
.links-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 14px 0 6px; }
.link-card { display: block; padding: 12px 14px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--bg-alt); text-decoration: none; transition: border-color .12s, transform .12s; }
.link-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.link-label { display: block; font-weight: 600; color: var(--accent); font-size: .9rem; }
.link-note { display: block; font-family: var(--mono); font-size: .68rem; color: var(--dim); margin-top: 4px; }

/* =============================================================
   MOBILE: hamburger + off-canvas drawer (per MOBILE-DRAWER-MENU-GUIDE.md)
   body-level drawer + backdrop, pointer-events toggle, transform not display
   ============================================================= */
.nav-toggle {
  display: none; background: none; border: 1px solid var(--rule); border-radius: var(--radius);
  width: 42px; height: 42px; padding: 0; cursor: pointer; position: relative; z-index: 5;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; flex-shrink: 0;
}
.nav-toggle span {
  display: block; position: absolute; left: 10px; width: 20px; height: 2px; background: var(--text);
  pointer-events: none; transition: transform .25s ease, opacity .15s ease, top .25s ease;
}
.nav-toggle span:nth-child(1) { top: 14px; }
.nav-toggle span:nth-child(2) { top: 20px; }
.nav-toggle span:nth-child(3) { top: 26px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { top: 20px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { top: 20px; transform: rotate(-45deg); }

.nav-drawer-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 9998;
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.nav-drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.nav-drawer {
  display: none; position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
  background: var(--bg-alt); border-bottom: 1px solid var(--rule);
  box-shadow: 0 14px 34px rgba(0,0,0,.45); padding: 14px 18px 24px;
  max-height: 100vh; max-height: 100dvh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  transform: translateY(-100%); pointer-events: none;
  transition: transform .3s cubic-bezier(.2,.7,.3,1);
}
.nav-drawer.open { transform: translateY(0); pointer-events: auto; }
.nav-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 0 14px; margin-bottom: 8px; border-bottom: 1px solid var(--rule);
}
.nav-drawer-brand { font-weight: 700; font-size: 1.05rem; color: var(--black); letter-spacing: .02em; }
.nav-drawer-brand .sep { color: var(--accent); }
.nav-drawer-close {
  background: none; border: 1px solid var(--rule); color: var(--dim); font-family: var(--mono);
  font-size: .72rem; padding: 9px 12px; border-radius: var(--radius); cursor: pointer;
  min-height: 40px; touch-action: manipulation;
}
.nav-drawer-close:hover { color: var(--accent); border-color: var(--accent); }
.nav-drawer-links { display: flex; flex-direction: column; gap: 3px; }
.nav-drawer-links a {
  display: flex; align-items: center; min-height: 48px; padding: 10px 14px;
  color: var(--text); text-decoration: none; border-radius: var(--radius); font-size: 1rem;
}
.nav-drawer-links a::after { display: none; }
.nav-drawer-links a:hover, .nav-drawer-links a.on { background: var(--accent-soft); color: var(--accent); }
.drawer-theme {
  margin-top: 12px; min-height: 46px; background: none; border: 1px solid var(--rule);
  color: var(--dim); font-family: var(--mono); font-size: .8rem; border-radius: var(--radius);
  cursor: pointer; touch-action: manipulation;
}
.drawer-theme:hover { color: var(--accent); border-color: var(--accent); }
body.nav-open { overflow: hidden; }

@media (max-width: 820px) {
  .site-nav .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-drawer, .nav-drawer-backdrop { display: block; }
}

/* ---------- broader responsive polish ---------- */
@media (max-width: 820px) {
  .hero-inner { padding: 24px 18px 32px; }
  .controls, .grid-wrap, .band, .band-main, .page-head, .map-main, .site-footer { padding-left: 18px; padding-right: 18px; }
  .mq-track img { height: 64px; }
  .detail-panel { width: 100%; }
}
@media (max-width: 560px) {
  .map-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .ww-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .stat-headline { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
  .d-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .d-tab { white-space: nowrap; }
  .hero-title { font-size: clamp(2rem, 11vw, 3rem); }
  .site-footer { flex-direction: column; align-items: flex-start; gap: 6px; }
  .jukebox-open { left: 12px; bottom: 12px; }
  .to-top { right: 12px; bottom: 12px; }
}
