:root {
  --primary:    #2563eb;
  --primary-lt: #3b82f6;
  --accent:     #60a5fa;
  --shopee:     #ee4d2d;
  --shopee-dk:  #c93a1e;
  --bg:         #f0f6ff;
  --surface:    #ffffff;
  --border:     #dbeafe;
  --text:       #0f1e3d;
  --muted:      #5a7099;
  --tag-bg:     #e8f0fe;
  --radius:     14px;
  --shadow:     0 4px 24px rgba(37,99,235,.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── NAV ── */
nav {
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 16px rgba(37,99,235,.08);
}
.nav-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
  font-size: clamp(1.1rem, 4vw, 1.35rem); /* Tự thu nhỏ theo màn hình */
  color: var(--primary);
  display: flex; 
  align-items: center; 
  gap: 8px;
  white-space: normal; /* Cho phép chữ rớt xuống dòng */
  line-height: 1.2;
}
.logo span { font-size: 1.5rem; }
.nav-links {
  display: flex; gap: 6px; align-items: center;
}
.nav-links a {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: 40px;
  font-weight: 700;
  font-size: .9rem;
  text-decoration: none;
  color: var(--text);
  transition: background .2s, color .2s;
  white-space: nowrap;
}
.nav-links a:hover { background: var(--tag-bg); color: var(--primary); }
.nav-links a.fb { background: #e7f0fd; color: #1877f2; }
.nav-links a.fb:hover { background: #1877f2; color: #fff; }
.nav-links a.contact { background: var(--tag-bg); color: var(--primary); }
.nav-links a.contact:hover { background: var(--primary); color: #fff; }

/* ── HERO ── */
.hero {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 60%, #bfdbfe 100%);
  padding: 56px 20px 40px;
  text-align: center;
  border-bottom: 2px solid var(--border);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 70% 30%, rgba(96,165,250,.25) 0%, transparent 60%);
  pointer-events: none;
}
.hero-emoji { font-size: 3.5rem; display: block; margin-bottom: 12px; animation: float 3s ease-in-out infinite; }
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }
.hero h1 {
  font-family: 'Baloo 2', cursive;
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
  margin-bottom: 10px;
}
.hero p {
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 600;
  max-width: 520px;
  margin: 0 auto;
}
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary);
  color: #fff;
  border-radius: 40px;
  padding: 6px 18px;
  font-size: .85rem;
  font-weight: 700;
  margin-top: 18px;
  box-shadow: 0 4px 14px rgba(37,99,235,.35);
  animation: pulse 2.5s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{box-shadow:0 4px 14px rgba(37,99,235,.35)} 50%{box-shadow:0 4px 22px rgba(37,99,235,.55)} }

/* ── MAIN ── */
main { max-width: 900px; margin: 0 auto; padding: 40px 20px 80px; }

.section-title {
  font-family: 'Baloo 2', cursive;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 10px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, var(--border), transparent);
  border-radius: 2px;
}

/* ── CODE LIST ── */
.code-wrapper {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.code-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--surface);
  border-radius: var(--radius);
  border: 2px solid var(--border);
  overflow: hidden;
}
.code-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
  animation: slideIn .35s ease both;
}
.code-item:last-child { border-bottom: none; }
.code-item:hover { background: var(--tag-bg); }
@keyframes slideIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
.code-num {
  min-width: 28px; height: 28px;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  font-size: .78rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.code-expiry {
  font-size: .78rem;
  font-weight: 700;
  color: #1d4ed8;
  background: #dbeafe;
  border-radius: 20px;
  padding: 2px 10px;
  white-space: nowrap;
}
.code-text {
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--text);
  flex: 1;
}
.copy-btn {
  background: none; border: none; cursor: pointer;
  color: var(--muted);
  font-size: 1.1rem;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.copy-btn:hover { background: var(--border); color: var(--primary); }
.copy-btn.copied { color: #27ae60; }

/* ── FADE OVERLAY ── */
.fade-overlay {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 180px;
  background: linear-gradient(to bottom, transparent 0%, rgba(240,246,255,.97) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 28px;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.3s ease, pointer-events 0.3s ease;
}
.fade-overlay .cta-btn {
  pointer-events: all;
}

/* ── SHOPEE BUTTON ── */
.cta-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--shopee);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 14px 30px;
  font-family: 'Baloo 2', cursive;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 6px 24px rgba(238,77,45,.38);
  transition: transform .18s, box-shadow .18s, background .18s;
  animation: shopeeGlow 2.5s ease-in-out infinite;
}
.cta-btn:hover {
  background: var(--shopee-dk);
  transform: translateY(-3px);
  box-shadow: 0 10px 32px rgba(238,77,45,.5);
  animation: none;
}
@keyframes shopeeGlow {
  0%,100%{box-shadow:0 6px 24px rgba(238,77,45,.38)}
  50%{box-shadow:0 8px 36px rgba(238,77,45,.65)}
}
.cta-btn .shopee-icon { font-size: 1.3rem; }

/* ── UNLOCK HINT ── */
.unlock-hint {
  font-size: .82rem;
  color: var(--muted);
  font-weight: 600;
  margin-top: 10px;
  text-align: center;
  pointer-events: none;
}

/* ── LOADING / EMPTY ── */
.loading-wrap {
  padding: 60px 0;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  color: var(--muted); font-weight: 600;
}
.spinner {
  width: 36px; height: 36px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to{transform:rotate(360deg)} }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: #0f1e3d; color: #fff;
  padding: 11px 24px; border-radius: 40px;
  font-weight: 700; font-size: .9rem;
  opacity: 0; transition: opacity .25s;
  pointer-events: none; z-index: 999; white-space: nowrap;
}
.toast.show { opacity: 1; }

/* ── FOOTER ── */
footer {
  text-align: center;
  padding: 28px 20px;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 600;
  border-top: 2px solid var(--border);
  background: var(--surface);
}

@media (max-width: 768px) {
  /* Nav responsive */
  .nav-inner {
    flex-direction: column; /* Đẩy nút liên hệ xuống dưới logo */
    height: auto;
    padding: 12px;
    gap: 12px;
    text-align: center;
  }
 .logo {
    width: 100%;
    justify-content: center;
  }
  .logo span { font-size: 1.2rem; }
  .nav-links {
    width: 100%;
    flex-direction: row; /* Hai nút bấm nằm ngang nhau */
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }
  .nav-links a {
    width: auto;
    padding: 8px 16px;
  }

  /* Hero responsive */
  .hero {
    padding: 36px 16px 28px;
  }
  .hero-emoji { font-size: clamp(2rem, 8vw, 3.5rem); margin-bottom: 10px; }
  .hero h1 { margin-bottom: 8px; }
  .hero p { font-size: .95rem; }
  .badge { font-size: .8rem; margin-top: 14px; }

  /* Main responsive */
  main { padding: 28px 16px 60px; }
  .section-title { font-size: 1.1rem; margin-bottom: 16px; }

  /* Code list responsive */
  .code-item {
    gap: 10px;
    padding: 12px 14px;
  }
  .code-text { font-size: .85rem; }

  /* Fade overlay responsive */
  .fade-overlay { height: 200px; padding-bottom: 20px; }
  .unlock-hint { font-size: .78rem; }

  /* CTA button responsive */
  .cta-btn {
    padding: 12px 24px;
    font-size: .95rem;
    gap: 8px;
  }
  .cta-btn .shopee-icon { font-size: 1.1rem; }
}

@media (max-width: 480px) {
  /* Super small screens */
  .nav-inner { padding: 8px 10px; }
  .logo {
    font-size: clamp(.9rem, 3vw, 1rem);
  }
  .logo span { font-size: 1rem; }
  .nav-links a {
    padding: 8px 12px;
    font-size: .75rem;
  }

  .hero-emoji { font-size: clamp(1.8rem, 6vw, 2.5rem); }
  .hero h1 {
    font-size: clamp(1.2rem, 4.5vw, 1.8rem);
  }
  .hero p { font-size: .85rem; }

  main { padding: 20px 12px 50px; }
  .section-title { font-size: .95rem; }

  .code-item {
    padding: 10px 12px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .code-num {
    min-width: 24px;
    height: 24px;
    font-size: .7rem;
  }
  .code-text { font-size: .78rem; }

  .fade-overlay { height: 220px; }
  .cta-btn {
    padding: 10px 18px;
    font-size: .85rem;
    border-radius: 40px;
  }
  .cta-btn .shopee-icon { font-size: .95rem; }

  .loading-wrap { padding: 40px 0; font-size: .9rem; }
}