/* ================== TOURNAMENT UI REDESIGN - PREMIUM BETTING FEEL ================== */

/* DEPTH SYSTEM
Layer 1: Page background (#070c16)
Layer 2: Section containers (soft gradient)
Layer 3: Cards (shadow + inner border)
Layer 4: Interactive elements (glow + hover scale)
Layer 5: Status elements (LIVE badge strongest glow)
*/

/* ================== GLOBAL PAGE STYLES ================== */
#page-tournament {
  min-height: 100vh;
  background: #070c16;
}

#page-tournament .page-content {
  padding: 0;
}

/* ================== TOURNAMENT HEADER ================== */
.tournament-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, #0b1220, #0a0f1a);
  position: sticky;
  top: 0;
  z-index: 100;
}

.tournament-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #f8fafc;
}

.header-actions {
  display: flex;
  gap: 12px;
}

.header-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.25s ease;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
}

.header-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.header-icon:active {
  transform: scale(0.92);
}

/* ================== TOURNAMENT ENABLED STATE ================== */
.tournament-enabled-state {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 14px;
  padding-bottom: 100px;
}

/* ================== LIVE BADGE ================== */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #00ff9c, #00d084);
  color: #02140d;
  font-weight: 700;
  font-size: 12px;
  box-shadow: 0 0 18px rgba(0, 255, 156, 0.45);
  animation: liveGlow 2s ease-in-out infinite;
}

.live-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #02140d;
  animation: pulseLive 1.2s ease-out infinite;
}

@keyframes pulseLive {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

@keyframes liveGlow {
  0%, 100% { box-shadow: 0 0 18px rgba(0, 255, 156, 0.45); }
  50% { box-shadow: 0 0 28px rgba(0, 255, 156, 0.65); }
}

/* ================== TOURNAMENT INFO CARD ================== */
.tournament-info-card {
  padding: 20px;
  border-radius: 18px;
  background: linear-gradient(145deg, #111827, #0b1220);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  margin-bottom: 4px;
}

.tournament-info-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
}

.tournament-title-section h3 {
  font-size: 20px;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 10px;
}

.tournament-countdown {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
  color: #fbbf24;
  font-variant-numeric: tabular-nums;
}

.tournament-info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.tournament-info-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tournament-info-label {
  font-size: 10px;
  font-weight: 600;
  color: rgba(148, 163, 184, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tournament-info-value {
  font-size: 14px;
  font-weight: 700;
  color: #f1f5f9;
}

.tournament-prize-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.tournament-prize-value {
  font-size: 20px;
  font-weight: 800;
  color: #fbbf24;
}

/* ================== TOURNAMENT ACCOUNT CARDS ================== */
.tournament-accounts-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.tournament-card {
  padding: 20px;
  border-radius: 18px;
  background: linear-gradient(145deg, #111827, #0b1220);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.tournament-card:hover {
  box-shadow:
    0 14px 40px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* Card Header */
.tournament-account-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.tournament-account-header .account-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tournament-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tournament-avatar-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.account-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.account-name {
  font-size: 17px;
  font-weight: 700;
  color: #f8fafc;
}

.joined-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(0, 255, 156, 0.12);
  border: 1px solid rgba(0, 255, 156, 0.2);
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  color: #00ff9c;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: fit-content;
}

.joined-badge::before {
  content: '';
  width: 5px;
  height: 5px;
  background: #00ff9c;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(0, 255, 156, 0.6);
}

.btn-remove-account {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: rgba(148, 163, 184, 0.8);
  cursor: pointer;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.2s ease;
}

.btn-remove-account:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.stat-box {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  padding: 14px 10px;
  text-align: center;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.2s ease;
}

.stat-box:hover {
  background: rgba(255, 255, 255, 0.06);
}

.stat-label {
  font-size: 11px;
  color: rgba(148, 163, 184, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 16px;
  font-weight: 700;
  margin-top: 4px;
  color: #f1f5f9;
  font-variant-numeric: tabular-nums;
}

.stat-value.positive {
  color: #00ff9c;
}

.stat-value.negative {
  color: #ff4757;
}

.stat-value.position-top {
  color: #fbbf24;
}

/* Mode Selector */
.tournament-mode-selector {
  margin-top: 18px;
}

.tournament-mode-selector label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: rgba(148, 163, 184, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.mode-select {
  width: 100%;
  padding: 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  color: #f1f5f9;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 44px;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.25s ease;
}

.mode-select:hover {
  border-color: rgba(0, 255, 156, 0.3);
}

.mode-select:focus {
  outline: none;
  border-color: #00ff9c;
  box-shadow: 0 0 0 2px rgba(0, 255, 156, 0.25);
}

/* Join Button */
.btn-join-account {
  width: 100%;
  margin-top: 18px;
  padding: 16px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border: none;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.25s ease;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

.btn-join-account:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(99, 102, 241, 0.45);
}

.btn-join-account:active {
  transform: translateY(0);
}

/* Losing Streak Warning */
.losing-streak-warning {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: rgba(234, 179, 8, 0.1);
  border: 1px solid rgba(234, 179, 8, 0.15);
  border-radius: 12px;
  font-size: 12px;
  color: #fbbf24;
  margin-top: 12px;
}

/* Section Header */
.tournament-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.06) 0%, transparent 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tournament-section-header h3 {
  font-size: 13px;
  font-weight: 700;
  color: #e2e8f0;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.tournament-section-header h3 i {
  color: #6366f1;
}

.tournament-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  font-size: 11px;
  font-weight: 700;
  border-radius: 11px;
  margin-left: 6px;
}

/* Add Button */
#btn-add-tournament-account {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: #818cf8;
  cursor: pointer;
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.2s ease;
}

#btn-add-tournament-account:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
  color: #a5b4fc;
}

/* Responsive */
@media (max-width: 768px) {
  .tournament-info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .stats-grid {
    gap: 10px;
  }
  
  .stat-box {
    padding: 12px 8px;
  }
  
  .stat-value {
    font-size: 14px;
  }
}

/* Smooth Transitions */
.tournament-card,
.tournament-info-card,
.stat-box,
.btn-join-account,
.mode-select,
.header-icon {
  transition: transform, opacity, background-color, background, border-color, box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
