/* Halloween: black and pumpkin orange, bone-white text, an orange LCD,
   slime dripping from every card, cobwebs in the corners, a bat now
   and then, and a lightning strike from time to time (pistar.js; not
   for reduced motion). The colours meet 4.5:1 like every theme. */
:root[data-theme="halloween-dark"] {
  --ps-bg-primary: #0c090e;
  --ps-bg-secondary: #16101a;
  --ps-bg-tertiary: #221828;
  --ps-border: #3b2a43;
  --ps-text-primary: #f2e6d2;
  --ps-text-secondary: #c9b39a;
  --ps-text-inverse: #0c090e;
  --ps-accent: #ff7518;
  --ps-accent-hover: #ff9142;
  --ps-accent-subtle: #2b1609;
  --ps-success: #8fd14f;
  --ps-warning: #ffb627;
  --ps-danger: #ff4b55;
  --ps-info: #b38bff;
  --ps-nav-bg: #050307;
  --ps-nav-text: #ff9a3c;
  --ps-input-bg: #120c15;
  --ps-input-border: #4a3553;
  --ps-table-header-bg: #221828;
  /* A dark-orange LCD, black segments */
  --lcd-bg: #d86e1c;
  --lcd-ink: #140800;
  /* The accent and state colours as text, and the buttons: readable
     (4.5:1) on this theme */
  --ps-accent-text: #ff7518;
  --ps-info-text: #b38bff;
  --ps-success-text: #8fd14f;
  --ps-warning-text: #ffb627;
  --ps-danger-text: #ff4b55;
  --ps-on-accent: #111418;
  --ps-accent-btn: #ff7518;
  --ps-accent-btn-hover: #ff9142;
}

/* Orange glow under the top bar */
:root[data-theme="halloween-dark"] header[role="banner"] {
  box-shadow: 0 2px 18px -4px rgba(255, 117, 24, 0.55);
}

/* Headings in pumpkin orange, softly lit */
:root[data-theme="halloween-dark"] .card h2,
:root[data-theme="halloween-dark"] main h1 {
  color: var(--ps-accent-text, #ff7518);
  text-shadow: 0 0 10px rgba(255, 117, 24, 0.35);
}

/* Slime dripping from the top of every card, and a cobweb in its corner */
:root[data-theme="halloween-dark"] .card {
  position: relative;
  border-color: #4a2d17;
}
:root[data-theme="halloween-dark"] .card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0.5rem;
  right: 0.5rem;
  height: 13px;
  background: url(../../../static/img/themes/drip.svg) repeat-x;
  background-size: 120px 13px;
  opacity: 0.85;
  pointer-events: none;
}
:root[data-theme="halloween-dark"] .card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 64px;
  height: 64px;
  background: url(../../../static/img/themes/cobweb.svg) no-repeat top right;
  background-size: contain;
  opacity: 0.3;
  pointer-events: none;
}

/* The LCD bezels glow like a carved pumpkin */
:root[data-theme="halloween-dark"] .lcd-bezel {
  box-shadow: 0 0 16px rgba(255, 117, 24, 0.35), 0 2px 8px rgba(0, 0, 0, 0.6);
}

/* A bat crosses the top of the page now and then */
:root[data-theme="halloween-dark"] body::after {
  content: "";
  position: fixed;
  top: 64px;
  left: -80px;
  width: 52px;
  height: 23px;
  background: url(../../../static/img/themes/bat.svg) no-repeat center / contain;
  pointer-events: none;
  z-index: 90;
  animation: ps-bat 26s linear infinite;
}
@keyframes ps-bat {
  0% { transform: translate(0, 0) scaleY(1); }
  3% { transform: translate(8vw, -10px) scaleY(0.6); }
  6% { transform: translate(16vw, 6px) scaleY(1); }
  9% { transform: translate(24vw, -8px) scaleY(0.6); }
  12% { transform: translate(32vw, 10px) scaleY(1); }
  15% { transform: translate(40vw, -4px) scaleY(0.6); }
  18% { transform: translate(48vw, 8px) scaleY(1); }
  21% { transform: translate(56vw, -10px) scaleY(0.6); }
  24% { transform: translate(64vw, 4px) scaleY(1); }
  27% { transform: translate(72vw, -6px) scaleY(0.6); }
  30% { transform: translate(80vw, 8px) scaleY(1); }
  33% { transform: translate(88vw, -8px) scaleY(0.6); }
  36%, 100% { transform: translate(calc(100vw + 120px), 0) scaleY(1); }
}
/* Lightning now and then (pistar.js draws it) */
#ps-lightning {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 94;
}

@media (prefers-reduced-motion: reduce) {
  :root[data-theme="halloween-dark"] body::after { display: none; }
}
