/* Seasonal decoration stays outside card content, medical images and 3D materials. */
html[data-halloween] body{background:radial-gradient(ellipse at 95% 0%,color-mix(in srgb,var(--accent) 9%,transparent),transparent 42%),var(--bg);color:var(--text)}
html[data-halloween] :is(body>header,.portal-header,.topbar,.farm-header,.lab-header,.da-header,.ma-header,.flow-topbar,.pt-header){border-bottom:2px solid var(--accent);background:var(--panel);color:var(--text)}
html[data-halloween] .halloween-monogram{color:var(--accent)!important;text-shadow:2px 2px 0 color-mix(in srgb,var(--accent) 16%,transparent)}
html .halloween-toggle{display:inline-flex!important;align-items:center;justify-content:center;gap:7px;flex:0 0 auto;min-height:40px;padding:7px 11px!important;border:1px solid var(--line)!important;border-radius:999px!important;background:var(--soft)!important;color:var(--text)!important;font:600 12px/1.3 system-ui!important;white-space:nowrap;cursor:pointer;letter-spacing:0}
html .halloween-toggle span:first-child{font-size:19px}html .halloween-toggle:focus-visible{outline:3px solid var(--focus);outline-offset:3px}html .halloween-toggle:hover{border-color:var(--accent)!important}
.halloween-welcome{display:none}html[data-halloween] .halloween-welcome{display:flex;align-items:center;position:relative;isolation:isolate;overflow:hidden;min-height:166px;padding:25px 34px;margin:0 0 24px;border:1px solid #775066;border-radius:20px;background:radial-gradient(ellipse at 70% 20%,#573044 0%,transparent 60%),#251b31;color:#fff3e4;box-shadow:0 12px 35px #21122612;grid-column:1/-1}
html[data-halloween] .halloween-welcome>div{position:relative;z-index:1}.halloween-welcome .halloween-eyebrow{font:700 10px/1.5 system-ui;letter-spacing:.2em;color:#ffc58d!important}.halloween-welcome p{font:400 clamp(23px,3vw,35px)/1.13 Georgia,serif!important;letter-spacing:-.03em;margin:11px 0!important;color:#fff3e4!important}.halloween-welcome p strong{font-weight:400;color:#ffc58d!important}.halloween-caption{font:12px/1.5 system-ui;color:#d9c5df!important}.halloween-welcome img{position:absolute;right:0;top:0;height:100%;width:auto;max-width:none;z-index:0;pointer-events:none}
html[data-halloween] .auth-main .halloween-welcome{width:min(100%,460px);box-sizing:border-box;min-height:148px;margin-bottom:14px;align-self:end}.auth-main:has(.halloween-welcome){align-content:center}.auth-main:has(.halloween-welcome) .auth-card{align-self:start}
html[data-halloween] :is(.page-heading h1,.portal-main h1,.panel-heading h2,.explorer-heading h1){color:var(--text)}
html[data-halloween] :is(.journey-summary,.study-discovery-card,.daily-brief,.auth-card,.membership-plan,.deck-card){border-color:var(--line);box-shadow:0 4px 20px color-mix(in srgb,var(--accent) 7%,transparent)}
html[data-halloween] :is(.journey-summary,.arena-discovery){background:linear-gradient(125deg,var(--soft),var(--panel))}
html[data-halloween] :is(.journey-emblem,.study-discovery-icon,.arena-glyph){color:var(--accent);background:var(--soft)}
html[data-halloween] :is(.explorer-heading,.panel-heading,.auth-card){position:relative}
html[data-halloween] :is(.explorer-heading,.auth-card)::after{content:'';position:absolute;pointer-events:none;right:0;top:0;width:70px;height:70px;opacity:.18;background:repeating-radial-gradient(circle at 100% 0,transparent 0 14px,var(--accent) 15px 16px,transparent 17px 24px);clip-path:polygon(100% 0,100% 100%,76% 60%,0 0)}
html[data-halloween] :is(.farm-header,.resource-bar,.farm-tabs,#farm-panel,.rank-chip,.world-note,.glass-button,.world-tools button,.farm-footer,dialog){background:var(--panel);color:var(--text);border-color:var(--line)}
html[data-halloween] :is(.farm-header,.farm-tabs,#farm-panel) :is(button[aria-current=page],button[aria-pressed=true],.primary,.study-button){background:var(--accent);color:var(--on-accent)!important;border-color:var(--accent)}
html[data-halloween] .farm-tabs button:not([aria-current=page]){color:var(--text)}
html[data-halloween] .farm-wordmark>span{color:var(--accent)}
html[data-halloween] .access-card{background:var(--panel);border-color:var(--line);color:var(--text)}
html[data-halloween] .access-card :is(p,label){color:var(--muted)}html[data-halloween] .access-card input{background:var(--soft);color:var(--text);border-color:var(--line)}html[data-halloween] .access-submit{background:var(--accent);color:var(--on-accent)}
@media(max-width:700px){html .halloween-toggle{font-size:11px!important;padding:6px 9px!important;min-height:40px}html[data-halloween] .halloween-welcome{padding:22px;min-height:155px;border-radius:15px}.halloween-welcome img{right:-112px;opacity:.48}.halloween-welcome>div{max-width:78%}.halloween-caption{display:block;max-width:215px}.halloween-eyebrow{max-width:210px;display:block}.halloween-welcome p{font-size:27px!important}}
@media(prefers-reduced-motion:reduce){.halloween-toggle{transition:none!important}}
@media print{.halloween-welcome,.halloween-toggle{display:none!important}}
html[data-halloween] .auth-main .halloween-welcome img{height:115px;right:-35px;top:auto;bottom:0;opacity:.65}
html[data-halloween] .auth-main .halloween-welcome p{font-size:28px!important;max-width:240px}
html[data-halloween] .auth-main .halloween-caption{display:block;max-width:240px}
html[data-halloween] :is(.study-discovery-card,.metrics>div,.dashboard>.panel,body>header){background-color:var(--panel)!important}
html .halloween-game-toggle{position:fixed;left:12px;bottom:12px;z-index:90}
html[data-halloween-game][data-halloween] .load-card{background:var(--panel);border-color:var(--line);color:var(--text)}
@media(max-width:700px){html .halloween-game-toggle{left:8px;bottom:calc(8px + env(safe-area-inset-bottom));font-size:10px!important}}
/* Haunted Atlas · original SVG scenery, corner webs, and compositor-friendly motion. */
.halloween-atmosphere,.haunt-panel-web,.haunt-arrival{display:none}
html[data-halloween] .halloween-atmosphere{display:block;position:fixed;inset:0;overflow:hidden;pointer-events:none;z-index:30;contain:layout paint}
.halloween-atmosphere *{pointer-events:none!important}
.haunt-web{position:absolute;width:clamp(95px,12vw,180px);height:auto;color:var(--muted);opacity:.3;transform-origin:0 0}.haunt-web svg{width:100%;display:block}.corner-nw{top:0;left:0}.corner-ne{top:0;right:0;transform:scaleX(-1)}.corner-sw{bottom:0;left:0;transform:scaleY(-1);width:105px;opacity:.18}
.haunt-spider{position:absolute;right:16px;top:-44px;width:39px;color:var(--text);opacity:.65;transform-origin:50% 0}.haunt-spider svg{width:100%;display:block}
.haunt-firefly{position:absolute;bottom:8%;width:4px;height:4px;border-radius:50%;background:#edaa57;box-shadow:0 0 10px #f5b75a;opacity:.5}.fly-0{left:12px;bottom:16%}.fly-1{right:12px;bottom:24%}.fly-2{left:24px;bottom:38%}.fly-3{right:25px;bottom:51%}.fly-4{left:9px;bottom:62%}.fly-5{right:8px;bottom:73%}.fly-6{left:18px;bottom:84%}.fly-7{right:18px;bottom:9%}
.haunt-web-host{position:relative}html[data-halloween] .haunt-panel-web{display:block;position:absolute;right:0;top:0;transform:scaleX(-1);width:75px;color:var(--accent);opacity:.2;pointer-events:none;z-index:0}.haunt-panel-web svg{display:block;width:100%}html[data-halloween] :is(.explorer-heading,.auth-card)::after{display:none}
html[data-halloween] .halloween-welcome.haunt-hero{min-height:300px;padding:34px 38px;background:radial-gradient(ellipse at 85% 55%,#603648 0,transparent 53%),linear-gradient(115deg,#21172e,#342139);border-color:#8b5b77;box-shadow:0 16px 44px #25152a25}
html[data-halloween] .haunt-hero>.haunt-hero-copy{width:59%;max-width:640px;z-index:3}.haunt-hero .halloween-eyebrow{font-size:10px;letter-spacing:.22em}.haunt-hero .halloween-caption{display:block;max-width:420px;font-size:13px;line-height:1.7}
html[data-halloween] .haunt-hero p{font-size:clamp(32px,4vw,49px)!important;line-height:1.02!important;margin:15px 0!important}.haunt-hero p strong{color:#ffc58d!important}
.haunt-hero-actions{display:flex;gap:9px;flex-wrap:wrap;margin-top:22px}html .haunt-hero .haunt-hero-actions button{font:650 12px/1.4 system-ui!important;min-height:42px;padding:10px 14px;border-radius:10px;border:1px solid #ad819b!important;background:#3c2846!important;color:#fff3e4!important;text-align:left;box-shadow:none}html .haunt-hero .haunt-hero-actions button:first-child{background:#ffc58d!important;color:#2a1827!important;border-color:#ffc58d!important}.haunt-hero-actions button:hover{transform:translateY(-2px)}
html[data-halloween] .haunt-hero>.haunt-scene{position:absolute;inset:0 0 0 auto;width:42%;max-width:530px;z-index:1;pointer-events:none;overflow:hidden}.haunt-scene>*{position:absolute;pointer-events:none}.haunt-moon{width:84px;height:84px;border-radius:50%;right:16%;top:28px;background:#ffe3a7;box-shadow:0 0 50px #f3c98538}.haunt-moon:after{content:'';position:absolute;inset:-4px -10px 10px 18px;background:#39253d;border-radius:50%}.haunt-orbit{border:1px solid #e0b68030;width:240px;height:240px;right:8%;top:12%;border-radius:50%}.haunt-lantern{width:215px;height:190px;right:18%;bottom:21px;transform-origin:center 90%;z-index:2}.haunt-lantern svg{width:100%;height:100%;overflow:visible}.haunt-face{transition:fill .45s}.is-lit .haunt-face{fill:#fff0b1;filter:drop-shadow(0 0 6px #ffd36c)}.haunt-ground{width:220px;height:24px;background:#140e24a8;border-radius:50%;right:17%;bottom:30px}.haunt-bat{color:#bc9ccb;width:65px;height:30px;transform-origin:center}.haunt-bat svg{width:100%;height:100%}.bat-one{top:51px;left:10%;transform:rotate(-12deg)}.bat-two{right:5%;top:48%;width:44px;transform:rotate(15deg)}.haunt-star{color:#e3bad9;font-style:normal;font-size:20px}.star-one{left:18%;top:35%;font-size:15px}.star-two{right:6%;top:25%}.star-three{right:35%;top:15%;font-size:11px}.haunt-mist{inset:auto -20% -16px;height:80px;border-radius:50%;background:radial-gradient(ellipse,#c8a2cb28,transparent 65%);transform:translateX(-5%);z-index:3}
html .haunt-patch{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-top:18px;padding-top:14px;border-top:1px solid #8b67844a;color:#ead7e6;font:12px/1.5 system-ui}.haunt-patch[hidden]{display:none!important}.haunt-pumpkins{display:inline-flex;gap:4px}.haunt-pumpkins i{font-style:normal;font-size:20px;filter:grayscale(1);opacity:.3;transition:opacity .3s,filter .3s}.haunt-pumpkins i.is-grown{filter:none;opacity:1}html .haunt-patch button{font-size:11px!important;min-height:32px!important;padding:4px 8px!important;background:transparent!important;border:0!important;color:#ffc58d!important}
html[data-halloween] .haunt-arrival{display:block;padding:12px 16px;border:1px solid var(--line);border-radius:10px;background:var(--soft);color:var(--text)}
html .haunt-dialog{width:min(820px,calc(100vw - 24px));max-height:calc(100dvh - 36px);padding:26px;border:1px solid var(--line);border-radius:22px;background:var(--panel);color:var(--text);overflow:auto;box-sizing:border-box;box-shadow:0 30px 100px #160e2a66;scrollbar-color:var(--line) var(--panel)}
.haunt-dialog::backdrop{background:#170f26b8;backdrop-filter:blur(5px)}html .haunt-dialog .haunt-dialog-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;border:0!important;padding:0!important;background:transparent!important}.haunt-dialog h2{font:400 36px/1.15 Georgia,serif;letter-spacing:-.03em;margin:8px 0;color:var(--text)}.haunt-dialog .halloween-eyebrow{color:var(--accent)!important;font:700 10px/1.5 system-ui;letter-spacing:.14em}.haunt-intro{color:var(--muted);font:14px/1.6 system-ui;margin:12px 0 22px}.haunt-dialog h3{font:700 16px/1.4 system-ui;margin:0;color:var(--text)}
html .haunt-dialog button,html .haunt-dialog select{min-height:42px;border:1px solid var(--line);border-radius:9px;background:var(--soft);color:var(--text);font:600 13px/1.4 system-ui;padding:9px 12px;cursor:pointer}.haunt-dialog :is(button,a,select,input):focus-visible{outline:3px solid var(--focus);outline-offset:3px}.haunt-controls{display:grid;grid-template-columns:auto 1fr 1fr;align-items:end;gap:14px;padding:18px;border:1px solid var(--line);border-radius:14px;background:var(--bg)}.haunt-controls label{display:grid;gap:8px;color:var(--muted);font:600 11px/1.4 system-ui;min-width:0}.haunt-controls select{width:100%;font-size:12px!important}.haunt-controls .haunt-switch{display:flex;align-items:center;color:var(--text);min-height:42px;font-size:12px}.haunt-switch input{width:18px;height:18px;accent-color:var(--accent)}.haunt-note{font:12px/1.6 system-ui;color:var(--muted);margin:12px 0 22px}.haunt-trail-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:24px 0 14px;font:12px/1.4 system-ui;color:var(--muted)}.haunt-trail{display:grid;grid-template-columns:1fr 1fr;gap:12px}.haunt-destination{display:flex;gap:12px;align-items:flex-start;padding:17px;border:1px solid var(--line);background:var(--bg);color:var(--text)!important;border-radius:13px;text-decoration:none;transition:transform .2s,border-color .2s}.haunt-destination:hover{transform:translateY(-3px);border-color:var(--accent)}.haunt-destination>b,.haunt-destination b{font:700 15px/1.4 system-ui}.haunt-destination-icon{font-size:25px;line-height:1.3}.haunt-destination small{display:block;color:var(--accent);font:600 10px/1.5 system-ui;margin-top:3px}.haunt-destination p{font:12px/1.6 system-ui;color:var(--muted);margin:9px 0}.haunt-destination .haunt-stamp-state{font:600 10px/1.4 system-ui;color:var(--muted);font-style:normal;display:inline-block;border:1px dashed var(--line);border-radius:6px;padding:4px 6px}.haunt-destination.is-visited .haunt-stamp-state{color:var(--accent);border-style:solid}.haunt-destination>span:last-child{margin-left:auto;color:var(--accent)}.haunt-treat{position:relative;display:flex;align-items:flex-start;gap:18px;background:var(--soft);border:1px solid var(--line);padding:20px;border-radius:14px;overflow:hidden}.haunt-cauldron{font-size:35px}.haunt-treat p{font:13px/1.6 system-ui;min-height:42px;margin:8px 0 14px;color:var(--text)}html .haunt-treat button{background:var(--accent);color:var(--on-accent);border-color:var(--accent)}.haunt-quicklinks{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px;align-items:center}.haunt-quicklinks a{font:12px/1.5 system-ui;color:var(--accent);padding:8px}.haunt-sparks{position:absolute;pointer-events:none;left:50%;bottom:35%;z-index:3}.haunt-sparks i{position:absolute;color:var(--accent);font-style:normal;animation:haunt-spark 1.1s ease-out forwards;--sx:70px;--sy:-60px}.spark-1{--sx:-90px!important;--sy:-80px!important}.spark-2{--sx:130px!important;--sy:-40px!important}.spark-3{--sx:-120px!important;--sy:20px!important}.spark-4{--sx:20px!important;--sy:-110px!important}.spark-5{--sx:-40px!important;--sy:-60px!important}.spark-6{--sx:90px!important;--sy:40px!important}.spark-7{--sx:-25px!important;--sy:55px!important}.spark-8{--sx:150px!important;--sy:-95px!important}
html[data-halloween] .auth-main .halloween-welcome.haunt-hero{padding:26px;min-height:260px}.auth-main .haunt-hero>.haunt-hero-copy{width:100%!important;max-width:100%!important}.auth-main .haunt-hero .halloween-caption{max-width:240px}.auth-main .haunt-hero .haunt-scene{width:48%!important;opacity:.35}.auth-main .haunt-lantern{right:-40px;width:175px;bottom:50px}.auth-main .haunt-moon{width:55px;height:55px;right:10%}.auth-main .haunt-hero-actions{position:relative;z-index:4;max-width:100%}.auth-main .haunt-hero-actions button{font-size:11px!important}.auth-main .haunt-hero p{font-size:36px!important}
@keyframes haunt-sway{0%,100%{transform:translateY(-8px) rotate(-4deg)}50%{transform:translateY(12px) rotate(4deg)}}
@keyframes haunt-bat{0%,100%{translate:0 0;rotate:-9deg;scale:1 1}50%{translate:12px -12px;rotate:7deg;scale:1 .78}}
@keyframes haunt-float{0%,100%{transform:translateY(0) rotate(-2deg)}50%{transform:translateY(-7px) rotate(2deg)}}
@keyframes haunt-glimmer{0%,100%{opacity:.28}50%{opacity:.8}}
@keyframes haunt-drift{0%,100%{transform:translate(0,0);opacity:.15}50%{transform:translate(7px,-35px);opacity:.65}}
@keyframes haunt-fog{0%,100%{transform:translateX(-7%);opacity:.5}50%{transform:translateX(7%);opacity:.9}}
@keyframes haunt-spark{from{transform:translate(0,0) scale(.3);opacity:1}to{transform:translate(var(--sx),var(--sy)) scale(1);opacity:0}}
html[data-halloween][data-halloween-motion=full] .haunt-spider{animation:haunt-sway 11s ease-in-out infinite}html[data-halloween][data-halloween-motion=full] .haunt-bat{animation:haunt-bat 7s ease-in-out infinite}html[data-halloween][data-halloween-motion=full] .bat-two{animation-delay:-4s;animation-duration:9s}html[data-halloween][data-halloween-motion=full] .haunt-lantern{animation:haunt-float 8s ease-in-out infinite}html[data-halloween][data-halloween-motion=full] .haunt-star{animation:haunt-glimmer 6s ease-in-out infinite}html[data-halloween][data-halloween-motion=full] .haunt-mist{animation:haunt-fog 18s ease-in-out infinite}html[data-halloween][data-halloween-motion=full] .haunt-firefly{animation:haunt-drift 13s ease-in-out infinite}html[data-halloween][data-halloween-motion=full] :is(.fly-1,.fly-3,.fly-5,.fly-7){animation-delay:-7s;animation-duration:16s}
html[data-halloween-paused] :is(.halloween-atmosphere,.haunt-scene,.haunt-sparks) *,body.reviewing :is(.halloween-atmosphere,.haunt-scene) *{animation-play-state:paused!important}
body.reviewing :is(.halloween-atmosphere,.haunt-panel-web),body:has(:fullscreen) .halloween-atmosphere{display:none!important}
html[data-halloween-motion=quiet] :is(.halloween-atmosphere,.haunt-scene,.haunt-sparks) *,body.reduce-motion :is(.halloween-atmosphere,.haunt-scene,.haunt-sparks) *{animation:none!important;transition:none!important}
html[data-halloween-motion=quiet] .haunt-destination:hover{transform:none}
@media(max-width:700px){.haunt-web{width:100px;opacity:.2}.corner-sw{width:65px}.haunt-spider{right:3px;width:26px;top:-28px}.haunt-firefly:nth-of-type(n+5){display:none}html[data-halloween] .halloween-welcome.haunt-hero{min-height:290px;padding:25px}.haunt-hero>.haunt-hero-copy{width:100%!important;max-width:100%!important}.haunt-hero .halloween-caption{max-width:76%;font-size:12px}.haunt-hero>.haunt-scene{width:53%!important;opacity:.45}.haunt-lantern{width:170px;right:-20px;bottom:58px}.haunt-moon{right:8%;top:22px;width:60px;height:60px}.haunt-hero p{font-size:39px!important}.haunt-hero-actions{max-width:100%}.haunt-hero-actions button{font-size:11px!important}.haunt-hero .haunt-patch{max-width:100%}.haunt-dialog{padding:19px!important;max-height:calc(100dvh - 20px)!important;border-radius:16px!important}.haunt-dialog h2{font-size:29px}.haunt-controls{grid-template-columns:1fr;gap:12px;padding:14px}.haunt-controls .haunt-switch{min-height:32px}.haunt-trail{grid-template-columns:1fr}.haunt-destination{padding:15px}.haunt-treat{padding:16px;gap:12px}.haunt-note{font-size:11px}.haunt-panel-web{width:55px!important}}
@media(prefers-reduced-motion:reduce){.halloween-atmosphere *,.haunt-scene *,.haunt-sparks *{animation:none!important;transition:none!important}.haunt-destination,.haunt-hero-actions button{transition:none!important;transform:none!important}}
@media print{.halloween-atmosphere,.haunt-panel-web,.haunt-dialog,.haunt-arrival{display:none!important}}

.daily-study-treat{margin:0 0 24px;position:relative;overflow:hidden}.daily-study-treat .haunt-note{display:block;margin-top:10px}.daily-study-treat h3{margin:0 0 8px}
