/* «А ты меня вообще знаешь?» — стили */
:root {
  --bg: #0c1526;
  --bg2: #16233d;
  --ink: #f4f1ea;
  --muted: rgba(244, 241, 234, .62);
  --faint: rgba(244, 241, 234, .38);
  --gold: #e8bd8c;
  --gold-deep: #b08a6e;
  --blue: #93b4dc;
  --card: rgba(255, 255, 255, .055);
  --card-strong: rgba(255, 255, 255, .09);
  --line: rgba(255, 255, 255, .13);
  --hue: 36;
  --accent: hsl(var(--hue) 72% 68%);
  --accent-soft: hsl(var(--hue) 72% 68% / .18);
  --radius: 22px;
  --font-head: "Unbounded", "Manrope", system-ui, sans-serif;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.4;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; }

/* фон */
.bg { position: fixed; inset: 0; overflow: hidden; z-index: 0; background: radial-gradient(120% 90% at 50% 0%, #1a2a4a 0%, #0c1526 55%, #090f1c 100%); }
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; animation: drift 26s ease-in-out infinite alternate; }
.o1 { width: 60vmax; height: 60vmax; left: -20vmax; top: -18vmax; background: hsl(var(--hue) 70% 55% / .55); }
.o2 { width: 50vmax; height: 50vmax; right: -22vmax; top: 20vh; background: rgba(90, 130, 200, .5); animation-delay: -9s; animation-duration: 31s; }
.o3 { width: 45vmax; height: 45vmax; left: 10vw; bottom: -25vmax; background: rgba(176, 138, 110, .45); animation-delay: -17s; animation-duration: 37s; }
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(8vw, 6vh, 0) scale(1.15); }
}
.grain { position: absolute; inset: 0; opacity: .05; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
#fx { position: fixed; inset: 0; z-index: 5; pointer-events: none; }

/* каркас */
.app {
  position: relative; z-index: 1;
  max-width: 480px; margin: 0 auto;
  min-height: 100vh; min-height: 100dvh;
  padding: calc(14px + var(--safe-t)) 18px calc(22px + var(--safe-b));
  display: flex; flex-direction: column;
}
.screen, .lvl { --accent: hsl(var(--hue) 72% 68%); --accent-soft: hsl(var(--hue) 72% 68% / .18); }
.screen { animation: fadeUp .38s cubic-bezier(.2, .8, .2, 1) both; display: flex; flex-direction: column; flex: 1; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.spacer { flex: 1; }

h1, h2, h3 { margin: 0; font-family: var(--font-head); font-weight: 700; letter-spacing: -.01em; line-height: 1.12; }
h1 { font-size: 30px; }
h2 { font-size: 24px; }
h3 { font-size: 17px; }
p { margin: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 14px; }
.center { text-align: center; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.brand i { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 14px var(--gold); }

/* кнопки */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 56px; padding: 14px 20px;
  border-radius: 18px; font-weight: 700; font-size: 17px;
  background: var(--gold); color: #1a1208;
  box-shadow: 0 10px 30px rgba(232, 189, 140, .25);
  transition: transform .12s ease, filter .2s ease, opacity .2s ease;
}
.btn:active { transform: scale(.975); }
.btn:disabled { opacity: .45; filter: grayscale(.4); cursor: default; }
.btn.ghost { background: var(--card-strong); color: var(--ink); box-shadow: none; border: 1px solid var(--line); }
.btn.quiet { background: none; color: var(--muted); box-shadow: none; min-height: 44px; font-weight: 600; font-size: 15px; }
.btn.accent { background: var(--accent); color: #141008; box-shadow: 0 10px 30px var(--accent-soft); }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* карточки */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.card.glow { box-shadow: 0 0 0 1px var(--accent-soft), 0 20px 60px -20px var(--accent-soft); }

/* поля */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 13px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.input {
  width: 100%; min-height: 56px; padding: 14px 18px;
  background: rgba(0, 0, 0, .22); border: 1px solid var(--line); border-radius: 16px;
  font-size: 18px; outline: none; transition: border-color .2s;
}
.input:focus { border-color: var(--gold); }
.input.code { font-family: var(--font-head); letter-spacing: .3em; text-transform: uppercase; text-align: center; font-size: 22px; }
textarea.input { resize: none; min-height: 96px; line-height: 1.35; }

/* главная */
.hero { padding-top: 8vh; gap: 18px; display: flex; flex-direction: column; }
.hero .title { font-size: clamp(32px, 9.5vw, 44px); line-height: 1.05; }
.hero .title em { font-style: normal; color: var(--gold); }
.hero .lead { font-size: 17px; color: var(--muted); max-width: 34ch; }
.hearts { position: relative; height: 150px; margin: 6px 0 2px; }
.hearts .h { position: absolute; width: 112px; height: 112px; border-radius: 40% 40% 50% 50%; opacity: .95; filter: drop-shadow(0 18px 40px rgba(0,0,0,.35)); animation: float 5s ease-in-out infinite; }
.hearts .h1 { left: 10%; top: 16px; background: linear-gradient(135deg, #f0c99a, #b08a6e); transform: rotate(-12deg); }
.hearts .h2 { left: 42%; top: 0; background: linear-gradient(135deg, #a9c4e6, #5f85b0); transform: rotate(10deg); animation-delay: -2.2s; mix-blend-mode: screen; }
.hearts .q { position: absolute; left: 50%; top: 44px; transform: translateX(-50%); font-family: var(--font-head); font-size: 64px; font-weight: 700; color: #fff; text-shadow: 0 10px 30px rgba(0,0,0,.4); animation: float 5s ease-in-out infinite; animation-delay: -1s; }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
.facts { display: flex; gap: 8px; }
.fact { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 10px; text-align: center; }
.fact b { display: block; font-family: var(--font-head); font-size: 22px; color: var(--gold); }
.fact span { font-size: 12px; color: var(--muted); }
.foot { font-size: 13px; color: var(--faint); text-align: center; margin-top: 10px; }
.foot a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line); }

/* лобби */
.codebox { text-align: center; padding: 26px 18px; }
.codebox .code { font-family: var(--font-head); font-size: 44px; letter-spacing: .22em; margin-left: .22em; color: var(--gold); text-shadow: 0 0 30px rgba(232,189,140,.35); }
.players { display: flex; gap: 10px; }
.pl { flex: 1; display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; min-height: 68px; }
.pl .av { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 18px; color: #121008; flex-shrink: 0; }
.av.a0 { background: linear-gradient(135deg, #f0c99a, #b08a6e); }
.av.a1 { background: linear-gradient(135deg, #a9c4e6, #5f85b0); }
.pl .nm { font-weight: 700; display: flex; align-items: center; gap: 6px; }
.pl .st { font-size: 12px; color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #6fd49a; box-shadow: 0 0 8px #6fd49a; display: inline-block; }
.dot.off { background: var(--faint); box-shadow: none; }
.pl.empty { border-style: dashed; color: var(--muted); justify-content: center; }
.pulse { display: inline-flex; gap: 5px; vertical-align: middle; }
.pulse i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .3; animation: blink 1.2s infinite; }
.pulse i:nth-child(2) { animation-delay: .2s; } .pulse i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* уровни */
.overall { display: flex; align-items: center; gap: 14px; }
.ring { position: relative; width: 84px; height: 84px; flex-shrink: 0; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; stroke-linecap: round; }
.ring .track { stroke: rgba(255,255,255,.1); }
.ring .bar { stroke: var(--gold); transition: stroke-dashoffset 1.2s cubic-bezier(.2,.8,.2,1); }
.ring .val { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-head); font-size: 18px; }
.ring.big { width: 190px; height: 190px; margin: 6px auto; }
.ring.big .val { font-size: 46px; }
.ring.big circle { stroke-width: 9; }
.ring.big .bar { stroke: var(--accent); filter: drop-shadow(0 0 10px var(--accent-soft)); }
.lvls { display: flex; flex-direction: column; gap: 10px; }
.lvl {
  --hue: 36;
  display: flex; align-items: center; gap: 14px; text-align: left;
  width: 100%; padding: 14px 16px; border-radius: 20px;
  background: var(--card); border: 1px solid var(--line);
  transition: transform .12s ease, background .2s ease;
}
.lvl:active { transform: scale(.985); }
.lvl .num { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; font-family: var(--font-head); font-size: 18px; background: hsl(var(--hue) 70% 62% / .16); color: hsl(var(--hue) 75% 72%); border: 1px solid hsl(var(--hue) 70% 62% / .3); flex-shrink: 0; }
.lvl .t { flex: 1; min-width: 0; }
.lvl .t b { display: block; font-size: 17px; }
.lvl .t span { font-size: 13px; color: var(--muted); }
.lvl .res { font-family: var(--font-head); font-size: 15px; color: hsl(var(--hue) 75% 72%); white-space: nowrap; }
.lvl .lock { width: 22px; height: 22px; color: var(--faint); }
.lvl.locked { opacity: .45; }
.lvl.locked .num { background: rgba(255,255,255,.05); color: var(--faint); border-color: var(--line); }
.lvl.next { background: hsl(var(--hue) 70% 62% / .1); border-color: hsl(var(--hue) 70% 62% / .35); box-shadow: 0 14px 40px -18px hsl(var(--hue) 70% 62% / .6); }

/* вопрос */
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.top .lv { font-size: 13px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.top .pts { font-family: var(--font-head); font-size: 15px; color: var(--accent); }
.streak { font-size: 12px; color: var(--gold); margin-left: 8px; }
.prog { display: flex; gap: 4px; margin: 12px 0 18px; }
.prog i { flex: 1; height: 5px; border-radius: 3px; background: rgba(255,255,255,.1); overflow: hidden; position: relative; }
.prog i.done { background: var(--accent); }
.prog i.cur::after { content: ""; position: absolute; inset: 0; background: var(--accent); opacity: .5; animation: blink 1.4s infinite; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.chip.me { background: rgba(232,189,140,.16); color: var(--gold); }
.chip.you { background: rgba(147,180,220,.16); color: var(--blue); }
.chip.we { background: rgba(255,255,255,.1); color: var(--ink); }
.qcard { margin-top: 12px; padding: 24px 22px; min-height: 128px; display: flex; align-items: center; }
.qcard .q { font-family: var(--font); font-size: clamp(20px, 5.8vw, 24px); font-weight: 700; line-height: 1.28; letter-spacing: -.01em; }
.opts { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.opt {
  width: 100%; text-align: left; padding: 16px 18px; border-radius: 18px;
  background: var(--card-strong); border: 1px solid var(--line);
  font-size: 17px; font-weight: 600; line-height: 1.3;
  transition: transform .1s ease, background .2s ease, border-color .2s ease;
  animation: fadeUp .4s both;
}
.opt:nth-child(2) { animation-delay: .05s; } .opt:nth-child(3) { animation-delay: .1s; } .opt:nth-child(4) { animation-delay: .15s; }
.opt:active { transform: scale(.98); }
.opt.sel { background: var(--accent-soft); border-color: var(--accent); }
.opt:disabled { cursor: default; }
.opts.locked .opt:not(.sel) { opacity: .4; }
.scale { display: flex; gap: 8px; margin-top: 14px; }
.scale button { flex: 1; aspect-ratio: 1; border-radius: 16px; background: var(--card-strong); border: 1px solid var(--line); font-family: var(--font-head); font-size: 20px; transition: transform .1s, background .2s; }
.scale button:active { transform: scale(.95); }
.scale button.sel { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.scale-labels { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 8px; }
.openform { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.counter { font-size: 12px; color: var(--faint); text-align: right; }
.waiting { margin-top: 18px; text-align: center; color: var(--muted); font-size: 15px; animation: fadeUp .3s both; }
.waiting b { color: var(--ink); }

/* раскрытие */
.verdict { text-align: center; margin: 14px 0 8px; animation: pop .5s cubic-bezier(.2, 1.4, .3, 1) both; }
.verdict h2 { font-size: 30px; }
.verdict.hit h2 { color: var(--gold); text-shadow: 0 0 30px rgba(232,189,140,.4); }
.verdict.near h2 { color: var(--blue); }
.verdict .badge { display: inline-block; margin-top: 8px; padding: 6px 14px; border-radius: 999px; font-family: var(--font-head); font-size: 15px; background: rgba(255,255,255,.1); }
.verdict.hit .badge { background: rgba(232,189,140,.18); color: var(--gold); }
@keyframes pop { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }
.ans { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.an { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); animation: slideIn .5s cubic-bezier(.2, .8, .2, 1) both; }
.an:nth-child(2) { animation-delay: .12s; }
@keyframes slideIn { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
.an .av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #121008; flex-shrink: 0; font-size: 15px; }
.an .who { font-size: 12px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.an .what { font-size: 18px; font-weight: 700; margin-top: 2px; overflow-wrap: anywhere; }
.an.truth { border-color: rgba(232,189,140,.35); background: rgba(232,189,140,.07); }
.scalebar { display: flex; gap: 5px; margin-top: 6px; }
.scalebar i { flex: 1; height: 8px; border-radius: 4px; background: rgba(255,255,255,.1); }
.scalebar i.on { background: var(--accent); }
.line { margin-top: 16px; text-align: center; color: var(--muted); font-style: italic; font-size: 15px; animation: fadeUp .5s .25s both; }
.judge { margin-top: 16px; }
.judge p { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 10px; }
.nextwrap { margin-top: 18px; }

/* итог уровня */
.end { text-align: center; }
.end .kicker { color: var(--muted); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.end h2 { margin-top: 6px; }
.end .ttl { font-family: var(--font-head); font-size: 22px; color: var(--accent); margin-top: 4px; }
.stats { display: flex; gap: 8px; margin-top: 16px; }
.stat { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 8px; }
.stat b { display: block; font-family: var(--font-head); font-size: 20px; }
.stat span { font-size: 12px; color: var(--muted); }
.evening { margin-top: 16px; text-align: left; border-color: rgba(232,189,140,.3); }
.evening .k { font-size: 12px; color: var(--gold); letter-spacing: .1em; text-transform: uppercase; }
.evening .q { font-size: 18px; font-weight: 600; margin-top: 8px; line-height: 1.35; }
.evening .by { font-size: 13px; color: var(--muted); margin-top: 10px; }
.improved { display: inline-block; margin-top: 8px; font-size: 13px; color: #6fd49a; }

/* тост */
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translate(-50%, 20px); z-index: 20; background: rgba(20, 28, 48, .96); border: 1px solid var(--line); color: var(--ink); padding: 12px 18px; border-radius: 14px; font-size: 15px; opacity: 0; pointer-events: none; transition: all .25s; max-width: 90vw; text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* мелочи */
.link { background: none; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font-size: 14px; }
.hdr { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; font-weight: 600; min-height: 36px; }
.sep { height: 1px; background: var(--line); margin: 14px 0; }
@media (min-width: 720px) {
  .app { padding-top: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
