/* Halloween V4: canonical clean scene + separately authored pumpkin, cat, and bat layers.
 * Seasonal switches are resolved in app.js; regular page and rider interactions stay untouched. */
body.season-halloween {
  --page-glow: rgba(148, 90, 174, .16);
  --page-top: #372154;
  --page-bottom: #221a43;
  --topbar-bg: rgba(35, 24, 63, .96);
  --event-zone-bg: rgba(47, 36, 66, .42);
}

body.season-halloween .topbar {
  border-bottom-color: rgba(253, 174, 102, .18);
}
body.season-halloween .brand-title {
  color: #fff0dd;
  text-shadow: 2px 2px 0 rgba(232, 109, 57, .55);
}
body.season-halloween .brand-spark,
body.season-halloween .today-total strong {
  color: #ffa35c;
}
body.season-halloween .today-total,
body.season-halloween .today-freshness,
body.season-halloween .manual-refresh-button {
  color: #e2c6dc;
}
body.season-halloween .profile-button {
  background: #352c4c;
  color: #f8e4ec;
  border-color: #66527e;
  box-shadow: 0 3px 0 rgba(12, 11, 28, .34);
}
body.season-halloween .manual-refresh-button:hover { color: #ffe5b9; }

/* Canonical clean-scene illustration. No cats, bats or lit pumpkin faces baked into the art.
 * Scene is painted behind both the two-lane track and the translucent event rail. */
body.season-halloween .app-shell {
  position: relative;
  isolation: isolate;
  background: #281d4b;
}
body.season-halloween .app-shell::before {
  content: "";
  position: absolute;
  inset: 82px 0 0;
  z-index: 0;
  pointer-events: none;
  background: var(--season-base, url("/themes/halloween/art/base-1920.webp")) center / cover no-repeat;
  /* The base is an unlit master; glowing pumpkins are in their own aligned mask. */
  filter: none;
}
/* Actor visual size is controlled by the road placement planner. Do not
 * stack the old inner 1.13 zoom on top of that road-relative scale. */
body.season-halloween .rider-inner { transform: scale(1); }
body.season-halloween .race-stage {
  /* The two painted roads span the full scene width; the event rail is a
   * separate overlay, not a permanent left column in the road geometry. */
  margin-left: 0;
  position: relative;
  z-index: 1;
  background: transparent;
  box-shadow: none;
}
/* Render the existing riders in the two illustrated asphalt lanes,
 * without altering their stored four-lane office positions. */
body.season-halloween .race-stage .lane {
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
  border: 0;
  overflow: visible;
}
body.season-halloween #lane1 { top: 52%; height: 16%; }
body.season-halloween #lane3 { top: 71%; height: 16%; }
body.season-halloween #lane2,
body.season-halloween #lane4 { display: none; }
@media (max-width: 900px) {
  body.season-halloween .app-shell::before { top: 72px; }
}
body.season-halloween .race-stage::before {
  content: none;
  display: none;
}
body.season-halloween .event-rail-head strong {
  color: #f7e5f3;
  text-shadow: none;
}
body.season-halloween .event-rail-head span {
  color: #c4afcf;
}
body.season-halloween .event-empty {
  color: #ddc6dc;
  text-shadow: none;
}

/* Frosted event glass: translucent cards and legible text over the office.
 * This visual change only applies while the Halloween preview is enabled. */
body.season-halloween .event-rail {
  border: 1px solid rgba(233, 198, 255, .42);
  background: linear-gradient(145deg, rgba(89, 57, 143, .27), rgba(31, 24, 68, .49));
  box-shadow: 0 12px 38px rgba(23, 14, 56, .23), inset 0 1px 0 rgba(255, 231, 253, .25);
  -webkit-backdrop-filter: blur(19px) saturate(150%);
  backdrop-filter: blur(19px) saturate(150%);
}
body.season-halloween .event-item {
  color: #fff0f9;
  border-color: rgba(246, 211, 255, .3);
  background: rgba(33, 25, 76, .55);
  box-shadow: 0 4px 12px rgba(20, 13, 57, .14), inset 0 1px 0 rgba(255,255,255,.1);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
}
body.season-halloween .event-join,
body.season-halloween .event-upload {
  background: rgba(51, 49, 106, .57);
}
body.season-halloween .event-comment {
  background: rgba(73, 47, 101, .61);
}
body.season-halloween .event-achievement {
  border-color: rgba(255, 197, 112, .5);
  background: rgba(98, 53, 101, .61);
}
body.season-halloween .event-release {
  background: rgba(71, 57, 124, .65);
}
body.season-halloween .event-line,
body.season-halloween .event-line strong {
  color: #fff2fb;
  text-shadow: 0 1px 3px rgba(8, 6, 27, .5);
}
body.season-halloween .event-body small {
  color: #e1c6e5;
}
body.season-halloween .event-avatar {
  border-color: rgba(255, 240, 255, .4);
  background: rgba(251, 244, 255, .83);
}
body.season-halloween .event-release::after {
  color: #ffd699;
}
body.season-halloween .event-composer {
  border-color: rgba(255, 220, 252, .4);
  background: rgba(48, 37, 91, .64);
  box-shadow: 0 4px 16px rgba(21, 15, 57, .15);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
body.season-halloween .event-composer input {
  color: #fff3f9;
}
body.season-halloween .event-composer input::placeholder {
  color: #e1cbe8;
}
body.season-halloween .event-composer button {
  color: #352043;
  background: #ffc07e;
}
@supports not (backdrop-filter: blur(1px)) {
  body.season-halloween .event-rail { background: rgba(43, 31, 84, .82); }
  body.season-halloween .event-item { background: rgba(39, 32, 78, .87); }
}


/* Theme Manifest layers use the identical crop and canvas as the background.
 * They never intercept input, so current rider dragging remains usable. */
body.season-halloween .season-layer-host {
  position: absolute;
  inset: 82px 0 0;
  z-index: 0;
  pointer-events: none !important;
  overflow: hidden;
  isolation: isolate;
}
body.season-halloween .season-layer {
  position: absolute;
  inset: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  pointer-events: none;
}
body.season-halloween .season-bats-static,
body.season-halloween .season-cats-static { opacity: 1; }
body.season-halloween .season-glow-pumpkins {
  mix-blend-mode: screen;
  /* 2048x768 transparent light mask: same registration and cover as base. */
  filter: saturate(1.07);
  animation: halloweenPumpkinBreath 4.1s ease-in-out infinite alternate;
}
@keyframes halloweenPumpkinBreath {
  from { opacity: .10; }
  to { opacity: 1; }
}
body.season-halloween .season-bat-flyover {
  display: block;
  position: absolute;
  top: var(--bat-top);
  left: -8%;
  width: var(--bat-size);
  height: auto;
  opacity: .82;
  filter: drop-shadow(0 1px 2px rgba(24,7,40,.25));
  pointer-events: none;
  animation: halloweenBatFly var(--bat-duration) linear var(--bat-delay) infinite;
}
@keyframes halloweenBatFly {
  0% { opacity: 0; transform: translate3d(-15px, 0, 0) scale(.85); }
  4% { opacity: .86; }
  48% { transform: translate3d(54vw, -12px, 0) scale(1); }
  96% { opacity: .86; }
  100% { opacity: 0; transform: translate3d(116vw, 6px, 0) scale(.93); }
}
body.season-halloween .season-costume {
  position: absolute;
  left: 57px;
  top: -23px;
  z-index: 7;
  width: 40px;
  height: 34px;
  display: grid;
  place-items: center;
  font-size: 28px;
  line-height: 1;
  pointer-events: none;
  transform: rotate(-9deg);
  filter: drop-shadow(0 2px 2px rgba(27,11,36,.42));
}
body.season-halloween .rider.is-near-right .season-costume { left: 57px; }
@media (max-width:900px) {
  body.season-halloween .season-layer-host { top: 72px; }
}
@media (prefers-reduced-motion:reduce) {
  body.season-halloween .season-glow-pumpkins,
  body.season-halloween .season-bat-flyover {
    animation: none !important;
  }
  body.season-halloween .season-glow-pumpkins { opacity: .55; }
  body.season-halloween .season-bat-flyover { display: none; }
}


/* One viewport-level bubble surface: rider transforms no longer control text.
 * Source message/action nodes remain in the rider for legacy state handling. */
body.season-halloween .rider-message-bubble,
body.season-halloween .effect-burst { display: none !important; }
.scene-bubble-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  pointer-events: none;
}
.scene-bubble {
  position: absolute;
  display: block;
  box-sizing: border-box;
  width: max-content;
  min-width: 58px;
  max-width: min(220px, calc(100vw - 16px));
  padding: 7px 10px;
  border: 2px solid #2b213e;
  border-radius: 11px;
  background: #fff9e9;
  color: #292535;
  box-shadow: 3px 3px 0 rgba(34,19,52,.26);
  font: 700 12px/1.25 ui-sans-serif, system-ui, sans-serif;
  overflow-wrap: anywhere;
  white-space: normal;
  text-align: left;
  pointer-events: none;
}
.scene-bubble-action {
  background: #f9e8ff;
  color: #50335b;
  border-color: #5d3b71;
}
@media (max-width: 760px) {
  .scene-bubble { max-width: min(180px, calc(100vw - 16px)); font-size: 11px; padding: 6px 8px; }
}
