/* ========================================
   birthday.css — party decorations layered on top of styles.css
   Loaded only on the birthday branch. Adds: bunting flags, floating
   balloons, the HAPPY BIRTHDAY hero with a blow-out-able cake, and the
   confetti canvas. All decoration layers are pointer-events: none except
   the cake itself.
   ======================================== */

/* ---------- Confetti canvas (driven by birthday.js) ---------- */
#confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 500;
}

/* ---------- Bunting: triangle party flags across the top ---------- */
.bunting {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 34px;
  display: flex;
  justify-content: space-evenly;
  pointer-events: none;
  z-index: 400;
  /* the "string" the flags hang from */
  background: linear-gradient(180deg, rgba(255,255,255,0.35) 0 2px, transparent 2px);
}
.bunting span {
  width: 26px;
  height: 30px;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  animation: bunting-sway 3.2s ease-in-out infinite;
  transform-origin: top center;
}
.bunting span:nth-child(6n + 1) { background: #ff5fa2; }
.bunting span:nth-child(6n + 2) { background: #ffd23f; animation-delay: 0.3s; }
.bunting span:nth-child(6n + 3) { background: #2fb6a8; animation-delay: 0.6s; }
.bunting span:nth-child(6n + 4) { background: #9b5fff; animation-delay: 0.9s; }
.bunting span:nth-child(6n + 5) { background: #ff9d3f; animation-delay: 1.2s; }
.bunting span:nth-child(6n + 6) { background: #6fa8ff; animation-delay: 1.5s; }
@keyframes bunting-sway {
  0%, 100% { transform: rotate(-4deg); }
  50%      { transform: rotate(4deg); }
}

/* Clear the bunting so it never covers the header/login card */
.app { padding-top: 40px; }
.login-screen { padding-top: 34px; }

/* ---------- Floating balloons (emoji, both screens) ---------- */
.bday-balloons {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.bday-balloons span {
  position: absolute;
  bottom: -80px;
  font-size: 42px;
  opacity: 0.5;
  animation: balloon-rise linear infinite;
  filter: drop-shadow(0 0 6px rgba(255, 95, 162, 0.35));
}
.bday-balloons span:nth-child(1) { left: 6%;  animation-duration: 18s; }
.bday-balloons span:nth-child(2) { left: 22%; animation-duration: 24s; animation-delay: 4s;  font-size: 30px; }
.bday-balloons span:nth-child(3) { left: 48%; animation-duration: 20s; animation-delay: 9s;  font-size: 50px; }
.bday-balloons span:nth-child(4) { left: 72%; animation-duration: 26s; animation-delay: 2s;  font-size: 34px; }
.bday-balloons span:nth-child(5) { left: 88%; animation-duration: 21s; animation-delay: 12s; }
.bday-balloons span:nth-child(6) { left: 35%; animation-duration: 28s; animation-delay: 15s; font-size: 28px; }
@keyframes balloon-rise {
  0%   { transform: translateY(0) rotate(-6deg); }
  50%  { transform: translateY(-55vh) rotate(6deg); }
  100% { transform: translateY(-115vh) rotate(-6deg); }
}

/* ---------- Login screen tweaks ---------- */
.login-emoji { font-size: 1.4em; }
.title.bday-title {
  color: var(--lime);
  animation: title-party 2.4s ease-in-out infinite;
}
@keyframes title-party {
  0%, 100% { text-shadow: 2px 2px 0 var(--void), 0 0 6px rgba(255, 95, 162, 0.55); }
  33%      { text-shadow: 2px 2px 0 var(--void), 0 0 6px rgba(255, 210, 63, 0.55); }
  66%      { text-shadow: 2px 2px 0 var(--void), 0 0 6px rgba(47, 182, 168, 0.55); }
}

/* ---------- Header ---------- */
.logo-emoji { font-size: 1.4em; line-height: 1; }

/* ---------- Birthday hero (top of the Board tab) ---------- */
.bday-hero {
  position: relative;
  text-align: center;
  padding: 28px 18px 24px;
  margin-bottom: 20px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 210, 63, 0.10), transparent 30%),
    radial-gradient(circle at 80% 30%, rgba(155, 95, 255, 0.14), transparent 32%),
    var(--panel);
  border: 3px solid var(--lime-dim);
  box-shadow: 4px 4px 0 var(--void), 0 0 10px rgba(255, 95, 162, 0.25);
  overflow: hidden;
}
.bday-hero-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 20px;
  line-height: 1.7;
  margin: 0 0 6px;
  background: linear-gradient(90deg, #ff5fa2, #ffd23f, #2fb6a8, #9b5fff, #ff5fa2);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: hero-rainbow 5s linear infinite;
}
@keyframes hero-rainbow {
  to { background-position: 300% 0; }
}
.bday-hero-sub {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: var(--text-mute);
  margin: 0 0 22px;
  line-height: 1.9;
}

/* ---------- The cake ---------- */
.bday-cake {
  position: relative;
  width: 150px;
  margin: 0 auto 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s;
}
.bday-cake:hover { transform: scale(1.04); }
.bday-cake:active { transform: scale(0.97); }

.cake-candles {
  display: flex;
  justify-content: center;
  gap: 26px;
  height: 44px;
  align-items: flex-end;
}
.candle {
  position: relative;
  width: 8px;
  height: 26px;
  background: repeating-linear-gradient(45deg, #ff5fa2 0 5px, #fff1e6 5px 10px);
}
.candle::before { /* wick */
  content: "";
  position: absolute;
  top: -5px;
  left: 3px;
  width: 2px;
  height: 5px;
  background: #444;
}
.flame {
  position: absolute;
  top: -19px;
  left: -2px;
  width: 12px;
  height: 15px;
  background: radial-gradient(circle at 50% 75%, #fff7cf 0 25%, #ffd23f 55%, #ff9d3f 100%);
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  transform-origin: bottom center;
  animation: flicker 0.55s ease-in-out infinite alternate;
  box-shadow: 0 0 12px rgba(255, 210, 63, 0.75);
}
.candle:nth-child(2) .flame { animation-delay: 0.2s; }
.candle:nth-child(3) .flame { animation-delay: 0.35s; }
@keyframes flicker {
  from { transform: rotate(-5deg) scale(1); }
  to   { transform: rotate(5deg)  scale(1.12); }
}
/* Blown-out state: flames become wisps of smoke */
.bday-cake.blown .flame {
  animation: smoke 1.4s ease-out forwards;
  box-shadow: none;
}
@keyframes smoke {
  0%   { opacity: 1; }
  20%  { background: #9a9a9a; border-radius: 50%; }
  100% { background: #9a9a9a; opacity: 0; transform: translateY(-26px) scale(0.4); }
}

.cake-tier {
  margin: 0 auto;
  border: 3px solid var(--void);
  box-shadow: 3px 3px 0 var(--void);
}
.cake-tier.top {
  width: 90px;
  height: 32px;
  background: linear-gradient(180deg, #fff1e6 0 40%, #ff5fa2 40%);
}
.cake-tier.bottom {
  width: 130px;
  height: 38px;
  background: linear-gradient(180deg, #9b5fff 0 35%, #7b3fbf 35%);
}
.cake-plate {
  width: 150px;
  height: 10px;
  margin: 0 auto;
  background: var(--cream);
  border: 3px solid var(--void);
  box-shadow: 3px 3px 0 var(--void);
}

.bday-cake-hint {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: var(--text-faint);
  margin: 14px 0 0;
  line-height: 1.8;
}
.bday-wish {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: var(--rust);
  margin: 14px 0 0;
  line-height: 2;
  text-shadow: 0 0 8px rgba(255, 182, 74, 0.6);
}

/* ---------- Reduced motion: park all the party animations ---------- */
@media (prefers-reduced-motion: reduce) {
  .bunting span,
  .bday-balloons span,
  .title.bday-title,
  .bday-hero-title,
  .flame {
    animation: none;
  }
  #confetti-canvas { display: none; }
}

@media (max-width: 520px) {
  .bday-hero-title { font-size: 14px; }
  .bunting span { width: 20px; height: 24px; }
}
