/* /id — Thiên Long Bát Bộ 2 (kiếm hiệp) */

html.tlbb2-id-page body {
  margin: 0 !important;
  padding: 0 !important;
  background: #0c0906 !important;
  overflow-x: hidden !important;
  font-family: 'Be Vietnam Pro', 'Segoe UI', sans-serif;
}

html.tlbb2-id-page body .wrapper {
  background: #0c0906 !important;
  background-image: none !important;
  overflow-x: hidden !important;
  position: relative;
  z-index: 1;
}

html.tlbb2-id-page .wrapper,
html.tlbb2-id-page #main-home,
html.tlbb2-id-page #main-action,
html.tlbb2-id-page #main-sect {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: none !important;
  background: transparent !important;
  z-index: 1 !important;
}

.tlbb2-id {
  --ink: #0c0906;
  --smoke: #1a140f;
  --bronze: #d4a84b;
  --gold: #f0d78c;
  --vermillion: #b42822;
  --vermillion-deep: #8a1a16;
  --paper: #fff6e4;
  --paper-dim: #f0e2c4;
  --mist: #e8dcc0;
  --line: rgba(240, 215, 140, 0.55);
  --font-display: 'Cormorant Garamond', 'Times New Roman', serif;
  --font-body: 'Be Vietnam Pro', 'Segoe UI', sans-serif;
  color: var(--paper);
  font-family: var(--font-body);
  background: var(--ink);
  min-height: 100vh;
}

.tlbb2-id a { color: inherit; text-decoration: none; }
.tlbb2-id * { box-sizing: border-box; }

/* Nav */
.tl2id-nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 4vw;
  background: rgba(8, 6, 4, 0.94);
  border-bottom: 1px solid var(--line);
}

.tl2id-brand {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.04em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.tl2id-nav-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.tl2id-nav-link {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--paper);
  padding: 0.45rem 0.7rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

.tl2id-nav-link:hover { color: var(--gold); }

/* Hero */
.tl2id-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--ink) center/cover no-repeat;
  padding: 6rem 4vw 4rem;
}

.tl2id-hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.tl2id-hero-media img,
.tl2id-hero-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.tl2id-hero-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(154, 31, 26, 0.22), transparent 55%),
    linear-gradient(180deg, rgba(12, 9, 6, 0.55) 0%, rgba(12, 9, 6, 0.88) 70%, #0c0906 100%);
  pointer-events: none;
}

.tl2id-hero-content {
  position: relative;
  z-index: 2;
  width: min(640px, 100%);
  text-align: center;
  animation: tl2id-rise 1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.tl2id-servers {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.tl2id-servers li {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--line);
  padding: 0.25rem 0.65rem;
}

.tl2id-hero-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 4.4rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: 0.02em;
  color: var(--paper);
}

.tl2id-hero-title em {
  display: block;
  margin-top: 0.3rem;
  font-style: italic;
  font-weight: 500;
  font-size: 0.42em;
  color: var(--gold);
  letter-spacing: 0.1em;
}

.tl2id-hero-lead {
  margin: 0 auto 1.75rem;
  max-width: 28rem;
  font-size: 1rem;
  line-height: 1.65;
  color: #fff6e4;
  font-weight: 500;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.75);
}

.tl2id-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
}

.tl2id-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.7rem 1.4rem;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
  background: transparent;
  color: var(--paper);
}

.tl2id-btn:hover { transform: translateY(-2px); }

.tl2id-btn--primary {
  background: linear-gradient(180deg, #c9332c, #8a1a16);
  border-color: #f0d78c;
  box-shadow: 0 8px 28px rgba(154, 31, 26, 0.45);
  color: #fff8ea !important;
}

.tl2id-btn--primary:hover {
  background: linear-gradient(180deg, #e03d35, #c9332c);
  color: #fff !important;
}

.tl2id-btn--ghost {
  background: rgba(8, 6, 4, 0.72);
  color: #fff6e4 !important;
  border-color: #f0d78c;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.tl2id-btn--ghost:hover {
  background: rgba(240, 215, 140, 0.22);
  color: #fff !important;
  border-color: #ffe9a8;
}

.tl2id-btn--block { width: 100%; }

.tl2id-btn.loading {
  opacity: 0.65;
  pointer-events: none;
}

/* Panel dưới hero */
.tl2id-panel {
  padding: 3.5rem 4vw 4rem;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(154, 31, 26, 0.1), transparent 50%),
    linear-gradient(180deg, var(--ink), var(--smoke));
  text-align: center;
}

.tl2id-panel h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.5vw, 2.3rem);
  color: var(--gold);
}

.tl2id-panel p {
  margin: 0 auto 1.5rem;
  max-width: 32rem;
  color: var(--mist);
  line-height: 1.6;
}

.tl2id-panel-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
}

/* Footer */
.tl2id-footer {
  padding: 2rem 4vw 2.5rem;
  text-align: center;
  border-top: 1px solid var(--line);
  background: #050403;
}

.tl2id-footer strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--gold);
  margin-bottom: 0.35rem;
}

.tl2id-footer p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--paper-dim);
}

/* —— Modal —— */
.modern-modal {
  display: none;
  position: fixed !important;
  inset: 0 !important;
  left: 0 !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-width: none !important;
  margin: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  padding: 3rem 1rem 2rem !important;
  font-family: 'Be Vietnam Pro', 'Segoe UI', sans-serif;
  background: rgba(0, 0, 0, 0.72) !important;
  -webkit-overflow-scrolling: touch;
  align-items: flex-start;
  justify-content: center;
  box-sizing: border-box !important;
}

.modern-modal.is-open,
.modern-modal[style*="display: block"],
.modern-modal[style*="display:block"],
.modern-modal[style*="display: flex"],
.modern-modal[style*="display:flex"] {
  display: flex !important;
}

.modern-modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  left: 0 !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: rgba(0, 0, 0, 0.78) !important;
  backdrop-filter: blur(3px);
  z-index: 0 !important;
}

.modern-modal-content {
  position: relative !important;
  z-index: 2 !important;
  display: flex !important;
  flex-direction: column !important;
  width: min(440px, 100%);
  max-height: min(92vh, 740px);
  margin: 0 auto;
  background: linear-gradient(165deg, #1a140f 0%, #0c0906 100%) !important;
  border: 1px solid rgba(240, 215, 140, 0.55);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
  animation: tl2id-rise 0.4s ease both;
  color: #fff6e4;
  pointer-events: auto;
  overflow: hidden !important;
}

/* Khóa toàn bộ trang khi popup mở */
body.tl2id-modal-open {
  overflow: hidden !important;
}

body.tl2id-modal-open .wrapper,
body.tl2id-modal-open .tlbb2-id,
body.tl2id-modal-open .tl2id-nav,
body.tl2id-modal-open #main-home,
body.tl2id-modal-open #main-action,
body.tl2id-modal-open #main-sect {
  z-index: 0 !important;
  pointer-events: none !important;
}

body.tl2id-modal-open .tl2id-nav {
  position: absolute !important;
}

.modern-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid rgba(184, 149, 58, 0.3);
  background: linear-gradient(90deg, rgba(154, 31, 26, 0.35), transparent);
  flex-shrink: 0;
}

.modern-modal-title {
  margin: 0;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: #e2c66a;
  letter-spacing: 0.03em;
}

.modern-modal-title i { display: none; }

.modern-close {
  font-size: 1.75rem;
  line-height: 1;
  color: #d8c9a8;
  cursor: pointer;
  padding: 0 0.25rem;
}

.modern-close:hover { color: #e2c66a; }

.modern-modal-body {
  padding: 1.15rem 1.25rem 0.75rem;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Giữ reCAPTCHA/iframe trong vùng scroll, không đè footer */
  isolation: isolate;
  position: relative;
  z-index: 1;
}

.modern-modal-footer {
  flex-shrink: 0;
  position: relative;
  z-index: 30;
  padding: 0.9rem 1.25rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background: #0c0906;
  border-top: 1px solid rgba(240, 215, 140, 0.4);
  box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.35);
}

.modern-modal-footer .modern-btn {
  width: 100%;
  position: relative;
  z-index: 31;
  flex-shrink: 0;
}

/* Nút Đăng ký nhanh — luôn nổi, dễ bấm */
#dk_Nhanh.modern-btn,
.modern-modal-footer #dk_Nhanh {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: 100% !important;
  min-height: 2.85rem;
  background: #1f1810 !important;
  color: #fff6e4 !important;
  border: 1px solid #f0d78c !important;
  order: 1;
}

#dk_Nhanh.modern-btn:hover {
  background: rgba(240, 215, 140, 0.22) !important;
  color: #fff !important;
}

.modern-modal-footer .modern-btn-primary {
  order: 2;
}

.modern-recaptcha {
  display: flex;
  justify-content: center;
  transform-origin: center;
  max-width: 100%;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.modern-recaptcha > div,
.modern-recaptcha iframe {
  max-width: 100%;
}

.modern-form-group {
  margin-bottom: 0.9rem;
}

.modern-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff6e4;
}

.modern-label i { color: #f0d78c; margin-right: 0.25rem; }

.modern-input,
.modern-select {
  width: 100%;
  min-height: 2.7rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid rgba(184, 149, 58, 0.35);
  background: rgba(0, 0, 0, 0.35);
  color: #efe4cf;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.modern-input:focus,
.modern-select:focus {
  border-color: #e2c66a;
}

.modern-input.error,
.modern-form-group.error .modern-input {
  border-color: #c44;
  animation: tl2id-shake 0.4s ease;
}

.modern-select option {
  background: #1a140f;
  color: #efe4cf;
}

.modern-error {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: #e07070;
}

.modern-alert {
  padding: 0.7rem 0.85rem;
  margin-bottom: 0.85rem;
  border: 1px solid rgba(196, 68, 68, 0.45);
  background: rgba(154, 31, 26, 0.2);
  color: #f0c0c0;
  font-size: 0.88rem;
}

.modern-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.7rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.modern-btn:hover { transform: translateY(-1px); }

.modern-btn-primary {
  background: linear-gradient(180deg, #c9332c, #8a1a16);
  color: #fff8ea !important;
  border-color: #f0d78c;
}

.modern-btn-secondary,
.modern-btn-info {
  background: rgba(8, 6, 4, 0.55);
  color: #fff6e4 !important;
  border-color: #f0d78c;
}

.modern-btn-secondary:hover,
.modern-btn-info:hover {
  background: rgba(240, 215, 140, 0.2);
  color: #fff !important;
}

.modern-btn-block { width: 100%; }

.modern-btn.loading {
  opacity: 0.65;
  pointer-events: none;
}

.modern-links {
  width: 100%;
  text-align: center;
  margin-top: 0.35rem;
}

.modern-link {
  font-size: 0.85rem;
  color: #ffe9a8;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.modern-link:hover { color: #fff; }

.modern-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(12, 9, 6, 0.75);
}

body:has(.modern-modal.is-open) .tl2id-nav {
  z-index: 0 !important;
  pointer-events: none;
}

.modern-loading-spinner {
  text-align: center;
  color: #e2c66a;
}

.modern-spinner-ring {
  width: 42px;
  height: 42px;
  margin: 0 auto 0.75rem;
  border: 2px solid rgba(184, 149, 58, 0.25);
  border-top-color: #e2c66a;
  border-radius: 50%;
  animation: tl2id-spin 0.8s linear infinite;
}

.modern-spinner-text {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@keyframes tl2id-rise {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}

@keyframes tl2id-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

@keyframes tl2id-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 640px) {
  .tl2id-nav {
    flex-direction: column;
    align-items: flex-start;
    background: rgba(12, 9, 6, 0.94);
  }

  .tl2id-nav-actions {
    width: 100%;
  }

  .tl2id-nav-actions .tl2id-btn {
    flex: 1;
    min-height: 2.5rem;
    padding: 0.5rem 0.7rem;
    font-size: 0.72rem;
  }

  .modern-modal {
    padding-top: 2rem;
  }

  .modern-modal-content {
    max-height: 94vh;
  }
}

/* Tôn trọng cài đặt giảm chuyển động của hệ điều hành (WCAG 2.3.3) */
@media (prefers-reduced-motion: reduce) {
  .tlbb2-id-page *,
  .tlbb2-id-page *::before,
  .tlbb2-id-page *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
