/* ============================================================
   BASE — reset, body background, typography, global utilities
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* scrollbar-gutter: luôn chừa chỗ cho thanh cuộn dọc → đổi tab dài/ngắn KHÔNG bị xô lệch ngang */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-gutter: stable; }

body {
  font-family: var(--font-main);
  color: var(--ink);
  background:
    radial-gradient(1100px 700px at 12% -8%, #2A1F55 0%, transparent 55%),
    radial-gradient(900px 600px at 100% 0%,   #3A1C42 0%, transparent 50%),
    var(--bg);
  min-height: 100vh;
}

img, video { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
/* [hidden] luôn thắng mọi display của component (grid/flex…) — tránh lộ panel ẩn */
[hidden] { display: none !important; }
input, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }
/* Số liệu/mono — Space Grotesk + chữ số đều bề rộng (giá tiền, số dư, KPI) */
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Icon theo theme (js/icons.js): Neon = emoji text (giữ nguyên) · Nebula = SVG nét.
   Neon để display:inline (mặc định) → emoji render y hệt bản cũ; chỉ Nebula flex + cỡ SVG. */
:root[data-theme="nebula"] [data-ic] { display: inline-flex; align-items: center; justify-content: center; vertical-align: -0.16em; }
:root[data-theme="nebula"] [data-ic] svg { width: 1.15em; height: 1.15em; display: block; }

::selection { background: var(--pink); color: var(--on-accent); }

/* --- Thanh cuộn theo tone chủ đạo (mượt, đồng bộ toàn app) --- */
* { scrollbar-width: thin; scrollbar-color: var(--violet) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--violet), var(--pink));
  border-radius: 20px; border: 2px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(var(--pink), var(--violet));
  background-clip: padding-box;
}
::-webkit-scrollbar-corner { background: transparent; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-radius: 8px;
}

/* --- Hiệu ứng quà bay toàn màn hình (gửi & nhận donate/quà) --- */
.gfly { position: fixed; inset: 0; z-index: 9998; pointer-events: none; overflow: hidden; }
.gfly__item {
  position: absolute; bottom: 8%; will-change: transform, opacity;
  filter: drop-shadow(0 6px 16px rgba(var(--shadow-rgb), .45));
  animation: gfly-rise 4.2s ease-in forwards;
}
@keyframes gfly-rise {
  0%   { transform: translateY(0) scale(.5); opacity: 0; }
  14%  { opacity: 1; }
  100% { transform: translateY(-88vh) translateX(var(--dx,0)) scale(1.35) rotate(18deg); opacity: 0; }
}
.gfly__burst {
  position: absolute; left: 50%; top: 44%; transform: translate(-50%,-50%);
  font-size: 150px; filter: drop-shadow(0 16px 44px rgba(var(--pink-rgb), .75));
  animation: gfly-burst 2.6s cubic-bezier(.2,.9,.3,1.3) forwards;
}
@keyframes gfly-burst {
  0%   { transform: translate(-50%,-50%) scale(.2); opacity: 0; }
  20%  { transform: translate(-50%,-50%) scale(1.25); opacity: 1; }
  75%  { transform: translate(-50%,-50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%,-64%) scale(1.15); opacity: 0; }
}

/* --- Animations --- */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

@keyframes pop {
  from { transform: scale(.5); opacity: 0; }
  to   { transform: scale(1);  opacity: 1; }
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0   rgba(var(--red-rgb), .55); }
  70%  { box-shadow: 0 0 0 9px rgba(var(--red-rgb), 0); }
  100% { box-shadow: 0 0 0 0   rgba(var(--red-rgb), 0); }
}

@keyframes wave-bounce {
  0%,100% { transform: scaleY(.35); }
  50%      { transform: scaleY(1); }
}

@keyframes wobble {
  0%,100% { transform: rotate(-7deg); }
  50%      { transform: rotate(7deg); }
}

/* --- Global helper classes --- */
.text-pink   { color: var(--pink); }
.text-cyan   { color: var(--cyan); }
.text-gold   { color: var(--gold); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-muted  { color: var(--muted); }

.eyebrow {
  color: var(--pink);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.h-title {
  font-size: 24px;
  font-weight: 800;
  margin: 4px 0 0;
  letter-spacing: -.3px;
}

.sub {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}

.block-h {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .4px;
  color: var(--muted);
  text-transform: uppercase;
  margin: 0 0 12px;
}

.verified { color: var(--cyan); font-size: 18px; }
.stars    { color: var(--gold); letter-spacing: 1px; }

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
