/* Halloween 2026 reskin. Every rule is gated by server-authorized body state. */
body.is-halloween-theme {
  --halloween-bg: #120914;
  --halloween-bg-deep: #09060c;
  --halloween-surface: #211528;
  --halloween-surface-soft: #2c1a35;
  --halloween-orange: #ff8a00;
  --halloween-orange-soft: #ffb347;
  --halloween-purple: #8f3fff;
  --halloween-purple-soft: #be78ff;
  --halloween-green: #75ff57;
  --halloween-green-soft: #3affac;
  --halloween-red: #ff4655;
  --halloween-ink: #fff4e7;
  --halloween-muted: #c5afc0;
  --halloween-line: rgba(255, 138, 0, .2);
  --bg: var(--halloween-bg);
  --surface: var(--halloween-surface);
  --surface-soft: var(--halloween-surface-soft);
  --ink: var(--halloween-ink);
  --muted: var(--halloween-muted);
  --line: #503550;
  --accent: #f18a28;
  --accent-strong: #ffc06b;
  --button-bg: #62323d;
  --featured-border: #89535d;
  --featured-glow-start: rgba(255, 138, 0, .22);
  --featured-glow-end: rgba(143, 63, 255, .2);
  --search-fade: rgba(18, 9, 20, 0);
  --shadow: 0 16px 40px rgba(6, 2, 10, .36);
  background:
    radial-gradient(circle at 8% 12%, rgba(255, 138, 0, .12), transparent 25%),
    radial-gradient(circle at 92% 18%, rgba(143, 63, 255, .16), transparent 28%),
    radial-gradient(circle at 50% 100%, rgba(117, 255, 87, .045), transparent 30%),
    var(--bg);
}

body.is-halloween-theme[data-theme="light"] {
  --halloween-bg: #f3e6cf;
  --halloween-bg-deep: #e7d3b4;
  --halloween-surface: #fff4df;
  --halloween-surface-soft: #ead7ba;
  --halloween-orange: #b7580b;
  --halloween-orange-soft: #874009;
  --halloween-purple: #74369b;
  --halloween-purple-soft: #5c2c7c;
  --halloween-green: #2e7046;
  --halloween-green-soft: #1e7652;
  --halloween-red: #a63842;
  --halloween-ink: #281827;
  --halloween-muted: #695467;
  --halloween-line: rgba(104, 52, 25, .22);
  --bg: var(--halloween-bg);
  --surface: var(--halloween-surface);
  --surface-soft: var(--halloween-surface-soft);
  --ink: var(--halloween-ink);
  --muted: var(--halloween-muted);
  --line: #c8ad94;
  --accent: #aa4e0b;
  --accent-strong: #683187;
  --button-bg: #e8c9a3;
  --featured-border: #ad7f75;
  --featured-glow-start: rgba(183, 88, 11, .14);
  --featured-glow-end: rgba(116, 54, 155, .12);
  --search-fade: rgba(243, 230, 207, 0);
  --shadow: 0 10px 28px rgba(77, 45, 38, .12);
  background:
    radial-gradient(circle at 8% 12%, rgba(183, 88, 11, .11), transparent 27%),
    radial-gradient(circle at 92% 18%, rgba(116, 54, 155, .095), transparent 30%),
    var(--bg);
}

body.is-halloween-theme .topbar {
  position: relative;
  border-bottom: 1px solid var(--halloween-line);
  background: linear-gradient(90deg, rgba(255, 138, 0, .055), transparent 42%, rgba(143, 63, 255, .08));
}
body.is-halloween-theme .topbar::after {
  content: "";
  position: absolute;
  top: -13px;
  right: -14px;
  width: 75px;
  height: 75px;
  background: url("./assets/halloween/decor/cobweb.svg") no-repeat top right / contain;
  opacity: .14;
  pointer-events: none;
}
body.is-halloween-theme .brand-logo {
  border: 1px solid color-mix(in srgb, var(--halloween-purple) 60%, var(--halloween-orange));
  box-shadow: 0 0 14px rgba(255, 138, 0, .25), 0 0 3px var(--halloween-green-soft);
}
body.is-halloween-theme .topbar-brand h1 { text-shadow: 0 0 18px rgba(143, 63, 255, .26); }
body.is-halloween-theme .topbar-brand .eyebrow::after {
  content: "";
  display: inline-block;
  width: 15px;
  height: 15px;
  margin-left: 6px;
  vertical-align: -3px;
  background: url("./assets/halloween/decor/pumpkin.svg") no-repeat center / contain;
  opacity: .7;
  pointer-events: none;
}
body.is-halloween-theme .menu-button,
body.is-halloween-theme .theme-button,
body.is-halloween-theme .wallet-button {
  border-color: var(--halloween-line);
  background: color-mix(in srgb, var(--surface) 86%, var(--halloween-purple) 14%);
  box-shadow: 0 5px 16px rgba(26, 6, 30, .2);
}

body.is-halloween-theme .search-box {
  border-color: color-mix(in srgb, var(--halloween-purple) 50%, var(--halloween-line));
  background: color-mix(in srgb, var(--surface) 88%, var(--halloween-purple) 12%);
  box-shadow: 0 7px 20px rgba(25, 5, 32, .18);
}
body.is-halloween-theme .search-box:focus-within {
  border-color: var(--halloween-orange);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--halloween-green) 30%, transparent);
}
body.is-halloween-theme .category-button {
  border-color: color-mix(in srgb, var(--halloween-purple) 32%, var(--line));
  background: color-mix(in srgb, var(--surface) 85%, var(--halloween-purple) 15%);
}
body.is-halloween-theme .category-button.is-active {
  border-color: color-mix(in srgb, var(--halloween-orange) 75%, var(--halloween-purple));
  background: linear-gradient(125deg, rgba(255, 138, 0, .3), rgba(143, 63, 255, .22));
  color: var(--ink);
}
body.is-halloween-theme .category-button:focus-visible,
body.is-halloween-theme .side-menu-link:focus-visible,
body.is-halloween-theme .app-row:focus-visible { outline: 2px solid var(--halloween-green); outline-offset: 2px; }

body.is-halloween-theme .featured-band:not(.is-halloween-message) {
  border-color: var(--halloween-orange);
  box-shadow: 0 12px 30px rgba(12, 4, 19, .32), 0 0 18px rgba(143, 63, 255, .16);
}
body.is-halloween-theme .featured-band:not(.is-halloween-message)::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: url("./assets/halloween/decor/cobweb.svg"), url("./assets/halloween/decor/pumpkin.svg");
  background-repeat: no-repeat;
  background-size: 90px 90px, 31px 31px;
  background-position: left top, right 8px bottom 6px;
  opacity: .21;
  pointer-events: none;
}
body.is-halloween-theme .featured-band:not(.is-halloween-message)::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: -5px;
  z-index: 1;
  width: 95px;
  height: 100px;
  background: url("./assets/halloween/malicious-block-producer.webp") no-repeat right bottom / contain;
  opacity: .13;
  pointer-events: none;
}
body.is-halloween-theme .featured-slide { box-shadow: inset 0 0 45px rgba(68, 13, 81, .31); }
body.is-halloween-theme .featured-button {
  border: 1px solid rgba(255, 179, 71, .52);
  background: linear-gradient(130deg, #8d3a13, #562276);
  color: #fff8ed;
}
body.is-halloween-theme[data-theme="light"] .featured-button { background: linear-gradient(130deg, #9b430e, #663083); }

body.is-halloween-theme .app-row {
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 91%, var(--halloween-purple) 9%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--halloween-purple) 13%, transparent);
}
body.is-halloween-theme .app-row:hover {
  background: color-mix(in srgb, var(--surface) 85%, var(--halloween-orange) 15%);
  box-shadow: inset 0 0 0 1px var(--halloween-line);
}
body.is-halloween-theme .app-section .section-title { position: relative; }
body.is-halloween-theme .app-section:nth-of-type(3n) .section-title::after {
  content: "";
  position: absolute;
  right: 8px;
  top: -4px;
  width: 29px;
  height: 29px;
  background: url("./assets/halloween/decor/ghost.svg") no-repeat center / contain;
  opacity: .19;
  pointer-events: none;
}
body.is-halloween-theme .section-title-button:hover { color: var(--halloween-orange-soft); }

body.is-halloween-theme .side-menu {
  border-left-color: var(--halloween-orange);
  background: radial-gradient(circle at 100% 8%, rgba(143, 63, 255, .2), transparent 34%), var(--surface);
  box-shadow: -20px 0 48px rgba(12, 3, 18, .45);
}
body.is-halloween-theme .side-menu::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  z-index: 0;
  width: 115px;
  height: 115px;
  background: url("./assets/halloween/decor/cobweb.svg") no-repeat top right / contain;
  opacity: .18;
  pointer-events: none;
}
body.is-halloween-theme .side-menu::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 0;
  width: 140px;
  height: 225px;
  background: url("./assets/halloween/block-keeper.webp") no-repeat right bottom / contain;
  opacity: .11;
  pointer-events: none;
}
body.is-halloween-theme .side-menu > * { position: relative; z-index: 1; }
body.is-halloween-theme .side-menu-link { border-color: var(--halloween-line); }
body.is-halloween-theme .side-menu-link:hover { border-color: var(--halloween-purple-soft); }
body.is-halloween-theme .halloween-menu-link { color: var(--halloween-orange-soft); }

body.is-halloween-theme .ranking-view { position: relative; }
body.is-halloween-theme .ranking-view::before {
  content: "";
  position: absolute;
  top: 82px;
  right: 2px;
  width: 75px;
  height: 96px;
  background: url("./assets/halloween/good-block-producer.webp") no-repeat right top / contain;
  opacity: .1;
  pointer-events: none;
}
body.is-halloween-theme .ranking-list-shell {
  border-color: var(--halloween-line);
  box-shadow: 0 9px 25px rgba(26, 6, 35, .12);
}
body.is-halloween-theme .ranking-list-head { background: color-mix(in srgb, var(--surface-soft) 78%, var(--halloween-purple) 22%); }
body.is-halloween-theme .ranking-row { border-bottom-color: var(--halloween-line); }

body.is-halloween-theme .wallet-analytics-card,
body.is-halloween-theme .wallet-mining-app-card {
  --accent-strong: var(--halloween-green-soft);
  border-color: var(--halloween-line);
}
body.is-halloween-theme .wallet-mining-app-card { background: color-mix(in srgb, var(--surface) 90%, var(--halloween-purple) 10%); }
body.is-halloween-theme .achievements-hero,
body.is-halloween-theme .achievement-group,
body.is-halloween-theme .achievement-item {
  border-color: var(--halloween-line);
  box-shadow: 0 6px 22px rgba(143, 63, 255, .06);
}
body.is-halloween-theme .supporter-view .supporter-hero,
body.is-halloween-theme .supporter-view .supporter-card {
  border-color: color-mix(in srgb, var(--halloween-purple) 38%, var(--halloween-line));
  background: linear-gradient(135deg, color-mix(in srgb, var(--surface-soft) 86%, var(--halloween-purple) 14%), var(--surface));
}
body.is-halloween-theme .supporter-view .supporter-hero { position: relative; }
body.is-halloween-theme .supporter-view .supporter-hero::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 90px;
  height: 90px;
  background: url("./assets/halloween/decor/cobweb.svg") no-repeat top right / contain;
  opacity: .11;
  pointer-events: none;
}

body.is-halloween-theme .submit-app-footer { position: relative; }
body.is-halloween-theme .submit-app-footer::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 95px;
  height: 160px;
  background: url("./assets/halloween/nacki.webp") no-repeat left bottom / contain;
  opacity: .1;
  pointer-events: none;
}
body.is-halloween-theme .submit-app-footer::after {
  content: "";
  position: absolute;
  right: 3px;
  bottom: 7px;
  width: 28px;
  height: 28px;
  background: url("./assets/halloween/decor/candy.svg") no-repeat center / contain;
  opacity: .36;
  pointer-events: none;
}

body.is-halloween-theme .halloween-entry,
body.is-halloween-theme .halloween-2026 {
  --h-ink: var(--halloween-ink);
  --h-muted: var(--halloween-muted);
  --h-line: rgba(255, 138, 0, .38);
  --h-surface: rgba(17, 10, 22, .91);
  --h-ember: var(--halloween-orange-soft);
  --h-emerald: var(--halloween-green-soft);
}
body.is-halloween-theme .halloween-entry {
  border-color: rgba(255, 138, 0, .57);
  background: radial-gradient(circle at 95% 5%, rgba(143, 63, 255, .28), transparent 44%), linear-gradient(140deg, #221128, #110b18 60%, #2c151d);
  box-shadow: 0 12px 30px rgba(5, 2, 9, .35), 0 0 18px rgba(255, 138, 0, .11);
}
body.is-halloween-theme .halloween-entry [data-halloween-entry] { background: linear-gradient(125deg, #a64a12, #602884); color: #fff; }
body.is-halloween-theme .halloween-2026 {
  border-color: rgba(255, 138, 0, .42);
  background: radial-gradient(circle at 96% 6%, rgba(143, 63, 255, .25), transparent 32%), radial-gradient(circle at 2% 74%, rgba(255, 70, 85, .12), transparent 34%), linear-gradient(155deg, #120b17, #09090e 58%, #211026);
  box-shadow: 0 18px 50px rgba(8, 2, 12, .4), 0 0 20px rgba(143, 63, 255, .12);
}
body.is-halloween-theme .halloween-2026::before {
  content: "";
  position: absolute;
  bottom: 16px;
  right: -18px;
  z-index: 0;
  width: 145px;
  height: 150px;
  background: url("./assets/halloween/horror-girl.webp") no-repeat right bottom / cover;
  opacity: .06;
  pointer-events: none;
}
body.is-halloween-theme .halloween-2026::after {
  content: "";
  position: absolute;
  right: -18px;
  top: 10px;
  z-index: 0;
  width: 180px;
  height: 340px;
  background: url("./assets/halloween/nacki-sword.webp") no-repeat right top / contain;
  opacity: .17;
  pointer-events: none;
}
body.is-halloween-theme .halloween-2026 > * { position: relative; z-index: 1; }
body.is-halloween-theme .halloween-header { position: relative; }
body.is-halloween-theme .halloween-header::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 0;
  width: 27px;
  height: 27px;
  background: url("./assets/halloween/decor/bones.svg") no-repeat center / contain;
  opacity: .28;
  pointer-events: none;
}
body.is-halloween-theme .halloween-collect-dialog { border-color: rgba(255, 138, 0, .5); background: radial-gradient(circle at 90% 0%, rgba(143, 63, 255, .18), transparent 45%), #180d20; }

body.is-halloween-theme[data-theme="light"] .halloween-entry,
body.is-halloween-theme[data-theme="light"] .halloween-2026 {
  --h-ink: #2a192b;
  --h-muted: #665567;
  --h-line: rgba(151, 74, 22, .35);
  --h-surface: rgba(255, 248, 231, .93);
  --h-ember: #8e440e;
  --h-emerald: #1c7045;
}
body.is-halloween-theme[data-theme="light"] .halloween-entry {
  background: radial-gradient(circle at 95% 5%, rgba(143, 63, 255, .11), transparent 42%), linear-gradient(140deg, #fff2dc, #f5e5ce 62%, #e9d2c7);
}
body.is-halloween-theme[data-theme="light"] .halloween-2026 {
  background: radial-gradient(circle at 96% 6%, rgba(143, 63, 255, .12), transparent 31%), linear-gradient(155deg, #fff2dc, #f5e5cf 63%, #e9d8cd);
}
body.is-halloween-theme[data-theme="light"] .halloween-2026::before { opacity: .035; }
body.is-halloween-theme[data-theme="light"] .halloween-2026::after { opacity: .085; }
body.is-halloween-theme[data-theme="light"] .halloween-collect-dialog { background: radial-gradient(circle at 90% 0%, rgba(143, 63, 255, .1), transparent 45%), #fff2dc; }

@media (max-width: 480px) {
  body.is-halloween-theme .featured-band:not(.is-halloween-message)::after { width: 67px; height: 78px; opacity: .1; }
  body.is-halloween-theme .side-menu::after { width: 95px; height: 155px; opacity: .075; }
  body.is-halloween-theme .ranking-view::before { width: 54px; height: 70px; opacity: .07; }
  body.is-halloween-theme .halloween-2026::before { width: 90px; height: 95px; opacity: .035; }
  body.is-halloween-theme .halloween-2026::after { width: 105px; height: 210px; opacity: .12; }
  body.is-halloween-theme .submit-app-footer::before { width: 68px; height: 120px; opacity: .07; }
}

@media (max-width: 380px) {
  body.is-halloween-theme .topbar { gap: 7px; }
  body.is-halloween-theme .topbar-brand { gap: 7px; }
  body.is-halloween-theme .topbar-actions { gap: 4px; }
  body.is-halloween-theme .brand-logo { width: 36px; height: 36px; }
  body.is-halloween-theme .topbar-brand h1 { font-size: 18px; }
  body.is-halloween-theme .featured-band:not(.is-halloween-message) { height: 190px; min-height: 190px; max-height: 190px; }
}

@media (prefers-reduced-motion: reduce) {
  body.is-halloween-theme *,
  body.is-halloween-theme *::before,
  body.is-halloween-theme *::after {
    animation: none !important;
    transition-duration: .01ms !important;
  }
}
