/*
 * ふたりIF - design tokens and components.
 * Hand-written CSS on purpose: the look is specific enough that a utility
 * framework would only get in the way, and it keeps the page dependency-free.
 */

:root {
  color-scheme: light;

  --paper: #ffffff;
  --paper-deep: #f2efec;
  --card: #ffffff;
  --ink: #2b2723;
  --ink-soft: #55504b;
  --ink-faint: #857f79;
  --line: #ebe6e1;

  --brand: #f184a4;
  --brand-deep: #d9587f;
  --brand-soft: #fdeaf0;

  --theme: var(--brand);
  --theme-deep: var(--brand-deep);
  --theme-soft: var(--brand-soft);

  --radius-lg: 18px;
  --radius-md: 15px;
  --radius-sm: 11px;

  --shadow-card: none;
  --shadow-pop: 0 10px 22px -16px rgba(90, 76, 66, 0.5);

  --font-jp: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "ヒラギノ丸ゴ ProN W4",
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", "Hiragino Sans",
    "Yu Gothic UI", Meiryo, sans-serif;
  --font-hand: "Caveat", "Segoe Script", cursive;
}

[data-theme="island"]    { --theme: #4bbfa4; --theme-deep: #1c8a72; --theme-soft: #e6f7f2; --theme-line: #bfe8dc; }
[data-theme="zombie"]    { --theme: #9483e6; --theme-deep: #6350c2; --theme-soft: #efecfd; --theme-line: #d6cff7; }
[data-theme="money"]     { --theme: #e0ab24; --theme-deep: #a97a00; --theme-soft: #fdf5db; --theme-line: #f0e0ab; }
[data-theme="travel"]    { --theme: #4fadea; --theme-deep: #1a79b6; --theme-soft: #e7f3fd; --theme-line: #c3e2f7; }
[data-theme="roomshare"] { --theme: #f0975f; --theme-deep: #c56125; --theme-soft: #fdf0e6; --theme-line: #f6d9c1; }
[data-theme="crush"]     { --theme: #f375a7; --theme-deep: #ca3874; --theme-soft: #fdeaf2; --theme-line: #f8ccdf; }
[data-theme="fight"]     { --theme: #f2776a; --theme-deep: #c73d2e; --theme-soft: #fdecea; --theme-line: #f8cec8; }
[data-theme="swap"]       { --theme: #3fbfc6; --theme-deep: #14868d; --theme-soft: #e4f7f8; --theme-line: #bce7ea; }
[data-theme="graduation"] { --theme: #7183dd; --theme-deep: #4a5ab8; --theme-soft: #edeffd; --theme-line: #cfd6f8; }
[data-theme="buzz"]       { --theme: #93c33f; --theme-deep: #5f8a1c; --theme-soft: #f1f8e3; --theme-line: #d8e9b6; }

:root { --theme-line: #f8ccdf; }

/* Player B's welcome is lavender in the mock regardless of the IF. */
[data-side="b"] {
  --theme: #9b8ce6;
  --theme-deep: #6f5fcf;
  --theme-soft: #efecfd;
  --theme-line: #d9d1f6;
  background-color: #f6f3fe;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-jp);
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* iOS paints form-control text with the system button colour when the element
   sets none itself -- white, once the phone is in dark mode, on our light
   cards. color-scheme: light does not cover it, so every control says it. */
button, input, select, textarea { font-family: inherit; color: var(--ink); }

/* ---------- layout ---------- */

.shell {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 0 18px calc(40px + env(safe-area-inset-bottom));
}

.site-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 2px 6px;
}
.head-slot { flex: none; width: 38px; }
.head-center { flex: 1; min-width: 0; display: flex; justify-content: center; }

.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  text-decoration: none;
  line-height: 1;
}
.logo-hand {
  font-family: var(--font-hand);
  font-size: 32px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.logo-if {
  font-size: 24px;
  font-weight: 800;
  font-style: italic;
  letter-spacing: 0.02em;
}

.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  text-decoration: none;
  font-size: 22px;
  color: var(--ink-soft);
}

.menu { position: relative; }
.menu > summary {
  list-style: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  font-size: 19px;
  color: var(--ink);
  cursor: pointer;
}
.menu > summary::-webkit-details-marker { display: none; }
.menu-sheet {
  position: absolute;
  top: 44px;
  right: 0;
  z-index: 5;
  /* Sized to the longest IF name so no title breaks onto a stray second line. */
  width: max-content;
  max-width: calc(100vw - 36px);
  padding: 12px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-pop);
}
.menu-title {
  margin: 0 0 8px;
  font-family: var(--font-hand);
  font-size: 20px;
  color: var(--ink-soft);
}
.menu-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.menu-list a {
  display: block;
  padding: 7px 9px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.menu-list a { display: flex; align-items: center; gap: 8px; }
.menu-art { flex: none; width: 24px; height: 24px; object-fit: contain; }
.art-fallback.menu-art { display: grid; place-items: center; font-size: 15px; }
.menu-list a:hover { background: var(--paper); }

.head-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}
.head-art { flex: none; width: 24px; height: 24px; object-fit: contain; }
.art-fallback.head-art { display: grid; place-items: center; font-size: 17px; }

/* ---------- top ---------- */

.hero { text-align: center; padding: 46px 0 14px; position: relative; }
/* The hero is a centred column and both text rows run nearly its full width,
   so there is no corner to tuck the mascot into: it gets its own row, kept
   small enough that the first cards stay above the fold. */
.hero-mascot { margin: 6px auto 0; width: 84px; }
.hero-mascot img { display: block; width: 100%; height: auto; }

.hero h1 {
  margin: 0 0 10px;
  font-size: 27px;
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: 0.01em;
}
.hero h1 .blank {
  display: inline-block;
  color: var(--brand);
  letter-spacing: -0.02em;
}
.hero p {
  margin: 0;
  font-size: 15.5px;
  font-weight: 800;
  color: var(--ink-soft);
}

.if-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}

.if-card {
  display: block;
  padding: 12px 12px 10px;
  background: var(--theme-soft);
  border: 1.5px solid var(--theme-line);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: transform 0.12s ease;
}
.if-card:active { transform: scale(0.985); }
.if-card:last-child:nth-child(odd) { grid-column: 1 / -1; }

.if-head { display: flex; align-items: center; gap: 8px; }
.if-art {
  flex: none;
  display: block;
  width: 44px;
  height: 44px;
  object-fit: contain;
}
.art-fallback.if-art { display: grid; place-items: center; font-size: 26px; }
.if-title {
  flex: 1;
  font-size: 14.5px;
  font-weight: 800;
  line-height: 1.35;
  word-break: auto-phrase;
}
.if-sub {
  display: block;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--ink-soft);
  line-height: 1.55;
  word-break: auto-phrase;
  text-wrap: balance;
}
/* Social proof. Quieter than the catchcopy, but the number itself is bold so
   it reads at a glance: the point is that it is big. */
.hero p.hero-proof {
  margin-top: 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-soft);
}
.hero p.hero-proof b { color: var(--brand-deep); font-weight: 800; }
.if-hero-proof {
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
}
.if-hero-proof b { color: var(--theme-deep); font-weight: 800; }

.hero p.hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  margin-top: 22px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-faint);
}

/* An odd-numbered final card spans the row, so it puts the copy beside the
   title like the mock. With an even count it stays a normal card. */
.if-card:last-child:nth-child(odd) { display: flex; align-items: center; gap: 14px; }
.if-card:last-child:nth-child(odd) .if-head { flex: none; }
.if-card:last-child:nth-child(odd) .if-body { flex: 1; }
.if-card:last-child:nth-child(odd) .if-sub { margin-top: 0; }
.if-card:last-child:nth-child(odd) .if-body { display: flex; align-items: center; }

.howto {
  margin-top: 26px;
  padding: 16px 16px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
}
.howto-title {
  margin: 0 0 10px;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-soft);
}
.howto-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.howto-steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.55;
}
.howto-steps b { font-weight: 800; }
.howto-num {
  flex: none;
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.top-note.is-quiet { margin-top: 8px; color: var(--ink-faint); }
.top-note.is-quiet a { color: inherit; }
.notice .btn-row { margin-top: 10px; }
.notice .waiting-note a { color: inherit; }
.top-note {
  margin: 20px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--ink-faint);
}

/* ---------- generic card / panel ---------- */

.panel {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 18px;
}

.stage { animation: stage-in 0.3s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes stage-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .stage, .pop-in, .spinner-dot { animation: none !important; }
}

/* ---------- nickname ---------- */

.avatar-pair {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  margin: 4px 0 16px;
}
.avatar {
  display: grid;
  justify-items: center;
  gap: 6px;
}
.avatar-face {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid var(--theme-line);
  overflow: hidden;
}
.avatar-face svg { display: block; width: 100%; height: 100%; }
.avatar-name { font-size: 11px; font-weight: 800; color: var(--ink-soft); }
.avatar.is-unknown .avatar-face { background: #f0ecfa; border-color: #ddd0f5; }

.intro-emoji {
  font-size: 46px;
  text-align: center;
  line-height: 1;
  margin-bottom: 10px;
}
.intro-title {
  margin: 0 0 8px;
  text-align: center;
  font-size: 25px;
  font-weight: 800;
  line-height: 1.45;
  white-space: pre-line;
}
/* Art beside the text rather than stacked: a centred column leaves the panel
   empty at both sides, and the extra height pushes the start button down. */
.if-hero {
  margin: 4px 0 18px;
  padding: 20px 18px 16px;
  border-radius: var(--radius-lg);
  background: var(--theme-soft);
  border: 1.5px solid var(--theme-line);
}
.if-hero-main { display: flex; align-items: center; gap: 14px; }
.if-hero-art { flex: none; width: 80px; height: 80px; object-fit: contain; }
.art-fallback.if-hero-art { display: grid; place-items: center; font-size: 48px; }
.if-hero-text { flex: 1; min-width: 0; }
.if-hero-title {
  margin: 0 0 5px;
  font-size: 23px;
  font-weight: 800;
  line-height: 1.35;
  word-break: auto-phrase;
}
.if-hero-sub {
  margin: 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-soft);
  line-height: 1.65;
  word-break: auto-phrase;
  text-wrap: balance;
}

.if-hero-pair {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 16px 0 0;
  padding-top: 15px;
  border-top: 1.5px solid var(--theme-line);
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink-soft);
}
.pair-person { display: inline-flex; align-items: center; gap: 6px; }
.pair-face {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid var(--theme-line);
  overflow: hidden;
}
.pair-face svg { display: block; width: 100%; height: 100%; }
.pair-face.is-unknown { background: #f0ecfa; border-color: #ddd0f5; }
.pair-plus { color: var(--ink-faint); }

.intro-title .hl { color: var(--theme-deep); }
.intro-sub b { color: var(--theme-deep); }

.intro-sub {
  margin: 0 0 20px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
  white-space: pre-line;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-soft);
}
.text-field {
  width: 100%;
  padding: 13px 14px;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
}
.text-field:focus { border-color: var(--theme); background: #fff; }
.field-hint { margin: 6px 2px 0; font-size: 11px; color: var(--ink-faint); }

.form-error {
  margin: 0 0 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: #fdeae7;
  color: #c04030;
  font-size: 13px;
  font-weight: 800;
}

/* ---------- buttons ---------- */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 15px 18px;
  border: none;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:active { transform: scale(0.98); opacity: 0.9; }
.btn svg { flex: none; width: 18px; height: 18px; }

.btn-primary { color: #fff; background: var(--theme); }
.btn-brand { color: #fff; background: var(--brand); }
.btn-line { color: #fff; background: #06c755; }
.btn-ghost {
  color: var(--ink-soft);
  background: var(--card);
  border: 1.5px solid var(--line);
}
.btn-row { display: grid; gap: 10px; margin-top: 14px; }
form > .btn, form > input.btn { margin-top: 4px; }
.btn-dark { color: #fff; background: #221d20; }
.cta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}
.cta-row .btn {
  padding: 15px 8px;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
}

/* ---------- question ---------- */

.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 0 16px;
}
.step-dot {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--paper-deep);
  color: var(--ink-faint);
  font-size: 13px;
  font-weight: 800;
}
.step-dot.is-current { background: var(--brand); color: #fff; }
.step-dot.is-done { background: var(--brand); color: #fff; }
.step-line {
  width: 26px;
  height: 2px;
  border-radius: 2px;
  background: var(--paper-deep);
}
.step-line.is-done { background: var(--brand); }

.turn-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 14px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #fbeef2;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
}

.day-badge {
  display: block;
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
}

.question-text {
  margin: 0 0 22px;
  font-size: 25px;
  font-weight: 800;
  line-height: 1.5;
  white-space: pre-line;
  word-break: auto-phrase;
}

.choice-list { display: grid; gap: 11px; }

.choice-form { margin: 0; }
.choice {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 20px 18px;
  text-align: left;
  background: #fdeef3;
  border: 1.5px solid #f7d5e0;
  border-radius: var(--radius-md);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.choice:active { transform: scale(0.985); }
/* Both mocks give each of the three choices its own pastel, independent of the
   scenario theme, so the row reads as a set rather than a block of one colour. */
.choice-form:nth-child(1) .choice { background: #fdeef3; border-color: #f7d5e0; }
.choice-form:nth-child(2) .choice { background: #fdf6e3; border-color: #f2e3b8; }
.choice-form:nth-child(3) .choice { background: #eaf6ee; border-color: #cbe8d5; }

.choice[aria-pressed="true"],
.choice.is-picked,
.choice-form:nth-child(n) .choice.is-picked {
  border-color: var(--theme);
  background: var(--theme-soft);
}
.choice-emoji { flex: none; width: 38px; height: 38px; display: grid; place-items: center; font-size: 26px; line-height: 1; }
.choice-text { flex: 1; font-size: 16px; font-weight: 800; line-height: 1.45; white-space: pre-line; }

.mascot { margin-top: 22px; text-align: center; }
.mascot img {
  display: inline-block;
  width: 100%;
  max-width: 216px;
  height: auto;
}
.notice-mascot { margin: 0 0 6px; }
.notice-mascot img { max-width: 176px; }

/* ---------- invite / nickname notes ---------- */

.note-box {
  margin-bottom: 18px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--theme-soft);
}
.note-box-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 800;
  color: var(--theme-deep);
}
.note-box .note-item { background: var(--card); }
.note-box.is-plain { background: var(--card); border: 1.5px solid var(--line); }

.note-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.note-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 13px;
  background: var(--theme-soft);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.55;
}
.note-dot {
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--theme);
}

/* ---------- share ---------- */

.share-title {
  margin: 28px 0 8px;
  text-align: center;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.45;
}
.share-lead {
  margin: 0 0 20px;
  text-align: center;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.7;
}
.share-lead b { color: var(--brand-deep); }

.share-sub {
  margin: 0 0 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-soft);
  line-height: 1.6;
}

.link-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: #f4effd;
  border: 1.5px solid #ddd0f5;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  word-break: break-all;
}

.share-icons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}
.share-icon {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 0;
  background: none;
  border: none;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}
.share-icon-glyph {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f1eeeb;
  color: var(--ink-soft);
  transition: transform 0.12s ease;
}
.share-icon-glyph svg { display: block; width: 26px; height: 26px; }
.share-icon:active .share-icon-glyph { transform: scale(0.94); }
.share-icon-label { font-size: 11px; font-weight: 800; color: var(--ink-soft); }
.share-icon.is-line .share-icon-glyph { background: #06c755; color: #fff; }
.share-icon.is-x .share-icon-glyph { background: #16141a; color: #fff; }

.share-note {
  display: flex;
  align-items: center;
  gap: 10px;
  word-break: auto-phrase;
  margin: 16px 0 0;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  background: #fdeef3;
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.6;
}
.lock-tile {
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
}
.lock-tile svg { width: 15px; height: 15px; }

.copy-flash {
  margin: 10px 0 0;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--theme-deep);
}

.waiting-note {
  margin: 18px 0 0;
  word-break: auto-phrase;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.8;
}
.waiting-note b { color: var(--brand-deep); }
.waiting-note.is-quiet { color: var(--ink-faint); }
.waiting-note.is-quiet b { color: inherit; }

.share-back { margin-top: 22px; text-align: center; }
.share-back-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.5;
  word-break: auto-phrase;
}
.share-back-lead { margin: 0 0 16px; font-size: 13px; color: var(--ink-soft); }
.share-back .btn-line { justify-content: center; }

/* ---------- computing ---------- */

.computing {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 16px;
  min-height: 70svh;
  text-align: center;
}
.computing-art { width: 76px; height: 76px; object-fit: contain; }
.art-fallback.computing-art { display: grid; place-items: center; font-size: 46px; }
.computing p { margin: 0; font-size: 18px; font-weight: 800; }
.computing small { color: var(--ink-faint); font-size: 12px; }

.spinner { display: flex; gap: 8px; }
.spinner-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--theme);
  animation: bounce 0.9s infinite ease-in-out;
}
.spinner-dot:nth-child(2) { animation-delay: 0.15s; }
.spinner-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30%           { transform: translateY(-9px); opacity: 1; }
}

/* ---------- result ---------- */

.result-heading {
  display: block;
  width: fit-content;
  margin: 30px auto 16px;
  padding: 8px 26px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  text-align: center;
  font-size: 22px;
  font-weight: 800;
}

/* Sparkles scattered around a heading: four-point stars, thin glints and dots
   in two different clusters, tall enough to wrap two lines of text. */
.doodle { position: relative; }
.doodle::before,
.doodle::after {
  content: "";
  position: absolute;
  top: -8px;
  width: 88px;
  height: 96px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  pointer-events: none;
}
.doodle::before { left: -10px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='96' viewBox='0 0 88 96'%3E%3Cpath transform='translate(18 20)' d='M0-8C0-2.4 2.4 0 8 0C2.4 0 0 2.4 0 8C0 2.4-2.4 0-8 0C-2.4 0 0-2.4 0-8Z' fill='%23f5a3c0'/%3E%3Cpath d='M44 2V14M38 8H50' stroke='%23f2c24a' stroke-width='1.6' stroke-linecap='round'/%3E%3Ccircle cx='44' cy='8' r='1.4' fill='%23f2c24a'/%3E%3Cpath transform='translate(9 50)' d='M0-4C0-1.2 1.2 0 4 0C1.2 0 0 1.2 0 4C0 1.2-1.2 0-4 0C-1.2 0 0-1.2 0-4Z' fill='%23a9d8f0'/%3E%3Cpath transform='translate(40 40)' d='M0-5.5C0-1.65 1.65 0 5.5 0C1.65 0 0 1.65 0 5.5C0 1.65-1.65 0-5.5 0C-1.65 0 0-1.65 0-5.5Z' fill='%23c8b9f0'/%3E%3Ccircle cx='56' cy='60' r='2' fill='%23f2c24a'/%3E%3Cpath transform='translate(24 76)' d='M0-6.5C0-1.95 1.95 0 6.5 0C1.95 0 0 1.95 0 6.5C0 1.95-1.95 0-6.5 0C-1.95 0 0-1.95 0-6.5Z' fill='%23f2c24a'/%3E%3Ccircle cx='50' cy='86' r='1.8' fill='%23f5a3c0'/%3E%3Cpath d='M58 24V32M54 28H62' stroke='%23f5a3c0' stroke-width='1.6' stroke-linecap='round'/%3E%3Ccircle cx='58' cy='28' r='1.4' fill='%23f5a3c0'/%3E%3C/svg%3E"); }
.doodle::after { right: -10px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='96' viewBox='0 0 88 96'%3E%3Cpath d='M44 4V16M38 10H50' stroke='%23f2c24a' stroke-width='1.6' stroke-linecap='round'/%3E%3Ccircle cx='44' cy='10' r='1.4' fill='%23f2c24a'/%3E%3Cpath transform='translate(70 22)' d='M0-8C0-2.4 2.4 0 8 0C2.4 0 0 2.4 0 8C0 2.4-2.4 0-8 0C-2.4 0 0-2.4 0-8Z' fill='%23c8b9f0'/%3E%3Cpath transform='translate(79 48)' d='M0-4C0-1.2 1.2 0 4 0C1.2 0 0 1.2 0 4C0 1.2-1.2 0-4 0C-1.2 0 0-1.2 0-4Z' fill='%23f5a3c0'/%3E%3Cpath transform='translate(46 40)' d='M0-5.5C0-1.65 1.65 0 5.5 0C1.65 0 0 1.65 0 5.5C0 1.65-1.65 0-5.5 0C-1.65 0 0-1.65 0-5.5Z' fill='%23a9d8f0'/%3E%3Ccircle cx='30' cy='60' r='2' fill='%23f5a3c0'/%3E%3Cpath transform='translate(64 74)' d='M0-6.5C0-1.95 1.95 0 6.5 0C1.95 0 0 1.95 0 6.5C0 1.95-1.95 0-6.5 0C-1.95 0 0-1.95 0-6.5Z' fill='%23f2c24a'/%3E%3Ccircle cx='38' cy='88' r='1.8' fill='%23a9d8f0'/%3E%3Cpath d='M28 22V30M24 26H32' stroke='%23a9d8f0' stroke-width='1.6' stroke-linecap='round'/%3E%3Ccircle cx='28' cy='26' r='1.4' fill='%23a9d8f0'/%3E%3C/svg%3E"); }

/* The result badge is narrow, so its confetti sits out beside the pill. */
.result-heading.doodle::before,
.result-heading.doodle::after { top: -26px; transform: scale(0.82); }
.result-heading.doodle::before { left: -72px; }
.result-heading.doodle::after { right: -72px; }

.result-hero {
  position: relative;
  margin-bottom: 14px;
  padding: 34px 20px 26px;
  border-radius: var(--radius-lg);
  background: linear-gradient(158deg, var(--theme) 0%, var(--theme-deep) 100%);
  box-shadow: var(--shadow-pop);
  text-align: center;
  overflow: hidden;
}
.result-scene {
  position: absolute;
  right: -14px;
  bottom: -18px;
  width: 148px;
  height: 148px;
  object-fit: contain;
  opacity: 0.34;
  pointer-events: none;
}
.result-figure {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin: 0;
  line-height: 1;
  color: #fff;
}
.result-number {
  font-size: 82px;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}
.result-number.is-word { font-size: 46px; letter-spacing: 0; }
.result-unit { font-size: 28px; font-weight: 800; }
.result-caption {
  position: relative;
  margin: 12px 0 0;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
.result-badge {
  position: relative;
  display: inline-block;
  margin-top: 16px;
  padding: 10px 20px;
  border-radius: 999px;
  background: #33485a;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.4;
}
.confetti {
  position: absolute;
  font-size: 14px;
  color: #fff;
  opacity: 0.8;
  pointer-events: none;
}
.confetti.c1 { top: 14px; left: 16px;  transform: rotate(-18deg); }
.confetti.c2 { top: 40px; right: 18px; transform: rotate(16deg); }
.confetti.c3 { bottom: 16px; left: 26px; transform: rotate(9deg); }

.punchline { margin: 0; font-size: 14px; line-height: 1.85; white-space: pre-line; }

.block-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 24px 0 11px;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink-soft);
}
/* The mock frames its section titles with hand-drawn slashes. */
.block-title::before,
.block-title::after {
  content: "";
  width: 20px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='18' viewBox='0 0 20 18'%3E%3Cpath d='M4 2 L10 16M11 2 L17 16' stroke='%23f087ad' stroke-width='2.2' stroke-linecap='round' fill='none'/%3E%3C/svg%3E") no-repeat center;
}
.block-title::after { transform: scaleX(-1); }

.block-title.is-wave::before,
.block-title.is-wave::after {
  width: 26px;
  height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='12' viewBox='0 0 26 12'%3E%3Cpath d='M2 8q4-6 8 0t8 0 6-2' fill='none' stroke='%23c8bcae' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center;
}

.keypoint {
  border-radius: var(--radius-lg);
  background: #fff;
  border: 1.5px solid #f8d3e0;
  overflow: hidden;
}
.keypoint-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #fbdfe8;
}
.keypoint-emoji { font-size: 22px; }
.keypoint-label { flex: 1; font-size: 16px; font-weight: 800; line-height: 1.4; color: var(--ink); }
.keypoint-body { padding: 18px 16px 16px; }
.keypoint-delta {
  margin: 0;
  text-align: center;
  line-height: 1;
  color: var(--brand-deep);
}
.keypoint-delta .value { font-size: 44px; font-weight: 800; letter-spacing: -0.02em; }
.keypoint-delta .unit { font-size: 24px; font-weight: 800; margin-left: 2px; }
.keypoint-note {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.75;
}

.who-label {
  margin: 18px 0 8px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-faint);
}
.who-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--brand-soft);
  border: 1.5px solid var(--card);
}
.who-face {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #fff;
  overflow: hidden;
}
.who-face svg { display: block; width: 100%; height: 100%; }
.who-name { flex: 1; font-size: 16px; font-weight: 800; }
.who-name b { color: var(--brand-deep); }
.who-quote {
  flex: none;
  padding: 5px 11px;
  border-radius: 14px;
  background: #fff;
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-soft);
}

.reasons {
  margin: 0;
  padding: 4px 14px;
  list-style: none;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
}
.reason {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
}
.reason + .reason { border-top: 1px solid var(--line); }
.reason-emoji { flex: none; font-size: 20px; line-height: 1; }
.reason-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.reason-label { font-weight: 800; }
.reason-who { font-size: 11px; color: var(--ink-faint); }
.reason-delta { flex: none; font-size: 14px; font-weight: 800; color: var(--brand-deep); }
.reason-rank {
  flex: none;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(150deg, #f7c14b, #ef9a3c);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.review { margin-top: 14px; }
.review summary {
  list-style: none;
  padding: 12px 15px;
  border-radius: 999px;
  background: var(--card);
  border: 1.5px solid var(--line);
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-soft);
  text-align: center;
  cursor: pointer;
}
.review summary::-webkit-details-marker { display: none; }
.review[open] summary { margin-bottom: 10px; }

.review-item {
  padding: 11px 14px;
  margin-bottom: 8px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
}
.review-q { font-size: 12px; color: var(--ink-soft); white-space: pre-line; }
.review-a { font-size: 14px; font-weight: 800; margin-top: 2px; }
.review-who {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--theme-soft);
  color: var(--theme-deep);
  font-size: 11px;
  font-weight: 800;
}

.text-link {
  display: block;
  margin: 18px 0 0;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-faint);
}

.pop-in { animation: pop-in 0.4s cubic-bezier(0.22, 1.4, 0.4, 1) both; }
@keyframes pop-in {
  from { opacity: 0; transform: scale(0.9) translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* Long-form copy: the landing sections and the static pages. */
.prose {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1.5px solid var(--line);
  font-size: 13.5px;
  line-height: 1.95;
  color: var(--ink);
}
.prose h1 { margin: 0 0 14px; font-size: 21px; font-weight: 800; line-height: 1.5; }
.prose h2 {
  margin: 26px 0 8px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.5;
}
.prose h2:first-child { margin-top: 0; }
.prose.is-page { margin-top: 6px; padding-top: 0; border-top: none; }
.prose p { margin: 0 0 12px; }
.prose a { color: var(--brand-deep); font-weight: 800; }
.prose ul, .prose ol { margin: 0 0 12px; padding-left: 1.3em; }
.prose li { margin-bottom: 5px; }
.prose-lead { color: var(--ink-soft); }
.prose-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}
.prose-tags li {
  margin: 0;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--theme-soft);
  color: var(--theme-deep);
  font-size: 12px;
  font-weight: 800;
}
.prose-steps { counter-reset: step; list-style: none; padding-left: 0; }
.prose-steps li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 7px;
}
.prose-steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 4px;
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

/* Aggregate bars on the IF landing page. */
.bars { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.bar { margin: 0; }
.bar-head { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; }
.bar-name { flex: 1; min-width: 0; font-weight: 800; }
.bar-rate { flex: none; font-weight: 800; color: var(--theme-deep); }
.bar-track {
  display: block;
  height: 7px;
  margin-top: 4px;
  border-radius: 999px;
  background: var(--paper-deep);
  overflow: hidden;
}
.bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--theme); }
.bar-note { display: block; margin-top: 3px; font-size: 11px; color: var(--ink-faint); }

.stat-q { margin-bottom: 18px; }
.stat-q-text { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-weight: 800; }
.stat-q-side {
  flex: none;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 10px;
}

.rarity {
  margin: -6px 0 14px;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.rarity b { color: var(--brand-deep); font-size: 15px; }

.ad-slot { margin: 26px 0 0; }
.ad-label {
  margin: 0 0 6px;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}
.ad-slot ins { display: block; }

.site-foot {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1.5px solid var(--line);
  text-align: center;
  font-size: 11px;
  color: var(--ink-faint);
}
.site-foot a { color: var(--ink-soft); text-decoration: none; }
.foot-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 800;
}

.notice {
  text-align: center;
  padding: 40px 0;
}
.notice h1 { font-size: 22px; font-weight: 800; margin: 0 0 8px; }
.notice p { color: var(--ink-soft); font-size: 14px; margin: 0 0 20px; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
