:root { --bg: #0b0b16; --card: #f5f7ff; --ink: #14122a; --dim: #6b6a8a; --pink: #00f2ea; --pink2: #9df7f3; --lav: #b58cff; --yellow: #ff5c8a; --line: rgba(20,18,42,.12); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; height: 100dvh; background: var(--bg); color: var(--ink); font-family: -apple-system, "Helvetica Neue", Inter, system-ui, sans-serif; overflow: hidden; }
#app { height: 100%; display: flex; align-items: center; justify-content: center; }
.phone { position: relative; width: min(100vw, calc(100vh * 9 / 16)); height: min(100vh, calc(100vw * 16 / 9)); width: min(100vw, calc(100dvh * 9 / 16)); height: min(100dvh, calc(100vw * 16 / 9)); overflow: hidden; background: #14122a; }
.cam { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); filter: saturate(.9); }
.scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.hidden { display: none !important; }

.hud { position: absolute; inset: 0; pointer-events: none; }
.hud-top { position: absolute; left: 16.7%; right: 16.7%; top: 12.5%; display: flex; justify-content: space-between; gap: 6px; } /* inside TikTok's core zone: x 65–325, y from 82 on a 390×694 canvas */
.hud-top > div { background: rgba(26,15,46,.55); backdrop-filter: blur(8px); border-radius: 14px; padding: 7px 10px; color: #fff; text-align: center; flex: 1; }
.hud-top b { display: block; font-size: 22px; line-height: 1; }
.hud-top span { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; opacity: .7; }
.judge { position: absolute; left: 0; right: 0; top: 46%; text-align: center; font-weight: 900; font-size: 34px; color: #fff; text-shadow: 0 2px 0 #0b0b16, 0 0 18px rgba(0,242,234,.7); opacity: 0; transform: scale(.8); transition: opacity .15s, transform .15s; }
.judge.show { opacity: 1; transform: scale(1); }
.eyes { position: absolute; left: 0; right: 0; top: 55%; display: flex; justify-content: center; gap: 14px; }
.phone:not(.practice) .eyes { display: none; } /* eye dots are a tap-practice aid; with the camera the sparkle on your face is the feedback */
.eye { width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.18); border: 2px solid rgba(255,255,255,.5); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; transition: background .08s, transform .08s; }
.eye.on { background: var(--pink); color: #0b0b16; transform: scale(1.15); border-color: #fff; }

.panel { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 22px; background: rgba(26,15,46,.35); }
.card { background: var(--card); border-radius: 22px; padding: 24px 22px; width: 100%; max-width: 360px; text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.kicker { font-size: 11px; letter-spacing: .3em; color: var(--pink); font-weight: 700; }
h1 { font-size: 30px; margin: 8px 0 8px; letter-spacing: -.01em; }
h2 { font-size: 24px; margin: 8px 0 8px; }
.card p { margin: 0 0 16px; color: var(--dim); font-size: 14px; line-height: 1.5; }
.card p b { color: var(--ink); }
.btn { display: block; width: 100%; background: var(--pink); color: #0b0b16; border: 0; border-radius: 14px; padding: 14px; font-size: 17px; font-weight: 700; cursor: pointer; }
.btn:active { transform: scale(.98); }
.link { background: none; border: 0; color: var(--dim); text-decoration: underline; font-size: 14px; margin-top: 12px; cursor: pointer; }
.tiny { font-size: 12px !important; margin: 10px 0 0 !important; }
.calib { margin: 8px 0 16px; text-align: left; }
.calib-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.calib-row i { width: 14px; height: 14px; border-radius: 50%; background: #ddd; }
.calib-row i.ok { background: #4ec9b0; }

.countdown { position: absolute; inset: 0 0 20% 0; display: flex; align-items: center; justify-content: center; font-size: 140px; font-weight: 900; color: #fff; text-shadow: 0 6px 0 #2a1740; pointer-events: none; }

.result .stats { display: flex; gap: 10px; margin: 6px 0 14px; }
.result .stats div { flex: 1; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 6px; }
.result .stats b { display: block; font-size: 22px; }
.result .stats span { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.faces { display: flex; gap: 12px; justify-content: center; margin-bottom: 16px; }
.faces div { text-align: center; }
.faces canvas { width: 120px; height: 150px; border-radius: 14px; background: #eee; display: block; border: 3px solid #fff; box-shadow: 0 6px 18px rgba(0,0,0,.15); }
.faces span { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); display: block; margin-top: 6px; }

.phone.setup .hud-top, .phone.setup .judge { display: none; }

.howto { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; color: #fff; background: rgba(26,15,46,.35); pointer-events: none; animation: howin .4s ease-out; }
.howto b { font-size: 22px; text-shadow: 0 2px 8px rgba(0,0,0,.4); }
.howto span { font-size: 13px; opacity: .8; max-width: 260px; line-height: 1.5; }
@keyframes howin { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
.result .big { margin: 6px 0 10px; }
.result .big b { display: block; font-size: 64px; line-height: 1; color: var(--pink); }
.result .big span { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.confetti { position: absolute; inset: 0; pointer-events: none; }

.resultlite { position: absolute; inset: 0; pointer-events: none; }
.phone.result { cursor: pointer; }
.rhead { position: absolute; left: 0; right: 0; top: 8%; text-align: center; color: #fff; text-shadow: 0 3px 0 #0b0b16, 0 0 24px rgba(0,242,234,.6); animation: howin .5s ease-out; }
.rhead b { display: block; font-size: 64px; line-height: 1; font-weight: 900; }
.rhead > span { display: block; font-size: 13px; letter-spacing: .22em; text-transform: uppercase; opacity: .9; margin-top: 6px; }
.rhead em { display: block; font-style: normal; font-size: 22px; font-weight: 800; margin-top: 6px; color: #ff5c8a; }
.rbtns { position: absolute; left: 17%; right: 17%; top: 52%; pointer-events: auto; display: flex; flex-direction: column; align-items: center; } /* web-only controls, kept inside the core zone */
.rbtns .link { color: rgba(255,255,255,.7); margin-top: 6px; font-size: 12px; }

.replay { width: 72px; height: 72px; border-radius: 50%; border: 3px solid #fff; background: rgba(26,15,46,.35); display: flex; align-items: center; justify-content: center; cursor: pointer; animation: howin .4s ease-out; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.replay:active { transform: scale(.94); }

.howto em { font-style: normal; margin-top: 18px; font-size: 15px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #00f2ea; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

.card.gate { padding: 26px 22px 20px; }
.card.gate svg { display: block; margin: 0 auto 6px; }
.card.gate h2 { margin: 6px 0 4px; }
.card.gate p { margin-bottom: 14px; }
.howto { justify-content: flex-start; padding-top: 34%; background: rgba(26,15,46,.22); }
.howto b { font-size: 20px; }
.phone.howto .hud-top { display: none; }

.band { position: absolute; left: 0; right: 0; top: var(--band-top, 82%); bottom: 0; background: rgba(11,11,22,.45); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
