/* Resistance Night · home. Layout: one outdoor stage, one playable table, the cast, the closing table. */

.band { padding: clamp(60px, 9vw, 130px) var(--gut); background: var(--night); }
.band-navy { background: var(--navy); }
.wrap { max-width: var(--wrap); margin: 0 auto; }
.sec-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 44px; }
.sec-head.row { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 22px; }
.sec-head.row > div:not(.seg) { display: flex; flex-direction: column; gap: 12px; }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes popin { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: scale(1); } }
.rise { animation: rise .55s var(--enter) both; animation-delay: var(--d, 0s); }
.js .reveal:not(.in) { opacity: 0; }
.reveal.in { animation: rise .55s var(--enter) both; animation-delay: var(--d, 0s); }

/* ---------- the hood: the cast ---------- */
.hood { --rim: var(--goldbright); --cloak: #101638; display: block; width: 100%; height: auto; overflow: visible; }
.hood.traitor { --rim: var(--ruby); --cloak: #12122e; }
.h-cloak { fill: var(--cloak); transition: fill .55s var(--enter); }
.h-rim { fill: var(--rim); opacity: .34; transition: fill .55s var(--enter), opacity .55s var(--enter); }
.lit .h-rim { opacity: .84; }
.h-acc, .h-clasp { fill: var(--rim); transition: fill .55s var(--enter); }
.h-clasp { opacity: .55; }
.lit .h-clasp { opacity: .9; }
.h-eye { fill: var(--ruby); }
.h-glow { fill: var(--ruby); opacity: .28; }
.f-sigil, .f-eyes { opacity: 0; transition: opacity .55s var(--enter); }
.show-sigil .f-sigil, .show-eyes .f-eyes { opacity: 1; }
.show-eyes.hot .h-glow { animation: ember 1.8s var(--draw) infinite alternate; }
@keyframes ember { from { opacity: .18; } to { opacity: .5; } }

/* ---------- hero ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; background: #0a0d24;
  min-height: clamp(700px, 100svh, 960px); display: flex; flex-direction: column; }
.hero-sky { position: absolute; inset: 0; z-index: 0; }
.hero-sky svg { width: 100%; height: 100%; display: block; }
.layer { transform: translate(calc(var(--px, 0) * var(--depth) * 1px), calc(var(--py, 0) * var(--depth) * 1px)); transition: transform .55s var(--enter); }
.star { animation: tw var(--td, 2.4s) var(--draw) infinite alternate; animation-delay: var(--tdl, 0s); }
@keyframes tw { from { opacity: .22; } to { opacity: .95; } }
.win { animation: winf 3.1s var(--draw) infinite alternate; animation-delay: var(--tdl, 0s); }
@keyframes winf { from { opacity: .62; } to { opacity: 1; } }
.flag-cloth { transform-box: fill-box; transform-origin: 0 50%; animation: wave 2.6s var(--draw) infinite alternate; }
@keyframes wave { from { transform: skewY(-4deg) scaleX(1); } to { transform: skewY(5deg) scaleX(.94); } }
.castle-rise { animation: castle .9s var(--draw) both .1s; }
@keyframes castle { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }

.hero-copy { position: relative; z-index: 10; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: clamp(120px, 17vh, 170px) var(--gut) 0; }
.hero-copy .lead { max-width: 30ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; margin-top: 8px; }
.hero-copy .label { color: var(--inkdim); }

.accuse { position: relative; z-index: 5; margin-top: auto; padding-top: 30px; }
.cast { --u: clamp(84px, 15.5vw, 176px); display: flex; justify-content: center; align-items: flex-end; gap: clamp(0px, .8vw, 12px); padding: 0 8px; }
.hood-btn { width: calc(var(--u) * var(--k)); flex: none; background: none; border: 0; padding: 0; cursor: pointer; margin-bottom: -6px;
  animation: castin .55s var(--enter) both; animation-delay: var(--ed); transition: transform .5s var(--pop); }
@keyframes castin { from { opacity: 0; transform: translateY(46px); } to { opacity: 1; transform: none; } }
.hood-btn .breath { display: block; animation: breath 4.2s var(--draw) infinite alternate; animation-delay: var(--bd); }
@keyframes breath { from { transform: translateY(0); } to { transform: translateY(-4px); } }
.hood-btn.picked { transform: translateY(-10px); }
.hood-btn[disabled] { cursor: default; }
.accuse-bar { position: relative; z-index: 10; background: var(--pine); border-top: 1.5px solid var(--line); min-height: 60px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 22px; padding: 14px var(--gut); }
.accuse-msg { font: 700 13px/1.4 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); text-align: center; }
.accuse-msg.swap { animation: rise .55s var(--enter) both; }

.flash { position: absolute; inset: 0; z-index: 7; background: var(--ruby); mix-blend-mode: screen; opacity: 0; pointer-events: none; }
.flash.go { animation: flash .5s var(--draw); }
@keyframes flash { 0% { opacity: 0; } 30% { opacity: .55; } 100% { opacity: 0; } }

/* ---------- the round ---------- */
.round { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(30px, 5vw, 60px); align-items: start; }
.steps { list-style: none; display: flex; flex-direction: column; }
.steps li { display: flex; gap: 16px; padding: 16px 0; border-top: 1.5px solid var(--line); opacity: .42; transition: opacity .55s var(--enter); }
.steps li:last-child { border-bottom: 1.5px solid var(--line); }
.steps li.done { opacity: .7; }
.steps li.on { opacity: 1; }
.steps .num { width: 38px; height: 38px; flex: none; border-radius: 999px; border: 1.5px solid var(--line2); color: var(--goldlite);
  display: grid; place-items: center; font: 400 24px/1 var(--serif); padding-bottom: 2px; }
.steps li.on .num { background: var(--goldbright); border-color: var(--goldbright); color: var(--navy); box-shadow: 2px 3px 0 var(--golddeep); animation: popin .5s var(--pop) both; }
.steps h3 { font: 400 28px/1.35 var(--serif); color: var(--ink); }
.steps p { display: none; font-size: 16px; color: var(--inkdim); max-width: 40ch; margin-top: 4px; }
.steps li.on p { display: block; animation: rise .55s var(--enter) both; }

.stage-wrap { position: relative; aspect-ratio: 620 / 560; overflow: hidden; background: #0e1232; }
.stage { position: absolute; left: 0; top: 0; width: 620px; height: 560px; transform-origin: 0 0; transform: scale(var(--k, 1)); }
.stage .glow { position: absolute; left: 60px; right: 60px; top: 300px; height: 240px; border-radius: 999px; background: radial-gradient(closest-side, rgba(242, 208, 138, .16), rgba(242, 208, 138, 0)); }
.cap { position: absolute; left: 20px; right: 20px; top: 22px; z-index: 12; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 7px; }
.cap .kicker { font-size: 11px; }
.cap-line { font: 400 40px/1 var(--serif); color: var(--ink); }
.cap-sub { font: 500 14.5px/1.35 var(--sans); color: var(--inkdim); max-width: 46ch; min-height: 20px; }
.cap.swap > * { animation: rise .55s var(--enter) both; }
.cap.swap > :nth-child(2) { animation-delay: .12s; }
.cap.swap > :nth-child(3) { animation-delay: .24s; }

.seat { position: absolute; z-index: 2; background: none; border: 0; padding: 0; cursor: default; transition: transform .5s var(--pop); }
.seat.pickable { cursor: pointer; }
.seat.picked { transform: translateY(-12px); }
.seat .name { position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); margin-bottom: 7px; padding: 4px 7px; white-space: nowrap;
  display: flex; align-items: center; gap: 5px; font: 700 10px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  transition: background .55s var(--enter), color .55s var(--enter); }
.seat .name svg { width: 13px; height: 13px; }
.seat.you .name { color: var(--goldlite); }
.seat.picked .name { background: var(--goldbright); color: var(--navy); }
.table-art { position: absolute; left: 0; top: 0; width: 620px; height: 560px; z-index: 3; pointer-events: none; }
.flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flick .9s var(--draw) infinite alternate; animation-delay: var(--tdl, 0s); }
@keyframes flick { from { transform: scale(1) translateX(-.6px); } to { transform: scale(1.1) translateX(.6px); } }
.halo { animation: halo 1.4s var(--draw) infinite alternate; }
@keyframes halo { from { opacity: .07; } to { opacity: .15; } }

.tok { position: absolute; z-index: 5; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 999px; background: #111737; border: 2px solid var(--c); color: var(--c);
  display: grid; place-items: center; animation: popin .5s var(--pop) both; animation-delay: var(--dl, 0s); }
.tok svg { width: 18px; height: 18px; }
.tok.pass { --c: var(--emerald); } .tok.fail { --c: var(--ruby); }
.tok.leave, .card.leave, .track.leave { transition: opacity .55s var(--enter); opacity: 0; }

.card { position: absolute; z-index: 6; width: 52px; height: 72px; margin: -36px 0 0 -26px; transform-style: preserve-3d;
  transition: transform .9s var(--draw), left .55s var(--enter), top .55s var(--enter), opacity .55s var(--enter); transition-delay: var(--dl, 0s); }
.card.flip { transform: rotateY(180deg); }
.cf { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 2px; border: 1.5px solid var(--line2); background: var(--navy);
  display: grid; place-items: center; box-shadow: 2px 3px 0 rgba(6, 9, 26, .6); color: rgba(224, 169, 78, .5); }
.cf svg { width: 24px; height: 24px; }
.cf.front { transform: rotateY(180deg); background: var(--paper); border-color: var(--c); color: var(--c); }
.cf.front.pass { --c: var(--emerald); } .cf.front.fail { --c: var(--ruby); }
.card.in { animation: rise .55s var(--enter) both; animation-delay: var(--dl, 0s); }

.rolecard { position: absolute; z-index: 14; left: 215px; top: 150px; width: 190px; padding: 26px 14px 20px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px; background: var(--paper); border: 1.5px solid rgba(224, 169, 78, .55); border-radius: 2px;
  box-shadow: 5px 6px 0 rgba(6, 9, 26, .6); animation: popin .5s var(--pop) both; }
.rolecard .ring { width: 84px; height: 84px; border-radius: 999px; border: 1.5px solid rgba(224, 169, 78, .4); background: #111737; display: grid; place-items: center; color: var(--goldbright); }
.rolecard .ring svg { width: 44px; height: 44px; }
.rolecard b { font: 400 32px/1 var(--serif); color: var(--goldbright); }
.rolecard span { font: 500 12.5px/1.35 var(--sans); color: var(--muted); }
.rolecard.out { transition: transform .55s var(--enter), opacity .55s var(--enter); opacity: 0; transform: translateY(30px) scale(.8); }

.track { position: absolute; z-index: 6; left: 0; right: 0; top: 452px; display: flex; justify-content: center; gap: 10px; }
.track i { width: 32px; height: 32px; border-radius: 999px; border: 1.5px solid var(--line2); background: #111737; display: grid; place-items: center; color: var(--c);
  animation: popin .5s var(--pop) both; animation-delay: var(--dl, 0s); }
.track i svg { width: 16px; height: 16px; }
.track i.pass { --c: var(--emerald); border-color: var(--emerald); } .track i.fail { --c: var(--ruby); border-color: var(--ruby); }
.target { position: absolute; z-index: 7; width: 160px; height: 160px; margin: -80px 0 0 -80px; border: 2px dashed var(--ruby); border-radius: 999px; pointer-events: none;
  animation: lock .9s var(--draw) both .5s; }
@keyframes lock { from { opacity: 0; transform: scale(1.5) rotate(-70deg); } to { opacity: 1; transform: none; } }


/* ---------- the cast ---------- */
.seg { display: inline-flex; border: 1.5px solid var(--line2); }
.seg button { background: transparent; border: 0; border-right: 1.5px solid var(--line2); padding: 11px 18px; cursor: pointer;
  font: 700 14px/1 var(--ui); letter-spacing: .05em; text-transform: lowercase; color: var(--inkdim); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--ink); color: var(--navy); }
.seg button:active { transform: scale(.97); }
.roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 22px; }
.role { --c: var(--goldbright); position: relative; height: 262px; perspective: 900px; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; color: inherit; font: inherit;
  animation: rise .55s var(--enter) both; animation-delay: var(--d, 0s); }
.role[data-side="traitor"] { --c: var(--ruby); }
.role[hidden] { display: none; }
.role-in { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .9s var(--draw); }
.role.flipped .role-in { transform: rotateY(180deg); }
.rf { position: absolute; inset: 0 6px 6px 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; padding: 22px; display: flex; flex-direction: column; gap: 10px;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 2px; box-shadow: 5px 6px 0 rgba(6, 9, 26, .6); }
.rf.back { transform: rotateY(180deg); background: var(--navy2); border-color: var(--c); justify-content: center; }
.rf .ring { width: 58px; height: 58px; border-radius: 999px; border: 1.5px solid var(--c); background: #111737; display: grid; place-items: center; color: var(--c); margin-bottom: 6px; }
.rf .ring svg { width: 28px; height: 28px; }
.rf .side { font: 700 11px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--c); }
.rf h3 { font: 400 32px/1 var(--serif); color: var(--ink); }
.rf p { font: 500 15px/1.45 var(--sans); color: var(--inkdim); }
.rf.back .tip { font: italic 400 26px/1.1 var(--serif); color: var(--ink); text-wrap: balance; }

/* ---------- why ---------- */
.why { display: grid; grid-template-columns: repeat(auto-fit, minmax(236px, 1fr)); gap: 22px; }
.why article { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.why .ico { width: 30px; height: 30px; color: var(--goldbright); }
.why h3 { font: 400 28px/1.05 var(--serif); color: var(--ink); text-wrap: balance; }
.why p { font-size: 16px; color: var(--inkdim); }

/* ---------- finale: the candlelit table ---------- */
.finale { position: relative; isolation: isolate; overflow: hidden; background: #0c0e28; text-align: center; padding: clamp(60px, 9vw, 110px) 0 60px; }
.finale-copy { position: relative; z-index: 10; display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 0 var(--gut); }
.finale-hint { font: 700 13px/1.4 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--inkdim); }
.finale-hint.swap { animation: rise .55s var(--enter) both; }
.finale-scene { position: relative; z-index: 3; max-width: 1080px; margin: 10px auto 0; }
.finale-scene svg { width: 100%; height: auto; display: block; overflow: visible; }
.finale-scene .candle { cursor: pointer; outline-offset: 6px; }
.finale-scene .candle .flame-g, .finale-scene .candle .halo-g { transition: opacity .55s var(--enter); }
.finale-scene .candle.out .flame-g, .finale-scene .candle.out .halo-g { opacity: 0; }
.finale-scene .dark { transition: opacity .9s var(--draw); pointer-events: none; }
.finale-scene .warm { transition: opacity .9s var(--draw); }
.finale-cta { position: relative; z-index: 10; display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; padding: 30px var(--gut) 0; }

/* ---------- scroll-driven round ---------- */
.scrolly { position: relative; background: var(--navy); height: calc(5 * 85vh + 100vh); }
.pin { position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; align-items: center; padding: 0 var(--gut); overflow: hidden; }
.pin .round { width: 100%; align-items: center; }
.story-col, .story-head { display: flex; flex-direction: column; gap: 12px; }
.story-col .steps { margin-top: 14px; }
.pin .steps li { padding: 12px 0; }
.pin .stage-wrap { width: min(100%, calc((100svh - 150px) * 620 / 560)); margin: 0 auto; }
.dots { display: flex; gap: 6px; width: min(100%, calc((100svh - 150px) * 620 / 560)); margin: 22px auto 0; }
.dots i { flex: 1; height: 3px; background: var(--line); transition: background .55s var(--enter); }
.dots i.on { background: var(--goldbright); }

/* ---------- try a role ---------- */
.plays { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; margin-bottom: 60px; }
.play { --c: var(--goldbright); display: flex; flex-direction: column; overflow: hidden; }
.play-art { position: relative; aspect-ratio: 360 / 240; background: #0e1232; border-bottom: 1.5px solid var(--line); overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.play-art svg { display: block; width: 100%; height: 100%; }
.play-copy { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 8px; }
.play .side { font: 700 11px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--c); }
.play h3 { font: 400 30px/1.05 var(--serif); color: var(--ink); }
.play-msg { font: 500 15px/1.45 var(--sans); color: var(--inkdim); min-height: 44px; }
.play-msg.swap { animation: rise .55s var(--enter) both; }
#p-merlin .play-art { cursor: crosshair; }
.target-hood, .claim { cursor: pointer; }
.tell .h-rim { animation: tell 1.8s var(--draw) infinite alternate; }
@keyframes tell { from { opacity: .34; } to { opacity: .62; } }
#dagger { cursor: grab; touch-action: none; }
.claim-t { font: 700 11px var(--sans); letter-spacing: .1em; text-transform: uppercase; fill: var(--inkdim); animation: rise .55s var(--enter) both; }
.claim:focus-visible { outline: none; } .claim:focus-visible .h-rim { opacity: .84; }

@media (max-width: 900px) {
  .pin { align-items: flex-start; padding-top: 70px; }
  .pin .round { gap: 16px; }
  .story-col { display: contents; }
  .story-head { order: 1; gap: 8px; } .story-head .lead { display: none; } .story-head .display-2 { font-size: 30px; }
  .pin .table-col { order: 2; }
  .pin .steps { order: 3; margin-top: 0; }
  .pin .steps li { display: none; border: 0; padding: 0; } .pin .steps li.on { display: flex; }
  .pin .stage-wrap, .dots { width: min(100%, calc((100svh - 350px) * 620 / 560)); }
  .dots { margin-top: 14px; }
}
@media (max-width: 900px) {
  .round { grid-template-columns: 1fr; }
  .table-col { order: -1; }
  .steps h3 { font-size: 24px; }
}
@media (max-width: 520px) {
  .hero-cta { flex-direction: column; width: 100%; max-width: 340px; }
  .accuse-msg { font-size: 11.5px; }
  .seg { width: 100%; } .seg button { flex: 1; }
  .roles { grid-template-columns: 1fr 1fr; gap: 12px; }
  .role { height: 290px; }
  .rf { padding: 16px 14px; inset: 0 5px 6px 0; }
  .rf h3 { font-size: 26px; } .rf p { font-size: 14px; } .rf.back .tip { font-size: 21px; }
  .rf .ring { width: 46px; height: 46px; } .rf .ring svg { width: 22px; height: 22px; }
}

/* role cards open the reveal instead of flipping */
.roles .role { height: auto; perspective: none; display: flex; }
.roles .rf { position: relative; inset: auto; flex: 1; margin: 0 6px 6px 0; }
.rf .mini { width: 96px; margin-bottom: 4px; }
.rf .more { margin-top: auto; padding-top: 8px; font: 700 11px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--c); }
