:root {
  --bg: #f7f4fb; --surface: #ffffff; --ink: #1c1529; --muted: #625a73; --line: #e3dcee;
  --accent: #6b2fd6; --accent-ink: #ffffff; --haha: #0f8a4b; --nope: #8a8199; --gold: #b07800; --soft: #efe8fa;
  --radius: 18px; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #141020; --surface: #1f1830; --ink: #f3eefb; --muted: #b9afcc; --line: #352b4b;
    --accent: #b794ff; --accent-ink: #160f24; --haha: #4fd894; --nope: #9d94b0; --gold: #ffd166; --soft: #2a2140; color-scheme: dark; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 18px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.01em; margin: 1.2em 0 0.5em; }
h1 { font-size: clamp(30px, 6vw, 46px); margin-top: 0.5em; letter-spacing: -0.02em; }
h2 { font-size: clamp(22px, 4vw, 28px); }
p { margin: 0 0 1em; }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -9999px; } .skip:focus { left: 12px; top: 12px; background: var(--surface); padding: 8px; z-index: 9; }
.site-head { border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; flex-wrap: wrap; }
.logo { font-weight: 850; font-size: 20px; color: var(--ink); text-decoration: none; }
.nav { display: flex; gap: 16px; flex-wrap: wrap; font-size: 16px; }
.nav a { color: var(--ink); text-decoration: none; padding: 6px 0; }
.nav a[aria-current="page"], .nav a:hover { color: var(--accent); text-decoration: underline; }
.site-foot { margin-top: 56px; border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: 15px; }
.site-foot nav { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.lede { font-size: 20px; color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 14px; font-weight: 750; color: var(--muted); margin: 0; }
.note, .hint { font-size: 15px; color: var(--muted); }
.hint { text-align: center; }
.card-box, .share-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 18px 0; }
.share-box { border: 2px dashed var(--accent); }
.share-box h2 { margin-top: 0; font-size: 22px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 50px; padding: 10px 24px; border-radius: 999px; border: 2px solid var(--accent); background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 750; cursor: pointer; text-decoration: none; }
.btn.secondary { background: transparent; color: var(--accent); }
.btn.small { min-height: 42px; padding: 6px 16px; font-size: 16px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.link-btn { background: none; border: 0; color: var(--accent); font: inherit; font-size: 15px; cursor: pointer; text-decoration: underline; padding: 6px; }
.link-btn[disabled] { color: var(--muted); opacity: 0.5; cursor: default; text-decoration: none; }
label.name { display: block; font-weight: 600; margin: 12px 0; }
input[type="text"], input.link { display: block; width: 100%; max-width: 420px; margin-top: 6px; font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); min-height: 48px; }
input.link { max-width: none; font-size: 14px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; margin-top: 8px; }

/* swiping */
.qhead { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 15px; font-weight: 650; }
.progress { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 4px 0 14px; }
.progress span { display: block; height: 100%; background: var(--accent); }
.stack { position: relative; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 28px rgba(28, 21, 41, 0.12); padding: 14px; touch-action: pan-y; user-select: none; transition: transform 0.18s ease, opacity 0.18s ease; cursor: grab; }
.card[data-lean="haha"] { box-shadow: 0 0 0 4px var(--haha); }
.card[data-lean="nope"] { box-shadow: 0 0 0 4px var(--nope); }
.meme { margin: 0; }
.meme .cap { font-size: clamp(19px, 4.4vw, 24px); font-weight: 750; line-height: 1.3; margin: 2px 4px 12px; }
.meme img { display: block; width: 100%; height: min(52vh, 480px); object-fit: contain; background: #0d0b12; border-radius: 12px; }
.meme .credit { font-size: 13px; color: var(--muted); margin: 8px 4px 0; }
.textcard, .format { min-height: min(46vh, 360px); display: flex; flex-direction: column; justify-content: center; padding: 18px 12px; font-size: clamp(21px, 4.8vw, 27px); font-weight: 650; line-height: 1.35; }
.textcard p, .format p { margin: 0 0 0.55em; }
.format .fmt { font-size: 15px; font-weight: 750; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); }
.format .fmt span { text-transform: none; letter-spacing: 0; color: var(--muted); font-weight: 500; }
.swipe-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 6px; }
.swipe-row .btn { min-height: 60px; font-size: 20px; }
.btn.nope { background: transparent; color: var(--ink); border-color: var(--nope); }
.btn.haha { background: var(--haha); border-color: var(--haha); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.haha { color: #0b1a12; } }

/* results */
.type { color: var(--accent); }
.score { font-size: clamp(60px, 16vw, 104px); font-weight: 900; line-height: 1; margin: 6px 0; color: var(--accent); }
.verdict { font-size: 22px; font-weight: 750; }
.types { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.types div { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.types span { display: block; font-size: 14px; color: var(--muted); }
.bars { display: grid; gap: 8px; margin: 10px 0 18px; }
.bar { display: grid; grid-template-columns: 6.5em 1fr 3em; align-items: center; gap: 10px; font-size: 16px; }
.track { position: relative; height: 12px; background: var(--line); border-radius: 99px; overflow: hidden; }
.track > span { position: absolute; left: 0; top: 0; height: 100%; background: var(--accent); }
.track > span.them { top: 4px; height: 4px; background: var(--gold); }
.bar b { text-align: right; }
.favs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.favs figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.favs img { width: 100%; height: 150px; object-fit: cover; display: block; }
.favs figcaption { font-size: 14px; padding: 8px 10px; }
.favs .txt { display: flex; align-items: center; }
.cardbox canvas { width: 100%; max-width: 400px; height: auto; border-radius: 12px; display: block; border: 1px solid var(--line); }
.typelist article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 14px 0; }
.typelist h2 { margin-top: 0; }
.credits li { margin: 6px 0; font-size: 16px; }
@media (max-width: 520px) { body { font-size: 17px; } .bar { grid-template-columns: 6em 1fr 2.8em; font-size: 15px; } }
@media (prefers-reduced-motion: reduce) { .card { transition: none; } }
