/* Entire seasonal layer is inert until the server-selected event is active. */
html[data-site-event="halloween"] {
  --ws-bg: #0d0b12;
  --ws-panel: #17131e;
  --ws-raised: #211b2b;
  --ws-text: #f2eef8;
  --ws-muted: #c3afc8;
  --ws-accent: #b39aff;
  --ws-border: #e7a5ff26;
  --ws-danger: #ff9797;
  --background: #0d0b12;
  --foreground: #f2eef8;
  --card: #17131e;
  --card-foreground: #f2eef8;
  --popover: #211b2b;
  --popover-foreground: #f2eef8;
  --primary: #b39aff;
  --primary-foreground: #1a1030;
  --muted: #211b2b;
  --muted-foreground: #c3afc8;
  --border: #e7a5ff26;
  --input: #e7a5ff35;
  --ring: #b39aff;
  --brixy-accent: #b39aff;
  --brixy-bg: #0d0b12;
  --brixy-panel: #17131e;
  --brixy-raised: #211b2b;
  --brixy-muted: #c3afc8;
}
html[data-site-event="halloween"] body {
  background:
    radial-gradient(ellipse at 5% 0%, #7854b510, transparent 45%),
    radial-gradient(ellipse at 100% 100%, #9c4adb15, transparent 50%), #0d0b12 !important;
  color: #f2eef8;
}
html[data-site-event="halloween"] img[src="/brixy-logo.png"] {
  content: url("/halloween/brixy-logo.png?v=2");
}
html[data-site-event="halloween"] img[src="/gift-bird.png"] {
  content: url("/halloween/gift-bird.png");
}
html[data-site-event="halloween"] img[src="/support-bird.png"] {
  content: url("/halloween/support-bird.png");
}
html[data-site-event="halloween"] img[src="/worker-bird.png"] {
  content: url("/halloween/worker-bird.png");
}
html[data-site-event="halloween"]
  body
  :is(
    .chat-app,
    .chat-sidebar,
    .chat-main,
    .game-tree-panel,
    .admin-page,
    .docs-page,
    .payments-page,
    .support-page,
    .appeal-page,
    .legal-page,
    .site-update-notice
  ) {
  background-color: var(--ws-bg) !important;
}
html[data-site-event="halloween"]
  body
  :is(dialog, .profile-panel, .notifications-panel, .home-nav) {
  background: rgba(23, 19, 30, 0.94) !important;
  border-color: rgba(179, 154, 255, 0.16) !important;
  box-shadow:
    inset 0 1px 0 #ffffff08,
    0 18px 48px #0005 !important;
}
html[data-site-event="halloween"]
  body
  :is(.home-primary, .admin-primary, .send-button, .update-primary, .login, .pricing-button) {
  background: #b39aff !important;
  color: #1a1030 !important;
  border-color: #b39aff !important;
}
html[data-site-event="halloween"] body :is(.credit-fill, .credits-fill, .credits-progress-fill) {
  background: linear-gradient(90deg, #a67bea, #b39aff) !important;
}
html[data-site-event="halloween"] body :is(button, a, input, textarea, select):focus-visible {
  outline-color: #b39aff !important;
}
html[data-site-event="halloween"] body :is(pre, code) {
  border-color: #a67bea30 !important;
}
html[data-site-event="halloween"]
  body
  :is(.home-eyebrow, .docs-eyebrow, .update-version-badge, .admin-title > div > span) {
  color: #b39aff !important;
}
.admin-event-panel {
  padding: 24px !important;
  max-width: 900px;
}
.admin-event-panel > p {
  color: var(--ws-muted);
  line-height: 1.7;
}
.admin-event-panel > button,
.admin-event-confirm button {
  margin: 10px 10px 0 0;
  padding: 12px 18px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--ws-border);
  border-radius: 10px;
}
.admin-event-preview {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 30px;
  border: 1px solid #bd83db35;
  border-radius: 18px;
  background: radial-gradient(ellipse at right, #773ba535, transparent), #170f20;
  color: #f2eef8;
  overflow: hidden;
}
.admin-event-preview > img:first-child {
  width: 90px;
  height: 90px;
  object-fit: contain;
}
.admin-event-preview > img:last-child {
  width: 150px;
  height: 170px;
  object-fit: contain;
}
.admin-event-preview span {
  color: #b39aff;
  font-size: 11px;
  letter-spacing: 0.12em;
}
.admin-event-preview h3 {
  font-size: 26px;
  margin: 12px 0;
}
.admin-event-preview p {
  color: #c3afc8;
  line-height: 1.6;
}
.admin-event-confirm {
  padding: 20px;
  border: 1px solid var(--ws-border);
  border-radius: 12px;
}
@media (max-width: 650px) {
  .admin-event-preview {
    gap: 16px;
    padding: 20px;
    flex-wrap: wrap;
  }
  .admin-event-preview > img:first-child {
    width: 55px;
    height: 55px;
  }
  .admin-event-preview > img:last-child {
    display: none;
  }
  .admin-event-preview h3 {
    font-size: 22px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html[data-site-event="halloween"] * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
.support-wait-notice {
  border: 1px solid var(--ws-border);
  background: var(--ws-raised);
  border-radius: 12px;
  padding: 18px;
  margin: 16px 0;
  color: var(--ws-text);
}
.support-wait-notice p {
  color: var(--ws-muted);
  line-height: 1.6;
}
.support-wait-notice a {
  color: var(--ws-accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.appeal-help-note {
  line-height: 1.6;
  color: var(--ws-muted);
}

/* Full seasonal palette: the application remains Brixy purple, with pumpkin warmth. */
html[data-site-event="halloween"] {
  color-scheme: dark;
  --ws-bg: #0d0b12;
  --ws-panel: #17131e;
  --ws-raised: #211b2b;
  --ws-text: #f2eef8;
  --ws-muted: #c3afc8;
  --ws-accent: #b39aff;
  --ws-border: #b39aff30;
  --ws-danger: #ff9797;
  --background: #0d0b12;
  --foreground: #f2eef8;
  --card: #17131e;
  --card-foreground: #f2eef8;
  --popover: #211b2b;
  --popover-foreground: #f2eef8;
  --primary: #b39aff;
  --primary-foreground: #1a1030;
  --muted: #211b2b;
  --muted-foreground: #c3afc8;
  --border: #b39aff30;
  --input: #b39aff35;
  --ring: #b39aff;
}
html[data-site-event="halloween"] body {
  background:
    radial-gradient(ellipse at 7% 4%, #865cad30, transparent 36%),
    radial-gradient(ellipse at 95% 92%, #bf6e361b, transparent 38%), #0d0b12 !important;
  color: #f2eef8 !important;
}
html[data-site-event="halloween"]
  body
  :is(
    .landing-nav,
    .home-nav,
    .profile-popover,
    .profile-panel,
    .notifications-panel,
    dialog,
    .project-dialog,
    .account-settings,
    .admin-action-dialog,
    .glass-command-dialog,
    .credit-gift-dialog,
    .admin-event-confirm
  ) {
  border-color: #b39aff36 !important;
  background: linear-gradient(145deg, #1c1726f5, #121019f5) !important;
  box-shadow:
    0 24px 72px #0007,
    inset 0 1px #ffffff0b !important;
  color: #f2eef8 !important;
}
html[data-site-event="halloween"]
  body
  :is(
    .chat-app,
    .chat-sidebar,
    .chat-main,
    .game-tree-panel,
    .landing-main,
    .workshop-home,
    .payments-page,
    .admin-page,
    .docs-page,
    .support-page,
    .support-full-page,
    .appeal-page,
    .legal-page,
    .brixy-not-found
  ) {
  background-color: #0d0b12 !important;
  color: #f2eef8;
}
html[data-site-event="halloween"]
  body
  :is(
    .build-canvas,
    .workshop-plan,
    .canvas-node,
    .canvas-core,
    .payments-panel,
    .admin-panel,
    .admin-stats > div,
    .admin-overview-grid > article,
    .admin-user-detail,
    .admin-system,
    .settings-card,
    .site-update-content,
    .support-full-page .admin-panel,
    .profile-credit-plan,
    .chat-composer .prompt-bar__field
  ) {
  border-color: #b39aff30 !important;
  background: linear-gradient(145deg, #1b1625, #121019) !important;
  box-shadow:
    inset 0 1px #ffffff09,
    0 12px 38px #0003 !important;
}
html[data-site-event="halloween"]
  body
  :is(
    .home-eyebrow,
    .docs-eyebrow,
    .admin-title > div > span,
    .landing-hero h1 > span,
    .ws-kicker > span,
    .workshop-brand span,
    .message-label,
    .profile-credit-eyebrow,
    .profile-credit-plan .profile-credit-copy strong
  ) {
  color: #c9b5ff !important;
}
html[data-site-event="halloween"]
  body
  :is(
    a,
    .ws-text-link,
    .workflow-rows article svg,
    .workshop-plan li svg,
    .settings-layout > nav button[aria-pressed="true"]
  ) {
  color: #c9b5ff;
}
html[data-site-event="halloween"]
  body
  :is(button, a, input, textarea, select, summary):focus-visible {
  outline: 2px solid #b39aff !important;
  outline-offset: 3px;
}
html[data-site-event="halloween"] body :is(input, textarea, select) {
  border-color: #b39aff35 !important;
  background-color: #100d18 !important;
  color: #f2eef8 !important;
}
html[data-site-event="halloween"]
  body
  :is(
    .home-primary,
    .admin-primary,
    .feature-primary,
    .project-dialog button[type="submit"],
    .pix-primary,
    .gift-primary,
    .update-primary,
    .pro-header-link,
    .login,
    .chat-sidebar .new-project,
    .chat-composer .prompt-bar__send
  ) {
  border-color: #b39aff !important;
  background: linear-gradient(140deg, #cbb5fa, #a486ed) !important;
  color: #1a1030 !important;
  box-shadow:
    0 8px 26px #9f7beb28,
    inset 0 1px #ffffff75 !important;
}
html[data-site-event="halloween"]
  body
  :is(.home-primary, .admin-primary, .new-project, .prompt-bar__send):hover {
  filter: brightness(1.08);
}
html[data-site-event="halloween"]
  body
  :is(
    .chat-sidebar,
    .chat-header,
    .admin-sidebar,
    .settings-layout > nav,
    .game-tree-panel > header
  ) {
  border-color: #b39aff2b !important;
}
html[data-site-event="halloween"] body .chat-composer .prompt-bar__field:focus-within {
  border-color: #b39aff9c !important;
  box-shadow:
    0 0 0 3px #b39aff1c,
    0 16px 42px #0005 !important;
}
html[data-site-event="halloween"]
  body
  :is(.chat-message.user, .admin-event-confirm, .support-wait-notice) {
  border-color: #b39aff36 !important;
  background-color: #211a2b !important;
}
html[data-site-event="halloween"] body :is(pre, code) {
  border-color: #b39aff36 !important;
}
html[data-site-event="halloween"] ::selection {
  background: #b39aff65;
  color: #fff;
}
.brixy-halloween-surprise {
  position: fixed;
  inset: 0;
  z-index: 100002;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(ellipse at center, #341c45f2 0%, #190d25f5 52%, #08060bea 100%);
  pointer-events: none;
  animation: brixy-halloween-screen 1.22s both;
}
.brixy-halloween-surprise img {
  width: min(72vw, 430px);
  height: min(72vh, 490px);
  object-fit: contain;
  filter: drop-shadow(0 0 35px #bd86ff90) drop-shadow(0 12px 28px #0009);
  animation: brixy-halloween-mascot 1.22s cubic-bezier(0.15, 0.85, 0.25, 1) both;
  user-select: none;
}
@keyframes brixy-halloween-screen {
  0% {
    opacity: 0;
    background-color: transparent;
  }
  7% {
    opacity: 1;
    background-color: #4b2343e8;
  }
  17% {
    opacity: 1;
    background-color: #110b19f5;
  }
  38% {
    opacity: 1;
    background-color: #27152fef;
  }
  70% {
    opacity: 1;
    background-color: #120b19ef;
  }
  100% {
    opacity: 0;
    background-color: transparent;
  }
}
@keyframes brixy-halloween-mascot {
  0% {
    opacity: 0;
    transform: scale(0.06) rotate(-14deg);
  }
  12% {
    opacity: 1;
    transform: scale(1.17) rotate(3deg);
  }
  24% {
    opacity: 1;
    transform: scale(0.96) rotate(-2deg);
  }
  42% {
    opacity: 1;
    transform: scale(1.03) rotate(1deg);
  }
  76% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
  100% {
    opacity: 0;
    transform: scale(0.92) rotate(0);
  }
}
@media (max-width: 650px) {
  .brixy-halloween-surprise img {
    width: 88vw;
    height: 70vh;
  }
}
@media (prefers-reduced-motion: reduce) {
  .brixy-halloween-surprise,
  .brixy-halloween-surprise img {
    animation: none !important;
    transition: none !important;
  }
  .brixy-halloween-surprise {
    opacity: 0.95;
  }
}
