* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
}

body {
  background-color: #010814;
  color: #fff;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Background nền chính */
.main-wrapper {
  width: 100%;
  max-width: 1400px;
  min-height: 100vh;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: url('bg-main.jpg') no-repeat center center / cover;
  position: relative;
}

/* Logo Onbet */
.logo-container {
  margin: 20px 0 30px;
}

.logo-img {
  max-width: 280px;
  height: auto;
  display: block;
}

/* Layout 2 Card */
.cards-container {
  display: flex;
  gap: 30px;
  width: 100%;
  max-width: 900px;
  justify-content: center;
  align-items: stretch;
  margin: auto 0;
}

.card {
  flex: 1;
  background: rgba(5, 18, 38, 0.88);
  border-radius: 16px;
  padding: 45px 20px 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.card-blue { border: 1.5px solid #1d4ed8; }
.card-green { border: 1.5px solid #15803d; }

.card-icon {
  position: absolute;
  top: -40px;
  width: 80px;
  height: 80px;
}

.card-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.card-title {
  color: #facc15;
  font-size: 1.4rem;
  margin-top: 15px;
  margin-bottom: 20px;
  line-height: 1.3;
}

.input-wrapper {
  width: 100%;
  margin-bottom: 15px;
}

.input-wrapper input {
  width: 100%;
  padding: 12px 18px;
  border-radius: 25px;
  border: 2px solid #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
  background-color: #ffffff;
  color: #0f172a;
  font-weight: 500;
  text-align: center;
  outline: none;
  transition: all 0.3s ease;
}

.input-wrapper input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 18px rgba(96, 165, 250, 0.9);
}

.card-desc {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 25px;
  line-height: 1.4;
  min-height: 42px;
  display: flex;
  align-items: center;
}

.btn {
  width: 85%;
  padding: 13px;
  border-radius: 25px;
  border: none;
  color: #fff;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  transition: transform 0.2s, filter 0.2s;
}

.btn:hover {
  transform: scale(1.03);
  filter: brightness(1.15);
}

.btn-blue { background: linear-gradient(90deg, #1d4ed8, #2563eb); }
.btn-green { background: linear-gradient(90deg, #15803d, #16a34a); }

/* ================= POPUP STYLES ================= */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 999;
  padding: 15px;
}

.popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

.popup-frame-container {
  position: relative;
  width: 100%;
  max-width: 860px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.frame-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.mobile-frame { display: none; }
.pc-frame { display: block; }

/* Nút Close (Dấu X) - Làm to hơn & neo chuẩn góc trên bên phải */
.close-btn {
  position: absolute;
  top: -12px;
  right: -12px;
  z-index: 10;
  background: transparent;
  border: none;
  cursor: pointer;
  width: 48px;
  height: 48px;
  transition: transform 0.2s ease;
}

.close-btn:hover {
  transform: scale(1.1);
}

.close-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Nội dung Popup */
.popup-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 45px 50px 35px 50px; /* Thêm lề phải/trái lớn hơn để tránh viền frame */
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}

.title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Ảnh Tiêu đề & Badge */
.popup-title-img {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.badge-img {
  height: 22px;
  width: auto;
  object-fit: contain;
}

/* Nút làm mới (Thêm icon & lùi cách lề phải) */
.refresh-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid #475569;
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 25px; /* Cách viền phải nhiều hơn */
  transition: background 0.2s;
}

.refresh-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.refresh-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

/* Danh sách link */
.link-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
  max-height: 60vh;
  overflow-y: auto;
}

.link-item {
  background: rgba(2, 18, 38, 0.9);
  border: 1px solid #1e3a5f;
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.link-item .num { font-weight: bold; width: 18px; }

.shield-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.link-item .url {
  flex: 1;
  font-size: 0.85rem;
  color: #e2e8f0;
}

.copy-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  width: 22px;
  height: 22px;
}

.copy-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ==========================================
   POPUP 2: KẾT QUẢ KIỂM TRA THẬT / GIẢ (NẰM HÀNG NGANG)
   ========================================== */
.result-card {
  position: relative;
  width: 90%;
  max-width: 520px;
  min-height: 220px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 16px;
  /* Bỏ overflow: hidden để nút close không bị cắt viền nếu đè ra ngoài */
}

/* Frame ảnh nền */
.result-frame-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  z-index: 1;
}

/* Bố cục dàn hàng ngang */
.result-body {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 30px 40px 30px 30px;
  display: flex;
  flex-direction: row; /* Xếp icon và chữ nằm ngang */
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.result-status-icon {
  width: 100px;
  height: 100px;
  object-fit: contain;
  flex-shrink: 0;
}

.result-text {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.3;
  text-align: left; /* Căn trái văn bản */
  word-break: break-word;
}

/* Màu chữ cho từng trạng thái */
.result-text.text-danger {
  color: #dc2626;
}

.result-text.text-success {
  color: #007BFF;
}

/* Nút close neo góc trên bên phải của frame */
#resultPopupOverlay .close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 36px;
  height: 36px;
  z-index: 10;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

#resultCloseIcon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Mobile Responsive cho Popup Result */
@media (max-width: 480px) {
  .result-card {
    min-height: 180px;
  }
  .result-body {
    padding: 20px 25px 20px 20px;
    gap: 12px;
  }
  .result-status-icon {
    width: 70px;
    height: 70px;
  }
  .result-text {
    font-size: 1.2rem;
  }
  #resultPopupOverlay .close-btn {
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
  }
}

/* ================= MOBILE RESPONSIVE (DÀN HÀNG NGANG) ================= */
@media (max-width: 768px) {

    /* Tự động căn giữa nội dung theo chiều dọc màn hình */
  .main-wrapper {
    justify-content: center;
    padding: 44px 10px;
  }
  
  .logo-container {
    margin: 0 0 56px 0;
  }

  /* Giữ 2 Card nằm ngang, tạo khoảng trống phía trên cho Icon */
  .cards-container {
    flex-direction: row;
    align-items: stretch;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    padding: 0 5px;
    margin-top: 25px; /* Tách biệt nhẹ với Logo */
  }
  
  .logo-img { 
    max-width: 280px;
  }
  
  /* Giữ 2 card nằm ngang, không xuống dòng */
  .cards-container {
    flex-direction: row; /* Ép nằm hàng ngang */
    align-items: stretch;
    gap: 8px; /* Thu nhỏ khoảng cách giữa 2 card */
    width: 100%;
    max-width: 100%;
    padding: 0 5px;
  }

  /* Tăng padding trên/dưới của Card giúp khung dài ra */
  .card {
    flex: 1;
    min-width: 0;
    padding: 56px 12px 56px 12px; /* Tăng padding trên lên 55px và dưới lên 35px */
    border-radius: 16px;
  }

  /* Định vị lại Icon hình tròn phía trên cho cân đối với padding mới */
  .card-icon {
    top: -35px;
    width: 68px;
    height: 68px;
  }

  /* Tăng size chữ Tiêu đề (Title) trong khung */
  .card-title {
    font-size: 1.25rem; /* Tăng từ 0.9rem - 1rem lên 1.15rem */
    font-weight: 800;
    margin-top: 10px;
    margin-bottom: 18px;
    line-height: 1.35;
  }

  .input-wrapper {
    margin-bottom: 24px;
  }

  .input-wrapper input {
    padding: 10px 8px;
    font-size: 1rem;
    border-width: 1.5px;
  }

  /* Điều chỉnh thêm chiều cao đoạn mô tả để kéo giãn khoảng cách */
  .card-desc {
    font-size: 1rem;
    margin-bottom: 22px;
    min-height: 55px;
    line-height: 1.35;
  }

  /* Tăng nhẹ chiều cao nút bấm cho đồng bộ */
  .btn {
    width: 100%;
    padding: 12px 8px;
    font-size: 0.9rem;
    border-radius: 22px;
  }

  .btn .arrow {
    display: none;
  }

  /* Rest of Popup Mobile styles... */
  .pc-frame { display: none; }
  .mobile-frame { display: block; }
  .popup-frame-container { max-width: 380px; }
  .link-grid { grid-template-columns: 1fr; }
  .popup-content { padding: 35px 20px 20px 20px; }
  .popup-header { flex-wrap: wrap; gap: 10px; margin-bottom: 15px; }
  .title-group { gap: 8px; }
  .popup-title-img { height: 22px; }
  .badge-img { height: 16px; }
  .refresh-btn { margin-right: 0; padding: 4px 8px; font-size: 0.75rem; white-space: nowrap; }
  .refresh-icon { width: 14px; height: 14px; }
  .close-btn { top: -8px; right: -8px; width: 40px; height: 40px; }
}