/* ═══════════════════════════════════════════════════════════════════════════
 *  Birthday Theme — 5.21
 *  Loaded AFTER tokens.css so these win via cascade.
 *  Only injected when today == May 21st.
 * ═══════════════════════════════════════════════════════════════════════════ */

/* ── Color Overrides ─────────────────────────────────────────────────────── */
:root,
[data-theme="dark"] {
  --accent:           #FF6B9D;
  --accent-hover:     #FF8DB5;
  --accent-pressed:   #E85585;
  --accent-soft:      rgba(255, 107, 157, 0.14);
  --accent-ring:      rgba(255, 107, 157, 0.45);
  --accent-secondary: #FFB84D;
  --accent-tertiary:  #7C5CFF;
  --accent-alt-rose:  #FF6B9D;
  --accent-alt-sky:   #4DA8FF;
  --accent-alt-lime:  #B8F26C;
  --gradient-primary:  linear-gradient(135deg, #FF6B9D 0%, #FFB84D 100%);
  --gradient-aurora:   radial-gradient(60% 80% at 10% 0%, rgba(255,107,157,0.22) 0%, transparent 60%),
                       radial-gradient(60% 80% at 90% 20%, rgba(255,184,77,0.14) 0%, transparent 60%),
                       radial-gradient(60% 80% at 50% 100%, rgba(124,92,255,0.10) 0%, transparent 60%);
}

[data-theme="light"] {
  --accent:           #E64E83;
  --accent-hover:     #D03A6F;
  --accent-pressed:   #B82A5B;
  --accent-soft:      rgba(230, 78, 131, 0.10);
  --accent-ring:      rgba(230, 78, 131, 0.35);
  --accent-secondary: #E6962A;
  --accent-tertiary:  #6D4BFF;
  --accent-alt-rose:  #E64E83;
  --accent-alt-sky:   #2E8BE6;
  --accent-alt-lime:  #7FC92B;
  --gradient-primary:  linear-gradient(135deg, #E64E83 0%, #E6962A 100%);
  --gradient-aurora:   radial-gradient(60% 80% at 10% 0%, rgba(230,78,131,0.10) 0%, transparent 60%),
                       radial-gradient(60% 80% at 90% 20%, rgba(230,150,42,0.08) 0%, transparent 60%),
                       radial-gradient(60% 80% at 50% 100%, rgba(109,75,255,0.06) 0%, transparent 60%);
}

/* ── Birthday Banner ─────────────────────────────────────────────────────── */
.birthday-banner {
  position: relative;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #FF6B9D 0%, #FFB84D 50%, #7C5CFF 100%);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  box-shadow: 0 2px 20px rgba(255, 107, 157, 0.3);
  animation: bannerSlideDown 0.6s var(--ease-emphasis) forwards;
  transform: translateY(-100%);
}

.birthday-banner__emoji {
  font-size: 1.2em;
  animation: bannerBounce 1.5s ease-in-out infinite;
}

.birthday-banner__link {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-pill);
  padding: 4px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
  white-space: nowrap;
}

.birthday-banner__link:hover {
  background: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.birthday-banner__close {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.15s;
}

.birthday-banner__close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

@keyframes bannerSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes bannerBounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

/* ── Floating Decorations ────────────────────────────────────────────────── */
.birthday-decorations {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  overflow: hidden;
}

.birthday-balloon {
  position: absolute;
  bottom: -80px;
  width: 36px;
  height: 44px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  opacity: 0.7;
  animation: balloonFloat linear infinite;
}

.birthday-balloon::after {
  content: '';
  position: absolute;
  bottom: -30px;
  left: 50%;
  width: 1px;
  height: 30px;
  background: currentColor;
  opacity: 0.4;
  transform: translateX(-50%);
}

@keyframes balloonFloat {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0;
  }
  5%  { opacity: 0.7; }
  90% { opacity: 0.7; }
  100% {
    transform: translateY(calc(-100vh - 120px)) rotate(15deg);
    opacity: 0;
  }
}

/* ── Stars / Sparkles ────────────────────────────────────────────────────── */
.birthday-sparkle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: #FFD700;
  border-radius: 50%;
  animation: sparkleFade ease-in-out infinite;
  pointer-events: none;
}

.birthday-sparkle::before,
.birthday-sparkle::after {
  content: '';
  position: absolute;
  background: inherit;
  border-radius: 50%;
}

.birthday-sparkle::before {
  width: 2px;
  height: 14px;
  top: -4px;
  left: 2px;
}

.birthday-sparkle::after {
  width: 14px;
  height: 2px;
  top: 2px;
  left: -4px;
}

@keyframes sparkleFade {
  0%, 100% { opacity: 0; transform: scale(0.5) rotate(0deg); }
  50%      { opacity: 1; transform: scale(1) rotate(45deg); }
}

/* ── Cake (bottom-right corner) ──────────────────────────────────────────── */
.birthday-cake {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9997;
  cursor: pointer;
  transition: transform 0.3s var(--ease-emphasis);
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.2));
}

.birthday-cake:hover {
  transform: scale(1.08);
}

.birthday-cake__body {
  position: relative;
  width: 80px;
  height: 48px;
}

.birthday-cake__layer {
  position: absolute;
  bottom: 0;
  border-radius: 6px 6px 8px 8px;
}

.birthday-cake__layer--bottom {
  width: 80px;
  height: 28px;
  background: linear-gradient(180deg, #FFB84D 0%, #E6962A 100%);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.birthday-cake__layer--top {
  width: 58px;
  height: 22px;
  left: 11px;
  bottom: 26px;
  background: linear-gradient(180deg, #FF6B9D 0%, #E64E83 100%);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.birthday-cake__layer--top::before {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  height: 8px;
  background: #fff;
  border-radius: 4px 4px 0 0;
  opacity: 0.6;
}

/* Candles */
.birthday-cake__candles {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.birthday-candle {
  width: 4px;
  height: 16px;
  background: linear-gradient(180deg, #FFD700 0%, #FF6B9D 100%);
  border-radius: 2px;
  position: relative;
}

.birthday-flame {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 12px;
  background: radial-gradient(ellipse at center bottom, #FFD700 0%, #FF6B9D 60%, transparent 100%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: flameFlicker 0.3s ease-in-out infinite alternate;
  transition: opacity 0.5s, transform 0.5s;
}

.birthday-flame.blown-out {
  opacity: 0;
  transform: translateX(-50%) scale(0);
}

@keyframes flameFlicker {
  0%   { transform: translateX(-50%) scaleY(1) scaleX(1); }
  100% { transform: translateX(-50%) scaleY(1.15) scaleX(0.9); }
}

/* Cake tooltip */
.birthday-cake__tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.birthday-cake:hover .birthday-cake__tip {
  opacity: 1;
}

.birthday-cake__tip--done {
  display: none;
}

.birthday-cake.wished .birthday-cake__tip--ask { display: none; }
.birthday-cake.wished .birthday-cake__tip--done { display: block; }

/* ── Cake in dark mode — slightly brighter ───────────────────────────────── */
[data-theme="dark"] .birthday-cake__layer--bottom {
  background: linear-gradient(180deg, #FFB84D 0%, #D08715 100%);
}

[data-theme="dark"] .birthday-cake__layer--top {
  background: linear-gradient(180deg, #FF6B9D 0%, #C83A6A 100%);
}

/* ── Reduced Motion ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .birthday-banner { animation: none; transform: translateY(0); }
  .birthday-balloon { animation: none; display: none; }
  .birthday-sparkle { animation: none; display: none; }
  .birthday-flame   { animation: none; }
}

/* ── Mobile Adjustments ──────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .birthday-banner {
    font-size: 0.8rem;
    padding: 8px 16px;
  }

  .birthday-cake {
    bottom: 16px;
    right: 16px;
    transform: scale(0.85);
  }

  .birthday-cake:hover {
    transform: scale(0.92);
  }
}

/* ── Danmaku (bullet comments) ──────────────────────────────────────────── */
.birthday-danmaku {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}

.birthday-danmaku__item {
  position: absolute;
  white-space: nowrap;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  padding: 4px 14px;
  background: rgba(255, 107, 157, 0.25);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: danmakuFloat linear forwards;
  will-change: transform;
}

[data-theme="light"] .birthday-danmaku__item {
  color: rgba(80, 20, 40, 0.9);
  background: rgba(255, 107, 157, 0.18);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

@keyframes danmakuFloat {
  from { transform: translateX(100vw); }
  to   { transform: translateX(-120%); }
}

@media (prefers-reduced-motion: reduce) {
  .birthday-danmaku__item { animation: none; display: none; }
}
