/* Màn LED Live Wall: sân khấu thiết kế 1920x1080, JS scale và mở rộng để phủ kín mọi kích thước cửa sổ (fitStage).
   Thiệp chồng dày thành một "đống" theo 3 lớp chiều sâu (trước rõ / giữa / sau mờ), trôi nhẹ liên tục.
   Chỉ animate transform/opacity để chạy mượt trên GPU (không dùng filter/blend-mode trên phần tử đang chuyển động). */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #fff3df; overflow: hidden; }
body.idle { cursor: none; }
body.idle .bcard { cursor: none; }
body { font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }

#stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 1920px; /* JS đặt lại theo cửa sổ */
  height: 1080px;
  transform-origin: 0 0;
  overflow: hidden;
  isolation: isolate;
  background: #fff3df url('/bg_live_wall.png') center / cover no-repeat;
}
#board { position: absolute; inset: 0; }

/* ---------- Thiệp trên bảng: bcard (vị trí, nghiêng, vòng đời) > push (nảy/đẩy) > float (đi lang thang, WAAPI trong JS) > card ---------- */
.bcard {
  position: absolute;
  width: calc(var(--w) * 1px);
  font-size: calc(var(--w) * 0.058);
  transform: rotate(var(--rot)) scale(var(--life-scale, 1));
  opacity: var(--op);
  cursor: pointer;
  transition: transform 2s ease, opacity 2s ease;
}
.bcard .card.pop { animation: lw-pop 900ms cubic-bezier(0.2, 1.4, 0.4, 1); }
.bcard.leaving { animation: lw-leave 700ms ease-in forwards; pointer-events: none; }

@keyframes lw-pop {
  0% { transform: scale(0.94, 1.05); }
  55% { transform: scale(1.03, 0.97); }
  100% { transform: scale(1); }
}
@keyframes lw-leave { to { opacity: 0; transform: rotate(var(--rot)) scale(0.9); } }

/* Vùng mờ quanh logo và tiêu đề (như bản Figma): thiệp đi qua đây bị làm mờ và nhạt dần về màu nền, rìa của vùng tan mềm vào nền.
   Nằm trên mọi thiệp trên bảng (z 30) và dưới chữ tiêu đề. Chỉ một lớp backdrop-filter, diện tích nhỏ. */
#halo {
  position: absolute;
  left: 50%;
  top: -160px;
  width: min(1300px, 92%);
  height: 760px;
  transform: translateX(-50%);
  z-index: 35;
  pointer-events: none;
  background: radial-gradient(ellipse closest-side at 50% 50%, rgba(255, 243, 223, 0.94) 0%, rgba(255, 243, 223, 0.82) 50%, rgba(255, 243, 223, 0) 100%);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  -webkit-mask-image: radial-gradient(ellipse closest-side at 50% 50%, #000 55%, transparent 100%);
  mask-image: radial-gradient(ellipse closest-side at 50% 50%, #000 55%, transparent 100%);
}

/* ---------- Tiêu đề ---------- */
#headline {
  position: absolute;
  left: 0;
  right: 0;
  top: 44px;
  text-align: center;
  color: var(--lw-green-strong);
  z-index: 36;
  pointer-events: none;
  text-shadow: 0 0 14px #fff3df, 0 0 28px #fff3df;
}
/* 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: 118px;
  width: 150px;
  margin: 0 auto 26px;
  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: 30px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

#qr {
  position: absolute;
  right: 44px;
  bottom: 44px;
  width: min(214px, 12%);
  aspect-ratio: 1;
  padding: 16px;
  border-radius: 24px;
  background: var(--lw-green-strong);
  z-index: 40;
}
#qr img { width: 100%; height: 100%; display: block; border-radius: 10px; background: #fff; }

/* ---------- Thiệp mới lên sân khấu ---------- */
#hero {
  position: absolute;
  left: 700px; /* JS căn giữa theo sân khấu */
  top: 300px;
  pointer-events: none;
  width: 420px; /* JS đặt lại theo sân khấu */
  opacity: 0;
  transform-origin: 50% 50%;
  will-change: transform, opacity;
  font-size: 24.36px; /* 420 * 0.058 giống thiệp trên bảng để thiệp nhảy vào vị trí nhìn liền mạch */
  z-index: 60;
}
/* Có thiệp trên sân khấu thì bắt chuột để bấm xem to hơn; lúc trống vẫn không chặn thiệp trên bảng. */
#hero.live {
  pointer-events: auto;
  cursor: pointer;
}
#hero .card { box-shadow: 0 1.2em 3em rgba(51, 54, 28, 0.32); }
#hero .card .letter .body { -webkit-line-clamp: 7; }

/* ---------- Thông báo có thiệp mới (góc trên phải) ----------
   Màu và tỉ lệ theo ảnh mẫu: pill kem, chữ xanh đậm in hoa giãn chữ, sao cam. Kích thước theo em để tỉ lệ
   giữ nguyên khi đổi font-size (ảnh mẫu: pill cao ~3.2em, chữ ~12.5px). */
#notice {
  position: absolute;
  top: 44px;
  right: 44px;
  display: flex;
  align-items: center;
  gap: 0.65em;
  padding: 1.1em 1.3em;
  border: 1px solid rgba(42, 87, 53, 0.08);
  border-radius: 999px;
  background: #fefbed;
  box-shadow: 0 0.5em 1.4em rgba(51, 54, 28, 0.18);
  color: #2a5735;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  z-index: 65;
  pointer-events: none;
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.22, 0.9, 0.3, 1);
}
#notice.show {
  opacity: 1;
  transform: translateX(0);
}
.notice__star {
  color: #d0902b;
  font-size: 1.1em;
  line-height: 1;
}

#status {
  position: absolute;
  left: 18px;
  bottom: 12px;
  color: rgba(11, 107, 56, 0.7);
  font-size: 18px;
  z-index: 70;
}
