/* jabbachat — light, bubblegum, mobile-first. */

:root {
  --pink: #ff8fc7;
  --pink-deep: #ff5fae;
  --violet: #a78bfa;
  --sky: #7fd3ff;
  --mint: #7ff0c0;
  --sun: #ffd66b;
  --ink: #2b2440;
  --ink-soft: #6b6386;
  --paper: #fff7fc;
  --card: #ffffff;
  --line: #f0e3f0;
  --on: #35d07f;
  --off: #c9c3d6;
  --shadow: 0 10px 30px rgba(160, 80, 160, 0.15);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* rapid taps (reactions, music keys, knocks) must never trigger iOS
   double-tap zoom — and this also removes the 300ms tap delay */
button, input, a { touch-action: manipulation; }

html, body {
  margin: 0;
  height: 100%;
  font-family: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, #fff0f8 0%, #f3f0ff 45%, #ecfbff 100%);
}

body { overflow: hidden; }

.app {
  /* Height is driven by JS from window.visualViewport so the composer + live
     bubbles stay above the mobile keyboard instead of hiding behind it. */
  height: var(--app-h, 100dvh);
  max-width: 480px;
  margin: 0 auto;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  overflow: hidden;
}

/* ---- screens ---- */
.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.screen.is-active { display: flex; }

/* ---- onboarding ---- */
.hero { text-align: center; margin-top: 18vh; }
.logo {
  font-size: 64px;
  font-weight: 900;
  letter-spacing: -2px;
  background: linear-gradient(90deg, var(--pink-deep), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.logo span { color: var(--sun); -webkit-text-fill-color: var(--sun); }
.tagline { color: var(--ink-soft); font-weight: 600; margin-top: -4px; }

.card {
  background: var(--card);
  margin: 32px 24px;
  padding: 24px;
  border-radius: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.card label { font-weight: 800; font-size: 14px; color: var(--ink-soft); }

input[type="text"],
input[type="email"] {
  font: inherit;
  font-weight: 700;
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fff;
  outline: none;
  transition: border-color .15s;
}
input[type="text"]:focus,
input[type="email"]:focus { border-color: var(--pink); }

/* ---- buttons ---- */
.btn {
  font: inherit;
  font-weight: 800;
  border: none;
  border-radius: 16px;
  padding: 14px 18px;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .15s;
}
.btn:active { transform: scale(0.96); }
.btn-primary {
  color: #fff;
  background: linear-gradient(90deg, var(--pink-deep), var(--violet));
  box-shadow: 0 8px 20px rgba(255, 95, 174, 0.35);
}
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-soft { background: #f4f0ff; color: var(--violet); }
.btn-danger { background: #ffdfe8; color: #e0356a; }
.btn.copied { background: linear-gradient(90deg, var(--mint), var(--sky)); color: var(--ink); box-shadow: 0 8px 20px rgba(127, 211, 255, .35); }
.btn-add {
  margin: 16px 20px 8px;
  color: var(--ink);
  background: #fff;
  border: 2px dashed var(--pink);
  box-shadow: var(--shadow);
}
.home-actions { display: flex; align-items: center; gap: 12px; margin: 16px 20px 8px; }
.home-actions .btn-add { flex: 1; margin: 0; }
.notif-toggle {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  margin: 0; font-weight: 800; font-size: 13px; color: var(--ink-soft); white-space: nowrap;
}
.switch {
  position: relative; width: 46px; height: 27px; padding: 0; border: none;
  border-radius: 999px; background: #d9d2e6; cursor: pointer; transition: background .15s;
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(43, 36, 64, .3);
  transition: transform .15s;
}
.switch.on { background: var(--violet); }
.switch.on::after { transform: translateX(19px); }

/* ---- topbar ---- */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  min-height: 60px;
}
.me, .peer { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.me { cursor: pointer; }
.me-username { font-size: 13px; font-weight: 800; color: var(--violet); }
.fr-username { color: var(--ink-soft); font-weight: 700; font-size: .82em; }
/* @jabba is honest about being scripted — never dressed up as a person */
.fr-bot {
  font-size: 9px; font-weight: 900; letter-spacing: .5px; text-transform: uppercase;
  color: var(--violet); background: #f4f0ff;
  border-radius: 999px; padding: 2px 7px; vertical-align: 2px;
}
.prof-label { font-weight: 800; font-size: 11px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .5px; margin-top: 4px; }
.prof-subhead { margin: 8px 0 0; font-size: 13px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .5px; }
.blocked-list { list-style: none; margin: 0; padding: 0; }
.blocked-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; font-weight: 700; }
.unblock-btn { border: none; background: #ffdfe8; color: #e0356a; font: inherit; font-weight: 800; font-size: 12px; padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.empty-sm { color: var(--ink-soft); font-weight: 600; font-size: 13px; margin: 4px 0; }
.btn-signin {
  margin-left: auto; border: 2px solid var(--violet); background: #fff; color: var(--violet);
  font: inherit; font-weight: 800; font-size: 13px; padding: 6px 14px; border-radius: 999px; cursor: pointer;
}
.btn-signin:active { transform: scale(.96); }
.username-status { font-size: 13px; font-weight: 700; min-height: 16px; }
.username-status.good { color: var(--on); }
.username-status.bad { color: var(--pink-deep); }
.me-handle, .peer-handle { font-size: 18px; }
.chat-top { justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.6); }

.icon-btn {
  border: none;
  background: #fff;
  width: 44px; height: 44px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.icon-btn:active { transform: scale(0.92); }
.icon-btn.nudge { background: linear-gradient(90deg, var(--sun), var(--pink)); }
/* The chat topbar is space-between across three children, so display:none on
   the nudge collapses its slot and shunts the name to the right. Keep the
   footprint and just make it invisible — layout never moves. (visibility
   also takes it out of the tab order and off screen readers.) */
.icon-btn.is-invisible { visibility: hidden; pointer-events: none; }
#back-btn { font-size: 30px; font-weight: 900; color: var(--pink-deep); }

/* ---- presence dots ---- */
.dot { width: 11px; height: 11px; border-radius: 50%; background: var(--off); display: inline-block; }
.dot-on, .dot.on { background: var(--on); box-shadow: 0 0 0 3px rgba(53,208,127,.2); }

/* ---- friends list ---- */
.home-body { flex: 1; overflow-y: auto; }
.list-title { margin: 12px 20px 6px; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-soft); }
.friend-list { list-style: none; margin: 0; padding: 0 12px; }
.friend-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border-radius: 18px;
  margin: 8px 0;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .08s;
}
.friend-row:active { transform: scale(0.98); }
.friend-row .fr-handle { font-weight: 800; flex: 1; }
.friend-row .fr-status { font-size: 12px; color: var(--ink-soft); font-weight: 700; }
.friend-row.has-unread { background: #fff0f8; box-shadow: 0 0 0 2px var(--pink), var(--shadow); }
.friend-row.has-unread .fr-handle { font-weight: 900; }
.fr-badge {
  min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pink-deep), var(--violet));
  color: #fff; font-weight: 800; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  animation: pop .18s ease;
}
.empty { text-align: center; color: var(--ink-soft); padding: 24px 32px; font-weight: 600; line-height: 1.5; }
.fr-clear {
  border: none; background: transparent; font-size: 16px;
  cursor: pointer; opacity: .45; padding: 6px; border-radius: 10px; line-height: 1;
}
.fr-clear:active { transform: scale(.9); opacity: 1; }
.hidden { display: none !important; }
/* profile: the sign-out block explains what leaves and what stays */
.prof-note {
  margin: 0; font-size: 11.5px; font-weight: 600; line-height: 1.45;
  color: var(--ink-soft); opacity: .85;
}

/* ---- chat ---- */
.chat-log { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.msg {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 20px;
  font-weight: 600;
  line-height: 1.35;
  word-wrap: break-word;
  animation: pop .18s ease;
}
.msg.mine { align-self: flex-end; color: #fff; background: linear-gradient(90deg, var(--pink-deep), var(--violet)); border-bottom-right-radius: 6px; }
.msg.theirs { align-self: flex-start; background: #fff; color: var(--ink); box-shadow: var(--shadow); border-bottom-left-radius: 6px; }
.msg a { color: inherit; text-decoration: underline; font-weight: 800; word-break: break-all; }
.msg.theirs a { color: var(--violet); }
/* reactions clustered at the bottom corner; each emoji grows with every tap */
.msg { position: relative; }
/* anchored just below the bubble's bottom edge, growing DOWNWARD into the
   space applyReactions reserves (margin-bottom) — never over the text */
.reactions-cluster { position: absolute; left: 6px; top: calc(100% - 8px); display: flex; gap: 2px; align-items: flex-start; z-index: 3; }
.msg.mine .reactions-cluster,
.live-bubble.mine .reactions-cluster { left: auto; right: 6px; } /* mirror for my bubbles */
.rchip {
  display: inline-block; line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(43, 36, 64, .3));
  transition: font-size .12s ease; /* smooth swell on each tap */
  animation: pop .2s ease;
}

/* vibe glow — from the 2nd reaction, intensity (--glow) grows with count */
.vibe-heart { box-shadow: 0 0 0 2px #ff8fc7, 0 0 var(--glow, 10px) rgba(255, 95, 174, .6) !important; }
.vibe-fire  { box-shadow: 0 0 0 2px #ffa24b, 0 0 var(--glow, 10px) rgba(255, 120, 40, .65) !important; }
.vibe-laugh { box-shadow: 0 0 0 2px #ffd66b, 0 0 var(--glow, 10px) rgba(255, 196, 60, .65) !important; }
.vibe-wow   { box-shadow: 0 0 0 2px #7fd3ff, 0 0 var(--glow, 10px) rgba(90, 180, 255, .6) !important; }
.vibe-sad   { box-shadow: 0 0 0 2px #a78bfa, 0 0 var(--glow, 10px) rgba(140, 110, 240, .55) !important; }

/* live as-you-type strip — two bubbles, both visible at once.
   Them on the left, you on the right, so concurrent typing is unmistakable. */
.live-strip { padding: 4px 12px; display: flex; flex-direction: column; gap: 4px; }
.live-bubble {
  position: relative;
  max-width: 85%;
  padding: 6px 12px;
  border-radius: 16px;
  font-weight: 600;
  background: rgba(255,255,255,.8);
  display: none;
}
.live-bubble.show { display: block; animation: pop .15s ease; }
.live-bubble.theirs { align-self: flex-start; color: var(--ink-soft); border: 2px dashed var(--violet); border-bottom-left-radius: 4px; }
.live-bubble.mine { align-self: flex-end; color: var(--pink-deep); border: 2px dashed var(--pink); border-bottom-right-radius: 4px; }
.live-label { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; font-weight: 800; opacity: .65; margin-right: 6px; }
.caret { display: inline-block; width: 2px; height: 1em; vertical-align: text-bottom; background: currentColor; animation: blink 1s steps(1) infinite; }

/* reactions bar */
.reactions-bar { display: flex; gap: 6px; padding: 6px 12px; justify-content: center; }
.react {
  border: none; background: #fff; font-size: 22px;
  width: 46px; height: 46px; border-radius: 50%;
  cursor: pointer; box-shadow: var(--shadow);
  transition: transform .08s;
}
.react:active { transform: scale(1.25); }

/* music instrument */
.music-open { background: linear-gradient(90deg, var(--sky), var(--violet)); }
.music-panel { display: none; padding: 10px 12px; background: rgba(255,255,255,.9); border-top: 1px solid var(--line); }
.music-panel.show { display: block; }
.music-keys { display: flex; gap: 4px; }
.music-key {
  flex: 1; min-width: 0; height: 66px; border: none; border-radius: 10px;
  background: var(--k, var(--pink)); box-shadow: var(--shadow);
  cursor: pointer; transition: transform .06s, filter .06s;
}
.music-key.hit { transform: translateY(4px) scale(.94); filter: brightness(1.25); }
/* chromatic keyboard: 25 keys wrap into rows, piano-style black keys */
.music-keys.full { flex-wrap: wrap; }
.music-keys.full .music-key { flex: 1 0 10%; height: 44px; }
.music-key.black { background: #3a3352; }

/* review-before-send: one chip per recorded note, tap to edit */
.tune-review { margin-top: 8px; background: #fff; border-radius: 14px; padding: 8px; box-shadow: var(--shadow); }
.review-hint { margin: 0 0 6px; font-size: 11px; font-weight: 700; color: var(--ink-soft); text-align: center; }
.legend { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 4px; }
.legend .lg {
  background: var(--h); color: #fff; font-size: 10px; font-weight: 800;
  padding: 2px 8px; border-radius: 999px;
}
.review-chips { display: flex; flex-wrap: wrap; gap: 4px; max-height: 88px; overflow-y: auto; }
.note-chip {
  border: 2px solid transparent; cursor: pointer;
  background: var(--h, var(--pink)); color: #fff;
  font: inherit; font-weight: 800; font-size: 11px;
  border-radius: 8px; padding: 4px 7px;
  display: inline-flex; gap: 4px; align-items: center;
}
.note-chip.sel { border-color: var(--ink); box-shadow: 0 0 0 2px #fff inset; transform: scale(1.08); }
.chip-inst { font-size: 12px; }

/* per-note editor */
.note-editor {
  display: flex; gap: 5px; align-items: center; flex-wrap: wrap;
  margin-top: 8px; padding-top: 8px; border-top: 1.5px solid var(--line);
}
.ne-label { font-size: 11px; font-weight: 900; color: var(--ink-soft); min-width: 62px; }
.ne-btn {
  border: 1.5px solid var(--line); background: var(--paper); cursor: pointer;
  font: inherit; font-weight: 800; font-size: 15px; color: var(--ink);
  min-width: 44px; min-height: 40px; padding: 8px 12px; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
}
/* ♭ / ♯ are the most-tapped controls — give them real thumb targets */
.ne-btn[data-act="up"], .ne-btn[data-act="down"] { font-size: 20px; min-width: 52px; }
.ne-btn[data-act="insert"] { font-size: 12px; }
.ne-btn:active { transform: scale(.94); }
.ne-inst { text-transform: lowercase; }
.ne-del { background: #ffdfe8; color: #e0356a; border-color: #ffc9d9; }

/* recording hint — explains layering exactly when it's actionable */
.rec-hint {
  margin: 0 0 8px; text-align: center;
  font-size: 11px; font-weight: 800; color: var(--pink-deep);
  animation: pulse 1.4s ease-in-out infinite;
}
.review-actions { display: flex; gap: 8px; margin-top: 8px; justify-content: center; }
.music-ctrl.send { background: linear-gradient(90deg, var(--pink-deep), var(--violet)); color: #fff; }
.music-ctrl.scale { order: 1; font-size: 13px; }
/* rec + close share the top row; the (now 5-wide) pill rack wraps onto its own
   full-width row below — 5 pills no longer overflow a phone screen */
.music-controls { display: flex; align-items: center; gap: 8px; margin-top: 8px; justify-content: center; flex-wrap: wrap; }
.music-ctrl.rec { order: 1; }
.music-ctrl.ghost { order: 2; }
.inst-pills { order: 3; width: 100%; justify-content: center; flex-wrap: wrap; }
.music-ctrl { font: inherit; font-weight: 800; border: none; border-radius: 12px; padding: 8px 16px; cursor: pointer; }
.music-ctrl.rec { background: #fff; color: var(--pink-deep); box-shadow: var(--shadow); }
.music-ctrl.rec.recording { background: var(--pink-deep); color: #fff; animation: pulse 1s infinite; }
.music-ctrl.ghost { background: transparent; color: var(--ink-soft); }
/* instrument selector — active pill is highlighted, so it's clear which is on */
.inst-pills { display: inline-flex; background: #f0e3f0; border-radius: 12px; padding: 3px; gap: 3px; }
.inst-pill { border: none; background: transparent; font: inherit; font-weight: 800; font-size: 12px; padding: 6px 9px; border-radius: 9px; cursor: pointer; color: var(--ink-soft); }
.inst-pill.active { background: #fff; color: var(--violet); box-shadow: var(--shadow); }
@keyframes pulse { 50% { opacity: .55; } }

/* tune message bubble */
.msg.tune-msg { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.tune-play { font-size: 1.1em; }
.tune-bars { letter-spacing: 1px; opacity: .75; font-size: .9em; }
.msg.tune-msg.playing .tune-bars { animation: pulse .4s infinite; }
.tune-label { font-size: .8em; opacity: .7; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; }
/* share-this-tune: sends a /t/#… link that plays anywhere */
.tune-share {
  border: none; cursor: pointer;
  width: 26px; height: 26px; border-radius: 50%;
  font-size: 13px; font-weight: 900; line-height: 1;
  background: rgba(255, 255, 255, .25); color: inherit;
  flex: 0 0 auto;
}
.msg.theirs .tune-share, .msg.knock-msg .tune-share { background: var(--paper); border: 1.5px solid var(--line); }

/* composer */
.composer { display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.7); border-top: 1px solid var(--line); }
.composer input { flex: 1; }
.btn-send {
  color: #fff; font-size: 18px; width: 52px;
  background: linear-gradient(90deg, var(--pink-deep), var(--violet));
}

/* ---- modal ---- */
.modal { position: fixed; inset: 0; background: rgba(43,36,64,.4); display: none; align-items: flex-end; justify-content: center; z-index: 50; }
.modal.show { display: flex; }
.modal-card {
  background: #fff; width: 100%; max-width: 480px;
  border-radius: 28px 28px 0 0; padding: 28px 24px calc(28px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 12px;
  animation: slideup .22s ease;
  max-height: 88dvh; overflow-y: auto; /* tall content scrolls inside the sheet */
}

/* tab chips (add-friend sheet) */
.tab-row { display: flex; gap: 6px; }
.tab {
  flex: 1;
  border: 1.5px solid var(--line); border-radius: 999px;
  background: var(--paper); color: var(--ink-soft);
  font: inherit; font-size: 13px; font-weight: 800;
  padding: 9px 4px; cursor: pointer;
}
.tab.active {
  background: linear-gradient(90deg, var(--pink-deep), var(--violet));
  border-color: transparent; color: #fff;
}
.sub-dim { font-size: 12px; opacity: .75; margin-top: 4px; }
.modal-card h3 { margin: 0; font-size: 22px; }
.modal-sub { margin: 0; color: var(--ink-soft); font-weight: 600; line-height: 1.4; }
.add-section { display: flex; flex-direction: column; gap: 10px; }
.add-row { display: flex; gap: 8px; }
.add-row .btn { flex: 1; }
.add-divider {
  text-align: center; color: var(--ink-soft); font-weight: 800;
  font-size: 12px; text-transform: uppercase; letter-spacing: 1px; opacity: .55;
}
/* search-a-username row: input grows, button stays compact */
.add-row #search-username { flex: 1; }
.add-row #search-btn { flex: 0 0 auto; }
.add-row .qr-btn { flex: 0 0 auto; white-space: nowrap; }

/* ---- my QR card ---- */
.my-qr {
  align-self: center;
  width: min(58%, 210px);
  padding: 12px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.my-qr svg { display: block; width: 100%; height: auto; }
#share-link { font-size: 12px; color: var(--ink-soft); }

/* ---- QR scanner overlay ---- */
.scan-overlay {
  position: fixed; inset: 0; z-index: 60;
  display: none;
  align-items: center; justify-content: center;
  background: #14101f;
}
.scan-overlay.show { display: flex; }
#scan-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.scan-frame {
  position: relative;
  width: min(62vw, 300px); aspect-ratio: 1;
  border-radius: 24px;
  border: 3px solid rgba(255, 255, 255, .9);
  box-shadow: 0 0 0 100vmax rgba(20, 16, 31, .45); /* dim everything outside the frame */
  pointer-events: none;
}
.scan-hint {
  position: absolute;
  bottom: calc(96px + env(safe-area-inset-bottom));
  left: 0; right: 0;
  text-align: center;
  color: #fff; font-weight: 800; font-size: 15px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .5);
  margin: 0;
}
.scan-cancel {
  position: absolute;
  bottom: calc(28px + env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%);
  background: rgba(255, 255, 255, .92);
}

/* ---- identity card (shared by search result + request rows) ---- */
.req-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.req-name { font-weight: 800; }
.req-bio { font-size: 12px; color: var(--ink-soft); font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.req-mutual { font-size: 11px; font-weight: 800; color: var(--violet); }
.search-msg { color: var(--ink-soft); font-weight: 700; font-size: 13px; }

/* search result card inside the add-friend sheet */
.search-result {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; margin-top: 2px;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 16px;
}
.search-result .sr-action { flex: 0 0 auto; }
.search-result .sr-action .btn { padding: 8px 14px; }

/* ---- incoming friend requests (home) ---- */
.requests-section { margin-bottom: 4px; }
.requests-list { list-style: none; margin: 0; padding: 0 12px; }
.request-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; margin: 8px 0;
  background: #fff; border-radius: 18px;
  box-shadow: 0 0 0 2px var(--violet), var(--shadow);
}
.req-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.req-accept {
  border: none; cursor: pointer; font-weight: 800; font-size: 13px;
  padding: 8px 14px; border-radius: 999px; color: #fff;
  background: linear-gradient(90deg, var(--pink-deep), var(--violet));
}
.req-decline {
  border: none; cursor: pointer; font-weight: 800; font-size: 15px;
  width: 34px; height: 34px; border-radius: 999px;
  background: var(--line); color: var(--ink-soft);
}
.req-accept:active, .req-decline:active { transform: scale(0.94); }

/* ---- knock strip (offline friend → knock instead of type) ---- */
.knock-strip {
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1.5px solid var(--line);
  display: flex; flex-direction: column; gap: 8px;
}
/* header = collapse toggle, so the conversation can be read in full */
.knock-toggle {
  border: none; background: transparent; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 800; color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 2px 0; width: 100%;
}
.knock-picker { display: flex; flex-direction: column; gap: 8px; }
.knock-strip.collapsed .knock-picker,
.knock-strip.collapsed .knock-send-bar { display: none; }
.knock-row { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
/* Phrases WRAP. They used to scroll sideways with the scrollbar hidden, which
   left desktop users unable to reach the ones off-screen — no swipe, nothing to
   drag. The sideways strip only existed because the emoji row was six buttons
   wide; now it's one, so there's room to simply show them all. */
.knock-phrases { flex-wrap: wrap; justify-content: center; }
.knock-phrases .knock { flex: 0 1 auto; }

/* full-screen knock preview takeover (fx-layer z-60 rains over this scrim) */
.knock-preview {
  position: fixed; inset: 0; z-index: 55;
  display: none; flex-direction: column;
  justify-content: space-between; align-items: center;
  background: rgba(24, 18, 42, .35);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.knock-preview.show { display: flex; }
.kp-hint {
  margin-top: calc(20px + env(safe-area-inset-top));
  color: #fff; font-weight: 700; font-size: 13px;
  background: rgba(24, 18, 42, .45);
  border-radius: 999px; padding: 8px 16px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .4);
}
.kp-actions {
  display: flex; gap: 10px; align-items: center;
  width: min(92%, 420px);
  margin-bottom: calc(26px + env(safe-area-inset-bottom));
}
.kp-send {
  flex: 1; border: none; cursor: pointer;
  font: inherit; font-weight: 900; font-size: 17px; color: #fff;
  padding: 16px 20px; border-radius: 999px;
  background: linear-gradient(90deg, var(--pink-deep), var(--violet));
  box-shadow: 0 10px 30px rgba(255, 95, 174, .55);
  animation: pop .18s ease;
}
.kp-send:active { transform: scale(.97); }
.kp-cancel {
  flex: 0 0 auto; border: none; cursor: pointer;
  width: 54px; height: 54px; border-radius: 50%;
  background: rgba(255, 255, 255, .94); color: var(--ink);
  font: inherit; font-weight: 900; font-size: 18px;
  box-shadow: 0 6px 20px rgba(24, 18, 42, .3);
}
.knock {
  border: none; cursor: pointer;
  background: var(--paper); border: 1.5px solid var(--line);
  border-radius: 999px;
  font-size: 20px; padding: 6px 12px;
  transition: transform .08s, box-shadow .15s;
}
.knock:active { transform: scale(.92); }
/* Armed = tapped once. The button grows, glows, and sprouts an explicit
   "send?" tag so the two-tap flow explains itself. */
.knock.armed {
  background: #fff;
  border-color: var(--pink-deep);
  box-shadow: 0 0 0 3px var(--pink), 0 0 18px rgba(255, 95, 174, .55);
  animation: knock-pulse .6s ease-in-out infinite;
  position: relative;
  z-index: 5;
}
@keyframes knock-pulse { 50% { transform: scale(1.12); } }
.knock-phrase { font-size: 13px; font-weight: 800; color: var(--ink); }
/* a labelled pill, so it's obvious what it does (vs a bare 📅 among emoji) */
.knock-pill { font-size: 12px; font-weight: 800; color: var(--ink); padding: 8px 14px; }
.date-copy {
  margin: 0; font-size: 11px; font-weight: 700; line-height: 1.45;
  color: var(--ink-soft); text-align: center;
}
/* jabba date: a week of day chips + a time — no full calendar */
.knock-date-row { display: flex; flex-direction: column; gap: 8px; }
/* likewise: wrap, so every day is reachable without a swipe */
.date-days { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.date-chip {
  flex: 0 0 auto; border: 1.5px solid var(--line); cursor: pointer;
  background: var(--paper); color: var(--ink-soft);
  font: inherit; font-weight: 800; font-size: 12px;
  padding: 7px 12px; border-radius: 999px; white-space: nowrap;
}
.date-chip.active {
  background: linear-gradient(90deg, var(--pink-deep), var(--violet));
  border-color: transparent; color: #fff;
}
.date-when { display: flex; gap: 8px; align-items: center; }
.date-when #date-time {
  flex: 0 0 auto;
  border: 1.5px solid var(--line); border-radius: 12px;
  padding: 8px 10px; font: inherit; font-size: 14px; font-weight: 800; color: var(--ink);
  background: var(--paper);
}
.date-preview { flex: 1; min-width: 0; font-size: 11px; font-weight: 800; color: var(--violet); }
.date-preview.bad { color: #e0356a; }
.date-when .btn { flex: 0 0 auto; padding: 10px 14px; font-size: 13px; }

/* knock bubbles in the stream — solid card + ink text on BOTH sides (mine
   normally has white text on gradient; a knock card must stay readable) */
.msg.knock-msg {
  background: #fff !important; color: var(--ink) !important;
  box-shadow: var(--shadow);
  border: 2px dashed var(--pink); border-radius: 16px;
  display: inline-flex; align-items: center; gap: 8px;
}
.msg.mine.knock-msg { border-color: var(--violet); }
.knock-big { font-size: 34px; line-height: 1; }
.knock-text { font-weight: 800; font-size: 14px; }
/* recall a knock that's still queued at their door */
.unsend-btn {
  border: 1.5px solid var(--line); background: var(--paper); cursor: pointer;
  color: var(--ink-soft); font: inherit; font-weight: 800; font-size: 11px;
  padding: 4px 10px; border-radius: 999px; margin-left: 4px;
}
.unsend-btn:active { transform: scale(.94); }
.date-accept-btn {
  border: none; cursor: pointer; font-weight: 800; font-size: 12px;
  padding: 6px 12px; border-radius: 999px; color: #fff;
  background: linear-gradient(90deg, var(--pink-deep), var(--violet));
}

/* ---- feedback ---- */
.fb-scale { display: flex; justify-content: space-between; gap: 6px; }
.fb-face {
  flex: 1; border: 2px solid transparent; background: var(--paper);
  border-radius: 14px; padding: 10px 0; font-size: 26px; cursor: pointer;
  transition: transform .1s, border-color .12s, background .12s;
}
.fb-face:active { transform: scale(.92); }
.fb-face.picked {
  border-color: var(--pink-deep); background: #fff;
  transform: scale(1.12);
  box-shadow: 0 6px 18px rgba(255, 95, 174, .3);
}
.fb-ends {
  display: flex; justify-content: space-between;
  font-size: 11px; font-weight: 700; color: var(--ink-soft); opacity: .8;
  margin-top: -6px;
}
.fb-fine { margin: 0; font-size: 11px; font-weight: 600; line-height: 1.45; color: var(--ink-soft); opacity: .85; }
.fb-anon {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 700; color: var(--ink-soft); cursor: pointer;
}
.fb-anon input { width: 18px; height: 18px; accent-color: var(--violet); }

/* passive entry point at the foot of the friend list */
.fb-inline {
  margin: 18px 12px calc(20px + env(safe-area-inset-bottom));
  padding: 14px 12px;
  border-top: 1.5px dashed var(--line);
  display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.fb-inline-q { margin: 0; font-size: 13px; font-weight: 800; color: var(--ink-soft); }
.fb-inline-scale { width: 100%; max-width: 300px; }
.fb-inline-scale .fb-face { font-size: 22px; padding: 6px 0; background: transparent; }
.fb-inline-scale .fb-face:hover { background: var(--paper); }

/* ---- empty friends list: the conversion screen ---- */
.empty-hero {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  padding: 26px 28px 20px;
  gap: 12px;
}
/* you ● ——— ○ them: the whole product in one glyph */
.eh-pair { display: flex; align-items: center; gap: 0; margin-bottom: 4px; }
.eh-dot { width: 16px; height: 16px; border-radius: 50%; }
.eh-you { background: linear-gradient(135deg, var(--pink-deep), var(--violet)); }
.eh-them {
  background: transparent;
  border: 2.5px dashed var(--pink);
  animation: eh-wait 2.4s ease-in-out infinite;
}
@keyframes eh-wait { 50% { transform: scale(1.25); opacity: .55; } }
.eh-line {
  width: 54px; height: 2.5px;
  background: linear-gradient(90deg, var(--violet), var(--pink));
  opacity: .4;
}
.eh-title {
  margin: 0; font-size: 21px; font-weight: 900; line-height: 1.25;
  letter-spacing: -.3px; text-wrap: balance;
}
.eh-sub {
  margin: 0; max-width: 280px;
  font-size: 14px; font-weight: 600; line-height: 1.5; color: var(--ink-soft);
}
.eh-btn { width: 100%; max-width: 300px; margin-top: 4px; font-size: 16px; }
.eh-username {
  display: flex; flex-direction: column; gap: 2px; align-items: center;
  font-size: 12px; font-weight: 700; color: var(--ink-soft);
  background: var(--paper); border: 1.5px solid var(--line);
  border-radius: 14px; padding: 8px 18px;
}
.eh-username b { font-size: 15px; color: var(--violet); }
.eh-more { font-size: 13px; padding: 6px 12px; }
@media (prefers-reduced-motion: reduce) { .eh-them { animation: none; } }

/* ---- empty-thread zero state ---- */
.zero-state {
  margin: auto;
  max-width: 260px;
  text-align: center;
  display: flex; flex-direction: column; gap: 6px;
  color: var(--ink-soft);
  font-size: 13px; font-weight: 600; line-height: 1.5;
}
.zero-state b { color: var(--ink); font-size: 14px; }
.zero-emoji { font-size: 40px; line-height: 1; }

/* ---- day separators in the chat log ---- */
.day-sep { text-align: center; margin: 14px 0 6px; }
.day-sep span {
  display: inline-block;
  font-size: 11px; font-weight: 800; text-transform: lowercase;
  color: var(--ink-soft);
  background: #fff; border: 1.5px solid var(--line);
  border-radius: 999px; padding: 3px 12px;
}

/* ---- delivery marks (subtle) ---- */
.msg-status {
  position: absolute; right: 6px; bottom: 2px;
  font-size: 10px; font-weight: 800; line-height: 1;
}
.msg-status.st-p { opacity: 0; }
.msg-status.st-q { opacity: 1; color: #b9b3cc; }  /* grey ✓ = safely on the server */
.msg-status.st-d { opacity: 1; color: #5bbcff; }  /* blue ✓ = actually in their hands */
.msg-status.st-f {
  opacity: 1; color: #e0356a;
  background: #ffdfe8; border-radius: 999px; padding: 2px 6px;
  bottom: -8px; font-size: 11px;
}

.notify-head { margin: 0; font-size: 20px; text-align: center; text-wrap: balance; }
.notify-variant { display: flex; flex-direction: column; gap: 12px; }
/* iOS install recipe — numbered because the order genuinely matters */
.ios-steps {
  margin: 0; padding-left: 22px;
  display: flex; flex-direction: column; gap: 8px;
  font-size: 14px; font-weight: 600; line-height: 1.45; color: var(--ink-soft);
}
.ios-steps b { color: var(--ink); }
.ios-share {
  width: 15px; height: 15px; vertical-align: -2px;
  color: var(--violet); margin: 0 1px;
}
/* ---- notification priming: iOS-style lock-screen banner, live-cycling ---- */
.notif-mock {
  display: flex; align-items: center; gap: 10px;
  background: rgba(250, 248, 255, .96);
  border: 1px solid var(--line);
  border-radius: 18px; padding: 12px 14px;
  box-shadow: 0 14px 38px rgba(43, 36, 64, .22);
}
.nm-icon { width: 38px; height: 38px; border-radius: 9px; flex: 0 0 auto; }
.nm-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.nm-body b { font-size: 13px; }
#nm-text {
  font-size: 13px; font-weight: 600; color: var(--ink-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nm-time { font-size: 11px; color: var(--ink-soft); align-self: flex-start; }
.notif-mock.drop { animation: nm-drop .55s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes nm-drop {
  from { transform: translateY(-30px) scale(.95); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

/* ---- settings screen ---- */
.settings-body { flex: 1; overflow-y: auto; padding: 4px 0 32px; }
.topbar-spacer { width: 44px; flex: 0 0 auto; } /* balances the back button */
.set-group {
  margin: 18px 24px 6px; font-size: 11px; font-weight: 900;
  letter-spacing: 1.2px; text-transform: uppercase; color: var(--ink-soft);
}
.set-card {
  background: #fff; margin: 0 16px; padding: 16px;
  border-radius: 20px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px;
}
.set-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 14px; font-weight: 700; color: var(--ink);
}
.set-row b { color: var(--violet); }
.set-card .notif-toggle { margin: 0; font-size: 14px; color: var(--ink); }
/* irreversible actions live apart from everything else, at the very bottom */
.danger-zone {
  margin: 32px 16px 0; padding: 16px;
  border: 1.5px dashed #ffc9d9; border-radius: 20px;
  display: flex; flex-direction: column; gap: 10px;
}

/* ---- the demo: a live sample of the one thing that can't be described ---- */
.demo-wrap:empty { display: none; }
.demo-wrap {
  margin: 18px 24px 0;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 20px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 6px;
}
.demo-head { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-soft); }
.demo-head b { color: var(--ink); font-size: 13px; }
.demo-tag {
  margin-left: auto; font-size: 9px; font-weight: 900; letter-spacing: 1px;
  text-transform: uppercase; color: var(--pink-deep);
  background: #fff0f8; border-radius: 999px; padding: 2px 8px;
}
.demo-line {
  position: relative;
  min-height: 34px; padding: 8px 12px; border-radius: 14px;
  font-size: 13.5px; font-weight: 600; line-height: 1.35;
  display: flex; align-items: center; flex-wrap: wrap;
}
.demo-line.theirs { background: var(--paper); color: var(--ink); }
.demo-line.mine {
  background: linear-gradient(90deg, var(--pink-deep), var(--violet));
  color: #fff;
}
.dl-label { font-size: 10px; font-weight: 900; opacity: .7; margin-right: 6px; text-transform: uppercase; }
.dl-react { margin-left: 6px; font-size: 17px; }
.dl-react.pop { animation: pop .3s cubic-bezier(.2, 1.6, .4, 1); }
.demo-input {
  border: 1.5px solid var(--line); border-radius: 12px;
  padding: 9px 12px; font: inherit; font-size: 13px; font-weight: 700;
  background: var(--paper); outline: none;
}
.demo-input:focus { border-color: var(--pink); }
/* both secondary actions on one quiet line, well below the primary */
.eh-secondary { display: flex; gap: 4px; align-items: center; justify-content: center; flex-wrap: wrap; }
.eh-secondary .eh-more { font-size: 12.5px; padding: 6px 10px; }

/* studio = the chat screen with the conversation stripped out */
.studio-mode .chat-log,
.studio-mode .live-strip,
.studio-mode .reactions-bar,
.studio-mode .composer,
.studio-mode #knock-strip,
.studio-mode #nudge-btn { display: none !important; }
.studio-hint {
  margin: 14px 20px; text-align: center;
  font-size: 13px; font-weight: 700; line-height: 1.5; color: var(--ink-soft);
}

/* ---- "someone invited you" banner on the welcome screen ---- */
.invite-banner {
  margin: 24px 24px -8px;
  padding: 16px 18px;
  background: #fff;
  border: 2px solid var(--pink);
  border-radius: 20px;
  box-shadow: var(--shadow);
  text-align: center;
  animation: pop .25s ease;
}
.ib-emoji { font-size: 30px; line-height: 1; display: block; margin-bottom: 4px; }
.ib-text { margin: 0; font-size: 16px; font-weight: 700; color: var(--ink); }
.ib-text b { font-weight: 900; color: var(--pink-deep); }
.ib-sub { margin: 4px 0 0; font-size: 12px; font-weight: 600; color: var(--ink-soft); }

/* ---- onboarding fineprint ---- */
.fineprint {
  margin: 18px 32px 0;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink-soft);
  opacity: .8;
}

/* ---- toast ---- */
#toast {
  position: fixed;
  left: 50%;
  top: calc(16px + env(safe-area-inset-top));
  transform: translateX(-50%);
  max-width: 88%;
  background: #2b2440;
  color: #fff;
  padding: 12px 18px;
  border-radius: 16px;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
  white-space: pre-line; /* render the \n line breaks in multi-step messages */
  z-index: 100;
  box-shadow: 0 8px 24px rgba(43, 36, 64, .35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
#toast.show { opacity: 1; }

/* ---- welcome splash (new visitors only) ---- */
.splash {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  background: #322b57; /* matches the artwork's dark backdrop */
}
.splash.show { display: flex; }
.splash.fade { opacity: 0; transition: opacity .5s ease; }
.splash-img { width: 100%; height: 100%; object-fit: contain; }

/* ---- fx layer (flying reactions) ---- */
.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.fx-emoji { position: absolute; font-size: 42px; animation: floatup 1.6s ease-out forwards; }

/* ---- knock FX: cartoonish, exaggerated ---- */
/* one GIANT emoji pops in the middle of the screen with a bounce */
.fx-big {
  position: absolute; left: 50%; top: 40%;
  font-size: min(45vw, 220px);
  line-height: 1;
  transform: translate(-50%, -50%) scale(0);
  filter: drop-shadow(0 10px 30px rgba(43, 36, 64, .35));
  animation: big-pop 1.5s cubic-bezier(.2, 1.6, .4, 1) forwards;
}
@keyframes big-pop {
  0%   { transform: translate(-50%, -50%) scale(0) rotate(-14deg); opacity: 0; }
  30%  { transform: translate(-50%, -50%) scale(1.2) rotate(4deg); opacity: 1; }
  50%  { transform: translate(-50%, -50%) scale(.92) rotate(-2deg); }
  70%  { transform: translate(-50%, -50%) scale(1.05) rotate(0deg); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.35); opacity: 0; }
}
/* a STORM: many copies with per-emoji physics (class storm-<style>) */
.fx-storm { position: absolute; top: -70px; line-height: 1; }
.fx-storm > span { display: inline-block; }

/* default: tumble straight down */
.storm-fall { animation: storm-fall linear forwards; }
@keyframes storm-fall {
  0%   { transform: translateY(0) rotate(-15deg); opacity: 0; }
  8%   { opacity: 1; }
  100% { transform: translateY(115vh) rotate(15deg); opacity: .85; }
}
/* hearts/stars: drift down slowly while swaying side to side */
.storm-sway { animation: storm-fall linear forwards; }
.storm-sway > span { animation: sway-x 1.2s ease-in-out infinite alternate; }
@keyframes sway-x {
  from { transform: translateX(-16px) rotate(-12deg); }
  to   { transform: translateX(16px) rotate(12deg); }
}
/* tears: hammer down fast with a slight slant */
.storm-rain { animation: storm-rain linear forwards; }
@keyframes storm-rain {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  10%  { opacity: 1; }
  100% { transform: translateY(115vh) translateX(9vw); opacity: .9; }
}
/* fire/muscle: rises from the bottom edge like flames, flickering */
.storm-rise { top: auto; bottom: -70px; animation: storm-rise ease-out forwards; }
@keyframes storm-rise {
  0%   { transform: translateY(0) scale(.7); opacity: 0; }
  12%  { opacity: 1; }
  70%  { opacity: .95; }
  100% { transform: translateY(-112vh) scale(1.3); opacity: 0; }
}
.storm-rise > span { animation: flicker .26s ease-in-out infinite alternate; }
@keyframes flicker {
  from { transform: scale(1) rotate(-7deg); }
  to   { transform: scale(1.18) rotate(7deg); }
}
/* laughter: drops and bounces off the bottom */
.storm-bounce { animation: storm-bounce forwards; }
@keyframes storm-bounce {
  0%   { transform: translateY(0); opacity: 0; animation-timing-function: cubic-bezier(.5,0,1,1); }
  8%   { opacity: 1; }
  46%  { transform: translateY(94vh); animation-timing-function: cubic-bezier(0,0,.4,1); }
  63%  { transform: translateY(70vh); animation-timing-function: cubic-bezier(.5,0,1,1); }
  77%  { transform: translateY(94vh); animation-timing-function: cubic-bezier(0,0,.5,1); }
  87%  { transform: translateY(86vh); animation-timing-function: cubic-bezier(.5,0,1,1); }
  95%  { transform: translateY(94vh); opacity: 1; }
  100% { transform: translateY(94vh); opacity: 0; }
}
/* Vortex: the wrapper sits at the centre and ROTATES, carrying its emoji
   around on an arm (the child is pushed out by --r). Scaling the wrapper grows
   that arm, so the path spirals outward instead of just spinning in place —
   which is all a transform on the emoji itself can ever do. */
.fx-vortex {
  position: absolute; left: 50%; top: 44%;
  width: 0; height: 0;
  /* 'both', not 'forwards': each orbit has a random start delay, and with only
     a forwards fill the element renders untransformed until that delay expires
     — the child already sits at its full translateX(--r), so the emoji appears
     way out at full radius and then SNAPS inward to scale(.15) when the
     animation finally begins. Filling backwards holds the 0% state through the
     delay, so it starts small at the centre as intended. */
  animation: vortex-orbit linear both;
}
.fx-vortex > span {
  position: absolute;
  display: inline-block;
  transform: translateX(var(--r, 90px));
  /* The keyframes must repeat the translate: an animated `transform` REPLACES
     the static one, so spinning with plain rotate() would yank every emoji
     back to the centre and there'd be no orbit at all. */
  animation: tumble-on-arm .8s linear infinite;
}
@keyframes tumble-on-arm {
  from { transform: translateX(var(--r, 90px)) rotate(0deg); }
  to   { transform: translateX(var(--r, 90px)) rotate(360deg); }
}
@keyframes vortex-orbit {
  0%   { transform: rotate(var(--a0, 0deg)) scale(.15); opacity: 0; }
  10%  { opacity: 1; }
  82%  { opacity: 1; }   /* hold visible longer, fade only at the very end */
  100% { transform: rotate(calc(var(--a0, 0deg) + var(--turn, 540deg))) scale(1.5); opacity: 0; }
}

/* nudge-💥: explodes outward from the center */
.storm-burst { animation: storm-burst ease-out forwards; }
@keyframes storm-burst {
  0%   { transform: translate(-50%, -50%) scale(.4); opacity: 0; }
  15%  { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, 0px))) scale(1.3) rotate(20deg); opacity: 0; }
}

/* full-screen mood wash (good morning / good night) */
.fx-overlay { position: absolute; inset: 0; opacity: 0; animation: overlay-fade 2.3s ease-in-out forwards; }
.fx-overlay.warm {
  background: radial-gradient(circle at 50% 12%, rgba(255, 224, 120, .95), rgba(255, 170, 60, .55) 55%, rgba(255, 200, 120, .18) 85%);
}
.fx-overlay.night {
  background: linear-gradient(180deg, rgba(18, 14, 48, .88), rgba(32, 26, 72, .55));
}
@keyframes overlay-fade { 0% { opacity: 0; } 25% { opacity: 1; } 72% { opacity: 1; } 100% { opacity: 0; } }

/* the poke: a giant 👉 slides in from the left and jabs twice */
.fx-poke {
  position: absolute; left: 0; top: 40%;
  font-size: min(38vw, 190px); line-height: 1;
  transform: translateX(-130%);
  filter: drop-shadow(0 8px 24px rgba(43, 36, 64, .35));
  animation: poke-jab 1.6s ease-in-out forwards;
}
@keyframes poke-jab {
  0%   { transform: translateX(-130%); }
  28%  { transform: translateX(28vw); }
  42%  { transform: translateX(18vw); }
  56%  { transform: translateX(32vw); }
  70%  { transform: translateX(20vw); }
  100% { transform: translateX(-140%); }
}
/* HUGE cartoon text: thick white outline, drop shadow, slight tilt, bounce */
.fx-bigtext {
  position: absolute; left: 50%; top: 38%;
  max-width: 92vw;
  text-align: center;
  font-size: clamp(30px, 10vw, 60px);
  font-weight: 900;
  letter-spacing: .5px;
  color: var(--pink-deep);
  -webkit-text-stroke: 6px #fff;
  paint-order: stroke fill;
  text-shadow: 0 5px 0 rgba(43, 36, 64, .18), 0 0 30px rgba(255, 143, 199, .8);
  transform: translate(-50%, -50%) rotate(var(--rot, -4deg)) scale(0);
  animation: bigtext-pop 1.9s cubic-bezier(.2, 1.6, .4, 1) forwards;
}
@keyframes bigtext-pop {
  0%   { transform: translate(-50%, -50%) rotate(var(--rot, -4deg)) scale(0); opacity: 0; }
  22%  { transform: translate(-50%, -50%) rotate(var(--rot, -4deg)) scale(1.15); opacity: 1; }
  40%  { transform: translate(-50%, -50%) rotate(var(--rot, -4deg)) scale(.95); }
  60%  { transform: translate(-50%, -50%) rotate(var(--rot, -4deg)) scale(1.03); }
  82%  { transform: translate(-50%, -50%) rotate(var(--rot, -4deg)) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) rotate(var(--rot, -4deg)) scale(1.15); opacity: 0; }
}
/* slam entrance: crashes down from huge, with a jolt (gym energy) */
.fx-bigtext.slam { animation: bigtext-slam 1.7s ease-out forwards; }
@keyframes bigtext-slam {
  0%   { transform: translate(-50%, -50%) rotate(var(--rot, -4deg)) scale(3.2); opacity: 0; }
  13%  { transform: translate(-50%, -50%) rotate(var(--rot, -4deg)) scale(1); opacity: 1; }
  19%  { transform: translate(-50%, -53%) rotate(var(--rot, -4deg)) scale(1.07); }
  25%  { transform: translate(-50%, -50%) rotate(var(--rot, -4deg)) scale(1); }
  80%  { opacity: 1; }
  100% { transform: translate(-50%, -50%) rotate(var(--rot, -4deg)) scale(1.05); opacity: 0; }
}
/* confusion shouldn't sit still — the text itself wavers */
.fx-bigtext.wobble { animation: bigtext-wobble 2s ease-in-out forwards; }
@keyframes bigtext-wobble {
  0%   { transform: translate(-50%, -50%) rotate(-8deg) scale(0); opacity: 0; }
  18%  { transform: translate(-50%, -50%) rotate(6deg) scale(1.1); opacity: 1; }
  34%  { transform: translate(-50%, -50%) rotate(-5deg) scale(1); }
  50%  { transform: translate(-50%, -50%) rotate(4deg) scale(1.03); }
  66%  { transform: translate(-50%, -50%) rotate(-3deg) scale(1); }
  82%  { transform: translate(-50%, -50%) rotate(2deg) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) rotate(0deg) scale(1.1); opacity: 0; }
}

/* glitch entrance: robotic monospace jitter (beep boop) */
.fx-bigtext.glitch {
  color: var(--sky);
  -webkit-text-stroke: 5px #2b2440;
  font-family: "Courier New", monospace;
  animation: bigtext-glitch 1.8s steps(1) forwards;
}
@keyframes bigtext-glitch {
  0%   { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  10%  { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  20%  { transform: translate(-52%, -48%) scale(1) skewX(8deg); }
  30%  { transform: translate(-48%, -52%) scale(1.03) skewX(-8deg); }
  40%  { transform: translate(-50%, -50%) scale(1); }
  52%  { transform: translate(-51%, -50%) skewX(5deg); opacity: .7; }
  58%  { transform: translate(-49%, -50%) skewX(-4deg); opacity: 1; }
  72%  { transform: translate(-50%, -51%); }
  85%  { transform: translate(-50%, -50%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 0; }
}

/* Must come AFTER .slam/.wobble/.glitch: those set the `animation` shorthand,
   which resets duration, and at equal specificity (two classes) the later rule
   wins. Declared earlier, this silently did nothing on the styled variants.
   Vortex storms run 2–3.5s; the default 1.9s headline vanished mid-swirl.
   Every entrance lands inside the first ~20%, so scaling stays snappy. */
.fx-bigtext.hold { animation-duration: var(--hold, 3.4s) !important; }


/* ---- screen shake (nudge) ---- */
.shake { animation: shake .5s cubic-bezier(.36,.07,.19,.97) both; }

/* ---- keyframes ---- */
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes slideup { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes floatup {
  0% { transform: translateY(0) scale(.6); opacity: 0; }
  20% { opacity: 1; transform: translateY(-10px) scale(1.2); }
  100% { transform: translateY(-70vh) scale(1); opacity: 0; }
}
@keyframes shake {
  10%, 90% { transform: translate(-2px, 0); }
  20%, 80% { transform: translate(4px, 0); }
  30%, 50%, 70% { transform: translate(-8px, 0); }
  40%, 60% { transform: translate(8px, 0); }
}
