/* ==========================================================================
   HUYỀN THOẠI TINH GIỚI - AAA DRAGON BALL CELESTIAL PORTAL
   Engineered for 60fps, Zero-latency, Authentic Anime Aesthetics
   ========================================================================== */

/* Google Fonts pre-loaded in HTML <head> for 0ms render latency */

:root {
  --gold-primary: #f5c518;
  --gold-glow: #ffe066;
  --gold-dark: #b8860b;
  --gold-gradient: linear-gradient(135deg, #ffe259 0%, #ffa751 100%);
  --gold-btn-gradient: linear-gradient(180deg, #fce043 0%, #fb8c00 100%);
  --blue-primary: #00d2ff;
  --blue-btn-gradient: linear-gradient(180deg, #00b4db 0%, #0083b0 100%);
  --bg-dark: #060914;
  --glass-card: rgba(8, 14, 30, 0.88);
  --glass-border: rgba(255, 215, 0, 0.4);
  --font-heading: 'Be Vietnam Pro', 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Montserrat', 'Be Vietnam Pro', sans-serif;
  --font-tech: 'Chakra Petch', 'Montserrat', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  background-color: var(--bg-dark);
  color: #fff;
  font-family: var(--font-body);
  user-select: none;
}

/* ==========================================================================
   PORTAL MAIN WRAPPER & EXACT CLEAN 1080P WALLPAPER
   ========================================================================== */
.portal-wrapper {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: url('../images/res_bg.webp') no-repeat center top fixed;
  background-size: cover;
  overflow: hidden;
}

.portal-wrapper::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(6, 9, 20, 0.05) 0%, rgba(6, 9, 20, 0.35) 60%, rgba(4, 6, 14, 0.9) 100%),
              linear-gradient(to bottom, rgba(4, 6, 14, 0.85) 0%, transparent 16%, transparent 74%, rgba(4, 6, 14, 0.96) 100%);
  pointer-events: none;
  z-index: 1;
}

#kiCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* ==========================================================================
   HEADER NAVIGATION (TOP)
   ========================================================================== */
.portal-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 68px;
  background: rgba(6, 10, 24, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 215, 0, 0.28);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.8), 0 1px 0 rgba(255, 255, 255, 0.08) inset;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  z-index: 100;
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  cursor: pointer;
}
.portal-brand-img {
  height: 48px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.9));
  transition: transform 0.2s ease;
}
.portal-brand:hover .portal-brand-img {
  transform: scale(1.05);
}

.portal-brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--gold-primary);
  box-shadow: 0 0 15px rgba(245, 197, 24, 0.65);
  transition: transform 0.2s ease;
}

.portal-brand:hover .portal-brand-logo {
  transform: scale(1.08) rotate(5deg);
}

.portal-brand-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 1px;
  text-transform: uppercase;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.9));
}

.portal-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.portal-nav-link {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: all 0.2s ease;
  cursor: pointer;
}

.portal-nav-link:hover {
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

.portal-nav-link.active {
  background: linear-gradient(135deg, rgba(245, 197, 24, 0.35) 0%, rgba(245, 197, 24, 0.15) 100%);
  color: #fff;
  border: 1px solid rgba(255, 215, 0, 0.6);
  box-shadow: 0 0 15px rgba(245, 197, 24, 0.3);
}

.portal-auth {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-portal {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  outline: none;
  border: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-portal-outline {
  background: url('../images/res_nav_btn_blue.png') no-repeat center / 100% 100%;
  color: #fff;
  border: none;
  min-width: 120px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.82rem;
  text-shadow: 0 0 10px rgba(0, 180, 255, 0.95);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-portal-outline:hover {
  filter: brightness(1.2) drop-shadow(0 0 15px rgba(0, 200, 255, 0.9));
  transform: translateY(-2px);
}
.btn-portal-gold {
  background: url('../images/res_nav_btn_gold.png') no-repeat center / 100% 100%;
  color: #1a0800;
  border: none;
  min-width: 120px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.82rem;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-portal-gold:hover {
  filter: brightness(1.15) drop-shadow(0 0 15px rgba(255, 200, 50, 0.95));
  transform: translateY(-2px);
}

.btn-portal-gold:hover {
  box-shadow: 0 0 30px rgba(251, 140, 0, 0.9);
  transform: translateY(-2px) scale(1.02);
  color: #000;
}

.btn-portal-admin {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  color: #fff !important;
  border: 1px solid #f87171;
  font-weight: 800;
  box-shadow: 0 0 15px rgba(220, 38, 38, 0.6);
}

.btn-portal-admin:hover {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.9);
  transform: translateY(-2px);
}

/* ==========================================================================
   LEFT FLOATING DOCK (ORNATE ANCIENT SHRINE - 100% PERFECT SPACING & NATIVE FONTS)
   ========================================================================== */
.floating-left-dock {
  position: fixed;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  width: 184px;
  height: 476px;
  background: url('../images/res_dock_left.png') no-repeat center / 100% 100%;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.9));
  display: flex;
  flex-direction: column;
  padding: 0;
  border: none;
}
.dock-item {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  padding-left: 70px;
  padding-right: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.dock-pos-1 {
  top: 7.5%;
  height: 11%;
  padding-left: 80px;
}
.dock-pos-2 { top: 21.5%; height: 11%; }
.dock-pos-3 { top: 34.5%; height: 11%; }
.dock-pos-4 { top: 49.5%; height: 11%; }
.dock-pos-5 { top: 63.2%; height: 11%; }
.dock-pos-6 { top: 76.8%; height: 11%; }
.dock-item:hover .dock-text {
  color: #ffe066;
  text-shadow: 0 0 12px rgba(255, 215, 0, 1);
  transform: translateX(3px);
}
.dock-item.active .dock-text {
  color: #fce182;
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.95);
}
.dock-text {
  font-family: 'Be Vietnam Pro', 'Montserrat', sans-serif;
  font-size: 0.74rem;
  font-weight: 800;
  color: #e2e8f0;
  letter-spacing: 0.3px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

/* ==========================================================================
   RIGHT FLOATING SOCIAL BAR (MASTER ATLAS FRAME)
   ========================================================================== */
.floating-right-dock {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  width: 76px;
  height: 330px;
  background: url('../images/res_dock_right.png') no-repeat center / 100% 100%;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.9));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  padding: 26px 0;
  border: none;
}
.social-item {
  width: 60px;
  height: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: #cbd5e1;
  transition: all 0.2s ease;
}
.social-item i {
  font-size: 1.15rem;
}
.social-label {
  font-family: var(--font-tech);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #94a3b8;
  transition: color 0.2s ease;
}
.social-item:hover {
  transform: scale(1.08);
}
.social-item:hover .social-label {
  color: #ffffff;
}
.social-item.fb:hover { color: #1877f2; }
.social-item.dc:hover { color: #5865f2; }
.social-item.yt:hover { color: #ff0000; }
.social-item.zl:hover { color: #0084ff; }

/* ==========================================================================
   CENTER HERO SHOWCASE (WITH EXACT 3D LOGO & REVEALED CELESTIAL DRAGON)
   ========================================================================== */
.portal-hero-container {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end; /* KÉO TOÀN BỘ CỤM NÚT & LOGO XUỐNG SÁT KẾ BÊN HÀNG CARD DƯỚI */
  text-align: center;
  padding-top: 0;
  padding-bottom: 12px;
}
.hero-logo-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0px;
}
.hero-logo-aura {
  position: absolute;
  inset: 10%;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.45) 0%, rgba(56, 189, 248, 0.25) 50%, transparent 75%);
  filter: blur(24px);
  pointer-events: none;
  z-index: 1;
  animation: pulseAura 4s ease-in-out infinite alternate;
}
.hero-logo-img {
  max-width: 360px;
  width: 80vw;
  height: auto;
  filter: drop-shadow(0 14px 35px rgba(0, 0, 0, 0.95));
  transition: transform 0.25s ease;
  position: relative;
  z-index: 2;
}
.hero-logo-img:hover {
  transform: scale(1.025);
}

/* Elegant Dark Ribbon Tagline - Nằm ngay trên nút, sát hàng card dưới */
.hero-tagline-ribbon {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, transparent 0%, rgba(4, 7, 18, 0.78) 12%, rgba(4, 7, 18, 0.94) 50%, rgba(4, 7, 18, 0.78) 88%, transparent 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 215, 0, 0.22);
  border-bottom: 1px solid rgba(255, 215, 0, 0.22);
  padding: 4px 28px 5px;
  margin: 1px auto 6px;
  border-radius: 4px;
  max-width: 90vw;
}
.hero-tagline-title {
  font-family: 'Be Vietnam Pro', 'Montserrat', sans-serif;
  font-size: 1.12rem;
  font-weight: 900;
  letter-spacing: 3px;
  color: #f8fafc;
  text-transform: uppercase;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95), 0 0 16px rgba(56, 189, 248, 0.6);
  line-height: 1.25;
  margin: 0 0 2px 0;
}
.hero-tagline-sub {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #cbd5e1;
  text-transform: uppercase;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95);
}
.hero-tagline-sub .sep {
  color: #f5c518;
  margin: 0 8px;
  font-weight: 900;
  font-size: 0.8rem;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.8);
}

.hero-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 6px;
}
.btn-hero-download {
  width: 235px;
  height: 56px;
  background: url('../images/res_btn_download.png') no-repeat center / contain;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 8px;
  padding-right: 42px;
  font-family: 'Be Vietnam Pro', 'Montserrat', sans-serif;
  font-size: 0.88rem;
  font-weight: 900;
  color: #2b1400;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
  letter-spacing: 0.3px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.7));
}
.btn-hero-download:hover {
  filter: brightness(1.12) drop-shadow(0 0 25px rgba(255, 200, 0, 0.95)) drop-shadow(0 6px 16px rgba(0, 0, 0, 0.9));
  transform: translateY(-2px) scale(1.02);
}
.btn-hero-register {
  width: 235px;
  height: 56px;
  background: url('../images/res_btn_register.png') no-repeat center / contain;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 8px;
  padding-right: 40px;
  font-family: 'Be Vietnam Pro', 'Montserrat', sans-serif;
  font-size: 0.88rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 0 12px rgba(0, 200, 255, 0.95), 0 2px 4px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.3px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.7));
}
.btn-hero-register:hover {
  filter: brightness(1.15) drop-shadow(0 0 25px rgba(0, 200, 255, 1)) drop-shadow(0 6px 16px rgba(0, 0, 0, 0.9));
  transform: translateY(-2px) scale(1.02);
}

.hero-platforms-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 6px;
}
.platform-pill {
  width: 105px;
  height: 42px;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #cbd5e1;
  font-family: var(--font-tech);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.5px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.6));
  transition: all 0.2s ease;
}
.platform-pill.android { background-image: url('../images/res_pill_android.png'); }
.platform-pill.ios     { background-image: url('../images/res_pill_ios.png'); }
.platform-pill.pc      { background-image: url('../images/res_pill_pc.png'); }
.platform-pill.jar     { background-image: url('../images/res_pill_jar.png'); }
.platform-pill:hover {
  filter: brightness(1.25) drop-shadow(0 0 16px rgba(56, 189, 248, 0.8));
  transform: translateY(-2px);
  color: #fff;
}

/* ==========================================================================
   BOTTOM 5 FEATURE ACTION CARDS (EXACT VISUALS WITH 3D ICONS)
   ========================================================================== */
.bottom-cards-dock {
  position: relative;
  z-index: 20;
  width: 100%;
  padding: 0 28px 10px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  max-width: 1420px;
  margin: 0 auto;
}
.action-card {
  position: relative;
  width: 100%;
  aspect-ratio: 500 / 236;
  max-height: 122px;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  cursor: pointer;
  border: none;
  background-color: transparent;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.85));
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), filter 0.25s ease;
}
.action-card:hover {
  transform: translateY(-6px) scale(1.02);
  filter: brightness(1.12) drop-shadow(0 0 25px rgba(255, 215, 0, 0.5)) drop-shadow(0 12px 30px rgba(0, 0, 0, 0.95));
}
.action-card.card-1 { background-image: url('../images/res_card_1.png'); }
.action-card.card-2 { background-image: url('../images/res_card_2.png'); }
.action-card.card-3 { background-image: url('../images/res_card_3.png'); }
.action-card.card-4 { background-image: url('../images/res_card_4.png'); }
.action-card.card-5 { background-image: url('../images/res_card_5.png'); }
.action-card-content {
  position: absolute;
  top: 13%;
  right: 5%;
  width: 44%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  pointer-events: none;
}
.action-card-title {
  font-family: 'Be Vietnam Pro', 'Montserrat', sans-serif;
  font-size: 0.86rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.9), 0 2px 4px rgba(0, 0, 0, 0.9);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 3px;
  white-space: nowrap;
}
.action-card-desc {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.62rem;
  font-weight: 600;
  color: #cbd5e1;
  letter-spacing: 0.4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
}
.action-card-btn {
  position: absolute;
  bottom: 8.5%;
  right: 6%;
  width: 42%;
  height: 27%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Chakra Petch', 'Montserrat', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  color: #38bdf8;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.9);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  gap: 4px;
  pointer-events: none;
  transition: all 0.2s ease;
}
.action-card:hover .action-card-btn {
  color: #ffffff;
  text-shadow: 0 0 16px rgba(56, 189, 248, 1);
  transform: scale(1.05);
}

/* ==========================================================================
   INSTANT 0ms MODALS
   ========================================================================== */
.portal-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 16, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.06s ease, visibility 0.06s ease;
  will-change: opacity, visibility;
}

.portal-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.portal-modal-dialog {
  background: rgba(10, 16, 36, 0.96);
  border: 2px solid var(--gold-primary);
  border-radius: 14px;
  width: 100%;
  max-width: 720px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.95), 0 0 35px rgba(245, 197, 24, 0.35);
  transform: scale(0.97);
  transition: transform 0.06s ease;
  will-change: transform;
}

.portal-modal-overlay.active .portal-modal-dialog {
  transform: scale(1);
}

.portal-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 215, 0, 0.3);
  background: rgba(6, 10, 24, 0.8);
}

.portal-modal-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.portal-modal-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #94a3b8;
  font-size: 1.25rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.portal-modal-close:hover {
  background: #ef4444;
  color: #fff;
}

.portal-modal-body {
  padding: 22px 24px;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
}

.custom-table th {
  background: rgba(255, 215, 0, 0.12);
  color: var(--gold-primary);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 215, 0, 0.3);
}

.custom-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.88rem;
  color: #e2e8f0;
}

.custom-table tr:hover td {
  background: rgba(255, 215, 0, 0.06);
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  background: rgba(6, 10, 24, 0.9);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 6px;
  padding: 11px 14px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
}

.form-control:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.35);
}

.portal-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  background: rgba(8, 12, 28, 0.96);
  border: 1px solid var(--gold-primary);
  border-radius: 8px;
  padding: 12px 20px;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9), 0 0 20px rgba(255, 215, 0, 0.3);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.portal-toast.active {
  transform: translateY(0);
  opacity: 1;
}

/* ==========================================================================
   RESPONSIVENESS
   ========================================================================== */
@media (max-width: 1200px) {
  .floating-left-dock { display: none; }
  .bottom-cards-dock { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .portal-nav { display: none; }
  .portal-hero-container { padding-top: 220px; }
  .hero-logo-img { max-width: 420px; }
  .bottom-cards-dock { grid-template-columns: repeat(2, 1fr); }
  .floating-right-dock { display: none; }
}

@media (max-width: 600px) {
  .portal-hero-container { padding-top: 180px; }
  .hero-logo-img { max-width: 320px; }
  .hero-tagline-title { font-size: 1rem; letter-spacing: 2px; }
  .hero-tagline-sub { font-size: 0.72rem; letter-spacing: 1px; }
  .hero-tagline-sub .sep { margin: 0 5px; }
  .hero-cta-group { flex-direction: column; width: 100%; }
  .btn-hero-download, .btn-hero-register { width: 100%; max-width: 290px; }
  .bottom-cards-dock { grid-template-columns: 1fr; padding: 0 14px 18px; }
}

/* --- BRAND LOGO & USER PILL --- */
.portal-brand-img {
  height: 48px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 12px rgba(255, 215, 0, 0.6));
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.portal-brand:hover .portal-brand-img {
  transform: scale(1.06);
}

.portal-user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(10, 16, 36, 0.92);
  border: 1px solid rgba(255, 215, 0, 0.4);
  padding: 5px 14px;
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6), inset 0 0 8px rgba(255, 215, 0, 0.15);
}

/* --- ORNATE GOLDEN SHRINE DOCK --- */
.dock-shrine-tip-top {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-bottom: 14px solid #f5c518;
  filter: drop-shadow(0 0 8px rgba(245, 197, 24, 0.9));
}
.dock-shrine-tip-top::after {
  content: '';
  position: absolute;
  top: 4px;
  left: -8px;
  width: 16px;
  height: 16px;
  background: #38bdf8;
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  box-shadow: 0 0 10px #38bdf8;
}

.dock-shrine-tip-bottom {
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 14px solid #f5c518;
  filter: drop-shadow(0 0 8px rgba(245, 197, 24, 0.9));
}
.dock-shrine-tip-bottom::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: -8px;
  width: 16px;
  height: 16px;
  background: #38bdf8;
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  box-shadow: 0 0 10px #38bdf8;
}

/* Bottom logo aura consolidated above */

/* Logo styles consolidated above */

/* --- ENHANCED MODAL ORNATE FRAMING --- */
.portal-modal-dialog {
  border: 1.5px solid #f5c518;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.98), 0 0 40px rgba(245, 197, 24, 0.35), inset 0 0 25px rgba(245, 197, 24, 0.06);
}

.portal-modal-header {
  background: linear-gradient(90deg, rgba(16, 24, 52, 0.95) 0%, rgba(8, 12, 28, 0.98) 100%);
  border-bottom: 1.5px solid rgba(255, 215, 0, 0.4);
}

/* Custom Gold Scrollbar */
.portal-modal-dialog::-webkit-scrollbar {
  width: 7px;
}
.portal-modal-dialog::-webkit-scrollbar-track {
  background: rgba(6, 10, 24, 0.8);
}
.portal-modal-dialog::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #f5c518, #b8860b);
  border-radius: 4px;
}

/* ==========================================================================
   MOBILE (<=900px): cho phep cuon trang de thay du 5 the (Su kien, Giftcode,
   San boss, Tu tien, BXH). Ban cu khoa chieu cao = 1 man hinh nen the phia duoi bi cat.
   ========================================================================== */
@media (max-width: 900px) {
  html, body { height: auto; min-height: 100%; overflow-y: auto; }
  .portal-wrapper {
    height: auto;
    min-height: 100vh;
    min-height: 100svh;
    max-height: none;
    overflow: visible;
    justify-content: flex-start;
    background-attachment: scroll;
  }
  .portal-hero-container { flex: none; padding-bottom: 18px; }
  .bottom-cards-dock { padding-bottom: 28px; }
}

/* ==========================================================================
   VIDEO NEN CHUYEN DONG (may tinh). Dien thoai / may tiet kiem dien: dung anh tinh.
   ========================================================================== */
.portal-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  z-index: 0;
  pointer-events: none;
}
@media (max-width: 900px) {
  .portal-bg-video { display: none; }
}

/* ==========================================================================
   MENU DIEN THOAI (nut 3 gach): thanh menu & dock bi an o <=900px nen can menu rieng
   ========================================================================== */
.portal-burger, .portal-mobile-menu { display: none; }
@media (max-width: 900px) {
  .portal-burger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; flex: 0 0 42px;
    border-radius: 10px; border: 1px solid rgba(255, 215, 0, 0.5);
    background: rgba(10, 16, 36, 0.92); color: #ffe066; font-size: 1.15rem; cursor: pointer;
    margin-left: 8px;
  }
  .portal-mobile-menu {
    display: none; position: fixed; top: 68px; left: 0; right: 0; z-index: 99;
    background: rgba(6, 10, 24, 0.97); border-bottom: 1px solid rgba(255, 215, 0, 0.35);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.8); padding: 6px 14px 12px;
    max-height: calc(100vh - 68px); overflow-y: auto;
  }
  .portal-mobile-menu.open { display: block; }
  .portal-mobile-menu a {
    display: block; padding: 13px 8px; color: #fff; text-decoration: none; font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08); font-size: 0.98rem;
  }
  .portal-mobile-menu a i { width: 26px; color: #f5c518; }
  .portal-mobile-menu a.mm-admin { color: #ffb4a8; }
  .portal-header { padding: 0 6px; gap: 2px; }
  .portal-header .portal-brand-img { height: 34px; width: auto; max-width: 88px; }
  .portal-burger { width: 38px; height: 38px; flex: 0 0 38px; margin-left: 2px; order: 3; }
  .portal-auth { order: 2; margin-left: auto; }
  #portalAuthContainer { gap: 4px !important; }
  .portal-auth .btn-portal { padding: 7px 9px; font-size: 0.66rem; white-space: nowrap; }
  .portal-user-pill { padding: 4px 8px; }
  /* trang thai DA DANG NHAP: thu gon de khong tran thanh tren cung */
  .portal-auth { flex: 1 1 0; min-width: 0; display: flex; justify-content: flex-end; }
  #portalAuthContainer { min-width: 0; max-width: 100%; flex-wrap: nowrap; justify-content: flex-end; }
  #portalAuthContainer .btn-portal { flex: 0 0 auto; }
  .portal-user-pill { min-width: 0; flex: 0 1 auto; gap: 5px !important; overflow: hidden; }
  .portal-user-pill > span:first-of-type { max-width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.78rem !important; }
  .portal-user-pill > span:nth-of-type(2) { font-size: 0.64rem !important; padding: 1px 5px !important; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .portal-user-pill > i { display: none; }
}
@media (max-width: 430px) {
  .portal-user-pill > span:nth-of-type(2) { display: none; }
}

@media (max-width: 900px) {
  .portal-mobile-menu .mm-user { padding: 10px 8px; color: #ffe066; font-weight: 800; border-bottom: 1px solid rgba(255, 215, 0, 0.3); word-break: break-all; }
}

/* ==========================================================================
   CUA SO PHU (modal) TREN DIEN THOAI: khong cho noi dung tran ra ngoai khung
   ========================================================================== */
@media (max-width: 600px) {
  .portal-modal-body div[style*="grid-template-columns: 1fr 1fr"],
  .portal-modal-body div[style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }
  .portal-modal-dialog { overflow-x: hidden; }
  .custom-table { width: 100%; table-layout: fixed; }
  .custom-table th, .custom-table td { padding: 8px 4px !important; font-size: 0.72rem !important; word-break: break-word; overflow-wrap: anywhere; }
  .portal-modal-body img, .portal-modal-body video, .portal-modal-body iframe { max-width: 100%; height: auto; }
  .portal-modal-body pre, .portal-modal-body code { white-space: pre-wrap; word-break: break-word; }
}

/* Chong tran theo MOI be rong (khong gan cung 1 kich co man hinh): hang flex cho phep xuong dong, chu tu ngat dong */
@media (max-width: 900px) {
  .portal-modal-body div[style*="display:flex"],
  .portal-modal-body div[style*="display: flex"] { flex-wrap: wrap; }
  .portal-modal-body { overflow-wrap: anywhere; }
  .portal-modal-body .btn-portal { max-width: 100%; }
  img, video, canvas { max-width: 100%; }
}

/* ==========================================================================
   NEN DONG DOC CHO DIEN THOAI: video man doc phu kin man hinh, dung yen khi cuon trang
   ========================================================================== */
.portal-bg-video-m { display: none; }
@media (max-width: 900px) {
  .portal-bg-video-m {
    display: block; position: fixed; inset: 0; width: 100%; height: 100%;
    object-fit: cover; object-position: center top; z-index: 0; pointer-events: none;
  }
  .portal-wrapper { background: #060914 url('../images/res_bg_doc.jpg') center top / cover no-repeat; }
}

/* Dien thoai: thu nho logo + chu giua man hinh de lo nen dong ben duoi */
@media (max-width: 900px) {
  .portal-hero-container { padding-top: 92px; }
  .hero-logo-img { max-width: min(58vw, 220px); }
  .hero-tagline-ribbon {
    background: linear-gradient(90deg, transparent 0%, rgba(4, 7, 18, 0.34) 14%, rgba(4, 7, 18, 0.46) 50%, rgba(4, 7, 18, 0.34) 86%, transparent 100%);
    backdrop-filter: none; -webkit-backdrop-filter: none; padding: 3px 14px 4px;
  }
  .hero-tagline-title { font-size: 0.74rem; letter-spacing: 1px; }
  .hero-tagline-sub { font-size: 0.56rem; letter-spacing: 0.4px; }
  .btn-hero-download, .btn-hero-register { max-width: 220px; font-size: 0.8rem; }
}

/* Dien thoai: de lo nghe thuat nen o nua tren man hinh; 2 nut ngang hang; the xep 2 cot */
@media (max-width: 900px) {
  .portal-hero-container { padding-top: 34vh; padding-top: 34svh; }
  .hero-cta-group { flex-direction: row; width: 100%; padding: 0 12px; gap: 8px; justify-content: center; }
  .btn-hero-download, .btn-hero-register { flex: 1 1 0; width: auto; max-width: none; min-width: 0; font-size: 0.7rem; padding-left: 6px; padding-right: 6px; white-space: nowrap; }
  .bottom-cards-dock { grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 0 10px 24px; }
  .action-card { max-height: none; }
  .action-card-title { font-size: 2.3vw; }
  .action-card-desc { font-size: 1.75vw; }
  .action-card-btn { font-size: 1.7vw; gap: 2px; }
}
@media (min-width: 560px) and (max-width: 900px) {
  .action-card-title { font-size: 0.8rem; }
  .action-card-desc { font-size: 0.58rem; }
  .action-card-btn { font-size: 0.62rem; }
}

@media (max-width: 900px) {
  .bottom-cards-dock .action-card:last-child:nth-child(odd) { grid-column: 1 / -1; width: calc(50% - 4px); justify-self: center; }
}
