:root { --ink: #f4f1ff; --cyan: #3fd8ff; --pink: #ff3d8b; --gold: #ffb347; --red: #ff4b5c; --bg: #06040c; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); overflow: hidden; font-family: system-ui, -apple-system, "Helvetica Neue", Arial, "Hiragino Sans", "Apple SD Gothic Neo", Thonburi, sans-serif; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: none; -webkit-tap-highlight-color: transparent; }
#c { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; }

/* ── title ── */
/* the words ride the sky (top), the button the floor (bottom): the middle of the screen is the plunge, never covered (polish_a) */
.title { position: fixed; inset: 0; display: flex; flex-direction: column; text-align: center; padding: calc(60px + env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(6,4,12,.8) 0%, rgba(6,4,12,.35) 22%, rgba(6,4,12,0) 34%, rgba(6,4,12,0) 80%, rgba(6,4,12,.7) 100%); transition: opacity .7s ease; }
.title.gone { opacity: 0; pointer-events: none; }
.title__top { position: absolute; top: calc(18px + env(safe-area-inset-top)); left: 0; right: 0; }
.course { font: 600 12px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .24em; color: rgba(200,210,255,.7); padding: 7px 12px; border: 1px solid rgba(200,210,255,.25); border-radius: 999px; background: rgba(6,4,12,.35); }
.title__inner { flex: 1; width: 100%; max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; }
.logo { margin: 0; font-size: clamp(48px, 14.5vw, 104px); line-height: .84; font-weight: 900; letter-spacing: -.035em; font-style: italic; color: #fff; transform: skewX(-6deg);
  background: linear-gradient(180deg, #ffffff 0%, #ffe9f6 38%, #ff5fa8 52%, #7a3cff 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 14px rgba(255,61,139,.55)) drop-shadow(0 0 40px rgba(63,216,255,.35)); }
.tag { margin: 12px 0 0; font-size: clamp(16px, 4.6vw, 21px); font-weight: 700; line-height: 1.25; color: #efeaff; text-shadow: 0 2px 14px #000; }
.tag span { display: block; }
.tag span + span { color: var(--gold); }
.friend { margin: 14px auto 0; display: inline-block; font-weight: 700; font-size: 14px; padding: 9px 14px; border-radius: 12px; border: 1px dashed rgba(255,255,255,.4); background: rgba(0,0,0,.35); }
/* creator night: "Beat @code's 64%" — the retention-pink end-screen chip, big enough to read at a glance */
.friend.creator { margin-top: 18px; max-width: min(360px, 92vw); font-weight: 900; font-size: clamp(20px, 5.8vw, 27px); line-height: 1.15; letter-spacing: .01em; padding: 13px 22px; border: 0; border-radius: 14px; color: #fff; overflow-wrap: anywhere; background: linear-gradient(180deg, #ff5fa8, #d4237a); box-shadow: 0 0 0 2px rgba(255,255,255,.28) inset, 0 0 36px rgba(255,61,139,.6), 0 10px 30px rgba(0,0,0,.4); text-shadow: 0 2px 8px rgba(80,0,40,.45); }
.play { margin-top: auto; font: 900 22px/1 inherit; font-family: inherit; letter-spacing: .06em; text-transform: uppercase; color: #1a0b02; background: linear-gradient(180deg, #ffe0a3, #ffb347 60%, #ff8a3a); border: 0; border-radius: 999px; padding: 19px 64px; box-shadow: 0 0 0 2px rgba(255,255,255,.3) inset, 0 0 30px rgba(255,170,70,.55), 0 10px 40px rgba(255,90,140,.35); cursor: pointer; }
.play:active { transform: scale(.97); }
.hint { margin: 12px 0 0; font-size: 13px; letter-spacing: .04em; opacity: .75; }

/* ── HUD ── */
.hud { position: fixed; left: 0; right: 0; top: 0; padding: calc(10px + env(safe-area-inset-top)) 16px 0; pointer-events: none; }
.hud__bar { height: 3px; border-radius: 3px; background: rgba(255,255,255,.14); overflow: hidden; }
.hud__bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), #fff); transform-origin: 0 50%; transform: scaleX(0); }
.hud__ret { margin-top: 10px; display: flex; flex-direction: column; }
.hud__ret b { font-size: 46px; line-height: 1; font-weight: 900; letter-spacing: -.03em; color: #fff; text-shadow: 0 0 18px rgba(63,216,255,.55); transition: color .2s, text-shadow .2s; font-variant-numeric: tabular-nums; }
.hud__ret span { margin-top: 4px; font: 700 10px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .28em; color: rgba(220,230,255,.7); }
.hud__time { position: absolute; right: 16px; top: calc(24px + env(safe-area-inset-top)); font: 700 15px/1 ui-monospace, "SF Mono", Menlo, monospace; color: rgba(230,236,255,.85); padding: 6px 10px; border-radius: 8px; background: rgba(0,0,0,.35); }
.hud[data-mood="pink"] .hud__ret b { color: #ff9cc8; text-shadow: 0 0 22px rgba(255,61,139,.9); }
.hud[data-mood="gold"] .hud__ret b { color: #ffd59a; text-shadow: 0 0 22px rgba(255,179,71,.9); }
.hud[data-mood="red"] .hud__ret b { color: #ff8a95; text-shadow: 0 0 22px rgba(255,60,80,.9); }

.floats { position: fixed; left: 16px; top: calc(96px + env(safe-area-inset-top)); pointer-events: none; }
.float { position: absolute; left: 0; top: 0; white-space: nowrap; font-weight: 900; font-size: 24px; animation: floatup 1.4s cubic-bezier(.2,.8,.3,1) both; text-shadow: 0 0 12px currentColor; }
.float.pink { color: #ff7fb6; font-size: 34px; } .float.gold { color: #ffcf88; font-size: 30px; } .float.red { color: #ff7480; }
@keyframes floatup { 0% { transform: translateY(18px) scale(.6); opacity: 0 } 15% { transform: translateY(0) scale(1.1); opacity: 1 } 100% { transform: translateY(-34px) scale(1); opacity: 0 } }

.hold { position: fixed; left: 50%; bottom: calc(15vh + env(safe-area-inset-bottom)); width: 110px; height: 110px; transform: translateX(-50%); display: grid; place-items: center; pointer-events: none; animation: breathe 1.6s ease-in-out infinite; }
.hold svg { position: absolute; inset: 0; transform: rotate(-90deg); filter: drop-shadow(0 0 10px rgba(255,179,71,.8)); }
.hold__track { fill: rgba(30,16,4,.35); stroke: rgba(255,179,71,.25); stroke-width: 6; }
.hold__ring { fill: none; stroke: var(--gold); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 301.6; stroke-dashoffset: 301.6; transition: stroke-dashoffset .12s linear; }
.hold span { position: relative; font-weight: 900; font-size: 17px; letter-spacing: .12em; color: #ffe2b0; text-shadow: 0 0 10px rgba(255,179,71,.9); }
.hold.on { animation: none; transform: translateX(-50%) scale(1.08); }
@keyframes breathe { 0%, 100% { transform: translateX(-50%) scale(1) } 50% { transform: translateX(-50%) scale(.92) } }
.tap { position: fixed; left: 50%; bottom: calc(15vh + env(safe-area-inset-bottom)); transform: translateX(-50%); pointer-events: none; }
.tap span { display: block; font-weight: 900; font-size: 18px; letter-spacing: .16em; color: #fff; padding: 14px 22px; border-radius: 999px; border: 2px solid rgba(120,230,255,.8); box-shadow: 0 0 18px rgba(63,216,255,.6), inset 0 0 14px rgba(63,216,255,.35); animation: tapPulse .5s ease-in-out infinite alternate; }
@keyframes tapPulse { from { transform: scale(.9) } to { transform: scale(1.06) } }

.quip { position: fixed; left: 16px; right: 16px; bottom: calc(26px + env(safe-area-inset-bottom)); text-align: center; pointer-events: none; font-weight: 800; font-size: clamp(17px, 4.8vw, 24px); line-height: 1.2; color: #fff; text-shadow: 0 2px 0 #000, 0 0 16px rgba(0,0,0,.8); opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; }
.quip.on { opacity: 1; transform: none; }
.quip.loud { font-size: clamp(22px, 6.6vw, 34px); font-weight: 900; color: #ffe14a; }
/* the 0 % slams the middle for a beat, then flies off to the top-right corner: the fall itself (you + the tumblers) owns the screen */
.stamp { position: fixed; top: 40%; left: 50%; font-weight: 900; font-size: clamp(90px, 34vw, 180px); line-height: 1; color: var(--red); text-shadow: 0 0 30px rgba(255,60,80,.9), 0 0 80px rgba(255,60,80,.5); pointer-events: none; transform: translate(-50%, -50%); animation: stamp 1.5s ease-out both; -webkit-text-stroke: 3px #fff2; }
@keyframes stamp { 0% { transform: translate(-50%, -50%) scale(3.2) rotate(-14deg); opacity: 0 } 12% { transform: translate(-50%, -50%) scale(0.88) rotate(-6deg); opacity: 1 } 18% { transform: translate(-47%, -52%) scale(1.06) rotate(-8deg) } 25% { transform: translate(-52%, -49%) scale(0.98) rotate(-7deg) } 55% { transform: translate(-50%, -50%) scale(1) rotate(-7deg) } 100% { transform: translate(calc(-50% + 28vw), calc(-50% - 27vh)) scale(.36) rotate(-7deg); opacity: 1 } }
.toast { position: fixed; top: calc(18px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); font-weight: 800; font-size: 15px; background: rgba(0,0,0,.7); border: 1px solid rgba(255,255,255,.2); padding: 10px 18px; border-radius: 999px; pointer-events: none; z-index: 5; }

/* ── the card ── */
.card { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: calc(14px + env(safe-area-inset-top)) 16px calc(14px + env(safe-area-inset-bottom)); background: radial-gradient(120% 70% at 50% 35%, rgba(40,20,70,.75), rgba(4,3,10,.96)); animation: fadein .6s ease both; touch-action: auto; }
@keyframes fadein { from { opacity: 0 } to { opacity: 1 } }
.card__img { width: auto; height: min(calc(100dvh - 312px), calc((100vw - 32px) * 16 / 9)); max-width: 100%; aspect-ratio: 9 / 16; border-radius: 16px; box-shadow: 0 0 0 1px rgba(255,255,255,.1), 0 24px 60px rgba(0,0,0,.6), 0 0 60px rgba(63,216,255,.15); animation: cardin .7s cubic-bezier(.2,1.2,.4,1) both; }
@keyframes cardin { from { transform: translateY(30px) scale(.94); opacity: 0 } to { transform: none; opacity: 1 } }
.card__btns { width: min(400px, 100%); display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn { font: 800 15px/1.1 inherit; font-family: inherit; padding: 15px 10px; border-radius: 14px; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.06); color: #fff; cursor: pointer; }
.btn--main { grid-column: 1 / -1; background: linear-gradient(90deg, #3fd8ff, #8b5cff); color: #050310; border: 0; font-size: 16px; }
.btn--gold { background: linear-gradient(180deg, #ffe0a3, #ffb347); color: #1a0b02; border: 0; }
.btn:active { transform: scale(.98); }
.btn--clip { grid-column: 1 / -1; border-color: rgba(255,95,168,.6); color: #ffd6ea; } /* the 12 s clip of your run */
.btn[hidden] { display: none; }
.bootfail { position: fixed; inset: auto 16px 40px; text-align: center; background: #000; padding: 14px; border-radius: 12px; }
@media (prefers-reduced-motion: reduce) { .hold, .tap span, .float, .stamp, .card__img { animation: none } }
@media (prefers-reduced-motion: reduce) { .stamp { transform: translate(calc(-50% + 28vw), calc(-50% - 27vh)) scale(.36) rotate(-7deg) } }

/* QA captures (?qa): show the settled state of entrance animations */
.qa .stamp { animation: none; transform: translate(calc(-50% + 28vw), calc(-50% - 27vh)) scale(.36) rotate(-7deg); }
.qa .quip { transition: none; }
.card .rx { margin-top: 2px; }
/* group-chat line (11-09): the quip under the card + "Send to the group chat" with explicit LINE / WhatsApp links.
   The card gives up the room so the buttons + the real exit still fit a 390x844 phone. */
.tsQuip { margin: -2px 0 0; width: min(400px, 100%); text-align: center; font-size: 14px; line-height: 1.3; font-weight: 700; color: #ffd6ea; }
.tsRow { grid-column: 1 / -1; display: flex; gap: 6px; }
.tsRow .btn { flex: 1; min-width: 0; padding: 13px 10px; border-color: rgba(63,216,255,.6); }
.tsLink { flex: 0 0 auto; display: flex; align-items: center; padding: 0 11px; border-radius: 14px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.06); color: #fff; font-size: 12px; font-weight: 800; text-decoration: none; }
.card:has(#tsRow:not([hidden])) { gap: 9px; }
.card:has(#tsRow:not([hidden])) .card__img { height: min(calc(100dvh - 432px), calc((100vw - 32px) * 16 / 9)); }
.card:has(#tsRow:not([hidden])) .card__btns .btn { padding-top: 12px; padding-bottom: 12px; }
