:root {
  --bg: #120A0E;
  --card: #1E1218;
  --card-2: #2A1A22;
  --coral: #FF5A6E;
  --coral-hi: #FF7083;
  --coral-lo: #F2445A;
  --berry: #C2185B;
  --powder: #FFD6DC;
  --muted: #A8959C;
  --text: #FFFFFF;
  --love: #FF5A6E;
  --flirt: #A66BFF;
  --friend: #FFB020;
  --team: #2ED3A0;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --smooth: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { min-height: 100%; background: var(--bg); color: var(--text); font-family: Manrope, -apple-system, sans-serif; font-weight: 500; overscroll-behavior: none; }
button, input { font: inherit; color: inherit; border: 0; background: none; }
button { cursor: pointer; user-select: none; -webkit-user-select: none; }
img { -webkit-user-drag: none; user-select: none; }

#app { min-height: 100vh; min-height: var(--tg-viewport-stable-height, 100vh); display: flex; flex-direction: column;
  max-width: 480px; margin: 0 auto; overflow-x: hidden;
  /* In Telegram fullscreen the system bar and Telegram's own Close/menu buttons sit on top
     of the page; telegram-web-app.js exposes both insets as CSS variables. */
  padding:
    calc(16px + var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px))
    calc(20px + var(--tg-safe-area-inset-right, 0px))
    calc(18px + max(var(--tg-safe-area-inset-bottom, 0px), env(safe-area-inset-bottom)) + var(--tg-content-safe-area-inset-bottom, 0px))
    calc(20px + var(--tg-safe-area-inset-left, 0px)); }

/* ---------- screen transitions ---------- */
.screen { flex: 1; display: flex; flex-direction: column; }
.screen > * { animation: rise .6s var(--smooth) both; }
.screen > *:nth-child(2) { animation-delay: .04s } .screen > *:nth-child(3) { animation-delay: .08s }
.screen > *:nth-child(4) { animation-delay: .12s } .screen > *:nth-child(5) { animation-delay: .16s }
.screen > *:nth-child(6) { animation-delay: .2s } .screen > *:nth-child(7) { animation-delay: .24s }
.screen > *:nth-child(n+8) { animation-delay: .28s }
.screen.back > * { animation-name: riseBack; }
.screen.out { animation: out .2s ease-in forwards; }
.screen.out > * { animation: none; }
.screen.back.out { animation-name: outBack; }
@keyframes rise { from { opacity: 0; transform: translate3d(28px, 0, 0) } to { opacity: 1; transform: none } }
@keyframes riseBack { from { opacity: 0; transform: translate3d(-28px, 0, 0) } to { opacity: 1; transform: none } }
@keyframes out { to { opacity: 0; transform: translate3d(-24px, 0, 0) } }
@keyframes outBack { to { opacity: 0; transform: translate3d(24px, 0, 0) } }

.progress { display: flex; gap: 5px; margin-bottom: 14px; animation: none !important; }
.progress span { flex: 1; height: 4px; border-radius: 2px; background: var(--card-2); overflow: hidden; }
.progress span i { display: block; height: 100%; width: 0; background: var(--coral); border-radius: 2px; transition: width .6s var(--smooth); }
.progress span.on i { width: 100%; }

.bunny { width: 150px; height: 150px; object-fit: contain; align-self: center; margin: 4px 0 8px; animation: pop .7s var(--spring) both !important; }
.bunny.big { width: 200px; height: 200px; }
.bunny.float { animation: pop .7s var(--spring) both, float 3.6s ease-in-out .7s infinite !important; }
@keyframes pop { from { opacity: 0; transform: scale(.7) translateY(14px) } to { opacity: 1; transform: none } }
@keyframes float { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-7px) } }

h1 { font-family: Unbounded, sans-serif; font-weight: 800; font-size: 26px; line-height: 1.15; text-align: center; letter-spacing: -.01em; }
.sub { color: var(--muted); font-size: 15px; text-align: center; margin-top: 8px; line-height: 1.45; }

.label { color: var(--muted); font-size: 14px; font-weight: 700; text-align: center; margin: 24px 0 10px; }

/* ---------- soft buttons ---------- */
.pills { display: flex; gap: 10px; }
.pill { flex: 1; position: relative; background: var(--card); border-radius: 22px; padding: 17px 8px; font-weight: 700; font-size: 15px;
  transition: background .35s var(--smooth), transform .45s var(--spring), color .3s; }
.pill:active { transform: scale(.95); transition-duration: .12s; }
.pill.on { background: var(--coral); }
.pill.on.bump { animation: bump .5s var(--spring); }
@keyframes bump { 0% { transform: scale(.92) } 60% { transform: scale(1.05) } 100% { transform: scale(1) } }

.cta { width: 100%; border-radius: 26px; padding: 19px; font-weight: 700; font-size: 16px; letter-spacing: .01em;
  background: var(--coral);
  transition: background .4s var(--smooth), color .4s var(--smooth), transform .45s var(--spring); }
.cta:active { transform: scale(.97); transition-duration: .12s; }
.cta[aria-disabled=true] { background: var(--card-2); color: var(--muted); }
.cta.ghost { background: var(--card); margin-top: 10px; }
.legal { color: var(--muted); font-size: 12px; text-align: center; margin-top: 14px; line-height: 1.5; }
.legal a { color: var(--powder); }

/* ---------- goal list ---------- */
.list { display: grid; gap: 10px; margin-top: 22px; }
.row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 13px 16px 13px 13px; font-size: 16px; font-weight: 700; text-align: left;
  background: var(--card); border-radius: 24px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
  transition: background .35s var(--smooth), box-shadow .35s var(--smooth), transform .45s var(--spring); }
.row:active { transform: scale(.97); transition-duration: .12s; }
.row .ic { width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; flex-shrink: 0;
  transition: transform .5s var(--spring); }
.row .ic svg { width: 28px; height: 28px; }
.row small { display: block; font-size: 13px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.row .check { margin-left: auto; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 15px;
  box-shadow: inset 0 0 0 2px var(--card-2); transition: all .4s var(--spring); }
.row.on { background: color-mix(in srgb, var(--c) 16%, var(--card)); box-shadow: inset 0 0 0 1.5px var(--c); }
.row.on .ic { transform: scale(1.08) rotate(-4deg); }
.row .check i { opacity: 0; transform: scale(.4); transition: all .4s var(--spring); }
.row.on .check { background: var(--c); box-shadow: none; transform: scale(1.1); }
.row.on .check i { opacity: 1; transform: none; }

/* ---------- inputs ---------- */
.field { background: var(--card); border-radius: 20px; padding: 17px 18px; width: 100%; font-size: 16px; outline: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); transition: box-shadow .3s var(--smooth); }
.field::placeholder { color: var(--muted); }
.field:focus { box-shadow: inset 0 0 0 1.5px var(--coral); }

.slider-card { background: var(--card); border-radius: 22px; padding: 16px 18px; display: flex; align-items: center; gap: 16px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); }
.slider-card b { font-family: Unbounded, sans-serif; font-size: 20px; min-width: 70px; font-variant-numeric: tabular-nums; }

/* custom slider */
.sl { position: relative; flex: 1; height: 36px; touch-action: none; cursor: pointer; }
.sl .tr { position: absolute; left: 0; right: 0; top: 15px; height: 6px; border-radius: 3px; background: var(--card-2); }
.sl .fl { position: absolute; top: 15px; height: 6px; border-radius: 3px; background: var(--coral); }
.sl .th { position: absolute; top: 4px; width: 28px; height: 28px; margin-left: -14px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
  transition: transform .35s var(--spring), box-shadow .3s; will-change: left; }
.sl .th.active { transform: scale(1.15); }
.sl.snap .th, .sl.snap .fl { transition: left .25s var(--smooth), width .25s var(--smooth), transform .35s var(--spring); }

.note { background: rgba(255,90,110,.1); box-shadow: inset 0 0 0 1px rgba(255,90,110,.3); color: var(--powder); border-radius: 20px; padding: 14px 16px; font-size: 14px; line-height: 1.5; }
.hint { background: var(--card); color: var(--powder); border-radius: 20px; padding: 13px 16px; font-size: 14px; line-height: 1.45; text-align: center; margin-top: 16px;
  transition: opacity .25s, transform .4s var(--spring); }
.hint.swap { opacity: 0; transform: scale(.96); }

.spacer { flex: 1; min-height: 20px; }

/* ---------- voice ---------- */
.mic-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 18px; }
.mic { width: 96px; height: 96px; border-radius: 50%; font-size: 40px; display: grid; place-items: center;
  background: var(--coral); box-shadow: 0 0 0 10px rgba(255,90,110,.1);
  transition: transform .45s var(--spring), background .4s; }
.mic:active { transform: scale(.92); transition-duration: .12s; }
.mic.rec { background: var(--berry); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 10px rgba(194,24,91,.18) } 50% { box-shadow: 0 0 0 18px rgba(194,24,91,.06) } }
.mic-label { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

.wave { display: flex; align-items: center; gap: 4px; height: 48px; justify-content: center; }
.wave span { width: 5px; border-radius: 3px; background: var(--coral); height: 8px; }

.player { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 24px; padding: 10px 16px 10px 10px; margin-top: 18px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); animation: pop .6s var(--spring) both; }
.player .play { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; flex-shrink: 0;
  background: var(--coral); transition: transform .45s var(--spring); }
.player .play:active { transform: scale(.88); transition-duration: .1s; }
.player .bars { flex: 1; display: flex; align-items: center; gap: 3px; height: 34px; }
.player .bars span { flex: 1; border-radius: 2px; background: rgba(255,255,255,.22); transition: background .25s, transform .3s var(--spring); }
.player .bars span.on { background: var(--coral); transform: scaleY(1.12); }
.player .time { color: var(--muted); font-size: 13px; min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- photo ---------- */
.photo { width: 220px; height: 280px; border-radius: 32px; background: var(--card); align-self: center; margin-top: 18px; overflow: hidden;
  display: grid; place-items: center; color: var(--muted); font-size: 48px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
  animation: pop .6s var(--spring) both !important; }
.photo img { width: 100%; height: 100%; object-fit: cover; animation: fadeIn .5s var(--smooth); }
@keyframes fadeIn { from { opacity: 0; transform: scale(1.06) } to { opacity: 1; transform: none } }
.seg { display: flex; background: var(--card); border-radius: 999px; padding: 4px; align-self: center; margin-top: 14px; position: relative; }
.seg button { position: relative; z-index: 1; padding: 9px 16px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--muted); transition: color .3s; }
.seg button.on { color: #fff; }
.seg .knob { position: absolute; top: 4px; bottom: 4px; border-radius: 999px; background: var(--card-2); transition: left .45s var(--spring), width .45s var(--spring); }
.two { display: flex; gap: 10px; }
.two .cta { margin-top: 0; }

.steps { counter-reset: s; margin-top: 16px; display: grid; gap: 10px; }
.steps div { background: var(--card); border-radius: 20px; padding: 14px 16px 14px 52px; position: relative; font-size: 15px; line-height: 1.4; }
.steps div::before { counter-increment: s; content: counter(s); position: absolute; left: 14px; top: 12px; width: 26px; height: 26px; border-radius: 50%; background: var(--coral); display: grid; place-items: center; font-size: 13px; font-weight: 700; }

/* ---------- profile card ---------- */
.card { background: var(--card); border-radius: 28px; overflow: hidden; margin-top: 16px; }
.card .ph { height: 230px; position: relative; }
.card .ph img { width: 100%; height: 100%; object-fit: cover; }
.card .ph .meta { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px; background: linear-gradient(transparent, rgba(18,10,14,.92)); }
.chip { display: inline-block; border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 700; }
.card .name { font-family: Unbounded, sans-serif; font-weight: 800; font-size: 20px; margin-top: 8px; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .city { font-size: 13px; color: var(--powder); margin-top: 2px; }
.card .player { margin: 0; border-radius: 0; box-shadow: none; animation: none; }

.toast { position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #fff; color: var(--bg);
  padding: 12px 18px; border-radius: 18px; font-size: 14px; font-weight: 700; z-index: 10; max-width: 90%; text-align: center;
  animation: toastIn .45s var(--spring); box-shadow: 0 12px 30px rgba(0,0,0,.4); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 16px) scale(.9) } to { opacity: 1; transform: translate(-50%, 0) } }

.center { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.loader { width: 36px; height: 36px; border-radius: 50%; border: 4px solid var(--card-2); border-top-color: var(--coral); animation: spin .8s linear infinite !important; }
@keyframes spin { to { transform: rotate(360deg) } }

/* ---------- feed ---------- */
.feed { gap: 14px; }
.feed-top { display: flex; align-items: center; justify-content: space-between; }
.feed-title { font-family: Unbounded, sans-serif; font-weight: 800; font-size: 24px; }
.me-btn { width: 42px; height: 42px; border-radius: 50%; overflow: hidden; background: var(--card); transition: transform .4s var(--spring); }
.me-btn:active { transform: scale(.9); }
.me-btn img { width: 100%; height: 100%; object-fit: cover; }

.stack { position: relative; flex: 1; min-height: 420px; display: grid; place-items: center; overflow: hidden; border-radius: 30px; touch-action: none; }
.fcard { position: absolute; inset: 0; border-radius: 30px; overflow: hidden; background: var(--card);
  touch-action: none; user-select: none; -webkit-user-select: none; will-change: transform; }
.fcard.drag { transition: none; }
.fcard.fly { transition: transform .32s cubic-bezier(.4, 0, .9, .6); }
.fcard.under { transform: scale(.94); animation: none; filter: brightness(.7); transition: transform .35s var(--smooth); }
@keyframes cardIn { from { opacity: 0; transform: scale(.94) } to { opacity: 1; transform: none } }
.fcard .fbg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); pointer-events: none; }
.fcard .fmeta { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 16px 16px;
  background: linear-gradient(transparent, rgba(18,10,14,.75) 30%, rgba(18,10,14,.95)); }
.fcard .name { font-family: Unbounded, sans-serif; font-weight: 800; font-size: 24px; margin-top: 8px; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fcard .city { font-size: 14px; color: var(--powder); margin-top: 2px; }
.fcard .player { margin-top: 14px; background: rgba(255,255,255,.08); animation: none; }
.fcard .viz { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.fcard .viz-bunny { position: absolute; left: 50%; top: 44%; width: 52%; max-width: 230px; aspect-ratio: 560 / 536;
  transform: translate(-50%, -50%); pointer-events: none; will-change: transform; filter: drop-shadow(0 8px 18px rgba(0,0,0,.35)); }
.viz-bunny img { position: absolute; display: block; }
.viz-bunny .body { inset: 0; width: 100%; height: 100%; z-index: 1; }
/* Ear roots sit behind the headband; each ear rotates around its base. */
.viz-bunny .ear { width: 21%; height: auto; bottom: 86%; transform-origin: 50% 95%; will-change: transform; }
.viz-bunny .ear.l { left: 31%; }
.viz-bunny .ear.r { left: 49%; }
.fcard::before { content: ""; position: absolute; inset: 0; background: rgba(18,10,14,.28); pointer-events: none; }
.fcard.fly { transition: transform .38s var(--smooth), opacity .38s; }
.actions { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 2px 0 0; }
.actions.hide { visibility: hidden; pointer-events: none; }
.ears-btn { width: 84px; height: 84px; border-radius: 50%; background: var(--card); display: grid; place-items: center;
  touch-action: none; -webkit-touch-callout: none; transition: transform .35s var(--spring); }
.like-art { position: relative; width: 48px; height: 63px; --fill: 0%; }
.like-art img { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; -webkit-user-drag: none; }
.like-full { clip-path: inset(calc(100% - var(--fill)) 0 0 0); }
.ears-cap { font-size: 12px; color: var(--muted); }

.empty { text-align: center; display: flex; flex-direction: column; align-items: center; padding: 0 10px; }
.empty .cta { margin-top: 18px; width: auto; padding: 14px 28px; }

/* ---------- card extras: brand tint, question, subtitles ---------- */
.fcard::before { background: linear-gradient(160deg, rgba(58,20,52,.62) 0%, rgba(30,14,24,.35) 45%, rgba(194,24,91,.32) 100%); }
.q-bubble { position: absolute; top: 56px; left: 16px; right: 16px; background: rgba(255,214,220,.94); color: #3A1A22;
  border-radius: 18px 18px 18px 6px; padding: 10px 14px; font-weight: 700; font-size: 14px; line-height: 1.35; pointer-events: none;
  animation: pop .6s var(--spring) .15s both; }
.subs { position: absolute; left: 18px; right: 18px; top: 66%; overflow: hidden; text-align: center; font-family: Unbounded, sans-serif; font-weight: 600;
  font-size: 17px; line-height: 1.4; color: rgba(255,255,255,.55); pointer-events: none; min-height: 48px; }
.subs span { display: inline; animation: word .35s var(--spring) both; }
.subs span.now { color: #fff; }
@keyframes word { from { opacity: 0; filter: blur(4px) } to { opacity: 1; filter: none } }

/* ---------- actions row ---------- */
.act-row { display: flex; align-items: center; justify-content: center; gap: 22px; }
.env-btn { width: 56px; height: 56px; border-radius: 50%; background: var(--card); color: var(--powder); font-size: 24px;
  display: grid; place-items: center; transition: transform .4s var(--spring); }
.env-btn:active { transform: scale(.88); transition-duration: .1s; }
.act-spacer { width: 56px; }

/* ---------- dynamic island: compact live wave while playing, expands to a hint when paused ---------- */
.island { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 2; height: 32px; width: 92px;
  border-radius: 18px; background: #000; color: #fff; display: flex; align-items: center; justify-content: center; gap: 8px;
  overflow: hidden; white-space: nowrap; font-size: 13px; font-weight: 700; pointer-events: none;
  transition: width .55s var(--spring), height .55s var(--spring); }
.isl-wave { display: flex; align-items: center; gap: 3px; height: 16px; }
.isl-wave i { width: 3px; height: 16px; border-radius: 2px; background: var(--coral); transform: scaleY(.3); }
.isl-time { font-variant-numeric: tabular-nums; color: var(--powder); }
.isl-text { display: none; color: var(--powder); }
.isl-text i { color: var(--coral); }
.fcard.paused .island, .fcard.needs-tap .island { width: 236px; }
.fcard.paused .isl-wave, .fcard.paused .isl-time, .fcard.needs-tap .isl-wave, .fcard.needs-tap .isl-time { display: none; }
.fcard.paused .isl-text, .fcard.needs-tap .isl-text { display: inline; animation: fadeIn .3s .15s both; }

.fcard.glide { transition: transform .43s cubic-bezier(.22, .9, .25, 1); }

/* ---------- heart envelope: a small letter ---------- */
.letter-wrap { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center;
  padding: 0 14px calc(14px + env(safe-area-inset-bottom)); background: rgba(10,5,8,0); transition: background .35s; }
.letter-wrap.open { background: rgba(10,5,8,.55); }
.letter { position: relative; width: 100%; max-width: 440px; background: #FFF4F1; color: #3A1A22; border-radius: 26px;
  padding: 26px 20px 18px; transform: translateY(110%) rotate(3deg); transition: transform .5s var(--spring), opacity .4s; }
.letter-wrap.open .letter { transform: none; }
.letter.sent { transform: translateY(40%) scale(.2) rotate(-8deg) !important; opacity: 0; transition: transform .55s cubic-bezier(.5, 0, .75, .3), opacity .5s .1s; }
.letter.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px) } 40%, 80% { transform: translateX(6px) } }
.letter-x { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%; color: #9C7A82; font-size: 18px; display: grid; place-items: center; }
.letter-seal { position: absolute; top: -26px; left: 50%; transform: translateX(-50%); width: 56px; height: 56px; border-radius: 50%;
  background: #FFF4F1; display: grid; place-items: center; }
.letter-seal img { width: 30px; height: auto; }
.letter-to { font-family: Unbounded, sans-serif; font-weight: 800; font-size: 19px; text-align: center; margin-top: 4px; }
.letter-to b { color: var(--berry); }
.letter-sub { text-align: center; color: #9C7A82; font-size: 13px; margin-top: 4px; }
.letter-ideas { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 16px 0 12px; }
.idea { background: #FFE2E6; color: #7A1E3A; border-radius: 999px; padding: 8px 12px; font-size: 13px; font-weight: 700;
  transition: background .25s, color .25s, transform .4s var(--spring); }
.idea:active { transform: scale(.94); }
.idea.on { background: var(--coral); color: #fff; }
.letter-text { width: 100%; resize: none; border: 0; outline: none; background:
  repeating-linear-gradient(transparent 0 27px, #F2D3D8 27px 28px); color: #3A1A22; font: 600 16px/28px Manrope, sans-serif; padding: 0 2px; }
.letter-text::placeholder { color: #C4A2AA; }
.letter-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.letter-count { color: #B08A93; font-size: 12px; }
.letter-send { background: var(--coral); color: #fff; border-radius: 999px; padding: 12px 20px; font-weight: 700; font-size: 15px;
  display: flex; align-items: center; gap: 6px; transition: transform .4s var(--spring); }
.letter-send:active { transform: scale(.95); }
