/* Quiz Night — shared base: fonts, tokens, buttons, utilities */
@font-face { font-family: 'Bungee'; font-style: normal; font-display: swap; font-weight: 400; src: url(../fonts/bungee-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Bungee'; font-style: normal; font-display: swap; font-weight: 400; src: url(../fonts/bungee-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Bungee Shade'; font-style: normal; font-display: swap; font-weight: 400; src: url(../fonts/bungee-shade-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Rubik'; font-style: normal; font-display: swap; font-weight: 300 900; src: url(../fonts/rubik-latin-wght-normal.woff2) format('woff2-variations'), url(../fonts/rubik-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Rubik'; font-style: normal; font-display: swap; font-weight: 300 900; src: url(../fonts/rubik-latin-ext-wght-normal.woff2) format('woff2-variations'), url(../fonts/rubik-latin-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #2a1408; --bg2: #5a2410; --ink: #fff6e6; --muted: color-mix(in srgb, var(--ink) 78%, transparent);
  --panel: rgba(40, 18, 6, 0.86); --edge: #ffcf6a;
  --accent: #ffb000; --accent-d: #a35c00; --accent-l: #ffe39a; --on-accent: #2a1408;
  --ray: #ff8a2a; --ray2: #ffc94a;
  --t0: #ff5a36; --t1: #18b6a4; --t2: #ffb000; --t3: #5b8cff;
  --ok: #2fd27a; --bad: #ff3b4e;
  --paper: #fffdf6; --paper-ink: #1d1d25;
  --display: 'Bungee', 'Arial Black', Impact, system-ui, sans-serif;
  --shade: 'Bungee Shade', 'Bungee', 'Arial Black', system-ui, sans-serif;
  --body: 'Rubik', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; font-family: var(--body); color: var(--ink); background: var(--bg); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.1; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus { outline: none; }
:focus-visible { outline: 3px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 6px var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border: 0; border-radius: 14px; cursor: pointer;
  font-family: var(--body); font-weight: 800; font-size: 17px; letter-spacing: 0.01em; text-decoration: none; text-align: center; line-height: 1.15;
  background: rgba(255, 255, 255, 0.1); color: var(--ink);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.22), 0 4px 0 rgba(0, 0, 0, 0.4);
  transition: transform 0.12s, box-shadow 0.12s, background 0.2s, opacity 0.2s, filter 0.2s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.btn:hover { background: rgba(255, 255, 255, 0.16); }
.btn:active { transform: translateY(3px); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.22), 0 1px 0 rgba(0, 0, 0, 0.4); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn-primary {
  background: linear-gradient(180deg, var(--accent-l) -50%, var(--accent) 55%); color: var(--on-accent);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.15), inset 0 2px 0 rgba(255, 255, 255, 0.45), 0 5px 0 var(--accent-d), 0 10px 26px rgba(0, 0, 0, 0.35);
}
.btn-primary:hover { background: linear-gradient(180deg, var(--accent-l) -30%, var(--accent) 60%); filter: brightness(1.05); }
.btn-primary:active { box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.15), 0 1px 0 var(--accent-d); }
.btn-ghost { background: rgba(0, 0, 0, 0.28); }
.btn-big { min-height: 60px; font-size: 21px; padding: 0 30px; border-radius: 18px; }
.btn-small { min-height: 44px; font-size: 15px; padding: 0 14px; }
.btn-glow { animation: glow 2.2s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.15), inset 0 2px 0 rgba(255, 255, 255, 0.45), 0 5px 0 var(--accent-d), 0 0 0 7px color-mix(in srgb, var(--accent) 30%, transparent), 0 10px 34px color-mix(in srgb, var(--accent) 55%, transparent); } }
.row { display: flex; gap: 10px; justify-content: center; align-items: center; }
.row.wrap { flex-wrap: wrap; }

.icon-btn {
  display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 12px; border: 0; cursor: pointer;
  background: rgba(0, 0, 0, 0.35); color: var(--ink); text-decoration: none; font-weight: 800; font-size: 15px;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.2); -webkit-tap-highlight-color: transparent;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn .ic-off { display: none; }
.icon-btn[aria-pressed="false"] .ic-on { display: none; }
.icon-btn[aria-pressed="false"] .ic-off { display: block; }

/* the host (shared) */
.host { position: relative; color: var(--accent); line-height: 0; }
.host-svg { width: 100%; height: auto; display: block; overflow: visible; }
.host .m { display: none; }
.host[data-mouth="smile"] .m-smile, .host[data-mouth="shock"] .m-shock, .host[data-mouth="smug"] .m-smug, .host[data-mouth="sad"] .m-sad { display: inline; }
.host.talking[data-flap="1"] .m { display: none; }
.host.talking[data-flap="1"] .m-open { display: inline; }
.host .eyes { transform-box: fill-box; transform-origin: center; animation: blink 4.6s infinite; }
.host .pupils { transition: transform 0.25s; }
.host[data-mood="shock"] .pupils { transform: scale(0.75); transform-box: fill-box; transform-origin: center; }
.host[data-mood="smug"] .pupils { transform: translateX(3px); }
.host[data-mood="sad"] .pupils { transform: translateY(3px); }
.host .h-body { transform-box: view-box; transform-origin: 50% 96%; animation: idle 2.8s ease-in-out infinite; }
.host .arm-l { transform-box: view-box; transform-origin: 24.5% 49%; animation: wave 3.4s ease-in-out infinite; }
.host .arm-r { transform-box: view-box; transform-origin: 75% 50%; }
.host.talking .arm-r { animation: gesture 0.9s ease-in-out infinite; }
.host.do-jump .h-body { animation: jump 0.7s cubic-bezier(.3, 1.6, .5, 1) 1, idle 2.8s ease-in-out 0.7s infinite; }
.host.do-shake .h-body { animation: hshake 0.5s ease-in-out 1, idle 2.8s ease-in-out 0.5s infinite; }
.host.do-pop { animation: hpop 0.6s cubic-bezier(.3, 1.6, .5, 1) 1; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
@keyframes idle { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-3%) rotate(1.5deg); } }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 70% { transform: rotate(-16deg); } 80% { transform: rotate(10deg); } 90% { transform: rotate(-12deg); } }
@keyframes gesture { 50% { transform: rotate(-9deg); } }
@keyframes jump { 0% { transform: translateY(0) scale(1, 1); } 25% { transform: translateY(2%) scale(1.06, 0.92); } 55% { transform: translateY(-16%) scale(0.95, 1.06); } 100% { transform: translateY(0) scale(1); } }
@keyframes hshake { 20% { transform: translateX(-5%) rotate(-6deg); } 40% { transform: translateX(5%) rotate(6deg); } 60% { transform: translateX(-3%) rotate(-3deg); } 80% { transform: translateX(2%); } }
@keyframes hpop { 0% { transform: scale(0.3) translateY(30%); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

.bubble { position: relative; background: var(--paper); color: var(--paper-ink); border-radius: 18px; padding: 10px 14px; box-shadow: 0 6px 0 rgba(0, 0, 0, 0.25), 0 12px 28px rgba(0, 0, 0, 0.3); }
.bubble p { margin: 0; font-weight: 600; font-size: 15px; line-height: 1.35; min-height: 1.35em; }

.toast { position: fixed; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translateX(-50%); z-index: 90; max-width: min(92vw, 420px); padding: 12px 18px; border-radius: 14px; background: var(--paper); color: var(--paper-ink); font-weight: 700; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); text-align: center; }

.modal { position: fixed; inset: 0; z-index: 85; display: grid; place-items: center; padding: calc(16px + var(--safe-t)) calc(16px + var(--safe-r)) calc(16px + var(--safe-b)) calc(16px + var(--safe-l)); background: rgba(5, 3, 10, 0.72); overflow-y: auto; overscroll-behavior: contain; animation: fadein 0.25s; }
@keyframes fadein { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
