/* vodanh.css — Tiên Nhân Vô Danh: Thiên Địa Bảng Vàng (Bảng Xếp Hạng) */

.vodanh-window {
  width: min(840px, 96%);
  height: min(92%, 760px);
  max-height: 94%;
  background: radial-gradient(circle at 50% 0%, rgba(26, 32, 53, 0.96), rgba(13, 17, 30, 0.98));
  border: 1px solid rgba(251, 191, 36, 0.45);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 35px rgba(234, 179, 8, 0.2);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  color: #f8fafc;
  font-family: inherit;
  backdrop-filter: blur(16px);
  animation: vodanhPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes vodanhPop {
  0% { transform: scale(0.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Header */
.vodanh-header {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: linear-gradient(180deg, rgba(30, 58, 138, 0.35) 0%, rgba(15, 23, 42, 0.65) 100%);
  border-bottom: 1px solid rgba(251, 191, 36, 0.3);
}

.vodanh-npc-card {
  display: flex;
  align-items: center;
  gap: 14px;
}

.vodanh-avatar-frame {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 2px solid #fbbf24;
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.4);
  overflow: hidden;
  background: #0f172a;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vodanh-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.vodanh-npc-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.vodanh-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 10px;
  font-weight: 800;
  color: #0f172a;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.vodanh-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #f8fafc;
  text-shadow: 0 0 10px rgba(234, 179, 8, 0.35);
}

.vodanh-subtitle {
  margin: 0;
  font-size: 12px;
  color: #94a3b8;
}

/* Speech Box */
.vodanh-speech {
  flex-shrink: 0;
  padding: 10px 20px;
  background: rgba(15, 23, 42, 0.65);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  line-height: 1.45;
  color: #e2e8f0;
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 8px;
}

.vodanh-speech-quote {
  font-size: 22px;
  color: #fbbf24;
  font-style: normal;
  line-height: 1;
}

/* Tabs */
.vodanh-tabs {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(15, 23, 42, 0.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.vodanh-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(30, 41, 59, 0.6);
  color: #cbd5e1;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.vodanh-tab-btn:hover {
  background: rgba(51, 65, 85, 0.8);
  color: #fff;
  border-color: rgba(251, 191, 36, 0.4);
}

.vodanh-tab-btn.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(30, 58, 138, 0.4));
  border-color: #fbbf24;
  color: #fde047;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.25);
}

/* Body */
.vodanh-body {
  padding: 16px 20px 32px;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior: contain;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(251, 191, 36, 0.45) rgba(15, 23, 42, 0.6);
}

.vodanh-body > * {
  flex-shrink: 0;
}

.vodanh-body::-webkit-scrollbar {
  display: block;
  width: 6px;
}

.vodanh-body::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
  border-radius: 4px;
}

.vodanh-body::-webkit-scrollbar-thumb {
  background: rgba(251, 191, 36, 0.45);
  border-radius: 4px;
}

.vodanh-body::-webkit-scrollbar-thumb:hover {
  background: rgba(251, 191, 36, 0.75);
}

/* Section Header */
.vd-sec-title {
  font-size: 13px;
  font-weight: 800;
  color: #fbbf24;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(251, 191, 36, 0.2);
  margin-top: 4px;
}

.vd-sec-badge {
  font-size: 11px;
  color: #94a3b8;
  font-weight: normal;
  text-transform: none;
}

/* Podium Hero Cards */
.vd-podium-wrap {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.vd-podium-wrap.solo {
  grid-template-columns: minmax(220px, 340px);
  justify-content: center;
}

.vd-podium-wrap.duo {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.vd-podium-wrap.trio {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.vd-podium-item {
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 14px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.vd-podium-item.champ {
  border-color: #fbbf24;
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.22) 0%, rgba(30, 41, 59, 0.6) 100%);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.2);
}

.vd-podium-item.runner {
  border-color: #94a3b8;
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.22) 0%, rgba(30, 41, 59, 0.6) 100%);
  box-shadow: 0 4px 15px rgba(148, 163, 184, 0.2);
}

.vd-podium-item.bronze {
  border-color: #fb923c;
  background: linear-gradient(180deg, rgba(234, 88, 12, 0.22) 0%, rgba(30, 41, 59, 0.6) 100%);
  box-shadow: 0 4px 15px rgba(234, 88, 12, 0.2);
}

.vd-podium-name {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.vd-podium-tag {
  font-size: 11px;
  font-weight: 700;
  color: #fde047;
}

.vd-podium-item.bronze .vd-podium-tag {
  color: #fb923c;
}

.vd-podium-item.runner .vd-podium-tag {
  color: #cbd5e1;
}

.vd-podium-sub {
  font-size: 12px;
  color: #94a3b8;
}

/* Table Wrappers */
.vd-table-wrap {
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.5);
  overflow: hidden;
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}

.vd-table-header {
  display: grid;
  grid-template-columns: 55px 1.5fr 1.3fr 1.3fr 1.2fr;
  padding: 10px 14px;
  background: rgba(30, 41, 59, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11px;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-height: 36px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.vd-table-header.hof-cols {
  grid-template-columns: 55px 1.5fr 1.3fr 1.3fr 1.2fr;
}

.vd-table-header.pv-top10-cols {
  grid-template-columns: 48px 105px 1.4fr 1.2fr 1.1fr 1.2fr;
}

.vd-table-header.guild-cols {
  grid-template-columns: 50px 1.5fr 1.2fr 80px 1.2fr 1.1fr;
}

.vd-table-header.lv-top-cols {
  grid-template-columns: 48px 105px 1.5fr 1.2fr 1.1fr 1.2fr;
}

.vd-table-header.lv-hof-cols {
  grid-template-columns: 50px 1.5fr 1.2fr 1.1fr 1.1fr 1.2fr;
}

.vd-table-header.lv-history-cols {
  grid-template-columns: 55px 1.3fr 1.3fr 1.2fr 1.2fr 1.1fr;
}

.vd-table-header.pv-history-cols {
  grid-template-columns: 55px 1.3fr 1.3fr 1.2fr 1.2fr;
}

.vd-table-body {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 100%;
}

.vd-row {
  display: grid;
  grid-template-columns: 55px 1.5fr 1.3fr 1.3fr 1.2fr;
  padding: 10px 14px;
  align-items: center;
  font-size: 13px;
  color: #e2e8f0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.15s ease;
  min-height: 40px;
  box-sizing: border-box;
  flex-shrink: 0;
  width: 100%;
}

.vd-row.hof-cols {
  grid-template-columns: 55px 1.5fr 1.3fr 1.3fr 1.2fr;
}

.vd-row.pv-top10-cols {
  grid-template-columns: 48px 105px 1.4fr 1.2fr 1.1fr 1.2fr;
}

.vd-row.guild-cols {
  grid-template-columns: 50px 1.5fr 1.2fr 80px 1.2fr 1.1fr;
}

.vd-row.lv-top-cols {
  grid-template-columns: 48px 105px 1.5fr 1.2fr 1.1fr 1.2fr;
}

.vd-row.lv-hof-cols {
  grid-template-columns: 50px 1.5fr 1.2fr 1.1fr 1.1fr 1.2fr;
}

.vd-row.lv-history-cols {
  grid-template-columns: 55px 1.3fr 1.3fr 1.2fr 1.2fr 1.1fr;
}

.vd-row.pv-history-cols {
  grid-template-columns: 55px 1.3fr 1.3fr 1.2fr 1.2fr;
}

.badge-title-champ {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  color: #0f172a;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  display: inline-block;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.badge-title-runner {
  background: linear-gradient(90deg, #94a3b8, #cbd5e1);
  color: #0f172a;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  display: inline-block;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.badge-title-bronze {
  background: linear-gradient(90deg, #ea580c, #fb923c);
  color: #0f172a;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  display: inline-block;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.badge-title-top {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  display: inline-block;
}

.vd-row:hover {
  background: rgba(51, 65, 85, 0.35);
}

.vd-row.rank-1 {
  background: linear-gradient(90deg, rgba(234, 179, 8, 0.14), transparent);
}
.vd-row.rank-1 .col-rank b {
  color: #fbbf24;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}

.vd-row.rank-2 {
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.12), transparent);
}
.vd-row.rank-2 .col-rank b {
  color: #e2e8f0;
}

.vd-row.rank-3 {
  background: linear-gradient(90deg, rgba(217, 119, 6, 0.12), transparent);
}
.vd-row.rank-3 .col-rank b {
  color: #fb923c;
}

.vd-empty {
  padding: 24px 20px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.6;
  background: rgba(15, 23, 42, 0.45);
  border: 1px dashed rgba(251, 191, 36, 0.2);
  border-radius: 10px;
  margin: 4px 0;
}

/* Info Notice Banner */
.vd-notice-card {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.25) 0%, rgba(15, 23, 42, 0.6) 100%);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 12px;
  line-height: 1.5;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.vd-btn-link {
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #fde047;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.vd-btn-link:hover {
  background: rgba(251, 191, 36, 0.3);
  color: #fff;
}

/* ==========================================================================
   Responsive for Mobile Landscape & Small Screens
   ========================================================================== */
@media (max-height: 620px), (max-width: 860px) {
  #vodanh-modal {
    padding: 4px !important;
  }

  .vodanh-window {
    width: 98% !important;
    max-width: 98% !important;
    height: 98% !important;
    max-height: 98% !important;
    border-radius: 12px !important;
  }

  .vodanh-header {
    padding: 6px 14px !important;
  }

  .vodanh-npc-card {
    gap: 8px !important;
  }

  .vodanh-avatar-frame {
    width: 36px !important;
    height: 36px !important;
  }

  .vodanh-badge {
    font-size: 9px !important;
    padding: 1px 6px !important;
  }

  .vodanh-title {
    font-size: 14px !important;
  }

  .vodanh-subtitle {
    font-size: 10.5px !important;
  }

  /* Ẩn text đối thoại "Thiên địa vô danh..." trên mobile */
  .vodanh-speech {
    display: none !important;
  }

  .vodanh-tabs {
    padding: 4px 10px !important;
    gap: 6px !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .vodanh-tab-btn {
    padding: 6px 10px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
  }

  .vodanh-body {
    padding: 8px 12px 20px !important;
  }

  .vd-notice-card {
    padding: 8px 12px !important;
    margin-bottom: 8px !important;
    gap: 8px !important;
  }

  .vd-btn-link {
    padding: 6px 12px !important;
    font-size: 11px !important;
  }
}

@media (max-width: 600px) {
  .vodanh-window {
    width: 98% !important;
    max-width: 98% !important;
    height: 98% !important;
    max-height: 98% !important;
  }
  .vodanh-body {
    padding: 12px 14px 28px;
  }
  .vd-table-header, .vd-row,
  .vd-table-header.hof-cols, .vd-row.hof-cols {
    grid-template-columns: 42px 1.2fr 1fr 1fr;
  }
  .col-guild { display: none; }
  .vd-table-header.guild-cols, .vd-row.guild-cols {
    grid-template-columns: 42px 1.3fr 1fr 1fr;
  }
  .guild-cols .col-members, .guild-cols .col-funds {
    display: none;
  }
  .vd-table-header.pv-history-cols, .vd-row.pv-history-cols {
    grid-template-columns: 42px 1.2fr 1fr 1fr;
  }
  .pv-history-cols .col-time {
    display: none;
  }
  .vd-table-header.pv-top10-cols, .vd-row.pv-top10-cols {
    grid-template-columns: 38px 75px 1.2fr 1fr;
  }
  .pv-top10-cols .col-realm, .pv-top10-cols .col-reward {
    display: none;
  }
  .vd-table-header.lv-top-cols, .vd-row.lv-top-cols {
    grid-template-columns: 38px 75px 1.2fr 1fr;
  }
  .lv-top-cols .col-realm, .lv-top-cols .col-reward {
    display: none;
  }
  .vd-table-header.lv-hof-cols, .vd-row.lv-hof-cols {
    grid-template-columns: 42px 1.2fr 1fr 1fr;
  }
  .lv-hof-cols .col-realm, .lv-hof-cols .col-runner-count {
    display: none;
  }
  .vd-table-header.lv-history-cols, .vd-row.lv-history-cols {
    grid-template-columns: 42px 1.2fr 1fr 1fr;
  }
  .lv-history-cols .col-bronze, .lv-history-cols .col-time {
    display: none;
  }
  .vd-podium-wrap {
    grid-template-columns: 1fr;
  }
  .vd-notice-card {
    flex-direction: column;
    align-items: flex-start;
  }
}
