@charset "UTF-8";

/* 冬の雪とシマエナガ。 */
#container {
  position: relative;
  overflow: hidden;
}

.petal,
.winter-snowflake,
.winter-bird-pair {
  position: absolute;
  z-index: 20;
  pointer-events: none;
}

/* 桜の花びら */
.petal {
  top: 0;
  background-color: #ffc0cb;
  border-radius: 150% 0 150% 0;
  animation: winter-petal-fall 10s linear forwards;
}

.petal::after {
  content: "";
  position: absolute;
  top: -14%;
  left: -10%;
  width: 100%;
  height: 100%;
  background-color: #ffc0cb;
  border-radius: 150% 0 150% 0;
  transform: rotate(15deg);
}

/* 淡い雪の粒 */
.winter-snowflake {
  top: 0;
  background-color: #f2f5ff;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(255, 255, 255, .8), 0 1px 2px rgba(75, 104, 135, .3);
  animation: winter-particle-fall 10s linear forwards;
}

@keyframes winter-petal-fall {
  0% { top: 0; opacity: 0; transform: rotate(0deg); }
  10%, 90% { opacity: 1; }
  100% { top: 100vh; opacity: 0; transform: rotate(3000deg); }
}

@keyframes winter-particle-fall {
  0% { top: 0; opacity: 0; transform: translateX(0) rotate(0deg); }
  10%, 90% { opacity: 1; }
  50% { transform: translateX(20px) rotate(180deg); }
  100% { top: 100vh; opacity: 0; transform: translateX(-20px) rotate(360deg); }
}

/* 鳥も前年と同じく、画面上端からさりげなく降らせます。 */
.winter-bird-pair {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.winter-bird {
  position: absolute;
  top: 0;
  left: var(--bird-left);
  width: var(--bird-size);
  aspect-ratio: 1 / 2;
  background: center / contain no-repeat;
  opacity: 0;
  filter: drop-shadow(0 3px 3px rgba(69, 47, 25, .18));
  will-change: transform, opacity;
  animation-delay: var(--bird-delay);
}

.winter-bird--left {
  background-image: url('images/shima_enaga.png');
  animation: winter-bird-fall-left 10s linear forwards;
  animation-delay: var(--bird-delay);
}

.winter-bird--right {
  background-image: url('images/shima_enaga.png');
  animation: winter-bird-fall-right 10s linear forwards;
  animation-delay: var(--bird-delay);
}

@keyframes winter-bird-fall-left {
  0% { top: 0; opacity: 0; transform: translateX(0) rotate(-3deg); }
  10%, 90% { opacity: 1; }
  50% { transform: translateX(calc(2vw + var(--bird-sway))) rotate(3deg); }
  100% { top: 100vh; opacity: 0; transform: translateX(calc(4vw + var(--bird-sway))) rotate(-3deg); }
}

@keyframes winter-bird-fall-right {
  0% { top: 0; opacity: 0; transform: translateX(0) rotate(3deg) scaleX(-1); }
  10%, 90% { opacity: 1; }
  50% { transform: translateX(calc(-2vw + var(--bird-sway))) rotate(-3deg) scaleX(-1); }
  100% { top: 100vh; opacity: 0; transform: translateX(calc(-4vw + var(--bird-sway))) rotate(3deg) scaleX(-1); }
}

@media (max-width: 600px) {
  .winter-bird { max-width: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .petal,
  .winter-snowflake { display: none; }
  .winter-bird-pair { display: none; }
}
