:root {
  --ink: #123f43;
  --muted: #667d7e;
  --jade: #187878;
  --jade-2: #0d5558;
  --line: #d4e6df;
  --gold: #e7bd65;
  --gold-2: #9d6632;
  --paper: #fbfdf9;
  --panel: rgba(255, 255, 255, .88);
  --shadow: 0 20px 46px rgba(16, 68, 70, .11);
  --soft-shadow: 0 10px 28px rgba(16, 68, 70, .08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: #20393b;
  font-family: "Segoe UI", Arial, sans-serif;
  background:
    linear-gradient(180deg, #edf8f4 0, #fbfdf9 360px, #f7fbf7 64%, #eef8f4 100%),
    repeating-linear-gradient(90deg, rgba(20, 100, 96, .025) 0 1px, transparent 1px 12px),
    #f7fbf9;
}

a { color: inherit; text-decoration: none; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .74));
  box-shadow: 0 8px 30px rgba(25, 78, 78, .08);
  backdrop-filter: blur(12px);
}

.header-inner,
.container,
.quick-actions,
.footer-inner {
  width: min(1050px, calc(100% - 40px));
  margin-inline: auto;
}

.header-inner {
  min-height: 78px;
  display: grid;
  grid-template-columns: 320px 1fr;
  align-items: center;
  gap: 20px;
}

.logo {
  position: relative;
  display: flex;
  align-items: center;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  font-style: italic;
  font-weight: 900;
  line-height: .9;
  text-decoration: none;
  min-width: 300px; /* Tăng chiều rộng vùng logo để không bị đè */
}

.header-logo-img {
  height: 150px; /* Điều chỉnh lại kích thước một chút cho cân đối */
  width: auto;
  object-fit: contain;
  position: absolute;
  top: -40px; /* Đưa top về 0 để không bị mất góc trên */
  left: -10px;
  z-index: 100;
  /* Tạo hiệu ứng viền (stroke) và bóng đổ để logo nổi bật */
  filter:
    drop-shadow(1px 1px 0px #fff)
    drop-shadow(-1px -1px 0px #fff)
    drop-shadow(1px -1px 0px #fff)
    drop-shadow(-1px 1px 0px #fff)
    drop-shadow(0 12px 25px rgba(0, 0, 0, 0.3));
  pointer-events: none;
}

.logo-text {
  margin-left: 130px; /* Đẩy chữ sang bên cạnh để logo không đè lên */
  position: relative;
  z-index: 101;
}


.main-nav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  background: transparent;
  box-shadow: none;
}

.main-nav a {
  height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  color: #315456;
  font-weight: 750;
  font-size: 15px;
  border-radius: 999px;
  white-space: nowrap;
  transition: color .18s ease, background .18s ease, box-shadow .18s ease;
}

.main-nav a.active,
.main-nav a:hover {
  color: white;
  background: linear-gradient(180deg, #238a87, #0d5a5e);
  box-shadow: 0 8px 18px rgba(13, 85, 88, .18);
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: clamp(450px, 42vw, 700px); /* Giảm nhẹ chiều cao để ảnh không bị kéo dãn quá mức */
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0) 72%, rgba(237, 248, 244, .92) 100%),
    linear-gradient(90deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, 0) 42%),
    url("img/bg.jpg") center center / 100% auto no-repeat;
}

.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 170px;
  background:
    linear-gradient(180deg, rgba(237, 248, 244, 0), rgba(247, 251, 247, .96) 72%, #f7fbf7 100%);
  pointer-events: none;
}

main {
  position: relative;
  z-index: 1;
  padding-bottom: 8px;
}

.quick-actions {
  margin-top: -64px;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .74);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .66), rgba(237, 248, 244, .44));
  box-shadow: 0 16px 42px rgba(16, 68, 70, .12);
  backdrop-filter: blur(8px);
}

.action {
  min-height: 78px;
  display: grid;
  grid-template-columns: 46px 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: white;
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, 0)),
    linear-gradient(135deg, #247f7b, #104f55);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .24);
  position: relative;
  overflow: hidden;
  transition: transform .18s ease, filter .18s ease;
  will-change: transform;
}

.action::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, .28);
  pointer-events: none;
}

.action:hover {
  transform: translateY(-3px);
  filter: brightness(1.05);
}

.action.gold {
  color: #5d3919;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .25), rgba(255, 255, 255, 0)),
    linear-gradient(135deg, #f5d98b, #c9913f);
}

.action.blue { background: linear-gradient(135deg, #368d9b, #155b70); }
.action.red { background: linear-gradient(135deg, #b5533f, #7f2e28); }
.action.purple { background: linear-gradient(135deg, #67639c, #3f416f); }

.action-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, .72);
  border-radius: 6px;
  background: rgba(255, 255, 255, .12);
}

.action-icon svg {
  width: 27px;
  height: 27px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.action strong {
  display: block;
  font-size: 20px;
  line-height: 1.05;
}

.action span span {
  display: block;
  margin-top: 4px;
  opacity: .86;
  font-size: 14px;
}

.container { margin-top: 38px; }

.section-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
  color: var(--ink);
  font-size: 27px;
  line-height: 1.1;
}

.section-title::before {
  content: "";
  width: 8px;
  height: 30px;
  background: linear-gradient(180deg, #2d9591, #d9b35c);
  border-radius: 2px;
}

.slider {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(212, 230, 223, .9);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.slides {
  width: 300%;
  display: flex;
  transform: translate3d(0, 0, 0);
  transition: transform .45s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  backface-visibility: hidden;
}

.slide {
  width: 33.3333%;
  flex: 0 0 33.3333%;
  min-height: 380px;
  position: relative;
  overflow: hidden;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.slide-content { display: none; }


.slide-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  color: #ffe7a4;
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
  border: 1px solid rgba(255, 231, 164, .58);
  border-radius: 3px;
}

.slide h2 {
  margin: 18px 0 12px;
  font-size: clamp(31px, 4vw, 54px);
  line-height: 1.02;
}

.slide p {
  margin: 0;
  color: rgba(255, 255, 255, .86);
  font-size: 18px;
  line-height: 1.55;
}

/* Nút điều hướng nằm trong Slider */
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(4px);
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
  padding: 0;
  line-height: 0;
}

.slider-btn i {
  display: block;
}

.slider-btn.prev i {
  margin-right: 2px; /* Bù trừ thị giác cho icon mũi tên trái */
}

.slider-btn.next i {
  margin-left: 2px; /* Bù trừ thị giác cho icon mũi tên phải */
}


.slider-btn:hover {
  background: var(--jade);
  border-color: var(--jade);
  box-shadow: 0 0 15px rgba(24, 120, 120, 0.4);
}

.slider-btn.prev { left: 20px; }
.slider-btn.next { right: 20px; }

/* Bullets nằm trong Slider */
.dots {
  position: absolute;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 10;
  padding: 8px 15px;
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(4px);
  border-radius: 20px;
}

.dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.3s ease;
}

.dot.active {
  background: #ffe7a4;
  transform: scale(1.3);
  box-shadow: 0 0 8px #ffe7a4;
}


.rank-social {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 388px;
  gap: 28px;
  align-items: stretch;
}

.rank-board,
.fanpage-card,
.video-section {
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.rank-board {
  overflow: hidden;
  border: 1px solid rgba(210, 176, 91, .34);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .94), rgba(250, 252, 247, .9)),
    #fff;
}

.rank-head {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  color: white;
  background:
    linear-gradient(135deg, rgba(13, 72, 73, .96), rgba(24, 114, 110, .9)),
    radial-gradient(circle at 88% 12%, rgba(255, 218, 132, .35), transparent 28%);
}

.rank-eyebrow,
.fanpage-head span,
.video-head span {
  display: block;
  color: #e7c46d;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.rank-head h2,
.fanpage-head h2,
.video-head h2 {
  margin: 4px 0 0;
  font-size: 25px;
  line-height: 1.05;
}

.rank-tabs {
  display: flex;
  gap: 6px;
  padding: 3px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .12);
}

.rank-tabs button {
  height: 32px;
  padding: 0 11px;
  color: rgba(255, 255, 255, .88);
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  border: 0;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

.rank-tabs button.active {
  color: #5f3718;
  background: linear-gradient(180deg, #ffe7a4, #d7a34d);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .16);
}

.ranking {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  table-layout: fixed; /* Khóa chiều rộng cột để không bị nhảy khi load dữ liệu */
}

.ranking th,
.ranking td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  transition: background .2s ease;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap; /* Tuyệt đối không xuống dòng */
}

.ranking th {
  color: var(--jade-2);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  background: rgba(24, 120, 120, 0.05);
  position: sticky;
  top: 0;
  z-index: 1;
}

/* Định nghĩa chiều rộng và căn lề cố định cho từng loại cột */

/* Cột Hạng: Luôn là cột đầu tiên */
.ranking th:nth-child(1),
.ranking td:nth-child(1) {
  width: 65px;
  text-align: center;
}

/* Cột Tên: Luôn là cột thứ hai, chiếm tối đa không gian còn lại */
.ranking th:nth-child(2),
.ranking td:nth-child(2) {
  text-align: left;
}

/* Xử lý căn lề linh hoạt cho bảng 3 cột và 4 cột */

/* Nếu là bảng 4 cột (Top Cao Thủ) */
.ranking.rank-power th:nth-child(3),
.ranking.rank-power td:nth-child(3) {
  width: 75px;
  text-align: center;
}

.ranking.rank-power th:nth-child(4),
.ranking.rank-power td:nth-child(4) {
  width: 140px;
  text-align: right;
  color: var(--gold-2);
  font-weight: 700;
}

/* Nếu là bảng 3 cột (Top Tài Phú) */
.ranking.rank-wealth th:nth-child(3),
.ranking.rank-wealth td:nth-child(3) {
  width: 150px;
  text-align: right;
  color: var(--gold-2);
  font-weight: 700;
}

.ranking tr:last-child td { border-bottom: none; }
.ranking tr:nth-child(even) td { background: rgba(237, 248, 244, 0.25); }
.ranking tr:hover td { background: rgba(217, 179, 92, 0.12); }

.rank-badge {
  width: 26px; /* Thu nhỏ huy hiệu */
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 900;
  font-size: 14px; /* Thu nhỏ font số */
  border-radius: 6px;
  position: relative;
  transition: transform .2s ease;
  font-family: Georgia, serif;
}

.rank-badge.one {
  background: linear-gradient(135deg, #ffd777 0%, #b87922 100%);
  box-shadow: 0 4px 10px rgba(184, 121, 34, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.4);
  transform: scale(1.1);
}

.rank-badge.two {
  background: linear-gradient(135deg, #e7edf0 0%, #8b9ba2 100%);
  box-shadow: 0 4px 10px rgba(139, 155, 162, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.rank-badge.three {
  background: linear-gradient(135deg, #f0b088 0%, #a95832 100%);
  box-shadow: 0 4px 10px rgba(169, 88, 50, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.rank-badge.normal {
  width: 22px;
  height: 22px;
  color: var(--muted);
  font-size: 12px;
  background: rgba(20, 100, 96, 0.05);
  border: 1px solid var(--line);
  box-shadow: none;
}

.character {
  display: flex;
  flex-direction: column;
  gap: 0; /* Loại bỏ gap để tiết kiệm chiều cao */
  line-height: 1.2;
}

.character strong { color: #193c40; }
.character span { color: var(--muted); font-size: 12px; }

.fanpage-card {
  overflow: hidden;
  border: 1px solid rgba(212, 230, 223, .9);
  background: var(--panel);
  width: 388px;
  max-width: 100%;
}

.fanpage-head {
  padding: 14px 18px;
  color: white;
  background:
    linear-gradient(135deg, rgba(25, 83, 96, .96), rgba(35, 119, 126, .9)),
    radial-gradient(circle at 92% 12%, rgba(255, 255, 255, .28), transparent 25%);
}

.fanpage-card iframe {
  display: block;
  width: 100%;
  height: 472px;
  background: transparent; /* Chỉnh thành trong suốt */
}

.video-section {
  overflow: hidden;
  border: 1px solid rgba(212, 230, 223, .9);
  background: var(--panel);
}

.video-head {
  padding: 22px 24px 18px;
  color: white;
  background: linear-gradient(135deg, #123f43, #1a807b);
}

.video-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 22px;
}

.video-card {
  aspect-ratio: 16 / 9;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: white;
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .02), rgba(0, 0, 0, .52)),
    url("img/bg.jpg") center 58% / cover;
}

.video-card h3 {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 22px;
  margin: 0;
  font-size: 28px;
  line-height: 1.12;
  text-shadow: 0 3px 12px rgba(0, 0, 0, .56);
}

.play {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  padding-left: 7px;
  color: white;
  font-size: 42px;
  border: 3px solid rgba(255, 255, 255, .86);
  border-radius: 50%;
  background: rgba(13, 85, 88, .78);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .28);
}

.group-face-card {
  aspect-ratio: 16 / 9;
  display: block;
  overflow: hidden;
  border-radius: 6px;
  background: #5a1514;
  box-shadow: inset 0 0 0 1px rgba(255, 224, 153, .35);
}

.group-face-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  transition: transform .25s ease;
}

.group-face-card:hover img {
  transform: scale(1.025);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 34px;
}

.info-card {
  min-height: 144px;
  padding: 20px;
  border: 1px solid rgba(212, 230, 223, .9);
  border-radius: 8px;
  background: rgba(255, 255, 255, .82);
  box-shadow: var(--soft-shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}

.info-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(16, 68, 70, .12);
}

.info-card b {
  color: var(--jade-2);
  font-size: 31px;
}

.info-card h3 {
  margin: 14px 0 8px;
  color: var(--ink);
  font-size: 20px;
}

.info-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.video-section, .rank-social, .info-grid {
  content-visibility: auto;
  contain-intrinsic-size: 500px;
}

.site-footer {
  margin-top: 54px;
  padding: 34px 0;
  border-top: 1px solid rgba(212, 230, 223, .9);
  background:
    linear-gradient(180deg, rgba(238, 248, 244, .72), rgba(225, 241, 235, .94));
}

.footer-inner {
  display: grid;
  grid-template-columns: 230px 1fr 170px;
  align-items: center;
  gap: 26px;
  color: #668083;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 14px;
}

.age {
  justify-self: end;
  width: 76px;
  min-height: 60px;
  display: grid;
  place-items: center;
  color: #285f68;
  font-size: 34px;
  font-weight: 900;
  border: 4px solid #4d8189;
  border-radius: 6px;
  background: white;
}

@media (max-width: 1120px) {
  .header-inner { grid-template-columns: 1fr; }

  .main-nav {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .quick-actions,
  .rank-social,
  .video-layout,
  .info-grid,
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }

  .footer-inner .logo,
  .footer-links {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .header-inner,
  .quick-actions,
  .rank-social,
  .video-layout,
  .info-grid,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 480px;
    background-size: cover; /* Trên mobile dùng cover để lấp đầy màn hình dọc */
    background-position: 50% top;
  }

  .quick-actions { margin-top: 18px; }

  .slide {
    min-height: 260px;
    padding: 28px 24px;
  }

  .rank-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .rank-tabs {
    width: 100%;
  }

  .rank-tabs button {
    flex: 1;
  }

  .ranking th,
  .ranking td {
    padding: 12px 10px;
    font-size: 14px;
  }

  .ranking th:nth-child(4),
  .ranking td:nth-child(4) {
    display: none;
  }

  .age { justify-self: stretch; }
}

/* Modal Download CSS */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.75); /* Tăng độ tối thay vì dùng blur */
  animation: fadeIn 0.2s ease-out;
  will-change: opacity;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: white;
  margin: 10% auto;
  width: 95%;
  max-width: 480px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transform: translateY(0);
  animation: modalSlideUp 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  will-change: transform, opacity;
}

@keyframes modalSlideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  padding: 20px 24px;
  background: linear-gradient(135deg, #187878, #0d5558);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 22px;
  font-family: 'Oswald', sans-serif;
  letter-spacing: 1px;
}

.close-modal {
  color: white;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
}

.close-modal:hover {
  color: #e7bd65;
}

.modal-body {
  padding: 30px 24px;
  text-align: center;
}

.modal-body p {
  color: #667d7e;
  margin-bottom: 25px;
}

.download-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dl-btn {
  padding: 14px 20px;
  border-radius: 8px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s ease;
  font-size: 16px;
}

.dl-btn.direct {
  background: linear-gradient(180deg, #f5d98b, #c9913f);
  color: #5d3919;
}

.dl-btn.gdrive {
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.dl-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dl-btn.gdrive:hover {
  background: linear-gradient(180deg, #60a5fa, #2563eb);
}

.dl-note {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px dashed #d4e6df;
}

.dl-note p {
  font-size: 13px;
  margin: 0;
  color: #94a3b8;
}

