/* tournament.css — Tiên Nhân Thanh Phong: Phong Vân Bảng & Tông Môn Luận Võ */

.tournament-window {
  width: min(840px, 96%);
  height: min(92%, 760px);
  max-height: 94%;
  background: radial-gradient(circle at 50% 0%, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(251, 191, 36, 0.4);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(56, 189, 248, 0.2);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  color: #f8fafc;
  font-family: inherit;
  backdrop-filter: blur(16px);
  animation: tourPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Header */
.tournament-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.3) 0%, rgba(15, 23, 42, 0.6) 100%);
  border-bottom: 1px solid rgba(251, 191, 36, 0.25);
}

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

.tournament-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;
}

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

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

.tournament-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;
}

.tournament-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #f8fafc;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

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

/* Speech Box */
.tournament-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;
}

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

/* Tabs */
.tournament-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);
}

.tour-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;
}

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

.tour-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);
}

.tour-tab-ic {
  font-size: 18px;
}

/* Body */
.tournament-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: none;
  -ms-overflow-style: none;
}

.tournament-body::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* Status Card */
.tour-status-card {
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.tour-status-card.active {
  border-color: rgba(34, 197, 94, 0.5);
  background: linear-gradient(180deg, rgba(22, 101, 52, 0.2) 0%, rgba(15, 23, 42, 0.5) 100%);
}

.tour-status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.tour-tag {
  font-size: 10px;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.tour-status-title {
  font-size: 16px;
  font-weight: 800;
  color: #f8fafc;
  margin-top: 2px;
}

.tour-status-card.active .tour-status-title {
  color: #4ade80;
}

.tour-action-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tour-user-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
  flex-wrap: wrap;
}

.tour-desc-hint {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.4;
}

/* Table List Wrap */
.tour-list-wrap {
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.5);
  overflow: hidden;
}

.tour-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;
}

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

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

.tour-table-body {
  display: flex;
  flex-direction: column;
}

.tour-row {
  display: grid;
  grid-template-columns: 55px 1.5fr 1.3fr 1.3fr 1.2fr;
  padding: 10px 14px;
  align-items: center;
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.15s ease;
}

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

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

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

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

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

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

.col-rank { font-weight: 700; }
.col-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-realm { font-size: 12px; }
.col-members { font-size: 12px; color: #cbd5e1; }
.col-cp { font-weight: 700; }
.col-funds { font-weight: 700; color: #fbbf24; }
.col-guild { font-size: 12px; color: #cbd5e1; }

.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;
}

.sp-btn.purple {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #fff;
  border: 1px solid rgba(167, 139, 250, 0.5);
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.35);
}

.sp-btn.purple:hover {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.sp-btn.red {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #fff;
  border: 1px solid rgba(248, 113, 113, 0.5);
  box-shadow: 0 0 12px rgba(220, 38, 38, 0.45);
  font-weight: 700;
}

.sp-btn.red:hover {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.sp-btn.pulse {
  animation: tourPulse 1.8s infinite;
}

@keyframes tourPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.6); }
  50% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
}

/* Schedule Status Card */
.tour-sched-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  padding: 12px 18px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.tour-sched-card.stage-registering {
  border-color: rgba(245, 158, 11, 0.6);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(15, 23, 42, 0.8) 100%);
}

.tour-sched-card.stage-running {
  border-color: rgba(239, 68, 68, 0.6);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(15, 23, 42, 0.8) 100%);
}

.tour-sched-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tour-sched-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.stage-registering .tour-sched-badge {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.5);
}

.stage-running .tour-sched-badge {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.5);
}

.stage-ended .tour-sched-badge {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.3);
}

.tour-sched-sub {
  font-size: 12px;
  color: #94a3b8;
}

.tour-sched-timer {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.tour-sched-timer-label {
  font-size: 11px;
  color: #cbd5e1;
}

.tour-sched-timer-val {
  font-size: 18px;
  font-weight: 800;
  color: #fde047;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}

/* Prize Pool Card */
.tour-pool-card {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tour-pool-card.guild {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(15, 23, 42, 0.8) 100%);
  border-color: rgba(16, 185, 129, 0.45);
}

.tour-pool-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.tour-pool-label {
  font-size: 13px;
  font-weight: 800;
  color: #fde047;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.tour-pool-amount {
  font-size: 22px;
  font-weight: 900;
  color: #fbbf24;
  text-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
}

.tour-pool-amount small {
  font-size: 13px;
  color: #cbd5e1;
  font-weight: normal;
}

.tour-rewards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.tour-rewards-grid.duo {
  grid-template-columns: repeat(2, 1fr);
}

.tour-reward-item {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
}

.tour-reward-item.rank-1 {
  border-color: rgba(234, 179, 8, 0.6);
  background: linear-gradient(180deg, rgba(234, 179, 8, 0.15) 0%, rgba(15, 23, 42, 0.7) 100%);
}

.tour-reward-item.rank-2 {
  border-color: rgba(148, 163, 184, 0.45);
}

.tour-reward-item.rank-3 {
  border-color: rgba(217, 119, 6, 0.45);
}

.rew-badge {
  font-size: 11px;
  font-weight: 800;
  color: #f1f5f9;
}

.rew-val {
  font-size: 14px;
  font-weight: 800;
  color: #fbbf24;
}

.rew-sub {
  font-size: 10px;
  color: #94a3b8;
}

/* Podium Cards */
.tour-podium-wrap {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

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

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

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

.podium-crown {
  font-size: 24px;
}

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

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

/* Battle Logs Box */
.tour-logs-box {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 12px;
}

.tour-bracket-round-title {
  font-size: 12px;
  font-weight: 800;
  color: #38bdf8;
  margin: 6px 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tour-match-row {
  font-size: 12px;
  color: #cbd5e1;
  padding: 3px 0;
  line-height: 1.4;
}

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

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

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

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

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

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

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

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

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

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

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

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

  .tour-banner, .tour-user-card {
    padding: 8px 12px !important;
    margin-bottom: 8px !important;
    gap: 8px !important;
  }
}

@media (max-width: 600px) {
  .tournament-window {
    width: 98% !important;
    max-width: 98% !important;
    height: 98% !important;
    max-height: 98% !important;
  }
  .tournament-body {
    padding: 12px 14px 28px;
  }
  .tour-table-header, .tour-row {
    grid-template-columns: 42px 1.2fr 1fr 1fr;
  }
  .col-guild { display: none; }
  .tour-table-header.tour-guild-cols, .tour-row.tour-guild-cols {
    grid-template-columns: 42px 1.3fr 1fr 1fr;
  }
  .tour-guild-cols .col-members, .tour-guild-cols .col-funds {
    display: none;
  }
  .tour-user-stats { gap: 8px; font-size: 12px; }
  .tour-rewards-grid, .tour-podium-wrap { grid-template-columns: 1fr; }
  .tour-podium-item.champ { transform: none; }
}

/* Roster Picker Modal */
.tour-roster-window {
  width: min(720px, 96%);
  max-height: 94%;
  background: radial-gradient(circle at 50% 0%, rgba(26, 32, 53, 0.98), rgba(13, 17, 30, 0.99));
  border: 1px solid rgba(251, 191, 36, 0.45);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 30px rgba(234, 179, 8, 0.2);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  color: #f8fafc;
  backdrop-filter: blur(16px);
  animation: tourPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.tour-roster-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.25);
}

.tour-roster-badge {
  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;
  display: inline-block;
  margin-bottom: 4px;
}

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

.tour-roster-sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: #94a3b8;
}

.tour-roster-body {
  padding: 16px 20px;
  overflow-y: auto;
  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);
}

/* Slot preview strip */
.tour-slots-box {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px 14px;
  flex-shrink: 0;
}

.tour-slots-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.tour-slots-heading {
  font-size: 11px;
  font-weight: 800;
  color: #fbbf24;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.tour-slots-count {
  font-size: 12px;
  font-weight: 700;
  color: #4ade80;
  background: rgba(74, 222, 128, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.tour-slots-count.incomplete {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.3);
}

.tour-slots-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.tour-slot-item {
  background: rgba(30, 41, 59, 0.6);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 8px 6px;
  text-align: center;
  position: relative;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tour-slot-item:hover {
  background: rgba(51, 65, 85, 0.6);
  border-color: rgba(251, 191, 36, 0.4);
}

.tour-slot-item.filled {
  background: linear-gradient(180deg, rgba(234, 179, 8, 0.15) 0%, rgba(30, 41, 59, 0.7) 100%);
  border: 1px solid rgba(251, 191, 36, 0.5);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
}

.tour-slot-tag {
  font-size: 10px;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
}

.tour-slot-item.filled .tour-slot-tag {
  color: #fde047;
}

.tour-slot-name {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.tour-slot-sub {
  font-size: 10px;
  color: #38bdf8;
}

.tour-slot-empty {
  font-size: 11px;
  color: #64748b;
  font-style: italic;
}

.tour-slot-remove {
  position: absolute;
  top: 2px;
  right: 5px;
  font-size: 11px;
  color: #94a3b8;
  line-height: 1;
  display: none;
}

.tour-slot-item.filled:hover .tour-slot-remove {
  display: block;
  color: #ef4444;
}

/* Members Section */
.tour-members-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.tour-members-title {
  font-size: 12px;
  font-weight: 800;
  color: #cbd5e1;
  text-transform: uppercase;
}

.tour-btn-auto {
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #fbbf24;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tour-btn-auto:hover {
  background: rgba(251, 191, 36, 0.25);
  color: #fff;
}

.tour-members-table-wrap {
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.5);
  overflow: hidden;
  max-height: 250px;
  overflow-y: auto;
  flex-shrink: 0;
}

.tour-member-pick-row {
  display: grid;
  grid-template-columns: 50px 1.5fr 90px 1.2fr 1.1fr 70px;
  padding: 8px 12px;
  align-items: center;
  font-size: 13px;
  color: #e2e8f0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: background 0.15s ease;
}

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

.tour-member-pick-row.selected {
  background: rgba(245, 158, 11, 0.12);
}

.tour-pick-slot-badge {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.tour-member-pick-row.selected .tour-pick-slot-badge {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #0f172a;
  border-color: #fbbf24;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.tour-member-role-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  text-align: center;
}

.role-leader { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.role-elder { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.4); }
.role-law { background: rgba(56, 189, 248, 0.2); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.4); }
.role-member { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.3); }

/* Footer */
.tour-roster-footer {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  background: rgba(15, 23, 42, 0.7);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Nút Quan Chiến trên thanh công cụ HUD (.world-top-btns) */
#w-spectate.active {
  background: linear-gradient(180deg, #f6da84, #c9a022);
  color: #3a2c08;
  border-color: #f59e0b;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.55);
}

#w-spectate.active i {
  color: #3a2c08;
  animation: luanvoEyePulse 1.8s infinite ease-in-out;
}

@keyframes luanvoEyePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.18); opacity: 0.85; }
}

/* Thẻ Sự Kiện Tông Môn Luận Võ (HUD Event Card bên dưới khu vực tiền tệ góc trái) */
.luanvo-event-card {
  position: fixed;
  top: 78px;
  left: 14px;
  right: auto;
  width: 285px;
  max-width: calc(100% - 28px);
  box-sizing: border-box;
  overflow: hidden;
  background: radial-gradient(circle at 50% 0%, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.96));
  border: 1px solid rgba(245, 158, 11, 0.55);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65), 0 0 12px rgba(245, 158, 11, 0.2);
  border-radius: 12px;
  padding: 10px 14px;
  color: #f8fafc;
  font-family: inherit;
  z-index: 102;
  backdrop-filter: blur(10px);
  user-select: none;
  animation: luanvoCardIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.2s ease;
  pointer-events: auto;
}

@keyframes luanvoCardIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.luanvo-event-card:hover {
  border-color: rgba(245, 158, 11, 0.85);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.75), 0 0 16px rgba(245, 158, 11, 0.35);
}

.luanvo-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  width: 100%;
  box-sizing: border-box;
}

.luanvo-card-title {
  font-size: 12px;
  font-weight: 800;
  color: #f59e0b;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.luanvo-card-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  white-space: nowrap;
  flex-shrink: 0;
  box-sizing: border-box;
}

.luanvo-card-badge.running {
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid #22c55e;
  color: #4ade80;
}

.luanvo-card-badge.registering {
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid #38bdf8;
  color: #7dd3fc;
}

.luanvo-card-info {
  font-size: 11.5px;
  color: #cbd5e1;
  margin-bottom: 8px;
  line-height: 1.4;
  word-break: break-word;
}

.luanvo-card-btn {
  box-sizing: border-box;
  display: block;
  width: 100%;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid #f59e0b;
  background: linear-gradient(180deg, #d97706, #b45309);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(180, 83, 9, 0.4);
  transition: all 0.15s ease;
}

.luanvo-card-btn:hover {
  background: linear-gradient(180deg, #f59e0b, #d97706);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.5);
}

.luanvo-card-btn.in-arena {
  background: linear-gradient(180deg, #0284c7, #0369a1);
  border-color: #38bdf8;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

.luanvo-card-btn.in-arena:hover {
  background: linear-gradient(180deg, #38bdf8, #0284c7);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.5);
}

@media (max-width: 600px) {
  .luanvo-event-card {
    top: 76px;
    left: 8px;
    right: auto;
    width: 240px;
    padding: 8px 10px;
  }
  .luanvo-card-title {
    font-size: 11px;
  }
  .luanvo-card-badge {
    font-size: 8.5px;
    padding: 2px 5px;
  }
}

.tour-return-btn {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.9), rgba(185, 28, 28, 0.95));
  border: 1px solid #f87171;
  color: #ffffff;
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.4);
  transition: all 0.2s ease;
  user-select: none;
}

.tour-return-btn:hover {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.6);
  transform: translateY(-1px);
}

