/* What's New sidebar entry (WhatsNewSidebarEntry). Colours follow the
   What's New confetti palette, which is deliberately its own world: the
   rainbow border and party popper are the one joyful element in the shell. */

.wn-entry {
  --wn-rainbow: linear-gradient(
    120deg,
    #fb7185,
    #fcd34d 28%,
    #34d399 52%,
    #3b82f6 76%,
    #8b5cf6
  );
  position: relative;
  display: block;
  margin: 0 0 2px;
  border-radius: 14px;
  padding: 1.5px;
  background: var(--wn-rainbow);
  outline: none;
  transition:
    transform 0.15s ease-out,
    box-shadow 0.15s ease-out;
}

.wn-entry:hover,
.wn-entry:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px -10px rgb(139 92 246 / 0.6);
}

.wn-entry:focus-visible {
  box-shadow:
    0 0 0 2px var(--sidebar),
    0 0 0 4px var(--ring);
}

.wn-entry-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 12.5px;
  background: var(--sidebar);
  padding: 9px 10px;
}

.wn-entry:hover .wn-entry-inner,
.wn-entry-active .wn-entry-inner {
  background: color-mix(in oklch, var(--sidebar) 92%, #fdba74);
}

.wn-entry-tile {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #fff4ec;
  box-shadow: inset 0 0 0 1px #fbd9c6;
}

.dark .wn-entry-tile {
  background: #2a2433;
  box-shadow: inset 0 0 0 1px #4a3b55;
}

.wn-entry-tile svg,
.wn-entry-confetti svg,
.wn-collapsed-popper svg {
  display: block;
  overflow: visible;
}

.wn-entry-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--sidebar-foreground);
}

.wn-entry-sub {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.3;
  color: var(--muted-foreground);
}

.wn-entry-new {
  border-radius: 999px;
  padding: 2px 7px;
  background: linear-gradient(90deg, #e11d48, #7c3aed 55%, #2563eb);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #fff;
}

.wn-entry-confetti {
  position: absolute;
  top: -24px;
  right: -8px;
  z-index: 20;
  width: 46px;
  height: 38px;
  pointer-events: none;
}

.wn-entry-confetti svg.wn-settle {
  animation: wn-settle 0.45s cubic-bezier(0.2, 0.8, 0.3, 1.3) both;
}

@keyframes wn-settle {
  from {
    opacity: 0;
    transform: scale(0.4) translate(-10px, 10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Collapsed sidebar: a rainbow tile, with a pink dot while unread. */
.wn-collapsed {
  position: relative;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1.5px solid transparent;
  border-radius: 10px;
  background:
    linear-gradient(var(--sidebar), var(--sidebar)) padding-box,
    linear-gradient(120deg, #fb7185, #fcd34d, #34d399, #3b82f6, #8b5cf6)
      border-box;
}

.wn-collapsed:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.wn-collapsed-popper svg {
  width: 20px;
  height: 20px;
}

.wn-collapsed-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fb7185;
  box-shadow: 0 0 0 2px var(--sidebar);
}

@media (prefers-reduced-motion: reduce) {
  .wn-entry,
  .wn-entry * {
    animation: none !important;
    transition: none !important;
  }

  .wn-entry:hover {
    transform: none;
  }
}
.halloween-bats {
  position: fixed;
  inset: 0;
  z-index: 60;
  overflow: hidden;
  pointer-events: none;
}

.halloween-bat {
  position: absolute;
  left: 0;
  animation: halloween-fly var(--bat-duration, 8s) linear var(--bat-delay, 0s)
    both;
  color: color-mix(in oklch, var(--foreground) 82%, oklch(0.5 0.2 300));
}

.halloween-bat-bob {
  animation: halloween-bob 1.3s ease-in-out infinite alternate;
}

.halloween-bat-wing {
  transform-box: view-box;
  transform-origin: 32px 18px;
  animation: halloween-flap 0.24s ease-in-out infinite alternate;
}

@keyframes halloween-fly {
  from {
    transform: translateX(-80px);
  }
  to {
    transform: translateX(calc(100vw + 80px));
  }
}

@keyframes halloween-bob {
  from {
    transform: translateY(-10px) rotate(-4deg);
  }
  to {
    transform: translateY(12px) rotate(5deg);
  }
}

@keyframes halloween-flap {
  from {
    transform: scaleY(1);
  }
  to {
    transform: scaleY(-0.35);
  }
}

.halloween-ghost {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 10;
  pointer-events: none;
  /* The theme-button row is an inline-size container; 230px is roughly where
     the Dark button's centre sits plus half the ghost. */
  --ghost-travel: min(400px, 100cqw - 230px);
  filter: drop-shadow(0 6px 10px rgb(0 0 0 / 0.15));
  animation: halloween-ghost-drift 3.4s ease-in-out forwards;
}

.dark .halloween-ghost {
  filter: drop-shadow(0 0 16px rgb(170 200 255 / 0.4));
}

.halloween-ghost-float {
  display: block;
  animation: halloween-ghost-wobble 0.6s ease-in-out infinite alternate;
}

/* Pops out of the Dark button, then drifts right through the card's empty
   space and fades without leaving the card. */
@keyframes halloween-ghost-drift {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.3);
  }
  12% {
    opacity: 1;
    transform: translate(-50%, -85%) scale(1);
  }
  32% {
    transform: translate(calc(-50% + var(--ghost-travel) * 0.28), -45%);
  }
  52% {
    transform: translate(calc(-50% + var(--ghost-travel) * 0.53), -75%);
  }
  75% {
    opacity: 1;
    transform: translate(calc(-50% + var(--ghost-travel) * 0.78), -45%);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--ghost-travel)), -80%) scale(0.9);
  }
}

@keyframes halloween-ghost-wobble {
  from {
    transform: rotate(-6deg);
  }
  to {
    transform: rotate(6deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .halloween-bats,
  .halloween-ghost {
    display: none;
  }
}

.halloween-avatar {
  background: #e9e3f3;
}

.halloween-cat-eyes {
  transform-box: fill-box;
  transform-origin: center;
  animation: halloween-cat-blink 4.5s ease-in-out infinite;
}

@keyframes halloween-cat-blink {
  0%,
  94%,
  100% {
    transform: scaleY(1);
  }
  97% {
    transform: scaleY(0.1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .halloween-cat-eyes {
    animation: none;
  }
}
