:root {
  --lime: #C6F135;
  --lime-2: #AED624;
  --ink: #142004;
  --bg: #0E1014;
  --top: #0A0B0E;
  --card: #171A20;
  --card-2: #1E2229;
  --text: #EEF0F3;
  --dim: #9AA0AA;
  --mute: #6B7079;
  --line: #262A33;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0; background: #07080A; color: var(--text);
  font: 15.5px/1.45 "Manrope", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
.app {
  max-width: 460px; margin: 0 auto; height: 100dvh; display: flex; flex-direction: column;
  background: var(--bg);
}

/* верхняя строка */
.bar {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--top); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.logo { width: 38px; height: 38px; border-radius: 12px; background: var(--lime); color: var(--ink); display: grid; place-items: center; }
.logo svg { width: 21px; height: 21px; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.15; }
.brand-txt b { font-size: 17px; font-weight: 800; letter-spacing: -.3px; }
.status { font-size: 11.5px; color: var(--dim); font-weight: 600; display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.status i { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); animation: blink 2s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.bar-link { font-size: 12px; color: var(--mute); font-weight: 700; text-decoration: none; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }

/* экран */
#qb { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.scr { padding: 14px 16px calc(24px + env(safe-area-inset-bottom)); animation: rise .35s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.stepline { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--dim); margin-bottom: 14px; }
.dots { display: flex; gap: 5px; }
.dots i { width: 20px; height: 4px; border-radius: 2px; background: #2A2E37; }
.dots i.on { background: var(--lime); }

.hero { font-size: 27px; line-height: 1.15; font-weight: 800; letter-spacing: -.6px; margin: 4px 0 14px; }
.hero em { font-style: normal; color: var(--lime); }

/* реплика бота */
.say { display: flex; gap: 9px; align-items: flex-start; margin: 0 0 14px; }
.ava { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 10px; background: var(--lime); color: var(--ink); display: grid; place-items: center; }
.ava svg { width: 17px; height: 17px; }
.bubble {
  background: var(--card-2); border-radius: 4px 16px 16px 16px; padding: 10px 13px; font-size: 14.5px;
  min-height: 40px; max-width: calc(100% - 40px);
}
.bubble b { color: var(--lime); }
.bubble.flash { animation: flash .5s ease; }
@keyframes flash { from { box-shadow: 0 0 0 2px rgba(198,241,53,.45); } to { box-shadow: 0 0 0 0 rgba(198,241,53,0); } }
.bubble.typing { display: inline-flex; gap: 4px; align-items: center; padding: 15px 14px; }
.bubble.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--lime); animation: dot 1s infinite; }
.bubble.typing i:nth-child(2) { animation-delay: .15s; }
.bubble.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

/* калькулятор */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 16px; }
.field + .field { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.field-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.field-top span { font-size: 13px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .5px; }
.field-top output { font-size: 26px; font-weight: 800; color: var(--lime); letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 99px; margin: 8px 0;
  background: linear-gradient(90deg, var(--lime) var(--fill, 50%), #2A2E37 var(--fill, 50%)); outline: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: var(--lime);
  border: 6px solid var(--card); box-shadow: 0 0 0 1.5px var(--lime);
}
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--lime); border: 6px solid var(--card); box-shadow: 0 0 0 1.5px var(--lime); }
.ends { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--mute); font-weight: 600; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.quick button { background: transparent; border: 1px solid var(--line); border-radius: 10px; padding: 8px 2px; font-size: 12.5px; font-weight: 700; color: var(--dim); white-space: nowrap; }
.quick button.on { border-color: var(--lime); color: var(--lime); background: rgba(198,241,53,.07); }

.cta {
  display: block; width: 100%; margin-top: 14px; padding: 16px; border: 0; border-radius: 16px;
  background: var(--lime); color: var(--ink); font-size: 16.5px; font-weight: 800; letter-spacing: -.2px;
}
.cta:active { transform: scale(.99); background: var(--lime-2); }
.note { text-align: center; font-size: 12px; color: var(--mute); margin: 10px 0 0; font-weight: 600; }

/* вопрос */
.q { font-size: 21px; line-height: 1.22; font-weight: 800; letter-spacing: -.4px; margin: 6px 0 14px; }
.opts { display: flex; flex-direction: column; gap: 9px; }
.opt {
  text-align: left; background: var(--card); border: 1.5px solid var(--line); border-radius: 16px;
  padding: 15px 16px; font-size: 16px; font-weight: 700; transition: border-color .15s, opacity .2s;
}
.opt:active, .opt.on { border-color: var(--lime); color: var(--lime); }
.opt.off { opacity: .35; pointer-events: none; }

.scan { margin-top: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 16px; }
.scan-top { display: flex; gap: 12px; align-items: center; }
.spin {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid #2A2E37; border-top-color: var(--lime); animation: spin .8s linear infinite;
  display: grid; place-items: center; color: var(--ink); font-weight: 800; font-size: 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.scan.ready .spin { animation: none; border-color: var(--lime); background: var(--lime); }
.scan.ready .spin::after { content: '✓'; }
.scan-txt { min-width: 0; display: flex; flex-direction: column; }
.scan-txt b { font-weight: 800; }
.scan-step { font-size: 13.5px; color: var(--dim); min-height: 19px; }
.scan-step.in { animation: stepIn .35s ease; }
@keyframes stepIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.blanks { margin-top: 16px; }
.blank {
  height: 46px; border-radius: 14px; background: #1C2027; border: 1px solid var(--line);
  padding: 11px 14px; display: flex; flex-direction: column; gap: 7px; justify-content: center;
  margin-top: -30px; opacity: 0; transform: translateY(18px) scale(.96);
  transition: opacity .35s ease, transform .35s cubic-bezier(.2,.8,.2,1), margin-top .35s ease, border-color .3s ease;
}
.blank:first-child { margin-top: 0; }
.blank.in { opacity: 1; transform: none; margin-top: 8px; }
.blank:first-child.in { margin-top: 0; }
.blank i { display: block; height: 7px; border-radius: 4px; background: linear-gradient(90deg, #262A33 0%, #343943 50%, #262A33 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.blank i:first-child { width: 55%; }
.blank i:last-child { width: 80%; opacity: .6; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.scan.ready .blank { border-color: rgba(198,241,53,.5); }

/* места */
.timer { font-size: 12px; font-weight: 700; color: var(--dim); font-variant-numeric: tabular-nums; display: flex; gap: 5px; }
.timer b { color: var(--lime); }

.offer { position: relative; z-index: 3; background: var(--card); border: 1.5px solid var(--lime); border-radius: 22px; padding: 22px 16px 16px; transition: transform .4s cubic-bezier(.4,0,.2,1), opacity .35s ease; }
.offer-badge {
  position: absolute; top: -11px; left: 16px; background: var(--lime); color: var(--ink);
  font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 8px; text-transform: uppercase; letter-spacing: .4px;
}
.offer-hook { font-size: 21px; font-weight: 800; letter-spacing: -.4px; line-height: 1.2; }
.offer-sub { font-size: 14px; color: var(--dim); margin-top: 4px; }
.offer-hint { font-size: 12.5px; color: var(--mute); margin-top: 10px; text-align: center; }

.final { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 22px 18px; text-align: center; margin-top: 10px; }
.final-ic { width: 56px; height: 56px; border-radius: 18px; background: var(--lime); color: var(--ink); display: grid; place-items: center; font-size: 28px; font-weight: 800; margin: 0 auto 12px; }
.final h3 { margin: 0 0 6px; font-size: 19px; font-weight: 800; }
.final p { margin: 0 0 12px; color: var(--dim); font-size: 14px; }
.final-warn { background: rgba(255,138,101,.08); border: 1px solid rgba(255,138,101,.25); color: #FFB199; font-size: 13px; border-radius: 12px; padding: 10px 12px; text-align: left; }

.track { margin-top: 18px; border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 11px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.row-n { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: #23272F; color: var(--dim); }
.row-t { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.row-t b { font-size: 14px; font-weight: 700; }
.row-t small { font-size: 12px; color: var(--mute); font-weight: 600; }
.row.cur .row-n { background: var(--lime); color: var(--ink); }
.row.done .row-n { background: rgba(198,241,53,.15); color: var(--lime); }
.row.done .row-t b { color: var(--dim); }
.row.lock { opacity: .55; }
.row-again { flex: 0 0 auto; background: none; border: 0; color: var(--mute); font-size: 12px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* нижняя панель: шанс по шагам и вопросы */
.dock {
  flex: 0 0 auto; background: var(--top); border-top: 1px solid var(--line);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); animation: rise .35s ease;
}
.dock-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#dockTxt { font-size: 13.5px; font-weight: 700; }
#dockTxt b { color: var(--lime); }
.dock-bar { display: flex; gap: 4px; margin-top: 8px; }
.dock-bar i { flex: 1 1 0; height: 6px; border-radius: 3px; background: #262A33; transition: background .4s ease; }
.dock-bar i.done { background: var(--lime); }
.dock-bar i.cur { background: rgba(198,241,53,.35); animation: blink 1.6s infinite; }
.tiles { display: flex; gap: 7px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.tiles::-webkit-scrollbar { display: none; }
.tile {
  flex: 0 0 auto; display: flex; align-items: center; gap: 7px; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 7px 11px 7px 8px; font-size: 12.5px; font-weight: 700; color: var(--text); white-space: nowrap;
}
.tile-ic { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; background: rgba(198,241,53,.12); color: var(--lime); font-size: 11px; font-weight: 800; }
.tile.seen { opacity: .5; }
.tile:active { border-color: var(--lime); }
.is-done .say, .is-done .timer { display: none; }

/* колода: следующие места выглядывают из-под активной карточки */
.deck { position: relative; margin-top: 18px; }
.peek {
  position: relative; display: flex; align-items: center; gap: 11px;
  margin: -22px 10px 0; padding: 34px 16px 14px;
  background: #1A1D23; border: 1px solid #2C3038; border-radius: 0 0 20px 20px;
  color: var(--text); z-index: 2; transition: transform .4s cubic-bezier(.4,0,.2,1);
}
.peek-2 { margin: -22px 20px 0; background: #16191E; z-index: 1; opacity: .85; }
.peek-3 { margin: -22px 30px 0; background: #131519; z-index: 0; opacity: .7; }
.peek-t { min-width: 0; display: flex; flex-direction: column; }
.peek-t b { font-size: 15.5px; font-weight: 800; letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.peek-t small { font-size: 12.5px; color: var(--mute); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.peek-edge { height: 9px; margin: -1px 40px 0; background: #111317; border: 1px solid #262A31; border-top: 0; border-radius: 0 0 14px 14px; opacity: .6; }
.peek-edge-2 { margin: -1px 50px 0; opacity: .4; }
.peek-ic { width: 17px; height: 17px; flex: 0 0 auto; color: var(--mute); }
.deck-hint { font-size: 13px; color: var(--dim); font-weight: 600; text-align: center; margin: 4px 8px 0; }
.offer.leave { transform: translateX(-115%) rotate(-7deg); opacity: 0; }
.deck.shift .peek-1 { transform: translateY(-14px); }
.deck.shift .peek-2 { transform: translateY(-10px); }
.deck.shift .peek-3 { transform: translateY(-6px); }
.offer.enter { animation: lift .35s ease; }
@keyframes lift { from { transform: translateY(14px) scale(.97); opacity: .6; } to { transform: none; opacity: 1; } }
.track:empty { display: none; }

/* ответ на вопрос: панель снизу */
.app { position: relative; }
.sheet-bg {
  position: absolute; inset: 0; z-index: 20; display: flex; align-items: flex-end;
  background: rgba(0,0,0,0); pointer-events: none; transition: background .25s ease;
}
.sheet-bg.open { background: rgba(0,0,0,.55); pointer-events: auto; }
.sheet {
  position: relative; width: 100%; background: var(--card-2); border-top: 1.5px solid var(--lime);
  border-radius: 22px 22px 0 0; padding: 22px 18px calc(24px + env(safe-area-inset-bottom));
  transform: translateY(105%); transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.sheet-bg.open .sheet { transform: none; }
.sheet-ava { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--lime); color: var(--ink); margin-bottom: 12px; }
.sheet-ava svg { width: 19px; height: 19px; }
.sheet h3 { margin: 0 0 8px; font-size: 18px; font-weight: 800; letter-spacing: -.3px; padding-right: 30px; }
.sheet p { margin: 0; color: #C9CDD3; font-size: 15px; line-height: 1.5; }
.sheet-x {
  position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 10px;
  border: 1px solid var(--line); background: transparent; color: var(--dim); font-size: 20px; line-height: 1;
}
