:root {
  --cm-purple: #7C3FBF;
  --cm-purple-deep: #8b5cf6;
  --cm-pink: #ff7ab8;
  --cm-orange: #ffb27a;
  --cm-text: #292929;
  --cm-text-soft: rgba(90, 90, 82, 0.74);
  --cm-text-faint: rgba(90, 90, 82, 0.85);
  --cm-surface: rgba(253, 252, 241, 0.95);
  --cm-surface-2: rgba(247, 246, 226, 0.92);
  --cm-border: rgba(185, 139, 255, 0.24);
  --cm-border-soft: rgba(185, 139, 255, 0.14);
  --cm-glow: 0 24px 60px rgba(139, 92, 246, 0.28);
}

/* Floating curls behind everything */
.cm-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.42;
}

/* Inner animated curls INSIDE the shell */
.cm-inner-curls {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.55;
  z-index: 0;
}

/* Fun fact overlay — sits on top of the quiz card so layout never shifts */
.cm-fun-fact {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 30%, rgba(185, 139, 255, 0.3), transparent 60%),
    linear-gradient(150deg, rgba(253, 252, 241, 0.98), rgba(247, 246, 226, 0.98));
  backdrop-filter: blur(10px);
  animation: cm-fact-pop 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
  overflow: auto;
}

.cm-fun-fact-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  text-align: center;
  max-width: 420px;
}

.cm-fun-fact-icon {
  font-size: 2.4rem;
  line-height: 1;
  animation: cm-sparkle 1.5s ease-in-out infinite;
}

.cm-fun-fact-kicker {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--cm-pink);
}

.cm-fun-fact-text {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--cm-text);
  line-height: 1.5;
}

.cm-fun-fact-btn {
  margin-top: 0.25rem;
  padding: 0.8rem 1.6rem;
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--cm-pink), var(--cm-purple-deep));
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(255, 122, 184, 0.3);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.cm-fun-fact-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 14px 32px rgba(255, 122, 184, 0.42);
}

.cm-fun-fact-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--cm-text-faint);
}

@keyframes cm-fact-pop {
  0% { opacity: 0; transform: scale(0.96); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes cm-sparkle {
  0%, 100% { transform: rotate(-8deg) scale(1); }
  50% { transform: rotate(8deg) scale(1.1); }
}

.cm-page {
  position: relative;
  z-index: 1;
  max-width: 1040px;
  color: var(--cm-text);
}

/* ---------------- Hero ---------------- */
.cm-kicker {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--cm-purple);
}

.cm-hero {
  text-align: center;
  margin-bottom: 1.6rem;
}

.cm-hero .tvx-h1,
.cm-live-title,
.cm-result-title {
  font-family: 'Baloo 2', 'Plus Jakarta Sans', sans-serif;
}

.cm-hero .tvx-h1 {
  margin-bottom: 0.55rem;
  font-size: clamp(2.9rem, 6vw, 4.4rem);
  line-height: 0.95;
  background: linear-gradient(110deg, var(--cm-purple), var(--cm-pink), var(--cm-orange));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: cm-wobble 6s ease-in-out infinite;
}

.cm-hero .tvx-subtitle {
  color: var(--cm-text-soft);
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.cm-hero-pills {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.1rem;
}

.cm-hero-pills span,
.cm-question-tag {
  border: 1px solid var(--cm-border);
  background: var(--cm-surface-2);
  color: var(--cm-text);
  border-radius: 999px;
  padding: 0.42rem 0.9rem;
  font-size: 0.86rem;
  font-weight: 700;
}

/* ---------------- Shell ---------------- */
.cm-shell {
  position: relative;
  overflow: hidden;
  padding: 1.25rem;
  margin-bottom: 1.35rem;
  border: 1px solid var(--cm-border-soft);
  background:
    radial-gradient(circle at 82% 8%, rgba(255, 122, 184, 0.16), transparent 40%),
    radial-gradient(circle at 12% 92%, rgba(139, 92, 246, 0.2), transparent 42%),
    rgba(240, 239, 198, 0.85);
  box-shadow: var(--cm-glow);
}

.cm-shell::before {
  content: '';
  position: absolute;
  inset: 14px;
  border-radius: 20px;
  border: 1px dashed rgba(185, 139, 255, 0.16);
  pointer-events: none;
}

.cm-shell-curl {
  position: absolute;
  width: 96px;
  height: 96px;
  border: 4px solid rgba(185, 139, 255, 0.2);
  border-radius: 50% 45% 55% 50%;
  pointer-events: none;
}

.cm-shell-curl::after {
  content: '';
  position: absolute;
  inset: 16px;
  border: 3px solid rgba(255, 122, 184, 0.22);
  border-radius: inherit;
}

.cm-shell-curl--1 { top: -18px; left: -8px; transform: rotate(16deg); }
.cm-shell-curl--2 { top: 22%; right: -38px; transform: rotate(-12deg); }
.cm-shell-curl--3 { bottom: -24px; left: 18%; transform: rotate(-22deg); }
.cm-shell-curl--4 { right: 18%; bottom: -18px; transform: rotate(20deg); }

.cm-playground {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  gap: 1rem;
}

.cm-quiz-card,
.cm-live-card,
.cm-result {
  position: relative;
  z-index: 1;
  border: 1px solid var(--cm-border);
  border-radius: 22px;
  background: var(--cm-surface);
  backdrop-filter: blur(16px);
}

/* Fixed min-height keeps the options in the same place from question to
   question, so you never have to chase the buttons with your mouse. */
.cm-quiz-card {
  padding: 1.5rem;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  /* Clears the sticky site navbar when we scroll the card into view. */
  scroll-margin-top: 84px;
}

/* Push Back to the bottom so the card height stays constant. */
.cm-quiz-card .cm-quiz-actions { margin-top: auto; padding-top: 1.1rem; }

.cm-live-card {
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.cm-live-kicker,
.cm-result-kicker,
.cm-commandments-title {
  margin: 0;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--cm-purple);
}

.cm-live-stage-wrap,
.cm-result-stage-wrap {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--cm-border-soft);
  background:
    radial-gradient(circle at 50% 22%, rgba(185, 139, 255, 0.22), transparent 55%),
    linear-gradient(180deg, #FDFCF1, #F0EFC6);
}

.cm-live-stage,
.cm-result-stage {
  display: block;
  width: 100%;
  height: auto;
}

.cm-live-title {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.05;
  color: var(--cm-text);
}

.cm-live-line {
  margin: 0;
  color: var(--cm-text-soft);
  font-size: 1rem;
  line-height: 1.5;
}

/* ---------------- Quiz ---------------- */
.cm-question-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.cm-step-label {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--cm-text-faint);
}

.cm-progress {
  height: 12px;
  border-radius: 999px;
  background: rgba(185, 139, 255, 0.16);
  overflow: hidden;
  margin-bottom: 1rem;
}

.cm-progress-fill {
  display: block;
  height: 100%;
  width: 14%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cm-purple), var(--cm-pink), var(--cm-orange));
  box-shadow: 0 0 16px rgba(255, 122, 184, 0.5);
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.cm-question {
  margin: 0 0 0.55rem;
  line-height: 1.18;
  color: var(--cm-text);
  /* Reserve room for two lines so short and long questions render the
     options at the same vertical position. */
  min-height: 2.36em;
}

.cm-question-note {
  margin: 0 0 1.1rem;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--cm-text-soft);
  /* Two lines reserved so the options never shift between questions. */
  min-height: 3.2em;
}

.cm-options {
  display: grid;
  gap: 0.7rem;
}

.cm-option {
  text-align: left;
  width: 100%;
  color: var(--cm-text);
  border: 1px solid var(--cm-border-soft);
  border-radius: 16px;
  background: rgba(185, 139, 255, 0.07);
  padding: 0.95rem 1.05rem;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.cm-option:hover {
  transform: translateY(-2px);
  border-color: var(--cm-purple);
  background: rgba(185, 139, 255, 0.15);
  box-shadow: 0 16px 30px rgba(139, 92, 246, 0.22);
}

.cm-option.is-picked {
  background: linear-gradient(130deg, var(--cm-purple-deep), var(--cm-pink));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 16px 34px rgba(255, 122, 184, 0.32);
}

.cm-option-title {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
}

.cm-option-sub {
  display: block;
  font-size: 0.88rem;
  color: var(--cm-text-soft);
}

.cm-option.is-picked .cm-option-sub {
  color: rgba(41, 41, 41, 0.9);
}

.cm-quiz-actions { margin-top: 1.1rem; }

/* ---------------- Readouts / badges ---------------- */
.cm-readouts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.cm-readout,
.cm-badge {
  border-radius: 14px;
  padding: 0.8rem 0.85rem;
  border: 1px solid var(--cm-border-soft);
  background: linear-gradient(180deg, rgba(185, 139, 255, 0.1), rgba(255, 122, 184, 0.08));
}

.cm-readout-label,
.cm-badge-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  color: var(--cm-text-faint);
  margin-bottom: 0.3rem;
}

.cm-readout-value,
.cm-badge strong {
  display: block;
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--cm-text);
}

/* ---------------- Result ---------------- */
.cm-result { padding: 1.4rem; }

.cm-hidden { display: none !important; }

.cm-result-head {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.1rem;
}

.cm-result-emoji {
  font-size: 3rem;
  line-height: 1;
  animation: cm-pop 0.55s ease;
}

.cm-result-title {
  margin: 0.06rem 0 0.12rem;
  font-size: clamp(2rem, 3.2vw, 2.9rem);
  line-height: 0.95;
  background: linear-gradient(110deg, var(--cm-purple), var(--cm-pink));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.cm-result-subtitle {
  margin: 0.15rem 0;
  color: var(--cm-text-soft);
  font-size: 1.05rem;
}

.cm-chaos {
  margin: 0.28rem 0 0;
  color: var(--cm-text-soft);
}

.cm-chaos strong { color: var(--cm-pink); }

.cm-result-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
  align-items: start;
}

.cm-result-copy {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 1rem;
  align-items: start;
}

.cm-verdict {
  margin: 0;
  color: var(--cm-text-soft);
  font-size: 1.04rem;
  line-height: 1.6;
}

.cm-badges {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.cm-commandments-wrap {
  border-radius: 16px;
  padding: 1rem 1.05rem;
  border: 1px solid var(--cm-border-soft);
  background: linear-gradient(180deg, rgba(185, 139, 255, 0.1), rgba(255, 122, 184, 0.08));
}

.cm-commandments {
  margin: 0.55rem 0 0;
  color: var(--cm-text);
}

.cm-commandments li { color: var(--cm-text-soft); }
.cm-commandments li + li { margin-top: 0.4rem; }

.cm-humidity { margin-top: 1.25rem; }

.cm-humidity label {
  display: block;
  font-weight: 700;
  color: var(--cm-text);
  margin-bottom: 0.5rem;
}

.cm-humidity label span { color: var(--cm-pink); }

.cm-humidity-note {
  color: var(--cm-text-faint);
  font-size: 0.9rem;
  margin: 0.45rem 0 0;
}

.cm-range {
  width: 100%;
  accent-color: var(--cm-pink);
  cursor: pointer;
}

.cm-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.15rem;
}

.cm-share-msg {
  min-height: 1.3em;
  margin: 0.75rem 0 0;
  font-size: 0.92rem;
  color: var(--cm-purple);
}

/* ---------------- Content blocks ---------------- */
.cm-content { padding: 1.5rem 1.6rem; margin-bottom: 1.3rem; }
.cm-content .tvx-h2 { color: var(--cm-text); }
.cm-content .tvx-list { color: var(--cm-text-soft); line-height: 1.7; }
.cm-content .tvx-list strong { color: var(--cm-text); }
.cm-content .tvx-secondary { color: var(--cm-text-soft); }
.cm-content .tvx-h3 { color: var(--cm-text); }

/* ---------------- Motion ---------------- */
@keyframes cm-wobble {
  0%, 100% { transform: rotate(-1.3deg); }
  50% { transform: rotate(1.3deg); }
}

@keyframes cm-pop {
  0% { transform: scale(0.45) rotate(-16deg); }
  70% { transform: scale(1.08) rotate(8deg); }
  100% { transform: scale(1) rotate(0); }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 860px) {
  .cm-playground,
  .cm-result-copy {
    grid-template-columns: 1fr;
  }

  .cm-shell { padding: 1rem; }

  /* Quiz stays first on small screens so you never scroll past the
     animation to find the questions. */
  .cm-quiz-card { order: 0; }
  .cm-live-card { order: 1; }

  /* Keep the animation compact so the quiz stays reachable. */
  .cm-live-stage-wrap { max-width: 320px; margin: 0 auto; }
}

@media (max-width: 560px) {
  .cm-quiz-card,
  .cm-live-card,
  .cm-result,
  .cm-content {
    padding: 1rem;
  }

  /* Let the card hug its content so there's no dead space under the
     options on small screens. */
  .cm-quiz-card { min-height: 0; }
  .cm-quiz-card .cm-quiz-actions { margin-top: 1rem; padding-top: 0; }
  .cm-question { min-height: 0; }
  .cm-question-note { min-height: 0; }

  .cm-question-topline { align-items: flex-start; }
  .cm-readouts { grid-template-columns: 1fr 1fr; }

  .cm-hero-pills span,
  .cm-question-tag { font-size: 0.8rem; }

  .cm-fun-fact { padding: 1rem 0.85rem; }
  .cm-fun-fact-icon { font-size: 2rem; }
  .cm-fun-fact-text { font-size: 1rem; }
  .cm-fun-fact-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .cm-hero .tvx-h1,
  .cm-result-emoji { animation: none; }

  .cm-progress-fill,
  .cm-option { transition: none; }
}
