/* =============================================
   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 {
  --accent:        #9aa5b4;
  --accent2:       #cbd5e1;
  --accent-glow:   rgba(154, 165, 180, 0.30);
  --success:       #34d399;
  --warn:          #fbbf24;
  --danger:        #f87171;

  /* Light theme */
  --bg:            #f5f6f8;
  --bg2:           #eceef1;
  --surface:       #ffffff;
  --surface2:      #f0f2f5;
  --border:        rgba(0,0,0,0.08);
  --text:          #1c1e22;
  --text2:         #4a4e57;
  --text3:         #8a8f99;
  --shadow:        0 8px 32px rgba(0,0,0,0.10);
  --shadow-sm:     0 4px 12px rgba(0,0,0,0.07);
  --nav-bg:        #ffffff;
  --hero-overlay:  rgba(245,246,248,0.7);
}

[data-theme="dark"] {
  --bg:            #0e0f11;
  --bg2:           #141618;
  --surface:       rgba(255,255,255,0.05);
  --surface2:      rgba(255,255,255,0.08);
  --border:        rgba(255,255,255,0.09);
  --text:          #e8eaed;
  --text2:         #b0b6c0;
  --text3:         #636878;
  --shadow:        0 8px 32px rgba(0,0,0,0.55);
  --shadow-sm:     0 4px 12px rgba(0,0,0,0.35);
  --nav-bg:        rgba(14,15,17,0.96);
  --hero-overlay:  rgba(14,15,17,0.55);
}

/* ===== 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
   ============================================= */
#introSplash {
  position: fixed; inset: 0;
  background: #080909;
  display: flex; align-items: center; justify-content: center;
  z-index: 9000;
  transition: opacity 0.6s, visibility 0.6s;
}
#introSplash.hide { opacity: 0; visibility: hidden; pointer-events: none; }

.splash-inner {
  text-align: center;
  position: relative;
}

.splash-ring {
  width: 130px; height: 130px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--accent2);
  border-right-color: var(--accent);
  animation: spinRing 1.2s linear infinite;
  position: absolute;
  top: -10px; left: 50%; transform: translateX(-50%);
}
@keyframes spinRing { to { transform: translateX(-50%) rotate(360deg); } }

.splash-avatar {
  width: 110px; height: 110px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 20px;
  border: 3px solid var(--accent);
  animation: popIn 0.7s cubic-bezier(0.175,0.885,0.32,1.275);
  position: relative; z-index:1;
}
@keyframes popIn { from { transform:scale(0.3); opacity:0; } to { transform:scale(1); opacity:1; } }

.splash-title {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 26px; font-weight: 800;
  color: #fff;
  letter-spacing: 1px;
  animation: fadeUp 0.5s 0.3s both;
}
.splash-sub {
  font-size: 14px; color: #9090bb;
  margin-top: 6px;
  animation: fadeUp 0.5s 0.5s both;
}
.splash-loader {
  margin-top: 24px;
  display: flex; justify-content: center;
  animation: fadeUp 0.5s 0.6s both;
}
.splash-loader span {
  width: 60px; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 99px;
  position: relative;
  overflow: hidden;
}
.splash-loader span::after {
  content: '';
  position: absolute; top:0; left:-100%;
  width: 100%; height: 100%;
  background: rgba(255,255,255,0.6);
  animation: shimmer 1s infinite;
}
@keyframes shimmer { to { left: 100%; } }
@keyframes fadeUp { from { transform:translateY(14px); opacity:0; } to { transform:translateY(0); opacity:1; } }

/* =============================================
   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(--accent2);
  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; }
.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 60% 60% at 50% 0%, rgba(154,165,180,0.20) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 80% 80%, rgba(203,213,225,0.12) 0%, transparent 60%),
    var(--bg);
  z-index: 0;
}
[data-theme="dark"] .hero-bg {
  background:
    radial-gradient(ellipse 70% 60% at 50% -10%, rgba(154,165,180,0.18) 0%, transparent 65%),
    radial-gradient(ellipse 50% 40% at 85% 85%, rgba(203,213,225,0.10) 0%, transparent 60%),
    radial-gradient(ellipse 30% 30% at 15% 70%, rgba(100,110,120,0.10) 0%, transparent 60%),
    var(--bg);
}

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

.avatar-wrap { position: relative; width: 110px; margin: 0 auto 16px; }
.avatar-glow {
  position: absolute; inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  animation: pulseGlow 2.5s ease-in-out infinite;
}
@keyframes pulseGlow {
  0%,100% { transform: scale(1); opacity: 0.6; }
  50%      { transform: scale(1.2); opacity: 1; }
}
.hero-avatar {
  width: 110px; height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  position: relative; z-index:1;
}

.hero-badge {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  letter-spacing: 2px;
  color: var(--text2);
  background: rgba(154,165,180,0.12);
  border: 1px solid rgba(154,165,180,0.25);
  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;
}
.verify-badge { width: 28px; }

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

.hero-stats {
  display: flex; align-items: center; justify-content: center; gap: 20px;
  margin-top: 28px;
  padding: 16px 24px;
  background: var(--surface);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 20px;
  display: inline-flex;
}
.stat { text-align: center; }
.stat strong { display: block; font-family:'Be Vietnam Pro',sans-serif; font-size: 20px; font-weight: 800; color: var(--accent2); }
.stat span { font-size: 12px; color: var(--text2); font-weight: 500; }
.stat-divider { width: 1px; height: 32px; background: var(--border); }

/* =============================================
   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); }

.qc-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1e2025, #2d3039);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #cbd5e1;
  flex-shrink: 0;
}
.qc-icon.tg   { background: linear-gradient(135deg, #0d3347, #1b6f8a); color: #38b2f0; }
.qc-icon.shop { background: linear-gradient(135deg, #1a2a1a, #2a4a2a); color: #4ade80; }
.qc-icon.vid  { background: linear-gradient(135deg, #3b0a0a, #7f1d1d); color: #f87171; }

/* ===== GAME EXTRA BUTTONS ===== */
.game-card-wrap {
  display: flex; flex-direction: column; gap: 0;
  border-radius: 18px; overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: 0.25s;
}
.game-card-wrap:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.game-card-wrap .game-card { border: none; box-shadow: none; border-radius: 0; }
.game-card-wrap .game-card:first-child { border-radius: 18px 18px 0 0; }

.game-extra-btn {
  width: 100%;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: rgba(99,102,241,0.07);
  border: none; border-top: 1px solid var(--border);
  font-size: 13px; font-weight: 700;
  color: #818cf8;
  cursor: pointer; transition: 0.2s;
  font-family: inherit; text-align: left;
  text-decoration: none;
}
.game-extra-btn i { font-size: 15px; flex-shrink: 0; }
.game-extra-btn:hover { background: rgba(99,102,241,0.16); color: #a5b4fc; }
.game-extra-btn.note-btn { color: #fb923c; background: rgba(251,146,60,0.07); }
.game-extra-btn.note-btn:hover { background: rgba(251,146,60,0.16); color: #fcd34d; }

.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: #111318; }
[data-theme="dark"] .content-section.alt { background: #0e0f11; }

.section-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: #5aabf5;
  background: rgba(26,111,191,0.10);
  border: 1px solid rgba(26,111,191,0.22);
  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: 12px;
  padding: 12px 14px;
  background: var(--surface);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  transition: 0.25s;
  cursor: pointer;
}
.game-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: rgba(154,165,180,0.35); }

.game-thumb {
  width: 54px; height: 54px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.game-info { flex: 1; min-width: 0; }
.game-name {
  font-weight: 700; font-size: 14px;
  white-space: normal; word-break: break-word;
  line-height: 1.35;
  margin-bottom: 3px;
}
.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: 3px; height: 3px; border-radius: 50%; background: #5aabf5; 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 8px; border-radius: 99px;
  flex-shrink: 0;
}
.platform-badge.ios {
  background: rgba(26,111,191,0.13);
  color: #5aabf5;
  border: 1px solid rgba(26,111,191,0.25);
}
.platform-badge.android {
  background: rgba(61,220,132,0.12);
  color: #3ddc84;
  border: 1px solid rgba(61,220,132,0.22);
}

/* Preview button — nhỏ pill, cạnh badge */
.game-preview-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; height: 22px;
  border-radius: 99px;
  background: rgba(90,171,245,0.12);
  border: 1px solid rgba(90,171,245,0.30);
  font-size: 10px; font-weight: 700;
  color: #5aabf5; white-space: nowrap;
  transition: 0.2s; cursor: pointer;
}
.game-preview-btn i { font-size: 11px; color: #5aabf5; }
.game-preview-btn:hover {
  background: rgba(90,171,245,0.22);
  border-color: rgba(90,171,245,0.55);
  color: #7dc8ff;
}
.game-preview-btn:hover i { color: #7dc8ff; }
.preview-count {
  background: rgba(90,171,245,0.25); color: #5aabf5;
  border-radius: 99px; padding: 0 4px;
  font-size: 9px; font-weight: 800;
}

/* Download button — far right */
.game-dl-btn {
  width: 44px; height: 44px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; color: #fff;
  flex-shrink: 0; transition: 0.2s;
}
.game-dl-btn.ios {
  background: linear-gradient(135deg, #0a3a6e, #1a6fbf);
  box-shadow: 0 4px 14px rgba(26,111,191,0.40);
}
.game-dl-btn.android {
  background: linear-gradient(135deg, #143320, #1e7a3a);
  box-shadow: 0 4px 14px rgba(61,220,132,0.35);
}
.game-card:hover .game-dl-btn { transform: scale(1.07); }


/* ===== 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(--accent2); 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: rgba(99,102,241,0.10);
  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: #5aabf5; 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: rgba(90,171,245,0.75);
  transform: translateY(-50%) scale(1.08);
  border-color: rgba(90,171,245,0.5);
}
.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: 20px;
  box-shadow: var(--shadow-sm);
  transition: 0.25s;
}
.key-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.key-card a { color: inherit; }

.key-icon-wrap {
  width: 52px; height: 52px;
  border-radius: 15px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: #fff;
  flex-shrink: 0;
}
.key-icon-wrap.ios     { background: linear-gradient(135deg, #0a3a6e, #1a6fbf); }  /* iOS — xanh dương */
.key-icon-wrap.android { background: linear-gradient(135deg, #143320, #1e7a3a); }  /* Android — xanh lá */
.key-icon-wrap.shop    { background: linear-gradient(135deg, #10b981, #34d399); }  /* Shop — mint */
.key-icon-wrap.gold    { background: linear-gradient(135deg, #b8860b, #f5c518); }  /* Gold */

.key-info { flex: 1; }
.key-name { font-weight: 700; font-size: 15px; }
.key-desc { font-size: 12px; color: var(--text2); font-weight: 500; margin-top: 3px; }

.key-action {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; color: #5aabf5;
  flex-shrink: 0;
  transition: 0.2s;
}
.key-card:hover .key-action { background: #1a6fbf; color: #fff; border-color: #1a6fbf; }

/* Spinning key animation */
.spin { animation: keySpin 2.5s 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: rgba(154,165,180,0.30); }
.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);
  padding: 32px 20px 48px;
  text-align: center;
}
[data-theme="dark"] .footer { background: rgba(0,0,0,0.3); }

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

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

.mod-card-wrap {
  display: flex; flex-direction: column; gap: 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: 0.25s;
}
.mod-card-wrap:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.mod-card {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px;
  background: var(--surface);
  text-decoration: none;
  transition: 0.2s;
}
.mod-card:hover { background: var(--surface2); }

.mod-icon {
  width: 54px; height: 54px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1e1b4b, #3730a3);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: #a5b4fc;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}
.mod-icon.zip  { background: linear-gradient(135deg, #1e1b4b, #3730a3); color: #a5b4fc; }
.mod-icon.ios  { background: linear-gradient(135deg, #0f172a, #1e3a5f); color: #7dd3fc; }
.mod-icon.bot  {
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
  color: #fff;
  box-shadow: 0 0 18px rgba(124,58,237,0.5);
  animation: botIconPulse 2.2s ease-in-out infinite;
}
@keyframes botIconPulse {
  0%,100% { box-shadow: 0 0 14px rgba(124,58,237,0.4); }
  50%     { box-shadow: 0 0 24px rgba(6,182,212,0.6); }
}

/* ===== CARD BOT nổi bật ===== */
.mod-card-wrap-bot {
  position: relative;
  background: linear-gradient(135deg, rgba(124,58,237,0.12), rgba(6,182,212,0.10));
  border: 1.5px solid transparent;
  background-clip: padding-box;
}
.mod-card-wrap-bot::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(135deg, #7c3aed, #06b6d4, #7c3aed);
  background-size: 200% 200%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: botBorderFlow 3s linear infinite;
  pointer-events: none;
}
@keyframes botBorderFlow {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
.mod-card-bot .mod-dl-btn,
.mod-card-wrap-bot .mod-dl-btn {
  background: linear-gradient(135deg, #7c3aed, #06b6d4) !important;
  box-shadow: 0 4px 16px rgba(124,58,237,0.45) !important;
}

/* Badge 24/24 nhấp nháy */
.mod-badge {
  display: inline-flex; align-items: center; gap: 3px;
  margin-left: 7px; padding: 2px 8px;
  font-size: 10px; font-weight: 800;
  border-radius: 99px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff; vertical-align: middle;
  box-shadow: 0 0 10px rgba(34,197,94,0.5);
  animation: badgeBlink 1.8s ease-in-out infinite;
}
.mod-badge i { font-size: 9px; }
@keyframes badgeBlink {
  0%,100% { opacity: 1; transform: scale(1); }
  50%     { opacity: 0.85; transform: scale(1.05); }
}

.mod-info { flex: 1; min-width: 0; }
.mod-name {
  font-weight: 700; font-size: 14px;
  white-space: normal; word-break: break-word;
  line-height: 1.35; margin-bottom: 3px;
}
.mod-meta {
  font-size: 12px; color: var(--text2); font-weight: 500;
  display: flex; align-items: center; gap: 5px;
  margin-bottom: 5px;
}
.mod-meta-dot { width: 3px; height: 3px; border-radius: 50%; background: #a5b4fc; flex-shrink: 0; }
.mod-desc { font-size: 11px; color: var(--text3); margin-top: 2px; line-height: 1.4; }

.mod-dl-btn {
  width: 44px; height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1e1b4b, #3730a3);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; color: #fff;
  flex-shrink: 0; transition: 0.2s;
  box-shadow: 0 4px 14px rgba(99,102,241,0.35);
}
.mod-card-wrap:hover .mod-dl-btn { transform: scale(1.07); }

/* Nút Fix Trận Ảo — nằm dưới card */
.mod-guide-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 16px;
  background: rgba(99,102,241,0.08);
  border: none;
  border-top: 1px solid var(--border);
  font-size: 13px; font-weight: 700;
  color: #818cf8;
  cursor: pointer; transition: 0.2s;
  font-family: inherit;
}
.mod-guide-btn i { font-size: 15px; }
.mod-guide-btn:hover { background: rgba(99,102,241,0.16); color: #a5b4fc; }

/* 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: #818cf8;
  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 {
  border-radius: 18px; overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: 0.25s;
}
.vid-card-wrap:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.vid-card-wrap .vid-card { border: none; box-shadow: none; border-radius: 0; }

/* 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: 12px;
  padding: 13px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  transition: 0.25s;
  cursor: pointer;
}
.vid-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: rgba(239,68,68,0.35); }

.vid-thumb-wrap {
  width: 80px; height: 54px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  background: #000;
}
.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: linear-gradient(135deg, #1e1b4b, #3730a3);
  font-size: 28px; color: #a5b4fc;
}
.vid-play-icon {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.45);
  font-size: 22px; color: #fff;
  transition: background 0.2s;
}
.vid-card:hover .vid-play-icon { background: rgba(239,68,68,0.65); }
.vid-play-icon.external { background: rgba(41,182,246,0.5); }
.vid-card:hover .vid-play-icon.external { background: rgba(0,136,204,0.75); }

.vid-info { flex: 1; min-width: 0; }
.vid-name {
  font-weight: 700; font-size: 14px;
  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 {
  max-width: 480px !important;
  padding: 0 !important;
  overflow: hidden;
  border-radius: 24px;
}
.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;
  /* height set dynamically, but keep aspect ratio */
  aspect-ratio: 16 / 9;
}
.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 { font-size: 42px; color: #4f46e5; opacity: 0.7; }
.vid-poster-placeholder span { font-size: 13px; color: #94a3b8; font-weight: 600; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (min-width: 600px) {
  .hero-name { font-size: 38px; }
  .game-grid, .key-grid, .ipa-grid { max-width: 560px; }
}

@media (min-width: 900px) {
  .game-grid, .key-grid, .ipa-grid { max-width: 680px; }
}

/* =============================================
   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);       }


/* =============================================
   CHATBOT WIDGET
   ============================================= */
.chat-fab {
  position: fixed; bottom: 20px; right: 20px;
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, #3730a3, #6366f1);
  border: none; cursor: pointer; z-index: 6500;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: #fff;
  box-shadow: 0 6px 24px rgba(99,102,241,0.5);
  transition: transform 0.2s, box-shadow 0.2s;
  animation: fabPulse 2.5s infinite;
}
.chat-fab:hover { transform: scale(1.08); }
.chat-fab:active { transform: scale(0.95); }
@keyframes fabPulse {
  0%   { box-shadow: 0 6px 24px rgba(99,102,241,0.5), 0 0 0 0 rgba(99,102,241,0.4); }
  70%  { box-shadow: 0 6px 24px rgba(99,102,241,0.5), 0 0 0 14px rgba(99,102,241,0); }
  100% { box-shadow: 0 6px 24px rgba(99,102,241,0.5), 0 0 0 0 rgba(99,102,241,0); }
}
.chat-fab-badge {
  position: absolute; top: -2px; right: -2px;
  min-width: 20px; height: 20px; padding: 0 5px;
  background: #ef4444; color: #fff;
  border-radius: 99px; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}
.chat-fab.hidden { display: none; }

.chat-widget {
  position: fixed; bottom: 20px; right: 20px;
  width: 380px; max-width: calc(100vw - 32px);
  height: 560px; max-height: calc(100vh - 100px);
  background: #111827; border: 1px solid #1e293b;
  border-radius: 22px; z-index: 6500;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 12px 48px rgba(0,0,0,0.6);
  opacity: 0; visibility: hidden; transform: translateY(20px) scale(0.96);
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
  color: #e8ecf3;
}
.chat-widget.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

/* Light mode override */
[data-theme="light"] .chat-widget { background: #f8fafc; border-color: #e2e8f0; color: #1e293b; }

.cw-header {
  display: flex; align-items: center; gap: 10px; padding: 13px 14px;
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  border-bottom: 1px solid #1e293b; flex-shrink: 0;
}
.cw-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #6366f1, #a5b4fc);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff; position: relative;
}
.cw-avatar::after {
  content: ''; position: absolute; bottom: 0; right: 0;
  width: 10px; height: 10px; background: #22c55e;
  border-radius: 50%; border: 2px solid #1e1b4b;
}
.cw-meta { flex: 1; min-width: 0; }
.cw-name { font-size: 15px; font-weight: 800; color: #fff; display: flex; align-items: center; gap: 5px; }
.cw-name i { color: #60a5fa; font-size: 13px; }
.cw-status { font-size: 11px; color: #4ade80; font-weight: 500; }
.cw-close {
  width: 34px; height: 34px; border-radius: 10px; border: none; cursor: pointer;
  background: rgba(255,255,255,0.12); color: #fff; font-size: 15px;
  display: flex; align-items: center; justify-content: center; transition: 0.2s;
}
.cw-close:hover { background: rgba(255,255,255,0.22); }

.cw-body {
  flex: 1; overflow-y: auto; padding: 16px 12px;
  display: flex; flex-direction: column; gap: 12px;
  background: #0f172a;
}
[data-theme="light"] .cw-body { background: #f1f5f9; }
.cw-body::-webkit-scrollbar { width: 5px; }
.cw-body::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }

.cw-msg { display: flex; gap: 8px; max-width: 90%; animation: cwSlide 0.3s ease; }
@keyframes cwSlide { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.cw-msg.bot { align-self: flex-start; }
.cw-msg.user { align-self: flex-end; flex-direction: row-reverse; }
.cw-msg-av {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.cw-msg.bot .cw-msg-av { background: linear-gradient(135deg, #3730a3, #818cf8); color: #fff; }
.cw-msg.user .cw-msg-av { background: #1e293b; color: #94a3b8; }
[data-theme="light"] .cw-msg.user .cw-msg-av { background: #e2e8f0; color: #475569; }

.cw-bubble {
  padding: 10px 13px; border-radius: 15px; font-size: 13.5px; line-height: 1.5;
  word-break: break-word;
}
.cw-msg.bot .cw-bubble { background: #1e293b; border-bottom-left-radius: 4px; color: #e2e8f0; }
.cw-msg.user .cw-bubble { background: #4338ca; border-bottom-right-radius: 4px; color: #fff; }
[data-theme="light"] .cw-msg.bot .cw-bubble { background: #fff; color: #1e293b; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }

.cw-bubble strong { font-weight: 700; color: #818cf8; }
.cw-msg.user .cw-bubble strong { color: #c7d2fe; }
[data-theme="light"] .cw-msg.bot .cw-bubble strong { color: #4338ca; }
.cw-bubble a { color: #818cf8; font-weight: 600; text-decoration: underline; word-break: break-all; }

/* ===== ICON GAME TRONG TIN NHẮN ===== */
.cw-game-icon {
  width: 22px; height: 22px; border-radius: 6px;
  display: inline-block; vertical-align: -5px;
  margin-right: 6px; object-fit: cover;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

/* ===== ICON SVG TRONG TIN NHẮN ===== */
.cw-svg-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; margin-right: 6px;
  vertical-align: -4px; color: #818cf8;
}
.cw-svg-icon svg { width: 100%; height: 100%; }
[data-theme="light"] .cw-svg-icon { color: #4338ca; }

/* ===== CARD VIDEO PREVIEW (giống Telegram/Messenger) ===== */
.cw-video-card {
  display: block; margin-top: 10px;
  border-radius: 12px; overflow: hidden;
  background: rgba(99,102,241,0.10);
  border: 1px solid rgba(99,102,241,0.28);
  text-decoration: none !important;
  transition: 0.2s;
}
.cw-video-card:active { transform: scale(0.98); }
.cw-video-thumb {
  position: relative; width: 100%; aspect-ratio: 16/9;
  background: linear-gradient(135deg,#1e1b4b,#312e81);
  overflow: hidden;
}
.cw-video-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cw-video-ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 38px; color: rgba(255,255,255,0.55);
}
.cw-video-play {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 24px; padding-left: 3px;
  border: 2px solid rgba(255,255,255,0.85);
}
.cw-video-meta { padding: 9px 12px; }
.cw-video-src {
  font-size: 10.5px; color: #818cf8; font-weight: 600;
  text-transform: lowercase; margin-bottom: 2px;
}
.cw-video-title {
  font-size: 13px; font-weight: 700; color: #e2e8f0;
  line-height: 1.35; margin-bottom: 2px;
}
.cw-video-sub { font-size: 11.5px; color: #94a3b8; line-height: 1.35; }
[data-theme="light"] .cw-video-title { color: #1e293b; }
[data-theme="light"] .cw-video-sub   { color: #64748b; }
[data-theme="light"] .cw-video-card  { background: rgba(99,102,241,0.06); }

/* ===== CHIP BẤM NHANH TRONG TIN NHẮN ===== */
.cw-inline-chip {
  display: inline-block; margin: 5px 5px 0 0;
  padding: 7px 14px; border-radius: 99px;
  background: rgba(99,102,241,0.16);
  border: 1.5px solid rgba(99,102,241,0.45);
  color: #a5b4fc; font-size: 12.5px; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: 0.2s;
}
.cw-inline-chip:hover { background: rgba(99,102,241,0.32); color: #fff; }
.cw-inline-chip:active { transform: scale(0.96); }
[data-theme="light"] .cw-inline-chip { color: #4338ca; background: rgba(99,102,241,0.09); }

/* ===== LINK GỌN "tại đây" ===== */
.cw-link-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 8px;
  background: linear-gradient(135deg,#4338ca,#6366f1);
  color: #fff !important; font-size: 12.5px; font-weight: 700;
  text-decoration: none !important; margin: 2px 0;
  box-shadow: 0 2px 8px rgba(99,102,241,0.35);
  transition: 0.2s; word-break: normal !important;
}
.cw-link-btn:active { transform: scale(0.96); }
.cw-link-btn i { font-size: 10px; }

.cw-msg.user .cw-bubble a { color: #c7d2fe; }
[data-theme="light"] .cw-msg.bot .cw-bubble a { color: #4338ca; font-weight: 700; }
.cw-bubble img { max-width: 100%; border-radius: 10px; margin-top: 6px; display: block; cursor: pointer; }
.cw-time { font-size: 10px; color: #64748b; margin-top: 3px; display: block; }

[data-theme="light"] .cw-msg.user .cw-bubble { background: #4338ca; }

.cw-typing { display: flex; gap: 8px; align-self: flex-start; }
.cw-typing-bubble {
  padding: 13px 15px; border-radius: 15px; border-bottom-left-radius: 4px;
  background: #1e293b; display: flex; gap: 4px; align-items: center;
}
[data-theme="light"] .cw-typing-bubble { background: #fff; }
.cw-typing-bubble span {
  width: 7px; height: 7px; border-radius: 50%; background: #64748b;
  animation: cwBounce 1.3s infinite;
}
.cw-typing-bubble span:nth-child(2) { animation-delay: 0.2s; }
.cw-typing-bubble span:nth-child(3) { animation-delay: 0.4s; }
@keyframes cwBounce { 0%,60%,100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-5px); opacity: 1; } }

.cw-quick {
  display: flex; gap: 7px; padding: 9px 12px; overflow-x: auto;
  border-top: 1px solid #1e293b; flex-shrink: 0;
  background: #111827;
}
[data-theme="light"] .cw-quick { background: #f8fafc; border-top-color: #e2e8f0; }
.cw-quick::-webkit-scrollbar { height: 0; }
.cw-chip {
  flex-shrink: 0; padding: 7px 13px; border-radius: 99px;
  background: rgba(99,102,241,0.18);
  border: 1.5px solid rgba(99,102,241,0.5);
  color: #a5b4fc; font-size: 12.5px; font-weight: 700; cursor: pointer;
  white-space: nowrap; transition: 0.2s; font-family: inherit;
}
.cw-chip:hover { background: rgba(99,102,241,0.35); border-color: #6366f1; color: #fff; }
[data-theme="light"] .cw-chip { color: #4338ca; border-color: rgba(67,56,202,0.4); background: rgba(99,102,241,0.08); }
[data-theme="light"] .cw-chip:hover { background: rgba(99,102,241,0.18); color: #3730a3; }

.cw-input-row {
  display: flex; gap: 8px; padding: 11px 12px;
  border-top: 1px solid #1e293b; align-items: flex-end; flex-shrink: 0;
  background: #111827;
}
[data-theme="light"] .cw-input-row { background: #f8fafc; border-top-color: #e2e8f0; }
.cw-input {
  flex: 1; background: #1e293b; border: 1px solid #334155;
  border-radius: 20px; padding: 10px 14px; color: #e2e8f0; font-size: 13.5px;
  font-family: inherit; outline: none; resize: none; max-height: 90px; line-height: 1.4;
  transition: 0.2s;
}
[data-theme="light"] .cw-input { background: #fff; border-color: #cbd5e1; color: #1e293b; }
[data-theme="light"] .cw-input::placeholder { color: #94a3b8; }
.cw-input::placeholder { color: #475569; }
.cw-input:focus { border-color: #6366f1; }
.cw-send {
  width: 42px; height: 42px; border-radius: 50%; border: none; flex-shrink: 0; cursor: pointer;
  background: linear-gradient(135deg, #3730a3, #6366f1); color: #fff; font-size: 17px;
  display: flex; align-items: center; justify-content: center; transition: 0.2s;
}
.cw-send:hover { transform: scale(1.07); }
.cw-send:active { transform: scale(0.95); }

/* Mobile: full screen */
@media (max-width: 480px) {
  .chat-widget {
    bottom: 0; right: 0; width: 100%; max-width: 100%;
    height: 100%; max-height: 100%; border-radius: 0;
  }
}
