:root {
  --brand: #0020a5; --brand-2: #253cc0; --violet: #4648d4;
  --night: #10183a; --night-2: #0a1029; --bezel: #17191f;
  --screen: #fbfbfd; --ink: #1a1d29; --muted: #5b6070; --line: #e4e6ee;
  --scam: #d22f27; --legit: #12804a; --miss: #8b90a0;
  --head: 'Plus Jakarta Sans', system-ui, sans-serif; --body: 'Inter', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--night-2); color: var(--ink); font: 15px/1.45 var(--body); -webkit-tap-highlight-color: transparent; }
#stage { position: relative; max-width: 540px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.screen { flex: 1; display: flex; flex-direction: column; min-height: 100dvh; }
.screen[hidden] { display: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #ffd54a; outline-offset: 2px; }
.small { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.rail-slot:empty, #intro-strip:empty, #best-line:empty { display: none; }

/* ---------- brand panels + buttons ---------- */
.panel { background: #fff; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; border-radius: 18px 18px 0 0; box-shadow: 0 -8px 24px rgba(0,0,0,.3); }
.btn { display: block; width: 100%; text-align: center; text-decoration: none; padding: 14px 16px; border-radius: 12px; border: 2px solid var(--brand); background: #fff; color: var(--brand); font: 700 16px/1.2 var(--head); cursor: pointer; transition: transform .08s; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 4px 0 #00137a; }
.btn-primary:active { box-shadow: 0 1px 0 #00137a; transform: translateY(3px); }
.btn-quiet { border-color: transparent; background: #eef0fb; color: var(--brand-2); font-size: 14px; padding: 10px; }
.row-btns { display: flex; gap: 8px; }

/* the night table everything sits on */
.scr-title, .scr-intro, .scr-play { background: radial-gradient(110% 70% at 50% 25%, #1d2a63 0%, var(--night) 55%, var(--night-2) 100%); }

/* ---------- title ---------- */
.title-art { flex: 1; display: grid; place-items: center; padding: 16px 16px 14px; }
.phone.mini { width: min(100%, 300px, calc((100dvh - 330px) * 0.95)); border-radius: 34px; padding: 34px 14px 26px; background: linear-gradient(170deg, #2c3a7a, #121b44 70%); border: 9px solid var(--bezel); box-shadow: 0 30px 50px rgba(0,0,0,.5), inset 0 0 0 1px rgba(255,255,255,.06); color: #fff; transform: rotate(-3deg); }
.lock-time { font: 800 54px/1 var(--head); text-align: center; letter-spacing: -0.02em; }
.lock-date { text-align: center; font-size: 13px; opacity: .8; margin: 4px 0 18px; }
.notif { background: rgba(255,255,255,.92); color: var(--ink); border-radius: 14px; padding: 9px 11px; margin-top: 8px; font-size: 12.5px; line-height: 1.35; position: relative; }
.notif b { display: block; font: 700 12px var(--body); color: var(--muted); margin-bottom: 1px; }
.mark-me { position: relative; font-weight: 600; white-space: nowrap; }
.mark-me .loop { position: absolute; }
.panel h1 { margin: 0; font: 800 34px/1.05 var(--head); color: var(--brand); letter-spacing: -0.02em; }
.goal { margin: 0 0 4px; font: 600 16px/1.4 var(--head); color: var(--ink); }

/* ---------- level card ---------- */
.intro-card { flex: 1; margin: 16px; color: #fff; display: flex; flex-direction: column; justify-content: center; }
.intro-last { margin: 0 0 14px; font-size: 14px; color: #c9d1f5; min-height: 1em; }
.intro-n { margin: 0; font: 700 14px var(--head); color: #9fb0ff; }
.intro-card h2 { margin: 4px 0 10px; font: 800 38px/1.05 var(--head); letter-spacing: -0.02em; }
.intro-line { margin: 0 0 18px; font-size: 17px; line-height: 1.45; color: #e7ebff; max-width: 34ch; }
.intro-tips { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.intro-tips li { background: rgba(255,255,255,.08); border-left: 3px solid #ffd54a; padding: 9px 12px; border-radius: 0 10px 10px 0; font-size: 14px; color: #f2f4ff; }

/* ---------- play ---------- */
.scr-play { flex: 0 0 100dvh; height: 100dvh; min-height: 0; overflow: hidden; }
/* play: fixed-height shell. Layout rules: docs/DESKTOP.md */
.hud { flex: none; }
.play-grid { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.play-side { display: flex; flex-direction: column; flex: none; }
/* the dock: reserved space under (phones) or beside (desktop) the phone; its panels swap in place */
.dock { position: relative; flex: none; height: clamp(196px, 31dvh, 270px); margin: 0 16px calc(10px + env(safe-area-inset-bottom)); }
.dk { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; }
.dk[hidden] { display: none !important; }
.dk-foot { display: flex; flex-direction: column; gap: 8px; }
.keys { display: none; margin: 0; font-size: 12.5px; color: #aeb8e6; text-align: center; }
.rv-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; outline: none; }
.rv-meta { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.rv-meta span:empty { display: none; }
.hud { display: flex; align-items: center; gap: 12px; padding: 8px 14px; color: #e9ecff; }
.hud-lvl { font: 700 14px var(--head); }
.hud-dots { display: flex; gap: 5px; flex: 1; justify-content: center; }
.hud-dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.22); }
.hud-dots i.now { background: #fff; }
.hud-dots i.ok { background: #46c483; }
.hud-dots i.no { background: #ff6b60; }
.hud-score { display: flex; align-items: center; gap: 6px; font: 800 18px var(--head); font-variant-numeric: tabular-nums; }
.streak { font: 700 12px var(--head); font-style: normal; padding: 2px 7px; border-radius: 99px; background: rgba(255,255,255,.14); color: #cfd6ff; }
.streak.hot { background: #ffcf3f; color: #3a2600; }
.streak.squash { animation: squash .35s; }
@keyframes squash { 30% { transform: scale(1.3, .6); } }
.streak.pulse { animation: pulse .4s; }
@keyframes pulse { 40% { transform: scale(1.35); } }

.table { position: relative; flex: 1; min-height: 0; display: flex; justify-content: center; padding: 2px 16px 10px; }
.phone { position: relative; width: 100%; max-width: 360px; display: flex; flex-direction: column; background: var(--screen); border: 9px solid var(--bezel); border-radius: 32px; overflow: hidden; box-shadow: 0 24px 50px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.07); }
.phone.shake { animation: shake .38s; }
@keyframes shake { 15% { transform: translateX(-9px) rotate(-1deg); } 35% { transform: translateX(8px) rotate(1deg); } 55% { transform: translateX(-5px); } 75% { transform: translateX(3px); } }
.status { display: flex; align-items: center; justify-content: space-between; padding: 6px 16px 4px; font: 600 12.5px var(--body); font-variant-numeric: tabular-nums; background: var(--screen); position: relative; z-index: 3; }
.notch { width: 74px; height: 18px; border-radius: 0 0 12px 12px; background: var(--bezel); position: absolute; left: 50%; top: 0; transform: translateX(-50%); }
.batt { display: flex; align-items: center; gap: 5px; }
.batt-body { width: 26px; height: 12px; border: 1.6px solid var(--ink); border-radius: 3px; padding: 1px; position: relative; display: block; }
.batt-body::after { content: ''; position: absolute; right: -4px; top: 3px; width: 2px; height: 4px; background: var(--ink); border-radius: 0 1px 1px 0; }
#batt-fill { display: block; height: 100%; width: 100%; background: var(--ink); border-radius: 1px; transition: width .2s linear; }
.batt.low { color: var(--scam); }
.batt.low #batt-fill { background: var(--scam); }
.batt.low .batt-body { border-color: var(--scam); }
.batt.hurt { animation: hurt .5s; }
@keyframes hurt { 30% { transform: scale(1.3); } }

.screen-area { position: relative; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; touch-action: pan-y; }
.msg { position: relative; min-height: 100%; will-change: transform; }
.drag-tag { position: absolute; top: 46px; padding: 6px 12px; border: 3px solid; border-radius: 8px; font: 800 22px var(--head); opacity: 0; pointer-events: none; z-index: 4; background: rgba(255,255,255,.9); }
.drag-tag.scam { right: 14px; color: var(--scam); transform: rotate(8deg); }
.drag-tag.legit { left: 14px; color: var(--legit); transform: rotate(-8deg); }
.verdict-chip { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); padding: 5px 12px; border-radius: 99px; font: 700 13px var(--head); color: #fff; z-index: 5; white-space: nowrap; box-shadow: 0 4px 10px rgba(0,0,0,.2); }
.verdict-chip.scam { background: var(--scam); }
.verdict-chip.legit { background: var(--legit); }

/* tappable pieces: identical look for every piece, so nothing leaks */
.t { border-radius: 4px; transition: background .15s; }
.phone.armed .t { cursor: pointer; background: rgba(0, 32, 165, .06); box-shadow: inset 0 -1.5px 0 rgba(0, 32, 165, .35); }
.phone.armed .t:hover, .phone.armed .t:focus-visible { background: rgba(255, 213, 74, .45); outline: none; }
.t.nudge { animation: nudge .35s; }
@keyframes nudge { 30% { transform: translateX(-3px); } 60% { transform: translateX(3px); } }
.loop { position: absolute; pointer-events: none; overflow: visible; z-index: 6; }
.loop path { fill: none; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.loop.scam path { stroke: var(--scam); }
.loop.legit path { stroke: var(--legit); }
.loop.miss path { stroke: var(--miss); stroke-width: 2.4; }
.mark-me .loop path { stroke-width: 3; }

/* shared bits inside the phone */
.av { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #c9cfe6; color: #2a3157; font: 700 15px var(--head); font-style: normal; flex: none; }
.bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.bar b { display: block; font: 700 15px var(--head); line-height: 1.2; }
.bar small { display: block; font-size: 12px; color: var(--muted); }
.bub { max-width: 88%; padding: 9px 12px; border-radius: 16px; font-size: 14.5px; line-height: 1.45; }
.bub p { margin: 0 0 6px; } .bub p:last-child { margin: 0; }

/* sms */
.k-sms .stamp { text-align: center; font-size: 11.5px; color: var(--muted); margin: 14px 0 8px; }
.k-sms .bub.in { background: #ebedf3; margin: 0 14px 20px; border-bottom-left-radius: 4px; }
/* chat */
.k-wa { background: #efe9df; min-height: 100%; }
.k-wa .bar { background: #1c5d55; color: #fff; border: 0; }
.k-wa .bar small { color: #cfe6e1; }
.k-wa .chat { display: flex; flex-direction: column; gap: 8px; padding: 14px 12px 24px; }
.k-wa .bub.in { background: #fff; align-self: flex-start; border-top-left-radius: 4px; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
/* email */
.k-mail .bar { font: 600 13px var(--body); color: var(--brand-2); }
.k-mail h3 { margin: 14px 16px 10px; font: 700 18px/1.3 var(--head); }
.k-mail .sender { display: flex; gap: 10px; align-items: center; padding: 0 16px 12px; border-bottom: 1px solid var(--line); }
.k-mail .sender b { display: block; font-size: 14px; }
.k-mail .sender small { font-size: 12.5px; color: var(--muted); }
.k-mail .mbody { padding: 12px 16px 24px; font-size: 14.5px; }
.k-mail .mbody p { margin: 0 0 10px; }
/* upi */
.k-upi { text-align: center; padding-bottom: 20px; }
.k-upi .bar { background: #3b2a8c; color: #fff; border: 0; justify-content: space-between; }
.k-upi .bar small { color: #d6cffd; }
.u-title { margin: 14px 0 10px; font: 600 13px var(--body); color: var(--muted); }
.av.big { width: 52px; height: 52px; font-size: 22px; background: #ded8fb; color: #3b2a8c; }
.u-who { margin: 8px 16px 2px; font: 700 18px var(--head); }
.u-vpa { margin: 0 16px; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; }
.valid-badge { display: inline-flex; align-items: center; gap: 4px; color: #14894b; font-weight: 700; font-size: 12px; }
.valid-badge svg { width: 17px; height: 16px; }
.u-tag { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
.u-amt { margin: 12px 0 6px; font: 800 38px var(--head); letter-spacing: -0.02em; }
.u-note { margin: 4px 22px; font-size: 14px; background: #f2f1f8; padding: 8px 10px; border-radius: 10px; }
.u-cta { margin: 16px 18px 0; padding: 13px 12px; border-radius: 12px; background: #3b2a8c; color: #fff; font: 700 15px var(--head); text-align: center; }
.u-cta .t { box-shadow: none !important; }
.phone.armed .u-cta .t { background: rgba(255,255,255,.14); }
/* call */
.k-call { min-height: 100%; background: linear-gradient(180deg, #24304f, #121828); color: #fff; padding: 16px 16px 22px; display: flex; flex-direction: column; }
.c-state { margin: 4px 0 0; text-align: center; font-size: 12px; color: #aab4d8; }
.c-num { margin: 6px 0 2px; text-align: center; font: 700 22px var(--head); }
.c-meta { margin: 0 0 14px; text-align: center; font-size: 13px; color: #cdd5f3; }
.c-lines p { background: rgba(255,255,255,.1); border-radius: 14px; border-top-left-radius: 4px; padding: 9px 12px; margin: 0 0 8px; font-size: 14.5px; }
.c-btns { margin-top: auto; padding-top: 14px; display: flex; justify-content: center; gap: 22px; }
.c-btns i { width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.15); }
.c-btns i.end { background: #e04a3f; }
.phone.armed .k-call .t { background: rgba(255,255,255,.08); box-shadow: inset 0 -1.5px 0 rgba(255,255,255,.4); }
/* channel */
.k-tg { background: #dfe8ef; min-height: 100%; }
.k-tg .bar { background: #fff; }
.k-tg .post { background: #fff; margin: 14px 12px 24px; padding: 11px 13px 22px; border-radius: 14px; border-bottom-left-radius: 4px; font-size: 14.5px; position: relative; }
.k-tg .post p { margin: 0 0 8px; }
.k-tg .views { position: absolute; right: 10px; bottom: 5px; font-size: 11px; color: var(--muted); }
/* app */
.k-app { padding-bottom: 20px; }
.k-app .bar { background: #0f6e8c; color: #fff; border: 0; }
.a-meta { margin: 12px 16px 10px; font-size: 13px; color: var(--muted); }
.a-card { margin: 0 14px 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; font-size: 14.5px; }
.k-app .u-cta { background: #0f6e8c; }

/* controls under the phone */
.prompt { margin: 0; padding-top: 4px; text-align: center; color: #e7ebff; font: 600 14.5px var(--head); min-height: 1.4em; }
.prompt.tut { color: #ffd54a; }
.vbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 380px; margin: 0 auto; }
.vbtns[hidden] { display: none; }
.vbtn { padding: 15px 10px; border-radius: 14px; border: 0; font: 800 18px var(--head); cursor: pointer; color: #fff; transition: transform .08s; }
.vbtn:active { transform: scale(.96); }
.vbtn.scam { background: var(--scam); box-shadow: 0 4px 0 #8f1b15; }
.vbtn.legit { background: var(--legit); box-shadow: 0 4px 0 #0a5631; }
.vbtn:disabled { opacity: .3; cursor: default; }
.vbtn.guide { animation: guide 1.1s infinite; }
@keyframes guide { 50% { box-shadow: 0 4px 0 #8f1b15, 0 0 0 6px rgba(255, 213, 74, .6); } }
.arr { opacity: .75; }

/* reveal: swaps in for the controls inside the dock */
.sheet { background: #fff; border-radius: 16px; padding: 12px 14px; box-shadow: 0 -6px 30px rgba(0,0,0,.35); animation: fadein .2s ease-out; }
@keyframes fadein { from { opacity: 0; } }
.res { margin: 0 0 4px; font: 600 16px var(--head); }
.res .ok { color: var(--legit); } .res .no { color: var(--scam); }
.why { margin: 0 0 8px; font-size: 15px; line-height: 1.45; }
.src { font-size: 11.5px; line-height: 1.35; color: var(--muted); }

.pops { position: absolute; inset: 0; pointer-events: none; z-index: 8; }
.pop { position: absolute; transform: translate(-50%, 0); font: 800 24px var(--head); color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,.5); animation: rise .95s ease-out forwards; white-space: nowrap; }
.pop.proof { color: #ffd54a; }
.pop.bad { color: #ff8a80; font-size: 18px; }
@keyframes rise { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.7); } 20% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -44px) scale(1); } }

/* ---------- end ---------- */
body:has(#scr-end:not([hidden])) { background: #f4f5fb; }
.scr-end { background: #f4f5fb; padding-bottom: 96px; }
.report { padding: 22px 16px 8px; }
.rep-head { margin: 0; font: 600 13px var(--body); color: var(--muted); }
.report h2 { margin: 2px 0 14px; font: 800 32px/1.1 var(--head); color: var(--brand); letter-spacing: -0.02em; }
.end-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.end-stats div { background: #fff; border-radius: 12px; padding: 10px; border: 1px solid var(--line); }
.end-stats b { display: block; font: 800 24px var(--head); font-variant-numeric: tabular-nums; }
.end-stats span { font-size: 12px; color: var(--muted); }
#end-best:empty { display: none; }
.end-grid { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.gl { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; font-size: 14px; }
.marks { display: flex; gap: 5px; }
.mk { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; }
.mk.pf { background: var(--legit); box-shadow: 0 0 0 2px #ffd54a inset; }
.mk.ok { background: var(--legit); }
.mk.no { background: var(--scam); }
.legend { margin: 8px 0 0; font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.end-promo { padding: 8px 16px 0; }
.end-promo:empty { display: none; }
.end-panel h3 { margin: 8px 0 8px; font: 700 16px var(--head); }
.missed { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.missed li { background: #fff; border-left: 4px solid var(--scam); border-radius: 0 10px 10px 0; padding: 9px 12px; }
.missed.real li { border-left-color: var(--legit); }
.missed b { display: block; font-size: 14.5px; }
.missed span { font-size: 13.5px; color: #3a3f50; }
.clean { background: #e8f6ee; padding: 12px; border-radius: 10px; margin: 0; }
.best-stamp { display: inline-block; margin: 2px 0 10px; padding: 4px 12px; border: 3px solid var(--violet); color: var(--violet); font: 800 18px var(--head); border-radius: 8px; transform: rotate(-4deg); }
/* phones: Share / Play again live in a fixed bottom bar, always in reach */
.end-actions { position: fixed; z-index: 5; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%, 540px); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: #fff; box-shadow: 0 -6px 18px rgba(16, 24, 58, .14); }
.end-actions .small { margin: 6px 0 0; max-height: 3em; overflow: hidden; text-align: center; }
.end-actions .small:empty { display: none; }

/* ---------- tablets: the same single column ---------- */
@media (min-width: 600px) and (max-width: 1023px) {
  #stage { max-width: 600px; }
  .end-actions { width: min(100%, 600px); }
  .dock { height: clamp(210px, 26dvh, 280px); }
}

/* ---------- desktop (1024+): phone left, dock + promo rail right ---------- */
@media (min-width: 1024px) {
  #stage { max-width: none; }
  .scr-title, .scr-intro, .scr-play { background-attachment: fixed; }
  .scr-play { --side: 340px; --pw: min(420px, calc((100dvh - 80px) * 0.6)); padding: 8px 24px 16px; }
  .hud { width: calc(var(--pw) + 32px + var(--side)); margin: 0 auto; padding: 8px 0; }
  .play-grid { display: grid; grid-template-columns: var(--pw) var(--side); gap: 32px; justify-content: center; align-items: stretch; }
  .table { padding: 0; min-height: 0; }
  .phone { max-width: none; }
  .play-side { gap: 12px; min-height: 0; }
  .dock { flex: 1 1 auto; height: auto; min-height: 0; margin: 0; }
  .controls { padding: 16px; border-radius: 16px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); }
  .prompt { text-align: left; font-size: 16px; }
  .sheet { padding: 16px; }
  .scr-title, .scr-intro { flex-direction: row; align-items: center; justify-content: center; gap: 56px; padding: 24px; }
  .title-art { flex: 0 1 420px; }
  .phone.mini { width: min(320px, calc((100dvh - 120px) * 0.62)); }
  .intro-card { flex: 0 1 520px; margin: 0; }
  .scr-title .panel, .scr-intro .panel { flex: 0 0 360px; border-radius: 18px; }
  .scr-end {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas: "left panel" "actions panel" ". panel"; gap: 0 32px; height: 100dvh; min-height: 0; padding: 24px; max-width: 1120px; margin: 0 auto; width: 100%;
  }
  .end-left { grid-area: left; }
  .report { padding: 0; }
  .end-promo { padding: 12px 0 0; }
  .end-actions { grid-area: actions; position: static; transform: none; width: auto; padding: 12px 0 0; background: none; box-shadow: none; }
  .end-panel { grid-area: panel; min-height: 0; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
}
@media (min-width: 1024px) and (hover: hover) { .keys { display: block; text-align: left; } }
@media (min-width: 1280px) { .scr-play { --side: 360px; } }

.nomotion *, .nomotion *::before, .nomotion *::after { animation: none !important; transition: none !important; }
