/* Reading DNA quiz (BookTwin/Index) and result card (BookTwin/Result). */

/* Card colour themes, chosen by the result; booktwin.js uses the same colours
   to draw the downloadable card. */
[data-theme="midnight"] { --bt-a: #1e1b4b; --bt-b: #4c1d95; --bt-accent: #fbbf24; }
[data-theme="dreamer"]  { --bt-a: #312e81; --bt-b: #db2777; --bt-accent: #fde68a; }
[data-theme="romantic"] { --bt-a: #9f1239; --bt-b: #f97316; --bt-accent: #fef3c7; }
[data-theme="sage"]     { --bt-a: #2c3623; --bt-b: #718a56; --bt-accent: #e3c15c; }
[data-theme="achiever"] { --bt-a: #1e3a8a; --bt-b: #0891b2; --bt-accent: #fde047; }
[data-theme="soul"]     { --bt-a: #134e4a; --bt-b: #7c3aed; --bt-accent: #ccfbf1; }
[data-theme="explorer"] { --bt-a: #7c2d12; --bt-b: #ca8a04; --bt-accent: #fef9c3; }
[data-theme="classic"]  { --bt-a: #3f2a14; --bt-b: #a16207; --bt-accent: #fde68a; }

/* ---------- Quiz page ---------- */

.bt-hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2rem;
  align-items: center;
  margin: 1.5rem 0;
  padding: 2rem 2.25rem;
  border-radius: 1.25rem;
  color: #fff;
  background:
    radial-gradient(circle at 85% 20%, rgba(227, 193, 92, 0.35), transparent 45%),
    linear-gradient(135deg, var(--bb-sage-900), var(--bb-sage-700) 55%, var(--bb-blue-700));
  overflow: hidden;
}

.bt-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  color: var(--bb-gold-400);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.bt-ai-chip {
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  letter-spacing: 0.04em;
  text-transform: none;
}

.bt-hero h1 {
  margin-bottom: 0.6rem;
  color: #fff;
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.1;
}

.bt-hero p {
  max-width: 34rem;
  color: rgba(255, 255, 255, 0.88);
}

.bt-hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.bt-last {
  margin: 1rem 0 0;
  font-size: 0.9rem;
}

.bt-last a {
  color: var(--bb-gold-400);
}

.bt-hero-art {
  position: relative;
  height: 220px;
}

.bt-hero-card {
  position: absolute;
  top: 10px;
  left: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.25rem;
  width: 140px;
  height: 190px;
  margin-left: -70px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 1rem;
  background: linear-gradient(160deg, var(--bt-a), var(--bt-b));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
  font-size: 3rem;
  animation: bt-float 5s ease-in-out infinite;
}

.bt-hero-card strong {
  color: var(--bt-accent);
  font-size: 1.6rem;
}

.bt-hero-card-back {
  transform: translateX(-70px) rotate(-12deg);
  animation-delay: -1.5s;
  opacity: 0.85;
}

.bt-hero-card-mid {
  transform: translateX(70px) rotate(12deg);
  animation-delay: -3s;
  opacity: 0.9;
}

@keyframes bt-float {
  50% { translate: 0 -8px; }
}

.bt-quiz {
  position: relative;
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.75rem;
  border: 1px solid var(--bb-sage-200);
  border-radius: 1.25rem;
  background: #fff;
  box-shadow: 0 10px 30px rgba(44, 54, 35, 0.08);
}

.bt-quiz-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.bt-progress {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--bb-sage-100);
  overflow: hidden;
}

.bt-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--bb-gold-500), var(--bb-sage-600));
  transition: width 0.3s ease;
}

.bt-step-count {
  color: var(--bb-sage-700);
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

.bt-question {
  margin: 0 0 1.75rem;
  padding: 0;
  border: 0;
}

.bt-question legend {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  color: var(--bb-sage-900);
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.3;
}

.bt-question-number {
  display: grid;
  flex: none;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--bb-gold-100);
  color: var(--bb-gold-700);
  font-size: 0.95rem;
}

.bt-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.bt-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 4.25rem;
  padding: 0.85rem 1rem;
  border: 2px solid var(--bb-sage-200);
  border-radius: 0.9rem;
  background: var(--bb-sage-50);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.bt-option:hover {
  border-color: var(--bb-sage-500);
  transform: translateY(-2px);
}

.bt-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.bt-option:has(input:focus-visible) {
  outline: 3px solid var(--bb-blue-500);
  outline-offset: 2px;
}

.bt-option:has(input:checked) {
  border-color: var(--bb-gold-500);
  background: var(--bb-gold-100);
}

.bt-option-emoji {
  font-size: 1.75rem;
  line-height: 1;
}

.bt-option-text {
  color: var(--bb-sage-900);
  font-weight: 600;
  line-height: 1.3;
}

.bt-quiz-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.bt-quiz-hint {
  display: none;
  margin-left: auto;
  color: #6b7280;
  font-size: 0.85rem;
}

/* With JavaScript: one question at a time. */
.bt-quiz.is-stepped .bt-question {
  display: none;
  margin-bottom: 1.25rem;
}

.bt-quiz.is-stepped .bt-question.is-current {
  display: block;
  animation: bt-in 0.3s ease;
}

.bt-quiz.is-stepped .bt-quiz-hint {
  display: inline;
}

.bt-quiz.is-stepped:not(.is-last) .bt-submit {
  display: none;
}

.bt-quiz.is-stepped.is-last .bt-quiz-hint {
  display: none;
}

.bt-submit {
  margin-left: auto;
  font-weight: 700;
}

@keyframes bt-in {
  from { opacity: 0; transform: translateX(16px); }
}

.bt-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1rem;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.94);
}

.bt-loading[hidden] {
  display: none;
}

.bt-loading-book {
  display: flex;
  gap: 0.4rem;
}

.bt-loading-book span {
  width: 14px;
  height: 46px;
  border-radius: 3px;
  background: var(--bb-sage-600);
  animation: bt-bounce 0.9s ease-in-out infinite;
}

.bt-loading-book span:nth-child(2) { background: var(--bb-gold-500); animation-delay: 0.15s; }
.bt-loading-book span:nth-child(3) { background: var(--bb-blue-600); animation-delay: 0.3s; }

@keyframes bt-bounce {
  50% { transform: translateY(-12px); }
}

.bt-loading-text {
  margin: 0;
  color: var(--bb-sage-900);
  font-size: 1.1rem;
  font-weight: 700;
}

.bt-footnote {
  margin: 1rem auto 2.5rem;
  max-width: 46rem;
  color: #6b7280;
  font-size: 0.8rem;
  text-align: center;
}

/* ---------- Result page ---------- */

.bt-result {
  display: grid;
  grid-template-columns: minmax(0, 25rem) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
  margin: 1.75rem 0 2.5rem;
}

.bt-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  aspect-ratio: 4 / 5;
  padding: 1.5rem 1.5rem 1.1rem;
  border-radius: 1.5rem;
  color: #fff;
  text-align: center;
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.18), transparent 40%),
    radial-gradient(circle at 85% 90%, rgba(255, 255, 255, 0.12), transparent 45%),
    linear-gradient(155deg, var(--bt-a), var(--bt-b));
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  animation: bt-reveal 0.6s cubic-bezier(0.2, 0.8, 0.2, 1.2);
}

.bt-card::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 1.1rem;
  pointer-events: none;
}

@keyframes bt-reveal {
  from { opacity: 0; transform: scale(0.85) rotate(-3deg); }
}

.bt-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.bt-card-kicker {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.85;
}

.bt-card-ai {
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.72rem;
  font-weight: 700;
}

.bt-card-emoji {
  margin: 0.6rem 0 0.2rem;
  font-size: 4rem;
  line-height: 1;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.25));
}

.bt-card-name {
  margin: 0.25rem 0;
  color: var(--bt-accent);
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.1;
}

.bt-card-tagline {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-style: italic;
  opacity: 0.92;
}

.bt-card-traits {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin: 0 0 0.9rem;
  padding: 0;
  list-style: none;
}

.bt-card-traits li {
  padding: 0.2rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.78rem;
  font-weight: 700;
}

.bt-card-reads {
  width: 100%;
  margin-top: auto;
  padding: 0.75rem 0.9rem;
  border-radius: 0.9rem;
  background: rgba(0, 0, 0, 0.2);
  text-align: left;
}

.bt-card-reads > span {
  color: var(--bt-accent);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.bt-card-reads ol {
  margin: 0.3rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.85rem;
  line-height: 1.35;
}

.bt-card-reads em {
  opacity: 0.75;
  font-size: 0.78rem;
}

.bt-card-foot {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  opacity: 0.85;
}

.bt-card-foot img {
  border-radius: 4px;
  background: #fff;
}

.bt-share {
  margin-top: 1.25rem;
}

.bt-card-name-edit {
  margin-bottom: 1rem;
}

.bt-card-name-edit .form-label {
  margin-bottom: 0.3rem;
  color: var(--bb-sage-900);
  font-size: 0.85rem;
  font-weight: 700;
}

.bt-name-step .form-label {
  color: var(--bb-sage-900);
  font-weight: 700;
}

.bt-name-hint {
  margin: 0.6rem 0 0;
  color: #6b7280;
  font-size: 0.85rem;
}

.bt-card-locked {
  margin-bottom: 0.85rem;
  padding: 0.9rem 1rem;
  border: 1px dashed var(--bb-gold-500);
  border-radius: 0.9rem;
  background: var(--bb-gold-100);
}

.bt-card-locked p {
  margin: 0 0 0.75rem;
  color: var(--bb-sage-900);
  font-size: 0.9rem;
}

.bt-card-locked .bt-share-buttons {
  margin-bottom: 0;
}

.bt-share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.bt-share-buttons .btn {
  display: inline-flex;
  flex: 1 1 9rem;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-weight: 700;
}

.bt-share .share-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.bt-share .blog-share-label {
  margin-right: 0.25rem;
  color: var(--bb-sage-700);
  font-size: 0.85rem;
  font-weight: 700;
}

.bt-share-hint {
  margin: 0.6rem 0 0;
  color: #6b7280;
  font-size: 0.8rem;
}

.bt-result-side {
  display: grid;
  gap: 1.25rem;
}

.bt-panel {
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--bb-sage-200);
  border-radius: 1rem;
  background: #fff;
}

.bt-panel h2 {
  margin-bottom: 0.6rem;
  color: var(--bb-sage-900);
  font-size: 1.2rem;
  font-weight: 800;
}

.bt-panel h3 {
  margin: 1rem 0 0.5rem;
  color: var(--bb-sage-700);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bt-description {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.6;
}

.bt-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.bt-genre {
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: var(--bb-sage-100);
  color: var(--bb-sage-900);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
}

.bt-genre:hover {
  background: var(--bb-gold-100);
  color: var(--bb-gold-700);
}

.bt-reads {
  display: grid;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bt-reads li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--bb-sage-100);
}

.bt-reads li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.bt-reads strong {
  color: var(--bb-sage-900);
}

.bt-reads-author {
  margin-left: 0.35rem;
  color: #6b7280;
  font-size: 0.85rem;
}

.bt-reads p {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
}

.bt-reads-find {
  flex: none;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--bb-blue-200);
  border-radius: 999px;
  color: var(--bb-blue-700);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
}

.bt-reads-find:hover {
  background: var(--bb-blue-50);
}

.bt-join {
  color: #fff;
  border: 0;
  background: linear-gradient(135deg, var(--bb-sage-700), var(--bb-sage-900));
}

.bt-join h2 {
  color: var(--bb-gold-400);
}

.bt-join p {
  color: rgba(255, 255, 255, 0.88);
}

.bt-join-login {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  text-align: center;
}

.bt-join-login a {
  color: var(--bb-gold-400);
}

.bt-retake {
  margin: 0;
  text-align: center;
}

.bt-picks {
  margin-bottom: 2.75rem;
}

.bt-locked {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.35rem;
  min-height: 16rem;
  padding: 1rem;
  border: 2px dashed var(--bb-gold-500);
  border-radius: 1rem;
  background: repeating-linear-gradient(135deg, var(--bb-gold-100), var(--bb-gold-100) 12px, #fff 12px, #fff 24px);
  color: var(--bb-sage-900);
  text-align: center;
  text-decoration: none;
}

.bt-locked:hover {
  border-style: solid;
}

.bt-locked-icon {
  font-size: 2rem;
}

.bt-locked span:last-child {
  color: var(--bb-gold-700);
  font-size: 0.85rem;
  font-weight: 700;
}

@media (max-width: 991.98px) {
  .bt-result {
    grid-template-columns: minmax(0, 1fr);
  }

  .bt-result-main {
    max-width: 25rem;
    width: 100%;
    margin: 0 auto;
  }
}

@media (max-width: 767.98px) {
  .bt-hero {
    grid-template-columns: 1fr;
    padding: 1.5rem;
  }

  .bt-hero-art {
    display: none;
  }

  .bt-quiz {
    padding: 1.25rem;
  }

  .bt-options {
    grid-template-columns: 1fr;
  }

  .bt-question legend {
    font-size: 1.15rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bt-hero-card,
  .bt-card,
  .bt-loading-book span,
  .bt-quiz.is-stepped .bt-question.is-current {
    animation: none;
  }
}

/* Start panel, shown while AI is on: AI writes the questions when it's pressed. */
.bt-start {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  padding: 1.5rem 1rem;
  text-align: center;
}

.bt-start[hidden],
.bt-quiz-body[hidden] {
  display: none;
}

.bt-start-icon {
  font-size: 2.75rem;
  line-height: 1;
}

.bt-start h2 {
  margin: 0;
  color: var(--bb-sage-900);
  font-size: 1.5rem;
  font-weight: 800;
}

.bt-start p {
  max-width: 28rem;
  margin: 0 0 0.5rem;
  color: #4b5563;
}

.bt-fresh {
  display: inline-block;
  margin: 0 0 0.85rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: var(--bb-gold-100);
  color: var(--bb-gold-700);
  font-size: 0.8rem;
  font-weight: 700;
}

/* ---------- Compatibility Check ---------- */

/* A friend's view of a result: the big invitation. */
.bt-compat {
  position: relative;
  padding: 1.5rem;
  border-radius: 1.1rem;
  color: #fff;
  background:
    radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.25), transparent 40%),
    linear-gradient(135deg, #db2777, #7c3aed 60%, #312e81);
  box-shadow: 0 16px 36px rgba(124, 58, 237, 0.25);
  overflow: hidden;
}

.bt-compat-hearts {
  position: absolute;
  top: -0.6rem;
  right: 0.6rem;
  font-size: 4.5rem;
  opacity: 0.25;
  transform: rotate(12deg);
}

.bt-compat h2 {
  position: relative;
  margin-bottom: 0.5rem;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
}

.bt-compat p {
  position: relative;
  color: rgba(255, 255, 255, 0.9);
}

.bt-compat .btn-light {
  color: #7c3aed;
}

.bt-compat-alt {
  display: block;
  margin-top: 0.6rem;
  color: #fff;
  font-size: 0.85rem;
  text-align: center;
}

.bt-compat-note {
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  text-align: center;
}

/* The owner's view: their matches. */
.bt-panel-sub {
  margin-bottom: 0.85rem;
  color: #6b7280;
  font-size: 0.9rem;
}

.bt-match-list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bt-match-list a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--bb-sage-100);
  border-radius: 0.8rem;
  color: inherit;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.bt-match-list a:hover {
  background: var(--bb-sage-50);
  transform: translateX(3px);
}

.bt-match-list-emoji {
  display: grid;
  flex: none;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: linear-gradient(155deg, var(--bt-a), var(--bt-b));
  font-size: 1.2rem;
}

.bt-match-list-who {
  display: grid;
  flex: 1;
  min-width: 0;
}

.bt-match-list-who span {
  overflow: hidden;
  color: #6b7280;
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bt-match-list-score {
  flex: none;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: #fce7f3;
  color: #be185d;
  font-weight: 800;
  font-size: 0.85rem;
}

.bt-empty {
  margin: 0;
  color: #6b7280;
}

.bt-compat-teaser {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.bt-compat-teaser span {
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: #fce7f3;
  color: #be185d;
  font-weight: 800;
}

/* The quiz page while comparing. */
.bt-compare-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 46rem;
  margin: 0 auto 1.25rem;
  padding: 1rem 1.25rem;
  border-radius: 1rem;
  color: #fff;
  background: linear-gradient(135deg, var(--bt-a), var(--bt-b));
}

.bt-compare-banner-emoji {
  font-size: 2.5rem;
  line-height: 1;
}

.bt-compare-banner strong,
.bt-compare-banner span {
  display: block;
}

.bt-compare-banner span {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.92rem;
}

/* The match page. */
.bt-match {
  margin: 1.5rem 0;
  padding: 2rem 1.5rem 2.25rem;
  border-radius: 1.5rem;
  color: #fff;
  text-align: center;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.18), transparent 35%),
    radial-gradient(circle at 85% 85%, rgba(251, 191, 36, 0.25), transparent 40%),
    linear-gradient(135deg, #312e81, #7c3aed 50%, #db2777);
}

.bt-match-eyebrow {
  display: inline-block;
  margin-bottom: 1.25rem;
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bt-match-duo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.bt-mini-card {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.25rem;
  width: 10rem;
  min-height: 12.5rem;
  padding: 1rem 0.75rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 1.1rem;
  background: linear-gradient(155deg, var(--bt-a), var(--bt-b));
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.25);
}

.bt-mini-card:first-child {
  transform: rotate(-5deg);
}

.bt-mini-card:last-child {
  transform: rotate(5deg);
}

.bt-mini-who {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}

.bt-mini-emoji {
  font-size: 3rem;
  line-height: 1.1;
}

.bt-mini-card strong {
  color: var(--bt-accent);
  font-size: 1rem;
  line-height: 1.2;
}

.bt-score-ring {
  --p: calc(var(--score) * 1%);
  display: grid;
  place-items: center;
  align-content: center;
  width: 9.5rem;
  height: 9.5rem;
  border-radius: 50%;
  background:
    radial-gradient(closest-side, #fff 78%, transparent 80%),
    conic-gradient(#fbbf24 0, #f472b6 var(--p), rgba(255, 255, 255, 0.25) var(--p));
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.12), 0 18px 40px rgba(0, 0, 0, 0.3);
  animation: bt-pop 0.7s cubic-bezier(0.2, 0.8, 0.2, 1.3);
}

.bt-score-value {
  color: #7c3aed;
  font-size: 2.6rem;
  font-weight: 900;
  line-height: 1;
}

.bt-score-hidden {
  color: #a78bfa;
  filter: blur(3px);
}

.bt-score-label {
  color: #6b7280;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.is-locked .bt-score-ring {
  background:
    radial-gradient(closest-side, #fff 78%, transparent 80%),
    repeating-conic-gradient(rgba(255, 255, 255, 0.5) 0 6deg, rgba(255, 255, 255, 0.15) 6deg 12deg);
}

@keyframes bt-pop {
  from { opacity: 0; transform: scale(0.6); }
}

.bt-match-title {
  margin: 1.5rem 0 0.4rem;
  color: #fff;
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  font-weight: 900;
}

.bt-match-title span {
  color: #fde68a;
}

.bt-match-blurb {
  max-width: 34rem;
  margin: 0 auto;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.05rem;
}

.bt-match-unlock {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 2.5rem;
}

.bt-match-unlock-text {
  padding: 1.75rem;
  border-radius: 1.1rem;
  color: #fff;
  background: linear-gradient(135deg, var(--bb-sage-700), var(--bb-sage-900));
}

.bt-match-unlock-text h2 {
  color: var(--bb-gold-400);
  font-size: 1.4rem;
  font-weight: 800;
}

.bt-match-unlock-text ul {
  display: grid;
  gap: 0.55rem;
  margin: 0.75rem 0 1.25rem;
  padding: 0;
  list-style: none;
}

.bt-match-unlock-text li span {
  margin-right: 0.4rem;
}

.bt-match-unlock-text .bt-join-login a {
  color: var(--bb-gold-400);
}

.bt-blurred {
  filter: blur(4px);
  opacity: 0.7;
  user-select: none;
}

.bt-match-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 2.5rem;
}

.bt-match-side {
  display: grid;
  gap: 1.25rem;
}

.bt-dna-legend {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.bt-dna-legend i {
  display: inline-block;
  width: 0.8rem;
  height: 0.8rem;
  margin-right: 0.3rem;
  border-radius: 3px;
  vertical-align: -1px;
}

.bt-dna-row {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--bb-sage-100);
}

.bt-dna-row:last-child {
  border-bottom: 0;
}

.bt-dna-label {
  color: var(--bb-sage-900);
  font-size: 0.88rem;
  font-weight: 600;
}

.bt-dna-bars {
  display: grid;
  gap: 4px;
}

.bt-dna-bar {
  display: block;
  width: var(--w, 0);
  min-width: 4px;
  height: 10px;
  border-radius: 999px;
  animation: bt-grow 0.9s ease-out;
}

.bt-dna-bar.is-me,
.bt-dna-legend .is-me {
  background: linear-gradient(90deg, #7c3aed, #a78bfa);
}

.bt-dna-bar.is-them,
.bt-dna-legend .is-them {
  background: linear-gradient(90deg, #db2777, #f9a8d4);
}

@keyframes bt-grow {
  from { width: 0; }
}

.bt-swap {
  display: grid;
  gap: 0.75rem;
}

.bt-swap-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.1rem 0.75rem;
  align-items: center;
  padding: 0.75rem 0.9rem;
  border-radius: 0.8rem;
  background: var(--bb-sage-50);
}

.bt-swap-for {
  grid-column: 1 / -1;
  color: #be185d;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bt-swap-item strong {
  color: var(--bb-sage-900);
}

.bt-swap-item .bt-reads-author {
  grid-column: 1;
  margin-left: 0;
}

.bt-swap-item .bt-reads-find {
  grid-column: 2;
  grid-row: 2 / span 2;
}

.bt-match-side .bt-join .share-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

@media (max-width: 767.98px) {
  .bt-match-duo {
    gap: 0.5rem;
  }

  .bt-mini-card {
    width: 6.5rem;
    min-height: 9rem;
    padding: 0.75rem 0.4rem;
  }

  .bt-mini-emoji {
    font-size: 2.2rem;
  }

  .bt-mini-card strong {
    font-size: 0.8rem;
  }

  .bt-score-ring {
    width: 7rem;
    height: 7rem;
  }

  .bt-score-value {
    font-size: 1.9rem;
  }

  .bt-match-unlock,
  .bt-match-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .bt-match-unlock-preview {
    display: none;
  }

  .bt-dna-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bt-score-ring,
  .bt-dna-bar {
    animation: none;
  }
}

/* ---------- Reading DNA groups (BookTwin/Group, BookTwin/NewGroup) ---------- */

.bt-group-banner {
  background: linear-gradient(135deg, #1e3a8a, #0891b2);
}

.bt-group-hero {
  display: grid;
  justify-items: center;
  gap: 0.6rem;
}

.bt-group-hero .bt-match-eyebrow {
  margin-bottom: 0.25rem;
}

.bt-group-name {
  margin: 0;
  color: #fff;
  font-size: clamp(1.8rem, 1.3rem + 2.4vw, 2.8rem);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.bt-group-meta {
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
}

.bt-group-faces {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  max-width: 40rem;
  margin: 0.5rem 0;
}

.bt-face {
  display: inline-grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  background: linear-gradient(155deg, var(--bt-a, #4c1d95), var(--bt-b, #7c3aed));
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
  font-size: 1.45rem;
  line-height: 1;
  animation: bt-pop 0.5s cubic-bezier(0.2, 0.8, 0.2, 1.3) backwards;
}

.bt-face:nth-child(2n) { animation-delay: 0.05s; }
.bt-face:nth-child(3n) { animation-delay: 0.1s; }

.bt-face.is-me {
  border-color: #fde68a;
  box-shadow: 0 0 0 3px rgba(253, 230, 138, 0.45), 0 6px 14px rgba(0, 0, 0, 0.2);
}

.bt-face-more {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 800;
}

.bt-face-sm {
  width: 2rem;
  height: 2rem;
  margin-right: 0.3rem;
  font-size: 1rem;
  vertical-align: middle;
  box-shadow: none;
}

.bt-group-score {
  margin: 0.25rem 0;
}

.bt-group-cta {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.bt-group-cta .btn-light {
  color: #7c3aed;
}

.bt-group-in {
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-weight: 700;
}

.bt-group-note {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
}

.bt-group-main {
  display: grid;
  gap: 1.25rem;
}

.bt-group-bars {
  grid-template-columns: minmax(0, 1fr) 2.75rem;
  align-items: center;
  gap: 0.6rem;
}

.bt-group-percent {
  color: #6b7280;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: right;
}

.bt-group-types {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bt-group-types li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem 0.35rem 0.4rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--bt-a), var(--bt-b));
  color: #fff;
  font-size: 0.88rem;
}

.bt-group-type-emoji {
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.bt-group-type-count {
  color: var(--bt-accent);
  font-weight: 800;
}

.bt-group-duo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 0.25rem 0 0.75rem;
}

.bt-group-duo .bt-face {
  border-color: #fff;
}

.bt-group-duo-score {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: #fce7f3;
  color: #be185d;
  font-weight: 800;
}

.bt-group-locked {
  color: #fff;
  border: 0;
  background:
    radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.22), transparent 40%),
    linear-gradient(135deg, #db2777, #7c3aed 60%, #312e81);
}

.bt-group-locked h2 {
  color: #fff;
}

.bt-group-locked ul {
  display: grid;
  gap: 0.35rem;
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
}

.bt-group-locked li span {
  margin-right: 0.35rem;
}

.bt-group-locked .bt-join-login a {
  color: #fff;
}

.bt-group-manage {
  text-align: center;
  font-size: 0.88rem;
}

.bt-group-new {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 2.5rem;
}

.bt-groups-panel .bt-match-list-emoji,
.bt-group-new .bt-match-list-emoji {
  color: #fff;
}

@media (max-width: 767.98px) {
  .bt-group-new {
    grid-template-columns: minmax(0, 1fr);
  }

  .bt-face {
    width: 2.6rem;
    height: 2.6rem;
    font-size: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bt-face {
    animation: none;
  }
}

/* ---------- Reading DNA page (BookTwin/Index) and quiz header (BookTwin/Quiz) ---------- */

.bt-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin: 1rem 0 -0.5rem;
  color: #6b7280;
  font-size: 0.9rem;
}

.bt-crumbs a {
  color: var(--bb-sage-700);
  font-weight: 700;
  text-decoration: none;
}

.bt-crumbs a:hover {
  text-decoration: underline;
}

.bt-hub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.1rem 0 0.25rem;
}

.bt-hub-mycard {
  display: grid;
  justify-items: center;
  gap: 0.3rem;
  justify-self: center;
  width: min(100%, 17rem);
  padding: 1.5rem 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 1.25rem;
  background:
    radial-gradient(circle at 80% 10%, rgba(255, 255, 255, 0.2), transparent 45%),
    linear-gradient(155deg, var(--bt-a), var(--bt-b));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
  color: #fff;
  text-align: center;
  text-decoration: none;
  transform: rotate(3deg);
  transition: transform 0.2s ease;
}

.bt-hub-mycard:hover {
  color: #fff;
  transform: rotate(0) translateY(-4px);
}

.bt-hub-mycard-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
}

.bt-hub-mycard-emoji {
  font-size: 3.5rem;
  line-height: 1.1;
}

.bt-hub-mycard strong {
  color: var(--bt-accent);
  font-size: 1.3rem;
  line-height: 1.2;
}

.bt-hub-mycard-tagline {
  font-size: 0.85rem;
  font-style: italic;
  opacity: 0.9;
}

.bt-hub-mycard-open {
  margin-top: 0.4rem;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.82rem;
  font-weight: 700;
}

.bt-hub-save {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 0.9rem;
  align-items: center;
  margin: -0.5rem 0 1.25rem;
  padding: 0.8rem 1rem;
  border: 1px solid #fde68a;
  border-radius: 1rem;
  background: #fffbeb;
  color: #78350f;
}

.bt-hub-save > div {
  flex: 1;
  min-width: 12rem;
}

.bt-hub-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.bt-hub-tile {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.25rem;
  border: 1px solid var(--bb-sage-200);
  border-radius: 1rem;
  background: #fff;
  color: #4b5563;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.bt-hub-tile:hover {
  border-color: #c4b5fd;
  box-shadow: 0 12px 28px rgba(124, 58, 237, 0.12);
  color: #4b5563;
  transform: translateY(-3px);
}

.bt-hub-tile-icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.25rem;
  border-radius: 0.9rem;
  background: linear-gradient(155deg, var(--bt-a), var(--bt-b));
  font-size: 1.5rem;
}

.bt-hub-tile strong {
  color: var(--bb-sage-900);
  font-size: 1.05rem;
}

.bt-hub-tile > span:not([class]) {
  font-size: 0.9rem;
}

.bt-hub-tile-go {
  margin-top: auto;
  padding-top: 0.35rem;
  color: #7c3aed;
  font-size: 0.9rem;
  font-weight: 800;
}

.bt-hub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 1.25rem;
}

.bt-hub-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.bt-hub-panel-head h2 {
  margin: 0;
}

.bt-hub-group-emoji {
  color: #fff;
}

.bt-hub-open {
  flex: none;
  color: #7c3aed;
  font-size: 0.85rem;
  font-weight: 700;
}

.bt-hub-types {
  margin-bottom: 2.5rem;
  padding: 1.75rem 1.5rem;
  border-radius: 1.25rem;
  background: linear-gradient(180deg, #faf5ff, #fff);
  border: 1px solid #ede9fe;
  text-align: center;
}

.bt-hub-types h2 {
  margin-bottom: 0.35rem;
  color: var(--bb-sage-900);
  font-size: 1.35rem;
  font-weight: 800;
}

.bt-hub-types ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 10rem), 1fr));
  gap: 0.75rem;
  margin: 1rem 0 1.25rem;
  padding: 0;
  list-style: none;
}

.bt-hub-types li {
  display: grid;
  justify-items: center;
  gap: 0.3rem;
  padding: 1rem 0.75rem;
  border-radius: 1rem;
  background: linear-gradient(155deg, var(--bt-a), var(--bt-b));
  color: #fff;
}

.bt-hub-types li span {
  font-size: 2rem;
  line-height: 1;
}

.bt-hub-types li strong {
  font-size: 0.88rem;
}

/* The quiz page's header, now that the hub has the big hero. */
.bt-quiz-head {
  max-width: 46rem;
  margin: 1.5rem auto 1.25rem;
  text-align: center;
}

.bt-eyebrow-dark {
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  background: var(--bb-sage-100);
  color: var(--bb-sage-900);
}

.bt-quiz-head h1 {
  margin: 0.5rem 0;
  color: var(--bb-sage-900);
  font-size: clamp(1.8rem, 1.3rem + 2vw, 2.5rem);
  font-weight: 900;
}

.bt-quiz-head p {
  margin: 0 0 0.6rem;
  color: #4b5563;
  font-size: 1.02rem;
}

.bt-quiz-points {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.25rem;
  margin: 0;
  padding: 0;
  color: var(--bb-sage-700);
  font-size: 0.9rem;
  font-weight: 600;
  list-style: none;
}

.bt-leave {
  margin: 0 0 2.5rem;
  text-align: center;
  font-size: 0.9rem;
}

.bt-leave a {
  color: #6b7280;
}

@media (max-width: 767.98px) {
  .bt-hub-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .bt-hub-mycard {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bt-hub-tile,
  .bt-hub-mycard {
    transition: none;
  }
}
