/* ============================================================
   Room Survey: pastel, sticker-style, a little bit silly
   ============================================================ */
:root {
  --bg: #fff7ee; --bg2: #f1eeff; --bg3: #e3f6ee;
  --card: #fffdf8; --ink: #2b2540; --muted: #6a6381; --outline: #2b2540; --shadow: #2b254022;
  --accent: #6d4aff; --accent-ink: #fff; --danger: #d63a4a; --good: #0f8a5f;
  --on-pastel: #2b2540; --p-pink: #ffd6e0; --p-peach: #ffe0c7; --p-lemon: #fff1b0; --p-mint: #c9f4e1; --p-sky: #cde5ff; --p-lilac: #e2d9ff;
  /* chart colours: validated for colour-blind separation (see README) */
  --c0: #4f8cf7; --c1: #f07f3c; --c2: #a15ff0; --c3: #1fb085; --c4: #c99700; --c5: #e8559f;
  --line: #2b254033; --pop: cubic-bezier(.34, 1.56, .64, 1);
  --font-head: "Fredoka", ui-rounded, "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --font-body: "Nunito", ui-rounded, "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1729; --bg2: #231b3b; --bg3: #14232b;
    --card: #262039; --ink: #f4efff; --muted: #b3aacb; --outline: #5d5090; --shadow: #0a0713aa;
    --accent: #9a82ff; --accent-ink: #14102a; --danger: #ff7b8a; --good: #4fd8a5;
    --on-pastel: #f4efff; --p-pink: #5a2c45; --p-peach: #5a3a2a; --p-lemon: #55491f; --p-mint: #1f4a3d; --p-sky: #243f63; --p-lilac: #3b2f6b;
    --c0: #4f8cf7; --c1: #e26a24; --c2: #a15ff0; --c3: #19a57d; --c4: #b88a00; --c5: #e8559f;
    --line: #5d509055;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font: 17px/1.5 var(--font-body); min-height: 100vh; overflow-x: hidden;
  background: radial-gradient(1200px 700px at 10% -10%, var(--bg2), transparent 60%), radial-gradient(900px 600px at 100% 10%, var(--bg3), transparent 55%), var(--bg);
  background-attachment: fixed;
}
.wrap { max-width: 920px; margin: 0 auto; padding: 18px 16px 70px; position: relative; z-index: 1; }
.narrow { max-width: 480px; }
h1, h2, h3, .big, .code, .qtext, .p-q, .p-num, .brand b { font-family: var(--font-head); letter-spacing: .01em; }
h1 { font-size: 32px; line-height: 1.15; margin: 0 0 6px; font-weight: 700; }
h2 { font-size: 23px; margin: 0 0 10px; font-weight: 600; } h3 { font-size: 18px; margin: 0 0 6px; font-weight: 600; }
a { color: var(--accent); font-weight: 700; }
.muted { color: var(--muted); } .small { font-size: 14px; }
::selection { background: var(--p-lemon); color: var(--on-pastel); }

/* ---------- floating background doodles (outside the re-rendered area, so they never restart) ---------- */
.doodles { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.doodles i { position: absolute; font-style: normal; font-size: 26px; opacity: .55; animation: drift 14s ease-in-out infinite; }
.doodles i:nth-child(1) { left: 6%; top: 14%; animation-delay: -2s; } .doodles i:nth-child(2) { left: 90%; top: 22%; animation-delay: -6s; font-size: 32px; }
.doodles i:nth-child(3) { left: 14%; top: 72%; animation-delay: -4s; } .doodles i:nth-child(4) { left: 82%; top: 78%; animation-delay: -9s; font-size: 30px; }
.doodles i:nth-child(5) { left: 48%; top: 6%; animation-delay: -1s; font-size: 20px; } .doodles i:nth-child(6) { left: 3%; top: 44%; animation-delay: -7s; font-size: 22px; }
.doodles i:nth-child(7) { left: 94%; top: 52%; animation-delay: -3s; font-size: 22px; } .doodles i:nth-child(8) { left: 60%; top: 92%; animation-delay: -5s; }
@keyframes drift { 0%, 100% { transform: translate(0, 0) rotate(-8deg); } 25% { transform: translate(14px, -22px) rotate(8deg); } 50% { transform: translate(-10px, -34px) rotate(-4deg); } 75% { transform: translate(-18px, -12px) rotate(10deg); } }

/* ---------- brand bar ---------- */
.brand { max-width: 920px; margin: 0 auto; padding: 14px 16px 0; display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
.brand a { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.brand b { font-size: 22px; font-weight: 700; }
.brand b em { font-style: normal; background: linear-gradient(transparent 62%, var(--p-pink) 62%); padding: 0 3px; }
.brand .mascot { width: 40px; height: 40px; }
body.present .brand { display: none; }

/* ---------- mascot "Bloop" ---------- */
.mascot { width: 96px; height: 96px; color: var(--outline); overflow: visible; }
.mascot .m-body { fill: var(--p-pink); } .mascot .m-cheek { fill: #ff9fb6; opacity: .75; } .mascot .m-leaf { fill: var(--p-mint); }
.mascot .m-all { transform-origin: 60px 100px; animation: bloop 2.6s ease-in-out infinite; }
.mascot .m-eye { transform-origin: center; transform-box: fill-box; animation: blink 4.2s infinite; fill: currentColor; }
.mascot .m-arm { transform-origin: 20px 70px; transform-box: view-box; animation: wave 1.6s ease-in-out infinite; }
.mascot .m-arm2 { transform-origin: 100px 70px; animation-delay: -.8s; }
.mascot.happy .m-all { animation: hop 0.9s var(--pop) infinite; }
@keyframes bloop { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.04, .95); } }
@keyframes hop { 0%, 100% { transform: translateY(0) scale(1.05, .94); } 40% { transform: translateY(-14px) scale(.96, 1.06); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes wave { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-18deg); } }

/* ---------- cards (sticker look) ---------- */
.card {
  background: var(--card); border: 2.5px solid var(--outline); border-radius: 24px; padding: 18px 20px; margin: 16px 0;
  box-shadow: 5px 6px 0 var(--sh, var(--p-lilac)); position: relative;
}
#app > .card:nth-of-type(5n+1), .card:nth-of-type(5n+1) { --sh: var(--p-lilac); }
.card:nth-of-type(5n+2) { --sh: var(--p-mint); } .card:nth-of-type(5n+3) { --sh: var(--p-peach); }
.card:nth-of-type(5n+4) { --sh: var(--p-sky); } .card:nth-of-type(5n+5) { --sh: var(--p-pink); }
a.card { transition: transform .25s var(--pop), box-shadow .25s; }
a.card:hover { transform: translate(-2px, -4px) rotate(-.6deg); box-shadow: 8px 10px 0 var(--sh, var(--p-lilac)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .row.between { justify-content: space-between; } .grow { flex: 1; }

/* ---------- forms ---------- */
input, textarea, select {
  width: 100%; font: inherit; color: var(--ink); background: var(--card); border: 2.5px solid var(--outline); border-radius: 16px; padding: 10px 14px;
  transition: box-shadow .2s, transform .2s;
}
input:focus, textarea:focus, select:focus { outline: none; box-shadow: 0 0 0 4px var(--p-lilac), 3px 4px 0 var(--accent); transform: translateY(-1px); }
input[type=checkbox] { accent-color: var(--accent); width: 20px; height: 20px; }
label { display: block; font-size: 14px; font-weight: 800; margin: 14px 0 5px; }
select { cursor: pointer; }

/* ---------- buttons ---------- */
button, .btn {
  font: inherit; font-weight: 800; cursor: pointer; color: var(--ink); background: var(--card); border: 2.5px solid var(--outline); border-radius: 99px;
  padding: 8px 18px; text-decoration: none; display: inline-block; box-shadow: 3px 4px 0 var(--outline);
  transition: transform .18s var(--pop), box-shadow .18s, background .2s;
}
button:hover:not(:disabled), .btn:hover { transform: translate(-1px, -3px) rotate(-1.2deg); box-shadow: 4px 7px 0 var(--outline); background: var(--p-lemon); color: var(--on-pastel); }
button:active:not(:disabled), .btn:active { transform: translate(3px, 4px) scale(.98); box-shadow: 0 0 0 var(--outline); }
button.primary, .btn.primary { background: var(--accent); color: var(--accent-ink); }
button.primary:hover:not(:disabled), .btn.primary:hover { background: var(--accent); filter: brightness(1.1); color: var(--accent-ink); }
button.danger { color: var(--danger); } button.danger.on, button.mic.danger { background: var(--p-pink); }
button:disabled { opacity: .45; cursor: not-allowed; box-shadow: 2px 3px 0 var(--outline); }
button.card { box-shadow: 5px 6px 0 var(--p-lilac); border-radius: 24px; font-weight: 600; }
button.mic { min-width: 48px; font-size: 18px; padding: 6px 12px; }
.seg { display: inline-flex; } .seg button { border-radius: 0; padding: 7px 16px; box-shadow: none; margin-left: -2.5px; }
.seg button:first-child { border-radius: 99px 0 0 99px; margin-left: 0; } .seg button:last-child { border-radius: 0 99px 99px 0; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.seg button:hover:not(:disabled) { transform: none; box-shadow: none; }

/* ---------- pills, status ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; padding: 3px 12px; border-radius: 99px; border: 2px solid var(--outline); background: var(--card); }
.pill.live { background: var(--p-mint); color: var(--ink); }
.pill.live::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 var(--good); animation: ping 1.6s infinite; }
.pill.off { background: var(--p-lemon); color: var(--on-pastel); }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 70%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }
.err { color: var(--danger); min-height: 1.4em; font-weight: 700; }

/* ---------- join code as little tiles ---------- */
.code { display: flex; gap: 8px; flex-wrap: wrap; font-size: 38px; font-weight: 700; line-height: 1; }
.code span { display: inline-grid; place-items: center; width: 1.25em; height: 1.45em; border: 2.5px solid var(--outline); border-radius: 14px; background: var(--p-lemon); color: var(--on-pastel); box-shadow: 3px 4px 0 var(--outline); }
.code span:nth-child(5n+2) { background: var(--p-pink); transform: rotate(-4deg); } .code span:nth-child(5n+3) { background: var(--p-sky); transform: rotate(3deg); }
.code span:nth-child(5n+4) { background: var(--p-mint); transform: rotate(-2deg); } .code span:nth-child(5n+5) { background: var(--p-lilac); transform: rotate(4deg); }
.code span:nth-child(5n+1) { transform: rotate(2deg); }
.code.tiny { font-size: 18px; gap: 4px; } .code.tiny span { border-width: 2px; border-radius: 8px; box-shadow: 2px 2px 0 var(--outline); }

/* ---------- participant ---------- */
.vote-btn { display: block; width: 100%; font-family: var(--font-head); font-size: 24px; font-weight: 600; padding: 22px 12px; margin: 14px 0; border-radius: 22px; box-shadow: 4px 6px 0 var(--outline); }
button.vote-btn:nth-of-type(6n+1) { background: var(--p-sky); color: var(--on-pastel); } button.vote-btn:nth-of-type(6n+2) { background: var(--p-pink); color: var(--on-pastel); }
button.vote-btn:nth-of-type(6n+3) { background: var(--p-mint); color: var(--on-pastel); } button.vote-btn:nth-of-type(6n+4) { background: var(--p-lemon); color: var(--on-pastel); }
button.vote-btn:nth-of-type(6n+5) { background: var(--p-lilac); color: var(--on-pastel); } button.vote-btn:nth-of-type(6n+6) { background: var(--p-peach); color: var(--on-pastel); }
.vote-btn:hover:not(:disabled) { transform: translate(-2px, -4px) rotate(-1deg) scale(1.02); }
.vote-btn.sel, button.vote-btn.sel { background: var(--accent); color: var(--accent-ink); }
.qtext { font-size: 26px; font-weight: 600; line-height: 1.25; margin: 6px 0 12px; }

/* ---------- results ---------- */
.bar { margin: 14px 0; } .bar .top { display: flex; justify-content: space-between; gap: 10px; font-weight: 800; }
.bar .track { height: 30px; background: var(--bg); border: 2.5px solid var(--outline); border-radius: 99px; overflow: hidden; margin-top: 5px; }
.bar .fill { height: 100%; border-right: 2.5px solid var(--outline); border-radius: 0 99px 99px 0; transition: width .9s var(--pop); min-width: 0; }
.bar .fill[style*="width:0%"], .bar .fill[style*="width: 0%"] { border-right-width: 0; }
.pie-row { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; justify-content: center; }
.pie { width: 230px; height: 230px; border-radius: 50%; border: 3px solid var(--outline); box-shadow: 5px 6px 0 var(--outline); animation: pieIn .8s var(--pop) both; }
@keyframes pieIn { from { transform: scale(.4) rotate(-120deg); opacity: 0; } to { transform: none; opacity: 1; } }
.legend div { margin: 8px 0; font-weight: 800; } .legend i { display: inline-block; width: 16px; height: 16px; border-radius: 6px; border: 2px solid var(--outline); margin-right: 9px; vertical-align: -2px; }
.progress { height: 18px; background: var(--card); border: 2.5px solid var(--outline); border-radius: 99px; overflow: hidden; }
.progress > div {
  height: 100%; border-right: 2.5px solid var(--outline); transition: width .7s var(--pop);
  background: repeating-linear-gradient(-45deg, var(--c3) 0 10px, color-mix(in srgb, var(--c3) 70%, #fff) 10px 20px); background-size: 28px 28px; animation: stripes 1s linear infinite;
}
@keyframes stripes { to { background-position: 28px 0; } }
.big { font-size: 44px; font-weight: 700; line-height: 1.1; }
.qlist button { display: block; width: 100%; text-align: left; margin: 8px 0; font-weight: 600; border-radius: 18px; box-shadow: 2px 3px 0 var(--outline); }
.qlist button.cur { background: var(--p-lilac); color: var(--on-pastel); }
.qlist button.cur .muted { color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } @media (max-width: 700px) { .grid2 { grid-template-columns: 1fr; } }
.qr { width: 170px; height: 170px; background: #fff; border: 2.5px solid var(--outline); border-radius: 18px; padding: 6px; flex: none; box-shadow: 4px 5px 0 var(--p-pink); transform: rotate(2deg); transition: transform .3s var(--pop); }
.qr:hover { transform: rotate(-2deg) scale(1.05); }
.qr svg { display: block; width: 100%; height: 100%; }

/* ---------- landing hero ---------- */
.hero { text-align: center; margin-top: 22px; }
.hero .mascot { width: 150px; height: 150px; }
.hero h1 { font-size: 44px; } .hero h1 em { font-style: normal; display: inline-block; background: linear-gradient(transparent 60%, var(--p-lemon) 60%); transform: rotate(-2deg); padding: 0 6px; }
.hero p { font-size: 18px; margin: 4px 0 18px; }
.ticket { text-align: left; }
.ticket input { font-family: var(--font-head); font-size: 34px; letter-spacing: .3em; text-align: center; text-transform: uppercase; padding: 12px; }
.sparkle { display: inline-block; animation: twinkle 2.4s ease-in-out infinite; } .sparkle:nth-of-type(2) { animation-delay: -1s; }
@keyframes twinkle { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.35) rotate(18deg); } }

/* ---------- entrance (only on first paint of a page, never on live updates) ---------- */
#app.enter > *, #app.enter .card { animation: popin .55s var(--pop) both; }
#app.enter > :nth-child(2) { animation-delay: .06s; } #app.enter > :nth-child(3) { animation-delay: .12s; } #app.enter > :nth-child(4) { animation-delay: .18s; }
#app.enter > :nth-child(5) { animation-delay: .24s; } #app.enter > :nth-child(6) { animation-delay: .3s; } #app.enter > :nth-child(n+7) { animation-delay: .36s; }
@keyframes popin { from { opacity: 0; transform: translateY(22px) scale(.96) rotate(-.6deg); } to { opacity: 1; transform: none; } }
.wiggle { animation: wiggle 1.2s ease-in-out infinite; } @keyframes wiggle { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(5deg); } }
.bounce { animation: bounce 1.4s var(--pop) infinite; } @keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.pulse-soft { animation: pulseSoft 2s ease-in-out infinite; } @keyframes pulseSoft { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }

/* ---------- confetti ---------- */
#confetti { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 999; }

/* ---------- projector view ---------- */
body.present .wrap { max-width: none; padding: 20px 4vw 100px; }
.p-top { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-head); font-size: 22px; font-weight: 600; color: var(--muted); }
.p-main { max-width: 1400px; margin: 3vh auto 0; }
.p-num { font-size: 26px; font-weight: 600; color: var(--muted); } .p-num span { color: var(--accent); }
.p-q { font-size: clamp(34px, 5.4vw, 88px); font-weight: 700; line-height: 1.12; margin: 10px 0 26px; }
.p-q::after { content: ""; display: block; width: 160px; height: 14px; margin-top: 12px; border-radius: 99px; background: repeating-linear-gradient(90deg, var(--c5) 0 20px, var(--c1) 20px 40px, var(--c4) 40px 60px, var(--c3) 60px 80px, var(--c0) 80px 100px, var(--c2) 100px 120px); }
.p-sub { font-size: 26px; font-weight: 800; margin-top: 8px; }
.p-opts { display: flex; flex-wrap: wrap; gap: 16px; margin: 0 0 28px; }
.p-opts div { font-family: var(--font-head); font-size: clamp(22px, 3vw, 44px); font-weight: 600; background: var(--card); border: 3px solid var(--outline); border-radius: 22px; padding: 10px 28px; box-shadow: 5px 6px 0 var(--sh, var(--p-lilac)); }
.p-opts div:nth-child(6n+1) { --sh: var(--p-sky); } .p-opts div:nth-child(6n+2) { --sh: var(--p-pink); } .p-opts div:nth-child(6n+3) { --sh: var(--p-mint); }
.p-opts div:nth-child(6n+4) { --sh: var(--p-lemon); } .p-opts div:nth-child(6n+5) { --sh: var(--p-peach); }
.p-opts b { color: var(--accent); margin-right: 10px; }
.p-prog .progress { height: 24px; }
.p-chart { font-size: 24px; margin-top: 24px; }
.p-chart .bar .track { height: 52px; } .p-chart .bar .top { font-size: 30px; font-family: var(--font-head); } .p-chart .pie { width: 340px; height: 340px; } .p-chart .legend div { font-size: 28px; }
.p-join { position: fixed; right: 1.6vw; bottom: 1.6vh; display: flex; gap: 10px; align-items: center; background: var(--card); border: 2.5px solid var(--outline); border-radius: 18px; padding: 6px 12px 6px 6px; font-size: 13px; line-height: 1.25; box-shadow: 3px 4px 0 var(--p-lemon); opacity: .95; }
.p-join .qr { width: 78px; height: 78px; } .p-join b { font-size: 15px; } .p-join .code { font-size: 18px; margin-top: 2px; }
.p-join .code span { width: 22px; height: 26px; font-size: 16px; border-width: 2px; border-radius: 7px; box-shadow: 1px 2px 0 var(--outline); }
.p-join .muted { font-size: 12px; }
.p-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.p-chip { display: inline-flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; background: var(--card); border: 2.5px solid var(--outline); border-radius: 99px; padding: 4px 16px; box-shadow: 2px 3px 0 var(--p-mint); }
.p-chip b { font-family: var(--font-head); font-size: 22px; }
.p-chip .mini { width: 90px; height: 10px; background: var(--bg); border: 2px solid var(--outline); border-radius: 99px; overflow: hidden; } .p-chip .mini i { display: block; height: 100%; background: var(--good, #1fb085); transition: width .6s var(--pop); }
.p-main.res .p-q { font-size: clamp(26px, 3.2vw, 52px); margin: 6px 0 12px; } .p-main.res .p-q::after { height: 8px; margin-top: 8px; }
.p-main.res .p-chart { margin-top: 10px; }
.p-main.res .p-chart .bar .track { height: 64px; } .p-main.res .p-chart .bar { margin: 20px 0; } .p-main.res .p-chart .bar .top { font-size: 36px; }
.p-main.res .p-chart .pie { width: min(52vh, 560px); height: min(52vh, 560px); } .p-main.res .p-chart .legend div { font-size: 32px; }
.p-main.res .cloud { font-size: 46px; } .p-main.res .rank-row .track { height: 46px; } .p-main.res .rank-row .top { font-size: 36px; }
.p-main.res .avg { font-size: 110px; }

/* ---------- grouping typed answers ---------- */
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 14px; margin-top: 12px; }
.grp { background: var(--card); border: 2.5px solid var(--outline); border-radius: 18px; padding: 10px 14px; cursor: grab; box-shadow: 3px 4px 0 var(--p-sky); transition: transform .25s var(--pop), box-shadow .2s; }
.grp:nth-child(3n+2) { box-shadow: 3px 4px 0 var(--p-pink); } .grp:nth-child(3n+3) { box-shadow: 3px 4px 0 var(--p-mint); }
.grp:hover { transform: translateY(-3px) rotate(-1deg); } .grp:active { cursor: grabbing; }
.grp.over { background: var(--p-lemon); color: var(--on-pastel); transform: scale(1.06) rotate(1.5deg); box-shadow: 6px 8px 0 var(--accent); }
.grp.dragging { opacity: .45; transform: rotate(4deg); } .grp.hid { opacity: .5; border-style: dashed; }
.glabel { font-size: 19px; word-break: break-word; font-family: var(--font-head); font-weight: 600; } .gcount { font-family: var(--font-head); font-size: 26px; font-weight: 700; color: var(--accent); }
.gmem { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { font-size: 13px; font-weight: 700; background: var(--p-lilac); color: var(--on-pastel); border: 2px solid var(--outline); border-radius: 99px; padding: 1px 4px 1px 10px; }
.chip button { border: 0; background: none; padding: 0 6px; font-size: 12px; box-shadow: none; color: var(--on-pastel); } .chip button:hover:not(:disabled) { transform: none; box-shadow: none; background: none; color: var(--danger); }
.grp select, .grp .row button { font-size: 13px; padding: 4px 10px; width: auto; box-shadow: 2px 2px 0 var(--outline); }
.grp select { box-shadow: none; border-radius: 99px; }
.sugs { background: var(--p-lemon); color: var(--on-pastel); border: 2.5px solid var(--outline); border-radius: 18px; padding: 10px 16px; margin: 6px 0 12px; box-shadow: 3px 4px 0 var(--outline); }
.sug { margin: 8px 0; } .sug button { font-size: 13px; padding: 3px 12px; margin-left: 6px; background: var(--card); }

@media (max-width: 520px) { h1 { font-size: 27px; } .hero h1 { font-size: 36px; } .code { font-size: 32px; } .big { font-size: 38px; } .card { padding: 16px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .doodles { display: none; }
}

/* who is logged in (host pages) */
.brand .who { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.brand .who .btn, .brand .who button { font-size: 13px; padding: 4px 12px; box-shadow: 2px 3px 0 var(--outline); }
code { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--p-lilac); color: var(--on-pastel); padding: 1px 6px; border-radius: 6px; font-size: .9em; }

/* ---------- more question types ---------- */
.typegrid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.typegrid button { padding: 8px 14px; font-size: 15px; }
.typegrid button.on { background: var(--accent); color: var(--accent-ink); }
.cloud { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 16px; padding: 14px 6px; line-height: 1.15; font-family: var(--font-head); font-weight: 600; }
.cloud span { display: inline-block; transform: rotate(var(--tilt, 0deg)); animation: cloudPop .7s var(--pop) both; }
@keyframes cloudPop { from { opacity: 0; transform: scale(.3) rotate(var(--tilt, 0deg)); } to { opacity: 1; transform: scale(1) rotate(var(--tilt, 0deg)); } }
.avg { font-family: var(--font-head); font-size: 44px; font-weight: 700; line-height: 1.1; margin: 4px 0 6px; }
.avg small { font-size: 14px; font-weight: 600; color: var(--muted); font-family: var(--font-body, inherit); }
.correct { margin: 12px 0 0; font-size: 18px; }
.rank-row, .lb-row { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.rank-row .top { display: flex; justify-content: space-between; gap: 10px; font-weight: 800; }
.rank-row .track { height: 22px; background: var(--bg); border: 2.5px solid var(--outline); border-radius: 99px; overflow: hidden; margin-top: 4px; }
.rank-row .fill { height: 100%; border-right: 2.5px solid var(--outline); border-radius: 0 99px 99px 0; transition: width .9s var(--pop); }
.medal { width: 34px; text-align: center; font-size: 26px; font-family: var(--font-head); font-weight: 700; }
.lb-row { background: var(--bg); border: 2.5px solid var(--outline); border-radius: 16px; padding: 6px 14px; font-size: 18px; }
.rate-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 14px 0 6px; }
.rate-row button { width: 56px; height: 56px; border-radius: 50%; padding: 0; font-family: var(--font-head); font-size: 24px; font-weight: 700; background: var(--p-lemon); color: var(--on-pastel); box-shadow: 3px 4px 0 var(--outline); }
.rate-ends { display: flex; justify-content: space-between; gap: 10px; font-weight: 700; font-size: 14px; }
.rank-pick { display: flex; align-items: center; gap: 10px; background: var(--card); border: 3px solid var(--outline); border-radius: 18px; padding: 8px 10px; margin: 10px 0; box-shadow: 3px 4px 0 var(--sh, var(--p-lilac)); font-size: 19px; font-weight: 800; }
.rank-pick .n { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-family: var(--font-head); }
.rank-pick button { padding: 6px 12px; font-size: 18px; }
.qa-item { display: flex; align-items: flex-start; gap: 12px; background: var(--card); border: 3px solid var(--outline); border-radius: 18px; padding: 10px 12px; margin: 10px 0; }
.qa-item.done { opacity: .55; }
.qa-item .up { flex: none; min-width: 58px; padding: 6px 8px; border-radius: 16px; line-height: 1.1; text-align: center; font-weight: 800; }
.qa-item .up.on { background: var(--accent); color: var(--accent-ink); }
.qa-item .qt { flex: 1; font-size: 18px; font-weight: 700; word-break: break-word; }
.qa-item .tools { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.present .cloud { font-size: 34px; } .present .avg { font-size: 80px; } .present .rank-row .top, .present .lb-row { font-size: 30px; }
.present .rank-row .track { height: 40px; } .present .qa-item .qt { font-size: 32px; } .present .qa-item .up { font-size: 26px; }
@media (prefers-reduced-motion: reduce) { .cloud span { animation: none; } }

/* ---------- word cloud picture and its design picker ---------- */
canvas.cloudcv { display: block; max-width: 100%; max-height: 70vh; width: auto; height: auto; margin: 6px auto 0; border: 3px solid var(--outline); border-radius: 22px; box-shadow: 5px 6px 0 var(--p-lilac); }
.p-main.res canvas.cloudcv { max-height: 66vh; }
.cstyles { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 4px; }
.cs { display: flex; align-items: center; gap: 8px; padding: 5px 14px 5px 5px; font-size: 14px; }
.cs i { width: 44px; height: 32px; border-radius: 12px; border: 2px solid var(--outline); display: grid; place-items: center; font-style: normal; }
.cs i b { font-size: 17px; line-height: 1; }
.cs.on { background: var(--accent); color: var(--accent-ink); }
