/* ════════════════════════════════════════════════════
   Rạng Rỡ Banker Mùa 3 - Bikini Ranking
   Design: Dark editorial + gold accent
   ════════════════════════════════════════════════════ */

/* ─── Reset & Base ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}



body {
  font-family: 'Outfit', 'Inter', -apple-system, sans-serif;
  background: #0a0b12;
  color: #e8e6e3;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: none;
}

a { color: #d4a853; text-decoration: none; transition: color .3s; }
a:hover { color: #e4c06a; }

img { max-width: 100%; display: block; }

/* ─── Navigation ───────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 11, 18, .85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(212, 168, 83, .1);
  contain: layout;
}

.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  color: #d4a853;
  font-size: 20px;
}

.brand-text {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .12em;
  color: #e8e6e3;
}

.nav-links { display: flex; gap: 28px; }
.nav-links a {
  color: #9a988f;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .04em;
  transition: color .3s;
}
.nav-links a:hover { color: #d4a853; }

/* ─── Hero ─────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 24px 80px;
  overflow-x: hidden;
}

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

.hero-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 20%, rgba(212, 168, 83, .12) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(212, 168, 83, .06) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 20% 60%, rgba(180, 130, 50, .08) 0%, transparent 50%);
}

.hero-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transform: translateZ(0);
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(212, 168, 83, .25) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 70% 50%, rgba(212, 168, 83, .12) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 80%, rgba(212, 168, 83, .15) 0%, transparent 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 800px;
}

.hero-badge {
  display: inline-block;
  padding: 6px 18px;
  border: 1px solid rgba(212, 168, 83, .3);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .18em;
  color: #d4a853;
  margin-bottom: 28px;
  text-transform: uppercase;
}

.hero-title {
  margin-bottom: 20px;
}

.title-line {
  display: block;
  font-size: clamp(36px, 8vw, 80px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.03em;
  color: #f0ede8;
  padding: 0.05em 0;
}

.title-line.accent {
  background: linear-gradient(135deg, #d4a853, #e4c06a, #d4a853);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: clamp(16px, 2.2vw, 20px);
  color: #9a988f;
  max-width: 500px;
  margin: 0 auto 40px;
  line-height: 1.5;
  font-weight: 400;
}

.hero-stats {
  display: inline-flex;
  align-items: center;
  gap: 32px;
  padding: 24px 40px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(212, 168, 83, .15);
  border-radius: 16px;
  backdrop-filter: blur(10px);
}

.stat-item { text-align: center; }

.stat-number {
  display: block;
  font-size: 32px;
  font-weight: 800;
  color: #d4a853;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 13px;
  color: #9a988f;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: rgba(212, 168, 83, .2);
}

.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #9a988f;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  animation: bounce 2s infinite;
}

.scroll-arrow {
  font-size: 18px;
  color: #d4a853;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

/* ─── Sections ─────────────────────────────────── */
.ranking {
  max-width: 1400px;
  margin: 0 auto;
  padding: 80px 24px 120px;
  content-visibility: auto;
  contain-intrinsic-size: 1200px;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  color: #f0ede8;
  margin-bottom: 12px;
}

.section-desc {
  color: #9a988f;
  font-size: 16px;
}

/* ─── Category Tabs ────────────────────────────── */
.category-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  flex-wrap: wrap;
  justify-content: center;
}

.cat-tab {
  padding: 10px 24px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(212, 168, 83, .12);
  border-radius: 100px;
  color: #9a988f;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all .3s;
  white-space: nowrap;
}

.cat-tab:hover {
  border-color: rgba(212, 168, 83, .3);
  color: #d4a853;
  background: rgba(212, 168, 83, .06);
}

.cat-tab.active {
  background: rgba(212, 168, 83, .15);
  border-color: #d4a853;
  color: #d4a853;
  font-weight: 600;
}

.cat-tab .cat-count {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  background: rgba(212, 168, 83, .1);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: #d4a853;
}

.cat-tab.active .cat-count {
  background: rgba(212, 168, 83, .2);
}

/* ─── Filter Bar ───────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 16px;
  margin-bottom: 40px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 280px;
  max-width: 480px;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #6b6a63;
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 14px 16px 14px 48px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(212, 168, 83, .12);
  border-radius: 12px;
  color: #e8e6e3;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color .3s, background .3s;
}

.search-box input::placeholder { color: #6b6a63; }
.search-box input:focus {
  border-color: rgba(212, 168, 83, .4);
  background: rgba(255, 255, 255, .06);
}

.sort-box {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #9a988f;
  font-size: 14px;
}

.sort-box select {
  padding: 12px 16px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(212, 168, 83, .12);
  border-radius: 12px;
  color: #e8e6e3;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  transition: border-color .3s;
}

.sort-box select:focus { border-color: rgba(212, 168, 83, .4); }
.sort-box select option { background: #1a1b24; color: #e8e6e3; }

/* ─── Loading Skeleton ─────────────────────────── */
.loading-skeleton { margin: 40px 0; }

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.skeleton-card {
  background: rgba(255, 255, 255, .03);
  border-radius: 16px;
  overflow: hidden;
  padding: 0;
}

.sk-img {
  height: 240px;
  background: linear-gradient(90deg, rgba(255,255,255,.03) 25%, rgba(255,255,255,.06) 50%, rgba(255,255,255,.03) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite;
}

.sk-line {
  height: 14px;
  margin: 16px 16px 8px;
  background: linear-gradient(90deg, rgba(255,255,255,.03) 25%, rgba(255,255,255,.06) 50%, rgba(255,255,255,.03) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite;
  border-radius: 4px;
}

.sk-line.w-60 { width: 60%; }
.sk-line.w-40 { width: 40%; }
.sk-line.w-30 { width: 30%; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Error State ──────────────────────────────── */
.error-state {
  text-align: center;
  padding: 80px 24px;
}

.error-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(200, 60, 60, .15);
  color: #e85555;
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.error-state h3 {
  font-size: 22px;
  margin-bottom: 8px;
  color: #e8e6e3;
}

.error-state p { color: #9a988f; margin-bottom: 24px; }

.btn-retry {
  padding: 12px 32px;
  background: #d4a853;
  color: #0a0b12;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .3s, transform .2s;
}

.btn-retry:hover { background: #e4c06a; transform: translateY(-1px); }
.btn-retry:active { transform: scale(.98); }

/* ─── Contestant Grid ──────────────────────────── */
.contestant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin: 0 auto;
}

.contestant-card {
  position: relative;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(212, 168, 83, .08);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .4s cubic-bezier(.16,1,.3,1), border-color .4s;
  contain: content;
}

.card-enter {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .5s cubic-bezier(.16,1,.3,1), transform .5s cubic-bezier(.16,1,.3,1);
}

.card-enter[style*="opacity: 1"] {
  opacity: 1;
  transform: translateY(0);
}

.contestant-card:hover {
  transform: translateY(-4px) translateZ(0);
  border-color: rgba(212, 168, 83, .35);
  box-shadow: 0 4px 20px rgba(212, 168, 83, .08);
}

.card-image-wrap {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: rgba(255,255,255,.02);
  min-height: 200px;
}

.card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s cubic-bezier(.16,1,.3,1);
}

.contestant-card:hover .card-img { transform: scale(1.05) translateZ(0); }

.card-sbd {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 12px;
  background: rgba(10, 11, 18, .75);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(212, 168, 83, .2);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #d4a853;
  letter-spacing: .06em;
}

.card-score {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 14px;
  background: rgba(212, 168, 83, .15);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(212, 168, 83, .25);
  border-radius: 8px;
  font-size: 16px;
  font-weight: 800;
  color: #d4a853;
}

.card-body {
  padding: 20px;
}

.card-name {
  font-size: 17px;
  font-weight: 700;
  color: #f0ede8;
  margin-bottom: 4px;
  line-height: 1.3;
}

.card-bank {
  font-size: 14px;
  color: #9a988f;
  font-weight: 400;
  margin-bottom: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-stats {
  display: flex;
  gap: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(212, 168, 83, .08);
}

.card-stat {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: #9a988f;
}

.card-stat .stat-val { font-weight: 600; color: #e8e6e3; }

.card-stat-icon {
  font-size: 14px;
  opacity: .6;
}

.card-fb-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  font-size: 11px;
  color: #d4a853;
  font-weight: 500;
  letter-spacing: .04em;
}

.has-fb { border-color: rgba(212, 168, 83, .2); }

/* ─── Empty state ──────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: #9a988f;
  grid-column: 1 / -1;
}

/* ─── Lightbox (full-res image viewer) ─────────── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,.92);
  align-items: center;
  justify-content: center;
  padding: 40px;
  cursor: zoom-out;
}

.lightbox.active { display: flex; }

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 80px rgba(0,0,0,.6);
  animation: lightboxIn .3s cubic-bezier(.16,1,.3,1);
}

@keyframes lightboxIn {
  from { opacity: 0; transform: scale(.92); }
  to { opacity: 1; transform: scale(1); }
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(0,0,0,.5);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .3s;
  z-index: 10;
}

.lightbox-close:hover { background: rgba(255,255,255,.15); }

/* ─── Modal ────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.active { display: flex; }

.modal {
  position: relative;
  width: 100%;
  max-width: 800px;
  max-height: 90dvh;
  background: #12131e;
  border: 1px solid rgba(212, 168, 83, .15);
  border-radius: 20px;
  overflow: hidden;
  overflow-y: auto;
  animation: modalIn .4s cubic-bezier(.16,1,.3,1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(.95) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: sticky;
  top: 16px;
  float: right;
  margin: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(212, 168, 83, .2);
  background: rgba(10, 11, 18, .8);
  color: #e8e6e3;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background .3s;
}

.modal-close:hover { background: rgba(212, 168, 83, .2); }

.modal-content { padding: 0 24px 24px; }

.modal-img-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 24px;
  cursor: zoom-in;
  background: rgba(0,0,0,.3);
}

.modal-img-wrap:hover .modal-img-expand { opacity: 1; }

.modal-img-expand {
  position: absolute;
  bottom: 12px;
  right: 12px;
  padding: 6px 14px;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
  border-radius: 8px;
  font-size: 12px;
  color: #fff;
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}

.modal-img {
  display: block;
  width: 100%;
  max-height: 500px;
  object-fit: contain;
}

.modal-name {
  font-size: 24px;
  font-weight: 700;
  color: #f0ede8;
  margin-bottom: 4px;
}

.modal-bank {
  font-size: 15px;
  color: #9a988f;
  margin-bottom: 20px;
}

.modal-stats {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
  padding: 16px 20px;
  background: rgba(255,255,255,.03);
  border-radius: 12px;
}

.modal-stat-item { text-align: center; }
.modal-stat-item .num { font-size: 20px; font-weight: 700; color: #d4a853; }
.modal-stat-item .lbl { font-size: 12px; color: #6b6a63; text-transform: uppercase; letter-spacing: .06em; }

.modal-caption {
  background: rgba(255,255,255,.02);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.7;
  color: #c8c5bf;
  max-height: 300px;
  overflow-y: auto;
}

.modal-fb-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(212, 168, 83, .1);
  border: 1px solid rgba(212, 168, 83, .25);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #d4a853;
  transition: background .3s, transform .2s;
}

.modal-fb-link:hover { background: rgba(212, 168, 83, .2); transform: translateY(-1px); }

.modal-no-fb {
  padding: 20px;
  text-align: center;
  color: #6b6a63;
  font-size: 14px;
}

/* ─── About Section ────────────────────────────── */
.about {
  background: rgba(255,255,255,.02);
  border-top: 1px solid rgba(212, 168, 83, .06);
  border-bottom: 1px solid rgba(212, 168, 83, .06);
  content-visibility: auto;
  contain-intrinsic-size: 400px;
}

.about-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 80px 24px;
  text-align: center;
}

.about-inner h2 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 40px;
  color: #f0ede8;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

.rule-card {
  padding: 32px 20px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(212, 168, 83, .08);
  border-radius: 16px;
  transition: border-color .3s;
}

.rule-card:hover { border-color: rgba(212, 168, 83, .2); }

.rule-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.rule-card h3 {
  font-size: 18px;
  font-weight: 600;
  color: #f0ede8;
  margin-bottom: 6px;
}

.rule-card p { color: #9a988f; font-size: 14px; }

.about-note {
  color: #9a988f;
  font-size: 15px;
  line-height: 1.7;
}

.about-note strong { color: #d4a853; }

/* ─── Footer ───────────────────────────────────── */
.footer {
  text-align: center;
  padding: 40px 24px;
  color: #6b6a63;
  font-size: 14px;
  line-height: 1.8;
}

.footer-sub { font-size: 12px; }

/* ─── Scrollbar ────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(212, 168, 83, .2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(212, 168, 83, .35); }

/* ─── Responsive ───────────────────────────────── */
@media (max-width: 768px) {
  .nav-inner { height: 56px; }
  .nav-links { display: none; }

  .hero { padding: 100px 20px 60px; }
  .hero-stats { flex-direction: column; gap: 16px; padding: 20px 28px; }
  .stat-divider { width: 40px; height: 1px; }
  .stat-number { font-size: 26px; }

  .filter-bar { flex-direction: column; align-items: stretch; }
  .search-box { max-width: none; min-width: 0; }
  .sort-box { justify-content: space-between; }

  .contestant-grid { grid-template-columns: 1fr; gap: 16px; }
  .card-image-wrap { height: 220px; }

  .rules-grid { grid-template-columns: 1fr; }
  .skeleton-grid { grid-template-columns: 1fr; }

  .modal { max-width: 100%; border-radius: 16px; margin: 12px; }
  .modal-stats { flex-wrap: wrap; gap: 16px; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .contestant-grid { grid-template-columns: repeat(2, 1fr); }
  .skeleton-grid { grid-template-columns: repeat(2, 1fr); }
}
