/* Scoped visual system: ordinary map cards are untouched. */
.halloween-popup,.halloween-dialog,.halloween-counter,.halloween-notice {
  --halloween-bg:#171323; --halloween-surface:#211a31; --halloween-surface-2:#2a213d;
  --halloween-text:#f7f2ff; --halloween-muted:#c7bdd6; --halloween-purple:#b18cff;
  --halloween-orange:#ff9b50; --halloween-border:rgba(155,108,255,.55); --halloween-glow:rgba(155,108,255,.22);
  font-family:inherit; color:var(--halloween-text);
}
.halloween-marker {display:grid;place-items:center;background:none;border:0}
.halloween-sprite {width:24px;height:24px;display:inline-block;image-rendering:pixelated;filter:drop-shadow(0 2px 2px #30204488);animation:halloween-float 3s ease-in-out infinite}
@keyframes halloween-float {50%{transform:translateY(-3px)}}
.halloween-marker:focus-visible {outline:3px solid #b18cff;outline-offset:2px;border-radius:8px}
.halloween-dialog,.halloween-popup .leaflet-popup-content-wrapper,.halloween-notice {
  background:radial-gradient(ellipse at 50% 0,#49326455,transparent 65%),linear-gradient(145deg,var(--halloween-surface),var(--halloween-bg));
  border:1px solid var(--halloween-border);border-radius:20px;
  box-shadow:0 20px 60px #08050e66,0 0 26px var(--halloween-glow),inset 0 1px 0 #e6d7ff0d;
}
.halloween-popup .leaflet-popup-tip {background:var(--halloween-bg);border:1px solid var(--halloween-border)}
.halloween-popup .leaflet-popup-content-wrapper {color:var(--halloween-text)}
.halloween-popup .leaflet-popup-content {margin:22px;min-width:0;width:min(280px,calc(100vw - 76px))!important;max-height:calc(100vh - var(--popup-top-overlay,100px) - 110px);max-height:calc(100dvh - var(--popup-top-overlay,100px) - 110px);overflow-y:auto;scrollbar-color:#76609e #211a31}
.leaflet-container .halloween-popup a.leaflet-popup-close-button {color:var(--halloween-muted);background:var(--halloween-surface-2);border:1px solid #b18cff33}
.leaflet-container .halloween-popup a.leaflet-popup-close-button:hover {color:var(--halloween-text);background:#493264}
.leaflet-container .halloween-popup a.leaflet-popup-close-button:focus-visible {outline:3px solid var(--halloween-orange);outline-offset:2px}
.halloween-card {color:var(--halloween-text);font-size:14px;line-height:1.65}
.halloween-card h2 {font-size:22px;line-height:1.2;font-weight:800;letter-spacing:-.4px;margin:14px 0 12px}
.halloween-card p {color:var(--halloween-muted);margin:0 0 20px}
.halloween-emblem {display:flex;align-items:center;justify-content:center;gap:18px;height:40px;margin-bottom:12px}
.halloween-emblem .halloween-sprite {width:32px;height:32px;filter:drop-shadow(0 0 9px #9b6cff66)}
.halloween-card .halloween-emblem {justify-content:flex-start;margin:-4px 0 12px}
.halloween-emblem::after {content:"";width:4px;height:4px;background:var(--halloween-orange);box-shadow:8px -8px 0 #b18cff66,-4px -16px 0 #b18cff33}
.halloween-eyebrow {display:block;color:var(--halloween-purple);font-size:10px;line-height:1.5;font-weight:800;letter-spacing:1.8px}
.halloween-spirit-number {display:block;color:var(--halloween-orange);font-size:10px;line-height:1.5;font-weight:800;letter-spacing:1.3px;margin-top:5px}
.halloween-card button,.halloween-dialog button,.halloween-counter button {box-sizing:border-box;min-height:44px;padding:12px 16px;border:1px solid var(--halloween-border);border-radius:10px;font-family:inherit;font-size:14px;line-height:1.3;font-weight:750;cursor:pointer;transition:background .15s ease,box-shadow .15s ease}
.halloween-card .halloween-button-primary,.halloween-dialog .halloween-button-primary {background:var(--halloween-orange);color:#211323;border-color:#ffb77f;box-shadow:0 4px 18px #ff8a341c}
.halloween-card .halloween-button-primary:hover,.halloween-dialog .halloween-button-primary:hover {background:#ffb77f;box-shadow:0 4px 22px #ff8a3433}
.halloween-card .halloween-button-primary:active,.halloween-dialog .halloween-button-primary:active {background:#ee8740}
.halloween-dialog .halloween-button-secondary {background:transparent;color:var(--halloween-muted);border-color:#b18cff40}
.halloween-dialog .halloween-button-secondary:hover {background:var(--halloween-surface-2);color:var(--halloween-text)}
.halloween-card button {width:100%}
.halloween-card button:focus-visible,.halloween-dialog button:focus-visible,.halloween-counter button:focus-visible,.halloween-dialog textarea:focus-visible {outline:3px solid var(--halloween-purple);outline-offset:4px}
.halloween-dialog {box-sizing:border-box;width:min(400px,calc(100vw - 32px));max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px);overflow-y:auto;padding:26px;font-size:15px;line-height:1.6;text-align:center;scrollbar-color:#76609e #211a31}
.halloween-dialog[open] {display:flex;flex-direction:column}
.halloween-dialog::backdrop {background:transparent}
/* Viewport siblings avoid Leaflet transforms, clipping and control stacking contexts. */
.halloween-map-shade {position:fixed;inset:0;z-index:6500;background:#100c1bdd;opacity:0;pointer-events:none;transition:opacity .18s ease}
.halloween-popup-viewport {position:fixed;inset:0;z-index:6501;background:transparent;overflow:visible;pointer-events:none}
.halloween-popup-viewport .leaflet-pane {pointer-events:none}
.halloween-popup-viewport .halloween-popup {pointer-events:auto}
.halloween-map-shade[data-active="true"] {opacity:1}
.halloween-dialog .halloween-emblem {order:-5}
.halloween-dialog .halloween-eyebrow {order:-4}
.halloween-dialog .halloween-spirit-number {order:-3}
.halloween-dialog-title {order:-2;margin:10px 0 0;font-size:17px;line-height:1.3;font-weight:750}
.halloween-dialog-capture .halloween-dialog-title {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.halloween-score {order:-1;margin:12px 0 18px;color:var(--halloween-orange);font-size:62px;line-height:1;font-weight:850;letter-spacing:-3px;font-variant-numeric:tabular-nums}
.halloween-score-total {color:var(--halloween-muted);font-size:28px;font-weight:650;letter-spacing:-1px}
.halloween-message {margin:0 0 16px;color:var(--halloween-muted)}
.halloween-dialog-capture .halloween-message:not(.halloween-message-specific) {color:var(--halloween-text);font-weight:600}
.halloween-message-specific {padding:15px 0 0;border-top:1px solid #b18cff33;font-size:14px}
.halloween-dialog button {order:1;width:100%;margin-top:6px}
.halloween-dialog .halloween-button-secondary {order:3;width:auto;min-width:100px;align-self:center}
.halloween-dialog .halloween-debug-reset {order:4;border-style:dashed;font-size:12px;margin-top:12px}
.halloween-share-feedback {order:2;margin:10px 0 0;color:var(--halloween-muted);font-size:13px}
.halloween-share-feedback:empty {display:none}
.halloween-dialog textarea {box-sizing:border-box;width:100%;min-height:110px;margin-top:10px;padding:10px;border:1px solid var(--halloween-border);border-radius:8px;background:var(--halloween-bg);color:var(--halloween-text);font:inherit}
.halloween-dialog-completion {border-color:#bd8e6855}
.halloween-dialog-completion .halloween-dialog-title {font-size:clamp(22px,6vw,28px);letter-spacing:.3px;font-weight:850}
.halloween-dialog-completion .halloween-emblem {height:44px}
.halloween-dialog-completion .halloween-emblem .halloween-sprite:nth-child(2) {width:40px;height:40px}
.halloween-dialog-completion .halloween-emblem .halloween-sprite:nth-child(odd) {animation-delay:-.8s}
.halloween-dialog-completion .halloween-score {padding:18px 12px 16px;margin:16px 0 12px;border:1px solid #ff9b504d;border-radius:10px;background:linear-gradient(135deg,#ff8a3412,#9b6cff12);box-shadow:inset 0 0 24px #ff9b5008}
.halloween-victory-label {display:block;margin-top:10px;color:var(--halloween-orange);font-size:10px;font-weight:800;line-height:1.4;letter-spacing:3px}
.halloween-completion-subtitle {margin-bottom:14px;color:var(--halloween-text);font-size:13px;font-weight:600}
.halloween-achievement-note {padding:14px;border:1px solid #b18cff33;border-radius:10px;background:#b18cff0c;color:var(--halloween-text);font-size:13px;line-height:1.5}
.halloween-counter {margin:0 10px 8px!important}
.halloween-counter button {min-width:82px;padding:10px 13px;color:var(--halloween-text);background:#211a31f2;box-shadow:0 3px 14px #08050e44,0 0 12px var(--halloween-glow);font-variant-numeric:tabular-nums}
.halloween-counter button:hover {background:#352844}
.halloween-counter button.halloween-counter-completed {border-color:#ff9b5080;box-shadow:0 3px 14px #08050e44,0 0 15px #ff8a3426}
.halloween-notice {position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);z-index:6500;box-sizing:border-box;width:max-content;max-width:calc(100vw - 32px);padding:16px 24px;text-align:center;pointer-events:none}
.halloween-notice .halloween-eyebrow {color:var(--halloween-orange);margin-bottom:6px}
.halloween-notice-message {display:block;font-size:16px;font-weight:700}
.halloween-finale {position:fixed;inset:0;z-index:6500;background:transparent;display:flex;gap:24px;align-items:center;justify-content:center;pointer-events:none}
.halloween-finale .halloween-sprite {width:28px;height:28px;filter:drop-shadow(0 0 8px #b18cff66);animation:halloween-ascend 1.5s ease-out both}
.halloween-finale .halloween-sprite:nth-child(even) {animation-delay:.12s}
@keyframes halloween-ascend {0%{opacity:0;transform:translateY(16px)}20%{opacity:1}75%{opacity:1}100%{opacity:0;transform:translateY(-42px)}}
@media (max-width:900px),(pointer:coarse) and (max-width:1200px) {
  .halloween-counter {margin-bottom:calc(var(--floating-ui-bottom,12px) + 64px)!important}
  .has-collaborator-carousel .halloween-counter {margin-bottom:max(calc(var(--floating-ui-bottom,12px) + 64px),calc(var(--collaborator-carousel-offset,0px) + 78px))!important}
}
@media (max-width:400px) {
  .halloween-dialog {padding:22px;font-size:14px}
  .halloween-card h2 {font-size:21px}
  .halloween-dialog-completion .halloween-score {padding-block:14px}
}
@media (prefers-reduced-motion:reduce) {
  .halloween-map-shade {transition:none}
  .halloween-sprite,.halloween-finale .halloween-sprite {animation:none}
  .halloween-card button,.halloween-dialog button,.halloween-counter button {transition:none}
}
