/* AMCULT — The Order of the Eternal Refill */
:root{
  --s: 1;
  --gold: #e2b34a;
  --gold2: #f6d98a;
  --burg: #7d1620;
  --cream: #f3e6c8;
  --fell: 'IM Fell English SC', Georgia, serif;
  --limelight: 'Limelight', Georgia, serif;
  --digits: 'Cinzel', Georgia, serif;
  --mono: 'Courier Prime', 'Courier New', monospace;
}
*{ box-sizing: border-box; margin: 0; padding: 0; }
html, body{ width:100%; height:100%; overflow:hidden; background:#1a0d09; }
body{ font-family: var(--fell); color: var(--cream); -webkit-font-smoothing: antialiased; }

#world{
  position: fixed; left:50%; top:50%; width:1920px; height:1080px;
  transform: translate(-50%,-50%) scale(var(--s));
  transform-origin: 50% 50%;
}
#world > *{ position:absolute; }
.layer{ left:0; top:0; width:1920px; height:1080px; pointer-events:none; }

#plate{ left:-320px; top:-4px; width:2560px; height:1088px; pointer-events:none; user-select:none; }

/* ---------- z0 plate / z1 candles ---------- */
#candlelayer{ z-index:1; }
.candle{
  position:absolute; width:260px; height:260px; border-radius:50%;
  background: radial-gradient(circle, rgba(255,196,110,.55) 0%, rgba(255,170,70,.22) 42%, rgba(255,150,50,0) 70%);
  mix-blend-mode: screen; opacity:.9; pointer-events:none;
}

/* ---------- z2 screen ---------- */
#screen{ left:235px; top:129px; width:1451px; height:547px; z-index:2; overflow:hidden; }
#glow{
  position:absolute; inset:0; opacity:0; mix-blend-mode:screen; pointer-events:none;
  background: radial-gradient(ellipse at 50% 40%, rgba(255,251,235,.75), rgba(255,240,200,.25) 60%, rgba(255,240,200,0) 85%);
}
#inscription{
  position:absolute; left:0; right:0; top:9px; height:66px; line-height:66px; text-align:center;
  font-family: var(--fell); font-size:64px; letter-spacing:.04em; color:#6b1a1a;
  mix-blend-mode: multiply; opacity:.82; white-space:nowrap; pointer-events:none;
}
#verdict{
  position:absolute; left:0; right:0; top:9px; height:66px; line-height:66px; text-align:center;
  font-family: var(--fell); font-size:66px; letter-spacing:.04em; color:#1b0f08; white-space:nowrap;
  filter: blur(.6px); text-shadow: 0 0 18px rgba(255,248,220,.9);
  display:none; opacity:0; pointer-events:none;
}
#verdict.show{ display:block; }

/* film leader — projected frame, misaligned to the left (disc canvas x 350–770) */
#leader{ position:absolute; inset:0; overflow:hidden; }
#leaderTint{ position:absolute; inset:0; background:rgb(104,112,122); opacity:.45; mix-blend-mode:multiply; }
.lead-disc{
  position:absolute; left:115px; top:61px; width:420px; height:420px; border-radius:50%; overflow:hidden;
  background: radial-gradient(circle at 50% 45%, #dadcd9 0 60%, #c6c9c6 61% 100%);
  box-shadow: inset 0 0 0 2px rgba(62,56,48,.22);
}
.lead-disc .ch{ position:absolute; left:0; right:0; top:50%; height:2px; margin-top:-1px; background:rgba(62,56,48,.5); }
.lead-disc .cv{ position:absolute; top:0; bottom:0; left:50%; width:2px; margin-left:-1px; background:rgba(62,56,48,.5); }
.lead-disc .lead-wedge{
  position:absolute; inset:0; border-radius:50%;
  background: conic-gradient(rgba(70,60,50,.30) 0deg 88deg, rgba(70,60,50,0) 90deg 360deg);
  animation: wedgeRot 1.1s linear infinite;
}
@keyframes wedgeRot{ to{ transform: rotate(360deg); } }
#leader.freeze .lead-wedge{ animation-play-state: paused; }
.lead-disc .lead-num{
  position:absolute; inset:0; display:grid; place-items:center;
  font-family: var(--digits); font-weight:700; font-size:220px; line-height:1; color:#3a3733;
  text-shadow: 0 0 2px rgba(57,50,42,.35);
}
#burn{
  position:absolute; width:760px; height:760px; left:0; top:0; opacity:1; pointer-events:none;
  transform: scale(0); /* left/top set to (screen-relative burn point - 380) in JS */
  filter: url(#burnFilter);
  background: radial-gradient(circle,
    #0a0400 0 330px,
    #1a0a03 330px 348px,
    #3a1c08 348px 366px,
    #6e340c 366px 372px,
    #ff7a10 372px 384px,
    #ffe2ac 384px 391px,
    rgba(150,66,12,.38) 391px 432px,
    rgba(150,66,12,0) 452px);
}
#burn .bub{
  position:absolute; border-radius:50%; opacity:0; pointer-events:none;
  background: radial-gradient(circle, #ffe6b0 0 30%, #ff8a1a 58%, rgba(255,122,16,0) 100%);
}

/* ---------- z3 rays ---------- */
#rays{
  left:510.5px; top:-134px; width:900px; height:900px; z-index:3; opacity:0; mix-blend-mode:screen; pointer-events:none;
  background: repeating-conic-gradient(from 0deg, rgba(255,214,110,.55) 0deg 5deg, rgba(255,214,110,0) 5deg 15deg);
  -webkit-mask: radial-gradient(circle, #000 12%, transparent 62%);
  mask: radial-gradient(circle, #000 12%, transparent 62%);
}

/* ---------- z4 halo ---------- */
#halo{
  left:853px; top:208px; width:215px; height:216px; z-index:4; pointer-events:none; user-select:none;
  transform-origin: 50% 50%;
}

/* ---------- z5 contact shadow ---------- */
#footshadow{
  left:860px; top:718px; width:200px; height:24px; z-index:5; border-radius:50%; pointer-events:none;
  background: radial-gradient(ellipse, rgba(25,8,4,.55), rgba(25,8,4,0) 70%);
}

/* ---------- z6 character ---------- */
#char{ left:829px; top:228px; width:266px; height:507px; z-index:6; }
#charInner{ position:absolute; inset:0; transform-origin: 50% 100%; }
.frame{ position:absolute; left:0; top:0; width:266px; height:507px; opacity:0; pointer-events:none; user-select:none; }
.frame.on{ opacity:1; }
#halo, #char{ opacity:0; transition: opacity .6s ease; }
body.assets-ready #halo, body.assets-ready #char{ opacity:1; }

/* ---------- z7 beam ---------- */
#beam{ z-index:7; opacity:0; pointer-events:none; mix-blend-mode:screen; filter: blur(6px); }
#beamShape{
  position:absolute; inset:0;
  clip-path: polygon(880px -10px, 1040px -10px, 1686px 129px, 1686px 676px, 235px 676px, 235px 129px);
  background: linear-gradient(180deg, rgba(255,246,214,.55), rgba(255,240,200,.12) 60%, rgba(255,240,200,.05));
}

/* ---------- z8 crumbs ---------- */
#crumbs{ z-index:8; }
.crumb{ position:absolute; pointer-events:none; will-change: transform, opacity; }

/* ---------- z9 dust ---------- */
#dust{ z-index:9; pointer-events:none; }

/* ---------- z10 seat plate ---------- */
#seatplate{
  left:110px; top:890px; width:180px; height:30px; z-index:10; transform: rotate(-2deg);
  display:flex; align-items:center; justify-content:center; border-radius:4px;
  background: linear-gradient(180deg, #e6c372, #b8873a 55%, #8d6226);
  box-shadow: inset 0 1px 0 rgba(255,243,196,.8), 0 2px 5px rgba(0,0,0,.5);
  font-family: var(--fell); font-size:14px; letter-spacing:.06em; color:#2a1607; white-space:nowrap; overflow:hidden;
}
#seatplate[hidden]{ display:none; }

/* ---------- z20 plaque ---------- */
#plaque{
  left:640px; top:781px; width:640px; height:46px; z-index:20; pointer-events:none;
  display:flex; align-items:center; justify-content:center; gap:16px; border-radius:6px;
  background: linear-gradient(180deg, #e6c372, #b8873a 55%, #8d6226);
  box-shadow: inset 0 1px 0 #fff3c4, 0 3px 6px rgba(0,0,0,.55);
}
#plaque .plbl{ font-family: var(--fell); font-size:21px; letter-spacing:.05em; color:#2a1607; white-space:pre; }
#plaque .plaque-dot{ width:6px; height:6px; border-radius:50%; background:#6d4a1c; }
#prayers{
  font-family: var(--digits); font-weight:700; font-size:22px; color:#3a1d08; display:inline-block;
  min-width:18px; text-align:center; transform-origin:50% 60%;
}
#plaque .odo{ display:inline-block; width:16px; height:28px; overflow:hidden; }
#plaque .odostrip{ display:block; will-change: transform; }
#plaque .odostrip b{ display:block; height:28px; line-height:30px; font-family: var(--digits); font-weight:700; font-size:22px; color:#3a1d08; text-align:center; }

/* ---------- z21 CTA + seat button ---------- */
#cta{
  position:absolute; left:50%; top:890px; width:400px; height:76px; z-index:21; cursor:pointer;
  transform: translateX(-50%);
  border-radius:14px; border:3px solid var(--gold);
  background: linear-gradient(180deg, #7d1620, #4d0a10);
  color: var(--gold2); font-family: var(--limelight); font-size:30px; letter-spacing:.06em;
  box-shadow: 0 0 0 6px rgba(20,6,4,.55), 0 10px 26px rgba(0,0,0,.6), inset 0 0 18px rgba(0,0,0,.5);
  transition: filter .15s ease, transform .1s ease, color .15s ease;
}
#cta::before, #cta::after{
  content:''; position:absolute; left:12px; right:12px; height:6px; pointer-events:none;
  background-image: radial-gradient(circle at 3px 3px, #ffe9a8 0 2.6px, rgba(255,233,168,0) 3.2px);
  background-size:21px 6px; background-repeat:repeat-x;
}
#cta::before{ top:4px; }
#cta::after{ bottom:4px; background-position-x:10px; }
#cta:hover{ filter: brightness(1.12); transform: translateX(-50%) translateY(-1px); }
#cta:active{ transform: translateX(-50%) translateY(1px); }
#cta:focus-visible{ outline:2px solid var(--gold); outline-offset:3px; }
#cta:hover::before, #cta:hover::after{ animation: bulbchase .9s linear infinite; }
@keyframes bulbchase{ to{ background-position-x: 21px; } }
#cta::after{ animation-delay: -.45s; }
#cta:disabled, #cta.busy{ opacity:.78; color:#c9a868; cursor:default; filter:none; transform: translateX(-50%); }
#cta:disabled::before, #cta:disabled::after, #cta.busy::before, #cta.busy::after{ animation:none; opacity:.5; }
#cta:disabled:hover, #cta.busy:hover{ filter:none; transform: translateX(-50%); }
@keyframes ctaPulse{ 0%,100%{ transform: translateX(-50%) scale(1); } 50%{ transform: translateX(-50%) scale(1.035); filter:brightness(1.1); } }
#cta.pulse{ animation: ctaPulse .9s ease; }

#seat{
  position:absolute; left:50%; top:984px; height:36px; z-index:21; cursor:pointer;
  transform: translateX(-50%);
  background:none; border:0; font-family: var(--fell); font-size:22px; letter-spacing:.06em; color:var(--cream);
  text-shadow: 0 2px 6px #000; display:flex; align-items:center; gap:8px;
}
#seat span{ border-bottom:1px solid rgba(226,179,74,.7); padding-bottom:2px; }
#seat .seat-icon{ flex:0 0 auto; }
#seat:hover{ color:var(--gold2); transform: translateX(-50%) translateY(-1px); }
#seat:active{ transform: translateX(-50%) translateY(1px); }
#seat:focus-visible{ outline:2px solid var(--gold); outline-offset:3px; }

/* ---------- header / footer (viewport-anchored) ---------- */
header{
  position:fixed; left:0; right:0; top:0; height:calc(72px * var(--s)); z-index:30; pointer-events:none;
  padding:0 calc(32px * var(--s)); display:flex; align-items:center; justify-content:space-between;
  background: linear-gradient(180deg, rgba(12,5,3,.85), rgba(12,5,3,0));
}
header .brand{ display:flex; align-items:baseline; gap:calc(14px * var(--s)); }
header .brand b{ font-family:var(--limelight); font-weight:400; font-size:calc(36px * var(--s)); letter-spacing:.04em; color:var(--gold); text-shadow: 0 2px 0 #3a1406, 0 0 14px rgba(226,179,74,.35); }
header .brand .tag{ font-family:var(--fell); font-size:calc(17px * var(--s)); color:var(--cream); opacity:.85; }
header nav{ display:flex; align-items:center; gap:calc(12px * var(--s)); pointer-events:auto; }
.chip{
  position:relative; display:inline-flex; align-items:center;
  padding: calc(7px * var(--s)) calc(14px * var(--s)); border-radius:999px; white-space:nowrap;
  font-family:var(--fell); font-size:calc(16px * var(--s)); color:var(--cream);
  background: rgba(60,12,14,.75); border:1px solid rgba(226,179,74,.45);
}
button.chip{ cursor:pointer; }
button.chip:hover, .buy:hover{ border-color:var(--gold); color:var(--gold2); transform: translateY(-1px); }
button.chip:active, .buy:active{ transform: translateY(1px); }
button.chip:focus-visible, .buy:focus-visible, .iconbtn:focus-visible{ outline:2px solid var(--gold); outline-offset:2px; }
.chip.ca{ font-family:var(--mono); font-weight:700; font-size:calc(14px * var(--s)); cursor:default; }
.chip.ca.live{ cursor:pointer; }
.chip.ca.copied{ color:var(--gold2); border-color:var(--gold); }
.tip{
  position:absolute; top:calc(100% + 8px); left:50%; transform:translateX(-50%);
  background:var(--cream); color:#2a1607; font-family:var(--fell); font-size:calc(13px * var(--s));
  padding: calc(5px * var(--s)) calc(11px * var(--s)); border-radius:6px; white-space:nowrap;
  opacity:0; pointer-events:none; transition:opacity .15s ease; box-shadow:0 4px 12px rgba(0,0,0,.55); z-index:31;
}
#ca:hover .tip, #ca:focus-visible .tip, #buy:hover .tip, #buy:focus-visible .tip{ opacity:1; }
.iconbtn{
  width:calc(38px * var(--s)); height:calc(38px * var(--s)); border-radius:50%; display:grid; place-items:center;
  background: rgba(60,12,14,.75); border:1px solid rgba(226,179,74,.45); color:var(--cream); cursor:pointer;
  transition: transform .1s ease, color .15s ease, border-color .15s ease;
}
.iconbtn:hover{ color:var(--gold2); border-color:var(--gold); transform:translateY(-1px); }
.iconbtn:active{ transform:translateY(1px); }
#sound .snd-off{ display:none; }
#sound.muted .snd-off{ display:block; }
#sound.muted .snd-on{ display:none; }
.buy{
  position:relative; display:inline-flex; align-items:center; cursor:pointer; text-decoration:none;
  padding: calc(8px * var(--s)) calc(18px * var(--s)); border-radius:10px;
  font-family:var(--limelight); font-size:calc(17px * var(--s)); letter-spacing:.05em;
  color:#2a1607; background: linear-gradient(180deg, var(--gold2), var(--gold));
  transition: filter .15s ease;
}
.buy.off{ background: rgba(60,12,14,.75); color:#b99a62; border:1px dashed rgba(226,179,74,.55); }
.buy.off:hover{ color:var(--gold2); }
.buy:not(.off):hover{ filter:brightness(1.1); }
footer{
  position:fixed; left:0; right:0; bottom:0; height:calc(34px * var(--s)); z-index:30; pointer-events:none;
  padding:0 calc(32px * var(--s)); display:flex; align-items:center; justify-content:space-between;
  color:rgba(243,230,200,.7); font-family:var(--fell); font-size:calc(14px * var(--s));
  background: linear-gradient(0deg, rgba(12,5,3,.8), rgba(12,5,3,0));
}

/* ---------- modal ---------- */
#modal{ position:fixed; inset:0; z-index:40; display:grid; place-items:center; }
#modal[hidden]{ display:none; }
#modal .backdrop{ position:absolute; inset:0; background:rgba(10,3,2,.82); backdrop-filter: blur(6px); }
#modal .card{
  position:relative; width:640px; max-width:92vw; border-radius:18px; padding:26px 26px 22px;
  background: linear-gradient(160deg, #4a0c12, #2c070b 70%);
  border:1px solid rgba(226,179,74,.5); box-shadow: 0 24px 70px rgba(0,0,0,.7), inset 0 1px 0 rgba(226,179,74,.25);
}
#modal h2{ font-family:var(--limelight); font-weight:400; font-size:30px; letter-spacing:.05em; color:var(--gold); text-align:center; margin-bottom:16px; }
.modal-close{
  position:absolute; right:12px; top:8px; width:34px; height:34px; border-radius:50%; cursor:pointer;
  background:rgba(60,12,14,.7); border:1px solid rgba(226,179,74,.4); color:var(--cream); font-size:20px; line-height:1;
}
.modal-close:hover{ color:var(--gold2); border-color:var(--gold); }
.modal-close:focus-visible{ outline:2px solid var(--gold); outline-offset:2px; }
.ticketwrap{ position:relative; width:100%; }
#preview{ display:block; width:100%; height:auto; border-radius:6px; }
.field{ display:block; margin-top:16px; }
.field span{ display:block; font-family:var(--fell); font-size:15px; letter-spacing:.08em; color:rgba(243,230,200,.8); margin-bottom:6px; }
.field input{
  width:100%; padding:10px 14px; border-radius:8px; font-family:var(--mono); font-weight:700; font-size:20px;
  letter-spacing:.08em; text-transform:uppercase; color:var(--cream);
  background:rgba(20,6,4,.7); border:1px solid rgba(226,179,74,.45); outline:none;
}
.field input:focus{ border-color:var(--gold); box-shadow:0 0 0 2px rgba(226,179,74,.25); }
.field input::placeholder{ color:rgba(243,230,200,.35); font-size:15px; letter-spacing:.04em; }
.actions{ display:flex; gap:12px; justify-content:center; margin-top:18px; flex-wrap:wrap; }
.actions button, .actions a{
  display:inline-flex; align-items:center; justify-content:center; cursor:pointer; text-decoration:none;
  padding:11px 20px; border-radius:10px; font-family:var(--limelight); font-size:17px; letter-spacing:.05em;
  color:#2a1607; background:linear-gradient(180deg, var(--gold2), var(--gold)); border:0;
  transition: filter .15s ease, transform .1s ease;
}
.actions button:hover, .actions a:hover{ filter:brightness(1.1); transform:translateY(-1px); }
.actions button:active, .actions a:active{ transform:translateY(1px); }
.actions button:focus-visible, .actions a:focus-visible{ outline:2px solid var(--gold); outline-offset:2px; }
.actions button[hidden], .actions a[hidden]{ display:none; }
#issue:disabled{ opacity:.55; color:#8a6f43; cursor:default; filter:none; transform:none; }
#postx{ color:var(--cream); background:rgba(60,12,14,.75); border:1px solid rgba(226,179,74,.5); }
#postx:hover{ color:var(--gold2); }
