html, body { margin: 0; height: 100%; background: #050403; overflow: hidden; }
body { -webkit-text-size-adjust: 100%; touch-action: manipulation; }
#stage { position: fixed; left: 0; top: 0; width: 100px; height: 100px; overflow: hidden; background: #050403; isolation: isolate; }
#clips video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; opacity: 0; pointer-events: none; }
#clips video.on { opacity: 1; }
.sprite { position: absolute; pointer-events: none; }
.hit { position: absolute; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; border-radius: 50%; -webkit-tap-highlight-color: transparent; }
.hit:focus { outline: none; }
#finish { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }

/* live ink: laid out flat in card space, warped onto the rendered card each picture */
.ink { position: absolute; left: 0; top: 0; transform-origin: 0 0; mix-blend-mode: multiply; will-change: transform; opacity: 0; transition: opacity .9s ease; }
.ink.wet { opacity: 1; }
#card { width: 780px; height: 600px; filter: url(#inkf); }
#env { width: 720px; height: 550px; filter: url(#inkc); text-align: center; }
.face { position: absolute; inset: 0; margin: 0; }
#card[data-side="front"] .back, #card[data-side="back"] .front { display: none; }
.ink p { margin: 0; position: absolute; }
.pr { font-family: 'IM Fell DW Pica', 'Iowan Old Style', Georgia, serif; color: #2a2420; }
.hw { font-family: 'Caveat', 'Bradley Hand', cursive; font-weight: 500; color: #18265e; }
.head { left: 62px; top: 46px; font-size: 27px; letter-spacing: .06em; }
.front .name { left: 60px; top: 92px; font-size: 70px; line-height: 80px; white-space: nowrap; transform-origin: 0 50%; rotate: -1.1deg; }
.front .addr { left: 62px; top: 190px; font-size: 46px; line-height: 54px; white-space: pre; transform-origin: 0 0; rotate: -0.5deg; }
.ask { left: 62px; top: 452px; width: 470px; font-size: 24px; line-height: 30px; font-style: italic; }
.fine { left: 62px; top: 540px; font-size: 19px; letter-spacing: .03em; opacity: .8; }
.back .ask { left: 400px; top: 446px; width: 330px; font-size: 22px; line-height: 27px; }
/* the mark is ink, not a control: unseen on the back of the card it lies over the postal code line and must not swallow taps meant for it */
.mark { position: absolute; left: 575px; top: 348px; width: 146px; height: 146px; opacity: 0; transform: rotate(-11deg); pointer-events: none; }
.mark.on { opacity: .9; }
.fld { position: absolute; height: 46px; }
.fld input { position: absolute; left: 0; top: 0; width: 100%; height: 46px; box-sizing: border-box; padding: 0 4px; margin: 0; border: 0; outline: 0; background: transparent;
  font: 500 38px/46px 'Caveat', 'Bradley Hand', cursive; color: #18265e; caret-color: #18265e; border-radius: 0; -webkit-appearance: none; appearance: none; }
.fld input::selection { background: rgba(24, 38, 94, .18); }
.fld input:-webkit-autofill { -webkit-text-fill-color: #18265e; transition: background-color 99999s; }
.fld label { position: absolute; left: 3px; top: 52px; white-space: nowrap; font: 19px/22px 'IM Fell DW Pica', Georgia, serif; letter-spacing: .03em; color: #2a2420; opacity: .85; }
.fld.miss label { color: #a11622; opacity: 1; }
.fld.miss::after { content: ''; position: absolute; left: 0; right: 0; top: 45px; height: 4px; background: #a11622; opacity: .8; border-radius: 2px; }
#env p { left: 40px; right: 40px; }
#env-1 { top: 44px; font-size: 62px; line-height: 70px; white-space: nowrap; }
#env-2 { top: 404px; font-size: 44px; line-height: 52px; white-space: nowrap; }
#env.small #env-1 { font-size: 48px; }
#env.msg #env-1 { top: 44px; font-size: 50px; line-height: 58px; }
#env.msg #env-2 { top: 112px; font-size: 46px; line-height: 54px; }

#sound { position: absolute; right: 2.2%; bottom: 3%; z-index: 20; background: none; border: 0; padding: 6px 8px; cursor: pointer; font-size: clamp(15px, 1.5vw, 24px);
  color: #f1dcb4; opacity: .5; mix-blend-mode: screen; filter: blur(.3px); transition: opacity .3s; }
#sound:hover, #sound:focus-visible { opacity: .9; outline: none; }
#scrub { position: absolute; left: 0; right: 0; bottom: 0; height: 18px; z-index: 60; opacity: 0; transition: opacity .25s; cursor: pointer; }
#scrub.show { opacity: 1; }
#scrub::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(241, 220, 180, .16); }
#scrub i { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: rgba(241, 220, 180, .7); }
@media (prefers-reduced-motion: reduce) { .ink { transition: none; } }

/* ?corners=1: outline and tint the tracked card so the lock, and the cut along the envelope's edge, can be checked in screenshots */
#card.dbg { filter: none; mix-blend-mode: normal; }
#card.dbg .face { box-shadow: inset 0 0 0 1px #ff00d0; background: rgba(0, 200, 255, .28); }
#card.dbg .face > * { visibility: hidden; }
