:root {
  --bg: #FFF4F6;
  --bg-glow: #FBDDE6;
  --bg-glow-2: #EADFF7;
  --surface: #FFFFFF;
  --surface-2: #FBEEF2;
  --ink: #3B1D35;
  --muted: #7A5670;
  --line: #F1D9E2;
  --accent: #C2325F;
  --accent-2: #9B5DE0;
  --accent-ink: #FFFFFF;
  --accent-soft: #FCE1EA;
  --gold: #E9967A;
  --love: #E0426F;
  --like: #EE8B6A;
  --curious: #8D63D9;
  --no: #B9A5B3;
  --ok: #237552;
  --shadow: 0 1px 2px rgba(120, 30, 70, .05), 0 10px 30px rgba(160, 40, 90, .08);
  --radius: 22px;
  --serif: 'Lora', Georgia, serif;
  --sans: 'Nunito', system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #170F22;
    --bg-glow: #3A1736;
    --bg-glow-2: #22174A;
    --surface: #23182F;
    --surface-2: #2E203D;
    --ink: #F8EAF2;
    --muted: #B79CBA;
    --line: #3A2A4A;
    --accent: #FF7EA3;
    --accent-2: #B48CFF;
    --accent-ink: #2A0F1E;
    --accent-soft: #48203F;
    --gold: #FFB199;
    --love: #FF7EA3;
    --like: #FFB199;
    --curious: #B48CFF;
    --no: #7E6D85;
    --ok: #6FD3A4;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 30px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(90% 50% at 0% 0%, var(--bg-glow), transparent 70%) fixed,
    radial-gradient(90% 50% at 100% 15%, var(--bg-glow-2), transparent 70%) fixed,
    var(--bg);
  color: var(--ink);
  font: 17px/1.5 var(--sans);
}
#app {
  max-width: 560px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px calc(40px + env(safe-area-inset-bottom));
}

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.25; margin: 0 0 .4em; }
h1 { font-size: 30px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 8px; align-items: center; }
.grow { flex: 1; }
.hidden { display: none !important; }

/* --- верхняя панель --- */
.top {
  display: flex; align-items: center; gap: 10px;
  margin: 4px 0 20px;
  min-height: 44px;
}
.top h1, .top h2 { margin: 0; }
.back {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%; border: 0;
  background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow);
  font-size: 20px; cursor: pointer;
}
.presence { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--no); }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }

/* --- карточки --- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.card.soft { background: var(--accent-soft); box-shadow: none; }
a.card, button.card {
  display: block; width: 100%; text-align: left;
  color: inherit; text-decoration: none; border: 0; font: inherit; cursor: pointer;
  transition: transform .15s ease;
}
a.card:active, button.card:active { transform: scale(.985); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { min-height: 112px; display: flex !important; flex-direction: column; justify-content: space-between; }

.tile b { font-family: var(--serif); font-size: 17px; font-weight: 600; }
.section-title { margin: 28px 0 12px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.list > * + * { margin-top: 10px; }
.item { display: flex !important; gap: 14px; align-items: center; }

.item .chev { margin-left: auto; color: var(--muted); }

/* --- кнопки и поля --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 22px;
  border-radius: 999px; border: 0;
  background: var(--accent); color: var(--accent-ink);
  font: 700 16px var(--sans); cursor: pointer;
  text-decoration: none;
}
.btn.block { width: 100%; }
.btn.ghost { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.btn.quiet { background: transparent; color: var(--muted); min-height: 40px; padding: 0 12px; }
.btn:disabled { opacity: .5; cursor: default; }
input, textarea {
  width: 100%; padding: 14px 16px;
  border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink);
  font: 17px/1.45 var(--sans);
}
input:focus, textarea:focus, .btn:focus-visible, .back:focus-visible, .card:focus-visible, .lvl:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
textarea { min-height: 110px; resize: vertical; }
.code-input { text-transform: uppercase; letter-spacing: .3em; text-align: center; font-size: 22px; font-weight: 700; }

/* --- приветствие --- */
.hero { text-align: center; padding: 40px 0 24px; }

.hero h1 { font-size: 40px; margin-top: 10px; }
.hero p { color: var(--muted); max-width: 26em; margin: 0 auto; }
.room-code {
  font: 700 36px var(--sans); letter-spacing: .25em; text-align: center;
  padding: 18px; border-radius: 16px; background: var(--surface-2);
  user-select: all;
}

/* --- вопрос дня и ответы --- */
.daily { background: linear-gradient(140deg, var(--accent-soft), var(--surface)); }
.daily .label { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.question { font-family: var(--serif); font-size: 21px; line-height: 1.35; margin: 8px 0 14px; }
.answers { display: grid; gap: 10px; }
.bubble { padding: 12px 14px; border-radius: 16px; background: var(--surface-2); white-space: pre-wrap; }
.bubble .who { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.bubble.mine { background: var(--accent-soft); }
.chip {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 700;
  background: var(--surface-2); color: var(--muted);
}
.chip.wait { background: var(--accent-soft); color: var(--accent); }
.chip.done { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.q-card .q-text { font-family: var(--serif); font-size: 18px; line-height: 1.4; margin-bottom: 8px; }
.depth { letter-spacing: 2px; color: var(--accent); font-size: 12px; }

/* --- карта интересов --- */
.progress { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-top: 10px; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.topic .sub { font-size: 14px; color: var(--muted); margin: 2px 0 12px; }
.levels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.lvl {
  min-height: 56px; padding: 6px 2px;
  border-radius: 14px; border: 1.5px solid var(--line);
  background: transparent; color: var(--ink);
  font: 600 12px/1.2 var(--sans); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}

.lvl[aria-pressed="true"] { border-color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); }
.lvl.love { --c: var(--love); } .lvl.like { --c: var(--like); } .lvl.curious { --c: var(--curious); } .lvl.no { --c: var(--no); }

/* --- совпадения --- */
.kind-head { display: flex; gap: 10px; align-items: center; margin: 26px 0 4px; }
.kind-head h3 { margin: 0; }
.prompts li { margin-bottom: 10px; }
.prompts { padding-left: 20px; margin: 0; }
.together li { margin-bottom: 8px; }
.together { padding-left: 20px; margin: 0; }

/* --- разговор --- */
.steps-bar { display: flex; gap: 4px; margin-bottom: 16px; }
.steps-bar i { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-2); }
.steps-bar i.done { background: var(--accent); }
.role {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 700; font-size: 15px; margin-bottom: 12px;
}
.hint { border-left: 3px solid var(--gold); padding: 4px 0 4px 12px; color: var(--muted); font-style: italic; margin: 12px 0; }
.lock-box { border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 18px; }
.consent-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 8px 0; }

/* --- пауза --- */
.pause {
  position: fixed; inset: 0; z-index: 20;
  background: var(--bg);
  display: grid; place-items: center; padding: 24px; text-align: center;
}
.pause .breath {
  width: 140px; height: 140px; margin: 0 auto 28px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  animation: breath 8s ease-in-out infinite;
}
.pause .timer { font: 600 32px var(--serif); margin: 12px 0 24px; }
@keyframes breath { 0%, 100% { transform: scale(.7); } 50% { transform: scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .pause .breath { animation: none; } }

#toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 30;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg);
  padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 15px;
  max-width: calc(100% - 32px);
  transition: opacity .2s, transform .2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.spinner { text-align: center; padding: 60px 0; color: var(--muted); }

/* --- иконки --- */
.ic { display: block; flex: none; }
.badge {
  width: 46px; height: 46px; flex: none;
  display: grid; place-items: center;
  border-radius: 15px;
  color: var(--tone, var(--accent));
  background: color-mix(in srgb, var(--tone, var(--accent)) 13%, transparent);
}
.badge.lg { width: 56px; height: 56px; border-radius: 18px; }
.tone-warm { --tone: var(--like); }
.tone-know { --tone: var(--accent); }
.tone-play { --tone: var(--curious); }
.tone-deep { --tone: var(--accent-2); }
.tone-intimacy { --tone: var(--love); }
.btn .ic, .back .ic { width: 20px; height: 20px; }
.chev .ic { width: 18px; height: 18px; }
.lvl .ic { width: 22px; height: 22px; color: var(--c); }
.lvl[aria-pressed="true"] { color: var(--ink); }
.hero .logo-mark { margin: 0 auto; display: block; }
.brand { display: flex; align-items: center; gap: 8px; font: 600 15px var(--serif); color: var(--muted); }
.daily { background: linear-gradient(150deg, var(--accent-soft), var(--surface) 70%); }
.kind-head .badge { width: 34px; height: 34px; border-radius: 11px; }
.role .ic { width: 18px; height: 18px; }
.pause-btn { min-height: 44px; padding: 0 16px; font-size: 15px; }
.item b { font-family: var(--serif); font-size: 17px; font-weight: 600; display: block; line-height: 1.3; }
.item > div { min-width: 0; overflow-wrap: anywhere; }
.top h2, .top h1 { overflow-wrap: anywhere; min-width: 0; }
.bubble, .question, .q-text, .prompts li, .together li { overflow-wrap: anywhere; }

/* --- вечер вместе --- */
.phase-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 16px; }
.phase-bar > div { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; }
.phase-bar i { height: 4px; border-radius: 2px; background: var(--surface-2); }
.phase-bar .done i { background: var(--accent); }
.phase-bar .now i { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.phase-bar .now { color: var(--accent); }
.moods { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.mood {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 2px; min-height: 76px;
  border-radius: 16px; border: 1.5px solid var(--line); background: transparent;
  color: var(--accent-2); font: 600 12px/1.2 var(--sans); cursor: pointer;
}
.mood span { color: var(--ink); }
.mood:active { transform: scale(.96); }
.moods-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mood-show { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 16px; background: var(--surface-2); color: var(--accent-2); text-align: center; font-size: 14px; }
.mood-show span { color: var(--ink); }
.mood-show.muted span { color: var(--muted); }
.ready-box { text-align: center; }
.timer-box:empty { display: none; }
.countdown { font: 600 64px/1 var(--serif); text-align: center; color: var(--accent); padding: 12px 0; animation: pulse 1s ease-in-out infinite; }
.elapsed { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; font: 600 28px var(--serif); padding: 8px 0; }
.elapsed .small { width: 100%; text-align: center; font-family: var(--sans); }
.elapsed.over { color: var(--muted); }
@keyframes pulse { 50% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .countdown { animation: none; } }

/* --- наш путь --- */
.weeks-preview { margin: 0; padding-left: 22px; }
.weeks-preview li { margin-bottom: 4px; }
.week { padding: 0; overflow: hidden; }
.week-head {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.week-head b { display: block; font-family: var(--serif); font-size: 17px; }
.week-head .small { display: block; }
.week-n {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center;
  border-radius: 50%; background: var(--surface-2); color: var(--muted); font-weight: 700;
}
.week-done .week-n { background: var(--accent); color: var(--accent-ink); }
.week-body { padding: 0 18px 16px; }
.step { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.step .badge { width: 38px; height: 38px; border-radius: 12px; }
.step a { color: inherit; text-decoration: none; }
.step a b { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.step > .grow { min-width: 0; overflow-wrap: anywhere; }
.step.done b { color: var(--muted); }
.tick { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-ink); }
.tick-btn {
  width: 36px; height: 36px; flex: none; display: grid; place-items: center;
  border-radius: 50%; border: 1.5px solid var(--line); background: transparent; color: transparent; cursor: pointer;
}
.tick-btn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tick .ic, .tick-btn .ic { width: 18px; height: 18px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.stats > div { display: flex; flex-direction: column; }
.stats b { font: 600 28px/1.1 var(--serif); color: var(--accent); }
.stats span { font-size: 14px; color: var(--muted); }

/* --- хорошая новость --- */
.label-row { display: flex; align-items: center; gap: 8px; color: var(--like); font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.label-row .ic { width: 20px; height: 20px; }
.label-row span { color: var(--accent); }
.hints { display: flex; flex-wrap: wrap; gap: 6px; }
.hint-chip {
  padding: 8px 12px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink); font: 600 14px var(--sans); cursor: pointer;
}
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }

/* --- тормоза и газ --- */
.brake .row { gap: 10px; }
.scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin-top: 12px; }
.sc {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 2px; border-radius: 12px; border: 1.5px solid var(--line); background: transparent;
  color: var(--muted); font: 600 11px/1.15 var(--sans); cursor: pointer; text-align: center;
}
.sc i { width: 14px; height: 14px; border-radius: 50%; background: var(--c); opacity: .45; }
.sc.v0 { --c: var(--accent-2); } .sc.v1 { --c: color-mix(in srgb, var(--accent-2) 55%, var(--no)); } .sc.v2 { --c: var(--no); }
.sc.v3 { --c: color-mix(in srgb, var(--love) 55%, var(--no)); } .sc.v4 { --c: var(--love); }
.sc[aria-pressed="true"] { border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--ink); }
.sc[aria-pressed="true"] i { opacity: 1; }
.eye { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--ink); cursor: pointer; }
.eye.off { color: var(--muted); }
.mood span, .sc span, .lvl { overflow-wrap: anywhere; hyphens: auto; }
.countdown.soon { font-size: 28px; padding: 30px 0; animation: none; color: var(--muted); }
.invite-link { font-size: 14px; color: var(--muted); text-align: center; padding: 10px 12px; }
a.btn { text-decoration: none; }
