html, body {
  margin: 0;
  padding: 0;
  background: linear-gradient(#7dd3fc, #e0f2fe);
  font-family: system-ui;

  /* 🔥 QUAN TRỌNG */
  overflow-x: hidden;
  overflow-y: auto;
}


.yep-screen {
  position: relative;
  width: 100vw;
  height: 100vh;
}

/* Fullscreen */
.btn-fullscreen {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 9999;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: #fff;
}

/* QR */
.yep-qr {
  position: absolute;
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}
.yep-qr img {
  width: 260px;
}

.slogan-final-wrap {
  position: absolute;
  top: 32%;                 /* 🔥 CHỖ NÀY là mốc slogan */
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  pointer-events: none;
}

.yep-slogan {
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}

.yep-slogan img {
  width: 1000px;        /* to hơn QR, tạo cảm giác climax */
  /* max-width: 90vw; */
}

.slogan-gif {
  display: block;
}

.slogan-final {
  width: 1000px;
  opacity: 1;
}

.slogan-final.show {
  animation: sloganDrop 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: 2s;
}

@keyframes sloganDrop {
  0% {
    opacity: 0;
    transform: translateY(-60px) scale(0.98);
  }
  70% {
    opacity: 1;
    transform: translateY(8px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* TRACK */
.yep-track {
  position: absolute;

  /* 🔥 đặt gần progress bar */
  top: calc(100% - 220px);   /* gần progress */
  left: 50%;
  transform: translateX(-50%);

  /* 🔥 BẰNG progress bar */
  width: 80%;
  height: 130px;
  border-radius: 65px;

  overflow: visible;

  background: linear-gradient(
    to bottom,
    #5b6775 0%,
    #4a5563 50%,
    #3f4854 100%
  );

  box-shadow:
    inset 0 6px 12px rgba(255,255,255,0.15),
    inset 0 -6px 12px rgba(0,0,0,0.25),
    0 10px 28px rgba(0,0,0,0.25);
}

/* Lane sọc chạy */
.yep-track::before {
  content: "";
  position: absolute;
  inset: 0;

  background: repeating-linear-gradient(
    90deg,
    rgba(255,255,255,0.12) 0px,
    rgba(255,255,255,0.12) 22px,
    rgba(0,0,0,0.12) 22px,
    rgba(0,0,0,0.12) 44px
  );

  opacity: 0.6;

  /* 🔥 CHẠY */
  animation: trackMove 1.2s linear infinite;
}

@keyframes trackMove {
  from { background-position: 0 0; }
  to   { background-position: -44px 0; }
}

/* HORSE */
.horse {
  position: absolute;

  /* 🔥 NẰM TRÊN PROGRESS */
  bottom: 120px;     /* cao hơn progress ~40px */

  width: 450px;
  transform: scaleX(-1);

  transition: left 0.5s ease-out;
  z-index: 10;
  pointer-events: none;

  filter: drop-shadow(0 10px 14px rgba(0,0,0,0.35));
}

.horse.idle {
  filter: grayscale(70%) opacity(0.7);
}

/* PROGRESS */
.yep-progress {
  position: absolute;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 16px;
  background: #e5e7eb;
  border-radius: 999px;
}
#progressFill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ef4444, #22c55e);
  border-radius: 999px;
}
#progressText {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 26px;                 /* 🔥 cách bar một chút */

  font-size: 44px;
  font-weight: 800;
  line-height: 1;
  color: #0284c7;
  text-shadow: 0 0 12px rgba(56,189,248,0.4);
}
/* STATS */
.yep-stats {
  position: absolute;
  bottom: 20px;
  left: 10%;                 /* 🔥 nằm bên trái progress */

  display: flex;
  align-items: center;
  gap: 8px;

  font-size: 26px;
  font-weight: 700;
  color: #0284c7;
}

/* icon vô cực */
.yep-stats img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

/* COUNT */
#infinity {
  line-height: 1;
  color: #0284c7;
}

.yep-stats img {
  filter: drop-shadow(0 0 6px rgba(56,189,248,0.6));
}

.hidden { display: none; }


#effects {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 15;
}

/* EFFECT CONTAINER */
#effects {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

/* EFFECT ITEM */
.effect {
  position: absolute;
  font-size: 32px;
  user-select: none;
  animation: floatUp 1.8s ease-out forwards;
}

/* 🔥 FLOAT UP – BAY CAO ~500px */
@keyframes floatUp {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.8);
  }
  10% {
    opacity: 1;
    transform: translateY(-20px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-500px) scale(1.25);
  }
}

.firework {
  position: fixed;
  font-size: 28px;
  pointer-events: none;
  animation: explode 1.4s ease-out forwards;
}

@keyframes explode {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(0.6);
  }
  70% {
    opacity: 1;
    transform: translate(var(--dx), var(--dy)) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) scale(1.6);
  }
}


/* =========================
 * LOGOS (TOP LEFT / RIGHT)
 * ========================= */
.yep-logos {
  position: absolute;
  top: 20px;
  left: 0;
  width: 100%;
  pointer-events: none; /* tránh che click QR / fullscreen */
  z-index: 10;
}

.yep-logo {
  height: 100px;
  width: auto;
}

.yep-logo.left {
  position: absolute;
  top: 60px;
  left: 60px;
}

.yep-logo.right {
  position: absolute;
  top: 60px;
  right: 60px;
}

/* =========================
 * FIREWORK – BIG & BRIGHT
 * ========================= */
.firework-img {
  position: absolute;
  pointer-events: none;

  opacity: 0;
  transform: scale(0.3);

  /* 🌟 QUẦNG SÁNG ĐẸP (bản cũ) */
  filter:
    drop-shadow(0 0 18px rgba(255,255,255,0.85))
    drop-shadow(0 0 36px rgba(255,220,120,0.65))
    drop-shadow(0 0 64px rgba(255,180,80,0.35));

  will-change: transform, opacity;

  animation: firework-burst 1.6s ease-out forwards;
}

@keyframes firework-burst {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  15% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(2.4); /* ⚠️ 2.4 chứ KHÔNG phải 2.6 */
  }
}


/* =========================
 * FINAL HORSES
 * ========================= */
.final-horse {
  position: absolute;
  bottom: 90px; /* ngang progress bar */
  width: 500px;
  height: auto;
  pointer-events: none;
  z-index: 15;

  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.final-horse.left {
  left: 3%;
  transform: scale(0.8) scaleX(1); /* quay mặt sang phải */
}

.final-horse.right {
  right: 3%;
  transform: scale(0.8) scaleX(-1); /* quay mặt sang trái */
}

/* show */
.final-horse.show {
  opacity: 1;
  transform: scale(1) scaleX(var(--dir));
}

/* set hướng bằng biến */
.final-horse.left.show {
  --dir: 1;
}

.final-horse.right.show {
  --dir: -1;
}

/* =========================
 * R500 BADGE
 * ========================= */
 .r500-wrap {
  position: absolute;
  top: -180px;
  left: 50%;
  transform: translateX(-52%);
  z-index: 30;
}
.r500 {
  width: 320px;
  opacity: 0;
}

.r500.show {
  animation: r500Drop 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes r500Drop {
  0% {
    opacity: 0;
    transform: translateY(-60px) scale(0.98);
  }
  70% {
    opacity: 1;
    transform: translateY(6px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}