/* Сайт «Пойдёшь?»: главная, конструктор, страница ответов */
:root {
  --cream: #FFF7EF;
  --paper: #FFFFFF;
  --ink: #2A1426;
  --ink2: #6E5468;
  --line: #EEDFE3;
  --coral: #FF4F6D;
  --coral2: #FF8A5B;
  --coral-d: #E23A5A;
  --butter: #FFD66B;
  --lilac: #CDBBFF;
  --mint: #A6E8CB;
  --sky: #BFE3FF;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(42, 20, 38, .08);
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font: 16px/1.5 'Nunito', system-ui, -apple-system, sans-serif;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
img { max-width: 100%; }
.display { font-family: 'Unbounded', 'Nunito', sans-serif; letter-spacing: -.02em; }
.hand { font-family: 'Caveat', cursive; }

/* логотип */
.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font: 800 21px 'Unbounded', sans-serif; letter-spacing: -.03em; color: var(--ink); }
.logo-mark { width: 34px; height: 34px; border-radius: 12px 12px 12px 4px; background: linear-gradient(135deg, var(--coral), var(--coral2)); display: grid; place-items: center; color: #fff; transform: rotate(-6deg); }
.logo-mark svg { width: 20px; height: 20px; }
.logo b { color: var(--coral); }

/* кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 24px; border-radius: 999px;
  border: 0; font-weight: 800; font-size: 16px; text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s, opacity .15s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--coral), var(--coral2)); box-shadow: 0 10px 24px rgba(255, 79, 109, .32); }
.btn-primary:hover { box-shadow: 0 12px 28px rgba(255, 79, 109, .42); }
.btn-light { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-light:hover { box-shadow: inset 0 0 0 1.5px var(--ink2); }
.btn-ghost { background: transparent; color: var(--ink2); padding: 10px 14px; min-height: 40px; }
.btn-ghost:hover { color: var(--ink); }
.btn-big { min-height: 58px; padding: 16px 34px; font-size: 18px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: 14px; }

/* ===================== конструктор ===================== */
.ed { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; overflow-x: clip; }
.ed-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 12px 20px; background: color-mix(in srgb, var(--cream) 88%, transparent); backdrop-filter: blur(10px); }
.ed-steps { flex: 1; min-width: 0; display: flex; justify-content: center; align-items: center; gap: 6px; }
.ed-step-dot { width: 30px; height: 6px; border-radius: 6px; background: var(--line); border: 0; padding: 0; cursor: pointer; transition: background .25s, width .25s; }
.ed-step-dot.done { background: color-mix(in srgb, var(--coral) 45%, transparent); }
.ed-step-dot.cur { background: var(--coral); width: 44px; }
.ed-main { flex: 1; display: grid; grid-template-columns: minmax(330px, 400px) minmax(0, 640px); justify-content: center; gap: 48px; padding: 18px 24px 120px; }
.ed-preview { position: sticky; top: 76px; align-self: start; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ed-preview-hint { font-size: 13px; color: var(--ink2); text-align: center; margin: 0; }
.phone { position: relative; width: 340px; height: min(690px, calc(100vh - 250px)); min-height: 540px; border-radius: 46px; padding: 12px; background: #1d1220;
  box-shadow: 0 30px 60px rgba(42, 20, 38, .25), inset 0 0 0 2px #3b2a3e; }
.phone-screen { position: relative; width: 100%; height: 100%; border-radius: 35px; overflow: hidden; background: #fff; }
.phone-notch { position: absolute; z-index: 30; top: 9px; left: 50%; transform: translateX(-50%); width: 92px; height: 26px; border-radius: 20px; background: #1d1220; pointer-events: none; }
.ed-preview-tools { display: flex; gap: 8px; }

.ed-panel { min-width: 0; padding-top: 6px; }
.ed-h { margin: 6px 0 4px; font-size: 30px; line-height: 1.15; font-weight: 800; }
.ed-lead { margin: 0 0 22px; color: var(--ink2); }

.blk { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.blk-h { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 17px; font-weight: 800; }
.blk-n { flex: none; width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: var(--ink);
  background: var(--butter); }
.blk-h .spacer { flex: 1; }
.blk-note { margin: -6px 0 14px; color: var(--ink2); font-size: 14px; }

.field { display: block; margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field-l { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--ink2); margin-bottom: 6px; }
.field-l .spacer { flex: 1; }
.inp, .txt, .sel { width: 100%; border: 1.5px solid var(--line); border-radius: 14px; background: #FFFCFA; padding: 11px 14px; font: 600 16px 'Nunito', sans-serif; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.txt { resize: vertical; min-height: 74px; line-height: 1.4; }
.inp:focus, .txt:focus, .sel:focus { outline: none; border-color: var(--coral); box-shadow: 0 0 0 4px rgba(255, 79, 109, .12); }
.count { font-size: 12px; color: #B49DAA; text-align: right; margin-top: 4px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dice { border: 0; background: #FFF1E6; border-radius: 10px; padding: 3px 10px; font-size: 13px; font-weight: 700; cursor: pointer; color: var(--ink); }
.dice:hover { background: #FFE4D1; }

/* карточки-варианты */
.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.opts.two { grid-template-columns: 1fr 1fr; }
.opt { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 16px 10px; min-height: 96px; border-radius: 18px;
  background: var(--paper); border: 2px solid var(--line); cursor: pointer; text-align: center; font-weight: 700; font-size: 15px; transition: border-color .15s, transform .15s, background .15s; }
.opt:hover { border-color: #E7C5CF; }
.opt.on { border-color: var(--coral); background: #FFF4F6; }
.opt-ico { font-size: 28px; line-height: 1; }
.opt-sub { font-size: 12px; font-weight: 600; color: var(--ink2); }
.opt-new { position: absolute; top: 8px; right: 8px; font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 8px; background: var(--butter); color: var(--ink); }
.opt.big { min-height: 150px; font-size: 18px; }
.opt.big .opt-ico { font-size: 56px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line); background: var(--paper); border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 14px; cursor: pointer; transition: all .15s; }
.chip:hover { border-color: #E7C5CF; }
.chip.on { border-color: var(--coral); background: #FFF4F6; color: var(--coral-d); }
.chip-var { border-style: dashed; font-size: 13px; padding: 5px 12px; }

.tabs { display: inline-flex; padding: 4px; border-radius: 999px; background: #F6ECE6; gap: 2px; margin-bottom: 16px; flex-wrap: wrap; }
.tab { border: 0; background: none; padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: 14px; cursor: pointer; color: var(--ink2); }
.tab.on { background: var(--ink); color: #fff; }

.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-ui { flex: none; width: 48px; height: 28px; border-radius: 28px; background: #E5D6DB; position: relative; transition: background .2s; }
.switch-ui::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked + .switch-ui { background: var(--coral); }
.switch input:checked + .switch-ui::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-ui { box-shadow: 0 0 0 4px rgba(255, 79, 109, .2); }
.switch-t { font-weight: 700; }
.switch-t small { display: block; font-weight: 600; color: var(--ink2); font-size: 13px; }

/* выбор картинки */
.stickers { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px; }
.stk { aspect-ratio: 1; border-radius: 16px; border: 2px solid var(--line); background: #FFFCFA; padding: 8px; cursor: pointer; transition: border-color .15s, transform .15s; }
.stk:hover { transform: translateY(-2px); }
.stk.on { border-color: var(--coral); background: #FFF4F6; }
.stk img { width: 100%; height: 100%; object-fit: contain; display: block; }
.stk.more { font-size: 13px; font-weight: 700; color: var(--ink2); }
.upload { display: flex; align-items: center; gap: 14px; margin-top: 12px; padding: 14px; border-radius: 16px; border: 2px dashed var(--line); background: #FFFCFA; cursor: pointer; width: 100%; text-align: left; transition: border-color .15s; }
.upload:hover { border-color: #E7C5CF; }
.upload-ico { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; background: #FFF1E6; }
.upload b { display: block; font-size: 15px; }
.upload small { color: var(--ink2); }
.upload.on { border-style: solid; border-color: var(--coral); }
.upload-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 12px; }

/* запись голоса и кружка */
.rec { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 18px; border-radius: 18px; background: #FFF6F1; text-align: center; }
.rec-btn { width: 76px; height: 76px; border-radius: 50%; border: 0; background: linear-gradient(135deg, var(--coral), var(--coral2)); color: #fff; font-size: 30px; cursor: pointer; box-shadow: 0 10px 24px rgba(255,79,109,.35); }
.rec-btn.recording { animation: rec-pulse 1.2s infinite; background: #E5484D; }
@keyframes rec-pulse { 50% { box-shadow: 0 0 0 14px rgba(229, 72, 77, .15); } }
.rec-time { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rec-cam { width: 200px; height: 200px; border-radius: 50%; overflow: hidden; background: #2A1426; }
.rec-cam video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.rec small { color: var(--ink2); }
.rec-done { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* экраны выбора */
.cq { border: 2px solid var(--line); border-radius: 18px; padding: 16px; margin-bottom: 14px; background: #FFFCFA; }
.cq-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-weight: 800; }
.cq-head .spacer { flex: 1; }
.items { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.item { display: flex; align-items: center; gap: 8px; }
.item-pic { flex: none; width: 48px; height: 48px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--paper); display: grid; place-items: center; cursor: pointer; padding: 6px; }
.item-pic img { width: 100%; height: 100%; object-fit: contain; }
.item-pic img.photo { object-fit: cover; border-radius: 9px; }
.item .inp { flex: 1; padding: 10px 12px; }
.icon-btn { flex: none; width: 38px; height: 38px; border-radius: 12px; border: 0; background: transparent; color: #B49DAA; cursor: pointer; font-size: 18px; display: grid; place-items: center; }
.icon-btn:hover { background: #FBEFF2; color: var(--coral-d); }
.add-row { width: 100%; padding: 12px; border-radius: 14px; border: 2px dashed var(--line); background: transparent; font-weight: 700; color: var(--ink2); cursor: pointer; }
.add-row:hover { border-color: #E7C5CF; color: var(--ink); }

/* всплывающий выбор эмодзи */
.pop-back { position: fixed; inset: 0; z-index: 90; background: rgba(42, 20, 38, .35); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .2s; }
.pop { width: 100%; max-width: 440px; max-height: 82vh; overflow: auto; background: var(--paper); border-radius: 24px; padding: 20px; box-shadow: 0 30px 60px rgba(0,0,0,.2); }
.pop h3 { margin: 0 0 12px; font-size: 18px; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.emoji-grid button { aspect-ratio: 1; border: 0; border-radius: 12px; background: #FFF8F4; cursor: pointer; padding: 6px; }
.emoji-grid button:hover { background: #FFE9EE; }
.emoji-grid img { width: 100%; height: 100%; }
@keyframes fade { from { opacity: 0; } }

/* ИИ-помощник */
.ai { background: linear-gradient(135deg, #FFF0F3, #F3EDFF); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.ai-h { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; margin-bottom: 6px; }
.ai-badge { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 8px; background: var(--ink); color: #fff; }
.ai p { margin: 0 0 12px; color: var(--ink2); font-size: 14px; }
.ai-closed { display: block; width: 100%; text-align: left; border: 0; cursor: pointer; transition: transform .15s; }
.ai-closed:hover { transform: translateY(-1px); }
.ai-closed .ai-h { margin-bottom: 2px; }
.ai-more { display: block; color: var(--ink2); font-size: 14px; font-weight: 600; }
.ai-wait { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink2); }
.spin { width: 20px; height: 20px; border-radius: 50%; border: 3px solid rgba(255,79,109,.25); border-top-color: var(--coral); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* нижняя навигация */
.ed-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--cream) 90%, transparent); backdrop-filter: blur(10px); box-shadow: 0 -1px 0 var(--line); }
.ed-nav-in { max-width: 1088px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ed-nav-mid { color: var(--ink2); font-size: 14px; font-weight: 700; }
.ed-fab { display: none; }

.err { color: #D23A4C; font-weight: 700; font-size: 14px; margin-top: 8px; }
.ok-note { color: #1E9E6A; font-weight: 700; font-size: 14px; }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 100; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 700; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.2); animation: fade .2s; max-width: calc(100vw - 32px); text-align: center; }

/* живое превью в ленте — только на телефоне */
.inline-wrap { display: none; }

/* мобильная версия конструктора */
.preview-modal { position: fixed; inset: 0; z-index: 80; background: rgba(42, 20, 38, .6); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; animation: fade .2s; }
.preview-modal .phone { width: min(340px, calc(100vw - 32px)); height: min(700px, calc(100dvh - 96px)); min-height: 0; }
.preview-modal .ed-preview-tools { flex-wrap: wrap; justify-content: center; }

@media (max-width: 900px) {
  .inline-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 4px 0 18px; }
  .inline-slot { width: 238px; height: 483px; }
  .inline-slot .phone { width: 340px; height: 690px; min-height: 0; transform: scale(.7); transform-origin: top left; box-shadow: 0 20px 40px rgba(42, 20, 38, .2), inset 0 0 0 2px #3b2a3e; }
  .ed-main { grid-template-columns: minmax(0, 1fr); padding: 8px 16px 130px; gap: 0; }
  .ed-preview { display: none; }
  .ed-top { padding: 10px 16px; gap: 10px; }
  .ed-steps { gap: 4px; }
  .ed-step-dot { width: 10px; }
  .ed-step-dot.cur { width: 22px; }
  .ed-h { font-size: 24px; }
  .ed-fab { display: inline-flex; padding: 10px 14px; }
  .ed-nav-in .btn { padding-left: 16px; padding-right: 16px; }
  .ed-nav-mid { display: none; }
  .hide-sm { display: none; }
  .ed-nav-in { gap: 8px; }
  .ed-nav-in #next { flex: 1; max-width: 220px; }
  .logo span.logo-text { display: none; }
}
@media (max-width: 420px) {
  .blk { padding: 16px; }
  .opts { grid-template-columns: 1fr 1fr; }
  .row2 { grid-template-columns: 1fr; }
}
