/* ---------- the shot: background + creator, re-lit and re-filmed ---------- */
.scene {
  position: absolute; left: 50%; top: 50%;
  width: 46%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; overflow: hidden;
  background: #000;
  box-shadow: 0 0 0 3px var(--line);
  container-type: inline-size;
  transition: box-shadow .2s;
}
.scene.preview { box-shadow: 0 0 0 3px var(--accent), 0 0 0 7px var(--accent-soft); }
.scene .shot, .scene .lit, .scene .bg, .scene .tint, .scene .cfx, .scene .lx, .scene .osd { position: absolute; inset: 0; }
.scene .shot { background: #000; transition: filter .4s; }
.scene .lit { isolation: isolate; background: var(--accent-soft); transition: filter .4s, transform .4s; }
.scene .bg {
  background: center/cover no-repeat;
  filter: blur(var(--bokeh, 0px));
  transform: scale(1.08); /* hide blurred edges */
  transition: filter .4s;
}

/* The creator is a solid figure: nothing shows through. */
.scene .person, .scene .eyes { position: absolute; left: 14%; top: 14%; width: 72%; overflow: visible; }
.person .shirt { fill: #2e5e6e; stroke: #1c3a44; stroke-width: 2; }
.person .skin { fill: #f2c6a2; stroke: #6b4a3a; stroke-width: 2; stroke-linejoin: round; }
.person .skin.shade { fill: #dfae8a; }
.person .hair { fill: #3a2a22; }
.person .brow { fill: none; stroke: #3a2a22; stroke-width: 3; stroke-linecap: round; }
.person .blush { fill: #ff8a7a; opacity: .25; }
.person .pupil { fill: #2a1d17; }
.person .glint { fill: #fff; }
.person .line { fill: none; stroke: #8a5a44; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.person .mouth { stroke: #8a4a3a; }
.scene.beauty .person { filter: blur(.4px) brightness(1.05) saturate(1.1); }

/* Light layers */
.scene .tint { mix-blend-mode: multiply; transition: opacity .4s, background-color .4s; }
.scene .dark, .scene .glow { position: absolute; inset: -30%; transition: opacity .4s; }
.scene .glow { mix-blend-mode: screen; }
.scene .lx > i, .scene .cfx > i { position: absolute; inset: 0; display: block; }

/* Glowing eyes: only when the room is too dark to see anything else. */
.eyes .glow-eyes { fill: var(--eye); opacity: 0; transition: opacity .6s; transform-box: fill-box; transform-origin: center; }
.scene.glowing .eyes .glow-eyes {
  opacity: 1;
  filter: drop-shadow(0 0 2px var(--eye)) drop-shadow(0 0 6px var(--eye));
  animation: blink 4.5s infinite;
}
.eyes .catch { fill: none; stroke: #fff; stroke-width: 1.2; opacity: 0; }
.scene.catchlight .eyes .catch { opacity: .9; }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }

/* --- light overlays --- */
.lf-panes {
  background:
    linear-gradient(90deg, transparent 46%, rgba(0,0,0,.4) 46% 52%, transparent 52%),
    linear-gradient(0deg, transparent 50%, rgba(0,0,0,.4) 50% 56%, transparent 56%);
  transform: skewX(-18deg) scale(1.4); filter: blur(4px); mix-blend-mode: multiply;
}
.lf-lava::before, .lf-lava::after {
  content: ""; position: absolute; width: 60%; height: 60%; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,80,40,.75), transparent 70%); mix-blend-mode: screen;
  animation: lava 9s ease-in-out infinite alternate;
}
.lf-lava::after { background: radial-gradient(circle, rgba(200,60,255,.6), transparent 70%); animation-duration: 13s; animation-direction: alternate-reverse; }
@keyframes lava { 0% { left: -10%; top: 50%; } 50% { left: 40%; top: 10%; } 100% { left: 50%; top: 60%; } }

.lf-xmas {
  mix-blend-mode: screen;
  background:
    radial-gradient(circle at 12% 18%, #ff3b3b 0 2.5%, transparent 6%), radial-gradient(circle at 28% 9%, #3bff6a 0 2.5%, transparent 6%),
    radial-gradient(circle at 46% 5%, #ffd23b 0 2.5%, transparent 6%), radial-gradient(circle at 64% 8%, #3b9bff 0 2.5%, transparent 6%),
    radial-gradient(circle at 82% 16%, #ff3b3b 0 2.5%, transparent 6%), radial-gradient(circle at 8% 48%, #ffd23b 0 2%, transparent 5%),
    radial-gradient(circle at 92% 44%, #3bff6a 0 2%, transparent 5%), radial-gradient(circle at 20% 80%, #3b9bff 0 2%, transparent 5%),
    radial-gradient(circle at 80% 82%, #ff3bd5 0 2%, transparent 5%);
  animation: twinkle 1.6s steps(2) infinite;
}
.lf-xmas::after { content: ""; position: absolute; inset: 0; background: inherit; transform: scaleX(-1) translateY(6%); animation: twinkle 1.6s steps(2) .8s infinite; }
@keyframes twinkle { 50% { opacity: .35; } }

.scene .lx .lf-disco {
  inset: -50%; mix-blend-mode: screen;
  background:
    radial-gradient(circle, rgba(255,255,255,.95) 0 1.4px, transparent 2.4px) 0 0 / 9% 9%,
    radial-gradient(circle, rgba(255,120,220,.8) 0 1.4px, transparent 2.4px) 4% 3% / 13% 11%,
    radial-gradient(circle, rgba(120,200,255,.8) 0 1.4px, transparent 2.4px) 2% 6% / 11% 14%;
  animation: spin 14s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.lf-flare {
  mix-blend-mode: screen;
  background:
    linear-gradient(0deg, transparent 44.3%, rgba(255,255,255,.45) 45%, transparent 45.7%),
    radial-gradient(circle at 30% 45%, #fff 0 4%, transparent 9%), radial-gradient(circle at 70% 45%, #fff 0 4%, transparent 9%);
}
.lf-static, .cf-grain, .cf-grain-soft, .cf-grain-heavy {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 120px; mix-blend-mode: overlay;
  animation: grain .4s steps(4) infinite;
}
.lf-static { opacity: .45; mix-blend-mode: screen; }
.lf-strobe { background: #fff; opacity: 0; mix-blend-mode: screen; }
@keyframes grain { 25% { background-position: 37px 11px; } 50% { background-position: -21px 53px; } 75% { background-position: 61px -29px; } }

/* --- how lights move --- */
.scene[data-light="flicker"] .dark { animation: flickD 1.3s infinite; }
.scene[data-light="flicker"] .glow { animation: flickG 1.3s infinite; }
@keyframes flickD { 0%, 100% { opacity: 1; } 20% { opacity: .9; } 35% { opacity: .97; } 55% { opacity: .86; } 80% { opacity: .95; } }
@keyframes flickG { 0%, 100% { opacity: .85; } 20% { opacity: 1; } 35% { opacity: .75; } 55% { opacity: 1; } 80% { opacity: .8; } }
.scene[data-light="swing"] .dark, .scene[data-light="swing"] .glow { animation: swing 3.2s ease-in-out infinite alternate; }
@keyframes swing { from { transform: translateX(-12%); } to { transform: translateX(12%); } }
.scene[data-light="wobble"] .dark, .scene[data-light="wobble"] .glow { animation: wobble 2.7s ease-in-out infinite; }
@keyframes wobble { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(5%, 3%); } 50% { transform: translate(-3%, 6%); } 75% { transform: translate(-6%, -2%); } }
.scene[data-light="clouds"] .glow { animation: clouds 9s ease-in-out infinite; }
.scene[data-light="clouds"] .dark { animation: cloudsD 9s ease-in-out infinite; }
@keyframes clouds { 50% { opacity: .35; } }
@keyframes cloudsD { 50% { opacity: .6; } }
.scene[data-light="buzz"] .lit { animation: buzz 4s infinite; }
@keyframes buzz { 0%, 86%, 88%, 90%, 100% { opacity: 1; } 87% { opacity: .55; } 89% { opacity: .35; } }
.scene[data-light="crt"] .glow { animation: crt .15s steps(2) infinite; }
@keyframes crt { 50% { opacity: .8; } }
.scene[data-light="strobe"] .dark { animation: strobeD 3s infinite; }
.scene[data-light="strobe"] .lf-strobe { animation: strobeF 3s infinite; }
.scene[data-light="strobe"] .eyes .glow-eyes { animation: strobeE 3s infinite; }
@keyframes strobeD { 0%, 90%, 97%, 100% { opacity: 1; } 91%, 94% { opacity: 0; } }
@keyframes strobeF { 0%, 90%, 95%, 100% { opacity: 0; } 91% { opacity: .55; } }
@keyframes strobeE { 0%, 90%, 97%, 100% { opacity: 1; } 91%, 94% { opacity: 0; } }

/* --- camera overlays --- */
.cf-grain { opacity: .3; } .cf-grain-soft { opacity: .14; } .cf-grain-heavy { opacity: .55; }
.cf-scan, .cf-scan-soft { background: repeating-linear-gradient(0deg, rgba(0,0,0,.28) 0 1px, transparent 1px 3px); }
.cf-scan-soft { opacity: .45; }
.cf-vignette { background: radial-gradient(circle, transparent 55%, rgba(0,0,0,.55) 100%); }
.cf-vignette-heavy { background: radial-gradient(circle, transparent 35%, rgba(0,0,0,.85) 100%); }
.cf-bars::before, .cf-bars::after { content: ""; position: absolute; left: 0; right: 0; height: 13%; background: #000; }
.cf-bars::before { top: 0; } .cf-bars::after { bottom: 0; }
.cf-cine { background: linear-gradient(160deg, rgba(255,150,60,.35), rgba(0,120,140,.4)); mix-blend-mode: soft-light; }
.scene .cfx .cf-track {
  top: -12%; bottom: auto; height: 10%;
  background: linear-gradient(transparent, rgba(255,255,255,.35) 40%, rgba(255,255,255,.1) 60%, transparent);
  mix-blend-mode: screen; animation: track 4.5s linear infinite;
}
@keyframes track { to { transform: translateY(1250%); } }
.cf-leak {
  background: radial-gradient(ellipse at 100% 0%, rgba(255,120,40,.75), transparent 55%),
              radial-gradient(ellipse at 0% 100%, rgba(255,50,90,.4), transparent 45%);
  mix-blend-mode: screen;
}
.cf-flash { background: radial-gradient(circle at 50% 45%, rgba(255,255,255,.75), transparent 45%); mix-blend-mode: soft-light; }
.cf-cracks svg { width: 100%; height: 100%; display: block; }
.cf-cracks path { fill: none; stroke: rgba(255,255,255,.75); stroke-width: .45; stroke-linejoin: bevel;
  filter: drop-shadow(.4px .4px 0 rgba(0,0,0,.6)); }
.cf-smudge { background: radial-gradient(ellipse at 30% 70%, rgba(255,255,255,.25), transparent 40%); filter: blur(2px); }
.scene .cfx .cf-thumb {
  inset: auto; left: -10%; bottom: -16%; width: 42%; height: 58%; border-radius: 50%;
  background: radial-gradient(ellipse at 35% 30%, #f6d0b2, #c98d6c 80%);
  filter: blur(3px); transform: rotate(28deg);
}
.scene .cfx .cf-seam { left: 60%; right: auto; width: 5%; backdrop-filter: blur(2px) hue-rotate(15deg) brightness(1.1); }
.scene .cfx .cf-trackbox {
  inset: auto; left: 31%; top: 20%; width: 38%; height: 52%;
  background:
    linear-gradient(#5f5, #5f5) top left / 18% 2px, linear-gradient(#5f5, #5f5) top left / 2px 18%,
    linear-gradient(#5f5, #5f5) top right / 18% 2px, linear-gradient(#5f5, #5f5) top right / 2px 18%,
    linear-gradient(#5f5, #5f5) bottom left / 18% 2px, linear-gradient(#5f5, #5f5) bottom left / 2px 18%,
    linear-gradient(#5f5, #5f5) bottom right / 18% 2px, linear-gradient(#5f5, #5f5) bottom right / 2px 18%;
  background-repeat: no-repeat; animation: follow 3s ease-in-out infinite;
}
@keyframes follow { 50% { transform: translate(3%, -2%) scale(1.03); } }
.cf-toyframe { box-shadow: inset 0 0 0 6cqw #ff7ac8, inset 0 0 0 8cqw #ffe14d; }
.cf-gbframe { box-shadow: inset 0 0 0 7cqw #0f380f; }

/* --- camera motion --- */
.scene[data-cam="shake"] .shot { animation: shake .5s infinite; }
@keyframes shake { 0%, 100% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(1.2%, -.8%) rotate(.6deg); }
  50% { transform: translate(-.8%, 1%) rotate(-.4deg); } 75% { transform: translate(.6%, .8%) rotate(.3deg); } }
.scene[data-cam="choppy"] .shot { animation: choppy 1.2s steps(1) infinite; }
@keyframes choppy { 0% { transform: none; } 33% { transform: translate(.6%, 0); } 66% { transform: translate(-.4%, .4%); } }

/* --- on-screen display (not filtered, so it stays legible) --- */
.scene .osd {
  font: 700 6.2cqw/1.15 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: #fff; text-shadow: 0 0 2px #000, 0 1px 2px #000; pointer-events: none;
}
.osd.vcr { font-size: 7cqw; letter-spacing: .04em; }
.osd > span { position: absolute; white-space: nowrap; }
.osd .o-tl { left: 19%; top: 19%; } .osd .o-tr { right: 19%; top: 19%; text-align: right; }
.osd .o-bl { left: 19%; bottom: 19%; } .osd .o-br { right: 19%; bottom: 19%; text-align: right; }
.osd .o-t { left: 50%; top: 9%; transform: translateX(-50%); } .osd .o-b { left: 50%; bottom: 9%; transform: translateX(-50%); font-size: 5.2cqw; }
.osd .rec { color: #ff3b30; }
.osd .pill { padding: .1em .45em; border-radius: .4em; text-shadow: none; font-size: 5cqw; }
.osd .pill.red { background: #ff3b30; } .osd .pill.yellow { background: #ffcc00; color: #000; }
.osd .led { display: inline-block; width: 3cqw; height: 3cqw; border-radius: 50%; background: #3dff6a; box-shadow: 0 0 6px #3dff6a; }
.osd .stamp { color: #ff8a1f; text-shadow: 0 0 4px rgba(255,120,0,.8); font-size: 7cqw; }
.osd .low { color: #ff3b30; }
.osd .blink { animation: blinkTxt 1s steps(1) infinite; }
@keyframes blinkTxt { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .scene *, .scene *::before, .scene *::after { animation: none !important; }
}

/* Final shot on the result card */
.result .scene { position: relative; left: auto; top: auto; transform: none; width: min(62vw, 240px); margin: 4px auto 14px; }
