:root {
  --navy: #1b2f86;
  --blue: #2f5be0;
  --sky: #dff1ff;
  --pink: #ec4899;
  --pink-soft: #ffe4f1;
  --yellow: #ffcd2e;
  --ink: #1d2340;
  --muted: #5b6285;
  --white: #ffffff;
  --radius: 22px;
  --shadow: 0 14px 40px rgba(27, 47, 134, .14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Be Vietnam Pro", system-ui, sans-serif;
  color: var(--ink);
  background: #fff9fc;
  line-height: 1.6;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: "Baloo 2", "Be Vietnam Pro", sans-serif; line-height: 1.15; margin: 0; }
a { color: inherit; }

/* nền trời có bóng bay nhẹ */
.sky {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(circle at 10% 15%, rgba(236, 72, 153, .12) 0 120px, transparent 121px),
    radial-gradient(circle at 90% 30%, rgba(255, 205, 46, .18) 0 90px, transparent 91px),
    radial-gradient(circle at 75% 85%, rgba(47, 91, 224, .10) 0 140px, transparent 141px),
    linear-gradient(180deg, #e9f6ff 0%, #fff9fc 55%);
}

/* THANH ĐẦU TRANG */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px clamp(16px, 4vw, 48px);
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(27, 47, 134, .08);
}
.brand {
  display: flex; align-items: center; gap: 8px;
  font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 24px;
  color: var(--navy); text-decoration: none;
}
.ball-ico {
  width: 28px; height: 28px; border-radius: 50%;
  background: conic-gradient(var(--yellow) 0 33%, var(--blue) 0 66%, #fff 0);
  border: 2px solid var(--navy);
  animation: spin 6s linear infinite;
}
.topbar nav { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.topbar nav a {
  text-decoration: none; font-weight: 600; font-size: 14px;
  padding: 6px 12px; border-radius: 999px; color: var(--navy);
}
.topbar nav a:hover { background: var(--pink-soft); color: var(--pink); }

/* NÚT */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 12px 22px; border-radius: 999px;
  font-weight: 700; text-decoration: none; font-size: 16px;
  border: 2px solid transparent; cursor: pointer; font-family: inherit;
  transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-2px); }
.btn-pink { background: var(--pink); color: #fff; box-shadow: 0 8px 20px rgba(236, 72, 153, .35); }
.btn-ghost { border-color: var(--navy); color: var(--navy); background: #fff; }
.btn-ghost.light { border-color: #fff; color: #fff; background: transparent; }

/* HERO */
.hero {
  display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(24px, 4vw, 56px);
  align-items: center;
  max-width: 1200px; margin: 0 auto;
  padding: clamp(32px, 6vw, 72px) clamp(16px, 4vw, 32px) 24px;
}
.tag {
  display: inline-block; margin: 0 0 14px;
  padding: 6px 14px; border-radius: 999px;
  background: var(--yellow); color: var(--navy);
  font-weight: 800; letter-spacing: .12em; font-size: 14px;
}
.hero h1 { font-size: clamp(44px, 7vw, 80px); color: var(--navy); font-weight: 800; }
.hero h1 span {
  color: var(--pink);
  background: linear-gradient(transparent 62%, rgba(255, 205, 46, .55) 0);
}
.lead { font-size: 18px; color: var(--muted); margin: 18px 0 26px; max-width: 520px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-pic {
  margin: 0; position: relative;
  transform: rotate(2deg);
  background: #fff; padding: 12px 12px 14px; border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: float 5s ease-in-out infinite;
}
.hero-pic img { border-radius: 14px; width: 100%; height: auto; }
.hero-pic figcaption {
  text-align: center; font-family: "Baloo 2", sans-serif; font-weight: 700;
  color: var(--navy); font-size: 18px; margin-top: 8px;
}
.ticker {
  grid-column: 1 / -1; overflow: hidden;
  background: var(--navy); color: #fff; border-radius: 999px;
  padding: 10px 0; margin-top: 12px;
}
.ticker-in { display: flex; gap: 48px; width: max-content; animation: slide 28s linear infinite; }
.ticker-in span { white-space: nowrap; font-weight: 600; }

/* KHỐI CHUNG */
.sec { padding: clamp(56px, 8vw, 96px) 0; }
.sec.soft { background: linear-gradient(180deg, var(--sky), #fff); }
.sec.dark { background: var(--navy); color: #fff; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); }
.eyebrow {
  margin: 0 0 8px; font-weight: 800; color: var(--pink);
  letter-spacing: .14em; text-transform: uppercase; font-size: 13px;
}
.sec h2 { font-size: clamp(30px, 4.5vw, 46px); color: var(--navy); }
.sec.dark h2 { color: #fff; }
.sub { color: var(--muted); margin: 10px 0 0; font-size: 17px; }
.sec.dark .sub { color: #c9d3ff; }

/* THẺ LẬT LỜI CHÚC */
.cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px; margin-top: 32px;
}
.flip {
  position: relative; height: 190px; border: 0; padding: 0; cursor: pointer;
  background: none; perspective: 900px; font-family: inherit;
}
.flip .front, .flip .back {
  position: absolute; inset: 0; border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 20px; text-align: center;
  backface-visibility: hidden; transition: transform .6s cubic-bezier(.3, 1.4, .5, 1);
  box-shadow: var(--shadow);
}
.flip .front {
  background: #fff; color: var(--navy);
  font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 24px;
  border: 3px dashed rgba(236, 72, 153, .4);
}
.flip .front b { font-size: 48px; line-height: 1; }
.flip .back {
  background: linear-gradient(135deg, var(--pink), #f472b6);
  color: #fff; font-weight: 600; font-size: 17px;
  transform: rotateY(180deg);
}
.flip.on .front { transform: rotateY(180deg); }
.flip.on .back { transform: rotateY(360deg); }
.flip:nth-child(even) .front { border-color: rgba(47, 91, 224, .35); }
.flip:nth-child(even) .back { background: linear-gradient(135deg, var(--blue), #60a5fa); }

/* HÀNH TRÌNH */
.chapters { display: flex; flex-direction: column; gap: 40px; margin-top: 36px; }
.chap-head { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center; margin-bottom: 14px; }
.chap-head .emo {
  grid-row: span 2; width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center; font-size: 28px;
  background: #fff; box-shadow: var(--shadow);
}
.chap-head h3 { font-size: 26px; color: var(--navy); }
.chap-head p { margin: 0; color: var(--muted); }
.strip {
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 6px 4px 14px;
}
.strip button {
  flex: 0 0 auto; height: 230px; border: 0; padding: 6px; background: #fff;
  border-radius: 16px; box-shadow: var(--shadow); cursor: zoom-in;
  scroll-snap-align: start; transition: transform .2s;
}
.strip button:nth-child(odd) { transform: rotate(-1.5deg); }
.strip button:nth-child(even) { transform: rotate(1.5deg); }
.strip button:hover { transform: rotate(0) scale(1.04); }
.strip img { height: 100%; width: auto; border-radius: 11px; }

.chatwall { columns: 3 260px; column-gap: 14px; }
.chatwall button {
  display: block; width: 100%; margin: 0 0 14px; padding: 8px; border: 0;
  background: #fff; border-radius: 16px; box-shadow: var(--shadow);
  cursor: zoom-in; break-inside: avoid;
}
.chatwall button:nth-child(3n+1) { transform: rotate(-1deg); }
.chatwall button:nth-child(3n+2) { transform: rotate(1deg); }
.chatwall img { width: 100%; height: auto; border-radius: 10px; }

/* BÓNG MAY MẮN */
.game { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }
.game-box {
  background: rgba(255, 255, 255, .08); border-radius: var(--radius);
  padding: 32px 24px; text-align: center;
  border: 2px dashed rgba(255, 255, 255, .25);
}
.lucky {
  width: 150px; height: 150px; border-radius: 50%; border: 0; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #fff 0 8%, transparent 9%),
    conic-gradient(from 20deg, var(--yellow) 0 33%, var(--blue) 0 66%, #fff 0);
  box-shadow: 0 14px 0 rgba(0, 0, 0, .25), inset 0 -10px 20px rgba(0, 0, 0, .15);
  animation: bounce 1.6s ease-in-out infinite;
}
.lucky:active { transform: scale(.92); }
.lucky.hit { animation: hit .6s ease; }
.lucky-text {
  min-height: 3.2em; margin: 22px 0 6px;
  font-family: "Baloo 2", sans-serif; font-size: 24px; font-weight: 700; color: var(--yellow);
}
.lucky-count { margin: 0; color: #c9d3ff; font-size: 14px; }

/* ALBUM */
.grid { columns: 4 220px; column-gap: 14px; margin-top: 30px; }
.grid button {
  display: block; width: 100%; margin: 0 0 14px; padding: 0; border: 0;
  border-radius: 14px; overflow: hidden; cursor: zoom-in; background: var(--sky);
  break-inside: avoid; box-shadow: 0 6px 18px rgba(27, 47, 134, .12);
}
.grid img { width: 100%; height: auto; transition: transform .35s; }
.grid button:hover img { transform: scale(1.06); }
.more-wrap { text-align: center; margin-top: 18px; }

/* CHÂN TRANG */
.foot {
  background: linear-gradient(135deg, var(--pink), var(--navy));
  color: #fff; text-align: center;
  padding: 56px 16px 64px;
}
.foot .big { font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: clamp(24px, 4vw, 36px); margin: 0 0 8px; }
.foot p { margin: 0 0 22px; }

/* XEM ẢNH LỚN */
.lb {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(10, 14, 40, .92);
  display: flex; align-items: center; justify-content: center;
}
.lb[hidden] { display: none; }
.lb img { max-width: 92vw; max-height: 86vh; border-radius: 10px; }
.lb button {
  position: absolute; border: 0; cursor: pointer; color: #fff;
  background: rgba(255, 255, 255, .15); border-radius: 50%;
  width: 48px; height: 48px; font-size: 28px; line-height: 1;
}
.lb button:hover { background: var(--pink); }
.lb-close { top: 16px; right: 16px; font-size: 20px; }
.lb-prev { left: 12px; top: 50%; translate: 0 -50%; }
.lb-next { right: 12px; top: 50%; translate: 0 -50%; }
.lb-count { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; color: #c9d3ff; margin: 0; }

/* NÚT NHẠC */
.music {
  position: fixed; right: 16px; bottom: 16px; z-index: 40;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px 10px 12px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--navy); color: #fff; font-family: inherit; font-weight: 700; font-size: 15px;
  box-shadow: 0 10px 24px rgba(27, 47, 134, .35);
}
.music b { font-size: 20px; line-height: 1; }
.music.on { background: var(--pink); }
.music.on b { animation: dance .5s ease-in-out infinite alternate; }
@keyframes dance { from { transform: rotate(-15deg) scale(1); } to { transform: rotate(15deg) scale(1.2); } }

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; width: 100%; height: 100%; }

/* HIỆU ỨNG */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 50% { transform: rotate(2deg) translateY(-10px); } }
@keyframes slide { to { transform: translateX(-50%); } }
@keyframes bounce { 50% { transform: translateY(-14px); } }
@keyframes hit { 30% { transform: scale(.85) rotate(-20deg); } 70% { transform: scale(1.1) rotate(15deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ĐIỆN THOẠI */
@media (max-width: 820px) {
  .hero, .game { grid-template-columns: 1fr; }
  .hero-pic { transform: none; }
  .topbar nav a { padding: 4px 8px; font-size: 13px; }
  .strip button { height: 190px; }
}
@media (max-width: 520px) {
  .topbar { flex-direction: column; gap: 6px; padding: 8px 12px; }
  .brand { font-size: 20px; }
  .grid { columns: 2; column-gap: 10px; }
  .grid button { margin-bottom: 10px; }
  .flip { height: 170px; }
}
