@font-face { font-family: "Montserrat"; font-weight: 500; font-display: swap; src: url("/fonts/montserrat-cyrillic-500.woff2") format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Montserrat"; font-weight: 500; font-display: swap; src: url("/fonts/montserrat-latin-500.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2212; }
@font-face { font-family: "Montserrat"; font-weight: 500; font-display: swap; src: url("/fonts/montserrat-latin-ext-500.woff2") format("woff2"); unicode-range: U+20A0-20C0; }
@font-face { font-family: "Montserrat"; font-weight: 700; font-display: swap; src: url("/fonts/montserrat-cyrillic-700.woff2") format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Montserrat"; font-weight: 700; font-display: swap; src: url("/fonts/montserrat-latin-700.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2212; }
@font-face { font-family: "Montserrat"; font-weight: 700; font-display: swap; src: url("/fonts/montserrat-latin-ext-700.woff2") format("woff2"); unicode-range: U+20A0-20C0; }
@font-face { font-family: "Montserrat"; font-weight: 900; font-display: swap; src: url("/fonts/montserrat-cyrillic-900.woff2") format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Montserrat"; font-weight: 900; font-display: swap; src: url("/fonts/montserrat-latin-900.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2212; }
@font-face { font-family: "Montserrat"; font-weight: 900; font-display: swap; src: url("/fonts/montserrat-latin-ext-900.woff2") format("woff2"); unicode-range: U+20A0-20C0; }

:root {
  --bg: #FFFFFF; --ink: #0F1B3D; --muted: #6A748C; --line: #E4E9F2; --fill: #F3F5FA;
  --blue: #1546B5; --blue-soft: #E9EFFC; --green: #17935F; --green-soft: #E4F5EC; --red: #D93A3F; --red-soft: #FCEAEA;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
html { scrollbar-gutter: stable; } /* место под полосу прокрутки занято всегда: экран не прыгает между короткими и длинными страницами */
body { font: 500 16px/1.45 "Montserrat", -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
/* Фон: лёгкая решётка сот, как на стойках зоны, и несколько залитых сот в правом верхнем углу. */
body::before, body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background-position: top right; }
body::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='45' height='78' viewBox='0 0 45 78'%3E%3Cpath d='M22.5 0L45 13V39L22.5 52L0 39V13Z M22.5 52V78' fill='none' stroke='%231546B5' stroke-opacity='.09'/%3E%3C/svg%3E");
  -webkit-mask-image: linear-gradient(180deg, #000 0, rgba(0,0,0,.5) 60%, rgba(0,0,0,.3)); mask-image: linear-gradient(180deg, #000 0, rgba(0,0,0,.5) 60%, rgba(0,0,0,.3)); }
body::after { background-repeat: no-repeat; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='156' viewBox='0 0 180 156'%3E%3Cg fill='%231546B5'%3E%3Cpath d='M157.5 0l22.5 13v26l-22.5 13-22.5-13V13z' fill-opacity='.09'/%3E%3Cpath d='M112.5 0l22.5 13v26l-22.5 13L90 39V13z' fill-opacity='.04'/%3E%3Cpath d='M180 39l22.5 13v26L180 91l-22.5-13V52z' fill-opacity='.15'/%3E%3Cpath d='M135 39l22.5 13v26L135 91l-22.5-13V52z' fill-opacity='.06'/%3E%3Cpath d='M157.5 78l22.5 13v26l-22.5 13-22.5-13V91z' fill-opacity='.04'/%3E%3C/g%3E%3C/svg%3E"); }

#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; gap: 16px;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom)); }
#app.in { animation: in .22s ease-out; }
/* Только прозрачность: сдвиг на пару пикселей вытягивал страницу, и на миг появлялась полоса прокрутки. */
@keyframes in { from { opacity: 0; } }
h1 { font-weight: 700; font-size: 26px; line-height: 1.15; margin: 0; letter-spacing: -0.02em; text-wrap: balance; }
h2 { font-weight: 700; font-size: 18px; line-height: 1.25; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
b { font-weight: 700; }
.muted, .soft { color: var(--muted); }
.small { font-size: 14px; }
.label { font-size: 13px; font-weight: 700; color: var(--muted); padding: 0 4px; }
.grow { flex: 1; }
.center { text-align: center; align-items: center; }
.col { display: flex; flex-direction: column; gap: 12px; }
.tight { gap: 6px; }
.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
svg { display: block; flex: none; }

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
.btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 54px; padding: 12px 20px;
  border-radius: 16px; font-weight: 700; font-size: 16px; background: var(--blue); color: #fff; transition: transform .12s, opacity .12s; }
.btn:active { transform: scale(0.98); opacity: .9; }
.btn.soft { background: var(--blue-soft); color: var(--blue); }
.btn.plain { background: none; color: var(--blue); min-height: 44px; }
.btn[disabled] { opacity: .5; }
.link { color: var(--muted); font-size: 14px; padding: 8px 4px; }
.back { width: 40px; height: 40px; border-radius: 50%; background: var(--fill); color: var(--ink); display: grid; place-items: center; flex: none; }
.bar { min-height: 40px; }
.bar .title { font-weight: 700; font-size: 15px; }

.card, .panel { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.note { font-size: 13px; color: var(--muted); }
.duck { margin: 0 auto; background: center/contain no-repeat; flex: none; }

/* вход */
.field { display: flex; align-items: center; gap: 10px; background: var(--fill); border-radius: 16px; padding: 0 16px; min-height: 56px; border: 1px solid transparent; transition: border-color .15s, background .15s; }
.field:focus-within { border-color: var(--blue); background: #fff; }
.field input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: 500 17px "Montserrat", sans-serif; color: var(--ink); padding: 16px 0; }
.field input::placeholder { color: #9AA3B8; }
.flag { width: 24px; height: 17px; border-radius: 4px; flex: none; box-shadow: 0 0 0 1px rgba(0,0,0,.08);
  background: linear-gradient(#fff 33.3%, #0039A6 33.3% 66.6%, #D52B1E 66.6%); }
.prefix { font-size: 17px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 13px; color: var(--muted); text-align: left; padding: 4px; }
.check input { appearance: none; -webkit-appearance: none; flex: none; width: 22px; height: 22px; margin: 0; border-radius: 7px; background: #fff; border: 1.5px solid #C3CBDC; }
.check input:checked { border-color: var(--blue); background: var(--blue) center/14px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3L13 4.8' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.error { background: var(--red-soft); color: #9E2327; border-radius: 14px; padding: 12px 14px; font-size: 14px; }

/* главная */
.hero { flex-direction: row; align-items: center; justify-content: space-between; padding: 18px 16px 18px 20px; }
.hero .n { font-weight: 700; font-size: 48px; line-height: 1; letter-spacing: -0.03em; }
.list { padding: 0; gap: 0; overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; min-height: 68px; padding: 12px 12px 12px 14px; position: relative; transition: background .12s; }
.item:active { background: var(--fill); }
.item + .item::before { content: ""; position: absolute; left: 62px; right: 0; top: 0; border-top: 1px solid var(--line); }
.item .name { font-weight: 700; font-size: 16px; display: block; }
.item .sub { font-size: 13px; color: var(--muted); display: block; }
.item .gain { font-size: 13px; color: var(--muted); white-space: nowrap; }
.item.done .gain { color: var(--ink); font-weight: 700; }
.item > svg:last-child { color: #B4BCCD; }

/* зона */
.steps { padding: 4px 16px; gap: 0; }
.step { display: flex; gap: 12px; align-items: center; padding: 12px 0; font-size: 15px; }
.step + .step { border-top: 1px solid var(--line); }
.step i { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--fill); color: var(--muted); font: 700 13px "Montserrat", sans-serif; display: grid; place-items: center; }
.step.ok { color: var(--muted); }
.step.ok i { background: var(--green-soft); color: var(--green); }
.ticket { background: var(--c); color: var(--i); border-radius: 20px; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ticket.white { border: 1px solid var(--line); }
.ticket .num { font-weight: 700; font-size: 26px; line-height: 1.1; letter-spacing: -0.01em; }
.pill { border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 13px; background: rgba(15, 27, 61, .1); white-space: nowrap; }
.plus { font-weight: 700; font-size: 34px; line-height: 1.1; letter-spacing: -0.02em; color: var(--blue); }
.reasons { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.reasons li { padding-left: 20px; position: relative; }
.reasons li::before { content: ""; position: absolute; left: 3px; top: .55em; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
.toggle { flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; font-size: 15px; }
.toggle input { appearance: none; -webkit-appearance: none; flex: none; margin: 0; width: 50px; height: 30px; border-radius: 15px; background: #D5DBE8; position: relative; transition: background .18s; }
.toggle input::after { content: ""; position: absolute; left: 2px; top: 2px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15,27,61,.25); transition: transform .18s; }
.toggle input:checked { background: var(--blue); }
.toggle input:checked::after { transform: translateX(20px); }

.lvl { align-items: flex-start; }
.lvl i { margin-top: 1px; box-shadow: inset 0 0 0 1.5px #CBD3E3; background: #fff; }
.lvl.ok i { box-shadow: none; }
.lvl small { display: block; font-size: 13px; line-height: 1.35; color: var(--muted); margin-top: 2px; }
.lvl.ok { color: var(--ink); }
.pts { font-weight: 700; color: var(--blue); white-space: nowrap; }
a.btn { text-decoration: none; }
a.ext { color: var(--blue); font-weight: 700; text-decoration: none; white-space: nowrap; }
a.ext span { font-weight: 500; margin-left: 2px; }
a.ext .tg { display: inline-block; vertical-align: -2px; margin-right: 3px; }
.place.gold { background: linear-gradient(145deg, #FFE27A, #E9A915); color: #5C4300; }
.place.silver { background: linear-gradient(145deg, #F1F4F8, #B4BDCB); color: #3D4758; }
.place.bronze { background: linear-gradient(145deg, #F2C29A, #C0763A); color: #4A2508; }
.prize-row { align-items: flex-start; }
.prize-row .place { margin-top: 2px; }
.info { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-left: 4px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font: 700 12px "Montserrat", sans-serif; vertical-align: 2px; }
.prize-row .sub { margin-top: 4px; }
.prize-row .sub[hidden] { display: none; }
.admin-only { background: #FFF8E1; border-color: #F1D98A; }
.admin-only .note { color: #8A6A00; }
.admin-only b:last-child { white-space: nowrap; }
.place { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--fill); color: var(--muted); font: 700 14px "Montserrat", sans-serif; display: grid; place-items: center; }
.item.me { background: var(--blue-soft); }
.item.me .place { background: var(--blue); color: #fff; }
div.item:active { background: none; }
div.item.me:active { background: var(--blue-soft); }
.prize { font-weight: 700; font-size: 24px; line-height: 1.15; letter-spacing: -0.02em; position: relative; }

/* игра со свайпами */
.progress { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; flex: 1; }
.progress i { display: block; height: 100%; background: var(--blue); border-radius: 2px; transition: width .25s; }
.deck { position: relative; flex: 1; min-height: 400px; touch-action: none; user-select: none; -webkit-user-select: none; }
.swipe { position: absolute; inset: 0; border-radius: 26px; overflow: hidden; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(15, 27, 61, .12); will-change: transform; cursor: grab; transition: transform .38s cubic-bezier(.2, .8, .2, 1); }
.swipe.under { transform: scale(.94) translateY(12px); }
.half { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px 10px 12px; font-weight: 700; font-size: 17px; line-height: 1.28; transition: background .18s, color .18s, opacity .18s; }
.half + .half { border-top: 1px solid var(--line); }
.half .txt { padding: 2px 8px 0; }
.half .dir { display: flex; align-items: center; gap: 6px; padding: 0 8px; font-size: 13px; font-weight: 500; color: var(--muted); }
.half.b { text-align: right; }
.half.b .dir { justify-content: flex-end; }
.swipe.left .half.a, .swipe.right .half.b { background: var(--blue); color: #fff; }
.swipe.left .half.a .dir, .swipe.right .half.b .dir { color: rgba(255,255,255,.8); }
.swipe.left .half.b, .swipe.right .half.a { opacity: .35; }

/* картинки */
.art { position: relative; border-radius: 16px; overflow: hidden; flex: 1; min-height: 64px; pointer-events: none; }
.art svg, .art img { position: absolute; inset: 0; width: 100%; height: 100%; }
.art img { object-fit: cover; }
.trip { padding: 0; gap: 0; overflow: hidden; }
.trip .art { flex: none; height: 156px; border-radius: 0; }
.trip .body { padding: 16px; }

/* что делать после игры */
.cta { position: relative; overflow: hidden; border-radius: 24px; padding: 20px 18px 18px; display: flex; flex-direction: column; gap: 12px; color: #fff;
  background: linear-gradient(140deg, #1B52CC 0%, #1546B5 45%, #0E338F 100%); box-shadow: 0 14px 32px rgba(21, 70, 181, .28); }
.cta .deco { position: absolute; right: -14px; top: -10px; opacity: .22; }
.cta-title { font-weight: 700; font-size: 19px; letter-spacing: -0.01em; padding-right: 70px; position: relative; }
.cta-step { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.35; position: relative; }
.cta-step i { flex: none; width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,.18); font: 700 13px "Montserrat", sans-serif; display: grid; place-items: center; }
.btn.white { background: #fff; color: var(--blue); margin-top: 4px; }

/* квиз */
.opt { width: 100%; text-align: left; min-height: 58px; padding: 14px 16px; border-radius: 16px; font-size: 16px; background: #fff; border: 1px solid var(--line); transition: transform .12s, background .15s, border-color .15s; }
.opt:active { transform: scale(0.985); }
.opt.right { background: var(--green-soft); border-color: var(--green); color: #0C6B44; font-weight: 700; }
.opt.wrong { background: var(--red-soft); border-color: var(--red); color: #9E2327; }
.opt.dim { opacity: .5; }

/* сканер */
#overlay { position: fixed; inset: 0; z-index: 10; background: #060B1F; color: #fff; display: flex; flex-direction: column; }
#overlay[hidden] { display: none; }
#overlay video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-ui { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(32px + env(safe-area-inset-bottom)); text-align: center; }
.scan-ui .close { align-self: flex-end; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.18); color: #fff; display: grid; place-items: center; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.frame { width: min(68vw, 280px); aspect-ratio: 1; border-radius: 28px; box-shadow: 0 0 0 100vmax rgba(6, 11, 31, .6), inset 0 0 0 3px #fff; }
.scan-ui .hint { font-weight: 700; max-width: 300px; text-shadow: 0 1px 8px rgba(0,0,0,.5); }

@media (min-width: 700px) { #app { padding-top: 40px; } }
