:root {
  --bg: #FBF5EC; --surface: #FFFDF9; --sunk: #F1E7D8; --ink: #1E2A33; --muted: #5A6670; --line: #E4D7C5;
  --coral: #E3624A; --amber: #EDA93A; --coralSoft: #F9DDD3; --amberSoft: #F8E6C2; --onCoral: #1E140F;
  --stripe: rgba(30,42,51,0.07); --ridge1: #F4DCC8; --ridge2: #ECC6AC; --canvas: #F5EEE3; --sage: #4F9466;
  --display: Fredoka, ui-rounded, system-ui, sans-serif;
  --body: Figtree, system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141B21; --surface: #1C252D; --sunk: #26313A; --ink: #F5EDE1; --muted: #A3ADB6; --line: #313D47;
    --coral: #F07A61; --amber: #F2B54A; --coralSoft: #3B2621; --amberSoft: #3A2F1C; --onCoral: #1E140F;
    --stripe: rgba(245,237,225,0.07); --ridge1: #1F2B34; --ridge2: #283741; --canvas: #0C1115; --sage: #79BE8D;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; }
a { color: var(--ink); }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* App frame: a phone-width column, centered on bigger screens. */
#app { max-width: 430px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; background: var(--bg); }
@media (min-width: 600px) {
  body { padding: 32px 0; }
  #app { min-height: min(844px, calc(100dvh - 64px)); border-radius: 44px; border: 1px solid var(--line);
    box-shadow: 0 30px 60px -30px rgba(20,27,33,.35); overflow: hidden; }
}

.screen {
  position: relative; display: flex; flex-direction: column;
  min-height: 100vh; min-height: 100dvh;
  padding: 64px 24px 32px; overflow: hidden;
}
@media (min-width: 600px) { .screen { min-height: min(844px, calc(100dvh - 64px)); } }
.screen.tight { padding-top: 56px; }
.screen.results { padding: 56px 20px 40px; gap: 28px; overflow: visible; }
.screen:focus { outline: none; }
.gap-28 { gap: 28px; } .gap-24 { gap: 24px; } .gap-22 { gap: 22px; } .gap-18 { gap: 18px; } .gap-16 { gap: 16px; }
.layer { position: relative; }
.spacer { flex: 1; }

.ridge { position: absolute; left: 0; right: 0; bottom: 0; pointer-events: none; }

.wordmark { font-family: var(--display); font-weight: 600; }
.wordmark .hope { color: var(--coral); }
.eyebrow { font-family: var(--mono); font-size: 13px; color: var(--muted); letter-spacing: .06em; }
.eyebrow.sm { font-size: 12px; }
.muted { color: var(--muted); }
.h-display { font-family: var(--display); font-weight: 600; line-height: 1.1; }
.lede { font-size: 16px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }

/* Goat placeholder (swap for illustrations via GOAT_IMAGES in app.js) */
.goat {
  flex: none; display: flex; align-items: flex-end; justify-content: center; padding: 12px;
  background: repeating-linear-gradient(135deg, var(--stripe) 0 8px, transparent 8px 16px);
  border: 1.5px dashed var(--line);
}
.goat span { font-family: var(--mono); font-size: 11px; color: var(--muted); text-align: center; }
.goat-wrap { position: relative; flex: none; display: flex; align-items: flex-end; justify-content: center; cursor: pointer; -webkit-user-select: none; user-select: none; }
.goat-img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; transform-origin: 50% 100%; }

/* Buttons */
.btn {
  display: flex; align-items: center; justify-content: center; width: 100%;
  height: 56px; border-radius: 28px; border: none; cursor: pointer;
  font-family: var(--display); font-weight: 600; font-size: 19px;
  text-decoration: none;
}
.btn-primary { background: var(--coral); color: var(--onCoral); box-shadow: 0 3px 0 rgba(0,0,0,.18); }
.btn-primary:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.18); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-ink { background: var(--ink); color: var(--bg); }
.btn-ghost { height: 52px; border-radius: 26px; background: var(--surface); border: 1.5px solid var(--line); color: var(--ink); font-size: 17px; }
.link { color: var(--ink); font-weight: 600; font-size: 15px; padding: 12px; background: none; border: none; cursor: pointer; text-decoration: underline; min-height: 44px; }
.back {
  width: 44px; height: 44px; flex: none; border-radius: 22px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0 0 3px;
}

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 16px; }
.pill { padding: 8px 14px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 600; }

/* 01 Landing */
.landing-hero { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 28px; }
.landing-hero h1 { font-family: var(--display); font-weight: 600; font-size: 46px; line-height: 1; }
.landing-hero .tagline { font-family: var(--display); font-weight: 500; font-size: 22px; }
.landing-hero .lede { max-width: 290px; }
.landing-actions { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.resume-note { font-size: 14px; color: var(--muted); text-align: center; }

/* The peek: a card showing at the bottom edge that opens the sheet */
.screen.has-peek { padding-bottom: 100px; }
.peek {
  position: absolute; left: 14px; right: 14px; bottom: 0; z-index: 4;
  display: flex; flex-direction: column; gap: 4px; padding: 8px 16px 18px;
  background: var(--surface); color: var(--ink); text-align: left; font: inherit; cursor: pointer;
  border: 1px solid var(--line); border-bottom: none; border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 28px rgba(20,27,33,.14); transform-origin: 50% 100%;
}
.peek .sheet-handle { margin-bottom: 4px; }
.peek-row { display: flex; align-items: center; gap: 12px; }
.peek-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.peek-text b { font-family: var(--display); font-weight: 600; font-size: 16px; line-height: 1.2; }
.peek-text span { font-size: 13px; color: var(--muted); }
.peek-open { flex: none; color: var(--coral); font-size: 24px; font-weight: 700; line-height: 1; }
@media (hover: hover) { .peek:hover { border-color: var(--coral); } }
@media (prefers-reduced-motion: no-preference) {
  .peek { animation: peek-up .5s cubic-bezier(.2,.85,.3,1) .4s both; }
  .peek.nudge { animation: peek-up .5s cubic-bezier(.2,.85,.3,1) .4s both, peek-jiggle .9s ease-in-out 1.5s, peek-jiggle .9s ease-in-out 6s; }
}
@keyframes peek-up { from { transform: translateY(100%); } }
@keyframes peek-jiggle {
  0%, 100% { transform: translateY(0) rotate(0); }
  14% { transform: translateY(-12px) rotate(-1.4deg); }
  28% { transform: translateY(0) rotate(1deg); }
  42% { transform: translateY(-6px) rotate(-.7deg); }
  56% { transform: translateY(0) rotate(.3deg); }
  70% { transform: translateY(-2px) rotate(0); }
}

/* Where this comes from: a bottom sheet over the landing or invite screen */
.sheet-backdrop { position: absolute; inset: 0; z-index: 5; background: rgba(20,27,33,.42); }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; max-height: 90%; overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px; padding: 10px 24px 28px;
  background: var(--surface); border-radius: 28px 28px 0 0; box-shadow: 0 -12px 40px rgba(20,27,33,.18);
}
.sheet-handle { width: 40px; height: 5px; border-radius: 3px; background: var(--line); align-self: center; margin-bottom: 6px; }
.sheet-title { font-family: var(--display); font-weight: 600; font-size: 27px; line-height: 1.12; text-wrap: balance; }
.sheet-intro { font-size: 16px; line-height: 1.5; }
.sheet-sources { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sheet-sources li { display: flex; gap: 10px; font-size: 15px; line-height: 1.45; }
.sheet-sources li::before { content: ''; width: 8px; height: 8px; margin-top: 7px; flex: none; border-radius: 2px; transform: rotate(45deg); background: var(--coral); }
.sheet-sources b { font-weight: 700; }
.sheet-credit { font-family: var(--display); font-weight: 500; font-size: 15px; padding-top: 12px; border-top: 1px solid var(--line); }
.sheet-actions { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 4px; }
@media (prefers-reduced-motion: no-preference) {
  .sheet { animation: sheet-up .5s cubic-bezier(.2,.85,.3,1) both; }
  .sheet-backdrop { animation: fade-in .3s ease-out both; }
}
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes fade-in { from { opacity: 0; } }

/* 02 Invited */
.invited-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 24px; }
.invited-body h1 { font-family: var(--display); font-weight: 600; font-size: 40px; line-height: 1.08; overflow-wrap: anywhere; }
.invited-body p { font-size: 17px; line-height: 1.55; color: var(--muted); text-wrap: pretty; }
.meta-dot { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--muted); }
.meta-dot::before { content: ''; width: 8px; height: 8px; border-radius: 4px; background: var(--amber); }

/* 03 How it works */
.steps { display: flex; flex-direction: column; gap: 12px; list-style: none; margin: 0; padding: 0; }
.step { display: flex; gap: 16px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 18px; }
.step-n { width: 44px; height: 44px; flex: none; border-radius: 14px; background: var(--amberSoft); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 600; font-size: 20px; }
.step-title { font-family: var(--display); font-weight: 600; font-size: 19px; }
.step-body { font-size: 15px; line-height: 1.45; color: var(--muted); margin-top: 4px; }
.callout { background: var(--coralSoft); border-radius: 24px; padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.callout-title { font-family: var(--display); font-weight: 600; font-size: 19px; }
.callout-body { font-size: 15px; line-height: 1.45; }

/* 04 Name */
.speech { display: flex; gap: 14px; align-items: flex-end; }
.bubble { background: var(--surface); border: 1px solid var(--line); border-radius: 20px 20px 20px 6px; padding: 12px 14px; font-size: 15px; line-height: 1.4; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 14px; font-weight: 600; }
.field .hint { font-size: 14px; color: var(--muted); }
.input {
  height: 60px; border-radius: 18px; border: 2px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 0 18px; font-family: var(--body); font-size: 20px; font-weight: 500; width: 100%;
}
.input:focus { outline: none; border-color: var(--coral); box-shadow: 0 0 0 4px var(--coralSoft); }
textarea.input { height: 120px; padding: 14px 18px; font-family: var(--mono); font-size: 14px; line-height: 1.5; resize: vertical; }
.error-text { font-size: 14px; color: var(--coral); font-weight: 600; }

/* 05 Category intro */
.camp-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 20px; }
.camp-badge { width: 96px; height: 96px; border-radius: 30px; background: var(--coral); color: var(--onCoral); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 600; font-size: 44px; }
.camp-body h2 { font-family: var(--display); font-weight: 600; font-size: 44px; line-height: 1.05; }
.camp-body p { font-size: 18px; line-height: 1.5; color: var(--muted); max-width: 300px; text-wrap: pretty; }
.seen-note { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px 16px; font-size: 15px; line-height: 1.45; max-width: 320px; }

/* 06 Question card */
.q-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.q-cat { font-size: 14px; font-weight: 600; color: var(--muted); text-align: center; }
.q-count { font-family: var(--display); font-weight: 600; font-size: 16px; min-width: 44px; text-align: right; white-space: nowrap; }
.q-count span { color: var(--muted); font-weight: 500; }
.trail { position: relative; height: 70px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
.trail svg { display: block; width: 100%; height: 68px; clip-path: inset(0 round 19px); }
.trail-goat {
  position: absolute; width: 32px; height: 32px; margin: -16px 0 0 -16px; border-radius: 16px;
  background: var(--surface); border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 8px; color: var(--muted); transition: left .35s ease, top .35s ease;
}
.trail-goat.has-img {
  width: 40px; height: 40px; margin: -38px 0 0 -20px; border: none; border-radius: 0; background: none;
  transition: left .45s cubic-bezier(.3,.7,.4,1), top .45s cubic-bezier(.3,.7,.4,1);
}
.trail-goat img { width: 100%; height: 100%; object-fit: contain; transform-origin: 50% 100%; }
.trail-goat.has-img { cursor: pointer; }
.q-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 8px 2px; }
.q-text { font-size: 29px; font-weight: 600; line-height: 1.25; text-wrap: pretty; }
.q-text.sm { font-size: 24px; }
.scale { display: flex; flex-direction: column; gap: 8px; }
.opt {
  height: 56px; border-radius: 18px; border: 2px solid var(--line); background: var(--surface); color: var(--ink);
  display: flex; align-items: center; gap: 14px; padding: 0 18px; font-family: var(--body); font-size: 17px; font-weight: 600;
  cursor: pointer; text-align: left; width: 100%;
}
.opt .dot { width: 22px; height: 22px; border-radius: 11px; border: 2px solid var(--line); background: transparent; flex: none; }
.opt[aria-checked="true"] { border-color: var(--coral); background: var(--coralSoft); }
.opt[aria-checked="true"] .dot { border-color: var(--coral); background: var(--coral); }
@media (hover: hover) { .opt:hover { border-color: var(--coral); } }
.opt-na { height: 48px; border-style: dashed; color: var(--muted); font-size: 15px; justify-content: center; }
.opt-na[aria-checked="true"] { color: var(--ink); }
.q-foot { text-align: center; font-size: 13px; color: var(--muted); }

/* Rank: tap in order */
.rank { display: flex; flex-direction: column; gap: 8px; }
.rank-hint { text-align: left; padding: 0 2px; }
.rank-n { width: 28px; height: 28px; flex: none; border-radius: 14px; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-size: 15px; }
.rank-opt[aria-pressed="true"] { border-color: var(--coral); background: var(--coralSoft); }
.rank-opt[aria-pressed="true"] .rank-n { border-color: var(--coral); background: var(--coral); color: var(--onCoral); }
.rank-actions { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; margin-top: 4px; }
.rank-actions .link:disabled { opacity: .4; cursor: default; }

/* Guess card */
.guess-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; background: var(--amberSoft); border-radius: 24px; padding: 12px 18px 16px; }
.guess-card .goat-wrap, .guess-card .goat { flex: none; }
.guess-head { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.guess-ask { font-family: var(--display); font-weight: 600; font-size: 22px; line-height: 1.2; overflow-wrap: anywhere; }
.guess-quote { font-size: 19px; font-weight: 600; line-height: 1.35; color: var(--muted); padding: 0 4px; flex: 1; display: flex; align-items: center; text-wrap: pretty; }
.guess-screen .opt { height: 52px; }

/* 07 Importance */
.imp-legend { display: flex; justify-content: flex-end; font-size: 12px; color: var(--muted); font-weight: 600; padding-right: 2px; }
.imp-legend span { width: 196px; display: flex; justify-content: space-between; }
.imp-rows { display: flex; flex-direction: column; gap: 6px; }
.imp-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 6px 6px 6px 14px; margin: 0; }
.imp-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; padding-bottom: 10px; }
.imp-name { font-size: 15px; font-weight: 600; padding: 0; }
.imp-desc { grid-column: 1 / -1; font-size: 13px; line-height: 1.35; color: var(--muted); padding-right: 8px; text-wrap: pretty; }
.pips { display: flex; gap: 4px; flex: none; }
.pip { width: 36px; height: 44px; border-radius: 10px; border: none; background: var(--sunk); color: var(--muted); font-family: var(--display); font-weight: 600; font-size: 15px; cursor: pointer; }
.pip.on { background: var(--coral); color: var(--onCoral); }

/* 08 Share */
.share-head { display: flex; flex-direction: column; gap: 10px; text-align: center; }
.share-head h2 { font-family: var(--display); font-weight: 600; font-size: 32px; line-height: 1.1; }
.link-box { background: var(--surface); border: 1.5px dashed var(--line); border-radius: 18px; padding: 14px 16px; font-family: var(--mono); font-size: 13px; line-height: 1.5; word-break: break-all; user-select: all; }
.share-actions { display: flex; flex-direction: column; gap: 10px; }
.two-up { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fine { font-size: 13px; line-height: 1.5; color: var(--muted); text-align: center; text-wrap: pretty; }


/* 09 Results */
.res-top { display: flex; justify-content: space-between; align-items: center; padding: 0 4px; gap: 12px; }
.res-names { font-size: 14px; font-weight: 600; color: var(--muted); text-align: right; overflow-wrap: anywhere; }
.hero { position: relative; background: var(--amberSoft); border-radius: 32px; padding: 24px 20px 26px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; overflow: hidden; }
.hero h1 { margin-top: 6px; font-family: var(--display); font-weight: 600; font-size: 32px; line-height: 1.08; text-wrap: balance; }
.score { display: flex; align-items: baseline; gap: 4px; }
.score b { font-family: var(--display); font-weight: 700; font-size: 84px; line-height: 1; color: var(--coral); }
.score span { font-family: var(--display); font-weight: 500; font-size: 22px; color: var(--muted); }
.hero p { font-size: 16px; line-height: 1.5; max-width: 300px; text-wrap: pretty; }
.hero .cap-note { font-size: 14px; color: var(--muted); }

/* Three dials */
.dials { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dial { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 14px 8px 12px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.dial svg { width: 76px; height: 76px; transform: rotate(-90deg); }
.dial circle { fill: none; stroke-width: 7; }
.dial-track { stroke: var(--sunk); }
.dial-value { stroke: var(--coral); stroke-linecap: round; animation: dial 1s cubic-bezier(.2,.8,.3,1) .2s both; }
@keyframes dial { from { stroke-dashoffset: var(--c); } }
.dial-num { position: absolute; top: 14px; height: 76px; display: flex; align-items: center; font-family: var(--display); font-weight: 700; font-size: 24px; }
.dial-label { font-family: var(--display); font-weight: 600; font-size: 16px; margin-top: 4px; }
.dial-sub { font-size: 12px; line-height: 1.3; color: var(--muted); }
.lovemaps { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; font-size: 14px; line-height: 1.35; }
.lovemaps b { display: inline-block; min-width: 30px; font-family: var(--display); font-size: 17px; color: var(--coral); }

/* Four Horsemen */
.horsemen { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hm { display: flex; flex-direction: column; gap: 8px; padding: 14px; }
.hm-title { font-family: var(--display); font-weight: 600; font-size: 17px; }
.hm-who { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 6px; align-items: center; font-size: 13px; }
.hm-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-level { color: var(--muted); }
.lv { width: 12px; height: 12px; border-radius: 6px; background: var(--sunk); }
.lv-green { background: var(--sage); } .lv-amber { background: var(--amber); } .lv-red { background: var(--coral); }
.lv-na { background: transparent; border: 2px solid var(--line); }
.hm-what { font-size: 13px; line-height: 1.4; color: var(--muted); }
.hm-fix { font-size: 13px; line-height: 1.4; }
.section { display: flex; flex-direction: column; gap: 12px; }
.section-head { display: flex; justify-content: space-between; align-items: center; padding: 0 4px; gap: 8px; }
.h3 { font-family: var(--display); font-weight: 600; font-size: 22px; }
.section > .h3 { padding: 0 4px; }
.toggle { min-height: 36px; border-radius: 18px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 600; padding: 0 12px; cursor: pointer; position: relative; }
.toggle::after { content: ''; position: absolute; inset: -4px; } /* 44px tap target */
.toggle[aria-pressed="true"] { background: var(--amberSoft); }
.radar-card { background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: 8px; }
.radar-card svg { display: block; width: 100%; height: auto; }
.radar-shape { transform-origin: 160px 160px; animation: grow .9s cubic-bezier(.2,.9,.3,1.15) .15s both; }
@keyframes grow { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .radar-shape, .bar-fill, .dial-value { animation: none !important; } .trail-goat { transition: none !important; } }

/* Goat moods. Motion only for people who haven't asked for less of it. */
@media (prefers-reduced-motion: no-preference) {
  .goat-curious { animation: g-curious 4.5s ease-in-out infinite; }
  .goat-climbing { animation: g-step 2.4s ease-in-out infinite; }
  .goat-cheering { animation: g-jump 1.8s cubic-bezier(.3,0,.3,1) infinite; }
  .goat-summit { animation: g-sway 3.6s ease-in-out infinite; }
  .goat-leaping { animation: g-leap-in 1s cubic-bezier(.2,.8,.3,1) .1s both, g-float 3s ease-in-out 1.1s infinite; }
  .settled .goat-leaping { animation: g-float 3s ease-in-out infinite; }
  .goat-hope { animation: g-hope 5s ease-in-out infinite; }
  .goat-binoculars { animation: g-scan 4s ease-in-out infinite; }
  .trail-goat.hop img { animation: g-hop .5s ease-out; }
  .trail-goat.hop::after { content: ''; position: absolute; left: 50%; bottom: -1px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%;
    background: var(--muted); box-shadow: -9px 1px 0 var(--muted), 9px 1px 0 var(--muted); opacity: 0; animation: g-dust .45s ease-out .38s; }

  /* Reactions to an answer */
  .trail-goat.react-nod img { animation: g-nod .4s ease-in-out; }
  .trail-goat.react-shake img { animation: g-shake .4s ease-in-out; }
  .trail-goat.react-tilt img { animation: g-tilt .4s ease-in-out; }
  .trail-goat.react-shrug img { animation: g-shrug .4s ease-in-out; }

  /* Tap a goat: a quick spring jump */
  .goat-wrap.poked .goat-img, .trail-goat.poked img { animation: g-poke .6s cubic-bezier(.3,0,.3,1); }
  .bleat { animation: g-bleat 1.3s ease-out both; }

  /* The landing goat turns toward the pointer */
  .landing-hero .goat-wrap { transform: translate(var(--look-x, 0), var(--look-y, 0)) rotate(var(--look-r, 0deg)); transform-origin: 50% 100%; transition: transform .35s ease-out; }
}
@keyframes g-curious {
  0%, 100% { transform: rotate(0) translateY(0); }
  20%, 40% { transform: rotate(-4deg) translateY(-2px); }
  60% { transform: rotate(2deg) translateY(0); }
  80% { transform: rotate(0); }
}
@keyframes g-step {
  0%, 100% { transform: translateY(0) rotate(0); }
  30% { transform: translateY(-6px) rotate(-3deg); }
  50% { transform: translateY(0) rotate(0); }
}
@keyframes g-jump {
  0%, 55%, 100% { transform: translateY(0) scale(1, 1); }
  62% { transform: translateY(0) scale(1.06, .92); }
  75% { transform: translateY(-16px) scale(.97, 1.04); }
  88% { transform: translateY(0) scale(1.04, .95); }
}
@keyframes g-sway {
  0%, 100% { transform: rotate(-1.5deg); }
  50% { transform: rotate(1.5deg); }
}
@keyframes g-leap-in {
  0% { transform: translate(-60px, 30px) rotate(-12deg); opacity: 0; }
  60% { transform: translate(6px, -14px) rotate(4deg); opacity: 1; }
  100% { transform: translate(0, 0) rotate(0); }
}
@keyframes g-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes g-hope {
  0%, 70%, 100% { transform: translateY(0) rotate(0); }
  76% { transform: translateY(-8px) rotate(-3deg); }
  82% { transform: translateY(0) rotate(0); }
  86% { transform: translateY(-4px) rotate(2deg); }
  90% { transform: translateY(0) rotate(0); }
}
@keyframes g-scan {
  0%, 100% { transform: rotate(0); }
  30% { transform: rotate(-2.5deg); }
  65% { transform: rotate(2deg); }
}
@keyframes g-hop {
  0% { transform: translateY(0) scale(1.12, .86); }
  40% { transform: translateY(-11px) rotate(-6deg) scale(.94, 1.07); }
  76% { transform: translateY(0) scale(1.1, .9); }
  100% { transform: translateY(0) scale(1, 1); }
}
@keyframes g-dust {
  0% { opacity: .55; transform: scale(.6); }
  100% { opacity: 0; transform: scale(1.8) translateY(-3px); }
}
@keyframes g-nod {
  0%, 100% { transform: rotate(0); }
  30% { transform: rotate(9deg) translateY(1px); }
  65% { transform: rotate(-3deg); }
}
@keyframes g-shake {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-9deg); }
  45% { transform: rotate(8deg); }
  70% { transform: rotate(-5deg); }
}
@keyframes g-tilt {
  0%, 100% { transform: rotate(0); }
  45% { transform: rotate(-12deg) translateX(-1px); }
}
@keyframes g-shrug {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  35% { transform: translateY(-3px) scale(.92, 1.08); }
  65% { transform: translateY(0) scale(1.06, .94); }
}
@keyframes g-poke {
  0% { transform: translateY(0) scale(1, 1); }
  15% { transform: translateY(0) scale(1.1, .88); }
  45% { transform: translateY(-14%) rotate(-5deg) scale(.95, 1.06); }
  75% { transform: translateY(0) scale(1.06, .94); }
  100% { transform: translateY(0) scale(1, 1); }
}
@keyframes g-bleat {
  0% { opacity: 0; transform: translateY(-100%) scale(.6); }
  12% { opacity: 1; transform: translateY(-100%) scale(1.05); }
  20% { transform: translateY(-100%) scale(1); }
  80% { opacity: 1; transform: translateY(-100%); }
  100% { opacity: 0; transform: translateY(-115%); }
}
@keyframes confetti {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  100% { transform: translate(var(--dx), 460px) rotate(var(--spin)); opacity: .8; }
}
.bleat {
  position: absolute; top: 4%; right: -4px; transform: translateY(-100%); z-index: 3; pointer-events: none;
  background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); border-radius: 14px 14px 14px 4px;
  padding: 4px 10px; font-family: var(--display); font-weight: 600; font-size: 15px; white-space: nowrap;
}
.trail-goat .bleat { top: 0; right: auto; left: 70%; font-size: 13px; padding: 3px 8px; }
.confetti { position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px; pointer-events: none; z-index: 2; animation: confetti 1.6s linear both; }
.settled .radar-shape, .settled .bar-fill, .settled .dial-value { animation: none; }
.legend { display: flex; gap: 16px; justify-content: center; font-size: 13px; color: var(--muted); padding: 0 0 10px; flex-wrap: wrap; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 16px; border-top: 2px dashed var(--ink); }
.legend i.b { border-top: 2px solid var(--amber); }
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar { display: flex; flex-direction: column; gap: 6px; padding: 0 4px; }
.bar-label { display: flex; justify-content: space-between; font-size: 15px; font-weight: 600; gap: 8px; }
.bar-label b { font-family: var(--display); font-weight: 600; }
.bar-track { height: 10px; border-radius: 5px; background: var(--sunk); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 5px; transform-origin: left; animation: fill .8s ease-out .3s both; }
@keyframes fill { from { transform: scaleX(0); } }
.strengths { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.strength { display: flex; flex-direction: column; gap: 4px; }
.strength b { font-family: var(--display); font-weight: 700; font-size: 34px; color: var(--coral); line-height: 1; }
.strength span { font-size: 15px; font-weight: 600; line-height: 1.3; }
.sub { font-size: 14px; color: var(--muted); margin-top: 4px; }
.mismatch { background: var(--coralSoft); border-radius: 18px; padding: 12px 16px; font-size: 15px; line-height: 1.45; }
.flag { display: flex; flex-direction: column; gap: 12px; }
.flag-cat { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.flag-text { font-size: 17px; font-weight: 600; line-height: 1.35; text-wrap: pretty; }
.flag-note { font-size: 13px; line-height: 1.4; color: var(--muted); }
.person { display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: center; }
.person-name { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.dots i { height: 10px; border-radius: 5px; background: var(--sunk); }
.person-label { font-size: 13px; color: var(--muted); margin-top: 4px; }
.idea-group { display: flex; flex-direction: column; gap: 10px; }
.surprise-group { display: flex; flex-direction: column; gap: 12px; }
.surprise { display: flex; flex-direction: column; gap: 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.surprise-text { font-size: 15px; font-weight: 600; line-height: 1.4; }
.surprise-ans { font-size: 14px; }
.surprise-ans span { display: inline-block; min-width: 64px; color: var(--muted); font-weight: 600; }
.idea-cat { font-family: var(--display); font-weight: 600; font-size: 17px; }
.idea { display: flex; gap: 10px; font-size: 15px; line-height: 1.45; }
.idea::before { content: ''; width: 8px; height: 8px; margin-top: 7px; flex: none; border-radius: 2px; transform: rotate(45deg); background: var(--coral); }
.celebrate { background: var(--amberSoft); border-radius: 22px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.celebrate .eyebrow { font-size: 11px; color: var(--ink); text-transform: uppercase; }
.celebrate div:last-child { font-size: 16px; font-weight: 600; line-height: 1.4; }
.res-actions { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.closing { padding: 20px 8px 0; border-top: 1px solid var(--line); font-family: var(--display); font-weight: 500; font-size: 18px; line-height: 1.4; text-align: center; text-wrap: pretty; display: flex; flex-direction: column; gap: 10px; }
.closing .counselor { font-family: var(--body); font-size: 15px; color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg);
  padding: 12px 18px; border-radius: 22px; font-weight: 600; font-size: 15px; z-index: 10;
}
