/* Buzzmoji: shared design system (host stage, player app, quiz maker).
   CraftiTool ink + six job colours, Anybody for display, Onest for text. Sticker cards: ink border + offset shadow. */
:root {
  --ink: #1B1446; --ink-2: #3B3466; --muted: #544D78; --paper: #fff; --mist: #F3F1FB; --line: #E4E0F3;
  --blue: #2E3BFF; --pink: #D4136F; --green: #00A27A; --violet: #7B3FF2; --orange: #FF7A1A; --yellow: #FFC21A;
  --c0: #E8344E; --c1: #2E5BFF; --c2: #FFC21A; --c3: #0E9A60; --c4: #8B3FE0; --c5: #FF7A1A;
  --f-display: 'Anybody', 'Arial Narrow', system-ui, sans-serif;
  --f-body: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r: 22px; --sh: 5px 5px 0 var(--ink); --sh-sm: 3px 3px 0 var(--ink);
  --ease-out: cubic-bezier(.16, 1, .3, 1); --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
}
*, *::before, *::after { box-sizing: border-box }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 500 16px/1.5 var(--f-body); color: var(--ink); background: var(--mist); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block }
button, input, select, textarea { font: inherit; color: inherit }
button { cursor: pointer }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px }
[hidden] { display: none !important }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }

/* ── logo ── */
.bz-logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: inherit }
.bz-logo__bee { width: 38px; height: 38px; filter: drop-shadow(0 3px 0 rgba(27, 20, 70, .25)); animation: buzz 3.6s ease-in-out infinite }
.bz-logo__t { font: 900 1.45rem/1 var(--f-display); font-stretch: 118%; letter-spacing: -.02em }
.bz-logo__t b { color: var(--yellow); -webkit-text-stroke: 1.4px var(--ink); paint-order: stroke fill }
@keyframes buzz { 0%, 100% { transform: translate(0, 0) rotate(-4deg) } 25% { transform: translate(2px, -3px) rotate(5deg) } 50% { transform: translate(-1px, -1px) rotate(-2deg) } 75% { transform: translate(1px, -4px) rotate(4deg) } }

/* ── school / company badge ── */
.brandbadge { display: inline-flex; align-items: center; gap: .5em; max-width: 100%; padding: .3em .8em .3em .35em; border-radius: 99px; background: #fff; color: var(--ink); border: 2.5px solid var(--ink); font: 800 .95em/1.15 var(--f-body); box-shadow: var(--sh-sm) }
.brandbadge__logo { height: 2.1em; width: auto; max-width: 7em; object-fit: contain; border-radius: .4em }
.brandbadge__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.brandbadge.big { flex-direction: column; border-radius: 1.2em; padding: .7em 1em; gap: .4em; text-align: center; box-shadow: none }
.brandbadge.big .brandbadge__logo { height: 4.4em; max-width: 12em }
.brandbadge.big .brandbadge__name { white-space: normal; font-size: 1.05em }

/* ── buttons ── */
.btn { --bg: var(--paper); --fg: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 48px; padding: 10px 20px;
  border: 3px solid var(--ink); border-radius: 16px; background: var(--bg); color: var(--fg); font: 800 1rem/1.1 var(--f-display); font-stretch: 112%;
  box-shadow: var(--sh-sm); text-decoration: none; transition: transform 120ms, box-shadow 120ms, background 200ms; user-select: none; -webkit-user-select: none }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink) }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink) }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: var(--sh-sm) }
.btn--yellow { --bg: var(--yellow) }
.btn--ink { --bg: var(--ink); --fg: #fff }
.btn--blue { --bg: var(--blue); --fg: #fff }
.btn--pink { --bg: var(--pink); --fg: #fff }
.btn--green { --bg: var(--green); --fg: #fff }
.btn--ghost { --bg: transparent; box-shadow: none; border-color: currentColor }
.btn--ghost:hover { box-shadow: none; background: rgba(255, 255, 255, .12) }
.btn--big { min-height: 64px; padding: 14px 30px; font-size: 1.35rem; border-radius: 20px; box-shadow: var(--sh) }
.btn--sm { min-height: 38px; padding: 6px 13px; font-size: .9rem; border-radius: 12px; border-width: 2.5px }
.btn .emo { width: 28px; height: 28px }
.btn--big .emo { width: 38px; height: 38px }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; border: 2.5px solid currentColor; background: transparent; color: inherit }
.icon-btn svg { width: 22px; height: 22px }
.icon-btn[aria-pressed="false"] { opacity: .55 }

/* ── cards + fields ── */
.card { background: var(--paper); border: 3px solid var(--ink); border-radius: var(--r); box-shadow: var(--sh); padding: 22px }
.field { display: grid; gap: 6px }
.field > label, .label { font: 800 .8rem/1.2 var(--f-display); font-stretch: 112%; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2) }
.input, .select, .textarea { width: 100%; min-height: 48px; padding: 11px 14px; border: 2.5px solid var(--ink); border-radius: 14px; background: #fff; font-weight: 600 }
.input:focus, .select:focus, .textarea:focus { outline: none; box-shadow: 0 0 0 4px rgba(46, 59, 255, .25); border-color: var(--blue) }
.textarea { resize: vertical; min-height: 96px; line-height: 1.4 }
.hint { font-size: .85rem; color: var(--muted) }
.err { color: #B4002C; font-weight: 700; font-size: .92rem; min-height: 1.2em }

/* toggle */
.tog { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; user-select: none }
.tog input { position: absolute; opacity: 0; pointer-events: none }
.tog__sw { flex: 0 0 auto; width: 50px; height: 30px; border-radius: 99px; border: 2.5px solid var(--ink); background: var(--line); position: relative; transition: background 200ms; margin-top: 1px }
.tog__sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 21px; height: 21px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); transition: transform 260ms var(--ease-spring) }
.tog input:checked + .tog__sw { background: var(--green) }
.tog input:checked + .tog__sw::after { transform: translateX(20px) }
.tog input:focus-visible + .tog__sw { outline: 3px solid var(--blue); outline-offset: 2px }
.tog__t { display: grid; gap: 1px }
.tog__t b { font-weight: 800 }
.tog__t small { color: var(--muted); font-size: .85rem; line-height: 1.35 }

/* segmented */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 2.5px solid var(--ink); border-radius: 14px; background: var(--mist) }
.seg button { border: 0; background: transparent; padding: 8px 12px; border-radius: 10px; font-weight: 800; min-height: 38px }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 99px; border: 2px solid var(--ink); background: #fff; font: 800 .82rem/1.3 var(--f-display); font-stretch: 112% }
.chip .emo { width: 20px; height: 20px }
.chip--yellow { background: var(--yellow) }
.chip--pink { background: var(--pink); color: #fff }
.chip--ink { background: var(--ink); color: #fff }

/* avatars */
.ava { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 0 rgba(27, 20, 70, .22)) }
.emo { display: inline-block; width: 1.2em; height: 1.2em; object-fit: contain; vertical-align: -0.2em }
.emo--text { font-size: 1em; line-height: 1; width: auto; height: auto; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif }

/* answer tiles */
.tile { --c: var(--c0); --on: #fff; position: relative; display: flex; align-items: center; gap: 14px; min-height: 84px; padding: 12px 18px 12px 12px; border-radius: 20px;
  border: 3px solid var(--ink); background: var(--c); color: var(--on); box-shadow: var(--sh-sm); font: 800 1.2rem/1.2 var(--f-body); text-align: left; overflow: hidden; transition: transform 160ms, box-shadow 160ms, opacity 300ms, filter 300ms }
.tile__ic { flex: 0 0 auto; width: 58px; height: 58px; display: grid; place-items: center; border-radius: 16px; background: rgba(255, 255, 255, .92); border: 2.5px solid var(--ink) }
.tile__ic img { width: 46px; height: 46px; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .18)) }
.tile__t { flex: 1; min-width: 0; overflow-wrap: anywhere }
.tile[data-i="0"] { --c: var(--c0) } .tile[data-i="1"] { --c: var(--c1) } .tile[data-i="2"] { --c: var(--c2); --on: var(--ink) }
.tile[data-i="3"] { --c: var(--c3) } .tile[data-i="4"] { --c: var(--c4) } .tile[data-i="5"] { --c: var(--c5); --on: var(--ink) }

/* toast */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 140%); z-index: 90; max-width: min(560px, 92vw); padding: 13px 20px; border-radius: 16px;
  background: var(--ink); color: #fff; font-weight: 700; border: 2.5px solid #fff; box-shadow: 0 10px 40px rgba(0, 0, 0, .3); transition: transform 380ms var(--ease-spring); text-align: center }
.toast.on { transform: translate(-50%, 0) }
.toast.bad { background: #B4002C }

/* modal */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(15, 10, 45, .55) }
.modal__box { width: min(760px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: #fff; color: var(--ink); border: 3px solid var(--ink); border-radius: 26px; box-shadow: 8px 8px 0 var(--ink); padding: 24px; animation: pop 360ms var(--ease-spring) }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px }
.modal__head h2 { margin: 0; font: 900 1.5rem/1.15 var(--f-display); font-stretch: 112% }
@keyframes pop { from { transform: scale(.86); opacity: 0 } to { transform: scale(1); opacity: 1 } }

/* bursts (reactions, emoji rain) */
.fxlayer { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden }
.burst { position: absolute; bottom: -80px; width: 64px; height: 64px; animation: rise var(--d, 3s) cubic-bezier(.2, .7, .3, 1) forwards; font-size: 52px }
.burst--big { width: 96px; height: 96px; font-size: 80px }
@keyframes rise { 0% { transform: translate(0, 0) scale(.6); opacity: 0 } 12% { opacity: 1; transform: translate(calc(var(--dx) * .15), -12vh) scale(1.05) } 100% { transform: translate(var(--dx), -105vh) scale(.9) rotate(16deg); opacity: 0 } }
canvas.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 70 }

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