/* ================= RESET & CẤU TRÚC GỐC ================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

:root {
  --bg-pitch-black: #050203;
  --neon-red: #ff2a4b;
  --neon-glow: rgba(255, 42, 75, 0.85);
  --crimson-dark: #8a0c16;
  --panel-bg: rgba(14, 7, 10, 0.86);
  --text-white: #ffffff;
  --text-sub: #b5acb0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-pitch-black);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-white);
  -webkit-font-smoothing: antialiased;
}

/* ================= 1. NỀN ĐEN HUYỀN BÍ CHUẨN ESPORTS ================= */
.bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #050203;
  overflow: hidden;
  pointer-events: none;
}

.radial-ambient-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(138, 12, 22, 0.22) 0%, rgba(30, 4, 7, 0.08) 55%, transparent 75%);
  filter: blur(40px);
}

/* ================= 2. TOP NAV BAR & KEY STATUS ================= */
.top-nav-bar {
  position: fixed;
  top: 14px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 80;
  pointer-events: auto;
}

.btn-key-status {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  background: rgba(255, 42, 75, 0.12);
  border: 1px solid rgba(255, 42, 75, 0.4);
  border-radius: 999px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 12px rgba(255, 42, 75, 0.25);
  transition: all 0.2s ease;
}

.btn-key-status:active {
  transform: scale(0.96);
}

.key-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #32d764;
  box-shadow: 0 0 6px #32d764;
}

.server-badge {
  font-size: 10px;
  font-weight: 700;
  color: #8c8286;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

/* ================= 3. THÔNG BÁO TOAST ================= */
.bg-toast {
  position: fixed;
  top: 56px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 10px;
  background: rgba(18, 10, 12, 0.9);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 42, 75, 0.4);
  border-radius: 999px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transform: translateY(-16px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 100;
}

.bg-toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #32d764;
  color: #050203;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-icon svg {
  width: 13px;
  height: 13px;
}

.toast-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.toast-title {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
}

.toast-sub {
  font-size: 10px;
  font-weight: 400;
  color: #a49da1;
}

/* ================= 4. LỚP HUD CHÍNH GIỮA (HOLO HUD, TÂM ẢO & VÒNG FOV) ================= */
.holo-hud-viewport {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 20;
}

/* Tiêu đề Holo HUD ở đỉnh trên */
.holo-hud-label {
  position: absolute;
  top: calc(50% - 170px);
  left: 50%;
  transform: translateX(-50%);
  color: #a49da1;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.9);
  transition: top 0.1s ease;
}

/* Vòng tròn ngắm FOV căn giữa */
.hud-fov-circle-ring {
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 1.6px solid rgba(255, 42, 75, 0.85);
  box-shadow: 0 0 22px rgba(255, 42, 75, 0.45), inset 0 0 22px rgba(255, 42, 75, 0.12);
  transition: width 0.06s ease, height 0.06s ease, opacity 0.2s ease;
}

.hud-fov-circle-ring.hidden {
  opacity: 0;
  visibility: hidden;
}

/* Chữ "Vòng FOV" góc dưới bên trái */
.hud-label-vong-fov {
  position: absolute;
  top: calc(50% + 115px);
  left: calc(50% - 150px);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 500;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.9);
  transition: opacity 0.2s ease;
}

.hud-label-vong-fov.hidden {
  opacity: 0;
  visibility: hidden;
}

/* Chữ "Tâm ảo" góc trên bên trái tâm ngắm */
.hud-label-tam-ao {
  position: absolute;
  top: calc(50% - 24px);
  left: calc(50% - 70px);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 500;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.9);
  transition: opacity 0.2s ease;
}

.hud-label-tam-ao.hidden {
  opacity: 0;
  visibility: hidden;
}

/* Tâm ngắm chữ thập neon đỏ (Tâm ảo) */
.hud-reticle-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
}

.hud-reticle-crosshair.hidden {
  opacity: 0;
  visibility: hidden;
}

.reticle-arm-h {
  position: absolute;
  width: 52px;
  height: 3.5px;
  background: var(--neon-red);
  border-radius: 2px;
  box-shadow: 0 0 10px var(--neon-red), 0 0 20px var(--neon-red);
}

.reticle-arm-v {
  position: absolute;
  height: 52px;
  width: 3.5px;
  background: var(--neon-red);
  border-radius: 2px;
  box-shadow: 0 0 10px var(--neon-red), 0 0 20px var(--neon-red);
}

.reticle-dot {
  position: absolute;
  width: 4px;
  height: 4px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 6px #ffffff;
}

/* ================= 5. BẢNG VIP PANEL (KHỚP 100% DESIGN MOCKUP) ================= */
.vip-panel-wrapper {
  position: fixed;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  z-index: 90;
  width: 275px;
  max-width: calc(100vw - 36px);
  pointer-events: auto;
  touch-action: none;
}

/* Avatar tròn góc trên bên phải VIP Panel */
.avatar-badge-wrap {
  position: absolute;
  top: -34px;
  right: 28px;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  z-index: 95;
  cursor: grab;
  touch-action: none;
}

.avatar-badge-wrap:active {
  cursor: grabbing;
}

.avatar-neon-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--neon-red);
  box-shadow: 0 0 22px rgba(255, 42, 75, 0.95), inset 0 0 10px rgba(255, 42, 75, 0.5);
  pointer-events: none;
}

.avatar-badge-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #000;
}

/* Thẻ bảng VIP Panel */
.vip-panel-card {
  background: rgba(14, 7, 10, 0.88);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1.5px solid rgba(255, 42, 75, 0.65);
  border-radius: 22px;
  box-shadow: 0 0 28px rgba(255, 42, 75, 0.35), 0 20px 50px rgba(0, 0, 0, 0.9);
  padding: 24px 16px 16px 16px;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
}

.vip-panel-card.minimized {
  display: none;
}

/* Viên thuốc đỏ tiêu đề: VIP PANEL */
.vip-capsule-header {
  width: 100%;
  padding: 8px 0;
  text-align: center;
  border-radius: 12px;
  background: rgba(255, 42, 75, 0.14);
  border: 1.5px solid rgba(255, 42, 75, 0.85);
  box-shadow: 0 0 14px rgba(255, 42, 75, 0.35);
  margin-top: 6px;
  margin-bottom: 12px;
}

.vip-capsule-title {
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 1px;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

/* Danh sách các hàng chức năng */
.vip-func-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.vip-func-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 2px;
}

.func-title {
  font-size: 13.5px;
  font-weight: 500;
  color: #ffffff;
}

/* ================= 6. CÔNG TẮC CHỮ ON / OFF ================= */
.toggle-pill {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-pill input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #ff2a4b;
  border-radius: 999px;
  transition: all 0.22s ease;
  box-shadow: 0 0 12px rgba(255, 42, 75, 0.7);
  display: flex;
  align-items: center;
}

.toggle-state-text {
  position: absolute;
  left: 9px;
  font-size: 8.5px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.5px;
  pointer-events: none;
}

/* Nút tròn bên trong switch */
.toggle-track:after {
  content: "";
  position: absolute;
  right: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0e070a;
  transition: all 0.22s ease;
}

/* Trạng thái TẮT (OFF) */
.toggle-pill input:not(:checked) + .toggle-track {
  background: rgba(50, 32, 38, 0.85);
  box-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.toggle-pill input:not(:checked) + .toggle-track .toggle-state-text {
  left: auto;
  right: 9px;
  color: #8c8286;
}

.toggle-pill input:not(:checked) + .toggle-track:after {
  right: auto;
  left: 3px;
  background: #6e6468;
}

/* ================= 7. THANH TRƯỢT KÍCH THƯỚC FOV ================= */
.vip-slider-block {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 2px;
}

.slider-title-row {
  font-size: 12px;
  color: #c4bcc0;
  font-weight: 500;
}

.slider-title-row strong {
  color: #ffffff;
  font-weight: 700;
}

.range-wrap {
  width: 100%;
}

.neon-range {
  -webkit-appearance: none;
  width: 100%;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.18);
  outline: none;
}

.neon-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ff2a4b;
  box-shadow: 0 0 8px #ff2a4b;
  cursor: pointer;
  border: none;
}

/* ================= 8. HÀNG NHẠC NỀN MP3 ================= */
.vip-music-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 3px;
  gap: 8px;
}

.music-left-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.music-txt-main {
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
}

.music-txt-sub {
  font-size: 10.5px;
  color: #b5acb0;
}

.music-right-action {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-pill-picker {
  padding: 5px 10px;
  font-size: 10.5px;
  font-weight: 600;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 42, 75, 0.5);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-pill-picker:active {
  transform: scale(0.96);
}

.toggle-pill-mini {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 20px;
  flex-shrink: 0;
}

.toggle-pill-mini input { opacity: 0; width: 0; height: 0; }

.toggle-pill-mini .toggle-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #ff2a4b;
  box-shadow: 0 0 10px rgba(255, 42, 75, 0.7);
  cursor: pointer;
}

.toggle-pill-mini .toggle-track:after {
  content: "";
  position: absolute;
  right: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #0e070a;
}

.toggle-pill-mini input:not(:checked) + .toggle-track {
  background: rgba(50, 32, 38, 0.85);
  box-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.toggle-pill-mini input:not(:checked) + .toggle-track:after {
  right: auto;
  left: 2px;
  background: #6e6468;
}

/* ================= 9. CẶP NÚT VÀO FREE FIRE Ở ĐÁY ================= */
.vip-launch-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
}

.btn-game-red {
  padding: 10px 8px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #ff2a4b, #b91625);
  box-shadow: 0 0 16px rgba(255, 42, 75, 0.6);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  transition: all 0.2s ease;
}

.btn-game-red:active {
  transform: scale(0.96);
}

.btn-game-outline {
  padding: 10px 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 42, 75, 0.6);
  background: rgba(18, 8, 12, 0.85);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  transition: all 0.2s ease;
}

.btn-game-outline:active {
  transform: scale(0.96);
}

/* ================= 10. MODAL XÁC THỰC KEY ================= */
.key-auth-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.key-auth-modal.open {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  width: 100%;
  max-width: 320px;
  background: rgba(18, 9, 13, 0.95);
  border: 1.5px solid rgba(255, 42, 75, 0.5);
  border-radius: 20px;
  box-shadow: 0 0 30px rgba(255, 42, 75, 0.35);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.modal-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--neon-red);
  box-shadow: 0 0 16px rgba(255, 42, 75, 0.8);
  margin-bottom: 12px;
  overflow: hidden;
}

.modal-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-title {
  font-size: 14.5px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.modal-desc {
  font-size: 11px;
  color: var(--text-sub);
  margin-bottom: 14px;
  line-height: 1.4;
}

.modal-input-wrap {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.modal-input {
  width: 100%;
  padding: 11px 54px 11px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  color: #ffffff;
  font-size: 12.5px;
  outline: none;
}

.modal-input:focus {
  border-color: var(--neon-red);
  box-shadow: 0 0 10px rgba(255, 42, 75, 0.4);
}

.btn-modal-paste {
  position: absolute;
  right: 6px;
  padding: 5px 10px;
  background: rgba(255, 42, 75, 0.2);
  border: 1px solid rgba(255, 42, 75, 0.4);
  border-radius: 8px;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
}

.modal-error {
  font-size: 11px;
  color: #ff4757;
  min-height: 16px;
  margin-bottom: 10px;
}

.modal-actions {
  display: flex;
  gap: 8px;
  width: 100%;
}

.btn-modal-cancel {
  flex: 1;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #a49da1;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-modal-submit {
  flex: 1.4;
  padding: 10px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #ff2a4b, #b91625);
  box-shadow: 0 0 12px rgba(255, 42, 75, 0.5);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
