/* The Martini — Halloween holiday theme decoration (branch halloween). Applies only while html[data-holiday="halloween"]
   is set (the person said "Turn it on" in the two weeks before Oct 31), plus the pop-up itself. Lightweight SVG (data URIs,
   made by scripts/make-halloween-art.py) + CSS. Every decoration is a background or a pointer-events:none layer behind
   the controls, so nothing covers a button or shrinks a tap target. prefers-reduced-motion = all still. */
:root {
  --hw-web: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M0 0L100.0 0.0M0 0L94.0 34.2M0 0L70.7 70.7M0 0L34.2 94.0M0 0L0.0 100.0M18.5 0.0Q14.0 2.5 17.4 6.3Q11.9 7.6 13.1 13.1Q7.6 11.9 6.3 17.4Q2.5 14.0 0.0 18.5M37.0 0.0Q28.0 4.9 34.8 12.7Q23.8 15.2 26.2 26.2Q15.2 23.8 12.7 34.8Q4.9 28.0 0.0 37.0M55.6 0.0Q42.0 7.4 52.2 19.0Q35.7 22.7 39.3 39.3Q22.7 35.7 19.0 52.2Q7.4 42.0 0.0 55.6M74.1 0.0Q56.0 9.9 69.6 25.3Q47.6 30.3 52.4 52.4Q30.3 47.6 25.3 69.6Q9.9 56.0 0.0 74.1M92.6 0.0Q70.0 12.4 87.0 31.7Q59.5 37.9 65.5 65.5Q37.9 59.5 31.7 87.0Q12.4 70.0 0.0 92.6' fill='none' stroke='%23C9B8D6' stroke-width='1.1' stroke-linecap='round' opacity='0.55'/%3E%3C/svg%3E");
  --hw-web-strong: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M0 0L100.0 0.0M0 0L94.0 34.2M0 0L70.7 70.7M0 0L34.2 94.0M0 0L0.0 100.0M18.5 0.0Q14.0 2.5 17.4 6.3Q11.9 7.6 13.1 13.1Q7.6 11.9 6.3 17.4Q2.5 14.0 0.0 18.5M37.0 0.0Q28.0 4.9 34.8 12.7Q23.8 15.2 26.2 26.2Q15.2 23.8 12.7 34.8Q4.9 28.0 0.0 37.0M55.6 0.0Q42.0 7.4 52.2 19.0Q35.7 22.7 39.3 39.3Q22.7 35.7 19.0 52.2Q7.4 42.0 0.0 55.6M74.1 0.0Q56.0 9.9 69.6 25.3Q47.6 30.3 52.4 52.4Q30.3 47.6 25.3 69.6Q9.9 56.0 0.0 74.1M92.6 0.0Q70.0 12.4 87.0 31.7Q59.5 37.9 65.5 65.5Q37.9 59.5 31.7 87.0Q12.4 70.0 0.0 92.6' fill='none' stroke='%23E6DCEF' stroke-width='1.1' stroke-linecap='round' opacity='0.8'/%3E%3C/svg%3E");
  --hw-bats-a: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 40' fill='%23D9CCE6'%3E%3Cpath transform='translate(0 12) scale(0.5)' d='M32 12c1.5-3 3-4 3-4l.6 3.2c2.5-.6 4.4.3 5.4 2.2c4-4.6 11-6.4 21-3.4c-5.5 2-8.4 5.6-8.6 10.4c-2.6-1.8-5.8-1.6-8 .8c-1.6-2.4-4.2-3-6.6-1.6c-1.2 2.6-3.6 4.4-6.8 4.4s-5.6-1.8-6.8-4.4c-2.4-1.4-5-.8-6.6 1.6c-2.2-2.4-5.4-2.6-8-.8c-.2-4.8-3.1-8.4-8.6-10.4c10-3 17-1.2 21 3.4c1-1.9 2.9-2.8 5.4-2.2l.6-3.2s1.5 1 3 4z'/%3E%3Cpath transform='translate(44 0) scale(0.36)' d='M32 12c1.5-3 3-4 3-4l.6 3.2c2.5-.6 4.4.3 5.4 2.2c4-4.6 11-6.4 21-3.4c-5.5 2-8.4 5.6-8.6 10.4c-2.6-1.8-5.8-1.6-8 .8c-1.6-2.4-4.2-3-6.6-1.6c-1.2 2.6-3.6 4.4-6.8 4.4s-5.6-1.8-6.8-4.4c-2.4-1.4-5-.8-6.6 1.6c-2.2-2.4-5.4-2.6-8-.8c-.2-4.8-3.1-8.4-8.6-10.4c10-3 17-1.2 21 3.4c1-1.9 2.9-2.8 5.4-2.2l.6-3.2s1.5 1 3 4z'/%3E%3Cpath transform='translate(78 14) scale(0.42)' d='M32 12c1.5-3 3-4 3-4l.6 3.2c2.5-.6 4.4.3 5.4 2.2c4-4.6 11-6.4 21-3.4c-5.5 2-8.4 5.6-8.6 10.4c-2.6-1.8-5.8-1.6-8 .8c-1.6-2.4-4.2-3-6.6-1.6c-1.2 2.6-3.6 4.4-6.8 4.4s-5.6-1.8-6.8-4.4c-2.4-1.4-5-.8-6.6 1.6c-2.2-2.4-5.4-2.6-8-.8c-.2-4.8-3.1-8.4-8.6-10.4c10-3 17-1.2 21 3.4c1-1.9 2.9-2.8 5.4-2.2l.6-3.2s1.5 1 3 4z'/%3E%3C/svg%3E");
  --hw-bats-b: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 40' fill='%23FF7A1A'%3E%3Cpath transform='translate(10 4) scale(0.34)' d='M32 12c1.5-3 3-4 3-4l.6 3.2c2.5-.6 4.4.3 5.4 2.2c4-4.6 11-6.4 21-3.4c-5.5 2-8.4 5.6-8.6 10.4c-2.6-1.8-5.8-1.6-8 .8c-1.6-2.4-4.2-3-6.6-1.6c-1.2 2.6-3.6 4.4-6.8 4.4s-5.6-1.8-6.8-4.4c-2.4-1.4-5-.8-6.6 1.6c-2.2-2.4-5.4-2.6-8-.8c-.2-4.8-3.1-8.4-8.6-10.4c10-3 17-1.2 21 3.4c1-1.9 2.9-2.8 5.4-2.2l.6-3.2s1.5 1 3 4z'/%3E%3Cpath transform='translate(84 10) scale(0.4)' d='M32 12c1.5-3 3-4 3-4l.6 3.2c2.5-.6 4.4.3 5.4 2.2c4-4.6 11-6.4 21-3.4c-5.5 2-8.4 5.6-8.6 10.4c-2.6-1.8-5.8-1.6-8 .8c-1.6-2.4-4.2-3-6.6-1.6c-1.2 2.6-3.6 4.4-6.8 4.4s-5.6-1.8-6.8-4.4c-2.4-1.4-5-.8-6.6 1.6c-2.2-2.4-5.4-2.6-8-.8c-.2-4.8-3.1-8.4-8.6-10.4c10-3 17-1.2 21 3.4c1-1.9 2.9-2.8 5.4-2.2l.6-3.2s1.5 1 3 4z'/%3E%3C/svg%3E");
  --hw-bat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 26' fill='%23FF7A1A'%3E%3Cpath d='M32 12c1.5-3 3-4 3-4l.6 3.2c2.5-.6 4.4.3 5.4 2.2c4-4.6 11-6.4 21-3.4c-5.5 2-8.4 5.6-8.6 10.4c-2.6-1.8-5.8-1.6-8 .8c-1.6-2.4-4.2-3-6.6-1.6c-1.2 2.6-3.6 4.4-6.8 4.4s-5.6-1.8-6.8-4.4c-2.4-1.4-5-.8-6.6 1.6c-2.2-2.4-5.4-2.6-8-.8c-.2-4.8-3.1-8.4-8.6-10.4c10-3 17-1.2 21 3.4c1-1.9 2.9-2.8 5.4-2.2l.6-3.2s1.5 1 3 4z'/%3E%3C/svg%3E");
  --hw-ghost: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 52'%3E%3Cpath d='M24 3C13 3 6 11 6 22v26l6-5 6 5 6-5 6 5 6-5 6 5V22C42 11 35 3 24 3z' fill='%23F4E9D8'/%3E%3Cellipse cx='18' cy='22' rx='3.2' ry='4.4' fill='%23120A1C'/%3E%3Cellipse cx='30' cy='22' rx='3.2' ry='4.4' fill='%23120A1C'/%3E%3Cellipse cx='24' cy='32' rx='3' ry='3.6' fill='%23120A1C'/%3E%3C/svg%3E");
  --hw-pumpkin: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 36'%3E%3Cpath d='M19 7c0-3 1-5 4-6' stroke='%236E9A2E' stroke-width='3' fill='none' stroke-linecap='round'/%3E%3Cellipse cx='20' cy='21' rx='18' ry='14' fill='%23FF7A1A'/%3E%3Cpath d='M13 9c-4 3-5 8-5 12s1 9 5 12M27 9c4 3 5 8 5 12s-1 9-5 12M20 7v28' stroke='%23C85A0A' stroke-width='1.6' fill='none'/%3E%3Cpath d='M10 18l5-4 4 4zM21 18l5-4 4 4zM10 25q10 8 20 0l-3 1-2-2-3 3-2-3-3 3-2-3-2 2z' fill='%23FFD23F'/%3E%3C/svg%3E");
  --hw-fog: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 200' preserveAspectRatio='none'%3E%3Cdefs%3E%3Cfilter id='b' x='-30%25' y='-80%25' width='160%25' height='260%25'%3E%3CfeGaussianBlur stdDeviation='18'/%3E%3C/filter%3E%3C/defs%3E%3Cg filter='url(%23b)' fill='%23C9B8D6'%3E%3Cellipse cx='90' cy='130' rx='150' ry='38' opacity='.5'/%3E%3Cellipse cx='330' cy='150' rx='190' ry='44' opacity='.42'/%3E%3Cellipse cx='540' cy='125' rx='140' ry='36' opacity='.5'/%3E%3Cellipse cx='220' cy='175' rx='230' ry='30' opacity='.38'/%3E%3C/g%3E%3C/svg%3E");
}

/* —— Creepster: headers only (body text stays the palette's own UI font). Self-hosted, SIL OFL 1.1 (fonts/OFL.txt) —— */
@font-face { font-family: "Creepster"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/Creepster.woff2") format("woff2"); }
html[data-holiday="halloween"] { --hw-display: "Creepster", var(--font-display); }
html[data-holiday="halloween"] .scn-head h2,
html[data-holiday="halloween"] .sheet-head h2,
html[data-holiday="halloween"] .empty h2,
html[data-holiday="halloween"] .hol-ask-t { font-family: var(--hw-display); font-weight: 400; letter-spacing: 0.035em; color: var(--accent); }
html[data-holiday="halloween"] .scn-head h2 { font-size: 1.45rem; line-height: 1.05; }
html[data-holiday="halloween"] .sheet-head h2 { font-size: 1.4rem; }
/* a little bat after each section title */
html[data-holiday="halloween"] .scn-head h2::after { content: ""; display: inline-block; width: 22px; height: 10px; margin-left: 6px; vertical-align: 0.15em; background: var(--hw-bat) center / contain no-repeat; opacity: .9; }

/* —— the page: a moonlit glow top-right, drifting fog along the bottom (behind everything; never takes a tap) —— */
html[data-holiday="halloween"] { background: radial-gradient(120% 60% at 92% -8%, rgba(255, 122, 26, .10), transparent 55%), radial-gradient(90% 50% at 0% 0%, rgba(169, 139, 255, .10), transparent 60%), var(--bg); background-attachment: fixed; }
html[data-holiday="halloween"] body { background: transparent; }
html[data-holiday="halloween"] body::before,
html[data-holiday="halloween"] body::after { content: ""; position: fixed; left: -20%; right: -20%; bottom: 0; height: 42vh; z-index: -1; pointer-events: none; background: var(--hw-fog) center bottom / 100% 100% no-repeat; opacity: .6; -webkit-mask-image: linear-gradient(transparent, #000 45%); mask-image: linear-gradient(transparent, #000 45%); animation: hw-fog 38s ease-in-out infinite alternate; }
html[data-holiday="halloween"] body::after { height: 30vh; bottom: -4vh; opacity: .4; transform: scaleX(-1); animation: hw-fog-b 52s ease-in-out infinite alternate; }
@keyframes hw-fog { from { transform: translateX(-6%); } to { transform: translateX(6%); } }
@keyframes hw-fog-b { from { transform: scaleX(-1) translateX(-7%); } to { transform: scaleX(-1) translateX(5%); } }

/* —— header (v1.7.3 top bar = the small production name only): bats flap along its right end, inside the bar's height,
      behind everything and never taking a tap; the name is kept clear of them (it ellipsizes first) —— */
html[data-holiday="halloween"] .top::before,
html[data-holiday="halloween"] .top::after { content: ""; position: absolute; z-index: -1; pointer-events: none; background-repeat: no-repeat; background-size: contain; }
html[data-holiday="halloween"] .top::before { right: 8px; top: calc(3px + env(safe-area-inset-top)); width: 86px; height: 30px; background-image: var(--hw-bats-a); animation: hw-flap 3.2s ease-in-out infinite; }
html[data-holiday="halloween"] .top::after { right: 96px; top: calc(9px + env(safe-area-inset-top)); width: 50px; height: 18px; background-image: var(--hw-bats-b); animation: hw-flap 2.6s .8s ease-in-out infinite; }
html[data-holiday="halloween"] .prod-name { max-width: calc(100% - 150px); }
@keyframes hw-flap { 0%, 100% { background-position: 0 2px; } 50% { background-position: 3px -2px; } }

/* —— a cobweb in the day card's top-right corner (a background; the day arrows sit on a solid chip above it) —— */
html[data-holiday="halloween"] .day-card { background-image: var(--holiday-stripe), var(--hw-web); background-size: 100% 4px, 92px 92px; background-position: top, right top; background-repeat: no-repeat; }
html[data-holiday="halloween"] .day-card { position: relative; }
html[data-holiday="halloween"] .day-step:not(:disabled) { position: relative; z-index: 1; background: var(--bg-panel, var(--surface)); }
/* scene cards stay clean for reading (no web over the page counts); the Working card glows like a jack-o'-lantern */
html[data-holiday="halloween"] .scn-row.st-being .scn-card { box-shadow: inset 0 0 22px rgba(255, 122, 26, .22); } /* inset: the row clips outer shadows */
/* a spider dangling from the day card's web on a thread (decoration, beside the controls) */
html[data-holiday="halloween"] .day-card::after { content: ""; position: absolute; right: 66px; top: 0; width: 12px; height: 46px; pointer-events: none; z-index: 0;
  background: linear-gradient(var(--muted), var(--muted)) center top / 1px 32px no-repeat, radial-gradient(circle at 50% 50%, var(--text) 0 4px, transparent 4.5px) center bottom / 12px 12px no-repeat;
  opacity: .7; transform-origin: 50% 0; animation: hw-dangle 4.5s ease-in-out infinite; }
@keyframes hw-dangle { 0%, 100% { transform: rotate(-5deg) translateY(0); } 50% { transform: rotate(5deg) translateY(4px); } }

/* —— today's dot on the day strip is a tiny pumpkin —— */
html[data-holiday="halloween"] .day-dots i.is-today { width: 11px; height: 10px; border-radius: 0; box-shadow: none; background: var(--hw-pumpkin) center / contain no-repeat; }

/* —— the User tab's avatar gets a pumpkin glow; the glass mark by the production name glows too —— */
html[data-holiday="halloween"] .tab-user .tab-av { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent), 0 0 10px rgba(255, 122, 26, .45); }
html[data-holiday="halloween"] .prod-name::before { filter: drop-shadow(0 0 4px rgba(255, 122, 26, .55)); }

/* —— empty states: a friendly ghost —— */
html[data-holiday="halloween"] .empty::before { content: ""; display: block; width: 46px; height: 50px; margin: 6px auto 8px; background: var(--hw-ghost) center / contain no-repeat; animation: hw-float 3.4s ease-in-out infinite; }
html[data-holiday="halloween"] .empty { text-align: center; }
@keyframes hw-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* —— loading / sign-in glass: a slow spooky stir (static with reduced motion), bats around it —— */
html[data-holiday="halloween"] .login-card { position: relative; }
html[data-holiday="halloween"] .login-ic { width: 132px; height: 132px; border-radius: 30px; box-shadow: 0 0 0 1px var(--border), 0 0 34px rgba(255, 122, 26, .28); animation: hw-stir 3.6s ease-in-out infinite; transform-origin: 50% 70%; }
html[data-holiday="halloween"] .login-card::before { content: ""; position: absolute; left: 50%; top: -58px; width: 220px; height: 72px; margin-left: -110px; pointer-events: none; background: var(--hw-bats-a) center / contain no-repeat; animation: hw-flap 3s ease-in-out infinite; }
@keyframes hw-stir { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg) translateY(-2px); } }

/* —— Settings: the Halloween row in Palette —— */
.hol-pal [data-hol-pal="halloween"] .swatch { background: var(--hw-web) right top / 26px 26px no-repeat, var(--sw-bg); }
.hol-pal .tag.is-season { --tag-c: var(--accent); margin-left: 6px; }

/* —— the pop-up: cobweb corner, bats across the top, pumpkin title —— */
.hol-ask[data-hol="halloween"] .hol-ask-card { position: relative; overflow: hidden; background: radial-gradient(120% 80% at 100% 0%, rgba(255, 122, 26, .16), transparent 60%), #1E1230; color: #FBEFDF; border-color: #3D2A5C; }
.hol-ask[data-hol="halloween"] .hol-ask-card::before { content: ""; position: absolute; left: 0; top: 0; width: 84px; height: 84px; pointer-events: none; background: var(--hw-web-strong) left top / contain no-repeat; }
.hol-ask[data-hol="halloween"] .hol-ask-card::after { content: ""; position: absolute; right: 8px; top: 6px; width: 110px; height: 38px; pointer-events: none; background: var(--hw-bats-b) center / contain no-repeat; animation: hw-flap 2.6s ease-in-out infinite; }
.hol-ask[data-hol="halloween"] .hol-ask-t { font-family: "Creepster", var(--font-display); font-weight: 400; font-size: 1.7rem; letter-spacing: 0.04em; color: #FF7A1A; }
.hol-ask[data-hol="halloween"] .hol-ask-p { color: #C9B8D6; }
.hol-ask[data-hol="halloween"] .hol-ask-f { color: #C9B8D6; }
.hol-ask[data-hol="halloween"] .btn:not(.btn-primary) { background: #2A1A42; color: #FBEFDF; border-color: #3D2A5C; }
.hol-ask[data-hol="halloween"] .btn-primary { background: #FF7A1A; color: #1A0A00; border-color: #FF7A1A; }
.hol-ask[data-hol="halloween"] .hol-pv-ui { background-image: var(--hw-web); background-size: 40px 40px; background-position: right bottom; background-repeat: no-repeat; }

/* —— reduced motion: every Halloween decoration holds still —— */
@media (prefers-reduced-motion: reduce) {
  html[data-holiday="halloween"] *, html[data-holiday="halloween"] *::before, html[data-holiday="halloween"] *::after,
  html[data-holiday="halloween"] body::before, html[data-holiday="halloween"] body::after, .hol-ask[data-hol="halloween"] *, .hol-ask[data-hol="halloween"] *::after { animation: none !important; }
}
