/* Twinvibe VibeCheck Lite: sticker-pack Y2K, loud on purpose.
   No images, no fonts, no libraries: shapes, borders and emoji only.
   Every animation stops under prefers-reduced-motion. */

:root {
  --bg: #fff4dc;
  --paper: #ffffff;
  --ink: #1b1230;
  --muted: #5d5470;
  --violet: #7c3aed;
  --pink: #ff4fa3;
  --lime: #c6f432;
  --sun: #ffd23f;
  --sky: #4cc9f0;
  --soft: #f1e6ff;
  --err: #c2260c;
  --shadow: 5px 5px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --round: 22px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #130a23;
    --paper: #21143a;
    --ink: #f7efff;
    --muted: #b9acd3;
    --soft: #2f1f52;
    --err: #ff8a6b;
    --shadow: 5px 5px 0 #7c3aed;
    --shadow-sm: 3px 3px 0 #7c3aed;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overscroll-behavior-y: none; }
body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(circle at 12% 8%, rgba(255, 79, 163, 0.22), transparent 38%),
                    radial-gradient(circle at 92% 22%, rgba(76, 201, 240, 0.25), transparent 34%),
                    radial-gradient(circle at 50% 100%, rgba(198, 244, 50, 0.22), transparent 40%);
  background-attachment: fixed;
  color: var(--ink);
  font: 17px/1.5 ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
  overflow-x: hidden;
}
main { max-width: 580px; margin: 0 auto; padding: 18px 16px 56px; position: relative; }
main.has-tabs { padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }
button, .btn, select, input { touch-action: manipulation; }
button, .btn { -webkit-user-select: none; user-select: none; }
h1, h2 { margin: 0 0 8px; line-height: 1.08; letter-spacing: -0.02em; font-weight: 900; }
h1 { font-size: clamp(2rem, 8vw, 2.9rem); }
h2 { font-size: 1.35rem; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 0.93rem; }
.center { text-align: center; }

/* the public about page */
.about h3 { font-size: 1.05rem; margin: 6px 0 2px; }
.about ol { margin: 0; padding-left: 1.3em; display: grid; gap: 8px; }
.about a:not(.btn), .boot-link { color: var(--violet); font-weight: 700; }
.about .btn { text-decoration: none; text-align: center; display: block; }
.link-about { text-align: center; margin: 0; }

/* brand sticker */
.brand {
  display: inline-block;
  font-weight: 900;
  font-size: 1.15rem;
  background: var(--sun);
  color: #1b1230;
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 4px 12px;
  box-shadow: var(--shadow-sm);
  transform: rotate(-2deg);
  margin: 2px 0 20px;
}
.brand span { color: var(--violet); }

/* cards = stickers */
.card {
  position: relative;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--round);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}
.card.pop { animation: slide-in 0.35s cubic-bezier(0.2, 1.2, 0.4, 1) both; }
.card.pink { background: #ffd6ea; color: #1b1230; }
.card.lime { background: var(--lime); color: #1b1230; }
.card.sky { background: #c9f1fd; color: #1b1230; }
/* The soft card follows the theme: lavender in light mode, deep violet in dark mode. */
.card.sun { background: var(--soft); color: var(--ink); }
/* Text inside the fixed-colour cards stays dark in both themes, so muted lines and labels never turn pale on pale. */
.card.pink .muted, .card.lime .muted, .card.sky .muted,
.card.pink label, .card.lime label, .card.sky label { color: #4a4060; }
/* A card that follows the theme: soft lavender in light mode, deep violet in dark mode. */
.card.accent { background: var(--soft); color: var(--ink); }
.stack > * + * { margin-top: 12px; }

/* hero */
.hero { overflow: visible; }
.hero h1 .hl { background: linear-gradient(90deg, var(--violet), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-weight: 800; font-size: 1.1rem; }
.floaty { position: absolute; z-index: 2; font-size: 2rem; pointer-events: none; animation: float 4s ease-in-out infinite; user-select: none; }
.floaty.f1 { top: -18px; right: 14px; transform: rotate(12deg); }
.floaty.f2 { display: none; }
/* the flag sits clear of the button, straddling the card's lower edge on the left */
.floaty.f3 { bottom: -30px; left: 26px; animation-delay: -2.2s; }
.perks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.perks li { background: var(--soft); border: 2px solid var(--ink); border-radius: 14px; padding: 8px 12px; font-weight: 700; font-size: 0.95rem; }

/* inputs */
label { display: block; font-weight: 800; margin: 16px 0 6px; }
input[type="text"], input[type="number"], input[type="tel"], select {
  width: 100%;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 12px 14px;
  min-height: 52px;
  box-shadow: var(--shadow-sm);
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 4px solid var(--sky);
  outline-offset: 2px;
}
.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 600; margin-top: 18px; }
.check input { width: 26px; height: 26px; margin-top: 2px; accent-color: var(--violet); flex: none; }

/* buttons */
button, .btn {
  font: inherit;
  font-weight: 900;
  display: block;
  width: 100%;
  min-height: 54px;
  border-radius: 999px;
  border: 3px solid var(--ink);
  background: var(--violet);
  color: #fff;
  padding: 12px 20px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  -webkit-tap-highlight-color: transparent;
}
button:hover:not([disabled]), .btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
button:active:not([disabled]), .btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
button.ghost, .btn.ghost { background: var(--paper); color: var(--ink); }
button.go, .btn.go { background: var(--lime); color: #1b1230; font-size: 1.1rem; animation: wobble 2.6s ease-in-out infinite; }
button.danger { background: var(--paper); color: var(--err); border-color: var(--err); box-shadow: none; }
button[disabled] { opacity: 0.6; cursor: default; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 170px; }
.row.chips > * { flex: 0 0 auto; }

.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button { width: auto; flex: 0 0 auto; min-height: 44px; padding: 8px 16px; background: var(--paper); color: var(--ink); box-shadow: none; }
.seg button[aria-pressed="true"] { background: var(--violet); color: #fff; }

/* the quiz */
.level {
  display: inline-block;
  background: var(--pink);
  color: #1b1230;
  border: 3px solid var(--ink);
  border-radius: 12px;
  font-weight: 900;
  padding: 2px 12px;
  margin-bottom: 10px;
  transform: rotate(-1.5deg);
  animation: pop-in 0.4s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.meter { position: relative; height: 16px; border: 3px solid var(--ink); border-radius: 99px; background: var(--paper); margin: 10px 0 22px; overflow: visible; }
.meter > i { display: block; height: 100%; width: calc(var(--p, 0) * 1%); background: linear-gradient(90deg, var(--lime), var(--sky), var(--pink)); border-radius: 99px; transition: width 0.4s cubic-bezier(0.2, 1.2, 0.4, 1); }
.meter > b { position: absolute; top: -9px; left: calc(var(--p, 0) * 1%); transform: translateX(-50%); font-size: 1.3rem; transition: left 0.4s cubic-bezier(0.2, 1.2, 0.4, 1); filter: drop-shadow(1px 1px 0 var(--ink)); }
.hook {
  font-weight: 900;
  font-size: clamp(1.45rem, 6.5vw, 1.9rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  background: linear-gradient(90deg, var(--violet), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.q { font-size: 1.1rem; font-weight: 600; line-height: 1.42; margin-bottom: 16px; }
.opts { display: grid; gap: 12px; }
.opts button {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  font-weight: 700;
  border-radius: 18px;
  min-height: 58px;
}
.opts button .key {
  flex: none;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  display: grid; place-items: center;
  font-weight: 900;
  color: #1b1230;
  background: var(--sun);
}
.opts button:nth-child(2) .key { background: var(--pink); }
.opts button:nth-child(3) .key { background: var(--sky); }
.opts button:nth-child(4) .key { background: var(--lime); }
.opts button.picked { background: var(--lime); color: #1b1230; animation: pop 0.35s cubic-bezier(0.2, 1.6, 0.4, 1); }
.react { min-height: 1.6em; font-weight: 900; color: var(--violet); }
.react.show { animation: pop-in 0.35s cubic-bezier(0.2, 1.6, 0.4, 1) both; }

/* vibe type */
.type { text-align: center; padding: 22px 18px; }
.type .big { font-size: 3.4rem; line-height: 1; display: block; animation: float 3.6s ease-in-out infinite; }
.type .kicker { font-weight: 900; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; }
.type h2 { font-size: 1.6rem; margin: 6px 0; }
.pair { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 8px; margin-bottom: 14px; }
.pair .card { margin: 0; padding: 14px 10px; }
.pair .x { align-self: center; font-weight: 900; font-size: 1.5rem; }
.pair .type h2 { font-size: 1.05rem; }
.pair .type .big { font-size: 2.3rem; }
.pair .type p { font-size: 0.8rem; margin: 0; }
@media (max-width: 380px) { .pair { grid-template-columns: 1fr; } .pair .x { display: none; } }

.pill { display: inline-block; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); border-radius: 99px; padding: 3px 12px; font-size: 0.85rem; font-weight: 800; }
.pill.flag { background: var(--sun); color: #1b1230; }
.pill.live { background: var(--lime); color: #1b1230; }

/* result */
.score { display: grid; place-items: center; margin: 4px 0 12px; }
.ring {
  --p: 0;
  width: 170px; height: 170px; border-radius: 50%;
  background: conic-gradient(var(--pink) calc(var(--p) * 1%), var(--soft) 0);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  display: grid; place-items: center;
}
.ring > div { width: 128px; height: 128px; border-radius: 50%; background: var(--paper); border: 3px solid var(--ink); display: grid; place-items: center; font-size: 2.6rem; font-weight: 900; }
.ring.land { animation: pop 0.6s cubic-bezier(0.2, 1.6, 0.4, 1); }
ul.clean { list-style: none; padding: 0; margin: 0; }
ul.clean li { padding: 12px 0; border-top: 2px dashed var(--ink); }
ul.clean li:first-child { border-top: 0; }
ul.clean strong { display: block; }
.note { background: var(--sun); color: #1b1230; border: 3px solid var(--ink); border-radius: 14px; padding: 10px 12px; font-size: 0.92rem; font-weight: 700; }

.bar { margin: 16px 0; }
.bar .names { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--muted); font-weight: 700; }
.track { position: relative; height: 14px; border: 3px solid var(--ink); border-radius: 99px; background: var(--soft); margin: 10px 0; }
.dot { position: absolute; top: 50%; left: calc(var(--at) * 1%); width: 24px; height: 24px; border-radius: 50%; transform: translate(-50%, -50%); border: 3px solid var(--ink); }
.dot.you { background: var(--violet); }
/* both people on the same spot: a heart, not two dots hiding each other */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.card-preview { width: 62%; max-width: 280px; margin: 4px auto; border: 3px solid var(--ink); border-radius: 18px; box-shadow: var(--shadow-sm); display: block; }
.card-pic { width: 100%; max-height: 70vh; object-fit: contain; border: 3px solid var(--ink); border-radius: 14px; }
.dot.both { width: 34px; height: 34px; border: 0; background: transparent; display: grid; place-items: center; font-size: 24px; line-height: 1; font-style: normal; filter: drop-shadow(0 1px 0 var(--ink)); }
.dot.them { background: var(--pink); }
.legend { display: flex; gap: 16px; font-size: 0.9rem; font-weight: 800; margin-bottom: 4px; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin-right: 6px; border: 2px solid var(--ink); vertical-align: -2px; }
.legend .you i { background: var(--violet); }
.legend .them i { background: var(--pink); }

.link-box { word-break: break-all; background: var(--soft); border: 3px dashed var(--ink); border-radius: 14px; padding: 10px 12px; font-size: 0.9rem; font-weight: 700; }
.err { color: var(--err); font-weight: 800; margin-top: 10px; min-height: 1.2em; }
.spin { text-align: center; padding: 40px 0; color: var(--muted); }

/* waiting dots */
.dots span { display: inline-block; width: 8px; height: 8px; margin-left: 4px; border-radius: 50%; background: var(--violet); animation: bounce 1s ease-in-out infinite; }
.dots span:nth-child(2) { animation-delay: 0.15s; }
.dots span:nth-child(3) { animation-delay: 0.3s; }

/* toast */
#toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 20;
  transform: translate(-50%, 140%);
  background: var(--ink); color: var(--bg);
  border-radius: 999px; padding: 12px 20px; font-weight: 900; max-width: 92vw;
  transition: transform 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
}
#toast.on { transform: translate(-50%, 0); }

/* confetti + sparkle trail (decorative) */
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; border-radius: var(--round); }
.confetti span {
  position: absolute; top: -10%; left: calc(var(--x) * 1%);
  font-size: 1.3rem;
  animation: fall var(--d, 2.4s) cubic-bezier(0.3, 0.6, 0.4, 1) var(--w, 0s) both;
}
.spark { position: fixed; z-index: 30; pointer-events: none; font-size: 1rem; animation: spark 0.8s ease-out both; }

@keyframes slide-in { from { opacity: 0; transform: translateY(18px) rotate(-1deg); } to { opacity: 1; transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.6) rotate(-6deg); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.06) rotate(-1deg); } 100% { transform: scale(1); } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); } 50% { transform: translateY(-9px) rotate(calc(var(--r, 0deg) + 6deg)); } }
@keyframes wobble { 0%, 86%, 100% { transform: rotate(0); } 90% { transform: rotate(-2deg); } 94% { transform: rotate(2deg); } 97% { transform: rotate(-1deg); } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes fall { from { transform: translateY(0) rotate(0); opacity: 1; } to { transform: translateY(520px) rotate(var(--r, 360deg)); opacity: 0; } }
@keyframes spark { from { transform: translate(0, 0) scale(1); opacity: 1; } to { transform: translate(var(--dx, 0), 22px) scale(0.2) rotate(120deg); opacity: 0; } }

/* app-like bottom navigation */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; gap: 6px;
  max-width: 580px; margin: 0 auto;
  background: var(--paper);
  border: 3px solid var(--ink); border-bottom: 0;
  border-radius: 22px 22px 0 0;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -4px 0 var(--ink);
}
.tabbar .tab {
  position: relative; flex: 1; min-height: 56px; border-radius: 16px;
  background: transparent; color: var(--ink); box-shadow: none; border: 3px solid transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  font-size: 0.8rem; padding: 4px 6px;
}
.tabbar .tab .ico { font-size: 1.35rem; line-height: 1.1; }
.tabbar .tab[aria-current="page"] { background: var(--violet); color: #fff; border-color: var(--ink); }
.tabbar .tab:hover:not([disabled]) { transform: none; box-shadow: none; }
.tabbar .tab:active:not([disabled]) { transform: scale(0.96); box-shadow: none; }
.badge {
  position: absolute; top: 2px; right: calc(50% - 30px);
  min-width: 20px; height: 20px; border-radius: 99px; padding: 0 5px;
  background: var(--pink); color: #1b1230; border: 2px solid var(--ink);
  font-style: normal; font-size: 0.72rem; font-weight: 900; line-height: 16px; text-align: center;
}

/* Instagram / Facebook in-app browser tip */
.banner {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--sun); color: #1b1230; border: 3px solid var(--ink); border-radius: 16px;
  padding: 10px 12px; margin-bottom: 16px; font-weight: 700; font-size: 0.9rem;
}
.banner span { flex: 1; }
.banner .x { width: 34px; min-height: 34px; padding: 0; flex: none; box-shadow: none; background: transparent; color: #1b1230; border-width: 2px; }

/* opened from the home screen: no browser bars, so give the top some air */
body.standalone main { padding-top: 10px; }
body.standalone .brand { margin-top: 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .confetti, .spark { display: none; }
}

/* sign-up taps and the ad page */
.pick { display: grid; gap: 12px; }
.pick button {
  background: var(--paper); color: var(--ink); text-align: left; font-weight: 800;
  border-radius: 18px; min-height: 58px;
}
.pick button:hover:not([disabled]) { background: var(--soft); }
.dots-row { display: flex; gap: 6px; }
.dots-row i { flex: 1; height: 8px; border: 2px solid var(--ink); border-radius: 99px; background: var(--paper); }
.dots-row i.on { background: linear-gradient(90deg, var(--lime), var(--sky)); }
.nudge { font-weight: 900; color: var(--violet); margin: 0; }
button.small, .btn.small { min-height: 44px; font-size: 0.9rem; box-shadow: none; }
.entry-title { font-size: clamp(1.6rem, 7vw, 2.2rem); margin-bottom: 4px; }
.teaser { background: var(--sun); color: #1b1230; border: 3px solid var(--ink); border-radius: 14px; padding: 8px 12px; font-weight: 800; font-size: 0.92rem; margin: 0 0 12px; }

.seg.wrap { flex-wrap: wrap; justify-content: center; }
.sheet { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(20, 10, 40, .72); }
.sheet .card { width: min(100%, 420px); text-align: center; }
.sheet .globe { font-size: 40px; }
