.halloween-quiz-modal{position:fixed;inset:0;z-index:1200;display:grid;place-items:center;padding:22px;background:rgba(12,19,48,.72);backdrop-filter:blur(5px)}.halloween-quiz-modal[hidden]{display:none}.halloween-quiz-panel{position:relative;isolation:isolate;width:min(100%,480px);box-sizing:border-box;padding:34px 32px 30px;border:1px solid rgba(255,183,83,.7);border-radius:24px;background:radial-gradient(circle at top right,#4b2869 0,transparent 42%),linear-gradient(140deg,#171433,#29183f);color:#fff;box-shadow:0 24px 70px rgba(0,0,0,.38);text-align:center;overflow:hidden}.halloween-quiz-panel:before{content:"";position:absolute;z-index:-1;inset:0;background-image:linear-gradient(rgba(20,13,43,.78),rgba(20,13,43,.86)),var(--halloween-quiz-background,none);background-size:cover;background-position:center;opacity:0;transition:opacity .2s}.halloween-quiz-panel.has-custom-background:before{opacity:1}.halloween-quiz-panel:after{content:"";position:absolute;z-index:-1;inset:9px;border:1px dashed rgba(255,203,117,.35);border-radius:18px;pointer-events:none}.halloween-quiz-panel>*{position:relative}.halloween-quiz-panel .halloween-quiz-close{position:absolute;top:13px;right:16px;display:grid;place-items:center;box-sizing:border-box;width:34px;height:34px;min-width:0;min-height:0;margin:0;padding:0;border:0;border-radius:50%;background:transparent;color:#fff;font:400 31px/1 "DM Sans",sans-serif;box-shadow:none;cursor:pointer}.halloween-quiz-panel .halloween-quiz-close:hover{background:rgba(255,255,255,.12)}.halloween-quiz-icons{margin:0 0 11px;font-size:28px;letter-spacing:5px}.halloween-quiz-panel .eyebrow{margin:0 0 7px;color:#ffc65d}.halloween-quiz-panel h2{margin:0;color:#fff;font-family:"Roboto Slab",serif;font-size:clamp(26px,6vw,36px);line-height:1.15}.halloween-quiz-panel>p:not(.eyebrow){margin:15px auto;color:#f0eaf5;line-height:1.55}.halloween-quiz-progress{min-height:19px;margin:15px 0 -8px!important;color:#ffd991!important;font-size:13px;font-weight:700}.halloween-quiz-panel form{display:grid;gap:13px;margin-top:22px;text-align:left}.halloween-quiz-panel label{display:grid;gap:7px;font-weight:700;color:#fff}.halloween-quiz-panel input{width:100%;box-sizing:border-box;padding:13px 14px;border:1px solid #dcb564;border-radius:10px;background:#fff;color:#211638;font:600 16px "DM Sans",sans-serif}.halloween-quiz-panel input:focus-visible,.halloween-quiz-close:focus-visible{outline:3px solid #ffc65d;outline-offset:3px}.halloween-quiz-submit{width:100%;border:0;background:#ed7c30!important;color:#fff!important}.halloween-quiz-submit:hover{filter:brightness(1.08)}.halloween-quiz-submit:disabled{opacity:.72;cursor:not-allowed}.halloween-quiz-status{min-height:24px;margin:14px 0 0!important;font-weight:700}.halloween-quiz-status.success{color:#a8f0b8}.halloween-quiz-status.error{color:#ffd1cc}.halloween-quiz-hint{margin-bottom:0!important;color:#ffd991!important;font-size:13px}@media(max-width:520px){.halloween-quiz-modal{align-items:end;padding:12px}.halloween-quiz-panel{padding:29px 22px 24px;border-radius:22px}.halloween-quiz-icons{font-size:24px}}

/* Floating launcher reuses the website's existing illustrated bat. */
.halloween-quiz-bat {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 132px;
  min-height: 108px;
  padding: 7px 6px;
  border: 0;
  border-radius: 20px;
  background: transparent;
  color: #fff8eb;
  box-shadow: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.halloween-quiz-bat[hidden],.halloween-quiz-panel [hidden] { display: none !important; }
.halloween-quiz-bat__art {
  display: block;
  width: 112px;
  height: 64px;
  filter: drop-shadow(0 3px 3px #0008) drop-shadow(0 0 9px #8ca7ff80);
  animation: halloween-bat-float 3.8s ease-in-out infinite;
  pointer-events: none;
}
.halloween-quiz-bat__art svg { display: block; width: 100%; height: 100%; overflow: visible; }
.halloween-quiz-bat__label {
  display: block;
  padding: 7px 12px;
  border: 1px solid #ffb16b99;
  border-radius: 999px;
  background: #223e92;
  color: #fff8eb;
  box-shadow: 0 3px 12px #0005;
  font: 700 13px/1.3 "DM Sans", Arial, sans-serif;
  white-space: nowrap;
  pointer-events: none;
}
.halloween-quiz-bat:hover .halloween-quiz-bat__label { background: #172b66; border-color: #ffb16b; }
.halloween-quiz-bat:focus-visible { outline: 3px solid #ffb16b; outline-offset: 3px; }
.halloween-quiz-bat[aria-expanded="true"] { visibility: hidden; }
body:has(.profile-modal[aria-hidden="false"],.wheel-modal[aria-hidden="false"]) .halloween-quiz-bat { visibility:hidden; }
@keyframes halloween-bat-float {
  0%,100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-9px) rotate(4deg); }
}
@media (max-width:520px) {
  .halloween-quiz-bat { right:max(10px,env(safe-area-inset-right)); bottom:max(12px,env(safe-area-inset-bottom)); width:119px; min-height:101px; }
  .halloween-quiz-bat__art { width:101px; height:58px; }
  .halloween-quiz-bat__label { padding:7px 10px; font-size:12px; }
}
@media (prefers-reduced-motion:reduce) { .halloween-quiz-bat__art { animation:none; } }

/* Hinge the wings independently; the face stays steady inside the floating bat. */
.halloween-quiz-bat__wing { transform-box:view-box; }
.halloween-quiz-bat__wing--left {
  transform-origin:47px 30px;
  animation:halloween-bat-left-wing .85s ease-in-out infinite;
}
.halloween-quiz-bat__wing--right {
  transform-origin:63px 30px;
  animation:halloween-bat-right-wing .85s ease-in-out infinite;
}
@keyframes halloween-bat-left-wing {
  0%,100% { transform:rotate(12deg) scaleY(.9); }
  50% { transform:rotate(-25deg) scaleY(.72); }
}
@keyframes halloween-bat-right-wing {
  0%,100% { transform:rotate(-12deg) scaleY(.9); }
  50% { transform:rotate(25deg) scaleY(.72); }
}
@media (prefers-reduced-motion:reduce) {
  .halloween-quiz-bat__art,.halloween-quiz-bat__wing { animation:none; }
}

/* One moving group keeps the close control beside the bat at every position. */
.halloween-quiz-flight {
  position:fixed;
  top:0;
  left:0;
  z-index:900;
  width:142px;
  padding:24px 0 0;
  box-sizing:border-box;
  will-change:transform;
}
.halloween-quiz-flight[hidden] { display:none!important; }
.halloween-quiz-flight .halloween-quiz-bat {
  position:relative;
  inset:auto;
  width:100%;
  margin:0;
}
.halloween-quiz-bat-dismiss {
  position:absolute;
  top:0;
  right:0;
  display:grid;
  place-items:center;
  width:36px;
  height:36px;
  min-width:0;
  min-height:0;
  margin:0;
  padding:0;
  border:1px solid #91a9eaaa;
  border-radius:50%;
  background:#0b0f1bef;
  color:#fff8eb;
  box-shadow:0 2px 8px #0005;
  font:400 25px/1 Arial,sans-serif;
  cursor:pointer;
  touch-action:manipulation;
}
.halloween-quiz-bat-dismiss:hover { background:#223e92; border-color:#ffb16b; }
.halloween-quiz-bat-dismiss:focus-visible { outline:3px solid #ffb16b; outline-offset:3px; }
@media (pointer:coarse) {
  .halloween-quiz-flight { padding-top:32px; }
  .halloween-quiz-bat-dismiss { width:44px; height:44px; }
}
@media (max-width:520px) { .halloween-quiz-flight { width:129px; } }
@media (prefers-reduced-motion:reduce) { .halloween-quiz-flight { will-change:auto; } }


/* A held bat pauses its flight and sweats; mouse and touch share pointer capture. */
.halloween-quiz-flight .halloween-quiz-bat { touch-action:none; cursor:grab; user-select:none; -webkit-user-select:none; }
.halloween-quiz-flight.is-held .halloween-quiz-bat { cursor:grabbing; }
.halloween-quiz-flight.is-held .halloween-quiz-bat__art { animation-play-state:paused; }
.halloween-quiz-bat__sweat { display:none; position:absolute; top:5px; left:50%; width:78px; height:58px; transform:translateX(-50%); pointer-events:none; }
.is-held .halloween-quiz-bat__sweat { display:block; }
.halloween-quiz-bat__sweat i { position:absolute; top:5px; width:7px; height:12px; border-radius:65% 35% 65% 35%; background:#75e5ff; box-shadow:0 0 5px #294793,1px 1px 0 #eaffff; animation:halloween-bat-sweat .68s ease-out infinite; }
.halloween-quiz-bat__sweat i:nth-child(1) { left:1px; transform:rotate(30deg); }
.halloween-quiz-bat__sweat i:nth-child(2) { right:0; animation-delay:.2s; }
.halloween-quiz-bat__sweat i:nth-child(3) { right:14px; top:0; animation-delay:.42s; }
@keyframes halloween-bat-sweat { 0% { opacity:0; translate:0 -5px; } 20% { opacity:1; } 100% { opacity:0; translate:6px 31px; } }
.halloween-quiz-panel { max-height:calc(100vh - 44px); max-height:calc(100dvh - 44px); overflow-y:auto; overscroll-behavior:contain; }
.halloween-quiz-panel .halloween-quiz-reveal-note { padding:10px 12px; border:1px solid #ffc65d55; border-radius:10px; background:#15122b88; color:#ffe2a9; font-size:13px; line-height:1.5; }
.halloween-quiz-results { text-align:left; }
.halloween-quiz-results h3 { color:#ffd991; text-align:center; font-size:24px; }
.halloween-quiz-results ol { padding-left:24px; }
.halloween-quiz-results li { margin:14px 0; padding:12px; border:1px solid #ffffff30; border-radius:12px; background:#100b2488; overflow-wrap:anywhere; }
.halloween-quiz-results h4 { margin:0 0 9px; color:#fff; }
.halloween-quiz-results p { margin:7px 0; color:#eee5fa; line-height:1.5; }
.halloween-quiz-results .is-correct strong { color:#a8f0b8; }
.halloween-quiz-results .is-incorrect strong { color:#ffd1cc; }
@media (max-width:520px) { .halloween-quiz-panel { max-height:calc(100dvh - 24px); } }
@media (prefers-reduced-motion:reduce) { .halloween-quiz-bat__sweat i { animation:none; opacity:1; } }
