/* ===== LIÊN QUÂN SHOP - Theme Variables ===== */
/* Mặc định: Dimension Breaker (Hayate) */
:root {
  --bg-primary: #0A0510;
  --bg-secondary: #1A0A22;
  --bg-card: rgba(26, 10, 34, 0.88);
  --bg-card-hover: rgba(58, 18, 56, 0.95);
  --accent-cyan: #6EF3FF;
  --accent-magenta: #FF1E4D;
  --accent-yellow: #FFE566;
  --accent-green: #39ff14;
  --accent-purple: #C4122E;
  --text-primary: #F5F7FA;
  --text-secondary: rgba(168, 176, 192, 0.85);
  --border-glow: rgba(196, 18, 46, 0.45);
  --header-gradient: linear-gradient(135deg, #0A0510 0%, #1A0A22 45%, #2A0A28 100%);
  --banner-gradient: linear-gradient(135deg, #3A1238 0%, #0A0510 45%, #1A0518 100%);
  --btn-primary: linear-gradient(135deg, #6EF3FF 0%, #C4122E 100%);
  --btn-success: linear-gradient(135deg, #39ff14, #6EF3FF);
  --btn-warning: linear-gradient(135deg, #FFE566, #FF1E4D);
  --shadow-neon: 0 0 24px rgba(255, 30, 77, 0.35);
  --radius: 12px;
  --radius-sm: 6px;
  --font-main: 'Be Vietnam Pro', 'Segoe UI', sans-serif;
  --font-display: 'Rajdhani', 'Be Vietnam Pro', sans-serif;
  --crimson: #C4122E;
  --ice: #6EF3FF;
  --void: #0A0510;
}

/* Theme: Xanh Neon (cũ) */
[data-theme="neon"] {
  --bg-primary: #0a0e27;
  --bg-secondary: #121836;
  --bg-card: rgba(20, 28, 68, 0.85);
  --bg-card-hover: rgba(30, 40, 90, 0.95);
  --accent-cyan: #00d4ff;
  --accent-magenta: #ff2d95;
  --accent-yellow: #ffd700;
  --accent-green: #39ff14;
  --accent-purple: #9b59ff;
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.65);
  --border-glow: rgba(0, 212, 255, 0.4);
  --header-gradient: linear-gradient(135deg, #0a0e27 0%, #1a1040 100%);
  --banner-gradient: linear-gradient(135deg, #1a0533 0%, #0d2847 50%, #1a0533 100%);
  --btn-primary: linear-gradient(135deg, #00d4ff, #9b59ff);
  --btn-success: linear-gradient(135deg, #39ff14, #00d4ff);
  --shadow-neon: 0 0 20px rgba(0, 212, 255, 0.3);
  --radius: 16px;
}

/* Theme: Đỏ Lửa */
[data-theme="fire"] {
  --bg-primary: #1a0a0a;
  --bg-secondary: #2d1212;
  --bg-card: rgba(60, 20, 20, 0.85);
  --accent-cyan: #ff6b35;
  --accent-magenta: #ff0040;
  --accent-yellow: #ffcc00;
  --accent-green: #ff9500;
  --accent-purple: #ff3366;
  --border-glow: rgba(255, 107, 53, 0.4);
  --header-gradient: linear-gradient(135deg, #1a0a0a 0%, #3d1010 100%);
  --banner-gradient: linear-gradient(135deg, #2d0a0a 0%, #4d1515 50%, #2d0a0a 100%);
  --btn-primary: linear-gradient(135deg, #ff6b35, #ff0040);
  --btn-success: linear-gradient(135deg, #ffcc00, #ff6b35);
  --shadow-neon: 0 0 20px rgba(255, 107, 53, 0.3);
}

/* Theme: Xanh Rồng */
[data-theme="dragon"] {
  --bg-primary: #0a1a0f;
  --bg-secondary: #0f2818;
  --bg-card: rgba(15, 50, 30, 0.85);
  --accent-cyan: #00ff88;
  --accent-magenta: #00cc66;
  --accent-yellow: #aaff00;
  --accent-green: #00ff66;
  --accent-purple: #33ff99;
  --border-glow: rgba(0, 255, 136, 0.4);
  --header-gradient: linear-gradient(135deg, #0a1a0f 0%, #0f3020 100%);
  --banner-gradient: linear-gradient(135deg, #0a2015 0%, #153d25 50%, #0a2015 100%);
  --btn-primary: linear-gradient(135deg, #00ff88, #00cc66);
  --btn-success: linear-gradient(135deg, #00ff66, #00ff88);
  --shadow-neon: 0 0 20px rgba(0, 255, 136, 0.3);
}

/* Theme: Tím Hoàng Gia */
[data-theme="royal"] {
  --bg-primary: #150a25;
  --bg-secondary: #251040;
  --bg-card: rgba(40, 20, 70, 0.85);
  --accent-cyan: #c084fc;
  --accent-magenta: #e879f9;
  --accent-yellow: #fbbf24;
  --accent-green: #a78bfa;
  --accent-purple: #9333ea;
  --border-glow: rgba(192, 132, 252, 0.4);
  --header-gradient: linear-gradient(135deg, #150a25 0%, #301050 100%);
  --banner-gradient: linear-gradient(135deg, #200a35 0%, #401060 50%, #200a35 100%);
  --btn-primary: linear-gradient(135deg, #c084fc, #9333ea);
  --btn-success: linear-gradient(135deg, #a78bfa, #c084fc);
  --shadow-neon: 0 0 20px rgba(192, 132, 252, 0.3);
}

/* Theme: Vàng Kim */
[data-theme="gold"] {
  --bg-primary: #1a1508;
  --bg-secondary: #2d2510;
  --bg-card: rgba(50, 40, 15, 0.85);
  --accent-cyan: #ffd700;
  --accent-magenta: #ffb347;
  --accent-yellow: #ffe066;
  --accent-green: #daa520;
  --accent-purple: #ffaa00;
  --border-glow: rgba(255, 215, 0, 0.4);
  --header-gradient: linear-gradient(135deg, #1a1508 0%, #3d3010 100%);
  --banner-gradient: linear-gradient(135deg, #251a05 0%, #4d3a10 50%, #251a05 100%);
  --btn-primary: linear-gradient(135deg, #ffd700, #ff8c00);
  --btn-success: linear-gradient(135deg, #ffe066, #ffd700);
  --shadow-neon: 0 0 20px rgba(255, 215, 0, 0.3);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation;
  overflow-x: hidden;
}

body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  touch-action: pan-x pan-y;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

input, textarea, [contenteditable] {
  -webkit-user-select: text;
  user-select: text;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 78% 18%, rgba(255, 30, 77, 0.14) 0%, transparent 42%),
    radial-gradient(ellipse at 12% 60%, rgba(110, 243, 255, 0.06) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 100%, rgba(58, 18, 56, 0.35) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* Ảnh nền full sảnh — phủ toàn trang shop */
.lobby-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.lobby-bg[hidden] { display: none !important; }

.lobby-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.lobby-bg-dim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 5, 16, 0.55) 0%, rgba(10, 5, 16, 0.72) 45%, rgba(10, 5, 16, 0.88) 100%),
    radial-gradient(ellipse at 50% 0%, transparent 0%, rgba(10, 5, 16, 0.35) 70%);
}

body.has-lobby-bg::before {
  opacity: 0.35;
}

body.has-lobby-bg .header {
  background: color-mix(in srgb, var(--bg-primary) 78%, transparent);
  backdrop-filter: blur(12px);
}

/* ===== MAINTENANCE OVERLAY ===== */
.maintenance-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.maintenance-overlay.active { display: flex; }

.maintenance-overlay .maint-icon {
  font-size: 5rem;
  margin-bottom: 1.5rem;
  animation: pulse 2s infinite;
}

.maintenance-overlay h1 {
  font-size: 2.5rem;
  background: var(--btn-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

.maintenance-overlay p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 500px;
  line-height: 1.6;
}

/* Mobile: không bắt xoay ngang */
.rotate-overlay { display: none !important; }

/* Bắt đăng nhập mới xem shop */
.login-gate-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10040;
  background: rgba(4, 8, 20, 0.96);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
}

.login-gate-overlay:not([hidden]) {
  display: flex;
}

body.login-gated .header,
body.login-gated .main-wrapper,
body.login-gated .footer,
body.login-gated .support-fab {
  visibility: hidden;
  pointer-events: none;
}

.login-gate-card {
  max-width: 380px;
  background: rgba(12, 18, 40, 0.95);
  border: 1px solid rgba(0, 212, 255, 0.25);
  border-radius: 16px;
  padding: 2rem 1.5rem;
}

.login-gate-icon {
  font-size: 2.8rem;
  margin-bottom: 0.75rem;
}

.login-gate-card h2 {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}

.login-gate-card p {
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.login-gate-card .btn {
  display: inline-block;
  width: auto;
  text-decoration: none;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

/* ===== HEADER ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-gradient);
  border-bottom: 1px solid var(--border-glow);
  backdrop-filter: blur(12px);
  padding: 0.75rem 2rem;
  overflow: visible;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
  min-height: 56px;
}

.header-inner::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.75rem;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--accent-cyan) 20%, var(--accent-magenta) 55%, transparent 100%);
  opacity: 0.85;
  pointer-events: none;
  box-shadow: 0 0 12px rgba(255, 30, 77, 0.45);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid var(--accent-cyan);
  box-shadow: var(--shadow-neon);
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--accent-cyan) 0%, #fff 40%, var(--accent-magenta) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.nav {
  display: flex;
  gap: 0.2rem;
}

.nav a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.55rem 1rem;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  transition: all 0.25s;
  position: relative;
  clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%);
  border-radius: 0;
}

.nav a[hidden] { display: none !important; }

.nav a:hover, .nav a.active {
  color: var(--text-primary);
  background: rgba(255, 30, 77, 0.12);
}

.nav a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 12%;
  width: 76%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-magenta));
  box-shadow: 0 0 10px rgba(255, 30, 77, 0.6);
}

.nav-admin-link {
  color: var(--accent-yellow) !important;
  background: rgba(255, 215, 0, 0.12) !important;
  border: 1px solid rgba(255, 215, 0, 0.35);
  clip-path: none !important;
  border-radius: 8px !important;
}

.nav-admin-link:hover,
.nav-admin-link.active {
  background: rgba(255, 215, 0, 0.22) !important;
  color: #ffe566 !important;
}

.nav-admin-link.active::after { display: none; }

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.header-more-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border-glow);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  letter-spacing: 0.12em;
  padding: 0 0 4px;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.header-user-block {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.balance-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: 50px;
  padding: 0.4rem 0.75rem 0.4rem 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.balance-pill .icon { font-size: 1.1rem; }

.balance-pill .add-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: var(--btn-primary);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: transform 0.2s;
}

.balance-pill .add-btn:hover { transform: scale(1.15); }

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--accent-purple);
  object-fit: cover;
  cursor: pointer;
}

.theme-picker {
  position: relative;
}

.theme-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border-glow);
  background: var(--btn-primary);
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.2s;
}

.theme-btn:hover { transform: rotate(30deg); }

.theme-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  min-width: 180px;
  box-shadow: var(--shadow-neon);
  z-index: 200;
}

.theme-dropdown.open { display: block; }

.theme-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s;
  border: none;
  background: none;
  color: var(--text-primary);
  width: 100%;
  text-align: left;
}

.theme-option:hover { background: rgba(255, 255, 255, 0.08); }

.theme-option.active {
  background: color-mix(in srgb, var(--accent-cyan) 14%, transparent);
  outline: 1px solid var(--border-glow);
}

.theme-option.active .theme-swatch {
  box-shadow: 0 0 0 2px var(--accent-cyan);
}

.theme-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ===== MAIN LAYOUT ===== */
.main-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 2rem 3rem;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  position: relative;
  z-index: 1;
}

.main-wrapper.no-sidebar {
  grid-template-columns: 1fr;
}

.sidebar[hidden] { display: none !important; }

[data-shop-section][hidden] { display: none !important; }

.main-content { min-width: 0; }

/* ===== HERO BANNER (Dimension Breaker depth) ===== */
.hero-banner {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--banner-gradient);
  border: 1px solid rgba(255, 30, 77, 0.35);
  margin-bottom: 1.5rem;
  min-height: 320px;
  display: flex;
  align-items: stretch;
  box-shadow: var(--shadow-neon), inset 0 0 80px rgba(196, 18, 46, 0.15);
}

.hero-banner-bg {
  position: absolute;
  inset: 0;
  object-fit: cover;
  object-position: center top;
  width: 100%;
  height: 100%;
  opacity: 0.72;
  filter: saturate(1.15) contrast(1.05);
}

.hero-depth {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.hero-rings {
  position: absolute;
  right: 8%;
  top: 50%;
  width: min(420px, 55vw);
  height: min(420px, 55vw);
  transform: translateY(-52%);
  opacity: 0.55;
}

.hero-rings span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 30, 77, 0.35);
  box-shadow: 0 0 24px rgba(255, 30, 77, 0.25), inset 0 0 24px rgba(255, 30, 77, 0.12);
  animation: heroRingSpin 48s linear infinite;
}

.hero-rings span:nth-child(2) {
  inset: 12%;
  border-color: rgba(255, 30, 77, 0.45);
  animation-duration: 36s;
  animation-direction: reverse;
}

.hero-rings span:nth-child(3) {
  inset: 26%;
  border-color: rgba(110, 243, 255, 0.25);
  animation-duration: 28s;
}

.hero-shards span {
  position: absolute;
  width: 10px;
  height: 10px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(255, 30, 77, 0.5));
  opacity: 0.55;
  animation: heroShardFloat 7s ease-in-out infinite;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

.hero-shards span:nth-child(1) { left: 12%; top: 22%; animation-delay: 0s; }
.hero-shards span:nth-child(2) { left: 28%; top: 68%; width: 7px; height: 7px; animation-delay: 1.2s; }
.hero-shards span:nth-child(3) { left: 62%; top: 18%; width: 14px; height: 14px; animation-delay: 0.6s; }
.hero-shards span:nth-child(4) { left: 78%; top: 55%; animation-delay: 2s; }
.hero-shards span:nth-child(5) { left: 48%; top: 78%; width: 8px; height: 8px; animation-delay: 1.5s; }
.hero-shards span:nth-child(6) { left: 88%; top: 28%; width: 6px; height: 6px; animation-delay: 2.4s; }

.hero-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 5, 16, 0.88) 0%, rgba(10, 5, 16, 0.35) 42%, rgba(10, 5, 16, 0.15) 70%, rgba(10, 5, 16, 0.55) 100%),
    linear-gradient(180deg, rgba(10, 5, 16, 0.2) 0%, transparent 35%, rgba(10, 5, 16, 0.65) 100%);
}

.hero-flare {
  position: absolute;
  right: 18%;
  top: 28%;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.35) 0%, rgba(255, 30, 77, 0.12) 35%, transparent 70%);
  animation: heroFlarePulse 4.5s ease-in-out infinite;
}

.hero-banner-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  width: 100%;
  padding: 2rem 2.25rem;
  gap: 1.5rem;
}

.hero-character {
  width: 200px;
  height: 220px;
  object-fit: contain;
  filter: drop-shadow(0 0 28px rgba(255, 30, 77, 0.55));
  flex-shrink: 0;
}

.hero-info { flex: 1; max-width: 520px; }

.hero-countdown {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--accent-cyan), #fff, var(--accent-magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 4px;
  margin-bottom: 0.5rem;
  line-height: 1.1;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  font-weight: 700;
  font-style: italic;
  letter-spacing: 0.5px;
  margin-bottom: 0.85rem;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55);
}

.hero-progress {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  max-width: 400px;
  clip-path: polygon(0 0, 100% 0, 98% 100%, 0 100%);
}

.hero-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-magenta));
  border-radius: 2px;
  width: 65%;
  animation: progressGlow 2s infinite;
}

@keyframes progressGlow {
  0%, 100% { box-shadow: 0 0 8px var(--accent-cyan); }
  50% { box-shadow: 0 0 16px var(--accent-magenta); }
}

@keyframes heroRingSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes heroShardFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.4; }
  50% { transform: translateY(-14px) rotate(18deg); opacity: 0.85; }
}

@keyframes heroFlarePulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 0.95; transform: scale(1.08); }
}

/* ===== HERO FRAME EFFECTS (5 mẫu) ===== */
.hero-frame-corners,
.hero-frame-scan {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 4;
}

.hero-frame-corners .hf-c {
  position: absolute;
  width: 28px;
  height: 28px;
  display: none;
}

.hero-frame-scan { display: none; }

/* 1) Crimson Glow — viền đỏ neon + glow ngoài (như ảnh) */
.hero-banner.frame-crimson {
  border: 1px solid rgba(255, 30, 77, 0.55);
  box-shadow:
    0 0 0 1px rgba(255, 30, 77, 0.25),
    0 0 28px rgba(255, 30, 77, 0.45),
    0 0 60px rgba(196, 18, 46, 0.25),
    inset 0 0 80px rgba(196, 18, 46, 0.12);
  animation: frameCrimsonPulse 3.2s ease-in-out infinite;
}

.hero-banner.frame-crimson .hero-frame-corners .hf-c {
  display: block;
  border-color: #FF1E4D;
  box-shadow: 0 0 12px rgba(255, 30, 77, 0.7);
}

.hero-banner.frame-crimson .hf-tl { top: 8px; left: 8px; border-top: 3px solid; border-left: 3px solid; }
.hero-banner.frame-crimson .hf-tr { top: 8px; right: 8px; border-top: 3px solid; border-right: 3px solid; }
.hero-banner.frame-crimson .hf-bl { bottom: 8px; left: 8px; border-bottom: 3px solid; border-left: 3px solid; }
.hero-banner.frame-crimson .hf-br { bottom: 8px; right: 8px; border-bottom: 3px solid; border-right: 3px solid; }

@keyframes frameCrimsonPulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255, 30, 77, 0.25), 0 0 24px rgba(255, 30, 77, 0.4), 0 0 50px rgba(196, 18, 46, 0.2); }
  50% { box-shadow: 0 0 0 1px rgba(255, 30, 77, 0.45), 0 0 36px rgba(255, 30, 77, 0.65), 0 0 72px rgba(196, 18, 46, 0.35); }
}

/* 2) Ice Bracket — góc cyan lạnh */
.hero-banner.frame-ice {
  border: 1px solid rgba(110, 243, 255, 0.45);
  box-shadow:
    0 0 24px rgba(110, 243, 255, 0.3),
    inset 0 0 40px rgba(110, 243, 255, 0.06);
  border-radius: 10px;
}

.hero-banner.frame-ice .hero-frame-corners .hf-c {
  display: block;
  width: 36px;
  height: 36px;
  border-color: #6EF3FF;
  filter: drop-shadow(0 0 6px #6EF3FF);
}

.hero-banner.frame-ice .hf-tl { top: 6px; left: 6px; border-top: 2px solid; border-left: 2px solid; }
.hero-banner.frame-ice .hf-tr { top: 6px; right: 6px; border-top: 2px solid; border-right: 2px solid; }
.hero-banner.frame-ice .hf-bl { bottom: 6px; left: 6px; border-bottom: 2px solid; border-left: 2px solid; }
.hero-banner.frame-ice .hf-br { bottom: 6px; right: 6px; border-bottom: 2px solid; border-right: 2px solid; }

.hero-banner.frame-ice::after {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(110, 243, 255, 0.18);
  pointer-events: none;
  z-index: 3;
}

/* 3) Energy Rings — vòng năng lượng góc */
.hero-banner.frame-rings {
  border: 1px solid rgba(255, 30, 77, 0.35);
  box-shadow: 0 0 20px rgba(255, 30, 77, 0.25);
}

.hero-banner.frame-rings .hero-frame-corners .hf-c {
  display: block;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid rgba(255, 30, 77, 0.55);
  box-shadow: 0 0 14px rgba(255, 30, 77, 0.5), inset 0 0 10px rgba(110, 243, 255, 0.25);
  animation: frameCornerRing 4s linear infinite;
}

.hero-banner.frame-rings .hf-tl { top: 4px; left: 4px; }
.hero-banner.frame-rings .hf-tr { top: 4px; right: 4px; animation-direction: reverse; }
.hero-banner.frame-rings .hf-bl { bottom: 4px; left: 4px; animation-direction: reverse; }
.hero-banner.frame-rings .hf-br { bottom: 4px; right: 4px; }

.hero-banner.frame-rings .hf-c::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1px solid rgba(110, 243, 255, 0.45);
}

@keyframes frameCornerRing {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 4) Dimension Glitch — RGB + scanline */
.hero-banner.frame-glitch {
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    -3px 0 0 rgba(255, 30, 77, 0.45),
    3px 0 0 rgba(110, 243, 255, 0.4),
    0 0 28px rgba(155, 89, 255, 0.25);
  animation: frameGlitchJitter 5s steps(2) infinite;
}

.hero-banner.frame-glitch .hero-frame-scan {
  display: block;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(255, 255, 255, 0.03) 3px,
    rgba(255, 255, 255, 0.03) 4px
  );
  animation: frameScanMove 3.5s linear infinite;
  mix-blend-mode: overlay;
}

.hero-banner.frame-glitch .hero-frame-corners .hf-c {
  display: block;
  width: 22px;
  height: 22px;
  background: linear-gradient(135deg, #FF1E4D, #6EF3FF);
  opacity: 0.85;
  clip-path: polygon(0 0, 100% 0, 100% 30%, 30% 30%, 30% 100%, 0 100%);
}

.hero-banner.frame-glitch .hf-tl { top: 0; left: 0; }
.hero-banner.frame-glitch .hf-tr { top: 0; right: 0; transform: scaleX(-1); }
.hero-banner.frame-glitch .hf-bl { bottom: 0; left: 0; transform: scaleY(-1); }
.hero-banner.frame-glitch .hf-br { bottom: 0; right: 0; transform: scale(-1); }

@keyframes frameGlitchJitter {
  0%, 90%, 100% { filter: none; transform: translate(0); }
  92% { filter: hue-rotate(20deg); transform: translate(-2px, 1px); }
  94% { filter: hue-rotate(-15deg); transform: translate(2px, -1px); }
  96% { filter: none; transform: translate(0); }
}

@keyframes frameScanMove {
  from { background-position: 0 0; }
  to { background-position: 0 40px; }
}

/* 5) Chrome Cut — kim loại góc cắt */
.hero-banner.frame-chrome {
  border: 1px solid rgba(200, 210, 230, 0.35);
  border-radius: 4px;
  clip-path: polygon(
    12px 0, calc(100% - 12px) 0, 100% 12px,
    100% calc(100% - 12px), calc(100% - 12px) 100%,
    12px 100%, 0 calc(100% - 12px), 0 12px
  );
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 0 30px rgba(110, 243, 255, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.hero-banner.frame-chrome .hero-frame-corners .hf-c {
  display: block;
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, #f8fafc, #94a3b8 40%, #6EF3FF);
  box-shadow: 0 0 10px rgba(110, 243, 255, 0.5);
}

.hero-banner.frame-chrome .hf-tl { top: 4px; left: 4px; clip-path: polygon(0 0, 100% 0, 0 100%); }
.hero-banner.frame-chrome .hf-tr { top: 4px; right: 4px; clip-path: polygon(0 0, 100% 0, 100% 100%); }
.hero-banner.frame-chrome .hf-bl { bottom: 4px; left: 4px; clip-path: polygon(0 0, 0 100%, 100% 100%); }
.hero-banner.frame-chrome .hf-br { bottom: 4px; right: 4px; clip-path: polygon(100% 0, 100% 100%, 0 100%); }

/* Admin picker */
.hero-frame-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
}

.hero-frame-opt {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-primary);
  border-radius: 10px;
  padding: 0.65rem;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.2s, transform 0.2s;
}

.hero-frame-opt:hover {
  border-color: rgba(110, 243, 255, 0.45);
  transform: translateY(-2px);
}

.hero-frame-opt.selected {
  border-color: var(--accent-magenta);
  box-shadow: 0 0 16px rgba(255, 30, 77, 0.3);
}

.hero-frame-opt strong {
  display: block;
  font-size: 0.82rem;
  margin: 0.4rem 0 0.15rem;
}

.hero-frame-opt small {
  display: block;
  font-size: 0.7rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

.hf-preview {
  display: block;
  height: 48px;
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}

.hf-prev-crimson {
  background: linear-gradient(135deg, #1a0510, #3a1020);
  box-shadow: inset 0 0 0 2px #FF1E4D, 0 0 12px rgba(255, 30, 77, 0.5);
}

.hf-prev-ice {
  background: linear-gradient(135deg, #0a1520, #123040);
  box-shadow: inset 0 0 0 2px #6EF3FF;
}

.hf-prev-ice::before,
.hf-prev-ice::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid #6EF3FF;
}
.hf-prev-ice::before { top: 4px; left: 4px; border-right: 0; border-bottom: 0; }
.hf-prev-ice::after { bottom: 4px; right: 4px; border-left: 0; border-top: 0; }

.hf-prev-rings {
  background: radial-gradient(circle at 20% 50%, rgba(255, 30, 77, 0.5), transparent 40%), #150a18;
  box-shadow: inset 0 0 0 1px rgba(255, 30, 77, 0.5);
}

.hf-prev-glitch {
  background: linear-gradient(90deg, #FF1E4D 0 33%, #6EF3FF 33% 66%, #a855f7 66%);
  opacity: 0.85;
}

.hf-prev-chrome {
  background: linear-gradient(135deg, #e2e8f0, #64748b 50%, #6EF3FF);
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
}

/* ===== SECTION ===== */
.section {
  margin-bottom: 2rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.section-title .icon { font-size: 1.4rem; }

.section-nav {
  display: flex;
  gap: 0.5rem;
}

.section-nav button {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-glow);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.section-nav button:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
}

/* ===== PRODUCT GRID ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 30, 77, 0.22);
  border-radius: 0;
  overflow: hidden;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
  cursor: pointer;
  position: relative;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%);
}

.product-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-magenta);
  box-shadow: 0 0 28px rgba(255, 30, 77, 0.28);
}

.product-card.premium {
  border: 1px solid transparent;
  background-clip: padding-box;
}

.product-card.premium::before {
  content: '';
  position: absolute;
  inset: -1px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-magenta), var(--crimson));
  z-index: -1;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%);
}

.product-image-wrap {
  position: relative;
  aspect-ratio: 1;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-image {
  width: 85%;
  height: 85%;
  object-fit: contain;
  transition: transform 0.3s;
}

.product-card:hover .product-image { transform: scale(1.08); }

.product-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--accent-magenta);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  z-index: 2;
}

.badge-soldout {
  background: #ff0040;
  right: 8px;
  left: auto;
}

/* ===== ACC CARD SẢNH — 2 cột, màu theo theme ===== */
.offer-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.offer-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.offer-card:hover {
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-neon);
  transform: translateY(-2px);
}

.offer-banner {
  position: relative;
  width: 100%;
  background: var(--bg-primary);
  overflow: hidden;
}

.offer-banner img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  object-position: center;
  transition: transform 0.35s ease;
}

.offer-card:hover .offer-banner img {
  transform: scale(1.02);
}

.offer-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #041018;
  background: var(--accent-cyan);
  padding: 0.28rem 0.55rem;
  border-radius: 6px;
}

.offer-tag.tag-buy {
  background: var(--accent-green);
  color: #052e16;
}

.offer-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem 1rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-glow);
  flex: 1;
}

.offer-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  line-height: 1.25;
}

.offer-meta {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.offer-meta strong {
  color: var(--accent-cyan);
}

.offer-card.is-hot {
  border-color: var(--accent-magenta);
}

.offer-card.is-soldout {
  opacity: 0.72;
  filter: grayscale(0.25);
}

.offer-card.is-soldout .offer-tag {
  background: var(--accent-magenta);
  color: #fff;
}

/* Nút Mua ngay / Trả giá — theo theme, không hiện giá */
.lobby-buy-btn {
  appearance: none;
  width: 100%;
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.78rem 1rem;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #041018;
  background: var(--btn-success);
  box-shadow: var(--shadow-neon);
  transition: transform 0.2s, filter 0.2s;
}

.lobby-buy-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.lobby-buy-btn.lobby-buy-offer {
  color: var(--text-primary);
  background: var(--btn-primary);
}

.lobby-buy-btn.is-disabled,
.lobby-buy-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  filter: grayscale(0.4);
  box-shadow: none;
  background: var(--bg-card);
  color: var(--text-secondary);
}

.lobby-buy-icon { font-size: 1rem; line-height: 1; }
.lobby-buy-label { font-size: 0.88rem; }
.lobby-buy-arrow { font-size: 1rem; opacity: 0.85; }

.section-desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin: -0.35rem 0 1rem;
  line-height: 1.45;
}

.empty-grid-hint {
  color: var(--text-secondary);
  font-size: 0.85rem;
  padding: 1rem 0;
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .offer-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }

  .offer-body {
    padding: 0.55rem 0.55rem 0.7rem;
    gap: 0.5rem;
  }

  .offer-title {
    font-size: 0.82rem;
  }

  .offer-meta {
    font-size: 0.68rem;
    margin-bottom: 0.25rem;
  }

  .lobby-buy-btn {
    padding: 0.5rem 0.4rem;
    gap: 0.25rem;
    border-radius: 8px;
  }

  .lobby-buy-label { font-size: 0.72rem; }
  .lobby-buy-icon,
  .lobby-buy-arrow { font-size: 0.85rem; }
}

.product-detail-btn {
  display: none;
}

.product-card .product-info { cursor: pointer; }
.product-card .product-image-wrap { cursor: pointer; }

.product-price-btn {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--btn-success);
  border: none;
  border-radius: 50px;
  padding: 0.35rem 1rem;
  color: #000;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
  transition: transform 0.2s;
}

.product-price-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.product-price-btn.yellow { background: var(--btn-warning); }

.product-price-btn:hover { transform: translateX(-50%) scale(1.05); }

.product-info {
  padding: 0.75rem;
}

.product-meta {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.product-name {
  font-size: 0.9rem;
  font-weight: 700;
}

.product-rank {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  margin-top: 0.35rem;
  font-weight: 600;
}

.rank-bronze { background: #cd7f32; color: #fff; }
.rank-silver { background: #c0c0c0; color: #000; }
.rank-gold { background: #ffd700; color: #000; }
.rank-diamond { background: #b9f2ff; color: #004466; }
.rank-conqueror { background: linear-gradient(135deg, #ff0040, #ffd700); color: #fff; }

/* ===== HERO SHOWCASE ===== */
.hero-showcase {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
}

.hero-item {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  overflow: hidden;
  text-align: center;
  transition: all 0.3s;
  cursor: pointer;
}

.hero-item:hover {
  border-color: var(--accent-cyan);
  transform: scale(1.05);
  box-shadow: var(--shadow-neon);
}

.hero-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.hero-item-name {
  padding: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ===== FLIP CARD GAME ===== */
.flip-game-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius);
  padding: 1rem 1.1rem 1.25rem;
  overflow: hidden;
}

.flip-game-rules {
  white-space: pre-wrap;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.55;
  margin-bottom: 0.65rem;
}

.flip-game-cost {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-yellow);
  margin-bottom: 1rem;
}

.flip-card-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.55rem;
  perspective: 1200px;
}

/* Mobile / tablet: 6 cột → 3 hàng (6+6+4) */
.flip-card-grid.is-mobile-rows {
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 0.35rem !important;
  min-width: 0 !important;
  width: 100% !important;
}

@media (max-width: 1024px) {
  .flip-card-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    gap: 0.35rem !important;
    min-width: 0 !important;
    width: 100% !important;
  }
}

.flip-card {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  perspective: 900px;
  aspect-ratio: 2 / 3;
  width: 100%;
  font-family: inherit;
  animation: flipCardFloat 3.2s ease-in-out infinite;
  animation-delay: var(--flip-delay, 0s);
  transition: transform 0.25s ease, filter 0.25s ease;
  will-change: transform;
}

.flip-card:nth-child(even) {
  animation-duration: 3.6s;
}

.flip-card:disabled {
  cursor: wait;
  pointer-events: none;
}

.flip-card.flipped {
  cursor: default;
  animation: none;
}

.flip-card:hover:not(.flipped):not(:disabled) {
  transform: translateY(-8px) scale(1.06);
  z-index: 2;
  filter: brightness(1.08);
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0.2, 0.2, 1);
}

.flip-card.flipped .flip-card-inner,
.flip-card.flipping .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card.reveal-out .flip-card-inner {
  transform: rotateY(0deg);
  transition-duration: 0.4s;
}

.flip-card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 10px;
  overflow: hidden;
  box-shadow:
    0 0 14px rgba(255, 45, 149, 0.4),
    0 6px 16px rgba(0, 0, 0, 0.35);
  transition: box-shadow 0.25s ease;
}

.flip-card-back {
  position: relative;
}

.flip-card-back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.flip-card-shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    115deg,
    transparent 35%,
    rgba(255, 255, 255, 0.28) 48%,
    transparent 62%
  );
  transform: translateX(-120%);
  animation: flipShine 4s ease-in-out infinite;
  animation-delay: var(--flip-delay, 0s);
}

.flip-card-front {
  transform: rotateY(180deg);
  background: linear-gradient(160deg, #2a0a40 0%, #5a1048 45%, #1a0530 100%);
  border: 2px solid #f0c14b;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
}

.flip-card-result {
  color: #ffe566;
  font-weight: 800;
  font-size: clamp(0.45rem, 0.85vw, 0.72rem);
  text-align: center;
  line-height: 1.3;
  text-shadow: 0 0 10px rgba(255, 200, 0, 0.45);
}

.flip-card:hover:not(.flipped):not(:disabled) .flip-card-face {
  box-shadow:
    0 0 22px rgba(0, 212, 255, 0.55),
    0 8px 20px rgba(0, 0, 0, 0.4);
}

.flip-card.reveal-win {
  z-index: 3;
  animation: flipRevealPulse 0.7s ease;
}

.flip-card.reveal-win .flip-card-front {
  box-shadow:
    0 0 28px rgba(255, 215, 0, 0.75),
    0 0 48px rgba(255, 45, 149, 0.45);
}

.flip-card-grid.is-shuffling .flip-card {
  animation: none;
  pointer-events: none;
}

.flip-card.is-shuffle-fly {
  animation: flipShuffleFly 0.5s ease forwards !important;
  animation-delay: var(--flip-delay, 0s) !important;
}

.flip-card.is-shuffle-land {
  animation: flipShuffleLand 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2) forwards !important;
  animation-delay: var(--flip-delay, 0s) !important;
}

@keyframes flipCardFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes flipShine {
  0%, 70% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}

@keyframes flipRevealPulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

@keyframes flipShuffleFly {
  0% { transform: translate(0, 0) rotate(0) scale(1); opacity: 1; }
  100% {
    transform: translate(var(--sx, 20px), var(--sy, -10px)) rotate(var(--srot, 12deg)) scale(0.88);
    opacity: 0.55;
  }
}

@keyframes flipShuffleLand {
  0% {
    transform: translate(var(--sx, 20px), var(--sy, -10px)) rotate(var(--srot, 12deg)) scale(0.88);
    opacity: 0.55;
  }
  100% { transform: translate(0, 0) rotate(0) scale(1); opacity: 1; }
}

@media (max-width: 900px) {
  .flip-card-result {
    font-size: clamp(0.38rem, 1.1vw, 0.58rem);
  }
}

/* Mobile: vừa khung, không cuộn ngang */
@media (max-width: 768px) {
  .flip-game-wrap {
    overflow: hidden;
    padding: 0.75rem;
  }

  .flip-card {
    aspect-ratio: 2 / 3;
  }

  .flip-card:hover:not(.flipped):not(:disabled) {
    transform: none;
    filter: none;
  }

  .flip-game-rules {
    font-size: 0.78rem;
    max-height: 4.5em;
    overflow: hidden;
  }
}

/* ===== SHOP BOT NPC (chỉ trên thanh header) ===== */
.shop-bot {
  position: absolute;
  left: 0;
  top: 50%;
  z-index: 120;
  width: 110px;
  margin-top: -48px;
  pointer-events: none;
  will-change: transform;
  transition: none;
}

.shop-bot[hidden] { display: none !important; }

.shop-bot.has-sprite .shop-bot-name { display: none; }

.shop-bot-figure {
  pointer-events: auto;
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  font-family: inherit;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45));
}

.shop-bot.facing-left .shop-bot-figure {
  transform: scaleX(-1);
}

.shop-bot.facing-left .shop-bot-name {
  transform: scaleX(-1);
}

.shop-bot-avatar {
  width: 96px;
  height: 96px;
  object-fit: contain;
  border-radius: 0;
  border: none;
  background: transparent;
  animation: shopBotBob 0.55s ease-in-out infinite;
}

.shop-bot-default {
  width: 80px;
  height: 96px;
  position: relative;
  animation: shopBotBob 0.55s ease-in-out infinite;
}

.shop-bot-head {
  width: 42px;
  height: 36px;
  margin: 0 auto;
  border-radius: 12px 12px 10px 10px;
  background: linear-gradient(160deg, #5ee7ff 0%, #3b82f6 55%, #7c3aed 100%);
  border: 2px solid rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 0 16px rgba(0, 212, 255, 0.45);
  position: relative;
}

.shop-bot-head::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  width: 4px;
  height: 8px;
  background: #94a3b8;
  transform: translateX(-50%);
  border-radius: 2px;
}

.shop-bot-head::after {
  content: '';
  position: absolute;
  top: -12px;
  left: 50%;
  width: 10px;
  height: 10px;
  background: #22d3ee;
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 10px #22d3ee;
}

.shop-bot-eye {
  width: 8px;
  height: 10px;
  background: #0f172a;
  border-radius: 3px;
  animation: shopBotBlink 3.2s infinite;
}

.shop-bot-torso {
  width: 36px;
  height: 28px;
  margin: 2px auto 0;
  border-radius: 8px;
  background: linear-gradient(180deg, #334155, #1e293b);
  border: 1px solid rgba(148, 163, 184, 0.4);
  position: relative;
}

.shop-bot-torso::after {
  content: '';
  position: absolute;
  inset: 7px 10px;
  border-radius: 4px;
  background: linear-gradient(90deg, #22d3ee, #a78bfa);
  opacity: 0.85;
  animation: shopBotCore 1.4s ease-in-out infinite;
}

.shop-bot-feet {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 2px;
}

.shop-bot-feet span {
  width: 12px;
  height: 10px;
  border-radius: 3px;
  background: #64748b;
  display: block;
}

.shop-bot.is-walking .shop-bot-feet span:first-child {
  animation: shopBotStep 0.35s ease-in-out infinite;
}

.shop-bot.is-walking .shop-bot-feet span:last-child {
  animation: shopBotStep 0.35s ease-in-out infinite reverse;
}

.shop-bot-name {
  font-size: 0.68rem;
  font-weight: 800;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
  white-space: nowrap;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shop-bot-bubble { display: none !important; }

@keyframes shopBotBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes shopBotBlink {
  0%, 92%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(0.1); }
}

@keyframes shopBotCore {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

@keyframes shopBotStep {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@media (max-width: 768px) {
  .shop-bot { width: 72px; margin-top: -28px; z-index: 90; }
  .shop-bot-avatar { width: 64px; height: 64px; }
  .shop-bot-default { width: 52px; height: 64px; }
  .shop-bot-name { font-size: 0.58rem; }
}

/* ===== SIDEBAR ===== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar-panel {
  background: var(--bg-card);
  border: 1px solid rgba(255, 30, 77, 0.22);
  border-radius: var(--radius);
  overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
}

.sidebar-header {
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-header h3 {
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.online-count {
  font-size: 0.75rem;
  color: var(--accent-green);
  font-weight: 600;
}

.lobby-tag {
  background: var(--accent-yellow);
  color: #000;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.lobby-panel {
  display: flex;
  flex-direction: column;
  min-height: 320px;
}

.lobby-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.lobby-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.55rem 0.4rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.lobby-tab.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.06);
}

.lobby-tab-panel {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.lobby-tab-panel.active {
  display: flex;
}

.lobby-chat-messages {
  flex: 1;
  min-height: 180px;
  max-height: 280px;
  overflow-y: auto;
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  background: rgba(0, 0, 0, 0.2);
}

.lobby-chat-bubble {
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  max-width: 95%;
}

.lobby-chat-bubble.me {
  align-self: flex-end;
  background: rgba(0, 212, 255, 0.12);
  border-color: rgba(0, 212, 255, 0.3);
}

.lobby-chat-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.65rem;
  color: var(--text-secondary);
  margin-bottom: 0.15rem;
}

.lobby-chat-meta strong {
  color: var(--accent-cyan);
}

.lobby-chat-text {
  font-size: 0.8rem;
  line-height: 1.4;
  word-break: break-word;
  white-space: pre-wrap;
}

.lobby-chat-form {
  display: flex;
  gap: 0.4rem;
  padding: 0.55rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.lobby-chat-form .form-control {
  flex: 1;
  padding: 0.45rem 0.6rem;
  font-size: 0.8rem;
}

.lobby-chat-form .btn {
  padding: 0.45rem 0.7rem;
  font-size: 0.78rem;
}

/* Top Nạp */
.top-nap-list { padding: 0.5rem; }

.top-nap-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem;
  border-radius: 8px;
  transition: background 0.2s;
}

.top-nap-item:hover { background: rgba(255, 255, 255, 0.05); }

.top-rank {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
}

.top-rank.r1 { background: #ffd700; color: #000; }
.top-rank.r2 { background: #c0c0c0; color: #000; }
.top-rank.r3 { background: #cd7f32; color: #fff; }
.top-rank.r4, .top-rank.r5 { background: rgba(255,255,255,0.1); color: var(--text-secondary); }

.top-nap-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.top-nap-info { flex: 1; min-width: 0; }

.top-nap-name {
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-nap-amount {
  font-size: 0.72rem;
  color: var(--accent-yellow);
  font-weight: 700;
}

/* Activity Feed */
.activity-feed {
  max-height: 320px;
  overflow-y: auto;
  padding: 0.5rem;
}

.activity-feed::-webkit-scrollbar { width: 4px; }
.activity-feed::-webkit-scrollbar-thumb { background: var(--accent-cyan); border-radius: 2px; }

.activity-item {
  display: flex;
  gap: 0.6rem;
  padding: 0.5rem;
  border-radius: 8px;
  transition: background 0.2s;
}

.activity-item:hover { background: rgba(255, 255, 255, 0.04); }

.activity-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--accent-purple);
}

.activity-text {
  font-size: 0.78rem;
  line-height: 1.4;
}

.activity-text .username {
  color: var(--accent-cyan);
  font-weight: 700;
}

.activity-text .action { color: var(--text-secondary); }

.activity-time {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 0.15rem;
}

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-neon);
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: none;
  color: var(--text-primary);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-close:hover { background: rgba(255, 0, 0, 0.2); border-color: #ff0040; }

.modal-body { padding: 1.5rem; }

/* ===== NẠP THẺ FORM ===== */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
}

.card-type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.card-type-btn {
  padding: 0.75rem;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-primary);
  cursor: pointer;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s;
}

.card-type-btn:hover, .card-type-btn.selected {
  border-color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.1);
}

.amount-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.amount-btn {
  padding: 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  transition: all 0.2s;
}

.amount-btn:hover, .amount-btn.selected {
  border-color: var(--accent-yellow);
  background: rgba(255, 215, 0, 0.1);
  color: var(--accent-yellow);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}

.btn-primary {
  background: var(--btn-primary);
  color: #0A0510;
  text-shadow: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 22px rgba(110, 243, 255, 0.35), 0 0 28px rgba(255, 30, 77, 0.3);
  filter: brightness(1.08);
}

.btn-success { background: var(--btn-success); color: #000; }
.btn-danger { background: linear-gradient(135deg, #ff0040, #cc0033); color: #fff; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-glow);
  color: var(--text-primary);
}

/* ===== HISTORY TABLE ===== */
.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.history-table th {
  text-align: left;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.history-table td {
  padding: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.history-table tr:hover td { background: rgba(255, 255, 255, 0.03); }

.status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 700;
}

.status-success { background: rgba(57, 255, 20, 0.15); color: var(--accent-green); }
.status-pending { background: rgba(255, 215, 0, 0.15); color: var(--accent-yellow); }
.status-failed { background: rgba(255, 0, 64, 0.15); color: #ff0040; }

/* ===== ADMIN PAGE ===== */
.admin-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-glow);
  padding: 1.5rem 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.admin-logo {
  padding: 0 1.5rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 1rem;
}

.admin-logo h2 {
  font-size: 1rem;
  background: var(--btn-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.admin-logo p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.admin-nav a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
  border-left: 3px solid transparent;
  flex-wrap: wrap;
}

.admin-nav a:hover, .admin-nav a.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  border-left-color: var(--accent-cyan);
}

.nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff0040;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-notif-wrap {
  position: relative;
}

.admin-notif-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-primary);
}

.admin-notif-btn:hover {
  border-color: var(--accent-cyan);
}

.admin-notif-count {
  position: absolute;
  top: -4px;
  right: -4px;
  margin-left: 0;
}

.admin-notif-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 360px;
  max-width: 92vw;
  background: var(--bg-secondary, #12182a);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  z-index: 5000;
  overflow: hidden;
}

.admin-notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-notif-list {
  max-height: 360px;
  overflow-y: auto;
}

.admin-notif-item {
  display: flex;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  padding: 0.75rem 0.9rem;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  font-family: inherit;
}

.admin-notif-item:hover {
  background: rgba(0, 212, 255, 0.06);
}

.admin-notif-item.unread {
  background: rgba(0, 212, 255, 0.08);
}

.admin-notif-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.admin-notif-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.admin-notif-body strong {
  font-size: 0.82rem;
}

.admin-notif-body span {
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-notif-body em {
  font-style: normal;
  font-size: 0.68rem;
  color: var(--text-secondary);
  opacity: 0.8;
}

.admin-main {
  padding: 2rem;
  overflow-y: auto;
}

.admin-page-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.admin-page-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.admin-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.admin-card h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.admin-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.card-api-test-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
}

.card-api-test-hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.card-api-test-result {
  margin-top: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 280px;
  overflow: auto;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
}

.card-api-test-result.ok {
  border-color: rgba(57, 255, 20, 0.45);
  color: #b8f5b0;
}

.card-api-test-result.err {
  border-color: rgba(255, 80, 80, 0.45);
  color: #ffb4b4;
}

.image-upload-box {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.image-upload-box:hover {
  border-color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.05);
}

.image-upload-box img.preview {
  max-width: 100%;
  max-height: 200px;
  object-fit: contain;
  margin-bottom: 0.5rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.image-upload-lg img.preview {
  max-height: 160px;
}

.image-upload-box input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.upload-field-label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.image-upload-box .upload-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.toggle-switch {
  position: relative;
  width: 50px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 26px;
  cursor: pointer;
  transition: 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider { background: var(--accent-cyan); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(24px); }

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.setting-row:last-child { border-bottom: none; }

.setting-info h4 { font-size: 0.9rem; margin-bottom: 0.15rem; }
.setting-info p { font-size: 0.78rem; color: var(--text-secondary); }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.admin-table th, .admin-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-table th {
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-edit { background: rgba(0, 212, 255, 0.15); color: var(--accent-cyan); }
.btn-delete { background: rgba(255, 0, 64, 0.15); color: #ff0040; }
.btn-sm.btn-success {
  background: rgba(57, 255, 20, 0.18);
  color: #39ff14;
}
.btn-edit:hover, .btn-delete:hover, .btn-sm.btn-success:hover { filter: brightness(1.2); }

.admin-tab-content { display: none; }
.admin-tab-content.active { display: block; }

.color-theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.color-theme-card {
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 1rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.color-theme-card:hover, .color-theme-card.selected {
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-neon);
}

.color-theme-preview {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.color-theme-preview span {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.color-theme-card p {
  font-size: 0.8rem;
  font-weight: 600;
}

.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-secondary);
  border: 1px solid var(--accent-green);
  color: var(--accent-green);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 10000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s;
  box-shadow: 0 0 20px rgba(57, 255, 20, 0.2);
}

.toast.show { transform: translateY(0); opacity: 1; }

/* ===== BANK NOTE AUTO ID ===== */
.bank-note-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.bank-note-row .form-control {
  flex: 1;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--accent-cyan);
}

.bank-note-hint {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.4rem;
}

.bank-transfer-code {
  background: rgba(0, 212, 255, 0.12);
  color: var(--accent-cyan);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-weight: 700;
}

.fee-source-hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.fee-source-hint a { color: var(--accent-cyan); }

.fee-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.fee-tab {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  cursor: pointer;
}

.fee-tab.active {
  color: #fff;
  border-color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.2);
}

.fee-table-wrap {
  overflow-x: auto;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.fee-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.fee-table th,
.fee-table td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
  white-space: nowrap;
}

.fee-table th {
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-secondary);
  font-weight: 700;
}

.fee-recv { color: var(--accent-green); font-weight: 700; }

.gach-receive-box {
  padding: 0.75rem 1rem;
  margin-bottom: 0.85rem;
  border-radius: 8px;
  background: rgba(57, 255, 20, 0.08);
  border: 1px solid rgba(57, 255, 20, 0.25);
  font-size: 0.9rem;
}

.gach-receive-box strong {
  color: var(--accent-green);
  font-size: 1.15rem;
  margin-right: 0.5rem;
}

.gach-receive-box span {
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.withdraw-balance {
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.withdraw-balance strong {
  color: var(--accent-cyan);
  font-size: 1.2rem;
}

.balance-pill.qh-pill {
  border-color: rgba(255, 215, 0, 0.35);
  color: #ffd700;
}

.balance-pill.qh-pill .add-btn { display: none; }

/* ===== SUPPORT FAB + CHAT ===== */
.support-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--accent-cyan);
  background: linear-gradient(135deg, rgba(0, 40, 80, 0.95), rgba(10, 20, 50, 0.98));
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 9000;
  box-shadow: 0 8px 28px rgba(0, 212, 255, 0.25);
  transition: transform 0.2s, box-shadow 0.2s;
}

.support-fab:hover {
  transform: scale(1.06);
  box-shadow: 0 10px 32px rgba(0, 212, 255, 0.4);
}

.support-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff0040;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-primary);
}

.support-modal {
  max-width: 440px;
  width: 94%;
}

.support-modal-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 70vh;
}

.support-chat-messages {
  flex: 1;
  min-height: 220px;
  max-height: 360px;
  overflow-y: auto;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.support-empty {
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-align: center;
  margin: auto;
  padding: 1.5rem 0.5rem;
}

.support-bubble {
  max-width: 85%;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.45;
}

.support-bubble.me {
  align-self: flex-end;
  background: rgba(0, 212, 255, 0.15);
  border: 1px solid rgba(0, 212, 255, 0.35);
}

.support-bubble.them {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.support-bubble-meta {
  font-size: 0.68rem;
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
}

.support-bubble-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.support-chat-form {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.support-chat-form .form-control {
  flex: 1;
  resize: none;
}

.support-admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1rem;
  min-height: 420px;
}

.support-admin-list {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  overflow-y: auto;
  max-height: 480px;
  background: rgba(0, 0, 0, 0.2);
}

.support-admin-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  width: 100%;
  text-align: left;
  padding: 0.75rem 0.85rem;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  font-family: inherit;
}

.support-admin-item:hover,
.support-admin-item.active {
  background: rgba(0, 212, 255, 0.08);
}

.support-admin-item-user {
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.support-admin-item-user em {
  font-style: normal;
  background: #ff0040;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
}

.support-admin-item-preview {
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.support-admin-thread {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  background: rgba(0, 0, 0, 0.15);
  min-height: 420px;
}

.support-admin-thread-head {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent-cyan);
}

.support-admin-thread .support-chat-messages {
  flex: 1;
  max-height: none;
  min-height: 280px;
}

@media (max-width: 768px) {
  .support-admin-layout {
    grid-template-columns: 1fr;
  }
  .support-admin-list {
    max-height: 160px;
  }
  .bank-note-row {
    flex-direction: column;
  }
}

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  z-index: 1;
}

.revenue-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 0.5rem;
}

.revenue-stat {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
}

.revenue-stat-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.revenue-stat-value {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent-yellow);
}

.revenue-stat-sub {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.member-money-row {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-wrap: wrap;
}

.member-money-row input {
  width: 110px;
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
}

@media (max-width: 768px) {
  .revenue-stat-grid { grid-template-columns: 1fr; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .main-wrapper { grid-template-columns: 1fr; }
  .sidebar { display: grid; grid-template-columns: 1fr 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; height: auto; }
}

@media (max-width: 1024px) and (orientation: landscape) {
  .main-wrapper {
    grid-template-columns: 1fr 260px;
    padding: 0.75rem 1rem 1.5rem;
    gap: 0.75rem;
  }
  .hero-banner { min-height: 220px; margin-bottom: 0.75rem; }
  .hero-banner-content { padding: 1.25rem 1rem; }
  .hero-rings { opacity: 0.35; }
  .hero-character { width: 110px; height: 110px; }
  .hero-countdown { font-size: 1.6rem; }
  .hero-title { font-size: 1rem; }
  .sidebar { display: flex; flex-direction: column; gap: 0.75rem; }
  .lobby-chat-messages { max-height: 160px; min-height: 120px; }
  .product-grid,
  .offer-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
  .support-fab { width: 46px; height: 46px; right: 0.75rem; bottom: 0.75rem; font-size: 1.2rem; }
}

@media (max-width: 768px) {
  html { font-size: 15px; }

  .header {
    padding: 0.55rem 0.6rem 0.65rem;
    overflow: visible;
  }

  .header-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "logo right"
      "nav nav";
    align-items: center;
    gap: 0.5rem 0.55rem;
    justify-content: stretch;
    min-height: 0;
    max-width: 100%;
    width: 100%;
    overflow: visible;
  }

  .header-inner::after {
    bottom: -0.55rem;
  }

  .logo {
    grid-area: logo;
    gap: 0.4rem;
    min-width: 0;
    max-width: 42vw;
  }

  .logo-img {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border-width: 1.5px;
    flex-shrink: 0;
  }

  .logo-text {
    font-size: 0.88rem;
    letter-spacing: 0.45px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-right {
    grid-area: right;
    flex: 0 0 auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 0.35rem;
    min-width: 0;
    overflow: visible;
    position: relative;
  }

  .header-more-btn {
    display: inline-flex;
  }

  .header-tools {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 450;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    min-width: min(280px, calc(100vw - 1.2rem));
    max-width: calc(100vw - 1.2rem);
    padding: 0.75rem;
    border-radius: 12px;
    border: 1px solid var(--border-glow);
    background: var(--bg-secondary);
    box-shadow: var(--shadow-neon);
  }

  .header-tools.is-open {
    display: flex;
  }

  .header-tools .theme-picker {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .header-tools .theme-picker::after {
    content: 'Đổi giao diện';
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
  }

  .header-tools .theme-dropdown {
    left: 0;
    right: auto;
    min-width: 100%;
  }

  #authArea {
    min-width: 0;
    max-width: 100%;
    overflow: visible;
    width: 100%;
  }

  .header-user-block,
  .header-user-block--more {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
    min-width: 0;
    max-width: 100%;
  }

  .header-more-user {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .header-more-username {
    font-weight: 800;
    font-size: 0.95rem;
  }

  .header-more-balances {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
  }

  .header-more-balances .balance-pill {
    width: 100%;
    justify-content: flex-start;
    padding: 0.45rem 0.55rem;
    font-size: 0.88rem;
    border-radius: 10px;
    max-width: none;
    flex: none;
  }

  .header-more-balances .balance-pill span[data-balance],
  .header-more-balances .balance-pill.qh-pill span[data-balance] {
    max-width: none;
    overflow: visible;
    text-overflow: unset;
  }

  .header-more-links {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding-top: 0.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .header-more-links a,
  .header-more-links .logout-link {
    display: block;
    width: 100%;
    padding: 0.55rem 0.65rem;
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 700;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
  }

  .header-more-links a:hover,
  .header-more-links .logout-link:hover {
    background: rgba(255, 255, 255, 0.08);
  }

  .header-more-links .admin-link {
    color: var(--accent-yellow);
  }

  .header-more-links .logout-link {
    color: #ff6b6b;
  }

  .theme-btn {
    width: 34px;
    height: 34px;
    font-size: 0.95rem;
    border-width: 1px;
    flex-shrink: 0;
  }

  .admin-entry-btn {
    display: none;
  }

  .nav {
    grid-area: nav;
    order: unset;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    gap: 0.3rem;
    padding: 0.2rem 0.15rem 0.4rem;
    margin: 0 -0.1rem;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar { display: none; }

  .nav a {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 0.82rem;
    padding: 0.42rem 0.7rem;
    letter-spacing: 0.45px;
    clip-path: none;
    border-radius: 8px;
    line-height: 1.25;
  }

  .nav a.active::after {
    bottom: 3px;
    left: 14%;
    width: 72%;
  }

  .hero-character { width: 72px; height: 72px; }
  .hero-countdown { font-size: 1.35rem; }
  .hero-title { font-size: 0.88rem; }
  .hero-banner { min-height: 150px; margin-bottom: 0.75rem; }
  .hero-banner-content { padding: 0.85rem 0.7rem; }

  .main-wrapper {
    padding: 0.55rem 0.55rem 1rem;
    gap: 0.65rem;
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
  }

  .sidebar { grid-template-columns: 1fr; }
  .admin-grid-2, .admin-grid-3 { grid-template-columns: 1fr; }
  .product-grid,
  .offer-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }
  .section-title { font-size: 0.95rem; }
  .footer { padding: 1rem 0.6rem; font-size: 0.72rem; text-align: center; }
  .acc-detail-modal { max-width: 96vw; }
  .acc-detail-image { max-height: min(42vh, 280px); }
  .support-fab { width: 44px; height: 44px; right: 0.6rem; bottom: 0.6rem; }
}

/* Màn rất hẹp: ẩn chữ logo, chỉ còn icon */
@media (max-width: 400px) {
  .logo-text { display: none; }
  .nav a { font-size: 0.78rem; padding: 0.4rem 0.62rem; }
}

/* ===== AUTH PAGE ===== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

.auth-box {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-neon);
}

.auth-logo {
  display: block;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 800;
  text-decoration: none;
  margin-bottom: 1.5rem;
  background: var(--btn-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.auth-tab-btn {
  flex: 1;
  padding: 0.6rem;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.auth-tab-btn.active {
  background: var(--btn-primary);
  color: #fff;
  border-color: transparent;
}

.auth-panel { display: none; }
.auth-panel.active { display: block; }

.auth-hint {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 1rem;
}

.auth-hint code {
  background: rgba(0,212,255,0.1);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: var(--accent-cyan);
}

.auth-back {
  display: block;
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
}

.auth-back:hover { color: var(--accent-cyan); }

/* ===== ADMIN SHORTCUT (header) ===== */
.admin-entry-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  flex-shrink: 0;
  padding: 0.35rem 0.7rem;
  border-radius: 50px;
  border: 1px solid rgba(255, 215, 0, 0.45);
  background: rgba(255, 215, 0, 0.12);
  color: var(--accent-yellow);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  white-space: nowrap;
  line-height: 1;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.admin-entry-btn:hover {
  background: rgba(255, 215, 0, 0.22);
  border-color: var(--accent-yellow);
  transform: translateY(-1px);
}

.admin-entry-btn span { display: inline; }

/* ===== HEADER USER DROPDOWN ===== */
.user-dropdown {
  position: relative;
}

.user-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: 50px;
  padding: 0.3rem 0.75rem 0.3rem 0.35rem;
  color: var(--text-primary);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s;
}

.user-dropdown-btn:hover {
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-neon);
}

.user-avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--btn-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: #fff;
}

.user-caret {
  font-size: 0.65rem;
  color: var(--text-secondary);
}

.user-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-sm);
  padding: 0.4rem;
  box-shadow: var(--shadow-neon);
  z-index: 300;
}

.user-dropdown-menu.open { display: block; }

.user-dropdown-menu a[hidden] { display: none !important; }

.user-dropdown-menu a,
.user-dropdown-menu .logout-link {
  display: block;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}

.user-dropdown-menu a:hover,
.user-dropdown-menu .logout-link:hover {
  background: rgba(255, 255, 255, 0.08);
}

.user-dropdown-menu .admin-link {
  color: var(--accent-yellow);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 0.25rem;
  padding-top: 0.65rem;
}

.user-dropdown-menu .logout-link {
  color: #ff6b6b;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 0.25rem;
  padding-top: 0.65rem;
}

/* ===== ACC DETAIL MODAL ===== */
.acc-detail-modal {
  max-width: min(980px, 96vw);
  width: 100%;
  padding: 0;
  overflow: hidden;
  position: relative;
}

.acc-detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
}

.acc-detail-body {
  display: flex;
  flex-direction: column;
}

.acc-detail-image-wrap {
  position: relative;
  background: rgba(0, 0, 0, 0.45);
  padding: 0;
  text-align: center;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.acc-detail-image {
  width: 100%;
  max-height: min(62vh, 560px);
  object-fit: contain;
  display: block;
  border-radius: 0;
}

@media (min-width: 820px) {
  .acc-detail-modal {
    max-height: 92vh;
  }

  .acc-detail-body {
    flex-direction: row;
    align-items: stretch;
    max-height: 92vh;
  }

  .acc-detail-image-wrap {
    flex: 1 1 62%;
    max-width: 62%;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
  }

  .acc-detail-image {
    max-height: 92vh;
    height: 100%;
    width: 100%;
    object-fit: contain;
  }

  .acc-detail-info {
    flex: 0 0 38%;
    max-width: 38%;
    overflow-y: auto;
    max-height: 92vh;
  }
}

.acc-detail-index {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.6);
  padding: 0.25rem 0.6rem;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.acc-detail-info {
  padding: 1.25rem 1.5rem 1.5rem;
}

.acc-detail-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0.5rem 0 0.75rem;
}

.acc-detail-content {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-cyan);
}

.acc-detail-price-box {
  margin-bottom: 1rem;
}

.acc-detail-price {
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--accent-yellow);
  display: block;
}

.acc-detail-old-price {
  font-size: 0.95rem;
  color: var(--text-secondary);
  text-decoration: line-through;
  margin-right: 0.5rem;
  display: none;
}

.acc-detail-save {
  display: none;
  font-size: 0.78rem;
  color: var(--accent-green);
  font-weight: 600;
  margin-top: 0.25rem;
}

.acc-detail-price-hint {
  font-size: 0.78rem;
  color: var(--accent-cyan);
  margin: -0.5rem 0 0.85rem;
}

.acc-detail-code-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.45rem 0 0.65rem;
  flex-wrap: wrap;
}

.acc-code-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.acc-detail-code,
.acc-code-cell {
  font-family: var(--font-display), ui-monospace, monospace;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent-cyan);
  background: rgba(110, 243, 255, 0.1);
  border: 1px solid rgba(110, 243, 255, 0.35);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
}

.acc-offer-panel .form-group {
  margin-bottom: 0.75rem;
}

.acc-offer-panel label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.acc-offer-hint {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin: 0 0 0.85rem;
  line-height: 1.4;
}

.acc-detail-discount {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.acc-detail-discount .form-control {
  flex: 1;
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
}

.acc-detail-discount .btn {
  width: auto;
  padding: 0.6rem 1rem;
  font-size: 0.82rem;
  white-space: nowrap;
}

.discount-msg {
  font-size: 0.78rem;
  min-height: 1.2rem;
  margin-bottom: 0.5rem;
}

.discount-msg.success { color: var(--accent-green); }
.discount-msg.error { color: #ff6b6b; }

.discount-hint {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.discount-hint code {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  color: var(--accent-cyan);
  font-size: 0.7rem;
}

.acc-detail-balance {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.acc-detail-balance strong {
  color: var(--accent-green);
}

.acc-buy-btn {
  font-size: 1rem;
  padding: 0.9rem;
  margin-bottom: 0.75rem;
}

.acc-detail-nav {
  display: none;
  gap: 0.5rem;
}

.acc-detail-nav .btn {
  flex: 1;
  font-size: 0.78rem;
  padding: 0.5rem;
}

.acc-detail-nav .btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-header {
  width: auto !important;
  padding: 0.5rem 1rem !important;
  font-size: 0.8rem !important;
}

/* ===== NAP TABS ===== */
.nap-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.nap-tab-btn {
  flex: 1;
  padding: 0.6rem;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
}

.nap-tab-btn.active {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: rgba(0,212,255,0.08);
}

.nap-tab-panel { display: none; }
.nap-tab-panel.active { display: block; }

.modal-lg { max-width: 560px; }

.bank-qr-wrap {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
  padding: 1rem;
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius-sm);
}

.bank-qr-img {
  width: 140px;
  height: 140px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--border-glow);
}

.bank-info {
  flex: 1;
  font-size: 0.85rem;
  line-height: 1.7;
}

.bank-info p { margin-bottom: 0.25rem; }

/* ===== ACC INFO / HISTORY ===== */
.acc-info code {
  display: inline-block;
  background: rgba(0,0,0,0.3);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  color: var(--accent-green);
  margin-bottom: 0.25rem;
}

.btn-copy {
  margin-top: 0.35rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border-glow);
  border-radius: 4px;
  background: rgba(0,212,255,0.1);
  color: var(--accent-cyan);
  font-size: 0.72rem;
  cursor: pointer;
  font-family: inherit;
}

.btn-copy:hover { background: rgba(0,212,255,0.2); }

.stock-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  background: rgba(57,255,20,0.15);
  color: var(--accent-green);
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 700;
}

/* ===== ADMIN STOCK ===== */
.stock-hint {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.stock-hint code {
  background: rgba(255,255,255,0.08);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  color: var(--accent-cyan);
  font-size: 0.78rem;
}

.stock-bulk-box {
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.stock-bulk-box h4 {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.stock-bulk-img-box {
  min-height: 90px;
  margin-bottom: 0.75rem;
}

.stock-bulk-img-count {
  font-size: 0.8rem;
  color: var(--accent-green);
  margin-top: 0.35rem;
}

.stock-bulk-img-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.stock-bulk-thumb {
  width: 72px;
  text-align: center;
}

.stock-bulk-thumb img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border-glow);
  display: block;
  margin: 0 auto 0.25rem;
}

.stock-bulk-thumb span {
  display: block;
  font-size: 0.65rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-overview {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stock-stat-total {
  text-align: center;
  padding: 1rem;
  background: rgba(0,212,255,0.08);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glow);
}

.stock-stat-num {
  display: block;
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent-cyan);
}

.stock-stat-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.stock-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.5rem;
}

.stock-stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  font-family: inherit;
  color: var(--text-primary);
}

.stock-stat-item:hover {
  border-color: var(--accent-cyan);
  background: rgba(0,212,255,0.06);
}

.stock-stat-item-name {
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stock-stat-item-count {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent-green);
}

.stock-stat-item-count.empty {
  color: var(--text-secondary);
}

.stock-img-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-width: 140px;
}

.stock-thumb {
  width: 140px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border-glow);
  background: rgba(0, 0, 0, 0.35);
  cursor: zoom-in;
}

.stock-img-btn {
  font-size: 0.7rem !important;
  padding: 0.2rem 0.45rem !important;
}

.stock-goto-btn {
  font-size: 0.65rem !important;
  padding: 0.15rem 0.4rem !important;
}

.stock-table textarea.form-control {
  resize: vertical;
  min-height: 48px;
}
