/* Телефон: тот же зин — чёрная бумага, кость, розовый и кислотный; кнопки крупные, под большой палец */
:root {
  --bg: #0e0c0f; --paper: #19161a; --ink: #120e13; --bone: #efe7d6; --muted: #9a919c; --pink: #ff2e88; --lime: #c4ff3a; --blue: #8fb3ff;
  --display: "Rubik Distressed", Impact, system-ui, sans-serif;
  --body: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hand: "Caveat", "Comic Sans MS", cursive;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
img:not([src]) { visibility: hidden; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--bone); font: 17px/1.45 var(--body);
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  background-image: radial-gradient(circle, rgba(239,231,214,.05) 1px, transparent 1.4px); background-size: 7px 7px;
  overscroll-behavior: none;
}
button, input { font: inherit; color: inherit; }
.hidden { display: none !important; }

.bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 0 10px; min-height: 60px; }
.brand { font: 400 22px/1 var(--display); }
.tv-link { display: none; text-align: center; }
@media (min-width: 900px) and (pointer: fine) { .tv-link { display: block; } }
.bar .brand { flex: 1 1 auto; min-width: 0; }
.bar:has(.me) .brand { font-size: 26px; }
.brand em { font-style: normal; color: var(--pink); }
.me { display: flex; align-items: center; gap: 8px; font: 600 15px/1 var(--body); flex: 0 0 auto; }
.me .nm { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .sc { white-space: nowrap; font: 700 14px/1 var(--mono); color: var(--ink); background: var(--lime); padding: 5px 7px; }
.me img { width: 34px; height: 36px; object-fit: cover; object-position: top; }
.remote-btn { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 1.5px solid var(--bone); padding: 7px 10px; font: 600 14px/1 var(--body); cursor: pointer; }

.view { display: grid; gap: 18px; padding: 8px 0 20px; max-width: 520px; margin: 0 auto; }
.view.center { min-height: 60dvh; align-content: center; text-align: center; }
.who-tag { display: inline-block; margin-top: 10px; font: 700 22px/1 var(--hand); color: var(--ink); background: var(--pink); padding: 5px 12px 2px; transform: rotate(-2deg); }
.kicker { font: 700 13px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--lime); margin: 0; }
h1, h2 { margin: 0; font-weight: 400; font-family: var(--display); line-height: .95; }
h1 { font-size: 52px; }
h2 { font-size: 38px; }
h1 em, h2 em { font-style: normal; color: var(--pink); }
.lead { margin: 0; font: 600 19px/1.35 var(--body); text-wrap: balance; }
.muted { color: var(--muted); margin: 0; }
.hand { font: 700 26px/1.1 var(--hand); color: var(--lime); }
label { display: block; font: 700 13px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.field {
  width: 100%; background: var(--paper); border: 2px solid var(--bone); padding: 14px 16px; font: 600 22px/1.2 var(--body); outline: none; border-radius: 0;
}
.field:focus { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(196,255,58,.25); }
.field.code { font: 700 30px/1 var(--mono); letter-spacing: .3em; text-transform: uppercase; text-align: center; }
.err { background: var(--pink); color: var(--ink); padding: 12px 14px; font-weight: 600; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 58px; padding: 14px 20px; cursor: pointer;
  background: var(--bone); color: var(--ink); border: 0; font: 400 26px/1 var(--display); transform: rotate(-.6deg);
  box-shadow: 5px 6px 0 rgba(0,0,0,.6); transition: transform .12s, box-shadow .12s;
}
.btn:active { transform: translate(3px, 4px) rotate(-.6deg); box-shadow: 1px 2px 0 rgba(0,0,0,.6); }
.btn.pink { background: var(--pink); }
.btn.lime { background: var(--lime); }
.btn.ghost { background: transparent; color: var(--bone); border: 2px solid var(--bone); box-shadow: none; font: 600 17px/1 var(--body); transform: none; min-height: 50px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn:focus-visible, .opt:focus-visible, .pick:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }
.linkish { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 10px; font-size: 15px; justify-self: center; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

/* выбор пола */
.genders { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.gender { position: relative; display: grid; justify-items: center; gap: 8px; padding: 20px 10px 18px; background: var(--paper); border: 2px solid var(--bone); cursor: pointer; }
.gender b { font: 400 30px/1 var(--display); }
.gender span { font: 700 20px/1 var(--hand); color: var(--muted); }
.gender img { height: 200px; width: auto; }
.gender:nth-child(1) { transform: rotate(-1deg); } .gender:nth-child(2) { transform: rotate(1deg); }

/* тест */
.progress { display: flex; gap: 6px; }
.progress i { flex: 1; height: 8px; border: 2px solid var(--bone); transform: skewX(-12deg); }
.progress i.on { background: var(--lime); border-color: var(--lime); }

/* кнопки ответов */
.opts { display: grid; gap: 12px; }
.opt {
  position: relative; display: grid; grid-template-columns: 54px 1fr; align-items: center; gap: 14px; text-align: left; cursor: pointer;
  padding: 12px 14px 12px 10px; min-height: 76px; background: var(--paper); border: 2.5px solid var(--bone); font: 700 20px/1.15 var(--body);
  transition: transform .15s, background .15s, opacity .2s;
}
.opt .key { width: 54px; height: 54px; display: grid; place-items: center; font: 400 36px/1 var(--display); color: var(--ink); }
.opt small { display: block; margin-top: 4px; font: 700 18px/1.1 var(--hand); color: var(--muted); }
.opt.a .key { background: var(--bone); } .opt.b .key { background: var(--pink); } .opt.c .key { background: var(--lime); } .opt.d .key { background: var(--blue); }
.opt:active { transform: scale(.98); }
.opt.sel { border-color: var(--lime); box-shadow: 0 0 0 3px var(--lime); background: #232b10; }
.opt.sel::after { content: "твой выбор"; position: absolute; right: 8px; top: -12px; font: 400 15px/1 var(--display); color: var(--ink); background: var(--lime); padding: 4px 7px 1px; transform: rotate(3deg); }
.opt.dim { opacity: .45; }
.opt.right { border-color: var(--lime); box-shadow: 0 0 0 3px var(--lime); }
.opts.photos { grid-template-columns: 1fr 1fr; }
.opt.photo { grid-template-columns: 1fr; padding: 6px; min-height: 0; }
.opt.photo img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.opt.photo .key { position: absolute; left: -6px; top: -8px; width: 42px; height: 42px; font-size: 28px; border: 2px solid var(--ink); transform: rotate(-8deg); }

/* «Кто из нас» */
.picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pick { position: relative; display: grid; justify-items: center; gap: 4px; padding: 8px 4px 10px; background: var(--paper); border: 2px solid rgba(239,231,214,.35); cursor: pointer; }
.pick img { width: 72px; aspect-ratio: 1 / 1.05; object-fit: cover; }
.pick span { font: 700 18px/1 var(--hand); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick.sel { border-color: var(--lime); box-shadow: 0 0 0 3px var(--lime); background: #232b10; }

/* камера */
.cam { position: relative; width: 100%; aspect-ratio: 3 / 4; background: #000; overflow: hidden; border: 2px solid var(--bone); }
.cam video, .cam img.shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam video { transform: scaleX(-1); }
.cam .oval {
  position: absolute; left: 19%; width: 62%; aspect-ratio: .84; top: 50%; transform: translateY(-54%); border-radius: 50%;
  box-shadow: 0 0 0 2000px rgba(14,11,15,.62); border: 3px dashed var(--lime); pointer-events: none;
}
.cam canvas.adj { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; }
.cam canvas.adj:active { cursor: grabbing; }
.adj-actions { display: grid; gap: 12px; }
.adj-row { display: flex; align-items: center; gap: 14px; }
.adj-pv { width: 112px; height: 118px; object-fit: contain; flex: none; background: rgba(239,231,214,.06); border: 1.5px solid rgba(239,231,214,.25); }
.adj-ctl { flex: 1; display: grid; gap: 6px; font: 700 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.adj-ctl input { width: 100%; accent-color: var(--lime); height: 28px; }
.cam .msg { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--muted); }
.cam .tip { position: absolute; left: 0; right: 0; bottom: 12px; text-align: center; font: 700 22px/1 var(--hand); color: var(--lime); text-shadow: 0 2px 0 var(--ink); pointer-events: none; }
.shutter { width: 84px; height: 84px; border-radius: 50%; border: 5px solid var(--bone); background: var(--pink); justify-self: center; cursor: pointer; box-shadow: 0 0 0 5px var(--ink); flex: none; }
.shutter:active { transform: scale(.94); }
/* селфи влезает в экран без скролла: кадр ужимается по высоте, кнопка снимка — внутри кадра */
.view.selfie { gap: 12px; }
.view.selfie .cam { width: min(100%, calc((100dvh - 230px) * .75)); justify-self: center; }
.view.selfie.adjusting .cam { width: min(100%, calc((100dvh - 330px) * .75)); }
.view.selfie.adjusting #skip { display: none; }
.cam .tip.top { top: 12px; bottom: auto; }
.shutter.in-cam { position: absolute; left: 50%; bottom: 16px; margin-left: -38px; width: 76px; height: 76px; z-index: 2; }
.adj-pv { width: 96px; height: 100px; }
.pause-ov { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; background: rgba(14,11,15,.86); text-align: center; }
.pause-ov > div { display: grid; gap: 14px; justify-items: center; }
.pause-ov b { font: 400 64px/1 var(--display); color: var(--ink); background: var(--lime); padding: 12px 22px 2px; transform: rotate(-3deg); }
.pause-ov .btn { min-width: 220px; }
.flash { position: fixed; inset: 0; background: #fff; z-index: 99; animation: flash .45s ease-out forwards; pointer-events: none; }
@keyframes flash { to { opacity: 0; } }

/* подбор образа */
.deal { display: grid; gap: 22px; justify-items: center; text-align: center; padding-top: 6dvh; }
.deal .scan { position: relative; width: 220px; height: 260px; border: 3px solid var(--bone); overflow: hidden; background: var(--paper); }
.deal .scan img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.5); }
.deal .scan::after { content: ""; position: absolute; left: 0; right: 0; height: 30%; background: linear-gradient(180deg, transparent, rgba(196,255,58,.55), transparent); animation: scan 1.1s ease-in-out infinite alternate; }
@keyframes scan { from { top: -30%; } to { top: 100%; } }
.deal .line { font: 700 18px/1 var(--mono); color: var(--lime); min-height: 1em; }
.deal .bar2 { width: 240px; height: 14px; border: 2px solid var(--bone); transform: skewX(-12deg); overflow: hidden; }
.deal .bar2 i { display: block; height: 100%; width: 0; background: var(--pink); transition: width .6s ease; }

/* карточка образа */
.look { position: relative; display: grid; justify-items: center; gap: 6px; text-align: center; }
.look .fig { height: min(56dvh, 460px); display: block; filter: drop-shadow(0 12px 14px rgba(0,0,0,.6)); }
@media (prefers-reduced-motion: no-preference) { .look.reveal .fig { animation: drop .9s cubic-bezier(.2,1.3,.4,1) both; } @keyframes drop { from { transform: translateY(-60px) rotate(-8deg) scale(.7); opacity: 0; } } }
.look .tagline { font: 400 30px/1 var(--display); color: var(--ink); background: var(--lime); padding: 8px 14px 2px; transform: rotate(-2deg); margin-top: -40px; position: relative; }
.look .name { font: 700 30px/1 var(--hand); }

/* в игре */
.card { background: var(--bone); color: var(--ink); padding: 20px 20px 22px; transform: rotate(-.6deg); box-shadow: 6px 8px 0 rgba(0,0,0,.6); }
.card .k { font: 700 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--pink); }
.card h2 { margin: 8px 0 8px; font-size: 34px; }
.card p { margin: 0; font: 600 18px/1.35 var(--body); }
.irl { background: var(--lime); color: var(--ink); padding: 16px 18px 18px; transform: rotate(.8deg); box-shadow: 6px 8px 0 rgba(0,0,0,.6); }
.irl .k { font: 700 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.irl h3 { margin: 6px 0 4px; font: 400 30px/1 var(--display); }
.irl p { margin: 0; font: 600 18px/1.3 var(--body); }
/* рейд проигран — телефон вожака становится табличкой для фото «в участке» */
.mugsign { background: #111; color: #f4f1ea; border: 3px solid #f4f1ea; outline: 6px solid #111; padding: 18px 14px 14px; text-align: center; display: grid; gap: 8px; }
.mugsign b { font: 400 54px/1 var(--display); letter-spacing: .04em; }
.mugsign span { font: 700 15px/1.2 var(--mono); letter-spacing: .08em; }
.mugsign small { font: 600 13px/1.2 var(--body); opacity: .6; }
.leader-badge { display: inline-block; justify-self: start; font: 400 20px/1 var(--display); color: var(--ink); background: var(--lime); padding: 6px 10px 2px; transform: rotate(-2deg); }
.big-note { font: 700 30px/1.15 var(--hand); color: var(--lime); text-align: center; margin: 0; }
.watch { display: grid; gap: 10px; justify-items: center; text-align: center; padding: 6dvh 0 2dvh; }
.watch .eye { font: 400 60px/1 var(--display); }
.score-big { font: 400 72px/1 var(--display); color: var(--lime); }
.result-pill { font: 400 44px/1 var(--display); padding: 10px 18px 4px; transform: rotate(-3deg); justify-self: center; }
.result-pill.win { background: var(--lime); color: var(--ink); }
.result-pill.lose { background: var(--paper); color: var(--muted); border: 2px solid var(--muted); }
.geo-line { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; background: var(--bone); color: var(--ink); padding: 14px 10px 10px; font: 700 30px/1 var(--mono); transform: rotate(-1deg); }
.geo-line .h { opacity: .25; }
.timer-line { height: 8px; background: rgba(239,231,214,.2); position: relative; overflow: hidden; }
.timer-line i { position: absolute; inset: 0 auto 0 0; background: var(--lime); }

.tap {
  width: min(78vw, 320px); aspect-ratio: 1; border-radius: 50%; justify-self: center; border: 6px solid var(--bone); background: var(--pink); color: var(--ink);
  font: 400 64px/1 var(--display); cursor: pointer; box-shadow: 0 10px 0 #8a1550, 0 0 0 8px var(--ink); touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.tap:active { transform: translateY(6px); box-shadow: 0 4px 0 #8a1550, 0 0 0 8px var(--ink); }
.tap[disabled] { background: var(--paper); color: var(--muted); box-shadow: none; }
.tapcount { text-align: center; font: 700 22px/1 var(--mono); }
.tapcount b { color: var(--lime); font-size: 34px; }

/* паспорт */
.passport { background: var(--bone); color: var(--ink); padding: 18px; transform: rotate(-.8deg); box-shadow: 8px 10px 0 rgba(0,0,0,.6); display: grid; gap: 12px; }
.passport .top { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px dashed rgba(18,14,19,.35); padding-bottom: 8px; }
.passport .top b { font: 400 26px/1 var(--display); }
.passport .top span { font: 700 12px/1 var(--mono); letter-spacing: .1em; }
.passport .body { display: grid; grid-template-columns: 130px 1fr; gap: 14px; align-items: end; }
.passport .body img { width: 130px; display: block; }
.passport dl { margin: 0; display: grid; gap: 8px; }
.passport dt { font: 700 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #6b636d; }
.passport dd { margin: 2px 0 0; font: 700 20px/1.1 var(--body); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badges span { font: 700 14px/1 var(--body); padding: 6px 8px; background: var(--ink); color: var(--lime); transform: rotate(-1.5deg); }
.badges span:nth-child(2n) { background: var(--pink); color: var(--ink); transform: rotate(1.5deg); }
.save-sheet { position: fixed; inset: 0; background: rgba(0,0,0,.88); z-index: 80; display: grid; place-items: center; padding: 20px; }
.save-sheet .in { display: grid; gap: 14px; max-width: 420px; text-align: center; }
.save-sheet img { width: 100%; height: auto; display: block; border: 2px solid var(--bone); }

/* пульт */
.vip-next { position: sticky; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 20; }
.remote { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 70; display: flex; align-items: flex-end; }
.remote-card { width: 100%; background: var(--paper); border-top: 3px solid var(--lime); padding: 18px 16px calc(22px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 10px; }
.remote-head { display: flex; justify-content: space-between; align-items: center; }
.danger { border-color: var(--pink) !important; color: var(--pink) !important; }
.offline { position: fixed; left: 50%; top: 10px; transform: translateX(-50%); background: var(--pink); color: var(--ink); font: 700 14px/1 var(--body); padding: 9px 14px; z-index: 90; white-space: nowrap; }
.dots::after { content: ""; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* реакции — капсула внизу, пока на телефоне нечего нажимать; эмодзи летят на ТВ к своему портрету */
.reacts { position: fixed; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: flex; gap: 2px; padding: 5px 8px; border-radius: 32px; background: rgba(22,17,24,.9); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1.5px solid rgba(239,231,214,.22); box-shadow: 0 10px 30px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.06); z-index: 40; transition: transform .3s cubic-bezier(.3,1.3,.5,1), opacity .25s; }
.reacts.off { opacity: 0; pointer-events: none; transform: translate(-50%, 130%); }
.reacts button img { display: block; height: 34px; width: auto; margin: 0 auto; pointer-events: none; filter: drop-shadow(1px 2px 0 rgba(0,0,0,.5)); }
.reacts button { width: 48px; height: 48px; border-radius: 50%; font-size: 28px; line-height: 1; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; transition: background .15s, transform .1s; }
.reacts button:active { background: rgba(255,47,146,.22); transform: scale(.88); }
.reacts button.pop { animation: rpop .3s cubic-bezier(.3,1.8,.5,1); }
@keyframes rpop { 50% { transform: scale(1.35) rotate(-12deg); } }
.react-fly img { display: block; height: 40px; width: auto; }
.react-fly { position: fixed; z-index: 41; font-size: 30px; line-height: 1; pointer-events: none; animation: rfly .9s ease-out forwards; }
@keyframes rfly { 0% { transform: translate(-50%, -50%) scale(.6); opacity: 1; } 100% { transform: translate(calc(-50% + var(--fx)), calc(-50% - 140px)) scale(1.3); opacity: 0; } }
body.reacting #app { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
body.reacting .vip-next { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }

.join-logo { display: block; width: 100%; height: auto; margin: 4px 0 -6px; transform: rotate(-2deg); filter: drop-shadow(6px 7px 0 rgba(0,0,0,.6)); }

/* тиктоки */
.tt-mini { justify-self: center; background: var(--bone); padding: 6px 6px 8px; transform: rotate(-1.5deg); box-shadow: 5px 6px 0 rgba(0,0,0,.6); }
.tt-mini .tt-in { position: relative; }
.tt-mini img { display: block; max-height: 34vh; width: auto; max-width: 100%; }
.tt-mini .tt-cover { position: absolute; display: grid; place-items: center; background: var(--pink); color: var(--ink); font: 400 28px/1 var(--display); transform: rotate(1.5deg); }
textarea.field { resize: none; font: 700 20px/1.25 var(--body); }
.opt.cap { grid-template-columns: 44px 1fr; min-height: 60px; }
.opt.cap .key { width: 44px; height: 44px; font-size: 28px; background: var(--bone); }

/* правка лица — наклейка на персонаже в лобби и на экране «образ подобран» */
.look { position: relative; }
.face-fix { position: absolute; top: 12px; right: 4px; z-index: 3; padding: 8px 12px; border: 0; background: var(--lime); color: var(--ink, #0b0b0d); font: 800 15px/1 var(--body, inherit); transform: rotate(4deg); box-shadow: 4px 5px 0 rgba(0,0,0,.6); cursor: pointer; }
.face-fix:active { transform: rotate(4deg) translateY(2px); box-shadow: 2px 3px 0 rgba(0,0,0,.6); }
/* «поправить лицо»: крупно персонаж с лицом, под ним — фото под овалом (двигать/масштабировать) */
.view.selfie.fixing { gap: 10px; }
.fix-pv { justify-self: center; width: 100%; height: 30dvh; object-fit: contain; background: rgba(239,231,214,.06); border: 1.5px solid rgba(239,231,214,.25); }
.view.selfie.fixing .cam { width: min(100%, calc((70dvh - 330px) * .75)); min-width: 150px; }
/* подпись в «Нефорских тиктоках» дошла до сервера */
.btn.sent { background: transparent; color: var(--lime); border: 2px solid var(--lime); box-shadow: none; }
.field.sent { border-color: var(--lime); box-shadow: 0 0 0 2px rgba(200,255,60,.25); }
