/* =============================================
   TUMADAM MOD — style.css
   Aesthetic: Dark Glassmorphism / Neon Accent
   Fonts: Be Vietnam Pro (display+body) — hỗ trợ đầy đủ tiếng Việt & tiếng Anh
   ============================================= */

/* ===== CSS VARIABLES ===== */
/* Palette: Silver / White-Grey */
:root {
  /* Brand Accents */
  --brand-indigo:        #6366f1;
  --brand-indigo-hover:  #4f46e5;
  --brand-cyan:          #06b6d4;
  --brand-pink:          #ec4899;

  /* Status Tokens */
  --success:             #10b981;
  --warn:                #f59e0b;
  --danger:              #ef4444;

  /* Light Theme — Modern Clean Slate & Royal Indigo */
  --bg:                  #f8fafc;
  --bg2:                 #f1f5f9;
  --surface:             #ffffff;
  --surface2:            #f8fafc;
  --surface-hover:       #f1f5f9;
  --border:              rgba(15, 23, 42, 0.08);
  --border-focus:        #4f46e5;

  --text:                #0f172a;
  --text2:               #475569;
  --text3:               #64748b;

  --accent:              #4f46e5;
  --accent2:             #0284c7;
  --accent-hover:        #4338ca;
  --accent-light-bg:     rgba(79, 70, 229, 0.08);
  --accent-border:       rgba(79, 70, 229, 0.20);
  --accent-hover-border: rgba(79, 70, 229, 0.40);
  --accent-glow:         rgba(79, 70, 229, 0.16);

  --shadow:              0 12px 32px -4px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
  --shadow-sm:           0 2px 8px -1px rgba(15, 23, 42, 0.05), 0 1px 3px -1px rgba(15, 23, 42, 0.03);
  --nav-bg:              rgba(255, 255, 255, 0.90);
  --hero-overlay:        rgba(248, 250, 252, 0.75);
}

[data-theme="dark"] {
  /* Dark Theme — Deep Obsidian Cyber & Neon Indigo */
  --bg:                  #090d16;
  --bg2:                 #0e1320;
  --surface:             rgba(18, 24, 38, 0.75);
  --surface2:            rgba(26, 35, 54, 0.85);
  --surface-hover:       rgba(33, 45, 68, 0.90);
  --border:              rgba(255, 255, 255, 0.08);
  --border-focus:        #6366f1;

  --text:                #f8fafc;
  --text2:               #94a3b8;
  --text3:               #64748b;

  --accent:              #818cf8;
  --accent2:             #38bdf8;
  --accent-hover:        #a5b4fc;
  --accent-light-bg:     rgba(99, 102, 241, 0.15);
  --accent-border:       rgba(99, 102, 241, 0.30);
  --accent-hover-border: rgba(99, 102, 241, 0.50);
  --accent-glow:         rgba(99, 102, 241, 0.28);

  --shadow:              0 14px 40px -4px rgba(0, 0, 0, 0.65), 0 4px 16px -2px rgba(0, 0, 0, 0.45);
  --shadow-sm:           0 4px 14px -2px rgba(0, 0, 0, 0.40);
  --nav-bg:              rgba(9, 13, 22, 0.92);
  --hero-overlay:        rgba(9, 13, 22, 0.60);
}

/* ===== RESET ===== */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; font-size:16px; }
body {
  font-family: 'Be Vietnam Pro', 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  transition: background 0.4s, color 0.4s;
  min-height: 100vh;
}
body.loading { overflow: hidden; }
a { text-decoration: none; color: inherit; }
img { display:block; max-width:100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 99px; }

/* =============================================
   INTRO SPLASH — tối giản, vòng tiến trình quanh avatar, thu vòng khi rời đi
   ============================================= */
#introSplash {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 9000;
  overflow: hidden;
  background: transparent;
  transition: visibility 0s 0.8s;
}
/* Màn tròn đủ lớn phủ kín màn hình; khi rời đi thu nhỏ bằng transform (chạy trên GPU → mượt) */
.splash-curtain {
  position: absolute;
  left: 50%; top: 45%;
  width: 152vmax; height: 152vmax;
  margin-left: -76vmax; margin-top: -76vmax;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle, #10142a 0%, #0a0c18 22%, #06070d 45%);
  transform: scale(1);
  transition: transform 0.8s cubic-bezier(0.76, 0, 0.24, 1);
  will-change: transform;
}
/* 2 quầng sáng tím / xanh trôi rất chậm phía sau */
.splash-curtain .blob {
  position: absolute;
  width: 46vmax; height: 46vmax;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.24;
  will-change: transform;
}
.splash-curtain .b1 { left: 34%; top: 30%; background: #4f46e5; animation: blobDrift 9s ease-in-out infinite alternate; }
.splash-curtain .b2 { left: 48%; top: 44%; background: #0891b2; opacity: 0.16; animation: blobDrift 11s ease-in-out infinite alternate-reverse; }
@keyframes blobDrift { from { transform: translate(-4vmax, -3vmax) scale(1); } to { transform: translate(5vmax, 4vmax) scale(1.12); } }

/* Rời đi: màn tối thu lại thành vòng tròn ở giữa, lộ ra trang chủ */
#introSplash.hide { visibility: hidden; pointer-events: none; }
#introSplash.hide .splash-curtain { transform: scale(0); }

.splash-inner {
  position: relative; z-index: 1;
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
  margin-top: -6vh;
  transition: transform 0.5s cubic-bezier(0.5, 0, 0.75, 0), opacity 0.4s ease;
  will-change: transform, opacity;
}
#introSplash.hide .splash-inner { transform: scale(1.12); opacity: 0; }

/* Avatar + vòng tiến trình */
.splash-avatar-wrap {
  position: relative;
  width: 116px; height: 116px;
  margin-bottom: 34px;
  animation: popIn 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.splash-avatar {
  position: relative; z-index: 1;
  display: block;
  width: 116px; height: 116px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.04), 0 18px 50px -10px rgba(79, 70, 229, 0.55);
}
.splash-ring {
  position: absolute; z-index: 2;
  width: 148px; height: 148px;
  left: -16px; top: -16px;
  transform: rotate(-90deg);          /* bắt đầu từ đỉnh */
  overflow: visible;
}
.splash-ring .ring-track { fill: none; stroke: rgba(255, 255, 255, 0.07); stroke-width: 3; }
.splash-ring .ring-progress {
  fill: none;
  stroke: url(#splashGrad);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 427.3;            /* chu vi 2π × 68 */
  stroke-dashoffset: 427.3;
  /* Chạy dần tới 90% theo easeOutCubic; JS dùng đúng công thức này để hiện % */
  animation: splashRingFill 3.2s cubic-bezier(0.33, 1, 0.68, 1) 0.3s forwards;
}
@keyframes splashRingFill { to { stroke-dashoffset: 42.7; } }
/* Chấm sáng nhỏ chạy vòng → cảm giác đang hoạt động */
.splash-ring .ring-spark {
  fill: none;
  stroke: #ffffff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 0.1 427.2;
  transform-box: view-box;
  transform-origin: 74px 74px;
  animation: fireSpin 1.6s linear infinite;
  will-change: transform;
}
#introSplash.done .ring-spark { opacity: 0; transition: opacity 0.2s; }
@keyframes popIn { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.splash-title {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 22px; font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #f8fafc;
  padding: 0 20px;
  animation: fadeUp 0.5s 0.2s both;
}
.splash-sub {
  font-size: 13px; font-weight: 500;
  color: #8b93a7;
  margin-top: 8px;
  min-height: 1.4em;
  animation: fadeUp 0.5s 0.3s both;
}
.splash-percent {
  margin-top: 14px;
  font-size: 12px; font-weight: 600;
  letter-spacing: 1.5px;
  color: #5d6578;
  font-variant-numeric: tabular-nums;
  animation: fadeUp 0.5s 0.4s both;
}
#introSplash.done .splash-sub,
#introSplash.done .splash-percent { color: #a5b4fc; }

@keyframes fadeUp { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .splash-curtain { transition: none; }
  .splash-curtain .blob, .splash-ring .ring-spark { animation: none; }
  #introSplash { transition: opacity 0.3s, visibility 0s 0.3s; }
  #introSplash.hide { opacity: 0; }
  .splash-ring .ring-progress { animation-duration: 0.01s; }
}

/* Trong lúc màn hình chờ đang hiện: tạm dừng mọi hiệu ứng ở phần đầu trang (không ai nhìn thấy) */
.splash-active .hero *,
.splash-active .hero *::before,
.splash-active .hero *::after,
.splash-active .clock-widget * { animation-play-state: paused !important; }

/* =============================================
   MODAL / POPUP
   ============================================= */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center;
  z-index: 8000;
  padding: 20px;
}
.modal-overlay.show { display: flex; }

.modal-box {
  background: var(--nav-bg);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 28px 24px;
  width: 100%; max-width: 340px;
  text-align: center;
  box-shadow: var(--shadow);
  animation: popIn 0.3s cubic-bezier(0.175,0.885,0.32,1.275);
}

.modal-icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1e2a1e, #2a4a2a);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: #3ddc84;
  margin: 0 auto 14px;
}
.modal-icon.android-icon { background: linear-gradient(135deg, #143320, #1e5c2e); color: #3ddc84; }
.modal-icon.apple { background: linear-gradient(135deg, #1a1a1a, #333); color: #e0e0e0; }

.modal-box h3 {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 19px; font-weight: 800;
  margin-bottom: 6px;
}
.modal-box p { font-size: 13px; color: var(--text2); font-weight: 500; margin-bottom: 20px; }

/* Horizontal layout (iOS) */
.modal-actions { display: flex; gap: 10px; margin-bottom: 10px; }
/* Vertical layout (Android) */
.modal-actions.vertical { flex-direction: column; gap: 10px; margin-bottom: 10px; }

.modal-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 12px;
  border-radius: 14px;
  font-weight: 700; font-size: 14px;
  transition: filter 0.2s, transform 0.15s;
}
.modal-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.modal-btn.primary   { background: linear-gradient(135deg, #2d7a3a, #3ddc84); color: #fff; }
.modal-btn.secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }

/* Device modal — nút có title + sub text */
.device-btn-text {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; flex: 1;
}
.device-btn-text span { font-size: 14px; font-weight: 700; }
.device-btn-text small { font-size: 11px; opacity: 0.75; font-weight: 400; line-height: 1.3; text-align: left; }

/* GetKey centered below arch buttons */
.modal-getkey-wrap {
  display: flex; justify-content: center;
  margin-bottom: 10px;
}
.modal-getkey-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 28px;
  border-radius: 99px;
  background: linear-gradient(135deg, #b8860b, #f5c518);
  color: #1a1200;
  font-weight: 700; font-size: 14px;
  transition: filter 0.2s, transform 0.15s;
  box-shadow: 0 4px 14px rgba(245,197,24,0.3);
}
.modal-getkey-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.modal-getkey-btn i { font-size: 16px; }

.modal-cancel {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 11px;
  color: var(--danger); font-size: 14px; font-weight: 600;
  border-radius: 12px;
  transition: background 0.2s;
}
.modal-cancel:hover { background: rgba(248,113,113,0.1); }

/* =============================================
   FAB MENU BUTTON
   ============================================= */
.menu-fab {
  position: fixed; top: 20px; right: 20px;
  width: 48px; height: 48px;
  border-radius: 14px;
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm), 0 0 0 0 var(--accent-glow);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 5px;
  z-index: 7000;
  transition: box-shadow 0.3s, transform 0.2s;
}
.menu-fab:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow), 0 0 0 4px var(--accent-glow);
}
.menu-fab span {
  display: block;
  width: 20px; height: 2px;
  background: var(--text);
  border-radius: 99px;
  transition: 0.3s;
}
.menu-fab.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-fab.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.menu-fab.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =============================================
   SIDEBAR NAV
   ============================================= */
#menuOverlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(3px);
  z-index: 6500;
  opacity: 0; visibility: hidden;
  transition: 0.35s;
}
#menuOverlay.open { opacity: 1; visibility: visible; }

#sideNav {
  position: fixed; top: 0; right: 0;
  width: 300px; height: 100%;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  border-left: 1px solid var(--border);
  box-shadow: -10px 0 40px rgba(0,0,0,0.3);
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4,0,0.2,1);
  z-index: 7500;
  display: flex; flex-direction: column;
  padding: 0 0 24px;
  border-radius: 28px 0 0 28px;
}
#sideNav.open { transform: translateX(0); }

.nav-close {
  position: absolute; top: 18px; right: 20px;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--text);
  transition: background 0.2s;
}
.nav-close:hover { background: rgba(248,113,113,0.15); color: var(--danger); }

.nav-header {
  display: flex; align-items: center; gap: 14px;
  padding: 28px 24px 20px;
  border-bottom: 1px solid var(--border);
}
.nav-avatar {
  width: 48px; height: 48px;
  border-radius: 14px;
  object-fit: cover;
  border: 2px solid var(--accent);
}
.nav-name { font-family:'Be Vietnam Pro',sans-serif; font-weight: 700; font-size: 15px; }
.nav-role { font-size: 12px; color: var(--text2); font-weight: 500; margin-top: 2px; }

.nav-links {
  list-style: none;
  padding: 20px 16px;
  display: flex; flex-direction: column; gap: 4px;
  flex: 1;
}
.nav-links a {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px;
  border-radius: 14px;
  font-weight: 600; font-size: 15px;
  color: var(--text2);
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.nav-links a:hover {
  background: var(--surface2);
  color: var(--accent);
  transform: translateX(4px);
}
.nav-links a i { font-size: 18px; width: 24px; }

.nav-footer { padding: 0 16px; }
.theme-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 13px 16px;
  border-radius: 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  font-size: 14px; font-weight: 600; color: var(--text);
  transition: 0.2s;
}
.theme-btn:hover { background: var(--accent); color: #fff; box-shadow: 0 4px 14px var(--accent-glow); }
.theme-btn i { font-size: 18px; }

/* =============================================
   HERO SECTION
   ============================================= */
.hero {
  position: relative;
  padding: 80px 24px 60px;
  text-align: center;
  overflow: hidden;
  min-height: 480px;
  display: flex; align-items: center; justify-content: center;
}

.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 65% 60% at 50% -10%, rgba(99, 102, 241, 0.09) 0%, transparent 65%),
    radial-gradient(ellipse 50% 40% at 85% 85%, rgba(6, 182, 212, 0.07) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 15% 65%, rgba(139, 92, 246, 0.05) 0%, transparent 60%),
    var(--bg);
  z-index: 0;
}
[data-theme="dark"] .hero-bg {
  background:
    radial-gradient(ellipse 70% 60% at 50% -10%, rgba(99, 102, 241, 0.20) 0%, transparent 65%),
    radial-gradient(ellipse 50% 40% at 85% 85%, rgba(6, 182, 212, 0.13) 0%, transparent 60%),
    radial-gradient(ellipse 35% 30% at 15% 65%, rgba(236, 72, 153, 0.09) 0%, transparent 60%),
    var(--bg);
}

.hero-content { position: relative; z-index: 1; max-width: 480px; }

.avatar-wrap { position: relative; width: 110px; height: 110px; margin: 0 auto 32px; }
.avatar-glow {
  position: absolute; inset: -22px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 110, 0, 0.45) 0%, rgba(255, 60, 0, 0.18) 45%, transparent 70%);
  animation: pulseGlow 1.6s ease-in-out infinite;
  z-index: 0;
}
@keyframes pulseGlow {
  0%,100% { transform: scale(1); opacity: 0.65; }
  50%      { transform: scale(1.15); opacity: 1; }
}

/* ===== VÒNG LỬA QUANH AVATAR ===== */
/* Hạt lửa bay (vẽ bằng canvas trong app.js) — nằm sau avatar */
.avatar-fire {
  position: absolute;
  left: 50%; top: 50%;
  width: 260px; height: 260px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
}
/* Viền lửa chạy vòng */
.avatar-fire-ring {
  position: absolute; inset: -4px;
  border-radius: 50%;
  z-index: 2;
  background: conic-gradient(from 0deg,
    #ff2a00, #ff7a00, #ffe45c, #ff8a00, #ff2a00,
    #ff5a00, #ffd000, #ff9a00, #ff2a00);
  animation: fireSpin 2s linear infinite, fireFlicker 0.35s ease-in-out infinite alternate;
  box-shadow: 0 0 8px 1px rgba(255, 106, 0, 0.75), 0 0 20px 2px rgba(255, 70, 0, 0.45);
  will-change: transform, opacity;
}
/* Lớp lửa mờ xoay ngược chiều → cảm giác lửa bập bùng */
.avatar-fire-ring::before {
  content: '';
  position: absolute; inset: -4px;
  border-radius: 50%;
  background: conic-gradient(from 90deg,
    transparent 0%, #ff4d00 12%, transparent 26%,
    #ffb300 42%, transparent 56%,
    #ff2200 72%, transparent 84%, #ffd54a 94%, transparent 100%);
  opacity: 0.8;
  animation: fireSpin 1.3s linear infinite reverse;
  will-change: transform;
}
@keyframes fireSpin { to { transform: rotate(360deg); } }
@keyframes fireFlicker {
  from { opacity: 0.88; }
  to   { opacity: 1; }
}

.hero-avatar {
  display: block;
  width: 110px; height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 0;
  box-shadow: 0 0 0 2px rgba(20, 8, 0, 0.55), 0 0 24px rgba(255, 90, 0, 0.55);
  position: relative; z-index: 3;
}

/* ===== MŨ TRÙM ĐỎ QUANH AVATAR (vải bay + tia điện) ===== */
/* 1 đơn vị viewBox = 0.88px → tâm mũ (100,110) trùng tâm avatar */
.avatar-hood {
  position: absolute; z-index: 4;
  width: 176px; height: 176px;
  left: -33px; top: -42px;
  overflow: visible;
  pointer-events: none;
  transform-origin: 50% 60%;
  animation: hoodSway 3.2s ease-in-out infinite;   /* cả mũ đung đưa nhẹ */
}
/* Đang đội mũ: ẩn viền lửa tròn cũ để lòng mũ tối tự nhiên */
.avatar-wrap.has-hood .avatar-fire-ring { display: none; }
@keyframes hoodSway {
  0%, 100% { transform: rotate(-2deg); }
  50%      { transform: rotate(2deg); }
}
/* Tia sét: lớp sáng xanh to bên ngoài + lõi trắng mảnh bên trong */
.avatar-hood .bolt-glow {
  fill: none; stroke: #60c8ff; stroke-width: 7; stroke-opacity: 0.55;
  stroke-linecap: round; stroke-linejoin: round;
}
.avatar-hood .bolt-core {
  fill: none; stroke: #ffffff; stroke-width: 2.3;
  stroke-linecap: round; stroke-linejoin: round;
}
.avatar-hood .bolt-branch { stroke-width: 1.1; }
.avatar-hood .bolt-glow.bolt-branch { stroke-width: 3.5; }
@media (prefers-reduced-motion: reduce) {
  .avatar-hood { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
  .avatar-fire { display: none; }
  .avatar-fire-ring, .avatar-fire-ring::before, .avatar-glow { animation: none; }
}

.hero-badge {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
  background: var(--accent-light-bg);
  border: 1px solid var(--accent-border);
  padding: 4px 14px;
  border-radius: 99px;
  margin-bottom: 12px;
}

.hero-sub {
  font-size: 16px; font-weight: 600;
  color: var(--text2);
  margin-bottom: 6px;
}

.hero-name {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 32px; font-weight: 800;
  line-height: 1.15;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  flex-wrap: wrap;
}
/* Verified Badge — Pure SVG Cyber Blue Rosette */
.verify-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  vertical-align: middle;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
  margin-left: 4px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: verifyGleamPulse 3.5s ease-in-out infinite;
}

.verify-badge svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  filter: drop-shadow(0 2px 8px rgba(14, 165, 233, 0.55)) 
          drop-shadow(0 0 14px rgba(56, 189, 248, 0.35));
  transition: filter 0.3s ease;
}

.verify-badge:hover {
  transform: scale(1.18) rotate(6deg);
}

.verify-badge:hover svg {
  filter: drop-shadow(0 4px 14px rgba(14, 165, 233, 0.85)) 
          drop-shadow(0 0 22px rgba(56, 189, 248, 0.65));
}

@keyframes verifyGleamPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.05); }
}

.hero-typed {
  font-size: 16px; font-weight: 600;
  color: var(--text2);
  min-height: 26px;
  margin-top: 10px;
}

/* =============================================
   HERO STATS — Dynamic Cyber Glass HUD
   ============================================= */
.hero-stats {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 28px;
  padding: 14px 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  will-change: transform;
  box-shadow: 0 10px 30px -4px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.05);
  animation: statBoxFloat 5s ease-in-out infinite;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  user-select: none;
  cursor: pointer;
}

/* Diagonal laser ray running across stats */
.hero-stats::before {
  content: '';
  position: absolute;
  top: 0; left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.12), rgba(56, 189, 248, 0.28), rgba(255, 255, 255, 0.4), transparent);
  transform: skewX(-25deg);
  animation: heroStatRay 4.5s ease-in-out infinite;
  pointer-events: none;
}

.hero-stats:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 16px 36px -6px rgba(99, 102, 241, 0.35), 0 0 0 1px rgba(99, 102, 241, 0.45);
  border-color: rgba(99, 102, 241, 0.5);
}

.stat {
  text-align: center;
  position: relative;
  min-width: 75px;
}

.stat-platform {
  min-width: max-content;
}

.stat strong,
.stat .stat-val {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
  color: var(--accent);
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 45%, var(--accent2) 80%, #38bdf8 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: statNumberShine 6s linear infinite;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-pop {
  animation: statNumberPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes statNumberPop {
  0% { transform: scale(0.9); }
  50% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

.stat-rank-trophy {
  font-size: 15px;
  color: #fbbf24;
  -webkit-text-fill-color: #fbbf24;
  filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.6));
  animation: trophyFloat 3s ease-in-out infinite;
}

@keyframes trophyFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-2px) rotate(6deg); }
}

.stat span.stat-lbl {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text2);
  font-weight: 600;
  margin-top: 3px;
  line-height: 18px;
}

.stat-lbl-icon {
  font-size: 11px;
  opacity: 0.8;
}

.stat-divider {
  width: 1px;
  height: 32px;
  background: linear-gradient(180deg, transparent, var(--border), transparent);
}

/* Platform Badge for iOS & Android — Dynamic Flow */
.stat-lbl-platform {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
  line-height: 18px;
  white-space: nowrap;
}

.platform-badge-flow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.10), rgba(56, 189, 248, 0.16), rgba(34, 197, 94, 0.12), rgba(99, 102, 241, 0.10));
  background-size: 300% 100%;
  border: 1px solid rgba(99, 102, 241, 0.25);
  animation: platformFlowRun 4s linear infinite;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.12);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.platform-badge-flow:hover {
  transform: scale(1.05);
  border-color: rgba(99, 102, 241, 0.5);
}

@keyframes platformFlowRun {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

.platform-brand.apple {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--text);
  font-weight: 700;
}

.platform-brand.apple i {
  font-size: 13px;
  animation: appleShimmer 3s ease-in-out infinite;
}

@keyframes appleShimmer {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

.platform-brand.andr {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #22c55e;
  font-weight: 700;
}

.platform-brand.andr i {
  font-size: 13px;
  animation: andrPulse 2s ease-in-out infinite;
}

@keyframes andrPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

.platform-amp {
  font-size: 10px;
  color: #38bdf8;
  font-weight: 800;
  text-shadow: 0 0 6px rgba(56, 189, 248, 0.5);
  margin: 0 1px;
}

.stat-live-beacon {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  display: inline-block;
  margin-left: 2px;
  animation: beaconPulse 1.8s infinite;
}

@keyframes beaconPulse {
  0% { transform: scale(0.9); opacity: 0.7; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 0 4px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.9); opacity: 0.7; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Keyframes */
@keyframes heroStatRay {
  0% { left: -120%; }
  30%, 100% { left: 220%; }
}

@keyframes statBoxFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3.5px); }
}

@keyframes statNumberShine {
  0% { background-position: 0% center; }
  50% { background-position: 100% center; }
  100% { background-position: 0% center; }
}

/* =============================================
   QUICK SECTION (SOCIALS + CARDS)
   ============================================= */
.quick-section {
  padding: 0 20px 40px;
  max-width: 520px;
  margin: 0 auto;
}

.socials {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.social-pill {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 8px;
  border-radius: 14px;
  font-weight: 700; font-size: 13px;
  border: 1px solid var(--border);
  transition: 0.2s;
  box-shadow: var(--shadow-sm);
  background: var(--surface);
  color: var(--text);
}
.social-pill span { white-space: nowrap; }
.social-pill i { font-size: 17px; flex-shrink: 0; }
/* YouTube — đỏ */
.social-pill.tiktok   { border-color: rgba(0,0,0,0.15); }
.social-pill.tiktok svg { color: #010101; transition: color 0.2s; }
[data-theme="dark"] .social-pill.tiktok svg { color: #fff; }
[data-theme="dark"] .social-pill.tiktok { border-color: rgba(255,255,255,0.15); }
.social-pill.tiktok:hover { background: #010101; color: #fff; border-color: #010101; }
.social-pill.tiktok:hover svg { color: #fff; }
/* Telegram — xanh dương */
.social-pill.tele   { border-color: rgba(41,182,246,0.25); }
.social-pill.tele i { color: #29b6f6; }
.social-pill.tele:hover { background: #0088cc; color: #fff; border-color: #0088cc; }
.social-pill.tele:hover i { color: #fff; }
/* Discord — indigo */
.social-pill.discord   { border-color: rgba(88,101,242,0.25); }
.social-pill.discord i { color: #5865f2; }
.social-pill.discord:hover { background: #5865f2; color: #fff; border-color: #5865f2; }
.social-pill.discord:hover i { color: #fff; }

.quick-cards { display: flex; flex-direction: column; gap: 12px; }
.quick-card {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 18px;
  background: var(--surface);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  transition: 0.25s;
}
.quick-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--accent-hover-border); }

.qc-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--accent);
  flex-shrink: 0;
}
.qc-icon.tg   { background: rgba(14, 165, 233, 0.12); color: #0284c7; }
.qc-icon.shop { background: rgba(16, 185, 129, 0.12); color: #059669; }
.qc-icon.vid  { background: rgba(239, 68, 68, 0.12); color: #dc2626; }

[data-theme="dark"] .qc-icon.tg   { background: rgba(14, 165, 233, 0.20); color: #38bdf8; }
[data-theme="dark"] .qc-icon.shop { background: rgba(16, 185, 129, 0.20); color: #34d399; }
[data-theme="dark"] .qc-icon.vid  { background: rgba(239, 68, 68, 0.20); color: #f87171; }

/* ===== GAME CARD WRAP (thẻ có hàng nút phụ) ===== */
.game-card-wrap {
  display: flex; flex-direction: column;
  border-radius: 16px; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.game-card-wrap:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--accent-border);
}
.game-card-wrap .game-card {
  flex: 1;
  border: none;
  box-shadow: none;
  border-radius: 0;
  background: transparent;
  transform: none !important;
}
.game-card-wrap .game-card:hover {
  transform: none !important;
  box-shadow: none !important;
  border-color: transparent !important;
}

/* Nút phụ (lưu ý / link) — kiểu mặc định nếu nằm ngoài .card-actions */
.game-extra-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: inherit;
  font-size: 12.5px; font-weight: 600;
  color: var(--text2);
  text-decoration: none;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.game-extra-btn i { font-size: 13px; color: var(--accent); flex-shrink: 0; }
.game-extra-btn.note-btn i { color: var(--warn); }
.game-extra-btn:hover { color: var(--accent); border-color: var(--accent-border); background: var(--accent-light-bg); }

.qc-text { flex: 1; }
.qc-text strong { display: block; font-weight: 700; font-size: 15px; }
.qc-text span { font-size: 12px; color: var(--text2); font-weight: 500; }
.qc-arrow { color: var(--text3); font-size: 18px; }

/* =============================================
   CONTENT SECTIONS (GAMES / KEYS / IPA)
   ============================================= */
.content-section {
  padding: 32px 20px 48px;
  background: var(--bg2);
}
.content-section:first-of-type { border-radius: 32px 32px 0 0; margin-top: 0; }
.content-section.alt { background: var(--bg); }

[data-theme="dark"] .content-section { background: var(--bg2); }
[data-theme="dark"] .content-section.alt { background: var(--bg); }

.section-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-light-bg);
  border: 1px solid var(--accent-border);
  padding: 5px 14px;
  border-radius: 99px;
  margin-bottom: 10px;
}

.section-title {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 26px; font-weight: 800;
  margin-bottom: 18px;
}

/* ===== GAME GRID ===== */
.game-grid {
  display: flex; flex-direction: column; gap: 12px;
  max-width: 520px; margin: 0 auto;
}

.game-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  cursor: pointer;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
}
.game-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--accent-border);
}

.game-thumb {
  width: 52px; height: 52px;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: block;
}

.game-info { flex: 1; min-width: 0; }
.game-name {
  font-weight: 700; font-size: 14.5px;
  white-space: normal; word-break: break-word;
  line-height: 1.35;
  margin-bottom: 3px;
  color: var(--text);
}
.game-meta {
  font-size: 12px; color: var(--text2);
  font-weight: 500;
  display: flex; align-items: center; gap: 5px;
  margin-bottom: 6px;
}
.game-meta-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--text3); opacity: .6; flex-shrink: 0; }

/* Hàng ngang: badge platform + nút preview */
.game-row-badges {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
}

/* Platform badge */
.platform-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 6px;
  flex-shrink: 0;
}
/* Nhãn "Link đầy" trên thẻ game */
.status-chip {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 6px;
  color: #dc2626;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.22);
}
[data-theme="dark"] .status-chip { color: #f87171; background: rgba(239, 68, 68, 0.14); border-color: rgba(239, 68, 68, 0.30); }
.platform-badge.ios {
  background: rgba(2, 132, 199, 0.10);
  color: #0284c7;
  border: 1px solid rgba(2, 132, 199, 0.22);
}
.platform-badge.android {
  background: rgba(16, 185, 129, 0.10);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.22);
}
[data-theme="dark"] .platform-badge.ios {
  background: rgba(14, 165, 233, 0.16);
  color: #38bdf8;
  border-color: rgba(14, 165, 233, 0.32);
}
[data-theme="dark"] .platform-badge.android {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.32);
}

/* Preview button — nhỏ, trung tính */
.game-preview-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; height: 22px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 10.5px; font-weight: 600;
  color: var(--text2); white-space: nowrap;
  transition: 0.2s; cursor: pointer;
}
.game-preview-btn i { font-size: 11px; color: var(--text3); }
.game-preview-btn:hover {
  background: var(--accent-light-bg);
  border-color: var(--accent-border);
  color: var(--accent);
}
.game-preview-btn:hover i { color: var(--accent); }
.preview-count {
  background: var(--surface2); color: var(--text2);
  border-radius: 4px; padding: 0 4px;
  font-size: 9px; font-weight: 800;
}

/* Nút tải — nhạt, rê chuột thì đậm lên (không gradient / phát sáng) */
.game-dl-btn {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  color: var(--accent);
  background: var(--accent-light-bg);
  border: 1px solid var(--accent-border);
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.game-card:hover .game-dl-btn {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}


/* ===== MODAL CHỌN PHIÊN BẢN ===== */
.version-modal {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(6px);
  z-index: 8200; align-items: center; justify-content: center; padding: 20px;
}
.version-modal.show { display: flex; }
.ver-modal-content {
  background: var(--surface); border-radius: 18px;
  width: 100%; max-width: 380px; overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
  animation: verSlideUp 0.32s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes verSlideUp {
  from { opacity: 0; transform: translateY(36px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.ver-modal-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 18px 18px 14px; border-bottom: 1px solid var(--border);
}
.ver-modal-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--accent); margin-bottom: 3px;
}
.ver-modal-title {
  font-size: 17px; font-weight: 800; color: var(--text); margin: 0; line-height: 1.25;
}
.ver-modal-close {
  width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
  border: none; background: var(--surface2); color: var(--text2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 14px; transition: 0.2s;
}
.ver-modal-close:hover { background: var(--border); color: var(--text); }
.ver-modal-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; }

.ver-btn {
  display: flex; align-items: center; gap: 13px;
  padding: 14px; border-radius: 14px;
  background: var(--surface2); border: 1.5px solid var(--border);
  text-decoration: none !important; transition: 0.2s;
}
.ver-btn:hover {
  border-color: var(--accent);
  background: var(--accent-light-bg);
  transform: translateY(-1px);
}
.ver-btn:active { transform: scale(0.98); }
.ver-btn-icon {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; color: #fff;
  background: linear-gradient(135deg, #4338ca, #6366f1);
  box-shadow: 0 3px 10px rgba(99,102,241,0.35);
}
.ver-btn:nth-child(2) .ver-btn-icon {
  background: linear-gradient(135deg, #059669, #10b981);
  box-shadow: 0 3px 10px rgba(16,185,129,0.35);
}
.ver-btn-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ver-btn-label { font-size: 14.5px; font-weight: 700; color: var(--text); line-height: 1.3; }
.ver-btn-sub   { font-size: 11.5px; color: var(--text2); line-height: 1.35; }
.ver-btn-arrow { color: var(--text3); font-size: 13px; flex-shrink: 0; }

/* ===== STATUS FULL MODAL (Link Đầy) ===== */
.status-full-modal {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 8000;
  align-items: center; justify-content: center; padding: 20px;
}
.status-full-modal.show { display: flex; }
.status-modal-content {
  background: var(--surface); border-radius: 14px; width: 100%; max-width: 360px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2); overflow: hidden;
  animation: modalSlideUp 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes modalSlideUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }
.status-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px; border-bottom: 1px solid var(--border);
}
.status-modal-title {
  font-size: 16px; font-weight: 700; color: var(--text); margin: 0;
}
.status-modal-close {
  background: none; border: none; font-size: 18px; color: var(--text2);
  cursor: pointer; padding: 4px; display: flex; align-items: center; justify-content: center;
}
.status-modal-body {
  padding: 24px; display: flex; flex-direction: column; gap: 16px;
}
.status-message {
  text-align: center; display: flex; flex-direction: column; align-items: center;
}
.status-actions {
  display: flex; flex-direction: column; gap: 10px;
}
.status-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; border-radius: 10px; font-weight: 600; font-size: 14px;
  transition: 0.2s; text-decoration: none; color: white;
}
.status-btn.telegram { background: #0288D1; }
.status-btn.telegram:active { opacity: 0.8; transform: scale(0.97); }
.status-btn.discord { background: #5865F2; }
.status-btn.discord:active { opacity: 0.8; transform: scale(0.97); }
.status-guide-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; border: 2px solid var(--accent); border-radius: 10px;
  background: transparent; color: var(--accent); font-weight: 600; font-size: 14px;
  cursor: pointer; transition: 0.2s;
}
.status-guide-btn:active { background: var(--accent); color: #fff; }

/* ===== PREVIEW MODAL ===== */
#imgPreviewModal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(10px);
  display: none; align-items: center; justify-content: center;
  z-index: 9500;
  padding: 20px;
}
#imgPreviewModal.show { display: flex; }

.img-preview-box {
  position: relative;
  max-width: 340px; width: 100%;
  background: var(--nav-bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  animation: popIn 0.3s cubic-bezier(0.175,0.885,0.32,1.275);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.img-preview-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.img-preview-title {
  font-weight: 700; font-size: 15px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 240px;
}
.img-preview-close {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--text3);
  flex-shrink: 0; cursor: pointer;
  transition: 0.2s;
}
.img-preview-close:hover { background: rgba(248,113,113,0.15); color: var(--danger); }

.img-preview-slider {
  position: relative; overflow: hidden;
  background: var(--surface2);
  min-height: 200px;
  display: flex; align-items: center; justify-content: center;
}
.img-preview-slider::before {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 3px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spinRing 0.8s linear infinite;
  z-index: 0;
}
.img-preview-track {
  display: flex; position: relative; z-index: 1;
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
  width: 100%;
}
.img-preview-track img {
  width: 100%; flex-shrink: 0;
  object-fit: contain;
  max-height: 440px;
  min-height: 200px;
  display: block;
  background: var(--surface2);
}
.img-preview-track .preview-placeholder {
  width: 100%; flex-shrink: 0;
  height: 240px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--text3); font-size: 14px; gap: 8px;
}
.img-preview-track .preview-placeholder i { font-size: 40px; opacity: 0.4; }

/* Dots */
.img-preview-dots {
  display: flex; justify-content: center; gap: 6px;
  padding: 10px;
}
.img-dot {
  width: 6px; height: 6px; border-radius: 99px;
  background: var(--border);
  transition: 0.2s; cursor: pointer;
}
.img-dot.active { background: var(--accent); width: 18px; }

/* Prev / Next arrows — to hơn, rõ hơn */
.img-nav-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px;
  background: rgba(0,0,0,0.55);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
  cursor: pointer; z-index: 2;
  transition: background 0.2s, transform 0.15s;
  border: 1.5px solid rgba(255,255,255,0.15);
  backdrop-filter: blur(4px);
}
.img-nav-btn:hover {
  background: var(--accent);
  transform: translateY(-50%) scale(1.08);
  border-color: var(--accent);
}
.img-nav-btn.prev { left: 10px; }
.img-nav-btn.next { right: 10px; }

/* Bộ đếm ảnh hiện tại / tổng — trên ảnh */
.img-counter {
  position: absolute; top: 10px; right: 10px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  color: #fff; font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 99px;
  z-index: 2;
  pointer-events: none;
  letter-spacing: 0.5px;
}

/* Mô tả app ở footer modal */
.img-preview-desc {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  line-height: 1.55;
  border-top: 1px solid var(--border);
  background: var(--surface2);
}

/* ===== KEY GRID ===== */
.key-grid {
  display: flex; flex-direction: column; gap: 14px;
  max-width: 520px; margin: 0 auto;
}

.key-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.key-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent-border); }
.key-card a { color: inherit; }

/* Icon: nền nhạt, icon 1 màu — đồng bộ với Mod Files */
.key-icon-wrap {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  color: var(--accent);
  background: var(--accent-light-bg);
}
.key-icon-wrap.ios     { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.key-icon-wrap.android { background: rgba(34, 197, 94, 0.10); color: #16a34a; }
[data-theme="dark"] .key-icon-wrap.android { color: #4ade80; }

.key-info { flex: 1; min-width: 0; }
.key-name { font-weight: 700; font-size: 14.5px; color: var(--text); line-height: 1.35; word-break: break-word; }
.key-desc { font-size: 12px; color: var(--text2); font-weight: 500; margin-top: 2px; }

.key-action {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  color: var(--accent);
  background: var(--accent-light-bg);
  border: 1px solid var(--accent-border);
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.key-card:hover .key-action { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Spinning key animation */
.spin { animation: keySpin 4s linear infinite; display: inline-block; }
@keyframes keySpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* =============================================
   HELP SECTION
   ============================================= */
.help-section {
  display: flex; justify-content: center; gap: 16px;
  padding: 36px 20px;
  flex-wrap: wrap;
}

.help-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 20px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: 0.25s;
  color: var(--text);
  font-weight: 600; font-size: 14px;
  min-width: 130px;
}
.help-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--accent-hover-border); }
.help-img { width: 48px; height: 48px; object-fit: contain; }
[data-theme="dark"] .help-img { filter: invert(1) brightness(1.3); }

/* =============================================
   FOOTER
   ============================================= */
.footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 36px 20px 48px;
  text-align: center;
}
[data-theme="dark"] .footer { background: var(--bg2); }

.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.footer-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); margin-bottom: 4px; box-shadow: 0 0 12px var(--accent-glow); }
.footer p { font-weight: 600; font-size: 14px; color: var(--text2); }
.footer-sub { font-size: 13px; color: var(--text3); font-weight: 500; }

/* =============================================
   MOD FILES SECTION — thiết kế tối giản, 1 màu nhấn
   ============================================= */
.mod-grid {
  display: flex; flex-direction: column; gap: 12px;
  max-width: 520px; margin: 0 auto;
}

.mod-card-wrap {
  display: flex; flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.mod-card-wrap:hover {
  transform: translateY(-2px);
  border-color: var(--accent-border);
  box-shadow: var(--shadow);
}

.mod-card {
  flex: 1;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}

/* Icon loại file: nền nhạt, icon 1 màu — không gradient / phát sáng */
.mod-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  background: var(--accent-light-bg);
  color: var(--accent);
}
.mod-icon.ios { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.mod-icon.zip { background: rgba(34, 197, 94, 0.10); color: #16a34a; }
[data-theme="dark"] .mod-icon.zip { color: #4ade80; }

.mod-info { flex: 1; min-width: 0; }
.mod-name {
  font-weight: 700; font-size: 14.5px;
  line-height: 1.35;
  color: var(--text);
  word-break: break-word;
  margin-bottom: 2px;
}
.mod-meta {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500;
  color: var(--text2);
}
.mod-meta-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--text3); opacity: .6; flex-shrink: 0; }
.mod-desc {
  font-size: 12px; line-height: 1.45;
  color: var(--text2);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Nhãn nhỏ (24/24, HOT...) — tĩnh, không nhấp nháy */
.mod-badge {
  display: inline-flex; align-items: center; gap: 3px;
  margin-left: 6px; padding: 1px 7px;
  font-size: 10px; font-weight: 700; letter-spacing: .3px;
  border-radius: 6px;
  vertical-align: 2px;
  color: var(--accent);
  background: var(--accent-light-bg);
  border: 1px solid var(--accent-border);
}
.mod-badge i { font-size: 9px; }

/* Nút tải / mở bot */
.mod-dl-btn {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  color: var(--accent);
  background: var(--accent-light-bg);
  border: 1px solid var(--accent-border);
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.mod-card-wrap:hover .mod-dl-btn {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Hàng nút phụ ở chân thẻ (Game / File Mod / Video) */
.card-actions {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 10px 16px 12px;
  border-top: 1px solid var(--border);
  background: var(--surface2);
}
.card-actions .mod-guide-btn,
.card-actions .game-extra-btn {
  width: auto;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: inherit;
  font-size: 12.5px; font-weight: 600;
  color: var(--text2);
  text-decoration: none;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.card-actions .mod-guide-btn i,
.card-actions .game-extra-btn i { font-size: 13px; color: var(--accent); }
.card-actions .game-extra-btn.note-btn i { color: var(--warn); }
.card-actions .mod-guide-btn:hover,
.card-actions .game-extra-btn:hover {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--accent-light-bg);
}
[data-theme="dark"] .card-actions .game-extra-btn.note-btn { color: var(--text2); background: var(--surface); }
[data-theme="dark"] .card-actions .game-extra-btn.note-btn:hover { color: var(--accent); background: var(--accent-light-bg); }

/* Guide modal */
.guide-modal-box {
  max-width: 420px !important;
  padding: 0 !important;
  overflow: hidden;
  max-height: 85vh;
  display: flex; flex-direction: column;
}
.guide-modal-box .img-preview-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.guide-modal-body {
  overflow-y: auto;
  padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  flex: 1;
}
.guide-step {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
}
.guide-step-heading {
  font-size: 13px; font-weight: 800;
  color: var(--accent);
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 6px;
}
.guide-step-body {
  font-size: 13px; font-weight: 500;
  color: var(--text2);
  line-height: 1.55;
}

/* =============================================
   VIDEO GUIDE SECTION
   ============================================= */
.vid-grid {
  display: flex; flex-direction: column; gap: 12px;
  max-width: 520px; margin: 0 auto;
}

/* Wrapper khi có note bên dưới */
.vid-card-wrap {
  display: flex; flex-direction: column;
  border-radius: 16px; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.vid-card-wrap:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent-border); }
.vid-card-wrap .vid-card { flex: 1; border: none; box-shadow: none; border-radius: 0; background: transparent; transform: none !important; }

/* Note dưới vid card */
.vid-note {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 14px;
  background: rgba(251,191,36,0.08);
  border-top: 1px solid rgba(251,191,36,0.20);
  font-size: 12px; font-weight: 500;
  color: #d97706; line-height: 1.5;
}
.vid-note i { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
[data-theme="dark"] .vid-note { color: #fbbf24; }

.vid-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  cursor: pointer;
}
.vid-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent-border); }

.vid-thumb-wrap {
  width: 88px; height: 54px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  background: var(--surface2);
  border: 1px solid var(--border);
}
.vid-thumb-wrap img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.vid-thumb-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-light-bg);
  font-size: 0; /* chỉ hiện nút play ở giữa */
}
/* Nút play: vòng tròn nhỏ ở giữa ảnh */
.vid-play-icon {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.18);
  transition: background .2s ease;
}
.vid-play-icon i {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #111;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: transform .2s ease, background .2s ease, color .2s ease;
}
.vid-play-icon:not(.external) i { padding-left: 2px; }
.vid-play-icon.external i { font-size: 12px; }
.vid-card:hover .vid-play-icon { background: rgba(0, 0, 0, 0.30); }
/* Không có ảnh bìa → không phủ tối */
.vid-thumb-placeholder + .vid-play-icon,
.vid-card:hover .vid-thumb-placeholder + .vid-play-icon { background: transparent; }
.vid-card:hover .vid-play-icon i { transform: scale(1.1); background: var(--accent); color: #fff; }

.vid-info { flex: 1; min-width: 0; }
.vid-name {
  font-weight: 700; font-size: 14.5px; color: var(--text);
  white-space: normal; word-break: break-word;
  line-height: 1.35; margin-bottom: 3px;
}
.vid-meta { font-size: 12px; color: var(--text2); font-weight: 500; }

/* Video modal */
.video-modal-box {
  width: 100%;
  max-width: min(960px, 100%) !important;
  padding: 0 !important;
  overflow: hidden;
  border-radius: 24px;
  background: #0b0d14 !important;      /* khung tối kiểu rạp phim, đỡ chói */
}
.video-modal-box .img-preview-title { color: #f1f5f9; }
.video-modal-box .img-preview-close { color: #cbd5e1; }
.video-modal-box .img-preview-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.video-container {
  position: relative;
  width: 100%;
  background: #000;
  border-radius: 0 0 24px 24px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  max-height: 82vh;
}
/* Điện thoại: khung xem video to gần full màn hình (video hướng dẫn thường quay màn hình dọc) */
@media (max-width: 640px) {
  #videoModal { padding: 8px; }
  .video-modal-box { border-radius: 20px; }
  .video-container { aspect-ratio: auto; height: min(72vh, 680px); border-radius: 0 0 20px 20px; }
}
.video-container iframe,
.video-container video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: none; display: block;
  background: #000;
}

/* Custom video overlay — nút play lớn, YouTube-style */
.vid-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.35);
  cursor: pointer;
  transition: background 0.2s;
  z-index: 2;
}
.vid-overlay:hover { background: rgba(0,0,0,0.15); }
.vid-overlay.hidden { display: none; }

.vid-play-big {
  width: 68px; height: 68px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.45);
  transition: transform 0.15s;
}
.vid-play-big i { font-size: 28px; color: #111; margin-left: 4px; }
.vid-overlay:hover .vid-play-big { transform: scale(1.1); }

/* Poster / thumbnail shown before play */
.vid-poster {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 1;
}
.vid-poster-placeholder {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #0f0f1a, #1a1a3e);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px; z-index: 1;
}
.vid-poster-placeholder i { display: none; }   /* nút play lớn đã nằm giữa */
.vid-poster-placeholder span { font-size: 13px; color: #94a3b8; font-weight: 600; margin-top: 110px; padding: 0 20px; text-align: center; }

/* =============================================
   RESPONSIVE LAYOUT SYSTEM (MOBILE & DESKTOP)
   ============================================= */
.content-section {
  width: 100%;
}
.content-section > * {
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
}
.section-label, .section-title {
  display: table;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* Mobile defaults (< 768px) */
@media (max-width: 767px) {
  .hero-content {
    padding: 70px 16px 28px;
  }
  .hero-name {
    font-size: 28px;
  }
  .hero-stats {
    gap: 8px;
    padding: 10px 14px;
    max-width: 100%;
  }
  .stat {
    min-width: 60px;
  }
  .stat-platform {
    min-width: max-content;
  }
  .stat strong,
  .stat .stat-val {
    font-size: 17px;
  }
  .stat span.stat-lbl {
    font-size: 11px;
    line-height: 16px;
  }
  .platform-badge-flow {
    font-size: 10.5px;
    padding: 2px 6px;
    gap: 3px;
  }
  .clock-widget {
    top: 12px;
    left: 12px;
    padding: 6px 12px;
    font-size: 12px;
  }
  .menu-fab {
    top: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
  }
  .content-section {
    padding: 28px 14px 38px;
  }
  .game-grid, .key-grid, .mod-grid, .vid-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 100%;
  }
  .game-card {
    padding: 12px;
    gap: 10px;
  }
  .game-thumb {
    width: 48px;
    height: 48px;
  }
  .game-dl-btn {
    width: 40px;
    height: 40px;
    font-size: 17px;
  }
  .help-section {
    gap: 12px;
    padding: 24px 14px;
  }
  .help-card {
    flex: 1 1 calc(50% - 12px);
    min-width: 130px;
    padding: 16px 12px;
  }
}

/* Tablet & Desktop (>= 768px) */
@media (min-width: 768px) {
  .hero-name {
    font-size: 42px;
  }
  .hero-sub {
    font-size: 18px;
  }
  .hero-stats {
    gap: 24px;
    padding: 16px 30px;
  }
  .stat strong,
  .stat .stat-val {
    font-size: 24px;
  }
  .stat span.stat-lbl {
    font-size: 13px;
  }
  .platform-badge-flow {
    font-size: 12.5px;
    padding: 3px 10px;
    gap: 6px;
  }
  .clock-widget {
    top: 20px;
    left: 28px;
    padding: 8px 16px;
  }
  .menu-fab {
    top: 20px;
    right: 28px;
    width: 48px;
    height: 48px;
  }
  .content-section {
    padding: 44px 32px 56px;
  }
  .section-title {
    font-size: 32px;
    margin-bottom: 24px;
  }
  .game-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 18px !important;
    max-width: 1100px !important;
    margin: 0 auto !important;
  }
  .key-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)) !important;
    gap: 18px !important;
    max-width: 1100px !important;
    margin: 0 auto !important;
  }
  .mod-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 18px !important;
    max-width: 1100px !important;
    margin: 0 auto !important;
  }
  .vid-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 20px !important;
    max-width: 1100px !important;
    margin: 0 auto !important;
  }
  .help-section {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 40px 20px;
    max-width: 800px;
    margin: 0 auto;
  }
  .help-card {
    min-width: 200px;
    padding: 24px 32px;
  }
}

/* Large Screens (>= 1200px) */
@media (min-width: 1200px) {
  .hero-content {
    max-width: 900px;
    margin: 0 auto;
  }
  .content-section > * {
    max-width: 1160px;
  }
  .game-grid {
    gap: 20px !important;
    max-width: 1160px !important;
  }
  .key-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 20px !important;
    max-width: 1160px !important;
  }
  .mod-grid, .vid-grid {
    gap: 22px !important;
    max-width: 1160px !important;
  }
}

/* =============================================
   CLOCK WIDGET — góc trên trái
   Màu thay đổi theo buổi: sáng/trưa/chiều/tối/khuya
   ============================================= */
.clock-widget {
  position: fixed;
  top: 16px; left: 16px;
  z-index: 6100;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: 99px;
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  transition: background 1.2s ease, border-color 1.2s ease, box-shadow 1.2s ease;
  cursor: default;
  overflow: hidden;
}

/* Greeting text — hiện lúc vừa vào, rồi ẩn */
.clock-greeting {
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  transition: max-width 0.8s ease, opacity 0.8s ease, margin 0.8s ease;
  opacity: 1;
}
.clock-greeting.hide {
  max-width: 0;
  opacity: 0;
  margin: 0;
}

/* Giờ thật */
.clock-time {
  font-size: 13px; font-weight: 800;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Icon buổi — Bootstrap Icons */
.clock-period-icon {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.clock-period-icon i { font-size: 16px; line-height: 1; }

/* ===== CLOCK — icon màu theo buổi ===== */
.clock-widget.period-midnight  .clock-period-icon i { color: #94a3b8; }
.clock-widget.period-dawn      .clock-period-icon i { color: #60a5fa; }
.clock-widget.period-morning   .clock-period-icon i { color: #d97706; }
.clock-widget.period-noon      .clock-period-icon i { color: #ea580c; }
.clock-widget.period-afternoon .clock-period-icon i { color: #059669; }
.clock-widget.period-evening   .clock-period-icon i { color: #7c3aed; }
.clock-widget.period-night     .clock-period-icon i { color: #6366f1; }

/* Nền + chữ dùng CSS var — tự đổi theo dark/light, không hardcode màu chữ */
.clock-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.clock-greeting { color: var(--text2); }
.clock-time     { color: var(--text);  }

/* Chỉ tô viền + glow nhẹ theo buổi */
.clock-widget.period-dawn      { border-color: rgba(96,165,250,0.45);  box-shadow: 0 4px 16px rgba(96,165,250,0.18);  }
.clock-widget.period-morning   { border-color: rgba(217,119,6,0.45);   box-shadow: 0 4px 16px rgba(217,119,6,0.18);   }
.clock-widget.period-noon      { border-color: rgba(234,88,12,0.45);   box-shadow: 0 4px 16px rgba(234,88,12,0.18);   }
.clock-widget.period-afternoon { border-color: rgba(5,150,105,0.45);   box-shadow: 0 4px 16px rgba(5,150,105,0.18);   }
.clock-widget.period-evening   { border-color: rgba(124,58,237,0.45);  box-shadow: 0 4px 16px rgba(124,58,237,0.18);  }
.clock-widget.period-night     { border-color: rgba(99,102,241,0.45);  box-shadow: 0 4px 16px rgba(99,102,241,0.18);  }
.clock-widget.period-midnight  { border-color: rgba(148,163,184,0.30); box-shadow: 0 4px 16px rgba(0,0,0,0.18);       }


/* =============================================
   THẺ THÔNG BÁO (Cấu hình trong admin)
   ============================================= */
.notice-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 22px auto 0;
  padding: 14px 16px 14px 18px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  text-align: left;
  overflow: hidden;
}
.notice-card[hidden] { display: none; }
/* Vạch màu báo hiệu bên trái */
.notice-card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #fbbf24, #f59e0b);
}
.notice-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.notice-icon {
  width: 30px; height: 30px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
  color: #d97706;
  background: rgba(245, 158, 11, 0.14);
}
[data-theme="dark"] .notice-icon { color: #fbbf24; background: rgba(245, 158, 11, 0.16); }
.notice-label {
  flex: 1;
  font-size: 11.5px; font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #b45309;
}
[data-theme="dark"] .notice-label { color: #fbbf24; }
.notice-close {
  width: 28px; height: 28px;
  border: 0; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  color: var(--text3);
  font-size: 15px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.notice-close:hover { background: var(--surface2); color: var(--text); }
.notice-text {
  margin: 0;
  font-size: 14px; font-weight: 500;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-line;          /* giữ xuống dòng admin nhập */
  overflow-wrap: anywhere;
}
.notice-text.clamped {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.notice-actions { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.notice-more, .notice-link {
  padding: 0; border: 0; background: none;
  font-family: inherit; font-size: 13px; font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
}
.notice-more:hover, .notice-link:hover { text-decoration: underline; }

/* =============================================
   MẠNG XÃ HỘI Ở CHÂN TRANG
   ============================================= */
.footer-social { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 4px 0; }
.footer-social-btn {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 17px;
  color: #fff;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
}
.footer-social-btn:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.footer-social-btn.telegram { background: #229ed9; }
.footer-social-btn.zalo     { background: #0068ff; }
.footer-social-btn.facebook { background: #1877f2; }
.footer-social-btn.tiktok   { background: #111; border: 1px solid rgba(255,255,255,.2); }
.footer-social-btn.youtube  { background: #ff0000; }

/* =============================================
   THẺ GAME KIỂU SHOWCASE — banner ảnh preview + icon + 2 nút
   Tỉ lệ gọn, chữ thường, 1 màu nhấn, nút bo vừa phải
   ============================================= */
.gm-card {
  display: flex; flex-direction: column;
  padding: 12px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  min-width: 0;
}
.gm-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent-border); }

/* ---- Banner ảnh preview ---- */
.gm-banner {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0; border: 0;
  border-radius: 14px;
  overflow: hidden;
  cursor: zoom-in;
  background: var(--surface2);
  font-family: inherit;
}
.gm-banner-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}
.gm-card:hover .gm-banner-img { transform: scale(1.03); }
/* Hiện TRỌN ảnh preview (không cắt mép); phần trống lấp bằng chính ảnh đó làm mờ phía sau */
/* Khung banner co giãn theo tỉ lệ ảnh (JS fitGameBanner) → ảnh lấp kín, không cắt, không viền */
.gm-banner .gm-banner-img { object-fit: cover; }
/* Viền mảnh phía trong banner cho sắc nét */
.gm-banner::before {
  content: '';
  position: absolute; inset: 0; z-index: 1;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  pointer-events: none;
}
/* Chưa có ảnh preview: nền màu nhấn nhạt + icon game ở giữa */
.gm-banner-empty {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 30% 20%, var(--accent-glow), transparent 60%),
    linear-gradient(135deg, var(--accent-light-bg), var(--surface2));
}
.gm-banner-empty img {
  width: 64px; height: 64px;
  border-radius: 16px;
  object-fit: cover;
  opacity: .9;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

/* ---- Nhãn trên banner ---- */
.gm-tag {
  position: absolute; z-index: 2;
  display: inline-flex; align-items: center; gap: 4px;
  height: 24px;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 11px; font-weight: 700; letter-spacing: .2px;
  color: #fff;
  background: rgba(10, 12, 18, 0.58);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.gm-tag i { font-size: 11px; }
.gm-tag.platform { top: 10px; right: 10px; }
.gm-tag.platform.android i { color: #4ade80; }
.gm-tag.count { bottom: 10px; right: 10px; }
.gm-tag.full { top: 10px; left: 10px; background: #dc2626; }

/* ---- Icon + tên game ---- */
.gm-body {
  position: relative; z-index: 3;
  display: flex; align-items: flex-start; gap: 12px;
  margin-top: -24px;
  padding: 0 6px;
  cursor: pointer;
}
.gm-icon {
  width: 60px; height: 60px;
  border-radius: 15px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface2);
  border: 3px solid var(--surface);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
[data-theme="dark"] .gm-icon { border-color: #131a29; }
/* Tên luôn nằm dưới banner (chỉ icon đè lên mép banner) */
.gm-info { flex: 1; min-width: 0; padding-top: 30px; }
.gm-name {
  font-size: 16px; font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.gm-meta {
  display: flex; align-items: center; gap: 5px;
  margin-top: 3px;
  font-size: 12.5px; font-weight: 500;
  color: var(--text2);
}
.gm-meta i { font-size: 12px; color: var(--text3); }

/* ---- 2 nút: Tải Xuống + Get Key ---- */
.gm-buttons {
  display: flex; gap: 8px;
  padding: 14px 2px 2px;
}
.gm-dl, .gm-key {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14.5px; font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background .2s ease, box-shadow .2s ease, filter .2s ease, transform .15s ease, border-color .2s ease;
}
.gm-dl:active, .gm-key:active { transform: scale(0.98); }
.gm-dl {
  flex: 1;
  border: 0;
  color: #fff;
  background: linear-gradient(180deg, #6d6af8 0%, #5a55f0 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 6px 16px -6px rgba(90, 85, 240, 0.65);
}
.gm-dl i { font-size: 16px; }
.gm-dl:hover { filter: brightness(1.07); }
.gm-key {
  flex: 0 0 auto;
  min-width: 118px;
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--border);
}
.gm-key i { color: var(--accent); font-size: 15px; }
.gm-key:hover { border-color: var(--accent-border); background: var(--accent-light-bg); }
/* Link đầy: nút tải chuyển sang trung tính */
.gm-card.is-full .gm-dl {
  background: var(--surface2); color: var(--text2);
  box-shadow: none; border: 1px solid var(--border);
}

/* ---- Nút phụ (lưu ý / link) dưới cùng ---- */
.gm-card .card-actions { margin: 12px -12px -12px; border-radius: 0 0 20px 20px; }

/* ---- Lưới thẻ game: 1 cột điện thoại, 2 cột tablet, 3 cột máy tính ---- */
.game-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  align-items: start;
  gap: 16px !important;
  max-width: 480px;
}
@media (min-width: 720px) {
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; max-width: 980px !important; gap: 20px !important; }
}
@media (min-width: 1100px) {
  .game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; max-width: 1160px !important; }
}
@media (max-width: 360px) {
  .gm-key { min-width: 0; }
}

/* Nhãn thống kê không bị xuống dòng trên điện thoại */
.hero-stats .stat-lbl { white-space: nowrap; }

/* =============================================================
   HIỆU ỨNG AVATAR — chọn trong admin (Cấu Hình Website → Hiệu ứng avatar)
   fx-hood: mũ trùm + lửa | fx-fire: lửa | fx-neon: vòng điện neon
   fx-plasma: hào quang plasma | fx-glitch: cyber glitch | fx-none: tắt
   ============================================================= */
.avatar-energy, .fx-neon-ring, .fx-plasma-aura, .fx-plasma-ring, .fx-glitch-layer { display: none; }

/* Lửa + viền lửa chỉ dùng cho kiểu Mũ trùm và Lửa */
.avatar-wrap:not(.fx-hood):not(.fx-fire) .avatar-fire-ring,
.avatar-wrap:not(.fx-hood):not(.fx-fire) .avatar-glow,
.avatar-wrap:not(.fx-hood):not(.fx-fire) .avatar-fire { display: none; }
.avatar-wrap:not(.fx-hood) .avatar-hood { display: none; }

/* Lớp canvas vẽ tia điện / hạt năng lượng (nằm trên avatar) */
.avatar-wrap.fx-neon .avatar-energy,
.avatar-wrap.fx-plasma .avatar-energy {
  display: block;
  position: absolute;
  left: 50%; top: 50%;
  width: 260px; height: 260px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 5;
}

/* ---------- 1. VÒNG ĐIỆN NEON ---------- */
.fx-neon .fx-neon-ring {
  display: block;
  position: absolute; inset: -6px;
  border-radius: 50%;
  z-index: 2;
  border: 2px solid #67e8f9;
  box-shadow: 0 0 6px #22d3ee, 0 0 18px rgba(34, 211, 238, 0.65), inset 0 0 10px rgba(34, 211, 238, 0.5);
  animation: neonFlicker 2.4s steps(1) infinite;
}
/* Các đoạn điện tím/xanh xoay quanh */
.fx-neon .fx-neon-ring::before {
  content: '';
  position: absolute; inset: -10px;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    transparent 0 6%, #a78bfa 6% 13%, transparent 13% 31%,
    #22d3ee 31% 38%, transparent 38% 56%, #a78bfa 56% 63%,
    transparent 63% 81%, #22d3ee 81% 88%, transparent 88%);
  -webkit-mask: radial-gradient(circle closest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
          mask: radial-gradient(circle closest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  animation: fireSpin 3.2s linear infinite;
  will-change: transform;
}
/* Vòng vạch chia mảnh xoay ngược chiều */
.fx-neon .fx-neon-ring::after {
  content: '';
  position: absolute; inset: -18px;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(103, 232, 249, 0.55) 0 2deg, transparent 2deg 10deg);
  -webkit-mask: radial-gradient(circle closest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
          mask: radial-gradient(circle closest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
  animation: fireSpin 9s linear infinite reverse;
  will-change: transform;
}
@keyframes neonFlicker {
  0%, 100% { opacity: 1; }
  41% { opacity: 0.55; } 42% { opacity: 1; }
  44% { opacity: 0.7; }  45% { opacity: 1; }
}
.fx-neon .hero-avatar { box-shadow: 0 0 0 2px #0b1220, 0 0 20px rgba(34, 211, 238, 0.35); }
[data-theme="light"] .fx-neon .fx-neon-ring { border-color: #06b6d4; box-shadow: 0 0 6px rgba(6, 182, 212, 0.8), 0 0 16px rgba(6, 182, 212, 0.45), inset 0 0 8px rgba(6, 182, 212, 0.35); }

/* ---------- 2. HÀO QUANG PLASMA ---------- */
.fx-plasma .fx-plasma-aura {
  display: block;
  position: absolute; inset: -28px;
  border-radius: 50%;
  z-index: 0;
  background: conic-gradient(#8b5cf6, #ec4899, #f59e0b, #22d3ee, #8b5cf6);
  filter: blur(18px);
  opacity: 0.7;
  animation: fireSpin 7s linear infinite;
  will-change: transform;
}
.fx-plasma .fx-plasma-ring {
  display: block;
  position: absolute; inset: -5px;
  border-radius: 50%;
  z-index: 2;
  background: conic-gradient(from 0deg, #8b5cf6, #ec4899, #f59e0b, #22d3ee, #8b5cf6);
  animation: fireSpin 3s linear infinite reverse;
  will-change: transform;
}
.fx-plasma .hero-avatar { box-shadow: 0 0 0 2px rgba(10, 8, 20, 0.7); }

/* ---------- 3. CYBER GLITCH ---------- */
.fx-glitch .fx-glitch-layer {
  display: block;
  position: absolute; inset: 0;
  z-index: 4;
  pointer-events: none;
}
.fx-glitch .hero-avatar {
  box-shadow: -2px 0 0 #ff2bd6, 2px 0 0 #22d3ee, 0 0 18px rgba(34, 211, 238, 0.3);
  animation: glitchShake 3s steps(1) infinite;
}
/* Ảnh tách màu đỏ / xanh khi nhiễu */
.fx-glitch .g-clone {
  position: absolute; inset: 0;
  width: 110px; height: 110px;
  border-radius: 50%;
  object-fit: cover;
  opacity: 0;
  mix-blend-mode: screen;
}
.fx-glitch .g-r { filter: sepia(1) saturate(8) hue-rotate(-50deg); animation: glitchR 3s steps(1) infinite; }
.fx-glitch .g-c { filter: sepia(1) saturate(8) hue-rotate(150deg); animation: glitchC 3s steps(1) infinite; }
/* Vạch quét màn hình */
.fx-glitch .g-scan {
  position: absolute; inset: 0;
  border-radius: 50%;
  overflow: hidden;
  background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0, 0, 0, 0.16) 2px 3px);
}
.fx-glitch .g-scan::after {
  content: '';
  position: absolute; left: 0; right: 0; top: 0;
  height: 18%;
  background: linear-gradient(to bottom, transparent, rgba(103, 232, 249, 0.35), transparent);
  animation: glitchSweep 2.6s linear infinite;
}
/* Khung ngắm HUD */
.fx-glitch .g-hud {
  position: absolute;
  width: 160px; height: 160px;
  left: -25px; top: -25px;
  overflow: visible;
}
.fx-glitch .g-hud .g-dash { transform-box: view-box; transform-origin: 80px 80px; animation: fireSpin 8s linear infinite; }
.fx-glitch .g-hud .g-corners { transform-box: view-box; transform-origin: 80px 80px; animation: hudPulse 1.8s ease-in-out infinite; }
@keyframes hudPulse { 0%, 100% { transform: scale(1); opacity: 0.95; } 50% { transform: scale(0.95); opacity: 0.7; } }
@keyframes glitchSweep { from { transform: translateY(-120%); } to { transform: translateY(560%); } }
@keyframes glitchShake {
  0%, 15%, 100% { transform: none; }
  2% { transform: translate(-2px, 1px) skewX(-3deg); }
  5% { transform: translate(2px, -1px); }
  8% { transform: translate(-1px, 0) skewX(2deg); }
  11% { transform: translate(1px, 1px); }
}
@keyframes glitchR {
  0%, 14%, 100% { opacity: 0; transform: none; clip-path: inset(0 0 0 0); }
  2%  { opacity: 0.8; transform: translate(-5px, 1px); clip-path: inset(10% 0 55% 0); }
  4%  { opacity: 0.8; transform: translate(4px, -2px); clip-path: inset(62% 0 12% 0); }
  6%  { opacity: 0.8; transform: translate(-3px, 0);   clip-path: inset(30% 0 42% 0); }
  9%  { opacity: 0.8; transform: translate(5px, 2px);  clip-path: inset(76% 0 4% 0); }
  12% { opacity: 0.8; transform: translate(-4px, -1px); clip-path: inset(4% 0 80% 0); }
}
@keyframes glitchC {
  0%, 14%, 100% { opacity: 0; transform: none; clip-path: inset(0 0 0 0); }
  2%  { opacity: 0.8; transform: translate(5px, -1px); clip-path: inset(48% 0 20% 0); }
  5%  { opacity: 0.8; transform: translate(-4px, 2px); clip-path: inset(15% 0 64% 0); }
  8%  { opacity: 0.8; transform: translate(3px, 0);    clip-path: inset(70% 0 10% 0); }
  11% { opacity: 0.8; transform: translate(-5px, -2px); clip-path: inset(36% 0 38% 0); }
}

@media (prefers-reduced-motion: reduce) {
  .fx-neon-ring, .fx-neon-ring::before, .fx-neon-ring::after,
  .fx-plasma-aura, .fx-plasma-ring,
  .fx-glitch .hero-avatar, .fx-glitch .g-clone, .fx-glitch .g-scan::after, .fx-glitch .g-hud * { animation: none !important; }
}

/* =============================================
   NÚT LIÊN HỆ Ở ĐẦU TRANG
   ============================================= */
.hero-social {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 8px;
  margin: 18px auto 0;
  max-width: 600px;
}
.hero-social[hidden] { display: none; }
.hero-social-btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  font-size: 13px; font-weight: 600;
  text-decoration: none;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.hero-social-btn i { font-size: 16px; }
.hero-social-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.hero-social-btn.telegram i { color: #229ed9; }
.hero-social-btn.zalo i     { color: #0068ff; }
.hero-social-btn.facebook i { color: #1877f2; }
.hero-social-btn.tiktok i   { color: var(--text); }
.hero-social-btn.youtube i  { color: #ff0000; }
.hero-social-btn.telegram:hover { border-color: rgba(34, 158, 217, 0.55); }
.hero-social-btn.zalo:hover     { border-color: rgba(0, 104, 255, 0.55); }
.hero-social-btn.facebook:hover { border-color: rgba(24, 119, 242, 0.55); }
.hero-social-btn.tiktok:hover   { border-color: var(--accent-border); }
.hero-social-btn.youtube:hover  { border-color: rgba(255, 0, 0, 0.45); }
[data-theme="dark"] .hero-social-btn.zalo i     { color: #3b8bff; }
[data-theme="dark"] .hero-social-btn.facebook i { color: #4a90f5; }
@media (max-width: 440px) {
  .hero-social { gap: 6px; }
  .hero-social-btn { height: 36px; padding: 0 11px; gap: 6px; font-size: 12.5px; }
  .hero-social-btn i { font-size: 15px; }
}

/* =============================================
   Ô LIÊN KẾT NHANH (Shop mua key, nhóm Telegram...)
   ============================================= */
.quick-links {
  display: flex; flex-direction: column; gap: 10px;
  width: 100%;
  max-width: 480px;
  margin: 22px auto 0;
  text-align: left;
}
.quick-links[hidden] { display: none; }
.ql-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px 14px 14px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.ql-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent-border); }
.ql-icon {
  width: 48px; height: 48px;
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.ql-icon.green  { background: linear-gradient(135deg, #14532d, #166534); color: #4ade80; }
.ql-icon.blue   { background: linear-gradient(135deg, #0c4a6e, #075985); color: #38bdf8; }
.ql-icon.purple { background: linear-gradient(135deg, #3b0764, #581c87); color: #c084fc; }
.ql-icon.orange { background: linear-gradient(135deg, #7c2d12, #9a3412); color: #fb923c; }
.ql-icon.red    { background: linear-gradient(135deg, #7f1d1d, #991b1b); color: #f87171; }
.ql-icon.pink   { background: linear-gradient(135deg, #831843, #9d174d); color: #f472b6; }
.ql-icon.indigo { background: linear-gradient(135deg, #312e81, #3730a3); color: #a5b4fc; }
.ql-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ql-text strong { font-size: 15px; font-weight: 700; line-height: 1.3; color: var(--text); word-break: break-word; }
.ql-text span { font-size: 12.5px; font-weight: 500; color: var(--text2); line-height: 1.35; }
.ql-arrow { font-size: 18px; color: var(--text3); flex-shrink: 0; transition: transform .2s ease, color .2s ease; }
.ql-card:hover .ql-arrow { transform: translateX(3px); color: var(--accent); }

/* =============================================
   POPUP THÔNG BÁO KHI VÀO WEB
   ============================================= */
.np-overlay {
  position: fixed; inset: 0;
  z-index: 8500;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(5, 7, 15, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .25s ease;
}
.np-overlay.show { opacity: 1; }
.np-card {
  position: relative;
  width: 100%; max-width: 420px;
  max-height: calc(100vh - 32px);
  display: flex; flex-direction: column;
  padding: 26px 22px 18px;
  border-radius: 24px;
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: 0 30px 70px -20px rgba(15, 23, 42, 0.45);
  transform: translateY(18px) scale(0.97);
  transition: transform .32s cubic-bezier(.2, .9, .3, 1.15);
}
[data-theme="dark"] .np-card { background: #121827; box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.8); }
.np-overlay.show .np-card { transform: none; }
.np-close {
  position: absolute; top: 12px; right: 12px;
  width: 34px; height: 34px;
  border: 0; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  color: var(--text3);
  font-size: 16px;
  cursor: pointer;
}
.np-close:hover { background: var(--surface2); color: var(--text); }
/* Icon loa + vòng sáng lan toả */
.np-icon {
  position: relative;
  width: 60px; height: 60px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: #fff;
  background: linear-gradient(135deg, #fbbf24, #f59e0b 55%, #ea580c);
  box-shadow: 0 10px 24px -8px rgba(245, 158, 11, 0.7);
  flex-shrink: 0;
}
.np-icon::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(245, 158, 11, 0.55);
  animation: npRing 2s ease-out infinite;
}
@keyframes npRing { from { transform: scale(1); opacity: 0.9; } to { transform: scale(1.7); opacity: 0; } }
.np-title {
  margin: 0 0 12px;
  font-size: 19px; font-weight: 800;
  text-align: center;
  color: var(--text);
}
.np-body {
  margin: 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  font-size: 14.5px; font-weight: 500;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-line;
  overflow-wrap: anywhere;
  overflow-y: auto;
  max-height: 46vh;
  text-align: left;
}
.np-actions { display: flex; gap: 10px; margin-top: 16px; }
.np-btn {
  flex: 1;
  height: 46px;
  border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: inherit; font-size: 15px; font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: filter .2s ease, background .2s ease, transform .15s ease;
}
.np-btn:active { transform: scale(0.98); }
.np-btn.primary { border: 0; color: #fff; background: linear-gradient(180deg, #6d6af8, #5a55f0); box-shadow: 0 8px 18px -8px rgba(90, 85, 240, 0.7); }
.np-btn.primary:hover { filter: brightness(1.07); }
.np-btn.ghost { color: var(--text); background: var(--surface2); border: 1px solid var(--border); }
.np-btn.ghost:hover { border-color: var(--accent-border); }
.np-snooze {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 12px auto 0;
  padding: 4px 8px;
  border: 0; background: none;
  font-family: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--text3);
  cursor: pointer;
}
.np-snooze:hover { color: var(--text); text-decoration: underline; }
@media (max-width: 420px) {
  .np-card { padding: 24px 18px 16px; border-radius: 22px; }
  .np-title { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .np-overlay, .np-card { transition: none; }
  .np-icon::after { animation: none; }
}
.np-btn:focus-visible, .np-close:focus-visible, .np-snooze:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Nội dung thông báo dạng HTML (soạn bằng CKEditor) */
.np-body.is-html, .notice-text.is-html { white-space: normal; }
.np-body.is-html > :first-child, .notice-text.is-html > :first-child { margin-top: 0; }
.np-body.is-html > :last-child,  .notice-text.is-html > :last-child  { margin-bottom: 0; }
.np-body.is-html p, .notice-text.is-html p { margin: 0 0 8px; }
.np-body.is-html ul, .np-body.is-html ol, .notice-text.is-html ul, .notice-text.is-html ol { margin: 0 0 8px; padding-left: 20px; }
.np-body.is-html h1, .np-body.is-html h2, .np-body.is-html h3 { margin: 0 0 8px; line-height: 1.3; font-size: 1.15em; }
.np-body.is-html a, .notice-text.is-html a { color: var(--accent); font-weight: 600; text-decoration: underline; }
.np-body.is-html img, .notice-text.is-html img { max-width: 100%; height: auto; border-radius: 10px; }
.np-body.is-html table { width: 100%; border-collapse: collapse; font-size: 13px; }
.np-body.is-html td, .np-body.is-html th { border: 1px solid var(--border); padding: 6px 8px; }
.np-body.is-html blockquote { margin: 0 0 8px; padding: 6px 12px; border-left: 3px solid var(--accent-border); color: var(--text2); }
