:root {
  --ink-soft: #fff5e8;
  --ink-muted: #f0e2d5;
  --glass-bg: rgba(20, 27, 51, 0.34);
  --glass-border: rgba(255, 236, 201, 0.42);
  --accent-peach: #ffbe96;
  --accent-sky: #b8d8ff;
  --accent-night: #8fd4ff;
  --ghibli-rose: #ffc3dc;
  --ghibli-mint: #c8f2d8;
  --ghibli-gold: #ffd9a8;
  --ghibli-water: #b6dcff;
}

* {
  box-sizing: border-box;
}

html,
body {
  position: relative;
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Zen Kaku Gothic New", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 16% 12%, rgba(255, 214, 170, 0.35), transparent 36%),
    radial-gradient(circle at 84% 22%, rgba(196, 228, 255, 0.3), transparent 42%),
    radial-gradient(circle at 50% 110%, rgba(165, 193, 255, 0.2), transparent 50%),
    linear-gradient(180deg, #09112a 0%, #0d1836 38%, #111f3c 70%, #071022 100%);
  color: var(--ink-soft);
}

#app::before,
#app::after {
  content: "";
  position: absolute;
  inset: -10%;
  pointer-events: none;
}

#app::before {
  background:
    radial-gradient(circle at 24% 26%, rgba(255, 233, 210, 0.2), transparent 38%),
    radial-gradient(circle at 72% 18%, rgba(183, 216, 255, 0.16), transparent 40%),
    radial-gradient(circle at 40% 74%, rgba(191, 243, 217, 0.1), transparent 45%);
  filter: blur(14px);
  animation: watercolorDrift 18s ease-in-out infinite;
}

#app::after {
  background:
    repeating-linear-gradient(
      125deg,
      rgba(255, 255, 255, 0.035) 0 2px,
      rgba(255, 255, 255, 0) 2px 15px
    );
  mix-blend-mode: soft-light;
  opacity: 0.32;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
}

#garden-canvas {
  width: 100%;
  height: 100%;
  display: block;
  filter: saturate(1.12) contrast(1.04) brightness(1.03);
}

#ghibli-effects{
position:fixed;
top:0;
left:0;
width:100%;
height:100%;
pointer-events:none;
z-index:2;
}

#intro-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 65%, rgba(255, 177, 132, 0.1), transparent 42%),
    radial-gradient(circle at 40% 25%, rgba(133, 189, 255, 0.14), transparent 58%),
    linear-gradient(180deg, rgba(3, 4, 10, 0.9) 0%, rgba(7, 8, 18, 0.82) 70%, rgba(8, 9, 19, 0.72) 100%);
  opacity: 1;
  transition: opacity 1.5s ease;
  pointer-events: none;
  z-index: 8;
}

#intro-overlay.hidden {
  opacity: 0;
}

.intro-content {
  width: min(92vw, 640px);
  text-align: center;
  transform: translateY(8px);
}

.intro-kicker {
  margin: 0 0 0.55rem;
  letter-spacing: 0.18rem;
  text-transform: uppercase;
  font-size: 0.76rem;
  color: #f8dfca;
}

#intro-text {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2rem, 6vw, 4.4rem);
  font-weight: 600;
  color: #ffecd4;
  text-shadow: 0 0 18px rgba(255, 185, 120, 0.36), 0 0 44px rgba(148, 210, 255, 0.2);
  opacity: 0;
  transition: opacity 1.1s ease;
}

#intro-text.visible {
  opacity: 1;
}

.intro-sub {
  margin: 0.6rem auto 0;
  max-width: 30rem;
  line-height: 1.5;
  font-size: 0.95rem;
  color: var(--ink-muted);
  opacity: 0.8;
}

#hud {
  position: absolute;
  left: 1rem;
  top: 1rem;
  width: min(90vw, 420px);
  padding: 0.95rem 1rem;
  border: 1px solid var(--glass-border);
  border-radius: 1rem;
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  box-shadow:
    0 14px 42px rgba(4, 5, 14, 0.34),
    0 0 22px rgba(255, 214, 163, 0.12),
    inset 0 0 20px rgba(177, 221, 255, 0.08);
  z-index: 9;
  animation: hudGlow 8s ease-in-out infinite;
}

.ui-during-intro {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.ui-during-intro.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#hud h2 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.2rem, 3vw, 1.78rem);
  letter-spacing: 0.02rem;
  color: #fff6e4;
  text-shadow: 0 0 14px rgba(255, 213, 152, 0.22);
}

#hud p {
  margin: 0.38rem 0 0;
  line-height: 1.34;
  font-size: 0.92rem;
  color: #f4ebdb;
}

#daily-message {
  color: #ffe5ca;
}

#love-timer {
  margin-top: 0.62rem;
  padding: 0.52rem 0.6rem;
  border-radius: 0.72rem;
  border: 1px solid rgba(255, 233, 206, 0.28);
  background: rgba(255, 182, 130, 0.08);
}

#love-timer p {
  margin: 0.14rem 0;
}

.timer-label {
  font-size: 0.74rem;
  letter-spacing: 0.04rem;
  text-transform: uppercase;
  color: #ffdcb9;
}

.timer-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.02rem;
  color: #fff2de;
}

#cycle-label {
  color: #cfe8ff;
}

.hud-actions {
  display: flex;
  gap: 0.52rem;
  margin-top: 0.86rem;
}

.hud-actions button {
  position: relative;
  border: 1px solid rgba(255, 232, 205, 0.5);
  background:
    linear-gradient(
      180deg,
      rgba(255, 197, 150, 0.26) 0%,
      rgba(162, 202, 255, 0.18) 100%
    );
  color: #fff5e6;
  padding: 0.56rem 0.72rem;
  border-radius: 0.7rem;
  font-size: 0.86rem;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, filter 0.25s ease;
}

.hud-actions button::before {
  content: "";
  position: absolute;
  inset: -90%;
  background: radial-gradient(circle, rgba(255, 240, 207, 0.42), rgba(176, 228, 255, 0.12) 44%, transparent 68%);
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.hud-actions button:hover {
  transform: translateY(-1px);
  filter: brightness(1.08) saturate(1.08);
  box-shadow:
    0 10px 16px rgba(6, 8, 19, 0.24),
    0 0 16px rgba(255, 212, 150, 0.34);
  border-color: rgba(255, 244, 222, 0.76);
}

.hud-actions button:hover::before {
  opacity: 1;
  transform: scale(1);
}

.hud-actions button.active {
  border-color: rgba(186, 232, 255, 0.9);
  box-shadow: 0 0 14px rgba(162, 223, 255, 0.32), 0 0 24px rgba(255, 208, 141, 0.25);
}

#mobile-note {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  max-width: 320px;
  padding: 0.5rem 0.7rem;
  border-radius: 0.76rem;
  background: rgba(8, 11, 26, 0.42);
  border: 1px solid rgba(203, 229, 255, 0.3);
  backdrop-filter: blur(6px);
  font-size: 0.78rem;
  color: #dae9ff;
  z-index: 9;
  box-shadow: 0 0 20px rgba(182, 222, 255, 0.15);
}

#mobile-note p {
  margin: 0;
}

/* Cinematic Ghibli-style atmosphere overlays */
#cinematic-parallax {
  position: fixed;
  inset: -8%;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
  --parallax-x: 0px;
  --parallax-y: 0px;
}

.parallax-layer {
  position: absolute;
  inset: 0;
  transform: translate3d(
    calc(var(--parallax-x) * var(--depth-x, 0)),
    calc(var(--parallax-y) * var(--depth-y, 0)),
    0
  );
  transition: transform 0.2s ease-out;
}

.layer-sky {
  --depth-x: 0.08;
  --depth-y: 0.05;
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 210, 171, 0.18), transparent 40%),
    radial-gradient(circle at 74% 26%, rgba(178, 214, 255, 0.15), transparent 44%),
    linear-gradient(180deg, rgba(193, 218, 255, 0.15) 0%, rgba(25, 36, 62, 0.05) 65%, transparent 100%);
}

.layer-mountains {
  --depth-x: 0.14;
  --depth-y: 0.1;
  bottom: auto;
  top: 33%;
  height: 50%;
  background:
    radial-gradient(ellipse at 20% 100%, rgba(99, 126, 145, 0.24) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 100%, rgba(84, 112, 131, 0.21) 0%, transparent 58%),
    radial-gradient(ellipse at 78% 100%, rgba(101, 122, 147, 0.2) 0%, transparent 52%);
}

.layer-torii {
  --depth-x: 0.2;
  --depth-y: 0.14;
  top: 42%;
  height: 44%;
}

.layer-torii::before,
.layer-torii::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.layer-torii::before {
  bottom: 24%;
  width: min(36vw, 520px);
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(169, 54, 44, 0.55), rgba(222, 94, 76, 0.62), rgba(169, 54, 44, 0.55));
  filter: blur(0.2px);
}

.layer-torii::after {
  bottom: 6%;
  width: min(30vw, 430px);
  height: min(24vw, 300px);
  border-left: 10px solid rgba(206, 88, 74, 0.48);
  border-right: 10px solid rgba(206, 88, 74, 0.48);
  border-top: 18px solid rgba(220, 102, 84, 0.54);
  border-radius: 4px;
  opacity: 0.68;
}

.layer-trees {
  --depth-x: 0.25;
  --depth-y: 0.2;
  top: 22%;
  height: 70%;
  background:
    radial-gradient(circle at 8% 58%, rgba(252, 191, 214, 0.2) 0%, transparent 24%),
    radial-gradient(circle at 18% 52%, rgba(250, 184, 208, 0.17) 0%, transparent 22%),
    radial-gradient(circle at 88% 56%, rgba(252, 191, 214, 0.19) 0%, transparent 23%),
    radial-gradient(circle at 79% 54%, rgba(245, 174, 199, 0.16) 0%, transparent 21%),
    linear-gradient(
      180deg,
      transparent 0%,
      transparent 30%,
      rgba(38, 71, 42, 0.12) 31%,
      rgba(38, 71, 42, 0.12) 100%
    );
  animation: treeSway 8s ease-in-out infinite;
}

.layer-mist {
  --depth-x: 0.06;
  --depth-y: 0.04;
  top: auto;
  bottom: -12%;
  height: 45%;
  background:
    radial-gradient(ellipse at 18% 45%, rgba(228, 239, 255, 0.22), transparent 52%),
    radial-gradient(ellipse at 50% 40%, rgba(224, 236, 255, 0.18), transparent 55%),
    radial-gradient(ellipse at 82% 46%, rgba(230, 242, 255, 0.2), transparent 52%);
  animation: mistDrift 14s linear infinite;
}

.layer-lanterns {
  --depth-x: 0.33;
  --depth-y: 0.24;
  inset: 0;
}

.floating-lantern {
  position: absolute;
  width: 30px;
  height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(255, 216, 161, 0.5);
  background:
    radial-gradient(circle at 50% 32%, rgba(255, 242, 201, 0.92), rgba(255, 177, 102, 0.66) 58%, rgba(214, 106, 72, 0.34) 100%);
  box-shadow: 0 0 26px rgba(255, 176, 112, 0.44), 0 0 44px rgba(255, 209, 157, 0.22);
  opacity: 0.88;
  pointer-events: auto;
  animation: lanternFloat var(--float-dur, 8.5s) ease-in-out infinite;
  transition: filter 0.35s ease, transform 0.35s ease, box-shadow 0.35s ease;
}

.floating-lantern::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -9px;
  width: 12px;
  height: 10px;
  transform: translateX(-50%);
  border-radius: 6px;
  border: 1px solid rgba(255, 221, 172, 0.6);
  background: rgba(156, 102, 62, 0.44);
}

.floating-lantern:hover {
  filter: brightness(1.24) saturate(1.15);
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 0 34px rgba(255, 203, 148, 0.72), 0 0 60px rgba(255, 219, 171, 0.38);
}

#sakura-petals {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.sakura-petal {
  position: absolute;
  top: -9%;
  width: 14px;
  height: 11px;
  border-radius: 70% 40% 70% 45%;
  background: linear-gradient(145deg, rgba(255, 244, 252, 0.95), rgba(255, 185, 213, 0.82));
  box-shadow: 0 0 8px rgba(255, 207, 233, 0.44);
  opacity: 0.78;
  animation: petalFall var(--fall-dur, 12s) linear infinite;
}

#ambient-fireflies {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.screen-firefly {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 223, 1) 0%, rgba(255, 230, 130, 0.62) 55%, rgba(255, 203, 105, 0) 100%);
  box-shadow: 0 0 12px rgba(255, 226, 124, 0.62), 0 0 26px rgba(255, 226, 124, 0.24);
  opacity: 0.66;
}

#magic-particles {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.magic-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 244, 215, 0.95), rgba(167, 220, 255, 0.25));
  box-shadow: 0 0 10px rgba(180, 233, 255, 0.52);
  opacity: 0;
  animation: magicPulse 2.4s ease-out forwards;
}

#love-timer {
  position: relative;
  overflow: hidden;
  border-color: rgba(255, 233, 206, 0.42);
  background:
    radial-gradient(circle at 16% 18%, rgba(255, 198, 151, 0.2), transparent 42%),
    radial-gradient(circle at 82% 24%, rgba(165, 219, 255, 0.19), transparent 44%),
    rgba(11, 20, 41, 0.28);
  box-shadow: inset 0 0 18px rgba(255, 216, 172, 0.15), 0 0 20px rgba(170, 220, 255, 0.17);
  animation: timerBreath 4.8s ease-in-out infinite;
}

#love-timer::before {
  content: "";
  position: absolute;
  inset: -30%;
  background: radial-gradient(circle, rgba(255, 239, 206, 0.2), rgba(170, 222, 255, 0.08) 36%, transparent 68%);
  animation: timerAura 7.2s linear infinite;
}

#love-timer::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 233, 204, 0.7) 0, rgba(255, 233, 204, 0) 18%),
    radial-gradient(circle at 80% 70%, rgba(166, 225, 255, 0.68) 0, rgba(166, 225, 255, 0) 16%);
  mix-blend-mode: screen;
  opacity: 0.35;
  pointer-events: none;
}

#love-timer p {
  position: relative;
  z-index: 1;
}

@keyframes treeSway {
  0%,
  100% {
    transform: translate3d(calc(var(--parallax-x) * var(--depth-x, 0)), calc(var(--parallax-y) * var(--depth-y, 0)), 0) rotate(-0.35deg);
  }
  50% {
    transform: translate3d(calc(var(--parallax-x) * var(--depth-x, 0)), calc(var(--parallax-y) * var(--depth-y, 0)), 0) rotate(0.45deg);
  }
}

@keyframes mistDrift {
  0% {
    transform: translate3d(calc(var(--parallax-x) * var(--depth-x, 0)), calc(var(--parallax-y) * var(--depth-y, 0)), 0);
  }
  50% {
    transform: translate3d(calc(var(--parallax-x) * var(--depth-x, 0) + 2%), calc(var(--parallax-y) * var(--depth-y, 0)), 0);
  }
  100% {
    transform: translate3d(calc(var(--parallax-x) * var(--depth-x, 0)), calc(var(--parallax-y) * var(--depth-y, 0)), 0);
  }
}

@keyframes lanternFloat {
  0%,
  100% {
    transform: translateY(0) rotate(-1.5deg);
  }
  50% {
    transform: translateY(-14px) rotate(1.5deg);
  }
}

@keyframes petalFall {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
    opacity: 0;
  }
  8% {
    opacity: 0.85;
  }
  78% {
    opacity: 0.85;
  }
  100% {
    transform: translate3d(var(--drift-x, 32px), 112vh, 0) rotate(360deg);
    opacity: 0;
  }
}

@keyframes timerBreath {
  0%,
  100% {
    box-shadow: inset 0 0 18px rgba(255, 216, 172, 0.15), 0 0 18px rgba(170, 220, 255, 0.12);
  }
  50% {
    box-shadow: inset 0 0 24px rgba(255, 225, 182, 0.24), 0 0 30px rgba(170, 220, 255, 0.28);
  }
}

@keyframes timerAura {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes magicPulse {
  0% {
    transform: scale(0.4);
    opacity: 0;
  }
  20% {
    opacity: 0.9;
  }
  100% {
    transform: translateY(-22px) scale(1.35);
    opacity: 0;
  }
}

@keyframes watercolorDrift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(1.4%, -1.1%, 0) scale(1.03);
  }
}

@keyframes hudGlow {
  0%,
  100% {
    box-shadow:
      0 14px 42px rgba(4, 5, 14, 0.34),
      0 0 22px rgba(255, 214, 163, 0.12),
      inset 0 0 20px rgba(177, 221, 255, 0.08);
  }
  50% {
    box-shadow:
      0 14px 42px rgba(4, 5, 14, 0.4),
      0 0 30px rgba(255, 219, 174, 0.2),
      inset 0 0 24px rgba(177, 221, 255, 0.14);
  }
}

@media (max-width: 900px) {
  #cinematic-parallax {
    inset: -2%;
  }

  .floating-lantern {
    width: 24px;
    height: 38px;
  }

  .sakura-petal {
    width: 11px;
    height: 8px;
  }

  #hud {
    width: min(94vw, 520px);
    left: 50%;
    transform: translateX(-50%);
    top: 0.6rem;
    padding: 0.72rem 0.76rem;
  }

  #hud p {
    font-size: 0.84rem;
  }

  .hud-actions button {
    font-size: 0.8rem;
    padding: 0.5rem 0.56rem;
  }

  #mobile-note {
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    bottom: 0.45rem;
    max-width: 94vw;
    text-align: center;
    font-size: 0.74rem;
  }
}
