/* Seasonal mood themes (seasons.js): Halloween, Christmas and Аня's birthday.
   Palettes override the brand tokens; decorations are pointer-events: none
   (birthday toys aside) and sit below tooltips (60), modals (200) and toasts (400). */

.season-fx { pointer-events: none; }
.season-sound {
  font-size: 14px; line-height: 1; width: 34px; height: 34px; border-radius: var(--r-pill);
  border: none; background: var(--elevated); cursor: pointer;
}
.season-sound:hover { background: var(--surface); }
@media print { .season-fx { display: none !important; } }

/* ══ Halloween ═══════════════════════════════════════════════════════ */

body[data-anya-theme="halloween"] {
  --bg: #16111c; --surface: #221a2a; --paper-2: #2a2133; --elevated: #33283e;
  --ink: #f2e7d5; --ink-2: #d3c4dc; --subtle: #9d8cab;
  --accent: #ff7a1a; --accent-ink: #ff9b45; --accent-weak: rgba(255, 122, 26, 0.16);
  --red: #ff5468;   --red-weak: rgba(255, 84, 104, 0.16);
  --green: #8be08f; --green-weak: rgba(139, 224, 143, 0.14);
  --blue: #a593ff;  --blue-weak: rgba(165, 147, 255, 0.16);
  --amber: #ffc04d; --amber-weak: rgba(255, 192, 77, 0.18);
  --mint: var(--green); --yellow: var(--amber);
  --st-pre: #8f9dff; --st-open: #6fd18a; --st-full: #ffb347; --st-live: #e9dcff; --st-done: #6f6580; --st-off: #ff5468;
  --stroke: rgba(255, 255, 255, 0.09); --divider: rgba(255, 255, 255, 0.06); --field-border: rgba(255, 255, 255, 0.17);
  --sh-1: 0 1px 2px rgba(0, 0, 0, 0.4); --sh-2: 0 24px 64px rgba(0, 0, 0, 0.6);
  --sidebar-bg: #0b080f;
  color-scheme: dark;
}
body[data-anya-theme="halloween"] main { padding-bottom: 130px; }

/* ── Her own garland over the mood bar (Halloween and Christmas); her wreath is Christmas-only ── */
body:is([data-anya-theme="halloween"], [data-anya-theme="xmas"]) .anya-bar { position: relative; margin-top: 36px; }
.ln-garland { position: absolute; left: -40px; right: -40px; top: -56px; height: 60px; overflow: hidden; }
.ln-garland svg { display: block; }
/* Lanterns just glow (Halloween adds the rain); each one swings when the mouse brushes it. */
.ln-swing { transform-box: fill-box; transform-origin: 50% 0%; }
.ln-hit { pointer-events: all; }
.ln-halo { animation: ln-breathe 3.2s ease-in-out infinite; }
@keyframes ln-breathe { 50% { opacity: .5; } }
.ln-garland.wet .ln-light { animation: ln-flicker .24s steps(2, jump-none) infinite; }
@keyframes ln-flicker { 0% { opacity: 1; } 50% { opacity: .3; } 100% { opacity: .95; } }
.ln.dead .ln-light { opacity: .1 !important; animation: none !important; }
.ln-say {
  position: absolute; left: -30px; top: -26px; z-index: 3; white-space: nowrap;
  padding: 6px 11px; border-radius: 10px; font-size: 13px; font-weight: 600;
  background: var(--surface); color: var(--ink); border: 1px solid var(--stroke); box-shadow: var(--sh-2);
  opacity: 0; transform: translateY(-4px); transition: opacity .2s ease, transform .2s ease;
}
.ln-say.on { opacity: 1; transform: none; }
/* Behind the content like the pillows: it hangs on the "door" between the greeting and the moods. */
.season-wreath { position: absolute; left: 58%; top: -54px; width: 142px; z-index: -1; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.3)); }
.season-wreath svg { display: block; width: 100%; height: auto; }
.wr-light { animation: xm-twinkle 1.4s ease-in-out infinite; }
.hw-rain { position: absolute; inset: 0; }
body[data-anya-theme="halloween"] h2 { text-shadow: 0 0 18px rgba(255, 122, 26, 0.35); }

/* Chips that draw ink as a background with white text: in the dark palette ink
   is bone, so their text turns dark. */
body[data-anya-theme="halloween"] :is(.brand-badge, .btn-small.primary, .btn-small.primary:hover, .toast, .pp-dep.on, .occ, .cu-seg.on) { color: #1a1220; }
body[data-anya-theme="halloween"] .hint::after,
body[data-anya-theme="halloween"] [data-tip]:not(.hint)::after { color: #1a1220; }
body[data-anya-theme="halloween"] :is(.cu-bulk, .ac-bar) { background: #3a2a48; color: var(--ink); }
body[data-anya-theme="halloween"] .btn-small.primary { background: var(--accent); border-color: var(--accent); }
body[data-anya-theme="halloween"] .toast.err { color: #fff; }
body[data-anya-theme="halloween"] .nav-item.active .nav-badge { color: #b84a00; }
body[data-anya-theme="halloween"] .ct-hero { background: var(--tile, #2d2238); }
body[data-anya-theme="halloween"] :is(.cu-bulk input, .ct-hero-edit:hover) { background: var(--surface); }
/* Print previews stay paper-white whatever the mood. */
body[data-anya-theme="halloween"] .print-page {
  --ink: #2b3655; --ink-2: #4a5473; --subtle: #858ba0; --surface: #fffdf8; --elevated: #efe8db;
  --stroke: rgba(43, 54, 85, 0.11); --divider: rgba(43, 54, 85, 0.07); color: var(--ink);
}

.hw-fog {
  position: fixed; left: 236px; right: 0; bottom: 0; height: 150px; z-index: 50;
  background:
    radial-gradient(40% 70% at 20% 100%, rgba(190, 170, 220, 0.16), transparent 70%),
    radial-gradient(35% 60% at 60% 100%, rgba(190, 170, 220, 0.13), transparent 70%),
    radial-gradient(45% 80% at 95% 100%, rgba(190, 170, 220, 0.15), transparent 70%);
  background-size: 140% 100%;
  animation: hw-fog 18s ease-in-out infinite alternate;
}
@keyframes hw-fog { from { background-position: 0 0; } to { background-position: 100% 0; } }

.hw-pumpkins { position: fixed; bottom: 4px; left: 252px; z-index: 53; display: flex; align-items: flex-end; gap: 2px; }
.hw-pumpkins-right { left: auto; right: 22px; }
.pk { display: block; filter: drop-shadow(0 0 16px rgba(255, 140, 30, 0.35)); pointer-events: auto; cursor: pointer; transform-origin: 50% 100%; transition: filter .25s ease; }
.pk.flare { filter: drop-shadow(0 0 28px rgba(255, 170, 40, 0.95)); }
.pk.flare .pk-face { animation: none; opacity: 1; }
.hw-ember { position: absolute; left: 0; top: 0; width: 5px; height: 5px; border-radius: 50%; background: #ffc35a; box-shadow: 0 0 8px 3px rgba(255, 140, 30, 0.7); }
.pk svg { display: block; width: 100%; height: auto; }
.pk-1 { width: 92px; } .pk-2 { width: 64px; } .pk-3 { width: 52px; } .pk-4 { width: 78px; }
.pk-face { animation: pk-flicker 2.6s infinite; }
@keyframes pk-flicker {
  0%, 100% { opacity: 1; } 18% { opacity: .78; } 22% { opacity: .95; } 47% { opacity: .7; }
  52% { opacity: 1; } 71% { opacity: .85; } 76% { opacity: .62; } 80% { opacity: .96; }
}

/* The spider from the house across the street: sits on the right edge of the
   screen like on the wall of that building, now and then crawls along it. */
.hw-spider {
  position: fixed; right: -58px; top: 19vh; width: 330px; z-index: 57;
  filter: drop-shadow(0 0 1.5px rgba(214, 196, 255, 0.6)) drop-shadow(0 12px 18px rgba(0, 0, 0, 0.6));
}
.hw-spider svg { display: block; width: 100%; height: auto; overflow: visible; }
@media (max-width: 1280px) { .hw-spider { width: 240px; right: -42px; } }
.sp-leg { transform-box: view-box; animation: sp-twitch 7s ease-in-out infinite; }
.hw-spider.agitated .sp-leg { animation-duration: .5s !important; }
@keyframes sp-twitch {
  0%, 86%, 100% { transform: rotate(0); }
  89% { transform: rotate(var(--tw)); }
  92% { transform: rotate(calc(var(--tw) * -0.5)); }
  95% { transform: rotate(calc(var(--tw) * 0.4)); }
}
.sp-abd { transform-box: fill-box; transform-origin: center; animation: sp-breathe 4.5s ease-in-out infinite; }
@keyframes sp-breathe { 50% { transform: scale(1.035); } }
.sp-eyes { animation: sp-eyes 3.4s infinite; }
.sp-hit { pointer-events: all; cursor: pointer; }
.hw-spider.angry .sp-eyes { animation: none; }
.hw-spider.angry .sp-eyes circle { fill: #ff2626; }
@keyframes sp-eyes { 0%, 100% { opacity: 1; } 40% { opacity: .55; } 44% { opacity: 1; } 70% { opacity: .8; } }

.hw-layer { position: fixed; inset: 0; z-index: 58; overflow: hidden; }
.hw-ghost, .hw-bat, .hw-witch, .hw-eyes { position: absolute; left: 0; top: 0; will-change: transform, opacity; }
.hw-ghost { width: 96px; filter: drop-shadow(0 0 16px rgba(205, 195, 255, 0.65)); }
.hw-ghost svg { display: block; width: 100%; height: auto; }
.hw-ghost-bob { animation: hw-bob 1.6s ease-in-out infinite; }
@keyframes hw-bob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-16px) rotate(4deg); } }
.hw-bat { width: 74px; filter: drop-shadow(0 0 5px rgba(170, 120, 255, 0.45)) drop-shadow(0 0 2px rgba(255, 150, 60, 0.4)); }
.hw-bat svg { display: block; width: 100%; height: auto; overflow: visible; }
/* Wings beat from the shoulders. */
.bat-wing { transform-box: view-box; animation: bat-flap .19s ease-in-out infinite alternate; }
.bat-wing-l { transform-origin: 54px 31px; --up: -30deg; --down: 24deg; }
.bat-wing-r { transform-origin: 66px 31px; --up: 30deg; --down: -24deg; }
@keyframes bat-flap { from { transform: rotate(var(--up)); } to { transform: rotate(var(--down)); } }
.hw-witch { font-size: 58px; line-height: 1; filter: drop-shadow(0 0 10px rgba(160, 255, 140, 0.45)); }
.hw-eyes { display: flex; gap: 14px; transform-origin: center; }
.hw-eyes i {
  display: block; width: 22px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #fff7c2 0 18%, #ffcf3a 30%, #ff7a00 70%, transparent 72%);
  box-shadow: 0 0 18px 6px rgba(255, 150, 30, 0.45);
}
.hw-eyes i:first-child { transform: rotate(14deg); } .hw-eyes i:last-child { transform: rotate(-14deg); }
.hw-overlay { position: absolute; inset: 0; opacity: 0; }
.hw-flash { background: #f4f0ff; }
.hw-dark { background: #000; }
.hw-vignette { background: radial-gradient(ellipse at center, transparent 45%, rgba(120, 0, 20, 0.6) 100%); }

/* ══ Christmas ═══════════════════════════════════════════════════════
   The page background is left exactly as it is: it is the colour of Аня's
   new sheet. Pillows lie at the head, the blanket covers the foot. */

body[data-anya-theme="xmas"] {
  --accent: #c0283c; --accent-ink: #a01d30; --accent-weak: rgba(192, 40, 60, 0.11);
  --sidebar-bg: #1d3a2f;
}
body[data-anya-theme="xmas"] main { padding-bottom: 150px; }
@keyframes xm-twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* Behind the content (z-index -1): cards lie on the pillows. */
.xm-pillows { position: absolute; right: 6px; top: calc(100% - 2px); z-index: -1; display: flex; }
.xm-pillow { display: block; width: 188px; filter: drop-shadow(0 8px 10px rgba(90, 20, 30, 0.22)); }
.xm-pillow svg { display: block; width: 100%; height: auto; }
.xm-pillow:first-child { transform: rotate(-5deg); }
.xm-pillow + .xm-pillow { transform: rotate(4deg) translateY(4px); margin-left: -34px; }

.xm-blanket {
  --gh: rgba(170, 30, 50, 0.58);
  position: fixed; left: 236px; right: 0; bottom: -12px; height: 80px; z-index: 52;
  border-radius: 28px 28px 0 0;
  background-color: #f2e6d4;
  background-image: linear-gradient(90deg, var(--gh) 50%, transparent 50%), linear-gradient(var(--gh) 50%, transparent 50%);
  background-size: 30px 30px;
  box-shadow: 0 -10px 26px -8px rgba(70, 20, 25, 0.35);
  transform-origin: 50% 100%;
  animation: xm-breathe 5.5s ease-in-out infinite;
}
.xm-blanket::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(60, 10, 20, 0.16) 75%);
}
.xm-cuff {
  position: absolute; left: 0; right: 0; top: 0; height: 24px; z-index: 1;
  border-radius: 28px 28px 8px 8px;
  background-color: #f2e6d4;
  background-image: linear-gradient(90deg, var(--gh) 50%, transparent 50%), linear-gradient(var(--gh) 50%, transparent 50%);
  background-size: 18px 18px;
  border-bottom: 3px solid #8f1a2c;
  box-shadow: 0 6px 8px -3px rgba(70, 20, 25, 0.35);
}
@keyframes xm-breathe { 50% { transform: scaleY(1.05); } }

.xm-trees { position: fixed; bottom: 36px; z-index: 51; display: flex; align-items: flex-end; }
.xm-trees-left { left: 252px; }
.xm-trees-right { right: 22px; }
.xm-tree { display: block; }
.xm-tree svg { display: block; width: 100%; height: auto; }
.xm-tree-1 { width: 100px; } .xm-tree-2 { width: 70px; margin-left: -10px; }
.xm-tree-3 { width: 66px; margin-right: -8px; } .xm-tree-4 { width: 108px; }
.xm-light { animation: xm-twinkle 1.3s ease-in-out infinite; }
.xm-star { filter: drop-shadow(0 0 4px #ffd34d); }

.fx-fall { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 56; }

/* ══ Аня's birthday (hidden, 15 September) ═══════════════════════════
   The toys here are the only decorations that take the mouse: balloons pop,
   candles go out, the bottle jumps. Everything else stays click-through. */

body[data-anya-theme="birthday"] {
  --bg: #fdf2ec; --surface: #fffdfb; --paper-2: #fff6f1; --elevated: #f8e4da;
  --accent: #e0457b; --accent-ink: #b8305f; --accent-weak: rgba(224, 69, 123, 0.12);
  --sidebar-bg: #3a2350;
}
body[data-anya-theme="birthday"] main { padding-bottom: 190px; }
body[data-anya-theme="birthday"] .anya-bar { position: relative; margin-top: 40px; }

.bd-banner { position: absolute; left: 50%; top: -54px; transform: translateX(-50%); }
.bd-banner svg { display: block; }
.bd-flag { transform-box: view-box; animation: bd-flutter 2.4s ease-in-out infinite; }
@keyframes bd-flutter { 50% { transform: rotate(5deg); } }

.bd-balloons { position: fixed; right: -26px; top: 13vh; width: 250px; z-index: 57; }
.bd-balloons svg { display: block; width: 100%; height: auto; overflow: visible; }
.bd-b { transform-box: view-box; transform-origin: 150px 410px; animation: bd-sway 4s ease-in-out infinite; }
@keyframes bd-sway { 0%, 100% { transform: rotate(-2deg) translateY(0); } 50% { transform: rotate(2deg) translateY(-6px); } }
.bd-ball { pointer-events: all; cursor: pointer; transform-box: view-box; }
.bd-string { transition: opacity .4s ease; }
.bd-b.popped .bd-ball { visibility: hidden; }
.bd-b.popped .bd-string { opacity: 0; }
.bd-b.inflating .bd-ball { animation: bd-inflate .9s cubic-bezier(.3, 1.6, .6, 1); }
@keyframes bd-inflate { from { transform: scale(.08); } to { transform: scale(1); } }

/* Her age as silver foil number balloons, standing next to the cake. */
.bd-age { position: fixed; left: 426px; bottom: 26px; z-index: 53; display: flex; align-items: flex-end; }
.bd-digit {
  display: block; width: 104px; pointer-events: auto; cursor: pointer;
  transform-origin: 50% 100%; animation: bd-digit-bob 3.6s ease-in-out infinite;
  filter: drop-shadow(0 8px 10px rgba(80, 90, 110, 0.25));
}
.bd-digit + .bd-digit { margin-left: -6px; animation-delay: -1.5s; }
.bd-digit svg { display: block; width: 100%; height: auto; overflow: visible; transform-origin: 50% 85%; }
@keyframes bd-digit-bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(2deg); } }
.bd-cake { position: fixed; left: 250px; bottom: 6px; width: 170px; z-index: 53; filter: drop-shadow(0 8px 12px rgba(120, 40, 70, 0.18)); }
.bd-cake svg { display: block; width: 100%; height: auto; overflow: visible; }
.bd-hit { pointer-events: all; cursor: pointer; }
.bd-flame { transform-box: view-box; animation: bd-flicker 1.1s ease-in-out infinite alternate; transition: opacity .25s ease, transform .25s ease; }
.bd-candle:nth-child(even) .bd-flame { animation-duration: .85s; }
@keyframes bd-flicker { from { transform: scale(1, 1) skewX(-3deg); } to { transform: scale(.92, 1.08) skewX(3deg); } }
.bd-candle.out .bd-flame { opacity: 0; animation: none; transform: scale(.2); }
.bd-smoke { opacity: 0; }
.bd-candle.out .bd-smoke { animation: bd-smoke 1.6s ease-out forwards; }
@keyframes bd-smoke { from { opacity: .8; transform: translateY(0); } to { opacity: 0; transform: translateY(-26px); } }

.bd-bottle { position: fixed; right: 44px; bottom: 6px; z-index: 54; }
.bd-bottle-body {
  width: 60px; pointer-events: auto; cursor: pointer;
  transform-origin: 50% 100%;
  animation: bd-hop 1.1s infinite;
  filter: drop-shadow(0 6px 8px rgba(30, 40, 30, 0.25));
}
.bd-bottle-body svg { display: block; width: 100%; height: auto; overflow: visible; }
.bd-bottle-body.launch { animation: none; }
/* Standing, hopping straight up and down at a steady beat – no tilting. */
@keyframes bd-hop {
  0% { transform: translateY(0) scale(1, 1); animation-timing-function: ease-out; }
  40% { transform: translateY(-9px) scale(.99, 1.02); animation-timing-function: ease-in; }
  80% { transform: translateY(0) scale(1.04, .95); }
  90%, 100% { transform: translateY(0) scale(1, 1); }
}
.bd-cork { transform-box: fill-box; transform-origin: center; }

.bd-layer { position: fixed; inset: 0; z-index: 58; overflow: hidden; }
.bd-shred { position: absolute; left: 0; top: 0; width: 7px; height: 11px; border-radius: 1px; }
.bd-drop { position: absolute; left: 0; top: 0; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, #fbeec0 60%, rgba(240, 220, 150, 0.6)); box-shadow: 0 0 0 1px rgba(190, 160, 80, 0.55); }
.bd-wish {
  position: absolute; left: 0; top: 0; white-space: nowrap;
  font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--accent-ink);
  text-shadow: 0 2px 0 #fff;
}

/* Phones and narrow windows (mobile.css): the sidebar becomes a drawer, so
   nothing is offset by its 236px any more, and the toys get smaller. */
@media (max-width: 960px) {
  .hw-fog, .xm-blanket { left: 0; }
  .hw-pumpkins, .xm-trees-left, .bd-cake { left: 8px; }
  .ln-garland { left: -16px; right: -16px; }
  .hw-spider { width: 170px; right: -36px; }
  .bd-balloons { width: 170px; right: -18px; }
  .season-wreath { width: 104px; left: auto; right: 4px; }
  .xm-pillow { width: 130px; }
  .bd-banner { transform: translateX(-50%) scale(.6); transform-origin: top center; }
  .bd-age { left: 186px; bottom: 22px; }
  .bd-digit { width: 70px; }
}
@media (max-width: 640px) {
  .pk-1 { width: 62px; } .pk-2 { width: 44px; } .pk-3 { width: 36px; } .pk-4 { width: 54px; }
  .xm-tree-1 { width: 66px; } .xm-tree-2 { width: 48px; } .xm-tree-3 { width: 44px; } .xm-tree-4 { width: 70px; }
  .bd-cake { width: 120px; }
  .bd-age { left: 132px; }
  .bd-digit { width: 54px; }
  .bd-bottle-body { width: 44px; }
  .hw-spider { width: 140px; }
}

@media (prefers-reduced-motion: reduce) {
  .hw-fog, .pk-face, .sp-leg, .sp-abd, .sp-eyes, .xm-light, .xm-blanket, .ln-halo, .wr-light,
  .bd-flag, .bd-b, .bd-flame, .bd-bottle-body, .bd-digit { animation: none !important; }
}
