/* FRAGMATCH After Dark: Halloween seasonal theme.
   Active only when <html data-season="halloween"> is set (owner toggle in the Promotions control center).
   Decorations never take clicks and freeze for players who prefer reduced motion. */

html[data-season="halloween"] {
  --hw-orange: #ff7a18;
  --hw-ember: #ff4d00;
  --hw-amber: #ffb347;
  --hw-purple: #8b2cf5;
  --hw-violet: #b26bff;
  --hw-night: #0b0614;
  --hw-slime: #8dff5a;
  --red: #ff7a18;
  --purple: #8b2cf5;
  --theme-accent: #ff7a18;
  --bg: #0b0614;
  color-scheme: dark;
  accent-color: #ff7a18;
}

/* ---------- Night sky backdrop ---------- */
html[data-season="halloween"] body,
html[data-season="halloween"] body .desktop-preview {
  background:
    radial-gradient(1100px 620px at 88% -8%, rgba(255, 140, 40, .16), transparent 60%),
    radial-gradient(900px 600px at 0% 110%, rgba(139, 44, 245, .22), transparent 62%),
    linear-gradient(180deg, #120821 0%, #0b0614 46%, #07040d 100%) !important;
  background-attachment: fixed !important;
}
html[data-season="halloween"] body .desktop-preview #view { background: transparent !important; }
html[data-season="halloween"] ::selection { background: rgba(255, 122, 24, .45); color: #fff; }
html[data-season="halloween"] * { scrollbar-color: rgba(255, 122, 24, .55) transparent; }

/* ---------- Brand colour swap: pumpkin orange + witch purple ---------- */
html[data-season="halloween"] body .primary,
html[data-season="halloween"] body button.primary,
html[data-season="halloween"] body .auth-submit,
html[data-season="halloween"] body .dp-button.dp-primary,
html[data-season="halloween"] body .profile-save-action,
html[data-season="halloween"] body .faction-app-tabs button.active,
html[data-season="halloween"] body .tab.active {
  border-color: transparent !important;
  background: linear-gradient(110deg, #ff8a1f 0%, #ff4d00 42%, #8b2cf5 100%) !important;
  color: #fff !important;
  box-shadow: 0 8px 26px rgba(255, 90, 10, .28), inset 0 1px 0 rgba(255, 255, 255, .22) !important;
  text-shadow: 0 1px 2px rgba(60, 10, 0, .55);
}
html[data-season="halloween"] body .primary:hover,
html[data-season="halloween"] body .dp-button.dp-primary:hover { filter: brightness(1.08) saturate(1.1); }

html[data-season="halloween"] body .dp-eyebrow,
html[data-season="halloween"] body .eyebrow,
html[data-season="halloween"] body .faction-app-title span,
html[data-season="halloween"] body .profile-edit-topbar > div > span,
html[data-season="halloween"] body .rep-tier-pill,
html[data-season="halloween"] body .discover-empty-hub .discover-empty-copy span { color: #ff9a3c !important; }

/* Navigation: active item glows like a lit pumpkin */
html[data-season="halloween"] body .nav-btn.active,
html[data-season="halloween"] body .dp-link.active {
  border-color: rgba(255, 122, 24, .75) !important;
  background: linear-gradient(135deg, rgba(255, 122, 24, .22), rgba(139, 44, 245, .22)) !important;
  color: #fff !important;
  box-shadow: 0 0 18px rgba(255, 110, 20, .25), inset 0 0 0 1px rgba(255, 160, 80, .18) !important;
}
html[data-season="halloween"] body .nav-btn.active svg,
html[data-season="halloween"] body .dp-link.active svg { color: #ffb347 !important; stroke: currentColor; filter: drop-shadow(0 0 6px rgba(255, 140, 40, .6)); }
html[data-season="halloween"] body .bottom-nav {
  border-top-color: rgba(255, 122, 24, .28) !important;
  box-shadow: 0 -10px 30px rgba(139, 44, 245, .18) !important;
}

/* Surfaces pick up a faint ember rim */
html[data-season="halloween"] body .panel,
html[data-season="halloween"] body .dp-surface,
html[data-season="halloween"] body .home-panel,
html[data-season="halloween"] body .activation-checklist,
html[data-season="halloween"] body .faction-hologram,
html[data-season="halloween"] body .modal-card {
  border-color: rgba(255, 122, 24, .2) !important;
}
html[data-season="halloween"] body h1 { text-shadow: 0 0 22px rgba(255, 110, 20, .28); }
html[data-season="halloween"] body .discover-player-card { border-color: rgba(255, 122, 24, .55) !important; box-shadow: 0 15px 40px rgba(0, 0, 0, .55), 0 0 30px rgba(255, 100, 20, .18) !important; }
html[data-season="halloween"] body .leaderboard-row.current-user { background: linear-gradient(90deg, rgba(255, 122, 24, .22), rgba(139, 44, 245, .16)) !important; }

/* Logo: a jack-o'-lantern perches on the brand mark */
html[data-season="halloween"] body .dp-brand,
html[data-season="halloween"] body .brand-lockup { position: relative; }
html[data-season="halloween"] body .dp-brand img:first-child,
html[data-season="halloween"] body .brand-lockup .brand-icon { filter: drop-shadow(0 0 10px rgba(255, 122, 24, .55)); }
html[data-season="halloween"] body .dp-brand::after,
html[data-season="halloween"] body .brand-lockup::after {
  content: "";
  position: absolute;
  top: -6px;
  left: 22px;
  width: 22px;
  height: 22px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M31 13c-1-6 3-10 8-10-3 3-3 6-2 10z' fill='%2345a32a'/%3E%3Cellipse cx='20' cy='38' rx='14' ry='19' fill='%23e8600e'/%3E%3Cellipse cx='44' cy='38' rx='14' ry='19' fill='%23e8600e'/%3E%3Cellipse cx='32' cy='38' rx='14' ry='21' fill='%23ff7a18'/%3E%3Cpath d='M21 33l6-6 4 6zM33 33l6-6 4 6z' fill='%23ffd23f'/%3E%3Cpath d='M19 42q13 12 26 0l-4 4-3-3-3 4-3-4-3 4-3-3-3 3z' fill='%23ffd23f'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 0 6px rgba(255, 170, 40, .8));
  pointer-events: none;
}

/* ---------- Home: "After Dark" event ribbon ---------- */
html[data-season="halloween"] body .home-command::before,
html[data-season="halloween"] body .dp-home-layout::before {
  content: "FRAGMATCH AFTER DARK  \2022  Halloween is live: squad up for the spookiest raids of the year";
  grid-column: 1 / -1;
  display: block;
  margin: 0 0 12px;
  padding: 12px 16px 12px 52px;
  border: 1px solid rgba(255, 122, 24, .45);
  border-radius: 14px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M31 13c-1-6 3-10 8-10-3 3-3 6-2 10z' fill='%2345a32a'/%3E%3Cellipse cx='20' cy='38' rx='14' ry='19' fill='%23e8600e'/%3E%3Cellipse cx='44' cy='38' rx='14' ry='19' fill='%23e8600e'/%3E%3Cellipse cx='32' cy='38' rx='14' ry='21' fill='%23ff7a18'/%3E%3Cpath d='M21 33l6-6 4 6zM33 33l6-6 4 6z' fill='%23ffd23f'/%3E%3Cpath d='M19 42q13 12 26 0l-4 4-3-3-3 4-3-4-3 4-3-3-3 3z' fill='%23ffd23f'/%3E%3C/svg%3E") 14px center / 28px no-repeat,
    linear-gradient(110deg, rgba(255, 110, 20, .24), rgba(139, 44, 245, .26)),
    #120821;
  color: #ffe2bf;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1.35;
  box-shadow: 0 10px 30px rgba(255, 90, 10, .12);
}

/* ---------- Atmosphere layer ---------- */
.season-decor { position: fixed; inset: 0; z-index: 3; overflow: hidden; pointer-events: none; }
.season-decor * { pointer-events: none; }
html:not([data-season="halloween"]) .season-halloween { display: none; }

.season-halloween .sd-sky {
  position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 50% 120%, rgba(255, 90, 10, .07), transparent 60%);
  mix-blend-mode: screen;
}

.season-halloween .sd-moon {
  position: absolute; top: 74px; right: clamp(-18px, 2vw, 48px);
  width: clamp(84px, 9vw, 132px); height: auto;
  opacity: .55;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 28px rgba(255, 170, 70, .55)) drop-shadow(0 0 70px rgba(255, 120, 30, .3));
  animation: sd-moon-breathe 9s ease-in-out infinite;
}
.season-halloween .sd-moon-cloud { animation: sd-cloud 26s ease-in-out infinite; transform-box: fill-box; }

.season-halloween .sd-web {
  position: absolute; top: 0; right: 0;
  width: clamp(120px, 14vw, 210px); height: auto;
  transform: scaleX(-1);
  opacity: .22;
}
.season-halloween .sd-web path { fill: none; stroke: #e8dcff; stroke-width: 1.1; stroke-linecap: round; }
.season-halloween .sd-spider line { stroke: #e8dcff; stroke-width: 1; }
.season-halloween .sd-spider circle { fill: #1a0f2b; stroke: #e8dcff; stroke-width: 1.2; }
.season-halloween .sd-spider path { fill: none; stroke: #e8dcff; stroke-width: 1.4; }
.season-halloween .sd-spider { animation: sd-spider 14s ease-in-out infinite; transform-origin: 150px 0; }

.season-halloween .sd-fog {
  position: absolute; left: -30%; width: 160%; height: 42vh; bottom: -12vh;
  background:
    radial-gradient(40% 55% at 20% 60%, rgba(178, 107, 255, .22), transparent 70%),
    radial-gradient(35% 50% at 55% 70%, rgba(255, 140, 60, .12), transparent 70%),
    radial-gradient(45% 60% at 85% 55%, rgba(178, 107, 255, .18), transparent 70%);
  filter: blur(18px);
  mix-blend-mode: screen;
  opacity: .8;
  animation: sd-fog 48s linear infinite alternate;
}
.season-halloween .sd-fog-b { bottom: -18vh; opacity: .55; animation-duration: 66s; animation-direction: alternate-reverse; }

.season-halloween .sd-embers i {
  position: absolute; bottom: -12px; left: var(--x);
  width: var(--s); height: var(--s);
  border-radius: 50%;
  background: #ffb347;
  box-shadow: 0 0 8px 2px rgba(255, 120, 30, .8);
  opacity: 0;
  mix-blend-mode: screen;
  animation: sd-ember var(--t) linear var(--d) infinite;
}

.season-halloween .sd-bat {
  position: absolute; left: -80px; width: 46px;
  color: #120821;
  filter: drop-shadow(0 0 6px rgba(255, 140, 60, .45));
  opacity: 0;
}
.season-halloween .sd-bat svg { width: 100%; height: auto; fill: currentColor; animation: sd-flap .32s ease-in-out infinite alternate; transform-origin: 50% 60%; }
.season-halloween .sd-bat-1 { top: 16vh; animation: sd-fly 21s linear 2s infinite; }
.season-halloween .sd-bat-2 { top: 9vh; width: 30px; animation: sd-fly 27s linear 11s infinite; }
.season-halloween .sd-bat-3 { top: 26vh; width: 36px; animation: sd-fly-back 33s linear 19s infinite; }

@keyframes sd-moon-breathe { 50% { opacity: .68; filter: drop-shadow(0 0 34px rgba(255, 170, 70, .65)) drop-shadow(0 0 90px rgba(255, 120, 30, .35)); } }
@keyframes sd-cloud { 50% { transform: translateX(-14px); } }
@keyframes sd-spider { 0%, 100% { transform: scaleY(1); } 45% { transform: scaleY(.55); } 60% { transform: scaleY(.62); } }
@keyframes sd-fog { to { transform: translateX(18%); } }
@keyframes sd-ember {
  0% { transform: translate(0, 0); opacity: 0; }
  12% { opacity: .9; }
  60% { transform: translate(24px, -55vh); opacity: .55; }
  100% { transform: translate(-12px, -105vh); opacity: 0; }
}
@keyframes sd-flap { from { transform: scaleY(1); } to { transform: scaleY(.45); } }
@keyframes sd-fly {
  0% { transform: translate(0, 0); opacity: 0; }
  4% { opacity: .9; }
  25% { transform: translate(30vw, -4vh); }
  50% { transform: translate(60vw, 3vh); }
  75% { transform: translate(90vw, -6vh); opacity: .9; }
  80%, 100% { transform: translate(115vw, -2vh); opacity: 0; }
}
@keyframes sd-fly-back {
  0% { transform: translate(115vw, 0) scaleX(-1); opacity: 0; }
  5% { opacity: .85; }
  50% { transform: translate(55vw, 6vh) scaleX(-1); }
  85% { transform: translate(-10vw, -3vh) scaleX(-1); opacity: .85; }
  90%, 100% { transform: translate(-20vw, 0) scaleX(-1); opacity: 0; }
}

/* Phones: lighter atmosphere, keep the header icons clear */
@media (max-width: 700px) {
  .season-halloween .sd-moon { top: 96px; right: -26px; width: 92px; opacity: .42; }
  .season-halloween .sd-web { width: 96px; top: 64px; opacity: .16; }
  .season-halloween .sd-embers i:nth-child(n + 9) { display: none; }
  .season-halloween .sd-bat-3 { display: none; }
  html[data-season="halloween"] body .home-command::before { font-size: 12px; }
}

/* Owner control card */
.season-admin-card {
  display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; align-items: center; gap: 18px;
  margin: 0 0 18px; padding: 16px 18px;
  border: 1px solid rgba(255, 122, 24, .35); border-radius: 16px;
  background: linear-gradient(110deg, rgba(255, 110, 20, .12), rgba(139, 44, 245, .14)), #0f0a1a;
}
.season-admin-card.is-live { border-color: #ff7a18; box-shadow: 0 0 0 1px rgba(255, 122, 24, .4), 0 12px 34px rgba(255, 90, 10, .18); }
.season-admin-art {
  width: 84px; height: 84px; border-radius: 18px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M31 13c-1-6 3-10 8-10-3 3-3 6-2 10z' fill='%2345a32a'/%3E%3Cellipse cx='20' cy='38' rx='14' ry='19' fill='%23e8600e'/%3E%3Cellipse cx='44' cy='38' rx='14' ry='19' fill='%23e8600e'/%3E%3Cellipse cx='32' cy='38' rx='14' ry='21' fill='%23ff7a18'/%3E%3Cpath d='M21 33l6-6 4 6zM33 33l6-6 4 6z' fill='%23ffd23f'/%3E%3Cpath d='M19 42q13 12 26 0l-4 4-3-3-3 4-3-4-3 4-3-3-3 3z' fill='%23ffd23f'/%3E%3C/svg%3E") center 58% / 64% no-repeat,
    radial-gradient(circle at 70% 25%, #ffe2a8 0 14%, transparent 15%),
    linear-gradient(160deg, #2a1048, #120821);
  box-shadow: inset 0 0 0 1px rgba(255, 160, 80, .25);
}
.season-admin-copy span { color: #ff9a3c; font-size: 11px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.season-admin-copy h2 { margin: 4px 0; font-size: 20px; }
.season-admin-copy p { margin: 0; color: rgba(230, 220, 255, .72); font-size: 13.5px; }
.season-admin-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.season-admin-actions button { min-height: 42px; padding: 0 16px; white-space: nowrap; }
@media (max-width: 700px) {
  .season-admin-card { grid-template-columns: 64px minmax(0, 1fr); }
  .season-admin-art { width: 64px; height: 64px; }
  .season-admin-actions { grid-column: 1 / -1; justify-content: stretch; }
  .season-admin-actions button { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .season-halloween *, .season-halloween .sd-moon { animation: none !important; }
  .season-halloween .sd-bats, .season-halloween .sd-embers { display: none; }
}

/* Layering: sky + moon sit BEHIND the app (peeking through gaps); web/fog/embers/bats float in front. */
html[data-season="halloween"] body .desktop-preview,
html[data-season="halloween"] body main.shell { background: transparent !important; }
html[data-season="halloween"] #app { position: relative; z-index: 1; }
.season-decor.season-decor-back { z-index: 0; }
.season-decor-back .sd-moon { top: 54px; right: clamp(8px, 4vw, 70px); width: clamp(110px, 12vw, 190px); opacity: .95; mix-blend-mode: normal; }
.season-halloween .sd-fog { opacity: .5; }
.season-halloween .sd-fog-b { opacity: .35; }
@media (max-width: 700px) {
  .season-decor-back .sd-moon { top: 70px; right: -20px; width: 120px; opacity: .9; }
}

/* Leftover brand accents found by a colour sweep with the theme on */
html[data-season="halloween"] body .dp-hero h2 em,
html[data-season="halloween"] body .dp-hero-content h2 em,
html[data-season="halloween"] body .home-hero h1 em,
html[data-season="halloween"] body .discover-welcome span {
  background: linear-gradient(100deg, #ffb347 0%, #ff7a18 45%, #b26bff 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  filter: drop-shadow(0 0 14px rgba(255, 120, 30, .35));
}
html[data-season="halloween"] body .dp-hero .dp-eyebrow { color: #ffb347 !important; }
html[data-season="halloween"] body header.faction-app-bar { background: linear-gradient(100deg, rgba(255, 110, 20, .16), transparent 45%), #120a1f !important; border-color: rgba(255, 122, 24, .3) !important; }
html[data-season="halloween"] body .squad-card-photo { border-color: rgba(255, 122, 24, .6) !important; }
html[data-season="halloween"] body .home-feature-card:hover,
html[data-season="halloween"] body .profile-edit-tile:hover { border-color: rgba(255, 122, 24, .6) !important; }
html[data-season="halloween"] body .profile-edit-tile-grid .profile-edit-tile > span,
html[data-season="halloween"] body .modal.profile-editor-modal .profile-edit-tile-grid .profile-edit-tile > span { border-color: rgba(255, 122, 24, .4) !important; background: rgba(255, 122, 24, .12) !important; }

/* Keep any text that lands in front of the moon readable */
.season-decor-back .sd-moon { opacity: .58; }
@media (max-width: 700px) { .season-decor-back .sd-moon { opacity: .5; } }
html[data-season="halloween"] body .dp-heading,
html[data-season="halloween"] body .dp-heading *,
html[data-season="halloween"] body .dp-quota,
html[data-season="halloween"] body .dp-quota *,
html[data-season="halloween"] body .profile-edit-topbar,
html[data-season="halloween"] body .route-hero { text-shadow: 0 1px 2px rgba(0, 0, 0, .9), 0 0 14px rgba(8, 3, 16, .95); }

html[data-season="halloween"] body .home-primary-action {
  border-color: rgba(255, 140, 50, .6) !important;
  background: linear-gradient(110deg, #ff8a1f 0%, #ff4d00 45%, #8b2cf5 100%) !important;
  box-shadow: 0 8px 22px rgba(255, 90, 10, .3) !important;
}
html[data-season="halloween"] body .home-primary-action svg { color: #fff !important; }
html[data-season="halloween"] body .home-referral-later span,
html[data-season="halloween"] body .home-challenge-main > span,
html[data-season="halloween"] body .profile-section-head > span,
html[data-season="halloween"] body .home-panel-head span { color: #ff9a3c !important; }
html[data-season="halloween"] body .home-status-game svg,
html[data-season="halloween"] body .discover-game-icon { color: #ff7a18 !important; }
