/* ══════════════════════════════════════════════
   Tu Tiên Võ Đạo — Design System
   Background: hero-wuxia.png (nhân vật hai bên, tối ở giữa)
   ══════════════════════════════════════════════ */

:root {
  --bg: #0a0d10;
  --panel: rgba(12, 8, 5, .88);
  --panel-soft: rgba(22, 14, 9, .82);
  --panel-glass: rgba(14, 10, 7, .72);
  --gold: #f3c567;
  --gold-dim: #9b6229;
  --gold-glow: rgba(243, 197, 103, .12);
  --jade: #48d6b5;
  --jade-glow: rgba(72, 214, 181, .15);
  --red: #b93b2b;
  --red-deep: #5e160f;
  --text: #f8eddb;
  --muted: #cdbb9b;
  --border-gold: rgba(243, 197, 103, .22);
  --border-gold-bright: rgba(243, 197, 103, .4);
  --shadow-heavy: 0 20px 60px rgba(0, 0, 0, .5);
  --radius: 6px;
}

* { box-sizing: border-box; margin: 0; }

html {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  scroll-behavior: smooth;
}

/* ── BODY: ảnh nền cố định toàn trang ── */
body {
  margin: 0;
  min-height: 100vh;
  background-color: #0a0d10;
  background-image: url("/assets/img/hero-wuxia.png");
  background-size: cover;
  background-attachment: fixed;
  background-position: center center;
  background-repeat: no-repeat;
}

/* Lớp overlay mờ trên toàn trang để chữ dễ đọc, nhưng vẫn thấy ảnh */
/* Flexbox sticky footer: footer luôn nằm dưới cùng */
.site {
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
}
/* Phần main content tự giãn ra đẩy footer xuống đáy */
.site > main,
.site > .wrap.section,
.site > .section,
.site > .form {
  flex: 1;
}
.site::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(
    ellipse 70% 60% at 50% 40%,
    rgba(6, 8, 10, .55) 0%,
    rgba(6, 8, 10, .35) 50%,
    rgba(6, 8, 10, .20) 100%
  );
  pointer-events: none;
  z-index: 0;
}
.site > * {
  position: relative;
  z-index: 1;
}

a { color: inherit; text-decoration: none; transition: color .2s, background .2s, border-color .2s; }

/* ══════════════════════════════════════════════
   HERO SECTION (Trang chủ)
   Ảnh nền đã có trên body, hero chỉ cần gradient overlay
   ══════════════════════════════════════════════ */
.hero {
  min-height: 620px;
  /* Không dùng background-image riêng nữa — dùng chung body bg */
  background: linear-gradient(
    180deg,
    rgba(6, 8, 10, .15) 0%,
    rgba(6, 8, 10, .10) 40%,
    rgba(6, 8, 10, .55) 100%
  );
  position: relative;
  overflow: hidden;
}
/* Viền vàng nhẹ dưới hero */
.hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: .4;
}

/* ── TOPBAR (các trang khác ngoài home) ── */
.topbar {
  background: linear-gradient(180deg, rgba(30, 18, 12, .92), rgba(9, 12, 14, .95));
  border-bottom: 1px solid var(--border-gold);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ══════════════════════════════════════════════
   NAVIGATION
   ══════════════════════════════════════════════ */
.nav {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  font-weight: 900;
  color: var(--gold);
  font-size: 24px;
  text-shadow: 0 2px 16px rgba(0, 0, 0, .7);
  letter-spacing: .02em;
}
.brand span {
  display: block;
  color: #fff2ce;
  font-size: 13px;
  font-weight: 600;
  margin-top: 2px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.nav-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav-links a {
  padding: 10px 16px;
  border: 1px solid var(--border-gold);
  background: rgba(18, 10, 6, .6);
  color: #ffe4aa;
  font-weight: 600;
  font-size: 14px;
  border-radius: var(--radius);
  backdrop-filter: blur(6px);
  transition: all .25s ease;
}
.nav-links a:hover {
  background: rgba(185, 59, 43, .65);
  border-color: var(--border-gold-bright);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(185, 59, 43, .3);
}

/* ══════════════════════════════════════════════
   HERO CONTENT
   ══════════════════════════════════════════════ */
.hero-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 80px auto 0;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 30px;
  align-items: end;
}
.hero-copy h1 {
  font-size: clamp(32px, 4.8vw, 62px);
  line-height: 1.05;
  margin: 0 0 18px;
  color: #ffe1a0;
  text-shadow: 0 4px 30px rgba(0, 0, 0, .8), 0 0 60px rgba(243, 197, 103, .15);
  white-space: nowrap;
}
.hero-copy p {
  font-size: 18px;
  color: #fff4df;
  max-width: 620px;
  line-height: 1.7;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .8);
}

/* ══════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════ */
.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 26px;
}
.btn {
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  background: linear-gradient(180deg, #c94433, #6e1a10);
  color: #fff3d1;
  font-weight: 800;
  font-size: 15px;
  border-radius: var(--radius);
  box-shadow:
    inset 0 1px 0 rgba(255, 230, 154, .25),
    0 8px 24px rgba(0, 0, 0, .4);
  transition: all .25s ease;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 230, 154, .35),
    0 12px 32px rgba(185, 59, 43, .5);
  filter: brightness(1.1);
}
.btn.secondary {
  background: linear-gradient(180deg, #3d8a7e, #153e44);
}
.btn.secondary:hover {
  box-shadow:
    inset 0 1px 0 rgba(72, 214, 181, .3),
    0 12px 32px rgba(72, 214, 181, .3);
}
.btn.ghost {
  background: rgba(14, 11, 8, .72);
  border: 1px solid var(--border-gold);
  backdrop-filter: blur(8px);
}
.btn.ghost:hover {
  border-color: var(--border-gold-bright);
  background: rgba(30, 18, 10, .85);
}

.mini-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.mini-actions a {
  padding: 9px 14px;
  background: rgba(10, 8, 6, .7);
  border: 1px solid var(--border-gold);
  color: #ffe3aa;
  font-weight: 800;
  border-radius: var(--radius);
  backdrop-filter: blur(6px);
  transition: all .2s;
}
.mini-actions a:hover {
  background: rgba(185, 59, 43, .65);
  border-color: var(--border-gold-bright);
}

/* ══════════════════════════════════════════════
   STATS
   ══════════════════════════════════════════════ */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--border-gold);
  padding: 20px;
  min-height: 96px;
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  transition: border-color .3s, box-shadow .3s;
}
.stat:hover {
  border-color: var(--border-gold-bright);
  box-shadow: 0 0 20px var(--gold-glow);
}
.stat b {
  display: block;
  font-size: 32px;
  color: var(--jade);
  text-shadow: 0 0 20px var(--jade-glow);
}
.stat span {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: 4px;
  display: block;
}

/* ══════════════════════════════════════════════
   LAYOUT
   ══════════════════════════════════════════════ */
.wrap {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}
.section { padding: 54px 0; }

.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.three { grid-template-columns: repeat(3, 1fr); }

/* ══════════════════════════════════════════════
   CARDS & PANELS
   ══════════════════════════════════════════════ */
.card, .panel {
  background: var(--panel);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow-heavy);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color .3s, transform .3s;
}
.card:hover {
  border-color: var(--border-gold-bright);
  transform: translateY(-2px);
}
.card {
  padding: 24px;
}
.card h3, .panel h2 {
  margin: 0 0 12px;
  color: #ffd98b;
}
.muted { color: var(--muted); }

.tag {
  display: inline-block;
  color: #1c1a13;
  background: var(--gold);
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 800;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 8px;
}

/* ══════════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════════ */
.form {
  max-width: 520px;
  margin: 36px auto;
  padding: 32px;
  background: var(--panel);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-heavy);
}
.form h1 {
  margin-top: 0;
  color: var(--gold);
  font-size: 26px;
}
.field { margin-bottom: 16px; }
.field label {
  display: block;
  color: #f8db9c;
  font-weight: 700;
  margin-bottom: 7px;
  font-size: 14px;
}
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--border-gold);
  background: rgba(10, 7, 5, .7);
  color: #fff5e0;
  padding: 12px 14px;
  outline: none;
  border-radius: 4px;
  font-size: 15px;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 12px var(--gold-glow);
}
.field textarea { min-height: 110px; resize: vertical; }

/* ══════════════════════════════════════════════
   ALERTS
   ══════════════════════════════════════════════ */
.alert {
  margin: 12px auto;
  width: min(1180px, calc(100% - 32px));
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(15, 11, 8, .85);
  border-radius: var(--radius);
  font-weight: 600;
  backdrop-filter: blur(8px);
}
.alert.success { border-color: #3bc79e; color: #bafbe9; background: rgba(11, 30, 24, .85); }
.alert.danger  { border-color: #e45c4d; color: #ffd3cd; background: rgba(35, 10, 8, .85); }
.alert.warning { border-color: #ecc15f; color: #ffedbd; background: rgba(35, 25, 8, .85); }

/* ══════════════════════════════════════════════
   TABLES
   ══════════════════════════════════════════════ */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(8px);
}
.table th, .table td {
  text-align: left;
  border-bottom: 1px solid rgba(243, 197, 103, .12);
  padding: 14px 16px;
}
.table th {
  color: #ffd98b;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: rgba(30, 18, 10, .5);
}
.table tr:hover td {
  background: rgba(243, 197, 103, .04);
}

.rank-table td:first-child { font-weight: 900; color: var(--gold); }
.rank-top { color: var(--jade) !important; font-size: 18px; }

.empty-state {
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

/* ══════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════ */
.footer {
  padding: 30px 0;
  color: var(--muted);
  border-top: 1px solid var(--border-gold);
  background: rgba(6, 8, 10, .88);
  backdrop-filter: blur(10px);
  text-align: center;
  font-size: 14px;
}

/* ══════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════ */
@media (max-width: 850px) {
  .hero { min-height: 500px; }
  .hero-copy h1 { white-space: normal; font-size: 36px; }
  .hero-inner {
    grid-template-columns: 1fr;
    margin-top: 40px;
  }
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .nav {
    height: auto;
    padding: 16px 0;
    flex-direction: column;
    gap: 12px;
  }
  .nav-links {
    justify-content: center;
    margin-top: 0;
  }
}
