/* ==========================================================
   Dungeons of Immortal Magic: site styles
   ========================================================== */
:root {
  --bg: #07050c;
  --bg-2: #0e0918;
  --panel: rgba(22, 13, 36, .82);
  --line: #3b2760;
  --text: #ece4f8;
  --muted: #a397bb;
  --purple: #8a3ffc;
  --purple-2: #b57cff;
  --glow: rgba(168, 92, 255, .55);
  --gold: #e8c14a;
  --wall-w: clamp(34px, 9vw, 150px);
  --nav-h: 56px;
  --radius: 14px;
  --serif: "Cinzel", Georgia, serif;
  --deco: "Grenze Gotisch", "Cinzel", Georgia, serif;   /* medieval display face for titles */
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); }
html { overflow-x: hidden; }
body { position: relative; overflow-x: hidden; overflow-x: clip; line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--purple-2); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- dungeon walls ---------- */
/* Background brick: the dungeon card back gridded into a faint wall pattern */
.bricks { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bricks::before {
  content: ""; position: absolute; inset: 0;
  background: url(../assets/cardback-purple.webp) repeat; background-size: clamp(130px, 14vw, 210px) auto;
  opacity: .11;
}
.bricks::after { /* keep the middle darker so text stays readable */
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 50%, rgba(7,5,12,.55), transparent 80%);
}
/* Stone pillars: a double-sided column built by site.js (--pillar), sitting above the ledges */
.walls { position: absolute; inset: 0; pointer-events: none; z-index: 3; overflow: hidden; }
.wall {
  position: absolute; top: 0; bottom: 0; width: calc(var(--wall-w) * 1.7);
  background-image: var(--pillar, url(../assets/stone-border.png)); background-repeat: repeat-y; background-size: 100% auto;
  filter: brightness(.42) saturate(.9);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 140px, #000 calc(100% - 200px), transparent);
          mask-image: linear-gradient(to bottom, transparent 0, #000 140px, #000 calc(100% - 200px), transparent);
}
.wall-l { left: calc(var(--wall-w) * -.7); }
.wall-r { right: calc(var(--wall-w) * -.7); }
.walls::after { /* darkness creeping in from the edges */
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(to right, rgba(7,5,12,.6), transparent calc(var(--wall-w) * 1.1), transparent calc(100% - var(--wall-w) * 1.1), rgba(7,5,12,.6));
}
#flames { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 40; }

/* ---------- torches ---------- */
/* A torch leans out from the wall. Parts are injected by site.js:
   .t-light (cast light), .t-handle (wood), .t-bracket (iron wall mount), .t-cup (iron basket), .tip (where the flame starts) */
.torch {
  position: absolute; z-index: 5; width: 34px; height: 116px; pointer-events: none; --f: 1; --tilt: 0deg; --ts: 1;
  transform-origin: 50% 78%; transform: rotate(var(--tilt)) scale(var(--ts));
}
.torch .t-light { /* the cast light; counter-rotated so it stays round */
  position: absolute; left: 50%; top: 10px; width: 780px; height: 780px; border-radius: 50%;
  transform: translate(-50%, -50%) scale(calc(.9 + var(--f) * .1));
  background: radial-gradient(circle, rgba(178,110,255,.42) 0%, rgba(140,70,240,.18) 28%, rgba(110,40,220,.06) 50%, transparent 68%);
  mix-blend-mode: screen; opacity: calc(.75 + var(--f) * .25);
}
.torch .t-handle {
  position: absolute; left: 50%; top: 20px; width: 16px; height: 96px; transform: translateX(-50%);
  clip-path: polygon(6% 0, 94% 0, 74% 100%, 26% 100%);
  background:
    /* iron bands */
    linear-gradient(#1d1823, #4c4358 45%, #1d1823) 0 8px / 100% 5px no-repeat,
    linear-gradient(#1d1823, #4c4358 45%, #1d1823) 0 46px / 100% 4px no-repeat,
    /* wood grain running along the handle */
    repeating-linear-gradient(90deg, rgba(20,8,0,.35) 0 1px, transparent 1px 3px, rgba(255,210,150,.07) 3px 4px, transparent 4px 6px),
    linear-gradient(176deg, transparent 0 30%, rgba(20,8,0,.35) 31%, transparent 34% 62%, rgba(20,8,0,.3) 63%, transparent 66%),
    linear-gradient(90deg, #2a170b 0%, #6e4526 30%, #8a5a33 48%, #5c3a1f 70%, #24140a 100%);
  box-shadow: inset 0 -10px 12px rgba(0,0,0,.5);
}
.torch .t-bracket { /* iron ring holding the torch to the wall */
  position: absolute; left: 50%; top: 82px; width: 26px; height: 9px; transform: translateX(-50%); border-radius: 3px;
  background: linear-gradient(#5a5068, #26202e); box-shadow: 0 2px 4px rgba(0,0,0,.6);
}
.torch .t-cup { /* iron basket with smouldering wrap */
  position: absolute; left: 50%; top: 6px; width: 30px; height: 20px; transform: translateX(-50%);
  clip-path: polygon(0 0, 100% 0, 78% 100%, 22% 100%);
  background:
    radial-gradient(ellipse 60% 70% at 50% 0%, rgba(210,150,255,.95), rgba(120,40,220,.6) 45%, transparent 70%),
    repeating-linear-gradient(90deg, transparent 0 5px, rgba(0,0,0,.45) 5px 7px),
    linear-gradient(#5b5169, #1f1a26);
}
.torch .tip { position: absolute; left: 50%; top: 7px; width: 2px; height: 2px; margin-left: -1px; }
.torch-hero-l .tip, .torch-wall-l .tip { margin-left: 2px; }   /* left torches lean right: nudge the flame onto the cup */
.torch-hero-l, .torch-wall-l { --tilt: 16deg; }
.torch-hero-r, .torch-wall-r { --tilt: -16deg; }
.torch-hero-l { left: calc(var(--wall-w) * .62); top: 34vh; }
.torch-hero-r { right: calc(var(--wall-w) * .62); top: 34vh; }
.torch-wall-l { left: calc(var(--wall-w) * .62); top: 140px; }
.torch-wall-r { right: calc(var(--wall-w) * .62); top: 160px; }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 max(16px, calc(var(--wall-w) * .5)); padding-top: env(safe-area-inset-top);
  background: linear-gradient(to bottom, rgba(7,5,12,.92), rgba(7,5,12,.62));
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(138,63,252,.18);
  transition: background .3s;
}
.nav-logo img { height: 32px; width: auto; filter: drop-shadow(0 0 10px rgba(168,92,255,.45)); }
.nav-links { display: flex; gap: clamp(16px, 3vw, 36px); }
.nav-links a {
  font-family: var(--serif); font-weight: 700; font-size: 13px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--text); text-decoration: none; opacity: .82; position: relative; padding: 6px 0;
}
.nav-links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--purple-2); transform: scaleX(0); transition: transform .25s; box-shadow: 0 0 8px var(--purple-2); }
.nav-links a:hover { opacity: 1; }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.cart { position: relative; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--text); border: 1px solid var(--line); background: rgba(20,12,34,.6); }
.cart-count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--purple); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.burger { display: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: rgba(20,12,34,.6); padding: 10px 9px; cursor: pointer; }
.burger span { display: block; height: 2px; background: var(--text); border-radius: 2px; margin: 4px 0; transition: transform .25s, opacity .25s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.menu {
  position: fixed; inset: 0; z-index: 45; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  background: radial-gradient(ellipse at 50% 40%, rgba(40,18,70,.97), rgba(7,5,12,.98) 70%);
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.menu.open { opacity: 1; pointer-events: auto; }
.menu > a { font-family: var(--serif); font-weight: 700; font-size: 26px; letter-spacing: .06em; color: var(--text); text-decoration: none; }
.menu-social { display: flex; gap: 20px; margin-top: 18px; }
.menu-social a { color: var(--muted); font-size: 14px; }

/* ---------- layout ---------- */
main { position: relative; } /* no z-index: ledges (z1) go under the pillars (z3), torches (z5) above */
.section { position: relative; padding: 130px max(16px, calc(var(--wall-w) * 1.05)) 90px; }
.ledge { /* double-sided stone beam; its ends run under the pillars */
  position: absolute; left: 0; right: 0; top: -44px; height: 88px; z-index: 1; pointer-events: none;
  background-image: var(--ledge, none); background-repeat: repeat-x; background-size: auto 100%;
  filter: brightness(.3) saturate(.9); opacity: .95;
}
.section > *:not(.ledge):not(.torch) { position: relative; z-index: 2; }
.title {
  font-family: var(--deco); font-weight: 700; text-align: center; margin: 0 0 10px; letter-spacing: .02em;
  font-size: clamp(34px, 6vw, 64px); line-height: 1.05; color: #e6d4ff;
  text-shadow: 0 0 24px rgba(168,92,255,.55), 0 2px 0 #1b0f2e;
}
.title.left { text-align: left; }
.subtitle { text-align: center; color: var(--muted); max-width: 620px; margin: 0 auto 44px; font-size: clamp(15px, 2vw, 17px); }
.eyebrow { font-family: var(--serif); font-weight: 700; letter-spacing: .22em; text-transform: uppercase; font-size: 12px; color: var(--purple-2); margin: 0 0 8px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(28px, 5vw, 72px); align-items: center; max-width: 1100px; margin: 0 auto; }
.split.reverse { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.facts { list-style: none; padding: 0; margin: 18px 0 24px; }
.facts li { padding-left: 26px; position: relative; margin: 8px 0; color: #d9cfe9; }
.facts li::before { content: "✦"; position: absolute; left: 0; color: var(--purple-2); }
.muted { color: var(--muted); }

/* ---------- buttons ---------- */
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.cta-row.center { justify-content: center; margin-top: 30px; }
.art .subtitle { max-width: 720px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px;
  border-radius: 999px; font-family: var(--serif); font-weight: 700; font-size: 15px; letter-spacing: .06em;
  text-decoration: none; cursor: pointer; border: 0; transition: transform .15s, box-shadow .2s, filter .2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  color: #fff; background: linear-gradient(180deg, #a35bff, #6c22d8);
  box-shadow: 0 0 0 1px rgba(255,255,255,.12) inset, 0 8px 28px rgba(138,63,252,.45);
}
.btn-primary:hover { filter: brightness(1.12); box-shadow: 0 0 0 1px rgba(255,255,255,.2) inset, 0 10px 38px rgba(138,63,252,.7); }
.btn-ghost { color: var(--text); background: rgba(20,12,34,.55); border: 1px solid #5a3f8c; }
.btn-ghost:hover { border-color: var(--purple-2); box-shadow: 0 0 22px rgba(168,92,255,.3); }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100svh; padding: calc(var(--nav-h) + 10px) max(16px, calc(var(--wall-w) * 1.05)) 70px; display: flex; flex-direction: column; align-items: center; }
.hero-art { width: min(1180px, 100%, calc((100svh - 150px) * 1.3)); aspect-ratio: 2000 / 1363; position: relative;
  -webkit-mask-image: radial-gradient(ellipse 72% 70% at 50% 44%, #000 42%, transparent 74%);
          mask-image: radial-gradient(ellipse 72% 70% at 50% 44%, #000 42%, transparent 74%); }
.hero-art img { width: 100%; height: 100%; object-fit: cover; animation: kenburns 28s ease-in-out infinite alternate; transform-origin: 50% 40%; }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.07); } }
.hero-copy { position: relative; text-align: center; margin-top: clamp(-120px, -9vw, -40px); max-width: 720px; }
.quote { font-family: var(--serif); font-weight: 700; font-style: italic; font-size: clamp(20px, 3.2vw, 30px); line-height: 1.35; margin: 0 0 12px; color: #f1e6ff; text-shadow: 0 2px 12px #000, 0 0 30px rgba(168,92,255,.5); }
.lede { color: #cfc3e3; margin: 0 auto 24px; max-width: 520px; text-shadow: 0 2px 10px #000; }
.hero .cta-row { justify-content: center; }
.micro { font-size: 13px; color: var(--muted); margin: 12px 0 0; }
.scroll-cue { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); width: 26px; height: 42px; border: 2px solid rgba(181,124,255,.5); border-radius: 14px; }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--purple-2); animation: cue 1.8s infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- flip cards + holo ---------- */
.card-row { display: grid; grid-template-columns: repeat(3, minmax(0, 270px)); gap: clamp(16px, 3vw, 40px); justify-content: center; }
.flip { display: block; aspect-ratio: 1444 / 2000; perspective: 1400px; text-decoration: none; color: inherit;
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .25s ease-out; transform-style: preserve-3d; }
.flip-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .85s cubic-bezier(.2,.8,.2,1); }
.flip.flipped .flip-inner { transform: rotateY(180deg); }
@media (hover: hover) { .flip:hover .flip-inner { transform: rotateY(180deg); } }
.face { position: absolute; inset: 0; border-radius: var(--radius); overflow: hidden; -webkit-backface-visibility: hidden; backface-visibility: hidden;
  box-shadow: 0 18px 40px rgba(0,0,0,.6), 0 0 0 2px rgba(255,255,255,.06); }
.face img { width: 100%; height: 100%; object-fit: cover; }
.flip[data-back="gold"] .face { box-shadow: 0 18px 40px rgba(0,0,0,.6), 0 0 0 2px rgba(232,193,74,.35), 0 0 30px rgba(232,193,74,.15); }
.flip[data-back="purple"] .face { box-shadow: 0 18px 40px rgba(0,0,0,.6), 0 0 0 2px rgba(181,124,255,.35), 0 0 30px rgba(168,92,255,.18); }
.front { transform: rotateY(180deg); }
.face-label { position: absolute; left: 0; right: 0; bottom: 0; padding: 60px 18px 18px; background: linear-gradient(to top, rgba(7,5,12,.96) 30%, transparent); }
.face-label strong { display: block; font-family: var(--deco); font-weight: 700; font-size: 28px; line-height: 1.05; }
.quote, .offer-main, .modal-body h3, .lore h3, .pname { font-family: var(--deco) !important; font-style: normal !important; letter-spacing: .01em; }
.quote { font-size: clamp(26px, 4vw, 40px) !important; font-weight: 700; }
.pname { font-size: 20px !important; font-weight: 700; }
.face-label small { display: block; color: #cdbfe3; font-size: 13px; margin-top: 4px; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; background: var(--purple); color: #fff; margin-bottom: 8px; }
/* holographic foil + glare, driven by --mx / --my (pointer position 0..100%) */
.holo::before, .holo::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2; border-radius: inherit; opacity: 0; transition: opacity .3s; }
.holo::before {
  background: repeating-linear-gradient(115deg, rgba(255,0,170,.0) 0%, rgba(255,90,200,.35) 8%, rgba(90,200,255,.35) 16%, rgba(120,255,170,.3) 24%, rgba(255,230,110,.35) 32%, rgba(255,0,170,0) 40%);
  background-size: 260% 260%; background-position: var(--mx, 50%) var(--my, 50%);
  mix-blend-mode: color-dodge;
}
.holo::after { background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.55), transparent 45%); mix-blend-mode: overlay; }
.flip.active .holo::before { opacity: .55; }
.flip.active .holo::after { opacity: .8; }

/* ---------- comic ---------- */
.comic-cover { position: relative; max-width: 420px; justify-self: center; border-radius: 10px; overflow: hidden;
  box-shadow: 0 30px 70px rgba(0,0,0,.7), 0 0 60px rgba(168,92,255,.22);
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .25s ease-out; }
.comic-cover .glare { position: absolute; inset: 0; background: radial-gradient(circle at var(--mx, 30%) var(--my, 20%), rgba(255,255,255,.35), transparent 50%); mix-blend-mode: overlay; pointer-events: none; }
.comic-copy p { color: #d9cfe9; }
.next-issue { display: flex; gap: 16px; align-items: center; margin-top: 30px; padding: 14px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.next-issue img { width: 70px; border-radius: 6px; box-shadow: 0 6px 16px rgba(0,0,0,.5); }
.next-issue strong { display: block; font-family: var(--serif); }
.next-issue span { display: block; font-size: 14px; color: var(--muted); }
.next-issue a { font-weight: 600; font-size: 14px; text-decoration: none; }

/* ---------- playtest ---------- */
.banner { text-align: center; }
.fan { position: relative; height: clamp(300px, 40vw, 440px); }
.fan img { position: absolute; top: 50%; left: 50%; width: 62%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; box-shadow: 0 20px 50px rgba(0,0,0,.7); border: 2px solid rgba(181,124,255,.25); transition: transform .4s; }
.fan img:nth-child(1) { transform: translate(-90%, -50%) rotate(-12deg); }
.fan img:nth-child(2) { transform: translate(-10%, -50%) rotate(10deg); }
.fan img:nth-child(3) { transform: translate(-50%, -54%) rotate(0deg); z-index: 2; }
.fan:hover img:nth-child(1) { transform: translate(-100%, -50%) rotate(-16deg); }
.fan:hover img:nth-child(2) { transform: translate(0%, -50%) rotate(14deg); }
.offer { padding: 20px 22px; border-radius: var(--radius); background: linear-gradient(135deg, rgba(108,34,216,.35), rgba(20,12,34,.85)); border: 1px solid #6c3fb0; box-shadow: 0 0 40px rgba(138,63,252,.18); }
.offer-badge { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.offer-main { font-family: var(--serif); font-size: clamp(22px, 3vw, 28px); margin: 6px 0 2px; line-height: 1.2; }
.offer-main strong { color: var(--gold); text-shadow: 0 0 16px rgba(232,193,74,.45); }
.offer-sub { margin: 0; color: var(--muted); }
.note { font-size: 13px; color: var(--muted); border-left: 2px solid var(--line); padding-left: 12px; }
.review-link { display: inline-block; margin-top: 18px; font-weight: 600; text-decoration: none; color: var(--gold); }

/* ---------- shop ---------- */
.shelf { display: flex; gap: 22px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 10px 4px 26px; max-width: 1200px; margin: 0 auto; scrollbar-width: thin; scrollbar-color: #4b3474 transparent; }
.pcard { flex: 0 0 auto; width: clamp(220px, 62vw, 260px); scroll-snap-align: center; perspective: 1200px; }
.pcard .flip-inner { aspect-ratio: auto; height: auto; }
.pcard .pfront, .pcard .pback { border-radius: var(--radius); overflow: hidden; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.pcard .pback { position: absolute; inset: 0; }
.pcard .pback img { width: 100%; height: 100%; object-fit: cover; }
.pcard .pfront { transform: rotateY(180deg); background: var(--panel); border: 1px solid var(--line); box-shadow: 0 16px 36px rgba(0,0,0,.55); display: flex; flex-direction: column; }
.pcard.flipped .flip-inner { transform: rotateY(180deg); }
.pimg { position: relative; aspect-ratio: 1; background: #120b1e; overflow: hidden; }
.pimg img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.pcard:hover .pimg img { transform: scale(1.05); }
.badge { position: absolute; top: 10px; left: 10px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: var(--purple); color: #fff; }
.badge.gold { background: var(--gold); color: #1d1405; }
.pbody { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pname { font-family: var(--serif); font-weight: 700; font-size: 16px; line-height: 1.25; margin: 0; }
.pdesc { font-size: 13px; color: var(--muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.prow { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 8px; }
.price { font-family: var(--serif); font-weight: 700; font-size: 20px; color: var(--gold); }
.add { min-height: 40px; padding: 0 16px; font-size: 13px; }
.details { font-size: 13px; text-decoration: none; color: var(--muted); }
.coming { text-align: center; color: var(--muted); margin-top: 18px; }

/* ---------- map ---------- */
.mapwrap { position: relative; width: min(100%, 78vh, 900px); margin: 0 auto; }
.stage { position: relative; width: 100%; aspect-ratio: 1;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent), linear-gradient(to bottom, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent), linear-gradient(to bottom, transparent, #000 8%, #000 92%, transparent);
  mask-composite: intersect; }
.stage canvas { width: 100%; height: 100%; display: block; touch-action: manipulation; }
.stage canvas.hot { cursor: pointer; }
.map-clock { text-align: center; margin-top: 10px; font-family: var(--serif); font-size: 15px; }
.lore { position: absolute; z-index: 5; transform: translate(-50%, calc(-100% - 14px)); width: max-content; max-width: 240px; padding: 12px 14px; border-radius: 12px;
  background: rgba(20,12,34,.95); border: 1px solid #5b3d8f; box-shadow: 0 10px 30px rgba(0,0,0,.6), 0 0 22px rgba(166,107,255,.25);
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; }
.lore.show { opacity: 1; pointer-events: auto; transform: translate(-50%, calc(-100% - 8px)); }
.lore::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 12px; height: 12px; margin-left: -6px; background: inherit; border-right: 1px solid #5b3d8f; border-bottom: 1px solid #5b3d8f; transform: rotate(45deg); }
.lore h3 { margin: 0 0 2px; font-family: var(--serif); font-size: 16px; color: #dcc6ff; }
.lore p { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.lore a { display: inline-block; padding: 8px 14px; border-radius: 999px; background: var(--purple); color: #fff; font-weight: 600; font-size: 13px; text-decoration: none; }

/* ---------- art gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 260px; gap: 14px; max-width: 1100px; margin: 0 auto; }
.gallery figure { position: relative; margin: 0; border-radius: 12px; overflow: hidden; cursor: zoom-in; box-shadow: 0 14px 30px rgba(0,0,0,.5); }
.gallery .g-wide { grid-column: span 2; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s, filter .4s; filter: brightness(.85); }
.gallery figure:hover img { transform: scale(1.05); filter: brightness(1); }
.gallery figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 14px 10px; font-family: var(--serif); font-size: 13px; letter-spacing: .06em;
  background: linear-gradient(to top, rgba(7,5,12,.9), transparent); }
.gallery figcaption::before { content: "Art by "; color: var(--muted); }

/* ---------- community ---------- */
.join { text-align: center; max-width: 620px; margin: 0 auto; }
.sigil { width: 90px; margin: 0 auto 12px; filter: drop-shadow(0 0 18px rgba(168,92,255,.7)); animation: pulse 4s ease-in-out infinite; }
@keyframes pulse { 50% { filter: drop-shadow(0 0 30px rgba(168,92,255,1)); transform: scale(1.04); } }
.signup { display: flex; gap: 10px; max-width: 480px; margin: 0 auto; }
.signup input { flex: 1; min-width: 0; min-height: 48px; padding: 0 18px; border-radius: 999px; border: 1px solid #5a3f8c; background: rgba(12,7,22,.85); color: var(--text); font: inherit; font-size: 16px; outline: none; }
.signup input:focus { border-color: var(--purple-2); box-shadow: 0 0 0 3px rgba(168,92,255,.25); }
.form-msg { min-height: 22px; font-size: 14px; margin: 10px 0 0; }
.form-msg.err { color: #ff8a8a; }
.form-msg.ok { color: #b9f5c8; }
.socials { display: flex; gap: 14px; justify-content: center; margin-top: 18px; }
.socials a { padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 14px; }
.socials a:hover { border-color: var(--purple-2); }

/* ---------- footer ---------- */
.footer { position: relative; z-index: 4; text-align: center; padding: 50px 20px 110px; border-top: 1px solid rgba(138,63,252,.15); background: linear-gradient(to bottom, transparent, #040308); }
.footer-logo { width: 180px; margin: 0 auto 16px; opacity: .9; }
.footer nav { display: flex; gap: 20px; justify-content: center; margin-bottom: 14px; }
.footer nav a { color: var(--muted); text-decoration: none; font-family: var(--serif); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.credits, .copy { font-size: 12px; color: #7d7193; margin: 4px 0; }

/* ---------- sticky CTA (mobile) ---------- */
.sticky-cta { display: none; }
@media (max-width: 760px) {
  .sticky-cta { display: flex; position: fixed; z-index: 48; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
    min-height: 52px; align-items: center; justify-content: center; border-radius: 999px; text-decoration: none;
    font-family: var(--serif); font-weight: 700; letter-spacing: .06em; color: #fff;
    background: linear-gradient(180deg, #a35bff, #6c22d8); box-shadow: 0 10px 30px rgba(0,0,0,.6), 0 0 26px rgba(138,63,252,.5);
    transform: translateY(140%); transition: transform .35s; }
  .sticky-cta.show { transform: none; }
}

/* ---------- modal / lightbox / toast ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(4,2,8,.78); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.modal[hidden] { display: none; }
.modal-card { position: relative; display: grid; grid-template-columns: 200px 1fr; max-width: 640px; width: 100%; border-radius: 18px; overflow: hidden;
  background: #120a1f; border: 1px solid #5b3d8f; box-shadow: 0 30px 80px rgba(0,0,0,.8), 0 0 60px rgba(168,92,255,.25); animation: rise .35s ease-out; }
@keyframes rise { from { transform: translateY(20px) scale(.97); opacity: 0; } }
.modal-card-art { width: 100%; height: 100%; object-fit: cover; }
.modal-body { padding: 26px 24px 20px; }
.modal-body .eyebrow { padding-right: 34px; letter-spacing: .16em; }
.modal-body h3 { font-family: var(--serif); font-size: 24px; margin: 0 0 8px; line-height: 1.2; }
.modal-body p { color: #cfc3e3; font-size: 15px; margin: 0 0 16px; }
.modal-body .signup { flex-direction: column; }
.modal-x { position: absolute; top: 8px; right: 10px; z-index: 2; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(0,0,0,.4); color: var(--text); font-size: 22px; cursor: pointer; }
.link { background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; margin-top: 6px; text-decoration: underline; }
.lightbox { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 20px; background: rgba(4,2,8,.94); cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-height: 84vh; max-width: 100%; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.8); }
.lightbox p { font-family: var(--serif); color: var(--muted); margin: 0; }
.toast { position: fixed; left: 50%; bottom: 84px; z-index: 65; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; transition: .3s;
  padding: 12px 18px; border-radius: 999px; background: #1d1130; border: 1px solid #6c3fb0; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  .hero-art img, .sigil { animation: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .split, .split.reverse { grid-template-columns: 1fr; }
  .title.left { text-align: center; }
  .comic-copy .cta-row { justify-content: center; }
  .play-copy .cta-row { justify-content: center; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 200px; }
}
@media (max-width: 760px) {
  .nav-links { display: none; }
  .burger { display: block; }
  .nav-logo img { height: 26px; }
  .section { padding-top: 110px; padding-bottom: 70px; }
  .card-row { grid-template-columns: repeat(3, 72%); justify-content: start; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px 4px 22px; margin: 0 -16px; padding-inline: 16px; }
  .card-row .flip { scroll-snap-align: center; }
  .torch { --ts: .72; }
  .torch .t-light { width: 460px; height: 460px; }
  .torch-hero-l, .torch-hero-r { top: 26vh; }
  .hero { min-height: auto; padding-bottom: 60px; }
  .hero-art { width: 120%; max-width: none; margin: 0 -10%; }
  .scroll-cue { display: none; }
  .modal-card { grid-template-columns: 1fr; }
  .modal-card-art { height: 120px; object-position: center 45%; }
  .signup { flex-direction: column; }
  .gallery { grid-template-columns: 1fr 1fr; grid-auto-rows: 160px; gap: 10px; }
  .gallery .g-wide { grid-column: span 2; }
}
