:root {
  --coral: #FF6B6B;
  --coral-soft: #FFE5E5;
  --yellow: #FFD93D;
  --yellow-soft: #FFF6CC;
  --mint: #6BCB77;
  --mint-soft: #E3F9E6;
  --sky: #4D96FF;
  --sky-soft: #E6F0FF;
  --lavender: #A78BFA;
  --lavender-soft: #F3EFFF;
  --bg: #FAFAFA;
  --ink: #1F2937;
  --muted: #6B7280;
  --card-radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: 'Be Vietnam Pro', 'Segoe UI', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, .font-display {
  font-family: 'Baloo 2', 'Be Vietnam Pro', 'Segoe UI', system-ui, sans-serif;
}

/* Playful dot grid background accent */
.bg-toy-dots {
  background-color: #FAFAFA;
  background-image:
    radial-gradient(rgba(255, 107, 107, 0.08) 1.5px, transparent 1.5px),
    radial-gradient(rgba(77, 150, 255, 0.08) 1.5px, transparent 1.5px);
  background-size: 32px 32px;
  background-position: 0 0, 16px 16px;
}

/* Pastel hero gradient */
.hero-gradient {
  background: linear-gradient(135deg, #FFF5F5 0%, #FFFBEB 45%, #EFF6FF 100%);
  border: 2px solid rgba(255, 217, 61, 0.45);
  box-shadow: 0 20px 50px -15px rgba(255, 107, 107, 0.16), 0 8px 24px -10px rgba(77, 150, 255, 0.14);
}

/* Glass sticky navbar */
.glass-nav {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1.5px solid rgba(229, 231, 235, 0.8);
}

/* Blind Box 3D Hover Tilt Card */
.blind-box-card {
  border-radius: 24px;
  background: #FFFFFF;
  border: 2px solid #F3F4F6;
  box-shadow: 0 10px 30px -10px rgba(17, 24, 39, 0.08);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.3s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.blind-box-card:hover {
  transform: rotate(-2deg) scale(1.03) translateY(-6px);
  box-shadow: 0 24px 44px -12px rgba(255, 107, 107, 0.22), 0 10px 20px -8px rgba(77, 150, 255, 0.18);
  border-color: var(--yellow);
}

.blind-box-card .box-reveal-badge {
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  transition: all 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.blind-box-card:hover .box-reveal-badge {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.blind-box-card .box-art {
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.blind-box-card:hover .box-art {
  transform: scale(1.07) rotate(2deg);
}

/* Individual Figure Card */
.figure-card {
  border-radius: 20px;
  background: #FFFFFF;
  border: 1.5px solid #F1F5F9;
  box-shadow: 0 6px 20px -8px rgba(15, 23, 42, 0.07);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.figure-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 30px -10px rgba(77, 150, 255, 0.18);
  border-color: #BFDBFE;
}

/* Shimmering Golden SECRET badge */
.secret-badge {
  background: linear-gradient(120deg, #F59E0B, #FDE047, #F59E0B);
  background-size: 200% auto;
  color: #78350F;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
  animation: shimmer 2.5s linear infinite;
}

@keyframes shimmer {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

/* Gentle floating animation for hero items */
@keyframes floatSlow {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
}

.animate-float {
  animation: floatSlow 4.2s ease-in-out infinite;
}

.animate-float-delay {
  animation: floatSlow 4.8s ease-in-out 1.1s infinite;
}

/* Responsive 16:9 Media Container */
.video-aspect {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: 20px;
  overflow: hidden;
  background: #111827;
  box-shadow: 0 14px 32px -12px rgba(17, 24, 39, 0.28);
}

.video-aspect iframe,
.video-aspect video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}

/* Slide-over Cart Drawer */
.cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  backdrop-filter: blur(4px);
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.cart-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(440px, 100vw);
  background: #FFFFFF;
  z-index: 70;
  box-shadow: -16px 0 40px rgba(15, 23, 42, 0.18);
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
}

.cart-drawer.open {
  transform: translateX(0);
}

/* Lightbox / Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.62);
  backdrop-filter: blur(6px);
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.open {
  display: flex;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Toast Notifications */
.toast-stack {
  position: fixed;
  bottom: 96px; /* chừa chỗ cho nút Trợ lý ở góc phải dưới */
  right: 24px;
  z-index: 95;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  min-width: 260px;
  max-width: 360px;
  border-radius: 16px;
  padding: 12px 16px;
  background: #FFFFFF;
  color: var(--ink);
  box-shadow: 0 16px 32px -8px rgba(15, 23, 42, 0.22);
  border-left: 5px solid var(--mint);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  animation: slideUpToast 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast-item.error {
  border-left-color: var(--coral);
}

.toast-item.info {
  border-left-color: var(--sky);
}

@keyframes slideUpToast {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Custom buttons */
.btn-coral {
  background: linear-gradient(135deg, #FF6B6B, #FF8E8E);
  color: #FFFFFF;
  box-shadow: 0 8px 20px -6px rgba(255, 107, 107, 0.55);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn-coral:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -6px rgba(255, 107, 107, 0.65);
  filter: brightness(1.03);
}

.btn-sky {
  background: linear-gradient(135deg, #4D96FF, #6BA8FF);
  color: #FFFFFF;
  box-shadow: 0 8px 18px -6px rgba(77, 150, 255, 0.45);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.btn-sky:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -6px rgba(77, 150, 255, 0.55);
}

button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

/* Subtle custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #F3F4F6;
}

::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* ===================== Tài khoản (avatar góc phải) ===================== */
.account-avatar {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #E6F0FF, #FFE5E5);
  color: #374151;
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 0 2px #E5E7EB, 0 6px 14px -6px rgba(15, 23, 42, 0.25);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.account-avatar:hover { transform: translateY(-1px); box-shadow: 0 0 0 2px var(--sky), 0 8px 18px -6px rgba(77, 150, 255, 0.4); }
.account-avatar.is-staff { background: linear-gradient(135deg, #6BCB77, #34D399); color: #FFFFFF; box-shadow: 0 0 0 2px #A7F3D0, 0 6px 14px -6px rgba(16, 185, 129, 0.5); }
.account-dot { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 999px; background: #10B981; border: 2px solid #FFFFFF; }

.account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 250px;
  background: #FFFFFF;
  border-radius: 18px;
  border: 1px solid #E5E7EB;
  box-shadow: 0 20px 40px -12px rgba(15, 23, 42, 0.25);
  overflow: hidden;
  z-index: 60;
  animation: fadeIn 0.15s ease;
}
.account-menu-item { display: block; padding: 11px 16px; font-size: 0.875rem; font-weight: 700; color: #374151; cursor: pointer; }
.account-menu-item:hover { background: #FFF5F5; color: var(--coral); }

/* ===================== Thanh toán ===================== */
.pay-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 6px;
  border-radius: 14px;
  border: 2px solid #E5E7EB;
  background: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 800;
  color: #4B5563;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.pay-option:hover { border-color: #BFDBFE; }
.pay-option.active { border-color: var(--sky); background: var(--sky-soft); color: #1D4ED8; }
.pay-option:focus-within { outline: 2px solid var(--sky); outline-offset: 2px; }
.pay-panel { border-radius: 14px; background: #FFFFFF; border: 1px dashed #CBD5E1; padding: 12px; font-size: 0.8rem; font-weight: 600; color: #4B5563; }
.qr-box { width: 180px; height: 180px; background: #FFFFFF; border-radius: 14px; border: 1px solid #E5E7EB; padding: 6px; }
.qr-box svg { width: 100%; height: 100%; display: block; }
.qr-fallback { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 800; font-size: 2rem; color: #9CA3AF; }
.qr-fallback span { font-size: 0.7rem; }

/* ===================== Blind box: chọn 1 trong 5 hộp ===================== */
.bb-panel {
  position: relative;
  width: min(860px, 100%);
  max-height: 94vh;
  overflow-y: auto;
  border-radius: 30px;
  background: linear-gradient(160deg, #FFF5F5 0%, #FFFBEB 45%, #F3EFFF 100%);
  border: 2px solid #FFFFFF;
  box-shadow: 0 30px 80px -20px rgba(17, 24, 39, 0.5);
}
.bb-stage { position: relative; min-height: 320px; margin: 18px 20px 20px; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 24px; }
.bb-boxes { position: relative; z-index: 2; display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; padding: 24px 8px 36px; }
.bb-box {
  position: relative;
  width: 132px;
  height: 160px;
  border-radius: 20px;
  background: #FFFFFF;
  border: 3px solid transparent;
  box-shadow: 0 12px 24px -12px rgba(17, 24, 39, 0.35);
  padding: 10px;
  cursor: pointer;
  animation: bbFloat 3.2s ease-in-out infinite;
  animation-delay: calc(var(--i) * -0.6s);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease, border-color 0.2s ease, filter 0.3s ease;
}
.bb-box img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; user-select: none; }
.bb-box.has-label { height: 196px; display: flex; flex-direction: column; gap: 6px; padding: 14px 12px 10px; }
.bb-box.has-label img { flex: 1; min-height: 0; height: auto; }
.bb-box-label { min-height: 2.4em; }
.bb-box-label { display: block; font-size: 0.7rem; font-weight: 800; line-height: 1.2; color: #374151; text-align: center; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hero-open-box { cursor: pointer; }
.hero-open-box:hover { box-shadow: 0 0 0 3px #FFD93D, 0 25px 50px -12px rgba(0, 0, 0, 0.25); }
.hero-open-box:focus-visible { outline: 3px solid #4D96FF; outline-offset: 4px; }

/* Mũi tên chỉ vào hộp ở banner */
.hero-arrow { position: absolute; z-index: 30; left: -44px; top: -30px; display: flex; flex-direction: row; align-items: flex-start; color: var(--coral); pointer-events: none; animation: heroArrowNudge 1.4s ease-in-out infinite; }
.hero-arrow-label {
  font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 1.15rem; line-height: 1.1;
  color: #FFFFFF; background: var(--coral); padding: 8px 14px; border-radius: 16px; border: 2px solid #FFFFFF;
  box-shadow: 0 10px 22px -6px rgba(255, 107, 107, 0.7); transform: rotate(-6deg);
}
/* Mũi tên đủ dài để đầu mũi tên nằm bên trong hộp */
.hero-arrow-svg { width: 104px; height: 78px; margin: -6px 0 0 -4px; flex-shrink: 0; filter: drop-shadow(0 3px 4px rgba(255, 255, 255, 0.9)) drop-shadow(0 3px 6px rgba(255, 107, 107, 0.45)); }
@media (min-width: 1280px) {
  .hero-arrow { left: -92px; top: -14px; }
}

/* Nút vòng tròn đổi hộp (thay cho ảnh hộp nhỏ) */
.hero-next-btn {
  position: absolute; left: 0; bottom: 8px; z-index: 25;
  width: 76px; height: 76px; border-radius: 999px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: #FFFFFF; color: var(--sky);
  border: 3px solid #BFDBFE;
  box-shadow: 0 14px 26px -10px rgba(77, 150, 255, 0.55);
  cursor: pointer; transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.hero-next-btn:hover { background: var(--sky); color: #FFFFFF; border-color: var(--sky); transform: scale(1.06); }
.hero-next-btn:focus-visible { outline: 3px solid #FFD93D; outline-offset: 3px; }
@media (max-width: 639px) {
  .hero-next-btn { width: 58px; height: 58px; left: -8px; bottom: -6px; }
  .hero-next-btn svg { width: 22px; height: 22px; }
  #hero-box-name { padding-left: 1.75rem; }
  .hero-arrow { left: -4px; }
  .hero-arrow-label { font-size: 1rem; }
}
.hero-next-label { font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em; }
.hero-next-btn.is-spinning svg { animation: heroSpin 0.5s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes heroSpin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

/* Hiệu ứng đổi ảnh hộp */
.hero-swap-out { animation: heroSwapOut 0.18s ease-in forwards; }
.hero-swap-in { animation: heroSwapIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes heroSwapOut { to { opacity: 0; transform: scale(0.7) rotate(-12deg); } }
@keyframes heroSwapIn { from { opacity: 0; transform: scale(0.7) rotate(12deg); } to { opacity: 1; transform: none; } }

/* Hộp duy nhất khi mở ngay từ banner */
.bb-box.bb-box-solo { width: 170px; height: 210px; cursor: default; }
@keyframes heroArrowNudge {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(0, 7px); }
}
.hero-cta-pulse { animation: heroCtaPulse 1.6s ease-in-out infinite; }
@keyframes heroCtaPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 217, 61, 0.7), 0 10px 15px -3px rgba(0, 0, 0, 0.2); }
  50% { box-shadow: 0 0 0 10px rgba(255, 217, 61, 0), 0 10px 15px -3px rgba(0, 0, 0, 0.2); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-arrow, .hero-cta-pulse { animation: none; }
}
.bb-box-num { position: absolute; top: -10px; left: -10px; width: 28px; height: 28px; border-radius: 999px; background: #1F2937; color: #FFD93D; font-weight: 800; font-size: 0.8rem; display: flex; align-items: center; justify-content: center; }
.bb-box:hover { border-color: #FFD93D; }
.bb-boxes.has-selection .bb-box:not(.is-selected) { opacity: 0.55; filter: saturate(0.6); transform: scale(0.94); }
.bb-box.is-selected { border-color: var(--coral); animation: none; transform: translateY(-16px) scale(1.08); box-shadow: 0 24px 40px -14px rgba(255, 107, 107, 0.6); }
.bb-box.is-selected::after { content: "Bấm để mở!"; position: absolute; left: 50%; bottom: -30px; transform: translateX(-50%); white-space: nowrap; font-size: 0.72rem; font-weight: 800; color: var(--coral); animation: bbBlink 1s ease-in-out infinite; }
.bb-boxes.is-opening .bb-box:not(.is-chosen) { opacity: 0; transform: scale(0.6) translateY(30px); pointer-events: none; transition-duration: 0.35s; }
/* Hộp được chọn bay vào giữa sân khấu (--dx, --dy tính bằng JS) và to ra một chút */
.bb-boxes.is-opening .bb-box.is-chosen {
  animation: none;
  z-index: 3;
  border-color: #FFD93D;
  transform: translate(var(--dx, 0px), var(--dy, 0px)) scale(1.35);
  box-shadow: 0 0 0 6px rgba(255, 217, 61, 0.35), 0 30px 60px -18px rgba(255, 107, 107, 0.6);
  transition: transform 0.7s cubic-bezier(0.34, 1.3, 0.64, 1), box-shadow 0.7s ease, border-color 0.3s ease;
}
.bb-boxes.is-opening .bb-box.is-chosen::after { display: none; }
.bb-box.bb-shake { animation: bbShake 1.1s cubic-bezier(.36,.07,.19,.97) both; }
.bb-box.bb-burst { animation: bbBurst 0.4s ease-in forwards; }

.bb-rays {
  position: absolute; inset: -50%; z-index: 0; opacity: 0;
  background: repeating-conic-gradient(from 0deg, rgba(255, 217, 61, 0.35) 0deg 10deg, transparent 10deg 20deg);
  transition: opacity 0.4s ease;
}
.bb-stage.is-revealed .bb-rays { opacity: 1; animation: bbSpin 14s linear infinite; }
.bb-stage.is-secret .bb-rays { background: repeating-conic-gradient(from 0deg, rgba(245, 158, 11, 0.55) 0deg 8deg, rgba(253, 224, 71, 0.15) 8deg 16deg); }
.bb-flash { position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 999px; background: radial-gradient(circle, #FFFFFF 0%, rgba(255, 255, 255, 0.85) 40%, rgba(255, 217, 61, 0) 70%); opacity: 0; z-index: 4; pointer-events: none; }
.bb-stage.is-flashing .bb-flash { animation: bbFlash 0.7s ease-out forwards; }

.bb-reveal { position: relative; z-index: 3; text-align: center; padding: 20px; }
.bb-figure { width: 230px; height: 230px; margin: 0 auto; border-radius: 28px; background: #FFFFFF; padding: 12px; box-shadow: 0 24px 50px -16px rgba(17, 24, 39, 0.45); animation: bbPop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.bb-stage.is-secret .bb-figure { box-shadow: 0 0 0 4px #FDE047, 0 0 40px 6px rgba(245, 158, 11, 0.55); }
.bb-figure img { width: 100%; height: 100%; object-fit: contain; }
.bb-name { animation: fadeIn 0.6s ease 0.35s both; }

.bb-confetti { position: absolute; left: 50%; top: 45%; z-index: 5; pointer-events: none; }
.bb-confetti i { position: absolute; left: 0; top: 0; border-radius: 2px; opacity: 0; animation: bbConfetti var(--d) cubic-bezier(0.22, 1, 0.36, 1) forwards; }

@keyframes bbFloat { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-8px) rotate(1.5deg); } }
@keyframes bbBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes bbShake {
  0% { transform: translate(var(--dx, 0px), var(--dy, 0px)) scale(1.35) rotate(0); }
  10%, 50% { transform: translate(var(--dx, 0px), var(--dy, 0px)) scale(1.35) rotate(-7deg) translateX(-4px); }
  20%, 60% { transform: translate(var(--dx, 0px), var(--dy, 0px)) scale(1.38) rotate(7deg) translateX(4px); }
  30%, 70% { transform: translate(var(--dx, 0px), var(--dy, 0px)) scale(1.4) rotate(-10deg); }
  40%, 80% { transform: translate(var(--dx, 0px), var(--dy, 0px)) scale(1.42) rotate(10deg); }
  90% { transform: translate(var(--dx, 0px), var(--dy, 0px)) scale(1.48) rotate(-4deg); }
  100% { transform: translate(var(--dx, 0px), var(--dy, 0px)) scale(1.5) rotate(0); }
}
@keyframes bbBurst {
  from { transform: translate(var(--dx, 0px), var(--dy, 0px)) scale(1.5); }
  to { transform: translate(var(--dx, 0px), var(--dy, 0px)) scale(2.1) rotate(8deg); opacity: 0; filter: brightness(2.2) blur(3px); }
}
@keyframes bbFlash { 0% { opacity: 0; transform: scale(0.2); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(22); } }
@keyframes bbPop { 0% { transform: scale(0.1) rotate(-25deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes bbSpin { to { transform: rotate(360deg); } }
@keyframes bbConfetti {
  0% { opacity: 1; transform: translate(0, 0) rotate(0); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--x), calc(var(--y) + 260px)) rotate(var(--r)); }
}

@media (max-width: 640px) {
  .bb-box { width: 96px; height: 118px; }
  .bb-figure { width: 180px; height: 180px; }
}

/* ===================== Bộ sưu tập: mẫu chưa có = bóng đen mờ ===================== */
.collect-card { position: relative; border-radius: 20px; background: #FFFFFF; border: 2px solid #F1F5F9; padding: 10px; transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; }
.collect-card:hover { transform: translateY(-3px); box-shadow: 0 14px 28px -12px rgba(15, 23, 42, 0.2); }
.collect-card.is-owned { border-color: #A7F3D0; }
.collect-card.is-owned.is-secret { border-color: #FDE047; background: linear-gradient(180deg, #FFFBEB, #FFFFFF); }
.collect-art { position: relative; height: 130px; border-radius: 14px; overflow: hidden; background: #F8FAFC; display: flex; align-items: center; justify-content: center; }
.collect-art img { max-width: 100%; max-height: 100%; object-fit: contain; transition: filter 0.4s ease, opacity 0.4s ease, transform 0.4s ease; }
.collect-card:not(.is-owned) .collect-art { background: #1F2937; }
.collect-card:not(.is-owned) .collect-art img { filter: grayscale(1) brightness(0.22) contrast(1.4) blur(4px); opacity: 0.85; transform: scale(1.04); }
.collect-unknown { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 2.4rem; color: rgba(255, 255, 255, 0.6); text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); }
.collect-card.is-owned .collect-unknown { display: none; }

/* ===================== Trang nhân viên ===================== */
.admin-label { display: block; font-size: 0.75rem; font-weight: 800; color: #4B5563; margin-bottom: 4px; }
.admin-input { width: 100%; padding: 10px 14px; border-radius: 12px; border: 1px solid #E5E7EB; font-size: 0.875rem; font-weight: 600; }
.admin-input:focus { outline: none; box-shadow: 0 0 0 2px #4D96FF; border-color: transparent; }

@media (prefers-reduced-motion: reduce) {
  .bb-box, .bb-rays, .animate-float, .animate-float-delay { animation: none !important; }
}

/* ===================== Trợ lý HACIPUPU (chat box) ===================== */
.chat-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 75;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px 12px 14px; border-radius: 999px;
  background: linear-gradient(135deg, #FF8E8E, #FF6B6B 55%, #FFB547); color: #FFFFFF;
  font-weight: 800; font-size: 0.9rem; border: 3px solid #FFFFFF;
  box-shadow: 0 16px 32px -10px rgba(255, 107, 107, 0.65);
  cursor: pointer; transition: transform 0.2s ease, opacity 0.2s ease;
}
.chat-fab:hover { transform: translateY(-2px) scale(1.03); }
.chat-fab:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
.chat-fab.hidden-fab { opacity: 0; pointer-events: none; transform: scale(0.8); }
/* Trang nhân viên: chỉ hiện icon, dạng ô vuông bo góc giống icon trên tab */
.chat-fab.chat-fab--icon { width: 54px; height: 54px; padding: 0; justify-content: center; border-radius: 16px; }
.chat-fab.chat-fab--icon .chat-fab-text { display: none; }
.chat-fab-icon { display: inline-flex; animation: chatWiggle 2.4s ease-in-out infinite; }
@keyframes chatWiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-14deg); } 92% { transform: rotate(10deg); } }

.chat-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 76;
  width: min(380px, calc(100vw - 24px)); height: min(580px, calc(100vh - 100px));
  display: flex; flex-direction: column; overflow: hidden;
  background: #FFFFFF; border-radius: 24px; border: 2px solid #FFE5E5;
  box-shadow: 0 30px 60px -20px rgba(17, 24, 39, 0.45);
  opacity: 0; pointer-events: none; transform: translateY(16px) scale(0.97); transform-origin: bottom right;
  transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.chat-panel.open { opacity: 1; pointer-events: auto; transform: none; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px; background: linear-gradient(90deg, #FFF5F5, #FFFBEB, #EFF6FF); border-bottom: 1px solid #F3F4F6; }
.chat-title { font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 1.1rem; color: #111827; line-height: 1.1; }
.chat-sub { font-size: 0.72rem; font-weight: 700; color: #6B7280; }
.chat-close { width: 32px; height: 32px; border-radius: 999px; background: #FFFFFF; color: #4B5563; font-weight: 800; cursor: pointer; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08); }
.chat-close:hover { background: #F3F4F6; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #FAFAFA; }
.chat-msg { max-width: 88%; padding: 10px 13px; border-radius: 16px; font-size: 0.84rem; line-height: 1.5; font-weight: 500; color: #1F2937; overflow-wrap: anywhere; }
.chat-msg.bot { align-self: flex-start; background: #FFFFFF; border: 1px solid #EEF0F3; border-bottom-left-radius: 6px; }
.chat-msg.user { align-self: flex-end; background: var(--coral); color: #FFFFFF; border-bottom-right-radius: 6px; font-weight: 700; }
.chat-msg.typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.chat-msg.typing span { width: 7px; height: 7px; border-radius: 999px; background: #CBD5E1; animation: chatDot 1s ease-in-out infinite; }
.chat-msg.typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-msg.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes chatDot { 0%, 100% { transform: translateY(0); opacity: 0.5; } 50% { transform: translateY(-4px); opacity: 1; } }
.chat-link { color: #2563EB; font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }
.chat-card { display: flex; gap: 10px; align-items: center; margin-top: 8px; padding: 8px; border-radius: 12px; background: #F9FAFB; border: 1px solid #F1F5F9; }
.chat-card img { width: 48px; height: 48px; object-fit: contain; border-radius: 10px; background: #FFFFFF; flex-shrink: 0; }
.chat-secret { display: inline-block; padding: 0 6px; border-radius: 999px; background: #FDE047; color: #78350F; font-size: 0.62rem; font-weight: 800; vertical-align: middle; }
.chat-suggest { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px; border-top: 1px solid #F3F4F6; background: #FFFFFF; }
.chat-chip { flex-shrink: 0; padding: 6px 11px; border-radius: 999px; background: #FFF5F5; color: #E05252; border: 1px solid #FFD5D5; font-size: 0.72rem; font-weight: 800; cursor: pointer; white-space: nowrap; }
.chat-chip:hover { background: #FFE5E5; }
.chat-form { display: flex; gap: 8px; padding: 10px 12px 12px; background: #FFFFFF; }
.chat-input { flex: 1; min-width: 0; padding: 10px 14px; border-radius: 999px; border: 1px solid #E5E7EB; font-size: 0.85rem; font-weight: 600; }
.chat-input:focus { outline: none; border-color: transparent; box-shadow: 0 0 0 2px var(--sky); }
.chat-send { width: 42px; height: 42px; border-radius: 999px; background: var(--coral); color: #FFFFFF; font-size: 1rem; cursor: pointer; flex-shrink: 0; }
.chat-send:hover { filter: brightness(1.05); }
@media (max-width: 639px) {
  .chat-fab-text { display: none; }
  .chat-fab { padding: 14px; right: 14px; bottom: 14px; }
  .chat-panel { right: 12px; bottom: 12px; height: calc(100vh - 90px); }
  .toast-stack { right: 12px; left: 12px; bottom: 84px; }
}
@media (prefers-reduced-motion: reduce) {
  .chat-fab-icon, .chat-msg.typing span { animation: none; }
}

/* ---------- Hướng dẫn nhanh dạng chỉ tay (js/tour.js) — tông pastel của trang ---------- */
.tour-blocker { position: fixed; inset: 0; z-index: 200; }
.tour-spot { position: fixed; z-index: 201; border-radius: 22px; pointer-events: none;
  box-shadow: 0 0 0 4px var(--coral), 0 0 0 10px rgba(255, 217, 61, 0.55), 0 0 0 9999px rgba(31, 41, 55, 0.45);
  transition: left 0.28s ease, top 0.28s ease, width 0.28s ease, height 0.28s ease; }
.tour-pop { position: fixed; z-index: 202; padding-top: 46px; transition: top 0.28s ease, left 0.28s ease; }
.tour-mascot { position: absolute; top: 0; left: 18px; width: 64px; height: 64px; z-index: 2;
  border-radius: 999px; background: var(--yellow-soft); object-fit: contain; padding: 4px; border: 3px solid var(--yellow);
  box-shadow: 0 8px 18px -8px rgba(255, 107, 107, 0.55); animation: tourBob 2.2s ease-in-out infinite; }
.tour-bubble { position: relative; background: linear-gradient(160deg, #FFFFFF 0%, #FFF8EC 100%); color: #4B5563;
  border: 2px solid #FFC2C2; border-radius: 22px; padding: 26px 18px 14px;
  box-shadow: 0 22px 50px -20px rgba(255, 107, 107, 0.55); }
.tour-bubble::before { content: ""; position: absolute; left: var(--arrow-x, 50%); top: -11px; width: 18px; height: 18px; margin-left: -9px;
  background: #FFFFFF; border-left: 2px solid #FFC2C2; border-top: 2px solid #FFC2C2; transform: rotate(45deg); }
.tour-pop.is-above .tour-bubble::before { top: auto; bottom: -11px; background: #FFF8EC; transform: rotate(225deg); }
.tour-title { font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 1.2rem; line-height: 1.3; color: var(--coral); margin-bottom: 6px; }
.tour-text { font-size: 0.9rem; line-height: 1.6; font-weight: 500; }
.tour-text b { color: var(--ink); }
.tour-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; white-space: nowrap; }
.tour-gap { flex: 1; }
.tour-skip, .tour-back { background: none; border: 0; padding: 6px 4px; color: #9CA3AF; font: inherit; font-size: 0.84rem; font-weight: 800; cursor: pointer; }
.tour-skip:hover, .tour-back:hover { color: var(--coral); }
.tour-count { padding: 3px 9px; border-radius: 999px; background: var(--yellow-soft); color: #B45309; font-size: 0.78rem; font-weight: 800; }
.tour-next { background: linear-gradient(135deg, #FF6B6B, #FF8E8E); color: #FFFFFF; border: 0; border-radius: 999px; padding: 9px 18px;
  font: inherit; font-size: 0.88rem; font-weight: 800; cursor: pointer; box-shadow: 0 8px 18px -6px rgba(255, 107, 107, 0.6);
  transition: transform 0.15s, box-shadow 0.15s; }
.tour-next:hover { transform: translateY(-1px); box-shadow: 0 12px 22px -6px rgba(255, 107, 107, 0.7); }
.tour-next:focus-visible, .tour-skip:focus-visible, .tour-back:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
@keyframes tourBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .tour-spot, .tour-pop { transition: none; } .tour-mascot { animation: none; } }
