:root {
  color-scheme: dark;
  --bg: #070708;
  --ink: #f4f0e6;
  --muted: #a39e93;
  --line: rgba(244, 240, 230, 0.16);
  --acid: #d6ff4a;
  --pink: #ff6b9a;
  --card: #101012;
  font-family: ui-sans-serif, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
*::selection { background: var(--acid); color: #14140c; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--acid); outline-offset: 3px; }
[hidden] { display: none !important; }

.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 15% -10%, rgba(214, 255, 74, 0.16), transparent 42%),
    radial-gradient(ellipse at 110% 90%, rgba(255, 107, 154, 0.1), transparent 36%),
    var(--bg);
}

.sky::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(#f4f0e6 0.7px, transparent 0.7px);
  background-size: 46px 46px;
  opacity: 0.16;
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
}

main {
  width: min(480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

header { margin-bottom: 8px; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--acid);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--acid);
  box-shadow: 0 0 12px var(--acid);
}

.dot.demo { background: var(--muted); box-shadow: none; }

h1 {
  margin: 0;
  font-family: Georgia, "Iowan Old Style", Palatino, "Palatino Linotype", serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(60px, 16vw, 92px);
  letter-spacing: -0.045em;
  line-height: 0.82;
}

.tag { margin: 12px 0 0; color: var(--muted); }

.stage { display: flex; flex-direction: column; align-items: center; }

#face { width: min(280px, 78vw); margin: 8px auto 0; cursor: pointer; }

#face svg { display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 18px 30px rgba(214, 255, 74, 0.1)); }

#face .head { fill: #16161a; stroke: #f4f0e6; stroke-width: 2.5; }
#face .ear { fill: #121214; stroke: #f4f0e6; stroke-width: 2.2; }
#face .inner { fill: var(--pink); opacity: 0.5; }
#face .gloss { fill: #fff; opacity: 0.14; }
#face .ant { fill: none; stroke: #f4f0e6; stroke-width: 2.4; stroke-linecap: round; }
#face .bulb { fill: var(--acid); }
#face .blush { fill: var(--pink); opacity: 0; }
#face .brow { fill: none; stroke: #f4f0e6; stroke-width: 3.1; stroke-linecap: round; transform-box: fill-box; transform-origin: center; transition: transform 0.2s ease; }
#face .sclera { fill: #f6f3ec; }
#face .pupil { fill: #121214; transform-box: fill-box; transform-origin: center; }
#face .glint { fill: var(--acid); }
#face .nose { fill: none; stroke: #f4f0e6; stroke-width: 2.2; stroke-linecap: round; opacity: 0.8; }
#face .mouth { opacity: 0; fill: none; stroke: #f4f0e6; stroke-width: 3.2; stroke-linecap: round; }
#face .fang { fill: #f4f0e6; opacity: 0; }
#face .eye { transform-box: fill-box; transform-origin: center; transition: transform 0.2s ease; }

#face[data-mood="idle"] .smile,
#face[data-mood="yes"] .smile,
#face[data-mood="smug"] .smile,
#face[data-mood="wink"] .smile,
#face[data-mood="soft"] .smile { opacity: 1; }
#face[data-mood="chaos"] .grin,
#face[data-mood="chaos"] .fang { opacity: 1; }
#face[data-mood="maybe"] .flat,
#face[data-mood="side"] .flat { opacity: 1; }
#face[data-mood="no"] .frown { opacity: 1; }
#face[data-mood="think"] .oh { opacity: 1; }

#face[data-mood="soft"] .blush,
#face[data-mood="yes"] .blush,
#face[data-mood="wink"] .blush,
#face[data-mood="smug"] .blush { opacity: 0.7; }

#face[data-mood="wink"] .eye.right { transform: scaleY(0.08); }
#face[data-mood="wink"] .eye.right .pupil,
#face[data-mood="wink"] .eye.right .glint { opacity: 0; }
#face[data-mood="smug"] .eye { transform: scaleY(0.62); }
#face[data-mood="no"] .eye { transform: scale(1.08); }
#face[data-mood="side"] .pupil { transform: translate(5px, 1px); }
#face[data-mood="chaos"] .eye.left .pupil { transform: translate(-4px, 3px) scale(1.15); }
#face[data-mood="chaos"] .eye.right .pupil { transform: translate(5px, -3px) scale(0.8); }
#face[data-mood="no"] .brow.left { transform: rotate(16deg); }
#face[data-mood="no"] .brow.right { transform: rotate(-16deg); }
#face[data-mood="yes"] .brow,
#face[data-mood="soft"] .brow { transform: translateY(-3px); }
#face[data-mood="maybe"] .brow.left { transform: rotate(-10deg); }
#face[data-mood="maybe"] .brow.right { transform: rotate(6deg); }

#face[data-mood="idle"] .eye { animation: blink 5.6s infinite; }
#face[data-mood="think"] .eye.left .pupil { animation: dart 0.8s ease-in-out infinite; }
#face[data-mood="think"] .eye.right .pupil { animation: dart 0.8s ease-in-out infinite reverse; }
#face[data-mood="think"] .bulb { animation: glow 0.55s ease-in-out infinite; }
#face[data-mood="yes"] .bulb,
#face[data-mood="chaos"] .bulb { filter: drop-shadow(0 0 5px var(--acid)); }

#face.thinking svg { animation: wobble 0.45s ease-in-out infinite; transform-origin: 50% 58%; }
#face.boop:not(.thinking) svg { animation: boop 0.35s ease; transform-origin: 50% 58%; }

#status {
  min-height: 1.4em;
  margin: 4px 0 18px;
  color: var(--muted);
  text-align: center;
}

.modes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  border-radius: 18px;
  background: rgba(244, 240, 230, 0.05);
}

.mode { flex: 1 1 30%; }

.mode {
  border: 0;
  border-radius: 999px;
  padding: 10px 8px;
  background: transparent;
  color: var(--muted);
}

.mode[aria-pressed="true"] {
  background: var(--ink);
  color: #14140c;
  font-weight: 700;
}

fieldset { margin: 0 0 12px; padding: 0; border: 0; }

label, .label {
  display: block;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

input[type="text"], textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: transparent;
  font-size: 16px;
}

textarea { min-height: 96px; resize: vertical; }

.help {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.narrow { margin-top: 18px; }
.narrow .go { margin-top: 12px; }

.qtext {
  margin: 8px 0 14px;
  font-size: 26px;
  line-height: 1.2;
}

.qlog {
  margin: 16px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.board {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

input[type="text"]::placeholder { color: #6f6b64; }

.examples, .vibes { display: flex; flex-wrap: wrap; gap: 8px; }
.examples { margin-top: 10px; }

.examples button {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}

.examples button:hover { color: var(--ink); border-color: var(--ink); }

.signs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.signs + label { margin-top: 14px; }
.vibes { margin-bottom: 14px; }

.chip {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px 10px;
  text-align: center;
  cursor: pointer;
}

.signs .chip { flex-direction: column; min-height: 58px; }
.vibes .chip { border-radius: 999px; }

.chip input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.chip .glyph { font-size: 18px; line-height: 1; }
.chip .name { font-size: 11px; letter-spacing: -0.02em; }
.chip:has(input:checked) { border-color: var(--acid); background: var(--acid); color: #14140c; }
.chip:has(input:focus-visible) { outline: 2px solid var(--acid); outline-offset: 3px; }
.chip input:focus-visible { outline: none; }

.go {
  width: 100%;
  margin-top: 6px;
  padding: 14px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--acid);
  color: #14140c;
  font-weight: 700;
}

.go:disabled { cursor: progress; opacity: 0.55; }
.go:hover:not(:disabled) { filter: brightness(1.05); }

#result {
  margin-top: 18px;
  padding: 22px 22px 16px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(ellipse at 0 0, rgba(214, 255, 74, 0.1), transparent 46%),
    var(--card);
}

#result .kicker {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

#result .headline {
  margin: 6px 0 0;
  font-family: Georgia, "Iowan Old Style", Palatino, serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(40px, 8vw, 56px);
  letter-spacing: -0.04em;
  line-height: 0.95;
}

#result .percent {
  margin: 10px 0 0;
  font-size: clamp(56px, 12vw, 76px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.06em;
  line-height: 0.85;
}

#result .percent-label {
  margin: 4px 0 0;
  color: var(--acid);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}

.pair .percent { font-size: clamp(42px, 8vw, 64px); }

#result[data-mood="no"] .percent,
#result[data-mood="side"] .percent { color: var(--pink); }

#result .note {
  margin: 12px 0 0;
  color: var(--muted);
  font-family: Georgia, "Iowan Old Style", Palatino, serif;
  font-style: italic;
  font-size: 18px;
}

#result .line { margin: 12px 0 0; font-size: 17px; line-height: 1.35; }
#result .sub { margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.4; }

.stat { margin-top: 14px; }
.stat p { margin: 0 0 6px; color: var(--muted); font-size: 13px; }

.meter {
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(244, 240, 230, 0.12);
}

.meter > span { display: block; height: 100%; border-radius: inherit; background: var(--acid); }
.b0 { width: 0%; } .b1 { width: 5%; } .b2 { width: 10%; } .b3 { width: 15%; }
.b4 { width: 20%; } .b5 { width: 25%; } .b6 { width: 30%; } .b7 { width: 35%; }
.b8 { width: 40%; } .b9 { width: 45%; } .b10 { width: 50%; } .b11 { width: 55%; }
.b12 { width: 60%; } .b13 { width: 65%; } .b14 { width: 70%; } .b15 { width: 75%; }
.b16 { width: 80%; } .b17 { width: 85%; } .b18 { width: 90%; } .b19 { width: 95%; }
.b20 { width: 100%; }

.runners { margin: 14px 0 0; }
.runners ul { margin: 0; padding: 0; list-style: none; }
.runners p { margin: 0 0 4px; color: var(--muted); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.runners li { display: flex; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); }

.actions { margin-top: 16px; }

.ghost {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
}

.ghost:hover { border-color: var(--acid); color: var(--acid); }

.market-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--ink);
  font-size: 13px;
}

.mark {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

footer { margin-top: 28px; }
footer p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

.noscript {
  width: min(480px, calc(100% - 32px));
  margin: 12px auto;
  color: var(--muted);
}

@media (min-width: 900px) {
  main { width: min(980px, calc(100% - 64px)); padding-top: 48px; }
  .play {
    display: grid;
    grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
    gap: 36px;
    align-items: center;
  }
  #status { margin-bottom: 0; }
}

@keyframes blink {
  0%, 92%, 100% { transform: scaleY(1); }
  96% { transform: scaleY(0.08); }
}

@keyframes dart {
  0%, 100% { transform: translate(0, 0); }
  40% { transform: translate(4px, -3px); }
  70% { transform: translate(-3px, 2px); }
}

@keyframes glow { 50% { fill: #fff; } }

@keyframes wobble {
  0%, 100% { transform: rotate(-2.5deg); }
  50% { transform: rotate(2.5deg); }
}

@keyframes boop {
  40% { transform: scale(0.94, 1.05); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---- The cloud: what gets asked ---- */
.pulse {
  margin-top: 26px;
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
}

.pulse-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.pulse-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.pulse-tabs,
.pulse-windows {
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(244, 240, 230, 0.05);
}

.pulse-windows { margin-bottom: 14px; width: max-content; }

.ptab,
.pwin {
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}

.ptab[aria-pressed="true"],
.pwin[aria-pressed="true"] {
  background: var(--acid);
  color: #14140c;
  font-weight: 600;
}

.cloud {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  min-height: 34px;
}

/* Sequential ramp: size + lightness both carry the same count (dim -> bright). */
.cw { line-height: 1.35; cursor: default; }
.cw.t1 { color: #857f73; }
.cw.t2 { color: var(--muted); }
.cw.t3 { color: #cfc9bc; }
.cw.t4 { color: var(--ink); }

.pulse-note {
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

/* ---- Per-result share page (/c/<slug>) ---- */
.sharepage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding-top: 48px;
}

.sharecard {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
}

.sharecta {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  border-radius: 999px;
  padding: 14px 0;
  background: var(--acid);
  color: #14140c;
  font-weight: 600;
}
