/* THE JOB — handler feed. Near-black, film grain, red/amber, condensed display + mono dossier. */
:root {
  --ink: #0a0a0a;
  --ink-2: #121212;
  --ink-3: #1b1b1b;
  --bone: #e9e3d6;
  --dim: #8a857b;
  --red: #e5242b;
  --red-deep: #8f1015;
  --amber: #f5a623;
  --green: #3ddc84;
  --display: "Bebas Neue", "Anton", Impact, sans-serif;
  --heavy: "Anton", "Bebas Neue", Impact, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: var(--ink); color: var(--bone); overflow: hidden; }
body {
  font-family: var(--mono); font-size: 15px; line-height: 1.45;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  overscroll-behavior: none; touch-action: manipulation;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; touch-action: manipulation; }
img { display: block; max-width: 100%; }

/* ---------- frame ---------- */
#frame {
  position: relative; z-index: 1;
  height: 100vh; height: 100dvh;
  padding: calc(var(--sat) + 10px) 16px calc(var(--sab) + 10px);
  display: flex; flex-direction: column;
}
#hud {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; letter-spacing: .18em; color: var(--dim); text-transform: uppercase;
  padding-bottom: 8px; border-bottom: 1px solid #222; margin-bottom: 8px;
}
#hud[hidden] { display: none; }
#hud-drop::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--red); margin-right: 8px; animation: pulse 1.4s infinite; vertical-align: 1px; }
#hud-money { font-family: var(--display); font-size: 24px; letter-spacing: .04em; color: var(--amber); }
#hud-money i { font-style: normal; color: var(--dim); font-size: 16px; }
#hud-money.bump { animation: bump .6s ease-out; }
#stage { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
#subs {
  min-height: 3.6em; padding-top: 8px; font-size: 14px; color: var(--amber);
  text-align: center; letter-spacing: .02em; opacity: 0; transition: opacity .25s;
}
#subs.on { opacity: 1; }
#subs:not(.on) { min-height: 0; padding: 0; }   /* captions are off by default: give the space back */

/* ---------- atmosphere ---------- */
#grain {
  position: fixed; inset: -60%; z-index: 50; pointer-events: none; opacity: .11;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain .6s steps(6) infinite;
}
#vignette { position: fixed; inset: 0; z-index: 49; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 45%, rgba(0,0,0,.75) 100%); }
#scan {
  position: fixed; inset: 0; z-index: 51; pointer-events: none; opacity: 0;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.07) 0 1px, transparent 1px 3px);
}
#scan.flick { animation: flick .5s steps(2) 1; }
#rain { position: fixed; inset: 0; z-index: 40; pointer-events: none; width: 100%; height: 100%; }

@keyframes grain { 0%{transform:translate(0,0)} 20%{transform:translate(-5%,3%)} 40%{transform:translate(4%,-6%)} 60%{transform:translate(-3%,5%)} 80%{transform:translate(6%,2%)} 100%{transform:translate(0,0)} }
@keyframes flick { 0%{opacity:1; background-color: rgba(229,36,43,.12)} 30%{opacity:.2} 60%{opacity:.9} 100%{opacity:0} }
@keyframes pulse { 0%,100%{opacity:1; transform:scale(1)} 50%{opacity:.25; transform:scale(.8)} }
@keyframes bump { 0%{transform:scale(1)} 30%{transform:scale(1.35); color:#fff} 100%{transform:scale(1)} }
@keyframes shake {
  0%{transform:translate(0,0)} 10%{transform:translate(-9px,6px) rotate(-.6deg)} 20%{transform:translate(8px,-7px) rotate(.5deg)}
  30%{transform:translate(-7px,-4px)} 40%{transform:translate(6px,5px)} 55%{transform:translate(-4px,2px)} 70%{transform:translate(3px,-2px)} 100%{transform:translate(0,0)}
}
.shake { animation: shake .45s cubic-bezier(.36,.07,.19,.97) 1; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes flickerIn { 0%{opacity:0} 10%{opacity:1} 20%{opacity:.1} 35%{opacity:1} 45%{opacity:.3} 60%,100%{opacity:1} }

/* ---------- shared bits ---------- */
.kicker { font-size: 11px; letter-spacing: .28em; color: var(--red); text-transform: uppercase; }
.kicker.amber { color: var(--amber); }
.big { font-family: var(--heavy); text-transform: uppercase; line-height: .92; letter-spacing: .01em; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 60px; width: 100%; padding: 0 18px;
  font-family: var(--display); font-size: 30px; letter-spacing: .08em;
  background: var(--red); color: #fff; border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset, 0 10px 30px -10px rgba(229,36,43,.7);
  transition: transform .08s;
}
.btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; color: var(--bone); box-shadow: 0 0 0 1px #3a3a3a inset; font-size: 22px; min-height: 52px; }
.btn.amber { background: var(--amber); color: #111; box-shadow: 0 10px 30px -10px rgba(245,166,35,.6); }
.appear { animation: fadeUp .5s ease-out both; }
.hide { display: none !important; }

/* ---------- S0 ---------- */
.s0 { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 26px; }
.s0 .dot { width: 18px; height: 18px; border-radius: 50%; background: var(--red); box-shadow: 0 0 24px 6px rgba(229,36,43,.55); animation: pulse 1.6s ease-in-out infinite; }
.s0 .accept { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; }
.s0 .accept .big { font-family: var(--display); font-size: 54px; letter-spacing: .04em; max-width: 9ch; }
.s0 .fine { font-size: 11px; letter-spacing: .25em; color: var(--dim); }
.s0 .load { font-size: 12px; letter-spacing: .2em; color: var(--amber); min-height: 1.4em; }

/* ---------- S1 dossier ---------- */
.s1 { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 4px; }
.s1 .head { width: 100%; display: flex; justify-content: space-between; font-size: 11px; letter-spacing: .22em; color: var(--dim); }
.pp-wrap { position: relative; width: min(66vw, 270px); aspect-ratio: 5 / 7; margin-top: 8px; opacity: 0; perspective: 800px; }
.pp-wrap.slam { animation: slam .55s cubic-bezier(.2,1.4,.4,1) forwards; }
@keyframes slam { 0%{opacity:0; transform:scale(2.6) rotate(-14deg)} 70%{opacity:1; transform:scale(.96) rotate(-3deg)} 100%{opacity:1; transform:scale(1) rotate(-4deg)} }
.pp-wrap img.art { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; box-shadow: 0 30px 60px -20px #000, 0 0 0 1px rgba(255,255,255,.06); }
.pp-css {
  width: 100%; height: 100%; border-radius: 6px 10px 10px 6px; padding: 22px 16px;
  background: radial-gradient(circle at 30% 20%, #23305a, #101a33 70%); color: #d6b25e;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; text-align: center;
  box-shadow: 0 30px 60px -20px #000, inset 6px 0 0 rgba(0,0,0,.35), inset 0 0 0 1px rgba(214,178,94,.25);
}
.pp-css .t1 { font-family: var(--display); font-size: 30px; letter-spacing: .2em; }
.pp-css .t2 { font-size: 10px; letter-spacing: .25em; }
.pp-css .seal { width: 92px; height: 92px; border-radius: 50%; border: 2px solid #d6b25e; display: grid; place-items: center; font-size: 40px; }
.pp-css .data { font-size: 10px; letter-spacing: .08em; line-height: 1.6; color: #e9d9a8; text-align: left; width: 100%; border-top: 1px solid rgba(214,178,94,.3); padding-top: 8px; }
.stamp {
  position: absolute; left: 50%; top: 50%; opacity: 0; pointer-events: none;
  transform: translate(-50%,-50%) rotate(-16deg) scale(3);
}
.stamp.hit { animation: stampHit .32s cubic-bezier(.2,1.5,.4,1) forwards; }
@keyframes stampHit { 0%{opacity:0; transform:translate(-50%,-50%) rotate(-10deg) scale(3)} 100%{opacity:.95; transform:translate(-50%,-50%) rotate(-16deg) scale(1)} }
.stamp-css {
  font-family: var(--heavy); font-size: 60px; letter-spacing: .06em; color: var(--red);
  border: 6px solid var(--red); padding: 2px 16px; border-radius: 8px; white-space: nowrap;
  mix-blend-mode: screen; text-shadow: 0 0 1px var(--red);
  -webkit-mask-image: radial-gradient(circle at 40% 40%, #000 55%, rgba(0,0,0,.65) 75%, #000 100%);
}
.stamp img { width: min(80vw, 320px); max-width: none; transform: rotate(16deg); } /* art is pre-rotated -12deg */
.assoc { width: 100%; margin-top: 6px; display: flex; flex-direction: column; gap: 8px; }
.assoc .row { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px dashed #2c2c2c; padding: 6px 0; opacity: 0; }
.assoc .row.on { animation: flickerIn .7s linear forwards; }
.assoc .row b { font-family: var(--display); font-size: 28px; font-weight: 400; letter-spacing: .06em; }
.assoc .row span { color: var(--red); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }

/* ---------- S2 the prep ---------- */
.s2 { flex: 1; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.prep-head { display: flex; justify-content: space-between; align-items: flex-end; }
.s2 .big { font-size: 64px; }
.s2 .big em { color: var(--red); font-style: normal; }
.prep-total { font-family: var(--heavy); font-size: 44px; color: var(--amber); line-height: 1; }
.prep-main { position: relative; flex: 1; min-height: 300px; display: grid; place-items: center; perspective: 900px; }
.env { position: relative; width: 270px; height: 165px; opacity: 0; transform: translateY(-40px) rotate(-3deg); transition: opacity .35s, transform .45s cubic-bezier(.2,1.3,.4,1); }
.env.in { opacity: 1; transform: rotate(-2deg); }
.env-back { position: absolute; inset: 0; background: #8a6a3a; border-radius: 3px; box-shadow: 0 24px 40px -18px #000; }
.env-front {
  position: absolute; inset: 0; z-index: 3; border-radius: 3px;
  background: linear-gradient(160deg, #d9b77c, #b88f52 70%, #a37c43);
  clip-path: polygon(0 18%, 50% 52%, 100% 18%, 100% 100%, 0 100%);
  box-shadow: inset 0 0 30px rgba(60,30,0,.35);
}
.env-flap {
  position: absolute; left: 0; right: 0; top: 0; height: 58%; z-index: 1;
  background: linear-gradient(180deg, #c9a568, #a98249); clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: 50% 0; transform: rotateX(180deg); transition: transform .35s cubic-bezier(.6,0,.4,1);
}
.env.sealed .env-flap { z-index: 4; transform: rotateX(0deg); }
.env-label {
  position: absolute; left: 14px; bottom: 14px; font-family: var(--mono); font-weight: 600; font-size: 15px; letter-spacing: .2em;
  color: var(--red-deep); border: 2px solid var(--red-deep); padding: 2px 8px; transform: rotate(-4deg) scale(2.4); opacity: 0;
}
.env-label.hit { animation: labelHit .25s cubic-bezier(.2,1.5,.4,1) forwards; }
@keyframes labelHit { to { opacity: .9; transform: rotate(-4deg) scale(1); } }
.env-code { position: absolute; right: 14px; bottom: 16px; font-family: var(--mono); font-size: 13px; color: #3a2a12; letter-spacing: .1em; }
.env-code .glyphs { letter-spacing: .05em; color: #2a1d0b; }
.env-code .redact { position: absolute; right: -4px; top: -2px; bottom: -2px; width: 0; background: #0a0a0a; transition: width .3s ease-in; }
.env-code .redact.wipe { width: calc(5ch + 12px); }
.bill { position: absolute; left: 50%; top: 18%; width: 150px; height: 64px; margin-left: -75px; z-index: 2; transform: translateY(-190px) rotate(-6deg); opacity: 0; object-fit: contain; }
.env.fill .bill { animation: billIn .7s cubic-bezier(.5,0,.3,1) forwards; }
.env.fill .bill.b2 { animation-delay: .22s; }
@keyframes billIn { 0% { opacity: 1; transform: translateY(-190px) rotate(-6deg); } 100% { opacity: 1; transform: translateY(14px) rotate(1deg); } }
.bill-css { background: #6f8f5a; border: 2px solid #2f4a26; outline: 1px solid #6f8f5a; outline-offset: -6px; display: flex; align-items: center; justify-content: space-between; padding: 0 8px; }
.bill-css i { font-family: var(--heavy); font-style: normal; font-size: 16px; color: #2f4a26; }
.bill-css b { width: 28px; height: 34px; border-radius: 50%; border: 2px solid #2f4a26; }
.prep-pop { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); font-family: var(--heavy); font-size: 46px; color: var(--green); text-shadow: 0 0 20px rgba(61,220,132,.6); animation: plus 1.2s ease-out forwards; pointer-events: none; z-index: 5; }
/* envelope 1 idles under the rest of s2_brief: slow drift, never a frozen frame */
.env.idle { animation: envIdle 5.5s ease-in-out infinite; }
@keyframes envIdle { 0%,100% { transform: rotate(-2deg); } 30% { transform: translate(5px,-6px) rotate(-.6deg); } 65% { transform: translate(-4px,3px) rotate(-3.2deg); } }
.prep-kick { position: absolute; left: 0; right: 0; bottom: 6%; text-align: center; font-size: 12px; letter-spacing: .3em; color: var(--red); text-transform: uppercase; opacity: .85; }
.prep-kick .cur { display: inline-block; width: .55em; height: 1em; background: var(--red); vertical-align: -2px; }
.pile { display: flex; gap: 8px; justify-content: center; padding-bottom: 4px; }
.pile-env { width: 62px; height: 38px; border: 1px dashed #333; border-radius: 2px; display: grid; place-items: center; font-family: var(--mono); font-size: 11px; color: #444; letter-spacing: .15em; transition: background .3s, border-color .3s; }
.pile-env.on { border: 0; background: linear-gradient(160deg, #d9b77c, #a37c43); color: var(--red-deep); font-weight: 600; box-shadow: 0 8px 16px -8px #000; }

/* ---------- drops ---------- */
.drop { flex: 1; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.card {
  position: relative; background: linear-gradient(180deg, #151515, #0f0f0f); border: 1px solid #262626; border-left: 3px solid var(--red);
  padding: 14px 14px 16px; transform: translateX(110%); transition: transform .55s cubic-bezier(.2,.9,.3,1);
  display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow-x: hidden; overflow-y: auto;
}
.card.in { transform: none; }
.card .ttl { font-size: 40px; }
.card .art-slot img { width: 100%; max-height: 22vh; object-fit: cover; border-radius: 2px; filter: contrast(1.1) saturate(.85); }
.art-css { position: relative; height: 14vh; height: 14dvh; max-height: 180px; display: flex; align-items: flex-end; justify-content: space-between; overflow: hidden;
  border-bottom: 1px solid #262626; background: repeating-linear-gradient(-45deg, transparent 0 14px, rgba(229,36,43,.05) 14px 28px); }
.art-css span { font-family: var(--heavy); font-size: 14vh; font-size: 14dvh; line-height: .8; color: transparent; -webkit-text-stroke: 2px rgba(229,36,43,.75); margin-bottom: -2vh; }
.art-css em { font-style: normal; font-family: var(--display); font-size: 22px; letter-spacing: .12em; color: var(--dim); padding: 0 2px 8px; text-align: right; max-width: 50%; }
.card .hint { font-size: 15px; min-height: 5.6em; color: var(--bone); }
.card .hint .cur { display: inline-block; width: .55em; height: 1em; background: var(--amber); vertical-align: -2px; animation: blink .8s steps(2) infinite; }
.fallback { border: 1px dashed var(--amber); color: var(--amber); padding: 10px 12px; font-size: 14px; }
.fallback .kicker { display: block; margin-bottom: 4px; }
.clock { display: flex; align-items: baseline; justify-content: space-between; margin-top: auto; }
.clock .t { font-family: var(--display); font-size: 92px; line-height: .85; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.clock .lab { font-size: 11px; letter-spacing: .22em; color: var(--dim); text-align: right; }
.clock.danger .t { color: var(--red); animation: pulse 1s ease-in-out infinite; }
.clock.over .t { color: var(--red); font-size: 64px; }
.drop .actions { display: flex; flex-direction: column; gap: 10px; }

/* ---------- lock ---------- */
.lock {
  position: fixed; inset: 0; z-index: 30; background: rgba(6,6,6,.96);
  padding: calc(var(--sat) + 16px) 16px calc(var(--sab) + 16px);
  display: flex; flex-direction: column; gap: 14px; animation: fadeUp .25s ease-out;
}
.lock .top { display: flex; justify-content: space-between; align-items: center; }
.lock .x { width: 52px; height: 52px; font-size: 28px; color: var(--dim); display: grid; place-items: center; border: 1px solid #2a2a2a; }
.lock .big { font-size: 44px; }
.slots { display: flex; gap: 8px; justify-content: center; margin: 6px 0; }
.slot {
  width: 58px; height: 74px; border: 2px solid #333; display: grid; place-items: center;
  font-family: var(--heavy); font-size: 44px; background: #111;
}
.slot.f { border-color: var(--amber); color: var(--amber); }
.slots.bad .slot { border-color: var(--red); color: var(--red); }
.slots.good .slot { border-color: var(--green); color: var(--green); box-shadow: 0 0 18px rgba(61,220,132,.35); }
.roast { min-height: 3em; text-align: center; color: var(--red); font-size: 14px; }
.keys { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;   /* 4px: (393-32-24)/7 = 48px keys */ margin-top: auto; }
.keys button {
  min-height: 52px; min-width: 0; background: #1a1a1a; border: 1px solid #2c2c2c; border-radius: 3px;
  font-family: var(--display); font-size: 26px; letter-spacing: .02em;
}
.keys button:active { background: var(--red); border-color: var(--red); }
.keys .wide { grid-column: span 2; font-size: 18px; letter-spacing: .12em; color: var(--amber); }
.plus40 { position: fixed; left: 50%; top: 38%; z-index: 35; transform: translate(-50%,-50%); font-family: var(--heavy); font-size: 96px; color: var(--green); text-shadow: 0 0 30px rgba(61,220,132,.6); pointer-events: none; animation: plus 1.6s ease-out forwards; }
@keyframes plus { 0%{opacity:0; transform:translate(-50%,-30%) scale(.6)} 20%{opacity:1; transform:translate(-50%,-50%) scale(1.1)} 70%{opacity:1} 100%{opacity:0; transform:translate(-50%,-90%) scale(1)} }

/* ---------- S8 ---------- */
.s8 { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; position: relative; }
.s8 .total { font-size: 120px; color: var(--amber); }
.s8 .stat { display: flex; gap: 24px; justify-content: center; font-size: 11px; letter-spacing: .2em; color: var(--dim); }
.s8 .stat b { display: block; font-family: var(--display); font-size: 34px; color: var(--bone); letter-spacing: .04em; font-weight: 400; }
.grade { position: relative; width: 140px; height: 150px; margin: 6px auto 0; }
.grade .stamp { font-size: 120px; }
.grade .stamp-css { font-size: 110px; padding: 0 22px; line-height: 1.1; }
.s8 .bg-pp { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity 3s ease; pointer-events: none; }
.s8 .bg-pp > * { width: min(70vw, 300px); height: auto !important; aspect-ratio: 5/7; transform: rotate(-4deg); }
.s8.still .bg-pp { opacity: .14; }
.s8.still .loud { opacity: 0; transition: opacity 1.6s ease; }
.dad { position: relative; max-width: 30ch; margin: 0 auto; font-family: Georgia, "Times New Roman", serif; font-size: 21px; line-height: 1.55; color: var(--bone); opacity: 0; transition: opacity 2.4s ease; white-space: pre-line; }
.dad.on { opacity: 1; }
/* After the handler drops the bit, S8 becomes one scrolling column: total · Dad's words · photos · buttons. */
.s8scroll { position: absolute; inset: 0; overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 12vh 0 24px; z-index: 44; }
.photos { display: flex; flex-direction: column; gap: 14px; width: min(100% - 16px, 360px); /* room for the tilt */ opacity: 0; transition: opacity 1.8s ease; }
.photos.on { opacity: 1; }
.photos figure { margin: 0; padding: 8px 8px 10px; background: #f3efe6; transform: rotate(-1.2deg); box-shadow: 0 10px 30px rgba(0,0,0,.6); }
.photos figure:nth-child(even) { transform: rotate(1.1deg); }
.photos img { display: block; width: 100%; height: auto; }
.fin { position: relative; width: 100%; display: flex; flex-direction: column; gap: 10px; z-index: 45; }
.complete { position: fixed; left: 50%; top: 26%; z-index: 46; pointer-events: none; transition: opacity 1.2s ease; }
.complete.fade { opacity: 0; }
.complete .stamp-css { font-size: 44px; }

/* ---------- art routing (designer SVGs + photos) ---------- */
.s1-hero { position: absolute; inset: -10px -16px; width: calc(100% + 32px); height: calc(100% + 20px); object-fit: cover; z-index: 5; opacity: 0; pointer-events: none; }
.s1-hero.slam { animation: heroIn .6s cubic-bezier(.2,1.3,.4,1) forwards; }
.s1-hero.out { animation: heroOut .35s ease-in forwards; }
@keyframes heroIn { from { opacity: 0; transform: scale(1.7) rotate(-6deg); } to { opacity: 1; transform: none; } }
@keyframes heroOut { from { opacity: 1; } to { opacity: 0; transform: scale(.85); visibility: hidden; } }
.pp-wrap { aspect-ratio: 3 / 4; }
.pp-wrap img.art { object-fit: contain; box-shadow: none; filter: drop-shadow(0 26px 30px rgba(0,0,0,.8)); }
.stamp.on-data { left: 2.8%; top: 62.5%; width: 94%; transform: scale(3); transform-origin: 50% 50%; }
.stamp.on-data.hit { animation: stampData .3s cubic-bezier(.2,1.5,.4,1) forwards; }
@keyframes stampData { 0% { opacity: 0; transform: scale(3); } 100% { opacity: 1; transform: scale(1); } }
.stamp img.stamp-art { width: 100%; max-width: none; transform: none; }
/* envelope art: bills slide down BEHIND the body = into the envelope */
.env.art { width: 290px; height: 193px; }
.env.art .bill { z-index: 1; top: 8%; }
.env.art .env-body { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; filter: drop-shadow(0 20px 24px rgba(0,0,0,.7)); }
.env.art .env-flap { position: absolute; left: 0; top: 5%; width: 100%; height: 33.3%; z-index: 0; background: none; clip-path: none;
  transform-origin: 50% 0; transform: rotateX(180deg); transition: transform .35s cubic-bezier(.6,0,.4,1); }
.env.art.sealed .env-flap { z-index: 3; transform: rotateX(0deg); }
.env.art .env-label { z-index: 4; left: 6%; bottom: auto; top: 40%; font-size: 13px; }
.env-codebox { position: absolute; z-index: 4; left: 30%; top: 72%; width: 40%; height: 14%; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 18px; color: #2a1d0b; }
.env-codebox .redact { position: absolute; left: 8%; top: 10%; bottom: 10%; width: 0; background: #0a0a0a; transition: width .3s ease-in; }
.env-codebox .redact.wipe { width: 84%; }
/* drop cards: photo behind, darkened */
.drop .card { flex: 1; }
.card.photo { background: #000; }
.card-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .5; filter: contrast(1.1) saturate(.8); z-index: 0; pointer-events: none; }
.card.photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,10,10,.1) 0%, rgba(10,10,10,.55) 45%, rgba(10,10,10,.9) 100%); z-index: 0; pointer-events: none; }
.card > *:not(.card-bg) { position: relative; z-index: 1; }
.card.photo .art-css { background: none; border-bottom-color: rgba(255,255,255,.08); }
.card .hint { text-shadow: 0 1px 6px #000; }
/* ---------- S2 montage: drops 2-5 slam-cut in already sealed, each with a gag ---------- */
.env.cut { transition: none; animation: cutIn .2s cubic-bezier(.2,1.4,.4,1) backwards; }
.env.cut .env-flap, .env.cut .redact { transition: none; }
.env.cut .env-label { animation: none; opacity: .9; transform: rotate(-4deg) scale(1); }
@keyframes cutIn { from { opacity: 1; transform: scale(1.35) rotate(-6deg); } to { opacity: 1; transform: rotate(-2deg); } }
.gag { position: absolute; z-index: 6; pointer-events: none; font-family: var(--heavy); text-transform: uppercase; text-align: center; line-height: 1.05;
  opacity: 0; animation: gagHit .22s cubic-bezier(.2,1.5,.4,1) .08s forwards; }
@keyframes gagHit { from { opacity: 0; transform: var(--gt) scale(2.6); } to { opacity: 1; transform: var(--gt) scale(1); } }
/* DROP 02 — frost edge + freezer sticker */
.gag-frost { --gt: rotate(5deg); right: -6px; top: 6%; width: 52%; padding: 7px 8px; font-size: 15px; letter-spacing: .04em;
  background: #dff3ff; color: #0d4a7a; border: 2px solid #7cc4ff; border-radius: 4px; box-shadow: 0 6px 14px -6px #000; }
.env.frost::after { content: ""; position: absolute; inset: 0; z-index: 5; pointer-events: none; border-radius: 4px;
  box-shadow: inset 0 0 22px 8px rgba(214,240,255,.85), inset 0 0 4px 2px #fff; animation: fadeUp .25s ease-out both; }
/* DROP 03 — bank stamp */
.gag-bank { --gt: rotate(-9deg); right: 4%; top: 8%; padding: 2px 10px; font-size: 22px; letter-spacing: .06em;
  color: #1f7a3a; border: 4px double #1f7a3a; border-radius: 6px; background: rgba(233,227,214,.15); mix-blend-mode: multiply; }
/* DROP 04 — caution sticker */
.gag-tesla { --gt: rotate(-4deg); left: 50%; margin-left: -42%; top: 4%; width: 84%; padding: 6px 8px; font-size: 16px; letter-spacing: .05em;
  color: #111; background: repeating-linear-gradient(-45deg, #f5c518 0 12px, #111 12px 16px); box-shadow: 0 6px 14px -6px #000; }
.gag-tesla span { display: block; background: #f5c518; padding: 3px 4px; }
/* DROP 05 — red stamp */
.gag-done { --gt: rotate(11deg); left: 50%; margin-left: -40%; top: 10%; width: 80%; padding: 3px 8px; font-size: 21px; letter-spacing: .04em;
  color: var(--red); border: 4px solid var(--red); border-radius: 6px; text-shadow: 0 0 1px var(--red); }

/* ---------- S0 full-screen affordance ---------- */
.s0 .fs { position: absolute; left: 16px; right: 16px; bottom: calc(var(--sab) + 18px); min-height: 48px; z-index: 3;
  font-family: var(--display); font-size: 20px; letter-spacing: .14em; color: var(--dim);
  box-shadow: 0 0 0 1px #2a2a2a inset; border-radius: 2px; }
.s0 .fs-tip { position: absolute; left: 16px; right: 16px; bottom: calc(var(--sab) + 18px); z-index: 3;
  font-size: 10px; letter-spacing: .18em; color: var(--dim); text-align: center; line-height: 1.6; }
.s0 .fs-tip span { color: var(--amber); }

/* Dad's words, synced to the voice: each word fades up when it is spoken. */
.dad .ph i { font-style: normal; opacity: 0; transition: opacity .55s ease; }
.dad .ph i.on { opacity: 1; }
