/* Qruuk interactive demo. Builds on /styles.css (tokens, fonts, buttons).
   Layout: narration column on the left, a "counter" stage on the right with the
   merchant's phone and the customer's phone either side of it. Below 900px one
   phone at a time. */

:root {
  --red: #8A3B2E; --red-bg: #F7E9E5;
  --phone-w: 292px; --phone-h: 600px; /* drawn size; scaled by --k (set in demo.js) */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.2, 1.4, .4, 1);
}

body.demo-page { min-height: 100vh; display: flex; flex-direction: column; }
body.demo-page main { flex: 1; }
.demo-page header.site { position: sticky; }
[hidden] { display: none !important; }

/* ── intro: choose a scenario ─────────────────────────────────────── */
.d-intro { padding: 48px 0 80px; }
.d-intro .head { margin-bottom: 36px; }
.d-intro h1 { font-size: clamp(38px, 5.4vw, 64px); }
.d-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.d-choice { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 14px; padding: 24px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s; position: relative; overflow: hidden; }
.d-choice:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(29,28,23,.10); border-color: var(--green); }
.d-choice:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.d-choice .art { height: 132px; border-radius: 12px; background: var(--paper); border: 1px dashed var(--line); display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.d-choice .tag { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--green); }
.d-choice h3 { font-size: 22px; }
.d-choice p { color: var(--muted); font-size: 15.5px; }
.d-choice .meta { margin-top: auto; display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; padding-top: 6px; }
.d-choice .go { color: var(--green); font-weight: 600; font-family: var(--body); text-transform: none; letter-spacing: 0; font-size: 15px; }
@media (max-width: 900px) { .d-choices { grid-template-columns: 1fr; } }

/* mini art on the choice cards */
.mini-card { width: 150px; background: var(--card); border-radius: 10px; box-shadow: 0 8px 20px rgba(29,28,23,.14); padding: 10px 12px; transform: rotate(-5deg); transition: transform .4s var(--spring); }
.d-choice:hover .mini-card { transform: rotate(-1deg) scale(1.04); }
.mini-card .n { font-family: var(--display); font-weight: 700; font-size: 12px; margin-bottom: 7px; }
.mini-dots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.mini-dots i { aspect-ratio: 1; border-radius: 50%; border: 1.5px dashed var(--input); }
.mini-dots i.on { border: 0; background: var(--green); }
.mini-flood { position: absolute; right: 14px; bottom: 12px; font-family: var(--display); font-weight: 700; font-size: 11px; color: #fff; padding: 4px 8px; border-radius: 6px; transform: rotate(6deg); }
.mini-row { display: flex; gap: 6px; }
.mini-chip { font-family: var(--display); font-weight: 700; font-size: 10px; letter-spacing: .04em; padding: 3px 7px; border-radius: 5px; border: 2px solid currentColor; transform: rotate(-4deg); }

/* ── player shell ─────────────────────────────────────────────────── */
.d-player { padding: 20px 0 28px; }
.d-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; margin-bottom: 18px; }
.d-tabs { display: flex; gap: 6px; background: var(--wash); padding: 4px; border-radius: 12px; }
.d-tab { all: unset; cursor: pointer; padding: 8px 14px; border-radius: 9px; font-size: 14.5px; font-weight: 600; color: var(--muted); transition: background .2s, color .2s; }
.d-tab[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(29,28,23,.12); }
.d-tab:focus-visible { outline: 2px solid var(--green); }
.d-top .tools { display: flex; gap: 8px; }
.d-ghost { all: unset; cursor: pointer; font-size: 14px; color: var(--muted); padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); display: inline-flex; gap: 6px; align-items: center; }
.d-ghost:hover { color: var(--ink); }
.d-ghost:focus-visible { outline: 2px solid var(--green); }
@media (max-width: 640px) { .d-tab { padding: 7px 10px; font-size: 13.5px; } .d-top .tools .lbl { display: none; } }

.d-body { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 36px; align-items: start; }
@media (max-width: 1080px) { .d-body { grid-template-columns: 300px minmax(0, 1fr); gap: 24px; } }
@media (max-width: 900px) { .d-body { grid-template-columns: minmax(0, 1fr); gap: 14px; } }

/* narration */
.d-narr { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 18px; }
.d-chapters { display: flex; gap: 4px; }
.d-chapters button { all: unset; cursor: pointer; flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.d-chapters .bar { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; position: relative; }
.d-chapters .bar i { position: absolute; inset: 0; background: var(--green); transform-origin: left; transform: scaleX(0); transition: transform .5s var(--ease); }
.d-chapters .lbl { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-chapters button[aria-current="step"] .lbl { color: var(--green); }
.d-chapters button:focus-visible .bar { outline: 2px solid var(--green); outline-offset: 2px; }
.d-copy { display: flex; flex-direction: column; gap: 12px; min-height: 210px; }
.d-copy .eyebrow b { color: var(--green); font-weight: 500; }
.d-copy h2 { font-size: clamp(26px, 2.6vw, 34px); line-height: 1.1; }
.d-copy p { color: var(--muted); font-size: 16.5px; }
.d-copy .why { font-family: var(--mono); font-size: 12px; letter-spacing: .02em; color: var(--muted); border-left: 2px solid var(--green); padding: 2px 0 2px 10px; }
.d-copy.swap { animation: copyIn .45s var(--ease) both; }
@keyframes copyIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.d-ctrls { display: flex; gap: 10px; align-items: center; }
.d-ctrls .btn { height: 48px; }
.d-ctrls .btn-primary { flex: 1; justify-content: center; }
.d-back { all: unset; cursor: pointer; width: 48px; height: 48px; border-radius: 10px; border: 1px solid var(--input); background: var(--card); display: flex; align-items: center; justify-content: center; }
.d-back[disabled] { opacity: .35; cursor: default; }
.d-back:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.d-keys { font-size: 12.5px; color: var(--muted); }
.d-keys kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--card); }
@media (max-width: 900px) {
  .d-body > .d-narr { order: 2; }
  .demo-page header.site { position: static; }
  .demo-page header.site .wrap { height: 56px; }
  .d-top { margin-bottom: 10px; flex-wrap: nowrap; }
  .d-top [data-restart] { display: none; }
  .d-side .d-label { display: none; }
  .d-side { padding-bottom: 12px; }
  .d-stage::after { height: 44px; }
  .d-narr { position: static; gap: 12px; }
  .d-copy { min-height: 0; }
  .d-copy h2 { font-size: 24px; }
  .d-copy p { font-size: 15.5px; }
  .d-keys { display: none; }
  .d-ctrls { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
  .d-player { padding-bottom: 96px; }
}

/* stage */
.d-stage { --k: 1; position: relative; display: grid; grid-template-columns: calc(var(--phone-w) * var(--k)) minmax(100px, 1fr) calc(var(--phone-w) * var(--k)); align-items: end; gap: 0; padding: 14px 4px 0; }
.phone-box { width: calc(var(--phone-w) * var(--k)); height: calc(var(--phone-h) * var(--k)); display: flex; justify-content: center; }
.d-stage::after { content: ''; position: absolute; left: -12px; right: -12px; bottom: 0; height: 82px; border-radius: 14px; background: linear-gradient(180deg, #E8E1D1, #DDD4C1); box-shadow: inset 0 2px 0 rgba(255,255,255,.5); z-index: 0; }
.d-side { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 10px; padding-bottom: 26px; }
.d-label { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; max-width: 100%; white-space: nowrap; }
.d-label .d-who { overflow: hidden; text-overflow: ellipsis; }
.d-label .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--input); transition: background .3s; }
.d-side.active .d-label { color: var(--ink); }
.d-side.active .d-label .dot { background: var(--green); box-shadow: 0 0 0 4px rgba(53,94,59,.15); }
.d-mid { position: relative; z-index: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 34px; }
.d-signal { position: absolute; inset: 0; pointer-events: none; z-index: 5; overflow: visible; }
.d-pulse { position: absolute; left: 0; top: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 6px rgba(53,94,59,.18), 0 0 18px rgba(53,94,59,.5); }
.d-pulse.amber { background: var(--amber); box-shadow: 0 0 0 6px rgba(161,98,7,.18), 0 0 18px rgba(161,98,7,.5); }

@media (max-width: 900px) {
  .d-stage { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-top: 4px; }
  .d-stage::after { height: 60px; left: 0; right: 0; }
  .d-mid { display: none; }
  .d-side { display: none; padding-bottom: 18px; }
  .d-side.shown { display: flex; animation: copyIn .35s var(--ease) both; }
}
.d-switch { display: none; }
@media (max-width: 900px) {
  .d-switch { display: flex; justify-content: center; gap: 4px; background: var(--wash); padding: 4px; border-radius: 10px; align-self: center; margin: 0 auto 4px; width: max-content; }
  .d-switch button { all: unset; cursor: pointer; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 7px; color: var(--muted); position: relative; }
  .d-switch button[aria-pressed="true"] { background: var(--card); color: var(--ink); }
  .d-switch button .ping { position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
}

/* the counter card (printed QR) */
.d-counter { width: 124px; background: #fff; border-radius: 6px; padding: 12px 10px 10px; text-align: center; box-shadow: 0 10px 22px rgba(29,28,23,.22), 0 1px 0 rgba(0,0,0,.05); transform: rotate(-3deg); color: var(--ink); }
.d-counter .t { font-family: var(--display); font-weight: 700; font-size: 11.5px; line-height: 1.15; }
.d-counter .s { font-size: 9px; color: var(--muted); margin: 3px 0 6px; }
.d-counter svg { width: 100%; height: auto; }
.d-counter .p { font-size: 7.5px; color: var(--muted); margin-top: 5px; letter-spacing: .04em; }
.d-counter.printing { animation: print 1.1s var(--ease) both; }
@keyframes print { 0% { clip-path: inset(0 0 100% 0); transform: translateY(-30px) rotate(0deg); } 70% { clip-path: inset(0 0 0 0); transform: translateY(-6px) rotate(0deg); } 100% { clip-path: inset(0 0 0 0); transform: rotate(-3deg); } }

/* ── phone ────────────────────────────────────────────────────────── */
.phone { flex: none; width: var(--phone-w); height: var(--phone-h); transform: scale(var(--k)); transform-origin: top center; border-radius: 44px; background: #1D1C17; padding: 10px; box-shadow: 0 30px 60px rgba(29,28,23,.28), 0 2px 0 #000 inset, 0 0 0 1px rgba(255,255,255,.04) inset; position: relative; transition: transform .5s var(--ease); }
.phone::before { content: ''; position: absolute; top: 18px; left: 50%; width: 76px; height: 22px; margin-left: -38px; border-radius: 12px; background: #000; z-index: 20; }
.d-side:not(.active) .phone { transform: scale(calc(var(--k) * .965)); }
.screen-wrap { position: relative; width: 100%; height: 100%; border-radius: 34px; overflow: hidden; background: var(--paper); isolation: isolate; }
.scr { position: absolute; inset: 0; display: flex; flex-direction: column; font-size: 13px; line-height: 1.45; color: var(--ink); background: var(--paper); will-change: transform, opacity; }
.scr.enter { transform: translateX(100%); }
.scr.enter.back { transform: translateX(-30%); opacity: 0; }
.scr.in { transform: none; opacity: 1; transition: transform .5s var(--ease), opacity .5s var(--ease); }
.scr.leave { transition: transform .5s var(--ease), opacity .5s var(--ease); transform: translateX(-30%); opacity: 0; }
.scr.leave.back { transform: translateX(100%); opacity: 1; }
.scr.fade.enter { transform: none; opacity: 0; }
.scr.fade.leave { transform: none; opacity: 0; }

/* status bar + chrome */
.sb { height: 44px; flex: none; display: flex; align-items: flex-end; justify-content: space-between; padding: 0 24px 6px; font-size: 12px; font-weight: 600; }
.sb .ic { display: flex; gap: 4px; align-items: center; }
.sb .ic i { display: block; width: 15px; height: 9px; border: 1.5px solid currentColor; border-radius: 3px; position: relative; }
.sb .ic i::after { content: ''; position: absolute; inset: 1px 4px 1px 1px; background: currentColor; border-radius: 1px; }
.sb .ic b { width: 13px; height: 9px; background: linear-gradient(90deg, currentColor 20%, transparent 20% 30%, currentColor 30% 50%, transparent 50% 60%, currentColor 60% 80%, transparent 80% 90%, currentColor 90%); clip-path: polygon(0 100%, 100% 0, 100% 100%); }
.appbar { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 6px 16px 10px; }
.appbar .brand-s { display: flex; align-items: center; gap: 6px; font-family: var(--display); font-weight: 700; font-size: 15px; }
.appbar .me { width: 26px; height: 26px; border-radius: 50%; background: var(--green); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.url { flex: none; margin: 2px 12px 8px; height: 30px; border-radius: 9px; background: var(--wash); display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 11.5px; color: var(--muted); }
.url svg { width: 10px; height: 10px; }
.body { flex: 1; overflow: hidden; padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 10px; position: relative; }
.tabbar { flex: none; display: flex; justify-content: space-around; padding: 8px 6px 18px; border-top: 1px solid var(--line); background: var(--card); font-size: 9.5px; color: var(--muted); }
.tabbar span { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.tabbar span i { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid currentColor; }
.tabbar span.on { color: var(--green); font-weight: 600; }

/* app pieces */
.kick { font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.h { font-family: var(--display); font-weight: 700; font-size: 20px; line-height: 1.12; letter-spacing: -.01em; }
.hs { font-family: var(--display); font-weight: 700; font-size: 15px; }
.mut { color: var(--muted); }
.fld { display: flex; flex-direction: column; gap: 4px; }
.fld label { font-size: 11px; font-weight: 600; }
.inp { min-height: 34px; border: 1px solid var(--input); background: var(--card); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; display: flex; align-items: center; justify-content: space-between; }
.inp.multi { align-items: flex-start; min-height: 52px; }
.inp .ph { color: #A39E92; }
.caret::after { content: ''; display: inline-block; width: 1.5px; height: 13px; background: var(--green); margin-left: 1px; vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.pbtn { position: relative; height: 40px; border-radius: 9px; background: var(--green); color: #FFFDF8; font-weight: 600; font-size: 13.5px; display: flex; align-items: center; justify-content: center; gap: 6px; box-shadow: 0 2px 0 var(--green-dark); }
.pbtn.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--input); box-shadow: none; }
.pbtn.amber { background: var(--amber); box-shadow: 0 2px 0 #7A4A05; }
.chk { display: flex; gap: 7px; align-items: flex-start; font-size: 10.5px; color: var(--muted); line-height: 1.35; }
.chk i { flex: none; width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--input); background: var(--card); margin-top: 1px; position: relative; transition: background .2s, border-color .2s; }
.chk.on i { background: var(--green); border-color: var(--green); }
.chk.on i::after { content: ''; position: absolute; left: 4px; top: 1px; width: 3.5px; height: 7px; border: solid #fff; border-width: 0 1.8px 1.8px 0; transform: rotate(45deg); }
.paper { background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.ticket-c { background: var(--card); border-radius: 14px; box-shadow: 0 6px 18px rgba(29,28,23,.10); position: relative; }
.ticket-c .tp { padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 10px; }
.perf { position: relative; border-top: 2px dashed var(--line); margin: 0; }
.perf::before, .perf::after { content: ''; position: absolute; top: -9px; width: 16px; height: 16px; border-radius: 50%; background: var(--paper); }
.perf::before { left: -8px; } .perf::after { right: -8px; }
.ticket-c .bt { padding: 10px 14px 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.code { font-family: var(--mono); font-size: 10.5px; letter-spacing: .18em; color: var(--muted); }
.qr { width: 104px; height: 104px; }
.qr.sm { width: 74px; height: 74px; }
.sbadge { font-family: var(--display); font-weight: 700; font-size: 10px; letter-spacing: .06em; border: 2px solid currentColor; border-radius: 5px; padding: 1px 6px; transform: rotate(6deg); display: inline-block; }
.g { color: var(--green); } .a { color: var(--amber); } .r { color: var(--red); } .m { color: var(--muted); }
.stamps { display: grid; gap: 7px; }
.st { aspect-ratio: 1; border-radius: 50%; border: 1.8px dashed var(--input); display: flex; align-items: center; justify-content: center; }
.st.on { border: 0; background: var(--green); }
.st.on svg { width: 52%; height: 52%; }
.st.fresh { animation: thunk .7s var(--spring) both; }
@keyframes thunk { 0% { transform: scale(2.4) rotate(-16deg); opacity: 0; } 55% { transform: scale(.88) rotate(-1deg); opacity: 1; } 100% { transform: scale(1) rotate(-4deg); } }
.reward-box { background: var(--amber-bg); border: 1px solid #E7D5A8; border-radius: 10px; padding: 10px 12px; text-align: center; }
.reward-box .hs { color: var(--amber); }
.reward-box.pop { animation: pop .7s var(--spring) both; }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: none; opacity: 1; } }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rcpt { font-family: var(--mono); font-size: 10.5px; display: flex; flex-direction: column; }
.rcpt div { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.rcpt .new { animation: rowIn .6s var(--ease) both; background: linear-gradient(90deg, rgba(53,94,59,.10), transparent); }
@keyframes rowIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tile .pr { font-family: var(--mono); font-weight: 600; font-size: 12.5px; }
.list { display: flex; flex-direction: column; }
.list > div { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); gap: 8px; }
.ava { width: 26px; height: 26px; border-radius: 50%; background: var(--wash); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex: none; }
.pill { font-size: 9.5px; font-weight: 600; padding: 2px 7px; border-radius: 99px; background: rgba(53,94,59,.1); color: var(--green); white-space: nowrap; }
.pill.amb { background: var(--amber-bg); color: var(--amber); }
.big { font-family: var(--display); font-weight: 700; font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.strip > div { background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 8px; }
.strip .kick { font-size: 8px; margin-top: 4px; }
.seg { display: flex; background: var(--wash); border-radius: 9px; padding: 3px; font-size: 11px; font-weight: 600; }
.seg span { flex: 1; text-align: center; padding: 5px 0; border-radius: 7px; color: var(--muted); }
.seg span.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* hotspot: where the visitor should tap */
[data-act] { cursor: pointer; }
.hot { position: relative; }
.hot::after { content: ''; position: absolute; inset: -5px; border-radius: inherit; border: 2px solid var(--amber); animation: hot 1.6s var(--ease) infinite; pointer-events: none; }
.hot.round::after { border-radius: 14px; }
@keyframes hot { 0% { opacity: .9; transform: scale(.96); } 70% { opacity: 0; transform: scale(1.08); } 100% { opacity: 0; } }
.tap-hint { position: absolute; z-index: 15; pointer-events: none; font-size: 10.5px; font-weight: 600; color: #fff; background: var(--ink); padding: 4px 8px; border-radius: 6px; white-space: nowrap; transform: translate(-50%, -100%); margin-top: -10px; animation: copyIn .4s .2s var(--ease) both; }
.tap-hint::after { content: ''; position: absolute; left: 50%; bottom: -4px; width: 8px; height: 8px; margin-left: -4px; background: var(--ink); transform: rotate(45deg); }

/* camera */
.cam { flex: 1; background: radial-gradient(ellipse at 50% 40%, #5a564c, #22211d 75%); position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cam .frame { position: absolute; width: 62%; aspect-ratio: 1; left: 19%; top: 24%; }
.cam .frame i { position: absolute; width: 26px; height: 26px; border: 3px solid #fff; }
.cam .frame i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-radius: 8px 0 0 0; }
.cam .frame i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-radius: 0 8px 0 0; }
.cam .frame i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 8px; }
.cam .frame i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-radius: 0 0 8px 0; }
.cam .beam { position: absolute; left: 8%; right: 8%; height: 2px; background: #8FD19A; box-shadow: 0 0 12px #8FD19A; top: 10%; animation: beam 1.8s ease-in-out infinite alternate; }
@keyframes beam { to { top: 88%; } }
.cam .seen { transform: rotate(-4deg) scale(.95); filter: saturate(.9); }
.cam .seen.card { width: 58%; }
.cam .seen svg.qr { width: 100%; height: auto; display: block; border-radius: 4px; }
.cam .lnk { position: absolute; left: 12px; right: 12px; bottom: 26px; background: rgba(255,253,248,.96); border-radius: 12px; padding: 9px 12px; font-size: 11.5px; display: flex; gap: 8px; align-items: center; box-shadow: 0 8px 20px rgba(0,0,0,.3); animation: lnk .6s .5s var(--spring) both; }
@keyframes lnk { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
.cam .lnk b { display: block; font-size: 11.5px; }
.cam .lnk .ic { width: 26px; height: 26px; border-radius: 7px; background: var(--green); flex: none; display: flex; align-items: center; justify-content: center; color: #fff; font-family: var(--display); font-weight: 700; }
.cam .cap { position: absolute; top: 14px; left: 0; right: 0; text-align: center; color: rgba(255,255,255,.75); font-size: 11px; }

/* verdict flood (the real POS answer) */
.flood { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #FFFDF8; text-align: center; padding: 24px; z-index: 3; animation: flood .6s var(--ease) both; }
@keyframes flood { from { clip-path: circle(0% at 50% 85%); } to { clip-path: circle(150% at 50% 85%); } }
.flood.ok { background: var(--green); } .flood.amb { background: var(--amber); } .flood.no { background: var(--red); }
.vstamp { font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: .04em; padding: 6px 14px; border: 3px double currentColor; border-radius: 8px; transform: rotate(-6deg); animation: vthunk .7s .25s var(--spring) both; white-space: nowrap; }
@keyframes vthunk { 0% { transform: scale(2.2) rotate(-14deg); opacity: 0; } 60% { transform: scale(.94) rotate(-5deg); opacity: 1; } 100% { transform: rotate(-6deg); } }
.flood .vbig { font-family: var(--display); font-weight: 700; font-size: 44px; line-height: 1; font-variant-numeric: tabular-nums; }
.flood .vsub { font-size: 13px; opacity: .9; }
.flood .dots { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; max-width: 190px; }
.flood .dots i { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid rgba(255,253,248,.55); }
.flood .dots i.on { background: #FFFDF8; border: 0; }
.flood .foot { position: absolute; bottom: 22px; font-size: 10.5px; opacity: .75; }
.flood .acts { display: flex; flex-direction: column; gap: 7px; width: 100%; margin-top: 8px; }
.flood .pbtn { background: #FFFDF8; color: var(--amber); box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.flood .pbtn.ghost { background: transparent; color: #FFFDF8; border: 1px solid rgba(255,253,248,.5); }

/* notification banner */
.notif { position: absolute; left: 8px; right: 8px; top: 46px; z-index: 12; background: rgba(255,253,248,.97); border-radius: 16px; padding: 10px 12px; box-shadow: 0 10px 26px rgba(0,0,0,.18); display: flex; gap: 9px; animation: notif 4.2s var(--ease) .5s both; font-size: 11.5px; }
.notif .ic { width: 30px; height: 30px; border-radius: 8px; background: #3B6FD8; flex: none; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; }
.notif b { display: block; }
@keyframes notif { 0% { transform: translateY(-140%); opacity: 0; } 12% { transform: none; opacity: 1; } 85% { transform: none; opacity: 1; } 100% { transform: translateY(-140%); opacity: 0; } }

/* idle phone */
.idle { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: linear-gradient(160deg, #3d4a3e, #1f2721); color: #FFFDF8; text-align: center; }
.idle .clock { font-family: var(--display); font-weight: 600; font-size: 54px; line-height: 1; font-variant-numeric: tabular-nums; }
.idle .date { font-size: 13px; opacity: .8; }
.idle .note { position: absolute; bottom: 40px; font-size: 11px; opacity: .6; padding: 0 30px; }

/* payment sheet */
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 8; background: var(--card); border-radius: 20px 20px 0 0; padding: 14px 16px 22px; box-shadow: 0 -12px 30px rgba(0,0,0,.18); display: flex; flex-direction: column; gap: 10px; animation: sheet .55s var(--ease) both; }
@keyframes sheet { from { transform: translateY(100%); } to { transform: none; } }
.scrim { position: absolute; inset: 0; z-index: 7; background: rgba(29,28,23,.35); animation: fadeIn .4s both; }
@keyframes fadeIn { from { opacity: 0; } }
.cardnum { display: flex; gap: 8px; align-items: center; }
.cardnum .brandmark { width: 30px; height: 20px; border-radius: 4px; background: linear-gradient(135deg, #1a1f71, #2b3fa0); flex: none; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255,253,248,.4); border-top-color: #FFFDF8; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ff: "time passes" overlay */
.ff { position: absolute; inset: 0; z-index: 9; display: flex; align-items: center; justify-content: center; background: rgba(246,243,236,.9); font-family: var(--display); font-weight: 700; font-size: 17px; animation: ff 1.4s var(--ease) both; pointer-events: none; }
@keyframes ff { 0% { opacity: 0; } 20% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }

/* ── end screen ───────────────────────────────────────────────────── */
.d-end { padding: 56px 0 90px; }
.d-end .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.d-end h1 { font-size: clamp(34px, 4.6vw, 56px); }
.d-end ul { list-style: none; margin: 22px 0 28px; padding: 0; display: grid; gap: 12px; }
.d-end li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; font-size: 17px; animation: copyIn .5s var(--ease) both; }
.d-end li::before { content: ''; width: 22px; height: 22px; border-radius: 50%; background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFDF8' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/14px no-repeat; transform: rotate(-6deg); margin-top: 2px; }
.d-end .ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.d-end .next { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.d-end .next .tag { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--green); }
@media (max-width: 860px) { .d-end .wrap { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .cam .beam { display: none; }
}
