/* wouldyourathers.net — concept: every question is a duel card. Two sides (coral vs. teal) meet at a plum
   "or" coin; after you vote, each side fills up like a glass to its real share of the votes. */
:root {
  --cream: #fff7ec;
  --card: #ffffff;
  --ink: #241638;
  --ink-2: #4a3d5e;
  --muted: #74678a;
  --line: #ecdfcc;
  --a: #ff5c7a; --a-deep: #c9304f; --a-tint: #ffe4ea; --a-fill: #ffb3c1;
  --b: #12b5a6; --b-deep: #0a7b70; --b-tint: #d9f4f0; --b-fill: #8fe0d6;
  --lilac: #b9a8ff; --lilac-tint: #eee9ff;
  --display: 'Bricolage Grotesque', 'Avenir Next', 'Segoe UI', sans-serif;
  --body: 'Lexend', 'Avenir Next', 'Segoe UI', Roboto, sans-serif;
  --fat: 'Bagel Fat One', 'Arial Rounded MT Bold', 'Avenir Next', sans-serif;
  --r: 18px;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 76px; }
body { margin: 0; font-family: var(--body); font-size: 17px; line-height: 1.6; color: var(--ink); background: var(--cream); }
a { color: var(--a-deep); text-underline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-left)); }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.08; letter-spacing: -.01em; text-wrap: balance; margin: 0 0 .4em; }
h1 { font-size: clamp(2.1rem, 5.4vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.05rem); }
h3 { font-size: 1.2rem; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 10px; z-index: 50; }

/* header */
.top { position: sticky; top: 0; z-index: 20; background: var(--cream); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 18px; min-height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.mark { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; display: flex; transform: rotate(-18deg); box-shadow: 0 0 0 3px var(--ink); }
.mark i { flex: 1; } .mark i:first-child { background: var(--a); } .mark i:last-child { background: var(--b); }
.word { font-family: var(--fat); font-size: 1.28rem; line-height: 1; letter-spacing: .01em; }
.word b { font-weight: 400; color: var(--a-deep); }
.nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { white-space: nowrap; text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: .93rem; padding: 7px 11px; border-radius: 999px; }
.nav a:hover { background: var(--lilac-tint); color: var(--ink); }
.nav a.play { background: var(--ink); color: #fff; }
.nav a.play:hover { background: var(--a-deep); }
@media (max-width: 760px) {
  .top-in { flex-wrap: wrap; gap: 0 12px; padding: 10px 0 8px; min-height: 0; }
  h1 { font-size: 2rem; }
  .nav { margin: 4px -16px 0; padding: 0 16px; width: calc(100% + 32px); }
  .nav a { font-size: .86rem; padding: 5px 10px; background: var(--card); border: 1px solid var(--line); margin-right: 2px; }
}

/* hero */
.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 34px; align-items: center; padding: 34px 0 18px; }
.crumb { margin: 0 0 6px; font-size: .88rem; color: var(--muted); }
.crumb a { color: var(--muted); }
.intro { margin: 0 0 .7em; color: var(--ink-2); max-width: 58ch; }
.meta { display: inline-block; margin: .4em 0 0; padding: 6px 14px; border-radius: 999px; background: var(--lilac-tint); font-size: .9rem; color: var(--ink-2); }
.meta b { font-family: var(--fat); font-weight: 400; color: var(--ink); }
.hero-img { margin: 0; border-radius: 22px; overflow: hidden; border: 3px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); background: var(--lilac-tint); aspect-ratio: 16 / 9; }
.hero-img img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 14px; padding: 18px 0 8px; }
  .hero-img { display: none; }
  .intro + .intro { display: none; }
  .intro { font-size: .96rem; }
}

/* section jump links */
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 8px; }
.toc a { text-decoration: none; font-size: .86rem; font-weight: 500; color: var(--ink-2); background: var(--card); border: 1.5px solid var(--line); padding: 5px 12px; border-radius: 999px; }
.toc a:hover { border-color: var(--ink); color: var(--ink); }
@media (max-width: 760px) { .toc { flex-wrap: nowrap; overflow-x: auto; margin: 6px -16px; padding: 2px 16px 6px; scrollbar-width: none; } .toc a { white-space: nowrap; } }

/* sections + duel cards */
.sec { padding-top: 26px; }
.sec > h2 { margin-bottom: .2em; }
.blurb { margin: 0 0 14px; color: var(--muted); }
.qs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.q { background: var(--card); border: 2px solid var(--ink); border-radius: var(--r); padding: 12px 12px 10px; box-shadow: 4px 4px 0 var(--ink); }
.q .lead { margin: 0 0 8px 2px; font-size: .84rem; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.num { font-family: var(--fat); font-weight: 400; color: var(--ink); background: var(--lilac-tint); border-radius: 8px; padding: 0 7px; font-size: .9rem; line-height: 1.6; }
.duel { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.side { position: relative; overflow: hidden; min-height: 108px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
  font: 500 1rem/1.3 var(--body); color: var(--ink); border: 2px solid transparent; border-radius: 14px; padding: 14px 16px 16px; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, border-color .15s ease, background .2s ease; }
.sa { background: var(--a-tint); } .sb { background: var(--b-tint); }
.side:hover { transform: translateY(-2px); }
.sa:hover { border-color: var(--a); } .sb:hover { border-color: var(--b); }
.side:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.side .txt { position: relative; z-index: 1; }
.side .lvl { position: absolute; left: 0; right: 0; bottom: 0; height: 0; transition: height .7s cubic-bezier(.2, .9, .2, 1); }
.sa .lvl { background: var(--a-fill); } .sb .lvl { background: var(--b-fill); }
.side .res { position: relative; z-index: 1; font-family: var(--fat); font-size: 1.35rem; line-height: 1.1; margin-top: 6px; min-height: 0; }
.side .res:empty { display: none; }
.or { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; width: 38px; height: 38px; border-radius: 50%;
  background: var(--ink); color: #fff; font-family: var(--fat); font-size: .95rem; display: grid; place-items: center; box-shadow: 0 0 0 4px var(--card); pointer-events: none; }
.q.tot .side { min-height: 84px; font-size: 1.12rem; font-weight: 600; }
.done .side { cursor: default; }
.done .side:not(.mine) { opacity: .82; }
.done .side:hover { transform: none; }
.side.mine.sa { border-color: var(--a-deep); } .side.mine.sb { border-color: var(--b-deep); }
.side.mine::after { content: '✓ your pick'; position: relative; order: -1; margin-bottom: 6px; z-index: 1; font-size: .7rem; font-weight: 600; letter-spacing: .02em; padding: 1px 7px; border-radius: 999px; color: #fff; }
.sa.mine::after { background: var(--a-deep); } .sb.mine::after { background: var(--b-deep); }
.pop { animation: pop .35s ease; }
@keyframes pop { 40% { transform: scale(1.04); } }
.tally { margin: 8px 4px 0; font-size: .86rem; color: var(--ink-2); min-height: 0; }
.tally:empty { display: none; }
@media (max-width: 860px) { .qs { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .side { min-height: 96px; padding: 12px 10px 14px; font-size: .95rem; } .q.tot .side { font-size: 1.02rem; } }
@media (prefers-reduced-motion: reduce) { .side, .side .lvl { transition: none; } .pop { animation: none; } }

/* homepage shelves + related tiles */
.shelves { margin: 40px 0 10px; padding: 26px 22px; background: var(--card); border: 2px solid var(--ink); border-radius: 24px; }
.shelf { margin-top: 18px; }
.shelf h3 { font-size: 1.05rem; margin-bottom: 10px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); background: var(--cream); border: 2px solid var(--ink); border-radius: 14px; overflow: hidden; transition: transform .12s ease, box-shadow .12s ease; }
.tile:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }
.tile img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; border-bottom: 2px solid var(--ink); background: var(--lilac-tint); }
.tile span { padding: 9px 12px 11px; display: flex; flex-direction: column; }
.tile b { font-family: var(--display); font-weight: 800; font-size: 1.02rem; line-height: 1.2; }
.tile small { color: var(--muted); font-size: .8rem; }
.tile.play { background: var(--ink); color: #fff; justify-content: center; min-height: 120px; }
.tile.play small { color: #d9d2e6; }

/* end card, how-to, faq, more */
.end { margin: 40px 0 0; padding: 22px 22px 18px; border-radius: 24px; background: var(--ink); color: #fff; }
.end h2 { color: #fff; }
.end .big { font-size: 1.15rem; }
.end h3 { color: var(--a-fill); margin: .6em 0 .2em; font-size: 1.35rem; }
.end a { color: var(--b-fill); }
.howto { margin: 30px 0 0; display: grid; gap: 24px; }
.howto ul { margin: 0; padding-left: 1.2em; }
.howto li { margin: 0 0 .45em; }
.howto li::marker { color: var(--a); }
.aside { color: var(--muted); font-size: .95rem; }
.faq { margin: 30px 0 0; }
.faq details { background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 16px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: .6em 0 0; color: var(--ink-2); }
.more { margin: 36px 0 30px; }
.btn { display: inline-block; text-decoration: none; background: var(--ink); color: #fff; font-weight: 600; padding: 12px 20px; border-radius: 999px; }
.btn:hover { background: var(--a-deep); }

/* sticky progress pill */
.prog { position: fixed; z-index: 30; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
  background: var(--ink); color: #fff; border-radius: 999px; padding: 6px 6px 6px 16px; box-shadow: 0 6px 20px rgba(36, 22, 56, .25); font-size: .86rem; white-space: nowrap; }
.prog[hidden] { display: none; }
.prog-bar { width: 70px; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.prog-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--a), var(--b)); transition: width .4s ease; }
.prog button { font: 600 .84rem var(--body); border: 0; background: #fff; color: var(--ink); border-radius: 999px; padding: 6px 12px; cursor: pointer; }

/* footer */
.foot { margin-top: 40px; padding: 26px 0 80px; border-top: 1px solid var(--line); font-size: .9rem; color: var(--muted); }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.foot-links a { color: var(--ink-2); }
.fine { font-size: .82rem; }

/* plain pages */
.prose { max-width: 720px; padding: 30px 0; }
.prose h2 { margin-top: 1.2em; }

/* the game */
.game-head { padding: 30px 0 4px; max-width: 720px; }
.cats { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 16px; }
.cats button { font: 500 .88rem var(--body); color: var(--ink-2); background: var(--card); border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 13px; cursor: pointer; }
.cats button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
@media (max-width: 760px) { .cats { flex-wrap: nowrap; overflow-x: auto; margin: 4px -16px 12px; padding: 2px 16px 6px; scrollbar-width: none; } .cats button { white-space: nowrap; } }
.stage { max-width: 760px; }
.q.game { padding: 16px 16px 14px; box-shadow: 7px 7px 0 var(--ink); }
.q.game .side { min-height: 190px; font-size: 1.18rem; }
.q.game .side .res { font-size: 1.9rem; }
.game-ctl { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.game-ctl .from { font-size: .85rem; color: var(--muted); margin-right: auto; }
.skip-btn { font: 500 .9rem var(--body); background: none; border: 1.5px solid var(--line); color: var(--ink-2); border-radius: 999px; padding: 9px 16px; cursor: pointer; }
.next-btn { border: 0; cursor: pointer; font: 600 1rem var(--body); opacity: .45; }
.next-btn.ready { opacity: 1; animation: nudge 1.4s ease 2; }
@keyframes nudge { 50% { transform: translateX(4px); } }
.keys { font-size: .8rem; color: var(--muted); }
kbd { font: 600 .78rem var(--body); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 0 5px; background: var(--card); }
@media (max-width: 560px) { .q.game .side { min-height: 150px; font-size: 1.04rem; } .keys { display: none; } }
.guide-img { border-radius: 20px; border: 3px solid var(--ink); margin: 6px 0 18px; aspect-ratio: 16 / 9; object-fit: cover; }
.prose li { margin-bottom: .4em; }
.game-ctl .from, .game-ctl button { white-space: nowrap; }
.next-btn { min-width: 120px; }
.shelves .tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
@media (max-width: 420px) { .tiles { grid-template-columns: 1fr 1fr; } .tile b { font-size: .92rem; } }
