/* Doybot. Cream paper, ink outlines, hard shadows, one loud color per type. */
:root {
  --paper: #fff7e8;
  --paper-2: #fdebd0;
  --ink: #1d1530;
  --ink-2: #4a3f63;
  --muted: #7a6e8f;
  --pink: #ff5c8a;
  --violet: #7b3fe4;
  --lemon: #ffd23f;
  --mint: #2fcf8f;
  --red: #ff4d4d;
  --radius: 22px;
  --line: 3px solid var(--ink);
  --shadow: 6px 6px 0 var(--ink);
  --h: 330;
  color-scheme: light;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Bricolage Grotesque", ui-rounded, "Segoe UI", system-ui, sans-serif;
  font-optical-sizing: auto;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
  font-size: 17px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: radial-gradient(rgba(29, 21, 48, 0.07) 1.2px, transparent 1.2px);
  background-size: 22px 22px;
}
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 10px; z-index: 50; }
.skip:focus { left: 8px; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- header */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px max(16px, env(safe-area-inset-left)) 6px;
  max-width: 980px; width: 100%; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.wordmark { font-weight: 800; font-size: 1.55rem; letter-spacing: -0.03em; }
.nav { display: flex; gap: 6px; }
.nav a {
  text-decoration: none; font-weight: 700; padding: 7px 14px; border-radius: 999px;
  border: 2px solid transparent;
}
.nav a:hover { border-color: var(--ink); background: #fff; }

/* ----------------------------------------------------------------- mascot */
.bot {
  position: relative; display: inline-block; flex-shrink: 0;
  background: var(--paper); border: var(--line); border-radius: 30%;
}
.bot .eye {
  position: absolute; top: 34%; width: 17%; height: 26%; background: var(--ink); border-radius: 50%;
  animation: blink 4.5s infinite;
}
.bot .eye::after { content: ""; position: absolute; top: 18%; left: 22%; width: 36%; height: 30%; background: #fff; border-radius: 50%; }
.bot .eye.l { left: 26%; }
.bot .eye.r { right: 26%; }
.bot-sm { width: 38px; height: 34px; border-width: 2.5px; }
.bot-sm .eye { top: 30%; }
.bot-hero { width: 112px; height: 98px; margin-top: 22px; }
.bot-hero .antenna {
  position: absolute; left: 50%; top: -24px; width: 4px; height: 22px; margin-left: -2px; background: var(--ink); border-radius: 4px;
}
.bot-hero .antenna::before {
  content: ""; position: absolute; top: -12px; left: -6px; width: 16px; height: 16px; border-radius: 50%; background: var(--pink); border: 3px solid var(--ink);
}
.bot-hero .mouth {
  position: absolute; left: 36%; bottom: 13%; width: 28%; height: 14%;
  border: 4px solid var(--ink); border-top: 0; border-left-color: transparent; border-right-color: transparent;
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
}
.bot.is-reading .eye { animation: scan 1.1s ease-in-out infinite alternate; }
.bot.is-reading .antenna::before { animation: pulse 0.8s ease-in-out infinite alternate; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
@keyframes scan { from { transform: translateX(-30%); } to { transform: translateX(30%); } }
@keyframes pulse { from { background: var(--pink); } to { background: var(--lemon); } }

/* ------------------------------------------------------------------ main */
main { flex: 1; width: 100%; max-width: 680px; margin: 0 auto; padding: 0 16px 40px; }
.view { animation: fadein 0.35s ease both; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.hero { text-align: center; padding: 18px 0 14px; }
.headline {
  font-size: clamp(2.3rem, 9vw, 4.1rem); font-weight: 800; line-height: 0.98; letter-spacing: -0.035em; margin: 18px 0 14px;
}
.hl { display: inline-block; background: var(--lemon); padding: 0 0.18em; border-radius: 10px; transform: rotate(-2deg); border: var(--line); box-shadow: 4px 4px 0 var(--ink); margin-top: 6px; }
.sub { font-size: 1.12rem; color: var(--ink-2); max-width: 30em; margin: 0 auto; }

/* ------------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 10px; justify-content: center; margin: 22px 0 14px; }
.tab {
  background: #fff; border: var(--line); border-radius: 999px; padding: 9px 20px; font-weight: 800; font-size: 1rem;
  box-shadow: 3px 3px 0 var(--ink); transition: transform 0.08s;
}
.tab.is-on { background: var(--ink); color: var(--paper); }
.tab:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

/* --------------------------------------------------------------- composer */
.composer {
  background: #fff; border: var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px;
}
.paste {
  width: 100%; resize: vertical; min-height: 140px; border: 2.5px solid var(--ink); border-radius: 14px;
  background: var(--paper); padding: 14px 15px; font: inherit; font-size: 1.05rem; line-height: 1.45; color: var(--ink);
}
.paste::placeholder { color: var(--muted); }
.row-meta { display: flex; justify-content: flex-end; margin: 4px 2px 0; }
.count { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.examples { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin: 10px 0 4px; }
.examples-label { font-size: 0.88rem; color: var(--muted); font-weight: 600; margin-right: 2px; }
.chip {
  border: 2px solid var(--ink); background: var(--paper-2); border-radius: 999px; padding: 4px 12px; font-size: 0.86rem; font-weight: 700;
}
.chip:hover { background: var(--lemon); }
.name-field { display: flex; flex-direction: column; gap: 5px; margin-top: 14px; font-size: 0.88rem; font-weight: 700; color: var(--ink-2); }
.name-field input, .pair-name {
  border: 2.5px solid var(--ink); border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 1rem; background: var(--paper); color: var(--ink);
}
.pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: start; }
.pair-col { display: flex; flex-direction: column; gap: 8px; }
.pair-plus { font-weight: 800; font-size: 2rem; align-self: center; }
.pair .paste { min-height: 130px; }
.link-btn { background: none; border: 0; text-decoration: underline; font-weight: 700; color: var(--violet); margin-top: 10px; font-size: 0.95rem; }
.duet-banner {
  display: flex; align-items: center; gap: 12px; background: var(--lemon); border: var(--line); border-radius: 16px; padding: 12px 14px; margin-bottom: 14px; font-weight: 700;
}
.duet-banner .em { font-size: 2rem; }
.go {
  width: 100%; margin-top: 16px; background: var(--pink); color: #fff; border: var(--line); border-radius: 16px; padding: 16px; font-weight: 800; font-size: 1.3rem; letter-spacing: -0.01em;
  box-shadow: var(--shadow); transition: transform 0.08s, box-shadow 0.08s;
}
.go:hover { background: #ff477c; }
.go:active { transform: translate(4px, 4px); box-shadow: 2px 2px 0 var(--ink); }
.go:disabled { opacity: 0.6; cursor: wait; }
.privacy-line { text-align: center; font-size: 0.86rem; color: var(--muted); margin-top: 12px; }
.error { background: #ffe1e1; border: 2px solid var(--red); color: #8a1111; border-radius: 12px; padding: 10px 12px; margin-top: 12px; font-weight: 600; }
.turnstile { display: flex; justify-content: center; margin-top: 10px; }
.turnstile:empty { display: none; }

.ticker {
  margin: 22px auto 0; text-align: center; font-weight: 700; font-size: 0.95rem; color: var(--ink-2);
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
}
.ticker span { background: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 4px 12px; }
.ticker .live::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); margin-right: 7px; animation: pulse-dot 1.4s infinite; vertical-align: 1px; }
@keyframes pulse-dot { 50% { opacity: 0.3; } }

.how { margin-top: 38px; }
.how h2, .section-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 12px; }
.steps { list-style: none; display: grid; gap: 10px; }
.steps li { display: flex; gap: 12px; align-items: center; background: #fff; border: 2.5px solid var(--ink); border-radius: 16px; padding: 12px 14px; }
.steps b { flex-shrink: 0; width: 34px; height: 34px; display: grid; place-items: center; background: var(--violet); color: #fff; border-radius: 50%; border: 2.5px solid var(--ink); }
.peek { display: inline-block; margin-top: 14px; font-weight: 800; color: var(--violet); }

/* ---------------------------------------------------------------- loading */
.loading { position: fixed; inset: 0; background: rgba(255, 247, 232, 0.97); z-index: 40; display: grid; place-items: center; animation: fadein 0.2s ease both; }
.loading-inner { text-align: center; padding: 20px; }
.loading .bot-hero { width: 150px; height: 130px; }
.loading-line { font-size: 1.3rem; font-weight: 800; margin: 26px 0 16px; min-height: 2em; }
.loading-bar { width: 240px; height: 14px; border: var(--line); border-radius: 999px; overflow: hidden; margin: 0 auto; background: #fff; }
.loading-bar i { display: block; height: 100%; width: 40%; background: var(--pink); border-radius: 999px; animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }

/* ----------------------------------------------------------------- result */
.result-head { display: flex; align-items: center; justify-content: space-between; margin: 14px 0 12px; gap: 10px; }
.result-head .who { font-weight: 800; color: var(--ink-2); }
.rcard {
  position: relative; overflow: hidden; color: #fff; border: 4px solid var(--ink); border-radius: 28px; box-shadow: 8px 8px 0 var(--ink);
  background: linear-gradient(135deg, hsl(var(--h) 78% 58%) 0%, hsl(calc(var(--h) + 35) 72% 42%) 100%);
  padding: 22px 20px 20px;
}
.rcard.pop { animation: pop 0.6s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
@keyframes pop { from { transform: scale(0.7) rotate(-4deg); opacity: 0; } to { transform: none; opacity: 1; } }
.rcard .label { font-weight: 800; letter-spacing: 0.12em; font-size: 0.82rem; text-transform: uppercase; opacity: 0.92; }
.rcard .emoji-tile {
  width: 104px; height: 104px; display: grid; place-items: center; font-size: 4.2rem; background: var(--paper);
  border: var(--line); border-radius: 26px; box-shadow: 5px 5px 0 var(--ink); margin: 14px 0 12px;
}
.rcard .arch { font-size: clamp(2.1rem, 9vw, 3.3rem); font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.rcard .tagline { font-size: 1.18rem; font-weight: 600; margin-top: 10px; line-height: 1.3; }
.rcard .pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.rcard .pill { background: rgba(255, 255, 255, 0.93); color: var(--ink); border-radius: 999px; padding: 5px 13px; font-weight: 800; font-size: 0.86rem; }
.sticker {
  position: absolute; right: 14px; top: 14px; background: var(--lemon); color: var(--ink); border: var(--line); border-radius: 14px;
  padding: 4px 11px; font-weight: 800; font-size: 1rem; transform: rotate(8deg); box-shadow: 3px 3px 0 var(--ink);
}
.rcard .foot-brand { display: flex; align-items: center; gap: 7px; margin-top: 16px; font-weight: 800; opacity: 0.95; }

.panel { background: #fff; border: var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-top: 18px; }
.panel h3 { font-size: 1.05rem; font-weight: 800; margin-bottom: 8px; }
.panel .readtext { font-size: 1.12rem; line-height: 1.5; }
.traits { display: grid; gap: 12px; margin-top: 4px; }
.trait-top { display: flex; justify-content: space-between; font-weight: 700; font-size: 0.95rem; margin-bottom: 4px; }
.track { height: 16px; border: 2.5px solid var(--ink); border-radius: 999px; background: var(--paper); overflow: hidden; }
.fill { height: 100%; width: 0; background: hsl(var(--h) 75% 55%); border-right: 2.5px solid var(--ink); transition: width 1.1s cubic-bezier(0.2, 0.9, 0.3, 1); }
.flags { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.flag { border: 2.5px solid var(--ink); border-radius: 16px; padding: 12px; font-size: 0.97rem; }
.flag b { display: block; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }
.flag.green { background: #ddf8ea; }
.flag.red { background: #ffe1e6; }
.energy { margin-top: 10px; background: var(--paper-2); border: 2.5px solid var(--ink); border-radius: 16px; padding: 12px; }
.secret { position: relative; margin-top: 10px; border: 2.5px dashed var(--ink); border-radius: 16px; padding: 12px; background: #f1ebff; cursor: pointer; }
.secret .s-text { filter: blur(7px); user-select: none; transition: filter 0.4s; }
.secret.is-open .s-text { filter: none; user-select: auto; }
.secret .s-hint { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; }
.secret.is-open .s-hint { display: none; }

.share { margin-top: 18px; }
.share-main {
  width: 100%; background: var(--ink); color: var(--paper); border: var(--line); border-radius: 16px; padding: 15px; font-weight: 800; font-size: 1.2rem; box-shadow: 5px 5px 0 var(--pink);
}
.share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.sbtn {
  background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; padding: 9px 4px; font-weight: 700; font-size: 0.8rem;
  display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; box-shadow: 3px 3px 0 var(--ink);
}
.sbtn .ic { font-size: 1.3rem; line-height: 1; }
.sbtn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

.invite { background: var(--lemon); }
.invite p { margin-bottom: 10px; font-weight: 600; }
.invite .linkbox { display: flex; gap: 8px; }
.invite input { flex: 1; min-width: 0; border: 2.5px solid var(--ink); border-radius: 12px; padding: 10px; font: inherit; font-size: 0.9rem; background: #fff; }
.btn {
  background: var(--ink); color: var(--paper); border: var(--line); border-radius: 12px; padding: 10px 16px; font-weight: 800; white-space: nowrap; text-decoration: none; display: inline-block;
}
.btn.light { background: #fff; color: var(--ink); }
.btn.pink { background: var(--pink); color: #fff; }
.vote { display: flex; gap: 8px; flex-wrap: wrap; }
.vote button { flex: 1; min-width: 90px; background: #fff; border: 2.5px solid var(--ink); border-radius: 12px; padding: 10px 6px; font-weight: 800; }
.vote button.is-on { background: var(--mint); }
.after { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.after .btn { flex: 1; text-align: center; }
.small-links { text-align: center; margin-top: 18px; font-size: 0.85rem; color: var(--muted); }
.small-links button { background: none; border: 0; text-decoration: underline; color: var(--muted); font-size: 0.85rem; }

/* compatibility */
.match { text-align: center; }
.ring {
  --p: 50;
  width: 170px; height: 170px; margin: 6px auto 10px; border-radius: 50%; border: 4px solid var(--ink);
  background: conic-gradient(#fff calc(var(--p) * 1%), rgba(255, 255, 255, 0.25) 0);
  display: grid; place-items: center; box-shadow: 6px 6px 0 var(--ink);
}
.ring b { width: 128px; height: 128px; border-radius: 50%; background: var(--paper); color: var(--ink); border: 4px solid var(--ink); display: grid; place-items: center; font-size: 2.6rem; font-weight: 800; }
.band { display: inline-block; background: var(--paper); color: var(--ink); border: var(--line); border-radius: 999px; padding: 6px 16px; font-weight: 800; font-size: 1.2rem; }
.duo { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin: 16px 0 6px; }
.duo .p { text-align: center; }
.duo .p .emoji-tile { margin: 0 auto 8px; width: 82px; height: 82px; font-size: 3.1rem; border-radius: 22px; }
.duo .p .n { font-weight: 800; font-size: 1.1rem; }
.duo .p .a { font-size: 0.88rem; opacity: 0.95; }
.duo .x { font-size: 1.8rem; font-weight: 800; }
.verdict { font-size: 1.2rem; font-weight: 700; margin-top: 10px; }

/* gallery + world */
.grid-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tcard {
  text-decoration: none; color: #fff; border: var(--line); border-radius: 20px; padding: 14px; box-shadow: 4px 4px 0 var(--ink);
  background: linear-gradient(135deg, hsl(var(--h) 78% 58%), hsl(calc(var(--h) + 35) 72% 42%));
  display: flex; flex-direction: column; gap: 6px; transition: transform 0.1s;
}
.tcard:hover { transform: translate(-2px, -2px) rotate(-0.6deg); }
.tcard .e { font-size: 2.2rem; }
.tcard .n { font-weight: 800; font-size: 1.1rem; line-height: 1.1; }
.tcard .v { font-size: 0.88rem; opacity: 0.95; }
.tcard .r { margin-top: auto; align-self: flex-start; background: rgba(255,255,255,0.93); color: var(--ink); border-radius: 999px; padding: 2px 10px; font-weight: 800; font-size: 0.78rem; }
.world-list { display: grid; gap: 8px; }
.wrow { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; padding: 10px 12px; }
.wrow .flagc { font-size: 1.7rem; }
.wrow .wt { font-weight: 800; }
.wrow .ws { font-size: 0.85rem; color: var(--muted); }
.wrow .wp { font-weight: 800; }
.empty { text-align: center; padding: 26px 12px; color: var(--ink-2); font-weight: 600; }
.lede { color: var(--ink-2); margin-bottom: 18px; font-size: 1.05rem; }
.page-title { font-size: clamp(2rem, 7vw, 3rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.02; margin: 16px 0 10px; }

/* toast + confetti */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 11px 18px; border-radius: 999px;
  font-weight: 700; z-index: 60; box-shadow: 4px 4px 0 var(--pink); animation: fadein 0.2s ease both; max-width: calc(100vw - 32px); text-align: center;
}
.confetti { position: fixed; top: -12px; width: 10px; height: 14px; z-index: 55; pointer-events: none; border: 1.5px solid var(--ink); animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ----------------------------------------------------------------- footer */
.foot { text-align: center; padding: 26px 16px 34px; color: var(--ink-2); font-size: 0.9rem; border-top: 3px solid var(--ink); background: var(--paper-2); }
.foot nav { display: flex; gap: 18px; justify-content: center; margin-bottom: 8px; font-weight: 800; }
.foot nav a { text-decoration: none; }
.foot-small { color: var(--muted); font-size: 0.8rem; margin-top: 6px; }
.lang-select { font: inherit; font-weight: 700; border: 2px solid var(--ink); border-radius: 10px; padding: 4px 8px; background: #fff; color: var(--ink); margin-top: 10px; }
.section-title.spaced { margin-top: 28px; }

/* prose pages (privacy) */
.prose { background: #fff; border: var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.prose h2 { font-size: 1.2rem; margin: 18px 0 6px; }
.prose p, .prose li { margin-bottom: 8px; }
.prose ul { padding-left: 20px; }

@media (max-width: 520px) {
  body { font-size: 16px; }
  .pair { grid-template-columns: 1fr; }
  .pair-plus { justify-self: center; font-size: 1.6rem; }
  .share-grid { grid-template-columns: repeat(4, 1fr); }
  .flags { grid-template-columns: 1fr; }
  .nav a { padding: 6px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
