/* Live Wall mobile: thiệp "mưa" rơi từ trên xuống. Chỉ animate transform/opacity/filter. */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #fff3df url('/bg_live_wall.png') center / cover no-repeat;
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

#rain {
  position: fixed;
  inset: 0;
  overflow: hidden;
  /* Thiệp mờ dần khi trôi vào vùng tiêu đề để chữ không chồng lên nhau. */
  -webkit-mask-image: linear-gradient(to bottom, transparent 80px, #000 124px);
  mask-image: linear-gradient(to bottom, transparent 80px, #000 124px);
}

#headline {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 80;
  padding: max(env(safe-area-inset-top), 12px) 20px 26px;
  text-align: center;
  color: var(--lw-green-strong);
  background: linear-gradient(to bottom, #fff3df 55%, rgba(255, 243, 223, 0));
  pointer-events: none;
}
/* Logo dẫn về landing page; #headline để pointer-events: none nên link phải bật lại. */
#headline .logo-link { display: block; pointer-events: auto; }
#headline .logo {
  height: 46px;
  width: 58px;
  margin: 0 auto 6px;
  background-color: var(--lw-green-strong);
  -webkit-mask: url('/logo.svg') no-repeat center / contain;
  mask: url('/logo.svg') no-repeat center / contain;
}
#headline h1 { margin: 0; font-size: 15px; line-height: 1.3; font-weight: 800; text-transform: uppercase; letter-spacing: 0.01em; }

/* ---------- Thiệp rơi: rcard (vị trí, rơi) > nudge > sway (đung đưa) > card ---------- */
.rcard {
  position: absolute;
  top: 0;
  width: calc(var(--w) * 1px);
  font-size: calc(var(--w) * 0.1);
  opacity: var(--op);
  filter: blur(calc(var(--blur) * 1px));
  will-change: transform;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.rcard.decor { pointer-events: none; }
.rcard .sway { animation: lw-sway var(--dur-sway) ease-in-out var(--delay) infinite alternate; }
.rcard .card .letter .body { -webkit-line-clamp: 4; }

@keyframes lw-sway {
  from { transform: translateX(-9px) rotate(-1.2deg); }
  to { transform: translateX(9px) rotate(1.2deg); }
}

#veil {
  position: absolute;
  inset: 0;
  z-index: 90;
  background: rgba(255, 243, 223, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease-out;
}
#veil.on { opacity: 1; }

/* ---------- Thiệp mới lên sân khấu ---------- */
#hero {
  position: fixed;
  left: 0;
  top: 0;
  width: calc(var(--w) * 1px);
  font-size: calc(var(--w) * 0.085);
  opacity: 0;
  z-index: 110;
  pointer-events: none;
  will-change: transform, opacity;
}
/* Có thiệp trên sân khấu thì bắt chạm để xem to hơn; lúc trống không chặn thiệp "mưa" phía sau. */
#hero.live {
  pointer-events: auto;
  cursor: pointer;
}
#hero .card { box-shadow: 0 1.6em 3.4em rgba(90, 55, 20, 0.3); }
#hero .card .letter .body { -webkit-line-clamp: 7; }

#hint {
  position: fixed;
  left: 0;
  right: 0;
  bottom: max(env(safe-area-inset-bottom), 14px);
  margin: 0;
  z-index: 80;
  text-align: center;
  font-size: 12px;
  color: rgba(11, 107, 56, 0.75);
  transition: opacity 400ms;
  pointer-events: none;
}
#hint.gone { opacity: 0; }
