/* v11 in-play HUD: the scene is the film. Letterbox bars hold the slate + leader countdown (top) and the subtitle (bottom).
   Under pressure the bars close in. Layers: canvas < paths < markers < bars/text < preroll < clip. */
.stage { --bt: 92px; --bb: 150px; }
@media (min-width: 900px) { .stage { --bt: 96px; --bb: 150px; } }
.stage > .pt-paths { z-index: 3; }
.stage > .pt-marks { z-index: 4; }
.stage > .pt-clip { z-index: 9; }
.hud { position: absolute; inset: 0; pointer-events: none; display: none; }
body[data-phase="play"] .hud, body[data-phase="reveal"] .hud { display: block; }

.hud__veil { position: absolute; inset: 0; z-index: 2; background: radial-gradient(130% 90% at 50% 50%, transparent 55%, rgba(0, 0, 0, .55) 100%); }
.hud__press { position: absolute; inset: 0; z-index: 2; opacity: 0; will-change: opacity; background: radial-gradient(120% 85% at 50% 50%, transparent 40%, rgba(170, 14, 20, .55) 100%); }
.pt-pressing .hud__press { opacity: var(--press-u, 0); }
.hud__flash { position: absolute; inset: 0; z-index: 7; background: #fff; opacity: 0; }
.hud__flash.is-on { animation: flash .42s ease-out; }
@keyframes flash { 0% { opacity: .55; } 100% { opacity: 0; } }

/* the letterbox bars */
.bar { position: absolute; left: 0; right: 0; z-index: 6; will-change: transform; transition: transform .5s var(--slow); }
.bar--t { top: 0; height: calc(var(--bt) + var(--sat)); transform-origin: top; background: linear-gradient(180deg, #000 0%, #000 78%, rgba(0, 0, 0, 0)); }
.bar--b { bottom: 0; height: calc(var(--bb) + var(--sab)); transform-origin: bottom; background: linear-gradient(0deg, #000 0%, #000 80%, rgba(0, 0, 0, 0)); }
.hud.is-pre .bar { transform: scaleY(1.9); }
.pt-pressing .bar { transition: none; }
.pt-pressing .bar--t { transform: scaleY(calc(1 + var(--press-u, 0) * .55)); }
.pt-pressing .bar--b { transform: scaleY(calc(1 + var(--press-u, 0) * .3)); }

/* top bar: the leader countdown + the slate */
.hud__top { position: absolute; z-index: 7; top: calc(var(--sat) + 14px); left: 14px; right: 64px; display: flex; align-items: center; gap: 12px; }
.slate { display: grid; gap: 3px; min-width: 0; }
.slate__scene { font: 600 11px/1 var(--cond); letter-spacing: .3em; text-transform: uppercase; color: var(--amber); }
.slate__who { font: italic 400 16px/1.2 var(--serif-text); color: var(--bone); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leader { position: relative; width: 58px; height: 58px; flex: none; display: grid; place-items: center; opacity: 0; transform: scale(.8); transition: opacity .3s, transform .4s var(--ease); }
.hud.is-choosing .leader, .hud.is-answered .leader { opacity: 1; transform: none; }
.leader svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; transform: rotate(-90deg); }
.leader__bg { fill: rgba(242, 237, 227, .08); stroke: rgba(242, 237, 227, .3); stroke-width: 1.2; }
.leader__cross { stroke: rgba(242, 237, 227, .22); stroke-width: 1; }
.leader__arc { fill: none; stroke: var(--amber); stroke-width: 3.4; stroke-dasharray: 100 100; stroke-dashoffset: 0; stroke-linecap: butt; }
.leader b { position: relative; font: 400 26px/1 var(--serif); color: var(--bone); font-variant-numeric: tabular-nums; }
.leader.is-low .leader__arc { stroke: #ff5a4e; }
.leader.is-low b { color: #ffb0a6; }
.leader.is-long b { font-size: 19px; }

/* bottom bar: the subtitle */
.hud__bottom { position: absolute; z-index: 7; left: 16px; right: 16px; bottom: calc(var(--sab) + 22px); display: grid; justify-items: center; gap: 8px; text-align: center; }
.sub { margin: 0; max-width: 22ch; font: 600 24px/1.22 var(--sans); color: var(--bone); text-shadow: 0 2px 10px #000, 0 0 2px #000; text-wrap: balance; }
.sub.is-say { animation: sub .5s var(--ease); }
@keyframes sub { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.sub.is-quiet { font: italic 400 22px/1.25 var(--serif-text); color: var(--bone-dim); }
.sub.is-good { color: var(--good); }
.sub.is-almost { color: var(--almost); }
.sub__hint { margin: 0; min-height: 14px; font: 600 11px/1.2 var(--cond); letter-spacing: .26em; text-transform: uppercase; color: var(--bone-dim); }
.sub__hint b { color: var(--amber); font-weight: 600; }
@media (min-width: 900px) { .sub { font-size: 28px; max-width: 32ch; } }

/* the presser off screen */
.threat { position: absolute; z-index: 5; top: 38%; height: 24%; width: 72px; opacity: 0; transition: opacity .25s; display: flex; align-items: center; }
.threat span { font: 700 10px/1.1 var(--cond); letter-spacing: .2em; text-transform: uppercase; color: #ffd6d0; text-shadow: 0 1px 6px #000; width: 60px; }
.threat--l { left: 0; padding-left: 6px; background: linear-gradient(90deg, rgba(220, 30, 30, .55), transparent); }
.threat--r { right: 0; justify-content: flex-end; text-align: right; padding-right: 6px; background: linear-gradient(270deg, rgba(220, 30, 30, .55), transparent); }
.threat--b { left: 20%; right: 20%; width: auto; top: auto; bottom: calc(var(--bb) + var(--sab) + 4px); height: 44px; justify-content: center; background: radial-gradient(60% 100% at 50% 100%, rgba(220, 30, 30, .5), transparent); }
.threat--b span { width: auto; }
.threat.is-on { opacity: 1; }

/* the pre-roll: a film leader counting 3, 2, 1 over the frozen first frame */
.preroll { position: absolute; inset: 0; z-index: 8; display: grid; place-content: center; justify-items: center; gap: 18px; background: rgba(5, 5, 5, .62); }
.preroll__dial { position: relative; width: 168px; height: 168px; display: grid; place-items: center; }
.preroll__dial svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.preroll__dial circle, .preroll__dial path { fill: none; stroke: rgba(242, 237, 227, .5); stroke-width: 1.4; }
.preroll__sweep { stroke: var(--amber) !important; stroke-width: 3 !important; transform-origin: 100px 100px; }
.preroll__sweep.is-go { animation: sweep .5s linear; }
@keyframes sweep { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.preroll__dial b { font: 400 92px/1 var(--serif); color: var(--bone); }
.preroll__dial b.is-pop { animation: pop .5s var(--ease); }
@keyframes pop { from { transform: scale(1.35); opacity: .2; } to { transform: none; opacity: 1; } }
.preroll__line { margin: 0; max-width: 26ch; text-align: center; font: italic 400 20px/1.35 var(--serif-text); color: var(--bone); text-wrap: balance; }
.preroll__line b { font-style: normal; color: var(--amber); }

/* ---- the markers: a soft focus pull into a glowing lens ---- */
.stage.is-placing .pt-mk { visibility: hidden; }
.v11-mk { position: relative; width: 60px; height: 60px; display: grid; place-items: center; animation: pull .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 90ms); }
@keyframes pull { from { opacity: 0; filter: blur(8px); transform: scale(1.6); } to { opacity: 1; filter: none; transform: none; } }
.v11-mk__core { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: rgba(5, 5, 5, .62); border: 2px solid var(--amber); color: var(--amber-hi); font: 400 25px/1 var(--serif); box-shadow: 0 0 22px -2px var(--amber-glow), 0 4px 14px rgba(0, 0, 0, .5); transition: background .25s, color .25s, border-color .25s, transform .3s var(--ease); }
.v11-mk__ring { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid var(--amber); opacity: 0; will-change: transform, opacity; animation: breathe 1.7s ease-out infinite; animation-delay: calc(.6s + var(--i, 0) * 220ms); }
@keyframes breathe { 0% { transform: scale(.8); opacity: .8; } 100% { transform: scale(1.45); opacity: 0; } }
.pt-mk:hover .v11-mk__core { background: var(--amber); color: #120c02; }
.pt-mk:active .v11-mk__core { transform: scale(.88); }
.pt-answered .v11-mk__ring { animation: none; opacity: 0; }
.pt-mk.is-pro .v11-mk__core { background: var(--good); border-color: var(--good); color: #06210c; transform: scale(1.12); box-shadow: 0 0 30px rgba(155, 227, 165, .65); }
.pt-mk.is-mine .v11-mk__core { background: var(--almost); border-color: var(--almost); color: #2a0602; }
.pt-mk.is-dim { opacity: .28; }
.pt-mk.is-pro .v11-mk::after { content: 'His call'; position: absolute; top: 100%; margin-top: 4px; white-space: nowrap; font: 700 10px/1 var(--cond); letter-spacing: .2em; text-transform: uppercase; color: var(--good); text-shadow: 0 1px 4px #000; }
.pt-mk.is-mine .v11-mk::after { content: 'You'; position: absolute; top: 100%; margin-top: 4px; font: 700 10px/1 var(--cond); letter-spacing: .2em; text-transform: uppercase; color: var(--almost); text-shadow: 0 1px 4px #000; }
.pt-mk[data-edge=l]::before { border-right-color: var(--amber); }
.pt-mk[data-edge=r]::before { border-left-color: var(--amber); }
.stage .pt-paths path { stroke: rgba(242, 181, 68, .8); stroke-width: 3; }
.stage .pt-paths path.is-pro { stroke: var(--good); }
.stage .pt-paths path.is-mine { stroke: var(--almost); }
.stage .pt-paths ellipse { fill: rgba(242, 181, 68, .22); }
.stage .pt-paths ellipse.is-pro { fill: rgba(155, 227, 165, .35); }
.stage .pt-paths ellipse.is-mine { fill: rgba(255, 138, 115, .3); }

/* ---- the reveal: the 3D stops drawing, the real footage plays in the letterbox ---- */
#stage.v11-reveal { visibility: hidden; }
#stage.v11-reveal > .pt-clip { visibility: visible; top: calc(var(--sat) + 84px); height: calc(100vw * .5625); max-height: 46vh; object-fit: cover; background: #000; }
@media (min-width: 900px) {
  #stage.v11-reveal > .pt-clip { top: calc(var(--sat) + 76px); height: calc(100vh - 76px - 300px); max-height: none; object-fit: contain; }
}
.rv { position: fixed; inset: 0; pointer-events: none; }
.rv__top { position: absolute; top: calc(var(--sat) + 18px); left: 16px; right: 64px; display: grid; gap: 4px; }
.rv__top .kicker { color: var(--amber); }
.rv__who { margin: 0; font: italic 400 17px/1.2 var(--serif-text); color: var(--bone); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv__rec { position: absolute; right: 0; top: 0; display: none; }
.rv__card { position: absolute; left: 0; right: 0; bottom: 0; top: calc(var(--sat) + 84px + min(56.25vw, 46vh) + 22px); padding: 0 16px calc(18px + var(--sab)); display: grid; grid-template-rows: auto auto auto 1fr; align-content: start; gap: 14px; justify-items: center; text-align: center; pointer-events: auto; }
.rv__card > .cta { align-self: end; }
.rv__verdict { margin: 0; font: 400 clamp(32px, 9vw, 52px)/1.04 var(--serif); text-wrap: balance; }
.rv__verdict.is-good em { color: var(--good); font-style: normal; }
.rv__verdict.is-almost em { color: var(--almost); font-style: normal; }
.times { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; width: 100%; max-width: 380px; background: var(--line); border: 1px solid var(--line); }
.times > div { background: var(--ink); padding: 10px 8px; display: grid; gap: 4px; }
.times small { font: 600 10px/1 var(--cond); letter-spacing: .24em; text-transform: uppercase; color: var(--bone-dim); }
.times b { font: 400 28px/1 var(--serif); font-variant-numeric: tabular-nums; }
.times .is-pro b { color: var(--amber); }
.times p { margin: 0; font-size: 12px; line-height: 1.3; color: var(--bone-dim); }
.rv__saw { margin: 0; max-width: 40ch; font: italic 400 16px/1.42 var(--serif-text); color: var(--bone-dim); text-wrap: balance; }
.rv__card .cta.is-pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 1px rgba(255, 210, 122, .5), 0 0 0 10px rgba(242, 181, 68, .16), 0 14px 40px -12px var(--amber-glow); } }
@media (min-width: 900px) {
  .rv__card { top: auto; grid-template-rows: none; padding-bottom: calc(26px + var(--sab)); }
  .rv__card > * { max-width: 720px; }
}
@media (max-width: 899px) and (max-height: 720px) { .rv__saw { display: none; } }
