:root {
  --bg: #080808; --ink: #f4f4ef; --dim: rgba(244,244,239,.62); --line: rgba(244,244,239,.16);
  --y: #F7E733; --mag: #FF2BD6; --cy: #19F0FF;
  --f: Geologica, 'Helvetica Neue', Arial, sans-serif;
}
* { box-sizing: border-box; margin: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: var(--bg); color: var(--ink); font-family: var(--f); overscroll-behavior: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
button:focus-visible, input:focus-visible, label:focus-visible { outline: 3px solid var(--cy); outline-offset: 3px; }
#app { position: fixed; inset: 0; overflow: hidden; max-width: 560px; margin: 0 auto; }

.screen { position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity .35s; display: flex; flex-direction: column; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.screen.active { opacity: 1; pointer-events: auto; }

/* ---------- главная ---------- */
#heroDots { position: absolute; inset: 0; width: 100%; height: 100%; }
.top { position: relative; display: flex; justify-content: space-between; align-items: flex-start; padding: 22px 22px 0; }
.logo { font-weight: 800; font-size: 15px; line-height: 1.05; letter-spacing: .04em; }
.logo i { display: inline-block; width: .68em; height: .68em; border-radius: 50%; background: var(--y); margin: 0 .04em; }
.dates { font-weight: 800; font-size: 34px; line-height: 1; text-align: right; color: var(--y); }
.dates small { display: block; font-size: 13px; font-weight: 400; color: var(--dim); margin-top: 6px; }
.home-body { position: relative; margin-top: auto; padding: 90px 20px 22px; background: linear-gradient(to bottom, rgba(8,8,8,0), rgba(8,8,8,.94) 34%); }
h1 { font-size: clamp(40px, 12.5vw, 62px); line-height: .98; font-weight: 800; letter-spacing: -.02em; }
.lead { margin: 14px 0 20px; font-size: 16px; line-height: 1.45; color: var(--dim); max-width: 34ch; }
.cards { display: grid; gap: 12px; }
.card { position: relative; display: flex; align-items: stretch; gap: 14px; text-align: left; border-radius: 26px; padding: 10px; background: rgba(20,20,20,.82); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: transform .2s, border-color .2s; }
.card:active { transform: scale(.98); }
.card .thumb { width: 84px; flex: none; aspect-ratio: 9/14; border-radius: 18px; background-size: cover; background-position: center; border: 1px solid var(--line); }
.card .txt { display: flex; flex-direction: column; justify-content: center; flex: 1; gap: 6px; }
.card b { font-size: 21px; font-weight: 800; line-height: 1.1; }
.card span { font-size: 14px; color: var(--dim); line-height: 1.35; }
.card .go { align-self: center; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--y); margin-right: 6px; }
.card .go svg, .arr svg { width: 20px; height: 20px; stroke: #080808; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.card.y { border-color: rgba(247,231,51,.55); }
.card.c { border-color: rgba(255,43,214,.6); box-shadow: 0 0 36px -12px var(--mag); }
.card.c .go { background: linear-gradient(135deg, var(--mag), var(--cy)); }
.foot { margin-top: 16px; font-size: 13px; color: var(--dim); text-align: center; }
.foot a { color: var(--y); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; padding: 8px 2px; }
.foot a:focus-visible { outline: 3px solid var(--cy); outline-offset: 2px; border-radius: 4px; }

/* ---------- камера ---------- */
#live { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.cam-top { position: relative; display: flex; justify-content: space-between; align-items: center; padding: 14px 14px 0; z-index: 2; }
.icon { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: rgba(8,8,8,.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid var(--line); }
.icon svg { width: 22px; height: 22px; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chip { padding: 11px 16px; border-radius: 999px; font-size: 14px; font-weight: 500; background: rgba(8,8,8,.6); border: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.chip[aria-pressed="true"] { background: var(--y); color: #080808; border-color: var(--y); }
.hint { position: relative; z-index: 2; margin: 14px auto 0; padding: 10px 16px; max-width: 86%; text-align: center; font-size: 14px; border-radius: 16px; background: rgba(8,8,8,.62); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: opacity .4s; }
.hint.off { opacity: 0; }
.banner-pick { position: relative; z-index: 2; margin-top: auto; display: flex; gap: 8px; justify-content: center; padding: 0 14px 10px; }
.banner-pick button { width: 44px; height: 70px; border-radius: 12px; background-size: cover; background-position: center; border: 2px solid transparent; opacity: .75; }
.banner-pick button[aria-pressed="true"] { border-color: var(--y); opacity: 1; }
.cam-bottom { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 6px 20px 26px; }
.shutter { width: 84px; height: 84px; border-radius: 50%; border: 4px solid var(--y); display: grid; place-items: center; background: rgba(8,8,8,.35); transition: transform .15s; }
.shutter i { width: 62px; height: 62px; border-radius: 50%; background: var(--y); transition: transform .15s; }
.shutter:active i { transform: scale(.86); }
.upload { font-size: 13px; color: var(--dim); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.count { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; font-size: 220px; font-weight: 800; color: var(--y); text-shadow: 0 0 60px rgba(247,231,51,.6); pointer-events: none; }
.count.pop { animation: pop .9s ease-out; }
@keyframes pop { from { transform: scale(1.5); opacity: 0; } 25% { opacity: 1; } to { transform: scale(.8); opacity: 0; } }
.flash { position: absolute; inset: 0; z-index: 4; background: #fff; opacity: 0; pointer-events: none; }
.flash.go { animation: fl .45s ease-out; }
@keyframes fl { from { opacity: .95; } to { opacity: 0; } }

/* ---------- обработка ---------- */
#procDots { position: absolute; inset: 0; width: 100%; height: 100%; }
.proc-text { position: relative; margin-top: auto; padding: 0 22px 40px; }
.proc-text h2 { font-size: 36px; font-weight: 800; letter-spacing: -.01em; }
.proc-text p { margin-top: 8px; color: var(--dim); font-size: 16px; min-height: 1.4em; }

/* ---------- результат ---------- */
.stage { position: relative; flex: 1; min-height: 0; margin: 14px 16px 0; border-radius: 22px; overflow: hidden; background: #111; display: grid; place-items: center; }
.stage img, .stage canvas, .stage video { max-width: 100%; max-height: 100%; width: auto; height: 100%; aspect-ratio: 9/16; object-fit: contain; }
#stage img { position: absolute; inset: 0; margin: auto; }
#resBefore { clip-path: inset(0 0 0 0); }
.compare-handle { position: absolute; top: 0; bottom: 0; width: 3px; background: var(--y); box-shadow: 0 0 14px var(--y); pointer-events: none; }
#cmp { position: relative; margin: 10px 28px 0; accent-color: var(--y); }
.actions { padding: 14px 16px 18px; display: grid; gap: 10px; }
.pill { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 8px 8px 8px 24px; height: 62px; border-radius: 999px; font-size: 18px; font-weight: 600; }
.pill.primary { background: var(--y); color: #080808; }
.pill.reel { border: 2px solid transparent; background: linear-gradient(#0c0c0c,#0c0c0c) padding-box, linear-gradient(100deg, var(--mag), var(--cy)) border-box; }
.pill .arr { width: 46px; height: 46px; border-radius: 50%; background: #080808; display: grid; place-items: center; }
.pill.primary .arr svg { stroke: var(--y); }
.pill.reel .arr { background: linear-gradient(135deg, var(--mag), var(--cy)); }
.pill:disabled { opacity: .45; }
.pill:active { transform: scale(.985); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row2:has(button:only-child) { grid-template-columns: 1fr; }
.ghost { height: 48px; border-radius: 999px; border: 1px solid var(--line); font-size: 15px; color: var(--dim); }
.tag { text-align: center; font-size: 13px; color: var(--dim); }
.tag b { color: var(--y); font-weight: 600; }
.reel-status { text-align: center; font-size: 15px; color: var(--dim); }

.toast { position: absolute; left: 50%; bottom: 110px; transform: translate(-50%, 20px); max-width: 88%; padding: 12px 18px; border-radius: 16px; background: #fff; color: #080808; font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: .3s; z-index: 9; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* маленькие экраны (iPhone SE) */
@media (max-height: 700px) { h1 { font-size: 38px; } .lead { display: none; } .card .thumb { width: 60px; } }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01s !important; transition-duration: .01s !important; } }

.arr::after { content: ''; width: 20px; height: 20px; background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F7E733' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17L17 7M8 7h9v9'/%3E%3C/svg%3E"); }
.pill.reel .arr::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23080808' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17L17 7M8 7h9v9'/%3E%3C/svg%3E"); }

/* ---------- пауза между снимками ---------- */
#lockDots { position: absolute; inset: 0; width: 100%; height: 100%; }
.lock-body { position: relative; margin-top: auto; padding: 90px 22px 26px; background: linear-gradient(to bottom, rgba(8,8,8,0), rgba(8,8,8,.94) 30%); }
.lock-body h2 { font-size: clamp(34px, 10vw, 52px); font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.lock-body .lead { margin: 12px 0 6px; }
.clock { font-size: clamp(64px, 22vw, 108px); font-weight: 800; line-height: 1; color: var(--y); font-variant-numeric: tabular-nums; margin-bottom: 22px; }
.lock-body .ghost { width: 100%; }
.actions .row2[hidden] { display: none; }

[hidden] { display: none !important; }
