/* How well do you know me? — group quiz. December family: cream play screens,
   ink leaderboard, Keepsake red, gold for winners. */
:root {
  --ink: #071013; --ink-2: #15181f; --ink-3: #1d2029;
  --cream: #f3ede4; --paper: #fffaf4; --line: #d9d0c4;
  --red: #d70913; --red-d: #7d0a11; --red-bright: #e3141d; --gold: #c9a84c; --good: #2f9e6a;
  --muted: #6b6560;
  --sans: "Cabin", system-ui, sans-serif; --serif: "Mynerve", cursive; --mono: "Ubuntu", system-ui, sans-serif;
  --ease: cubic-bezier(.2,.7,.2,1); --spring: cubic-bezier(.34,1.56,.64,1);
}
* { box-sizing: border-box; min-width: 0; }
html, body { margin: 0; overflow-x: hidden; max-width: 100%; }
@supports (overflow: clip) { html, body { overflow-x: clip; } }
body { min-height: 100vh; min-height: 100dvh; background: var(--cream); color: var(--ink); font: 17px/1.45 var(--sans); -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body.is-dark { background: var(--ink); color: var(--cream); }
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
a { color: inherit; }

.screen { min-height: 100vh; min-height: 100dvh; width: 100%; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; position: relative;
  padding: max(14px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); }
.screen--center { justify-content: center; text-align: center; align-items: center; gap: 14px; }
.top { display: flex; justify-content: space-between; align-items: center; min-height: 44px; }
.logo { font-weight: 800; font-size: 18px; letter-spacing: -.02em; text-decoration: none; }
.mono { margin: 0; font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; opacity: .75; }
.serif { font-family: var(--serif); font-style: normal; font-weight: 400; letter-spacing: 0; }
.big { margin: 0; font-weight: 800; font-size: clamp(38px, 11.5vw, 60px); line-height: .94; letter-spacing: -.035em; }
.big .serif { color: var(--red); }
.is-dark .big .serif { color: var(--gold); }
.sub { margin: 10px 0 0; font-size: 18px; color: var(--muted); }
.is-dark .sub { color: #c9c1b6; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; padding: 0 24px; border: 0; border-radius: 15px; background: var(--red); color: #fff7f2; font-weight: 800; font-size: 18px; text-decoration: none; cursor: pointer; box-shadow: 0 4px 0 var(--red-d); transition: transform .1s, box-shadow .1s, opacity .2s; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--red-d); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn--ink { background: var(--ink); color: var(--cream); box-shadow: 0 4px 0 #000; }
.is-dark .btn--ink { background: var(--cream); color: var(--ink); box-shadow: 0 4px 0 #8f877b; }
.btn--wide { width: 100%; }
.btn:focus-visible, .chip:focus-visible, .opt:focus-visible, .linkbtn:focus-visible, .qcard button:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.linkbtn { min-height: 44px; padding: 0 6px; border: 0; background: none; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; opacity: .85; }
.ico { width: 20px; height: 20px; flex: none; }

.field { display: grid; gap: 7px; font-weight: 700; font-size: 15px; }
.field em { font-style: normal; font-weight: 500; color: var(--muted); }
.field input { min-height: 52px; padding: 0 14px; border: 2px solid var(--ink); border-radius: 14px; background: #fff; font-size: 17px; outline: 0; }
.field input:focus { box-shadow: 4px 4px 0 var(--red); }
.field input.is-right { border-color: var(--good); box-shadow: inset 6px 0 0 var(--good); }
.err { min-height: 1.3em; margin: 0; color: var(--red); font-weight: 700; }
.is-dark .err { color: #ff8a8f; }
.fine { margin: 8px 0 0; font-size: 13px; color: var(--muted); text-align: center; }
.stack { display: grid; gap: 10px; width: 100%; }
.form { display: grid; gap: 14px; margin-top: 22px; }

/* Hero cards on the create intro */
.peek { position: relative; height: 220px; margin: 20px 0 4px; }
.peek__card { position: absolute; border-radius: 18px; padding: 14px; box-shadow: 0 20px 34px -20px rgba(0,0,0,.5); }
.peek__q { left: 0; right: 14%; top: 0; background: #fff; border: 2px solid var(--ink); transform: rotate(-2deg); }
.peek__q b { display: block; font-size: 20px; line-height: 1.1; letter-spacing: -.01em; }
.peek__q span { display: inline-block; margin-top: 10px; padding: 6px 10px; border-radius: 10px; background: var(--good); color: #fff; font-weight: 700; font-size: 14px; }
.peek__score { right: 0; top: 104px; width: 46%; background: var(--ink); color: var(--cream); transform: rotate(3deg); text-align: center; animation: bob 4s ease-in-out infinite; }
.peek__score b { display: block; font-size: 44px; line-height: 1; letter-spacing: -.03em; color: var(--gold); }
.peek__score small { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(1deg); } }
.how { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; counter-reset: s; }
.how li { display: flex; gap: 12px; align-items: baseline; }
.how li::before { counter-increment: s; content: counter(s); flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--cream); font-family: var(--mono); font-size: 12px; transform: translateY(3px); }

/* Builder */
.progress { display: flex; justify-content: space-between; align-items: baseline; margin-top: 16px; }
.progress b { font-size: 34px; letter-spacing: -.03em; }
.bar { height: 6px; border-radius: 3px; background: rgba(11,13,18,.1); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--red); transition: width .4s var(--ease); }
.bank { margin-top: 18px; }
.bank__tabs, .chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -20px; padding: 2px 20px 6px; scrollbar-width: none; }
.bank__tabs::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 40px; padding: 0 14px; border: 1.5px solid var(--ink); border-radius: 999px; background: transparent; font-size: 15px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--cream); }
.bank__list { display: grid; gap: 8px; margin-top: 10px; }
.bank__item { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 10px 14px; border: 1.5px dashed rgba(11,13,18,.35); border-radius: 14px; background: transparent; text-align: left; font-weight: 600; cursor: pointer; }
.bank__item svg { flex: none; }
.bank__item[disabled] { opacity: .4; cursor: default; }
.qlist { display: grid; gap: 10px; margin-top: 16px; }
.qcard { padding: 14px; border-radius: 16px; background: #fff; border: 2px solid var(--ink); }
.qcard__top { display: flex; justify-content: space-between; gap: 10px; }
.qcard__n { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.qcard b { display: block; margin-top: 4px; font-size: 18px; line-height: 1.15; }
.qcard__opts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.qcard__opts span { padding: 4px 10px; border-radius: 999px; background: rgba(11,13,18,.07); font-size: 13px; font-weight: 600; }
.qcard__opts span.is-right { background: var(--good); color: #fff; }
.qcard__tools { display: flex; gap: 4px; }
.qcard__tools button { width: 40px; height: 40px; border: 0; border-radius: 10px; background: rgba(11,13,18,.06); display: grid; place-items: center; cursor: pointer; }
.sticky { position: sticky; bottom: 0; z-index: 4; margin: 18px -20px 0; padding: 14px 20px max(14px, env(safe-area-inset-bottom)); background: linear-gradient(to bottom, rgba(243,237,228,0), var(--cream) 30%); }
.is-dark .sticky { background: linear-gradient(to bottom, rgba(11,13,18,0), var(--ink) 30%); }

/* Question editor */
.decoys { display: grid; gap: 8px; }

/* ── Play ── */
.qhead { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.streak { display: flex; align-items: center; gap: 4px; font-weight: 800; font-size: 15px; color: var(--red); min-height: 24px; }
.streak.is-zero { color: var(--muted); }
.ring { width: 58px; height: 58px; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 18px; font-variant-numeric: tabular-nums; }
.ring.is-low b { color: var(--red); }
.qtext { margin: 16px 0 0; font-size: clamp(26px, 7.6vw, 34px); line-height: 1.06; font-weight: 800; letter-spacing: -.02em; }
.opts { display: grid; gap: 10px; margin-top: 18px; perspective: 900px; }
.opt { position: relative; min-height: 58px; border: 0; padding: 0; background: none; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.3,.7,.2,1), opacity .3s; cursor: pointer; }
.opt .f, .opt .b { position: absolute; inset: 0; display: flex; align-items: center; gap: 12px; padding: 0 14px; border-radius: 15px; backface-visibility: hidden; -webkit-backface-visibility: hidden; font-weight: 700; font-size: 17px; text-align: left; line-height: 1.15; }
.opt .f { background: #fff; border: 2px solid var(--ink); }
.opt .b { transform: rotateY(180deg); color: #fff; justify-content: space-between; }
.opt .b small { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; white-space: nowrap; }
.opt.flip { transform: rotateY(180deg); }
.opt.right .b { background: var(--good); } .opt.wrong .b { background: var(--red); }
.opt.dim { opacity: .42; }
.opt .letter { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--ink); color: #fff; font-family: var(--mono); font-size: 12px; flex: none; }
.opt:disabled { cursor: default; }
.timeout { margin: 12px 0 0; font-weight: 800; color: var(--red); }
.stat { margin-top: 16px; padding: 14px; border-radius: 16px; background: var(--ink); color: var(--cream); font-size: 15px; opacity: 0; transform: translateY(10px); transition: opacity .4s .45s, transform .4s .45s; }
.stat.show { opacity: 1; transform: none; }
.stat b { color: var(--gold); }
.dist { display: grid; gap: 6px; margin-top: 10px; }
.dist div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) 26px; gap: 8px; align-items: center; font-family: var(--mono); font-size: 12px; }
.dist span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dist i { display: block; height: 8px; border-radius: 4px; background: #3a3631; width: 0; transition: width .7s .7s var(--ease); }
.dist i.c { background: var(--good); }
.dist span:last-child { text-align: right; }

/* Result */
.result__score { font-size: clamp(84px, 30vw, 132px); font-weight: 800; line-height: .85; letter-spacing: -.05em; color: var(--gold); }
.result__score small { font-size: .4em; color: var(--cream); opacity: .7; letter-spacing: -.02em; }
.badge { display: inline-flex; padding: 8px 16px; border-radius: 999px; background: var(--red); color: #fff7f2; font-weight: 800; font-size: 18px; }

/* ── Leaderboard ── */
.live { display: inline-flex; align-items: center; gap: 6px; color: var(--gold); opacity: 1; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--red-bright); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 8px; margin-top: 16px; min-height: 190px; }
.pod { display: grid; justify-items: center; gap: 4px; text-align: center; }
.pod b { font-size: 15px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pod small { font-family: var(--mono); font-size: 12px; color: #bdb5ab; }
.pod.is-empty { opacity: .3; }
.av { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 16px; color: var(--ink); flex: none; }
.block { width: 100%; border-radius: 12px 12px 0 0; display: grid; place-items: start center; padding-top: 8px; font-weight: 800; font-size: 22px; color: var(--ink); height: 0; transition: height .9s var(--spring); overflow: hidden; }
.rows { display: grid; gap: 6px; margin-top: 10px; }
.row { display: grid; grid-template-columns: 24px 32px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 14px; background: var(--ink-2); font-size: 15px; }
.row .n { font-family: var(--mono); font-size: 12px; color: #9a948c; text-align: center; }
.row .av { width: 32px; height: 32px; font-size: 13px; }
.row b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row em { display: block; font-style: normal; font-size: 12px; color: #bdb5ab; }
.row .s { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.row .s small { display: block; font-family: var(--mono); font-weight: 400; font-size: 11px; color: #9a948c; }
.row .x { width: 34px; height: 34px; border: 0; border-radius: 10px; background: rgba(255,255,255,.06); color: #c9c1b6; display: grid; place-items: center; cursor: pointer; }
.row.is-you { box-shadow: 0 0 0 2px var(--gold); }
.row.is-new { animation: glow 2.4s ease-out; }
@keyframes glow { 0% { box-shadow: 0 0 0 2px var(--gold); background: #2a2516; } 100% { box-shadow: 0 0 0 0 transparent; } }
.you { position: sticky; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 3; margin-top: 12px; display: grid; grid-template-columns: 24px 32px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px; border-radius: 14px; background: var(--cream); color: var(--ink); font-size: 15px; box-shadow: 0 10px 30px -10px #000; }
.you .n { font-family: var(--mono); font-size: 12px; text-align: center; }
.you .av { width: 32px; height: 32px; font-size: 13px; background: #fff; box-shadow: 0 0 0 2px var(--ink); }
.you em { display: block; font-style: normal; font-size: 12px; color: var(--muted); }
.you .s { font-weight: 800; text-align: right; }
.you .up { display: inline-flex; align-items: center; gap: 2px; color: var(--good); font-size: 12px; }
.missed { margin-top: 12px; padding: 12px 14px; border-radius: 14px; border: 1px dashed rgba(243,237,228,.3); font-size: 15px; color: #d7d0c6; }
.missed b { color: var(--gold); }
.empty { margin-top: 18px; padding: 22px 16px; border-radius: 16px; background: var(--ink-2); text-align: center; color: #c9c1b6; }

/* Owner breakdown */
.breakdown { display: grid; gap: 10px; margin-top: 14px; }
.bq { padding: 14px; border-radius: 16px; background: var(--ink-2); }
.bq b { display: block; font-size: 16px; line-height: 1.2; }
.bq small { font-family: var(--mono); font-size: 11px; color: #9a948c; }
.share-row { display: flex; gap: 8px; align-items: center; padding: 6px 6px 6px 14px; border-radius: 14px; background: var(--ink-2); }
.share-row input { flex: 1; min-width: 0; border: 0; background: transparent; font-family: var(--mono); font-size: 14px; outline: 0; color: var(--cream); }
.share-row button { min-height: 40px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--cream); color: var(--ink); font-weight: 800; cursor: pointer; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row2 .btn { padding: 0 10px; font-size: 16px; }
h2.h { margin: 26px 0 0; font-size: 22px; letter-spacing: -.01em; }

/* petals for the winner */
.petal { position: fixed; top: -24px; z-index: 30; width: 12px; height: 15px; border-radius: 80% 10% 80% 10%; background: linear-gradient(135deg, #ff6b74, #b80f19); pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translate(var(--dx, 40px), 110vh) rotate(var(--rot, 540deg)); } }

/* 9:16 status image */
.shot { position: fixed; left: -10000px; top: 0; width: 450px; height: 800px; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 56px 36px 40px; background: var(--ink); color: var(--cream); }
.shot__foot { display: flex; justify-content: space-between; align-items: flex-end; font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.shot__foot b { font-family: var(--sans); font-size: 18px; letter-spacing: 0; text-transform: none; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } .petal { display: none; } }
