/* The big screen. Built to run full-bleed on a TV or projector all night. */

.reel-body {
  overflow: hidden;
  height: 100dvh;
  background: var(--bg-2);
  cursor: none; /* no mouse pointer floating on the party screen */
}

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(130% 100% at 50% 0%, color-mix(in srgb, var(--purple) 22%, transparent), transparent 60%),
    var(--bg-2);
}

/* Soft aurora of the party colors behind letterboxed photos */
.aurora { position: absolute; inset: -10%; filter: blur(60px); opacity: 0.55; }
.blob { position: absolute; width: 46vw; height: 46vw; border-radius: 50%; mix-blend-mode: screen; }
.blob.b1 { background: var(--purple); top: -8%; left: -6%; animation: drift1 22s ease-in-out infinite; }
.blob.b2 { background: var(--pink);   bottom: -12%; right: -6%; animation: drift2 26s ease-in-out infinite; }
.blob.b3 { background: var(--gold);   top: 30%; left: 45%; opacity: 0.5; animation: drift3 30s ease-in-out infinite; }
@keyframes drift1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(6vw,4vh) scale(1.15); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0) scale(1.1); } 50% { transform: translate(-5vw,-3vh) scale(1); } }
@keyframes drift3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-4vw,3vh) scale(1.2); } }

/* Photo layers - two stacked for cross-fade */
.layer {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;   /* never crop a memory */
  opacity: 0;
  transition: opacity 1100ms ease;
  will-change: opacity, transform;
}
.layer.show { opacity: 1; }

/* Ken Burns lives on a modifier so crossfade-only mode can skip it.
   Direction is randomized via --kb-x / --kb-y so the camera doesn't always drift the same way. */
.layer.kb-in { animation: kenburns var(--kb-dur, 7s) ease-out forwards; }
@keyframes kenburns {
  from { transform: scale(1.02) translate(0, 0); }
  to   { transform: scale(1.12) translate(var(--kb-x, -1.5%), var(--kb-y, -1%)); }
}

/* Slide mode - direction via --slide-from */
.layer.slide-in  { animation: slideIn 900ms cubic-bezier(0.16,1,0.3,1) forwards; }
@keyframes slideIn { from { transform: translateX(var(--slide-from, 4%)); } to { transform: translateX(0); } }

/* Zoom (punch-in) */
.layer.zoom-in { animation: zoomIn 1000ms cubic-bezier(0.16,1,0.3,1) forwards; }
@keyframes zoomIn { from { transform: scale(1.16); } to { transform: scale(1); } }

/* Glide (slow drift + zoom, a softer cousin of Ken Burns) */
.layer.glide-in { animation: glideIn var(--kb-dur, 7s) ease-out forwards; }
@keyframes glideIn {
  from { transform: scale(1.05) translate(var(--kb-x, 0%), var(--glide-y-from, 2.5%)); }
  to   { transform: scale(1.12) translate(calc(var(--kb-x, 0%) * -1), var(--glide-y-to, -1.5%)); }
}

/* Rise (drift up while fading in) */
.layer.rise-in { animation: riseIn 1000ms cubic-bezier(0.16,1,0.3,1) forwards; }
@keyframes riseIn { from { transform: translateY(3%) scale(1.04); } to { transform: translateY(0) scale(1); } }

/* Brief gold flash when a guest photo lands */
.flash {
  position: absolute; inset: 0; z-index: 5; pointer-events: none;
  background: radial-gradient(60% 50% at 50% 40%, color-mix(in srgb, var(--gold) 55%, transparent), transparent 70%);
  opacity: 0;
}
.flash.on { animation: flashPop 1.1s ease-out; }
@keyframes flashPop {
  0% { opacity: 0; }
  12% { opacity: 0.85; }
  100% { opacity: 0; }
}

.vignette {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(125% 95% at 50% 42%, transparent 55%, rgba(9,4,14,0.72) 100%);
}

/* Corner wordmark */
.wordmark {
  position: absolute; top: 4vh; left: 4vh; z-index: 6;
  font-size: clamp(15px, 2vh, 26px); letter-spacing: 0.02em;
  text-shadow: 0 2px 14px rgba(0,0,0,0.6);
  transition: opacity .6s ease;
}
.wm-name { color: var(--gold); font-weight: 700; }
.wm-dot { color: var(--pink); margin: 0 0.35em; }
.wm-age { color: #fff; font-weight: 700; }

/* Uploader credit */
.credit {
  position: absolute; bottom: 4.5vh; left: 4vh; z-index: 6;
  display: inline-flex; align-items: baseline; gap: 0.4em;
  padding: 0.55em 1em; border-radius: 999px;
  background: rgba(20,10,26,0.5); border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  font-size: clamp(14px, 2.1vh, 24px);
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
  opacity: 0; transform: translateY(8px); transition: opacity .5s, transform .5s;
}
.credit.on { opacity: 1; transform: none; }
.credit-by { color: var(--muted); font-size: 0.72em; text-transform: lowercase; }
.credit-name { color: var(--gold); font-weight: 700; }

/* Live drop toast - top center so it never collides with the QR (top right) */
.toast {
  position: absolute; top: 4vh; left: 50%; z-index: 8;
  display: inline-flex; align-items: center; gap: 0.7em;
  padding: 0.8em 1.3em; border-radius: 999px;
  background: rgba(20,10,26,0.72); border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  font-size: clamp(15px, 2.1vh, 24px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  opacity: 0; transform: translateX(-50%) translateY(-12px); transition: opacity .45s, transform .45s;
}
.toast.on { opacity: 1; transform: translateX(-50%); }

/* Guest QR, upper right */
.reelqr {
  position: absolute; top: 3.4vh; right: 3.4vh; z-index: 8;
  display: flex; align-items: center; gap: 0.85em;
  padding: 0.7em 0.8em; border-radius: 16px;
  background: rgba(20,10,26,0.55); border: 1px solid var(--line);
  backdrop-filter: blur(8px); box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.reelqr-cap {
  text-align: right; font-weight: 700; line-height: 1.2;
  font-size: clamp(13px, 1.8vh, 21px); color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}
.reelqr-tile { background: #fff; border-radius: 10px; padding: 6px; flex: 0 0 auto; }
.reelqr-tile img { display: block; width: clamp(80px, 11vh, 118px); height: auto; }
.toast-dot { width: 0.6em; height: 0.6em; border-radius: 50%; background: #5ee6a8; box-shadow: 0 0 12px #5ee6a8; }
.toast-text b { color: var(--gold); }

/* Title interstitial */
.interstitial {
  position: absolute; inset: 0; z-index: 7;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .8s ease;
  background: radial-gradient(120% 120% at 50% 50%, color-mix(in srgb, var(--purple) 34%, transparent), transparent 70%);
}
.interstitial.on { opacity: 1; }
.lock { text-align: center; text-shadow: 0 4px 30px rgba(0,0,0,0.6); }
.interstitial.on .lock { animation: lockIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes lockIn {
  0% { transform: scale(0.86) translateY(10px); opacity: 0; }
  60% { transform: scale(1.03) translateY(0); }
  100% { transform: scale(1); opacity: 1; }
}
.lock-k {
  font-size: clamp(16px, 2.6vh, 30px); letter-spacing: 0.62em; color: var(--gold);
  font-weight: 700; padding-left: 0.62em;
}
.interstitial.on .lock-k { animation: kIn 0.8s ease 0.15s both; }
@keyframes kIn { from { opacity: 0; letter-spacing: 0.9em; } to { opacity: 1; letter-spacing: 0.62em; } }
.lock-13 {
  display: flex; align-items: baseline; justify-content: center; gap: 0.04em;
  font-size: clamp(64px, 20vh, 240px); font-weight: 800; line-height: 0.9; margin-top: 0.1em;
  position: relative;
}
.lock-13 span { color: #fff; }
/* Soft glow ring behind the big 13 for the title card moment */
.lock-13::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 1.15em; height: 1.15em;
  transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none; z-index: -1;
  background: radial-gradient(circle, color-mix(in srgb, var(--gold) 35%, transparent), transparent 70%);
  opacity: 0;
}
.interstitial.on .lock-13::before { animation: glowIn 1.4s ease 0.2s both; }
@keyframes glowIn { from { opacity: 0; transform: translate(-50%, -50%) scale(0.7); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
/* The number gets a gold sheen that sweeps across when the title appears */
.lock-13 b {
  font-style: italic; padding: 0 0.06em; color: transparent;
  background: linear-gradient(100deg, var(--gold) 0%, var(--gold) 38%, #fff6d5 50%, var(--gold) 62%, var(--gold) 100%);
  background-size: 260% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text;
}
.interstitial.on .lock-13 b { animation: shine 2.6s ease-in-out 0.3s; }
@keyframes shine { 0% { background-position: 130% 0; } 100% { background-position: -40% 0; } }
.lock-sub { margin-top: 0.6em; font-size: clamp(14px, 2.4vh, 30px); color: #e7d9f2; letter-spacing: 0.04em; }
.interstitial.on .lock-sub { animation: subIn 0.8s ease 0.35s both; }
@keyframes subIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Empty state */
.empty { position: absolute; inset: 0; z-index: 9; display: flex; align-items: center; justify-content: center; text-align: center; }
.empty-inner { max-width: 82vw; animation: emptyIn 1s cubic-bezier(0.16,1,0.3,1) both; }
@keyframes emptyIn { from { opacity: 0; transform: translateY(16px) scale(0.97); } to { opacity: 1; transform: none; } }
.empty-k { font-size: clamp(34px, 8vh, 110px); font-weight: 800; letter-spacing: -0.01em; }
.empty-k b { color: var(--gold); font-style: italic; }
.empty-lead { font-size: clamp(16px, 2.6vh, 30px); color: var(--muted); margin: 0.4em 0 1.4em; }
.empty-qr {
  width: clamp(180px, 26vh, 320px); margin: 0 auto; background: #fff; padding: 14px; border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 0 color-mix(in srgb, var(--gold) 40%, transparent);
  animation: qrPulse 2.8s ease-in-out infinite;
}
@keyframes qrPulse {
  0%, 100% { box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 0 color-mix(in srgb, var(--gold) 0%, transparent); transform: scale(1); }
  50% { box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 12px color-mix(in srgb, var(--gold) 18%, transparent); transform: scale(1.015); }
}
.empty-qr img { width: 100%; display: block; }
.empty-scan { margin-top: 1em; color: var(--muted); font-size: clamp(13px, 2vh, 22px); }

/* Caption lower-third (cinematic mode) */
.capbar {
  position: absolute; left: 50%; bottom: 4.5vh; transform: translateX(-50%) translateY(10px);
  z-index: 6; max-width: 80vw; text-align: center;
  padding: 0.5em 1.2em; border-radius: 14px;
  background: linear-gradient(180deg, rgba(20,10,26,0.15), rgba(20,10,26,0.62));
  font-size: clamp(16px, 2.6vh, 30px); font-weight: 600; color: #fff;
  text-shadow: 0 2px 16px rgba(0,0,0,0.7);
  opacity: 0; transition: opacity .55s, transform .55s;
}
.capbar.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Collage wall */
.collage {
  position: absolute; inset: 2vh; z-index: 4;
  display: grid; gap: 1.4vh;
  grid-template-columns: repeat(var(--cols, 4), 1fr);
  grid-auto-rows: 1fr;
}
.tile {
  position: relative; overflow: hidden; border-radius: 12px;
  background: rgba(255,255,255,0.03);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.05) inset;
}
.tile .ti {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: 0; transition: opacity .9s ease;
}
.tile .ti.show { opacity: 1; }
.tile.pop { animation: tilePop .7s cubic-bezier(0.16,1,0.3,1); z-index: 2; }
@keyframes tilePop { 0% { transform: scale(0.82); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }
.tile .chip {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  padding: 0.7em 0.8em 0.6em; font-size: clamp(11px, 1.5vh, 17px);
  background: linear-gradient(180deg, transparent, rgba(9,4,14,0.86));
  color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,0.6);
  opacity: 0; transform: translateY(6px); transition: opacity .5s, transform .5s;
}
.tile .chip.on { opacity: 1; transform: none; }
.tile .chip b { color: var(--gold); }

/* Self-hosted display font for the quotes (no external CDN, bulletproof on the TV) */
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/caveat.woff2') format('woff2');
}

/* Rotating fun quote, lower-right - hand-lettered, gold-to-pink, with a sparkle */
.quote {
  position: absolute; right: 4.2vh; bottom: 4vh; z-index: 6;
  max-width: min(46vw, 680px);
  display: flex; align-items: flex-start; justify-content: flex-end; gap: 0.35em;
  opacity: 0; transform: translateY(12px) rotate(-1.5deg);
  transition: opacity 0.85s ease, transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
}
.quote.on { opacity: 1; transform: rotate(-1.5deg); }
.quote #quoteText {
  font-family: 'Caveat', 'Segoe Script', cursive;
  font-weight: 700; line-height: 1.02; text-align: right;
  font-size: clamp(30px, 5.4vh, 68px);
  background: linear-gradient(105deg, var(--gold) 15%, var(--pink) 85%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 2px rgba(0, 0, 0, 0.6));
  padding-bottom: 0.08em; /* room for descenders (g, y, p) */
  transition: opacity 0.45s ease;
}
.quote #quoteText.swap { opacity: 0; }  /* text-only fade during rotation, independent of container */
.q-spark {
  width: 0.72em; height: 0.72em; flex: 0 0 auto; margin-top: 0.55em;
  font-size: clamp(30px, 5.4vh, 68px); fill: var(--gold);
  filter: drop-shadow(0 0 7px rgba(244, 193, 90, 0.55));
  animation: twinkle 3.2s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.9; }
  50% { transform: scale(1.25) rotate(45deg); opacity: 1; }
}

/* Tap-for-menu */
.reelhint {
  position: absolute; bottom: 1.6vh; left: 50%; transform: translateX(-50%); z-index: 7;
  font-size: 12px; letter-spacing: 0.08em; color: rgba(255,255,255,0.5);
  background: rgba(20,10,26,0.4); padding: 5px 12px; border-radius: 999px;
  opacity: 0; transition: opacity 1s ease; pointer-events: none;
}
.reelhint.on { opacity: 1; }
/* Full-screen toggle button - big and remote-friendly, reveals on activity */
.fsbtn {
  position: absolute; left: 50%; bottom: 4vh; z-index: 11;
  transform: translateX(-50%) translateY(14px);
  display: inline-flex; align-items: center; gap: 0.55em;
  padding: 0.85em 1.7em; border-radius: 999px;
  background: rgba(20,10,26,0.82); border: 1px solid rgba(255,255,255,0.18);
  backdrop-filter: blur(10px); color: #fff;
  font-size: clamp(16px, 2.4vh, 28px); font-weight: 700; cursor: pointer;
  box-shadow: 0 14px 44px rgba(0,0,0,0.5);
  opacity: 0; pointer-events: none; transition: opacity .4s ease, transform .4s ease;
}
.fsbtn.show { opacity: 1; transform: translateX(-50%); pointer-events: auto; }
.fsbtn svg { color: var(--gold); }
.fsbtn:active { transform: translateX(-50%) scale(0.97); }
.fsbtn:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }

.reelmenu { position: absolute; inset: 0; z-index: 12; display: flex; align-items: center; justify-content: center;
  background: rgba(6,2,10,0.72); backdrop-filter: blur(6px); }
.rm-card { text-align: center; display: grid; gap: 12px; min-width: 280px; padding: 30px;
  background: linear-gradient(180deg, rgba(40,20,54,0.9), rgba(20,10,26,0.94));
  border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,0.6); }
.rm-title { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.rm-title::after { content: " 13"; color: var(--gold); }
.rm-btn { display: block; text-decoration: none; padding: 15px 20px; border: 0; border-radius: 13px; cursor: pointer;
  font-size: 17px; font-weight: 700; color: #241705;
  background: linear-gradient(180deg, var(--gold), color-mix(in srgb, var(--gold) 72%, var(--pink))); }
.rm-btn.ghost { background: rgba(255,255,255,0.07); color: var(--text); border: 1px solid var(--line); }

.confetti { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 10; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .layer { transition: opacity 400ms ease; }
  .layer.kb-in, .layer.slide-in, .layer.zoom-in, .layer.glide-in, .layer.rise-in { animation: none; }
  .blob { animation: none; }
  .q-spark { animation: none; }
  .empty-qr, .empty-inner { animation: none; }
  .flash.on { animation: none; opacity: 0; }
  .interstitial.on .lock, .interstitial.on .lock-k, .interstitial.on .lock-13 b, .interstitial.on .lock-sub, .interstitial.on .lock-13::before { animation: none; }
}
