/* bazilove.me. Same colours as the app (src/app/theme.css). Light only, like the app. */
@font-face {
  font-family: Quicksand;
  src: url(fonts/quicksand-latin-500-normal.woff2) format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: Quicksand;
  src: url(fonts/quicksand-latin-700-normal.woff2) format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #fff4f1;
  --card: #ffffff;
  --text: #4a2a33;
  --muted: #7f5a64;
  --muted-2: #6a4651;
  --accent: #bc4a66;
  --accent-text: #9e3a54;
  --accent-hover: #7c2c42;
  --chip: #fce6e2;
  --line: #f3d3cc;
  --border: #e2c7c0;
  --shadow: 0 6px 20px rgba(188, 74, 102, 0.08);
  --font: Quicksand, 'PingFang SC', 'Noto Sans SC', 'Noto Sans CJK SC', 'Microsoft YaHei', system-ui, sans-serif;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 500 16px/1.7 var(--font);
  overflow-wrap: break-word;
}
/* Quicksand has no Chinese, so Chinese pages use the system Chinese font throughout. The logo name and big numbers keep Quicksand. */
:lang(zh) body {
  font-family: 'PingFang SC', 'Noto Sans SC', 'Noto Sans CJK SC', 'Microsoft YaHei', system-ui, sans-serif;
}
:lang(zh) .brand,
:lang(zh) .ring-score,
:lang(zh) .tile b,
:lang(zh) .num {
  font-family: var(--font);
}
a {
  color: var(--accent-text);
  text-underline-offset: 2px;
}
a:hover {
  color: var(--accent-hover);
}
:focus-visible {
  outline: 3px solid rgba(188, 74, 102, 0.45);
  outline-offset: 2px;
}
h1,
h2 {
  line-height: 1.3;
  font-weight: 700;
}
b {
  font-weight: 700;
}
.muted {
  color: var(--muted-2);
}

.draft {
  padding: 8px 16px;
  background: #fff1c2;
  color: #5a4200;
  font-size: 14px;
  text-align: center;
}

/* Header and footer */
.top {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}
.brand img {
  border-radius: 10px;
}
.langs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 14px;
}
.langs a,
.langs span {
  padding: 4px 10px;
  border-radius: 999px;
  text-decoration: none;
}
.langs span {
  background: var(--chip);
  color: var(--accent-text);
  font-weight: 700;
}
/* "More" opens the full language list. */
.more {
  position: relative;
}
.more summary {
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--accent-text);
  list-style: none;
  cursor: pointer;
}
.more summary::-webkit-details-marker {
  display: none;
}
.more summary::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 0 3px 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}
.more[open] summary::after {
  margin-bottom: -1px;
  transform: rotate(-135deg);
}
.more summary.is-here,
.more[open] summary {
  background: var(--chip);
  font-weight: 700;
}
.more ul {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 10;
  min-width: 170px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.more li a,
.more li span {
  display: block;
  padding: 8px 12px;
  border-radius: 10px;
}
.more li a:hover {
  background: var(--chip);
}
.wrap {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 16px 40px;
  flex: 1;
}
.foot {
  padding: 20px 16px 28px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 14px;
  text-align: center;
}
.foot nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
}
.foot p {
  margin: 8px 0 0;
}
.foot .tm {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

/* Home. Page rhythm: pink hero, white number strip, deep wine demo (the only dark part), white features, then light cards. */
.page-index .top {
  max-width: 1080px;
}
.home {
  flex: 1;
  width: 100%;
}
.wide {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}
/* Hearts float behind a section's content, so each section clips its own. clip (not hidden) keeps it from being a scroll box. */
.home > section {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  overflow: clip;
}
.home > section > :not(.float) {
  position: relative;
  z-index: 1;
}
.float {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
/* Each heart is a 520px strip with the heart at its bottom, so moving the strip up by 100% carries the heart up 520px.
   Only translate, transform and opacity change, so it stays light. */
.float i {
  position: absolute;
  bottom: var(--y);
  left: var(--x);
  width: var(--s);
  height: 520px;
  background: var(--c);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='9 15 82 74'%3E%3Cpath d='M50 25C47 19 40 15 30 15C18 15 9 24 9 37C9 60.8 26 75.2 43.1 86.2C47.2 88.8 52.8 88.8 56.9 86.2C74 75.2 91 60.8 91 37C91 24 82 15 70 15C60 15 53 19 50 25Z'/%3E%3C/svg%3E") no-repeat 50% 100% / 100% auto;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='9 15 82 74'%3E%3Cpath d='M50 25C47 19 40 15 30 15C18 15 9 24 9 37C9 60.8 26 75.2 43.1 86.2C47.2 88.8 52.8 88.8 56.9 86.2C74 75.2 91 60.8 91 37C91 24 82 15 70 15C60 15 53 19 50 25Z'/%3E%3C/svg%3E") no-repeat 50% 100% / 100% auto;
  transform-origin: 50% calc(100% - var(--s) / 2);
  opacity: 0;
  animation:
    rise var(--t) linear var(--w) infinite,
    sway calc(var(--t) / 3) ease-in-out var(--w) infinite alternate;
}
@keyframes rise {
  0% {
    translate: 0 0;
    opacity: 0;
  }
  15%,
  70% {
    opacity: 0.8;
  }
  100% {
    translate: 0 -100%;
    opacity: 0;
  }
}
@keyframes sway {
  from {
    transform: translateX(-10px) rotate(-12deg);
  }
  to {
    transform: translateX(10px) rotate(12deg);
  }
}

/* Buttons and the "coming soon" store pills */
.cta-row {
  margin: 24px 0 0;
}
.btn {
  min-height: 52px;
  padding: 0 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(188, 74, 102, 0.28);
  transition: background-color 0.15s, transform 0.15s;
}
.btn:hover {
  background: var(--accent-hover);
  color: #ffffff;
}
.btn:active {
  transform: scale(0.97);
}
/* Not links: the apps aren't out yet. Our own drawing, not the stores' badges. */
.stores {
  margin: 14px 0 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.store {
  min-width: 150px;
  height: 52px;
  padding: 0 16px 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--muted-2);
  line-height: 1.2;
  text-align: left;
}
.store svg {
  flex: none;
}
.store b {
  display: block;
  color: var(--text);
  font-size: 15px;
}
.store small {
  display: block;
  color: var(--accent-text);
  font-size: 12.5px;
  font-weight: 700;
}
.badges {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.badge {
  min-width: 210px;
  height: 52px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
}
.badge-appStore {
  background: #000000;
  color: #ffffff;
}
.badge-googlePlay {
  border: 1.5px solid var(--border);
  background: #ffffff;
  color: #1f1f1f;
}

/* Hero */
.hero-wrap {
  background: radial-gradient(120% 80% at 50% 0%, #ffe3e7 0%, rgba(255, 227, 231, 0) 70%);
}
.hero {
  display: grid;
  gap: 36px;
  align-items: center;
  padding-top: 16px;
  padding-bottom: 52px;
}
.hero-text {
  text-align: center;
}
.eyebrow {
  display: inline-block;
  margin: 0;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--card);
  color: var(--accent-text);
  font-size: 14px;
  font-weight: 700;
  box-shadow: var(--shadow);
}
.home h1 {
  margin: 16px 0 0;
  font-size: 34px;
  line-height: 1.22;
  text-wrap: balance;
}
.intro {
  max-width: 560px;
  margin: 14px auto 0;
  color: var(--muted-2);
  font-size: 17px;
  text-wrap: pretty;
}
.chips {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.chips li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: 999px;
  background: var(--card);
  color: var(--accent-text);
  font-size: 14px;
  font-weight: 700;
  box-shadow: var(--shadow);
}
/* On a phone the hero is already long; the chips say again what the number strip and the free card say. */
@media (max-width: 599px) {
  .hero-text .chips {
    display: none;
  }
}
@media (min-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 64px;
    padding-top: 36px;
    padding-bottom: 72px;
  }
  .hero-text {
    text-align: left;
  }
  .home h1 {
    font-size: 48px;
  }
  .hero-text .intro {
    margin-left: 0;
  }
  .hero-text .stores,
  .hero-text .badges,
  .hero-text .chips {
    justify-content: flex-start;
  }
}

/* A phone, like the app's screens: the hero's result and the live demo */
.phone {
  position: relative;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 46px;
  background: var(--card);
  box-shadow: 0 24px 60px rgba(188, 74, 102, 0.16);
}
.phone::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 50%;
  width: 72px;
  height: 6px;
  margin-left: -36px;
  border-radius: 999px;
  background: var(--line);
}
.screen {
  padding: 34px 14px 18px;
  border-radius: 36px;
  background: var(--bg);
  text-align: center;
}
.sample-label {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 700;
}
.pair {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.pair-heart {
  display: flex;
  color: var(--accent);
}
.pair-names {
  margin: 6px 0 0;
  font-size: 15px;
  font-weight: 700;
}
.av {
  width: var(--s);
  height: var(--s);
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: calc(var(--s) * 0.4);
  font-weight: 700;
  line-height: 1;
}
/* The total in a ring (ring() in build.mjs): the arc draws round to the score once. */
.ring {
  position: relative;
  width: 150px;
  height: 150px;
  margin: 12px auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ring svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.ring-track {
  fill: var(--card);
  stroke: #fce9e6;
  stroke-width: 12;
}
.ring-arc {
  fill: none;
  stroke: var(--accent);
  stroke-width: 12;
  stroke-linecap: round;
  animation: draw 1.4s cubic-bezier(0.3, 0.7, 0.3, 1) 0.2s both;
}
@keyframes draw {
  from {
    stroke-dasharray: 0 400;
  }
}
.ring-score {
  position: relative;
  color: var(--accent);
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
}
.ring-sub {
  position: relative;
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 14px;
}
/* Star rating (stars() in build.mjs), coloured like the app's. */
.stars {
  display: inline-flex;
  vertical-align: middle;
}
.stars svg {
  display: block;
}
.stars path {
  fill: var(--accent);
  stroke: var(--accent);
  stroke-width: 1.4;
  stroke-linejoin: round;
}
.sample-stars {
  margin-top: 12px;
  line-height: 0;
}
.rank {
  margin: 14px 0 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  text-wrap: balance;
}
.star-say {
  margin: 6px 0 0;
  color: var(--muted-2);
  font-size: 15px;
  line-height: 1.5;
  text-wrap: balance;
}
/* 你们俩: the two best scores and the ones to watch, coloured by score */
.us {
  margin-top: 14px;
  padding: 12px 14px;
  display: grid;
  gap: 8px;
  border-radius: 18px;
  background: var(--card);
  text-align: left;
}
.us p {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}
.us p > b {
  margin-right: 2px;
}
.pill {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}
/* One clause that stays on one line (phrases() in build.mjs). */
.ph {
  display: inline-block;
}
.warm {
  margin: 12px 0 0;
  padding: 10px 14px;
  border-radius: 18px;
  background: var(--card);
  color: var(--accent-text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  text-wrap: balance;
}
.warm svg {
  margin-right: 6px;
  vertical-align: -2px;
}

/* The number strip */
.stats-wrap {
  border-block: 1px solid var(--line);
  background: var(--card);
}
.stats {
  margin: 0 auto;
  padding-top: 24px;
  padding-bottom: 24px;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 12px;
  text-align: center;
}
.stats b {
  display: block;
  color: var(--accent);
  font-family: var(--font);
  font-size: 38px;
  line-height: 1.1;
}
.stats b small {
  margin-left: 4px;
  color: var(--text);
  font-size: 15px;
}
.stats span {
  display: block;
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 14px;
  line-height: 1.45;
  text-wrap: balance;
}
@media (min-width: 760px) {
  .stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Sections */
.sec {
  padding-top: 60px;
  padding-bottom: 60px;
}
.sec-white {
  background: var(--card);
}
.sec-h {
  margin: 0;
  font-size: 28px;
  text-align: center;
  text-wrap: balance;
}
.sec-sub {
  max-width: 640px;
  margin: 10px auto 0;
  color: var(--muted-2);
  font-size: 17px;
  text-align: center;
  text-wrap: pretty;
}
@media (min-width: 760px) {
  .sec {
    padding-top: 80px;
    padding-bottom: 80px;
  }
  .sec-h {
    font-size: 34px;
  }
}

/* The demo: deep wine, from the logo's colours. Stories are white cards; the app's own demo runs live beside them on wide screens. */
.demo {
  background: linear-gradient(160deg, #6c1a38 0%, #8e2648 100%);
  color: #fff4f1;
}
.demo .sec-h {
  color: #ffffff;
}
.demo .sec-sub {
  color: #f8dce3;
}
.fiction {
  max-width: 680px;
  margin: 18px auto 0;
  padding: 10px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
  color: #fde9ee;
  font-size: 14px;
  line-height: 1.55;
}
.fiction svg {
  flex: none;
  margin-top: 1px;
}
.demo-grid {
  max-width: 640px;
  margin: 30px auto 0;
  display: grid;
  gap: 28px;
  align-items: start;
}
.story-group {
  margin: 22px 4px 10px;
  color: #f8dce3;
  font-size: 15px;
}
.story-group:first-child {
  margin-top: 0;
}
.story {
  border-radius: 22px;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 12px 30px rgba(40, 0, 15, 0.25);
}
.story + .story {
  margin-top: 10px;
}
.story summary {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  list-style: none;
  cursor: pointer;
}
.story summary::-webkit-details-marker {
  display: none;
}
/* The arrow: points down when closed, up when open. */
.story summary::after {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  margin: -4px 4px 0 0;
  border-right: 2px solid var(--accent-text);
  border-bottom: 2px solid var(--accent-text);
  transform: rotate(45deg);
}
.story[open] summary::after {
  margin-top: 4px;
  transform: rotate(-135deg);
}
.cast {
  flex: none;
  display: flex;
}
.cast .av {
  box-shadow: 0 0 0 2px var(--card);
}
.cast .av + .av {
  margin-left: -10px;
}
.story-t {
  flex: 1;
  min-width: 0;
}
.story-t b {
  display: block;
  font-size: 17px;
  line-height: 1.35;
}
.story-t small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.4;
}
.story-t .guess {
  margin-top: 0;
  color: var(--accent-text);
  font-weight: 700;
}
.story[open] .guess {
  display: none;
}
.story-a {
  padding: 0 16px 16px;
}
.story[open] .story-a {
  animation: fade 0.35s ease-out;
}
@keyframes fade {
  from {
    opacity: 0;
    translate: 0 -6px;
  }
}
.ranked {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.ranked li {
  padding: 10px 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto 3.2em;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}
.who b,
.who small {
  display: block;
  line-height: 1.3;
}
.who small {
  color: var(--muted);
  font-size: 13px;
}
.total {
  font-family: var(--font);
  font-size: 18px;
  text-align: right;
}
.ranked .top .total {
  color: var(--accent);
}
.plot {
  margin: 12px 0 0;
  color: var(--muted-2);
  font-size: 15px;
}
.story-open {
  display: inline-block;
  margin-top: 10px;
  font-weight: 700;
}
.story-open::after {
  content: ' →';
}
/* The live demo needs a wide screen; on a phone, each story's link opens it full screen instead. */
.live {
  display: none;
  text-align: center;
}
.live-h {
  margin: 0 0 12px;
  color: #ffffff;
  font-weight: 700;
}
.live-phone {
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 24px 60px rgba(40, 0, 15, 0.35);
}
.live-phone::before {
  display: none;
}
.live-phone iframe {
  display: block;
  width: 100%;
  height: 720px;
  border: 0;
  border-radius: 36px;
  background: var(--bg);
}
.live-hint {
  margin: 12px 0 0;
  color: #f8dce3;
  font-size: 14px;
  text-wrap: balance;
}
/* Only with the script: it is what loads the demo into the frame. */
@media (min-width: 1000px) {
  .js .demo-grid.has-live {
    max-width: none;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 56px;
  }
  .js .has-live .live {
    display: block;
  }
}
.demo .warm {
  max-width: 680px;
  margin: 32px auto 0;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

/* Features: text and a small picture, side by side on wide screens, alternating */
.feat {
  margin-top: 56px;
  display: grid;
  gap: 22px;
  align-items: center;
}
.sec-sub + .feat {
  margin-top: 40px;
}
.kicker {
  margin: 0;
  color: var(--accent-text);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.feat h3 {
  margin: 6px 0 0;
  font-size: 24px;
  line-height: 1.3;
  text-wrap: balance;
}
.feat-text p:not(.kicker) {
  margin: 10px 0 0;
  color: var(--muted-2);
  font-size: 16.5px;
  text-wrap: pretty;
}
.feat-vis {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
}
@media (min-width: 900px) {
  .feat {
    margin-top: 88px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 64px;
  }
  .feat.flip .feat-text {
    order: 2;
  }
  .feat-text {
    max-width: 460px;
    justify-self: end;
  }
  .feat.flip .feat-text {
    justify-self: start;
  }
  /* The 12 scores are much taller than their text, so the text stays in view beside them. */
  .feat.tall {
    align-items: start;
  }
  .feat.tall .feat-text {
    position: sticky;
    top: 96px;
  }
}
.mini {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--bg);
  box-shadow: var(--shadow);
}
.mini.center {
  text-align: center;
}
.mini-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}
.mini-head .av + .av {
  margin-left: -12px;
  box-shadow: 0 0 0 2px var(--bg);
}
.mh-name {
  flex: 1;
  min-width: 0;
}
.mini-head > b {
  color: var(--accent);
  font-family: var(--font);
  font-size: 20px;
}
.mini-h {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 10px;
  font-weight: 700;
}
.mini-h small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.lock-note {
  margin: 12px 0 0;
  color: var(--muted-2);
  font-size: 13.5px;
  line-height: 1.5;
}
.lock-note svg {
  margin-right: 6px;
  vertical-align: -2px;
}

/* The 12 scores: tap one to see why. Radio buttons + CSS, so it needs no script. */
.tap-hint {
  margin: 10px 0 0;
  color: var(--muted-2);
  font-size: 14px;
}
.seen {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.grp-h {
  margin: 12px 4px 0;
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 700;
}
.tiles {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.tile {
  position: relative;
  min-height: 56px;
  padding: 6px 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s;
}
.tile:active {
  transform: scale(0.96);
}
.tile input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.tile:has(input:checked) {
  box-shadow:
    0 0 0 2px var(--bg),
    0 0 0 4px var(--accent-text);
}
.tile:has(input:focus-visible) {
  outline: 3px solid rgba(188, 74, 102, 0.45);
  outline-offset: 4px;
}
.tile span {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.2;
}
.tile b {
  font-size: 18px;
  line-height: 1.25;
}
/* Read out, not shown. */
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.lock {
  position: absolute;
  top: 5px;
  right: 7px;
  display: flex;
  opacity: 0.75;
}
.b1 {
  background: #faeff2;
  color: #7f5a64;
}
.b2 {
  background: #f9dde4;
  color: #7a3449;
}
.b3 {
  background: #f4c6d2;
  color: #74293f;
}
.b4 {
  background: #eca7b9;
  color: #6a1f36;
}
.detail {
  display: none;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--card);
  font-size: 15px;
  line-height: 1.6;
}
.detail p {
  margin: 4px 0 0;
}
.detail .why {
  color: var(--muted-2);
  font-size: 14px;
}
.detail-h {
  color: var(--accent-text);
}
/* The best score (.on) shows until another is picked. Without :has() it simply stays. */
.explore .on {
  display: block;
}
.explore:has(input:checked:not(.def)) .on {
  display: none;
}
.explore:has([value='0']:checked) .d0,
.explore:has([value='1']:checked) .d1,
.explore:has([value='2']:checked) .d2,
.explore:has([value='3']:checked) .d3,
.explore:has([value='4']:checked) .d4,
.explore:has([value='5']:checked) .d5,
.explore:has([value='6']:checked) .d6,
.explore:has([value='7']:checked) .d7,
.explore:has([value='8']:checked) .d8,
.explore:has([value='9']:checked) .d9,
.explore:has([value='10']:checked) .d10,
.explore:has([value='11']:checked) .d11 {
  display: block;
}

/* 跟所有八字比 (vsBar() in build.mjs), drawn like the app's: marks under the bar, the pair's score above its dot. */
.vs {
  margin-top: 16px;
  padding: 14px 16px 2px;
  border-radius: 18px;
  background: var(--card);
  text-align: left;
}
.vs-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.vs-h {
  flex: none;
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}
.vs-hint {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  text-wrap: balance;
}
.vs-bar {
  position: relative;
  height: 8px;
  margin: 40px 10px 44px;
  border-radius: 999px;
  background: #fce9e6;
}
.vs-tick {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 14px;
  margin-left: -1px;
  border-radius: 1px;
  background: #e2b8af;
}
.vs-label {
  position: absolute;
  top: 16px;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
  white-space: nowrap;
}
.vs-label b {
  color: var(--muted-2);
  font-size: 12px;
}
.vs-dot {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--card);
}
.vs-score {
  position: absolute;
  bottom: 14px;
  transform: translateX(-50%);
  color: var(--accent);
  font-size: 14px;
  white-space: nowrap;
}

/* Your matches: ranked, each with its 12 scores as coloured squares, a gap between the five groups */
.cmp {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.cmp li {
  padding: 12px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 3.2em;
  align-items: center;
  gap: 8px 10px;
  border-top: 1px solid var(--line);
}
.cmp-who {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.strip {
  grid-column: 1 / -1;
  display: flex;
  gap: 3px;
}
.strip i {
  flex: 1;
  height: 16px;
  border-radius: 4px;
}
.strip .g {
  margin-left: 6px;
}
/* The squares are small, so their colours are spread further apart than the score tiles'. */
.strip .b1 {
  background: #f6e4e8;
}
.strip .b2 {
  background: #ecc3cd;
}
.strip .b3 {
  background: #dc8fa2;
}
.strip .b4 {
  background: #c4566f;
}
/* What each number of stars means; the pair's row is marked. */
.ladder {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.ladder li {
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 78px auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
}
.ladder .stars {
  justify-self: start;
}
.ladder b {
  white-space: nowrap;
}
.ladder span {
  color: var(--muted-2);
}
.ladder .here {
  background: var(--card);
  box-shadow: inset 0 0 0 2px var(--accent);
}
.ladder .here span {
  color: var(--text);
}

/* Ten-Year Luck Pillars: one bar per decade */
.decades {
  height: 200px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.decades li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.decades li > b {
  font-family: var(--font);
  font-size: 18px;
  line-height: 1;
}
.bar {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: flex-end;
  border-radius: 14px;
  background: #fdf0ee;
  box-shadow: inset 0 0 0 1px var(--line);
}
.bar i {
  width: 100%;
  border-radius: 14px;
}
/* The palest score colour would vanish in the bar's track. */
.bar .b1 {
  background: #f2cfd8;
}
.decades small {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

/* Ideal Type: the top birth dates with their four pillars */
.ideal {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.ideal li {
  padding: 9px 0;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 3em;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
}
.rk {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--chip);
  color: var(--accent-text);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
}
.when b,
.when small {
  display: block;
  line-height: 1.3;
}
.when b {
  font-size: 15px;
}
.when small {
  color: var(--muted);
  font-size: 12.5px;
}

/* My Chart: hour, day, month and year pillars like the app's chart page, the day pillar ringed */
.pillars {
  max-width: 330px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.pillar {
  padding: 8px 0 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border-radius: 18px;
  background: var(--card);
}
.pillar small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.pillar.day {
  box-shadow: 0 0 0 2px var(--accent);
}
/* A Stem or Branch in the app's Five Elements colours (only on the chart). */
.gz {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-family: 'PingFang SC', 'Noto Sans SC', 'Noto Sans CJK SC', 'Microsoft YaHei', system-ui, sans-serif;
  font-size: 24px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
}
.unknown {
  color: var(--muted);
  font-size: 12px;
}
.dm {
  margin: 14px 0 0;
  text-align: center;
}
.love {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--card);
}
.love p {
  margin: 4px 0 0;
}
.love .love-h {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-text);
  font-weight: 700;
}

/* Free and paid */
.plans {
  max-width: 920px;
  margin: 0 auto;
  display: grid;
  gap: 16px;
}
.plan {
  padding: 24px;
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.plan.free {
  box-shadow:
    inset 0 0 0 2px var(--accent),
    var(--shadow);
}
.plan h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 21px;
}
.plan h2 svg {
  flex: none;
  color: var(--accent);
}
.plan p {
  margin: 10px 0 0;
  color: var(--muted-2);
}
@media (min-width: 760px) {
  .plans {
    grid-template-columns: 1fr 1fr;
  }
}

/* Peace of mind: three columns, no card frames (the page already has many cards) */
.trust {
  max-width: 980px;
  margin: 30px auto 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 26px;
}
.trust h3 {
  margin: 12px 0 0;
  font-size: 18px;
  line-height: 1.4;
}
.trust p {
  margin: 6px 0 0;
  color: var(--muted-2);
  font-size: 15px;
  line-height: 1.65;
}
.trust .go {
  margin-top: 10px;
  font-weight: 700;
}
@media (min-width: 760px) {
  .trust {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px;
  }
}
/* Three steps, inside the coming-soon card */
.steps-h {
  margin: 28px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 17px;
}
.steps {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
  text-align: left;
}
.steps li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  column-gap: 12px;
}
.steps .num {
  grid-row: span 2;
  width: 34px;
  height: 34px;
  font-size: 16px;
}
.steps h4 {
  margin: 4px 0 0;
  font-size: 16px;
  line-height: 1.4;
}
.steps p {
  margin: 2px 0 0;
  color: var(--muted-2);
  font-size: 14px;
  line-height: 1.6;
}
.ic,
.num {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ic {
  border-radius: 14px;
  background: var(--chip);
  color: var(--accent-text);
}
.num {
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-size: 19px;
  font-weight: 700;
}

/* Coming soon */
.get-card {
  max-width: 640px;
  margin: 0 auto;
  padding: 34px 22px;
  border-radius: 34px;
  background: var(--card);
  box-shadow: 0 24px 60px rgba(188, 74, 102, 0.14);
  text-align: center;
}
.get-card img {
  border-radius: 18px;
}
.get-card h2 {
  margin: 12px 0 0;
  font-size: 26px;
}
.get-card p {
  margin: 8px 0 0;
  color: var(--muted-2);
}
.get-card .stores {
  margin-top: 20px;
}
.get-card .cta-row {
  margin-top: 18px;
}
.about,
.home-note {
  max-width: 600px;
  margin: 22px auto 0;
  color: var(--muted-2);
  font-size: 15px;
  text-align: center;
  text-wrap: balance;
}
.home-note {
  margin-top: 8px;
  font-size: 14px;
}

/* Fading in on scroll: the script adds .pre, then .in once in view. Without the script nothing is hidden. */
.pre {
  opacity: 0;
  translate: 0 16px;
  transition:
    opacity 0.6s ease-out,
    translate 0.6s ease-out;
}
.pre.in {
  opacity: 1;
  translate: 0 0;
}
@media (prefers-reduced-motion: reduce) {
  .float {
    display: none;
  }
  .ring-arc,
  .story[open] .story-a {
    animation: none;
  }
  .btn,
  .tile {
    transition: none;
  }
}

/* Policy pages */
.doc h1 {
  margin: 12px 0 4px;
  font-size: 30px;
}
.updated {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}
.lead {
  margin: 0 0 20px;
  font-size: 17px;
}
.doc-body {
  padding: 4px 22px 22px;
  background: var(--card);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.doc-body section {
  padding-top: 18px;
  scroll-margin-top: 16px;
}
.doc-body section + section {
  margin-top: 18px;
  border-top: 1px solid var(--line);
}
.doc-body h2 {
  margin: 0;
  font-size: 19px;
}
.doc-body p,
.doc-body ul {
  margin: 8px 0 0;
}
.doc-body ul {
  padding-left: 1.25em;
}
.doc-body li + li {
  margin-top: 4px;
}

/* FAQ: one card per group; each question opens its answer (<details>, no script). */
.faq-group {
  padding: 18px 22px 6px;
  background: var(--card);
  border-radius: 24px;
  box-shadow: var(--shadow);
  scroll-margin-top: 16px;
}
.faq-group + .faq-group {
  margin-top: 16px;
}
.faq-group h2 {
  margin: 0 0 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--accent-text);
  font-size: 19px;
}
.qa + .qa {
  border-top: 1px solid var(--line);
}
.qa summary {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 0;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}
.qa summary::-webkit-details-marker {
  display: none;
}
.qa summary:hover {
  color: var(--accent-text);
}
/* The arrow: points down when closed, up when open. */
.qa summary::after {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  margin: 8px 4px 0 0;
  border-right: 2px solid var(--accent-text);
  border-bottom: 2px solid var(--accent-text);
  transform: rotate(45deg);
}
.qa[open] summary::after {
  margin-top: 12px;
  transform: rotate(-135deg);
}
.qa-a {
  padding-bottom: 14px;
  color: var(--muted-2);
}
.qa-a p,
.qa-a ul {
  margin: 8px 0 0;
}
.qa-a ul {
  padding-left: 1.25em;
}
.qa-a li + li {
  margin-top: 4px;
}
.qa-a > :first-child {
  margin-top: 0;
}
.faq-more {
  margin-top: 20px;
  text-align: center;
}
.faq-more p {
  margin: 6px 0 0;
}
/* Star bands in an FAQ answer: stars, range and share on one line, what it means under them. */
/* The rows share the list's columns (subgrid), so the stars all start in line after the widest range.
   The stars column is as wide as 5 stars (14px each, 2px apart). */
.qa-a .star-list {
  display: grid;
  grid-template-columns: auto 78px 1fr;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.qa-a .star-list li {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 5.5em 78px 1fr;
  grid-template-columns: subgrid;
  align-items: center;
  column-gap: 10px;
  row-gap: 2px;
  margin: 0;
  padding: 8px 0;
}
.qa-a .star-list li + li {
  border-top: 1px solid var(--line);
}
.star-list b {
  color: var(--text);
  white-space: nowrap;
}
.star-list .share {
  justify-self: end;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}
.star-list .say {
  grid-column: 1 / -1;
}

/* Link-off page */
.narrow {
  max-width: 480px;
}
.flow {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card {
  padding: 16px 18px;
  background: var(--card);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.card h2 {
  margin: 0;
  font-size: 17px;
}
.hint {
  margin: 0;
  color: var(--muted-2);
  font-size: 14px;
  text-align: center;
}
.done {
  padding: 32px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-radius: 28px;
}
.done h1 {
  margin: 16px 0 0;
  font-size: 23px;
}
.done p {
  margin: 8px 0 0;
}
.big-dot {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--chip);
  color: var(--accent-text);
}
.cta {
  text-align: center;
}
.cta p {
  margin: 4px 0 14px;
}
