/* v1.6.0: Player Stats Page - Enhanced Visual Design */
.player-stats-body {
  background: radial-gradient(circle at top, #1a2d4a 0%, #0a1525 40%, #050a14 100%);
  min-height: 100vh;
}

.player-stats-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 110px 20px 60px;
  color: #e8f2ff;
}

/* Panels */
.panel-elevated {
  border: 1px solid rgba(112, 199, 255, 0.25);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(14, 24, 42, 0.92), rgba(10, 18, 32, 0.94));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 40px rgba(78, 205, 196, 0.05);
  backdrop-filter: blur(12px);
}

/* Hero Section */
.stats-hero-panel {
  padding: 32px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.stats-hero-panel::before {
  content: '';
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 999px;
  right: -80px;
  top: -140px;
  background: radial-gradient(circle, rgba(78, 205, 196, 0.25), rgba(78, 205, 196, 0));
  pointer-events: none;
  filter: blur(40px);
}

.stats-hero-panel::after {
  content: '';
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 999px;
  left: -60px;
  bottom: -80px;
  background: radial-gradient(circle, rgba(0, 170, 255, 0.15), rgba(0, 170, 255, 0));
  pointer-events: none;
  filter: blur(30px);
}

.stats-eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 12px;
  font-weight: 600;
  color: #90e9df;
}

.stats-hero-panel h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3.5vw, 2.5rem);
  line-height: 1.15;
  font-weight: 700;
  background: linear-gradient(135deg, #ffffff 0%, #90e9df 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stats-hero-subtitle {
  margin: 14px 0 0;
  max-width: 800px;
  color: #adc8e2;
  font-size: 15px;
  line-height: 1.55;
}

.stats-pill-row {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.stats-pill {
  border-radius: 999px;
  border: 1px solid rgba(78, 205, 196, 0.4);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #c9f8f3;
  background: rgba(11, 29, 42, 0.85);
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}

.stats-pill:hover {
  border-color: rgba(78, 205, 196, 0.7);
  background: rgba(78, 205, 196, 0.1);
  transform: translateY(-1px);
}

/* Sections */
.stats-section {
  margin-bottom: 20px;
}

.stats-section-title-wrap {
  margin-bottom: 14px;
}

.stats-section-title-wrap h2 {
  margin: 0;
  font-size: clamp(1.2rem, 3vw, 1.55rem);
  font-weight: 700;
  color: #fff;
}

.stats-section-title-wrap p {
  margin: 8px 0 0;
  color: #97b6d3;
  font-size: 14px;
}

/* Podium Grid - Top 3 */
.podium-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.podium-card {
  border: 1px solid rgba(170, 213, 255, 0.2);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(14, 26, 45, 0.93), rgba(10, 18, 30, 0.9));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  transition: all 0.3s ease;
  padding: 16px;
  position: relative;
  overflow: hidden;
  animation: statsFadeUp 0.5s ease both;
}

.podium-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(78, 205, 196, 0.6), transparent);
}

.podium-card:hover {
  transform: translateY(-4px);
  border-color: rgba(78, 205, 196, 0.5);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 30px rgba(78, 205, 196, 0.08);
}

/* Special styling for 1st place */
.podium-card.place-1 {
  border-color: rgba(255, 215, 0, 0.4);
  box-shadow: 0 12px 32px rgba(255, 215, 0, 0.15), 0 0 20px rgba(255, 215, 0, 0.1);
}

.podium-card.place-1::before {
  background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.7), transparent);
  height: 4px;
}

.podium-card.place-1 .podium-rank {
  color: #ffd700;
  font-size: 16px;
}

/* 2nd place */
.podium-card.place-2 {
  border-color: rgba(192, 192, 192, 0.4);
}

.podium-card.place-2 .podium-rank {
  color: #c0c0c0;
}

/* 3rd place */
.podium-card.place-3 {
  border-color: rgba(205, 127, 50, 0.4);
}

.podium-card.place-3 .podium-rank {
  color: #cd7f32;
}

.podium-rank {
  margin: 0 0 12px;
  color: #95d8ff;
  font-weight: 700;
  letter-spacing: 0.05em;
  font-size: 14px;
  text-transform: uppercase;
}

/* Model Slot */
.model-slot {
  height: clamp(220px, 32vw, 280px);
  border-radius: 14px;
  border: 1px dashed rgba(148, 198, 243, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  background: radial-gradient(circle at 52% 35%, rgba(71, 123, 216, 0.2), rgba(5, 10, 24, 0.92));
  overflow: hidden;
  position: relative;
}

.model-slot::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(78, 205, 196, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

.model-slot canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.model-loading {
  color: #9ec5e8;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  z-index: 1;
}

/* Player Image Fallback */
.podium-card img {
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  margin-top: 10px;
}

/* Player Info */
.player-line {
  margin-top: 12px;
  font-size: 16px;
  font-weight: 600;
}

.player-line strong {
  color: #fff;
}

.player-line span {
  color: #95adc4;
  font-size: 14px;
  font-weight: 400;
}

.player-meta {
  color: #9cb7d1;
  font-size: 13px;
  margin-top: 6px;
  line-height: 1.4;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* KPI Stats - Enhanced */
.player-kpis {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 8px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.kpi-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.kpi-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 2px;
}

.kpi-value {
  font-size: 14px;
  font-weight: 700;
  color: #4ecdc4;
}

/* Top 10 Grid */
.top10-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.top10-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(170, 213, 255, 0.18);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(11, 20, 35, 0.91), rgba(8, 14, 26, 0.88));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.34);
  transition: all 0.25s ease;
}

.top10-card:hover {
  transform: translateY(-2px);
  border-color: rgba(78, 205, 196, 0.5);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.4);
}

.top10-card .rank {
  font-weight: 700;
  font-size: 18px;
  color: #4ecdc4;
  min-width: 30px;
}

.top10-card img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid rgba(78, 205, 196, 0.2);
}

.top10-card > div:last-child {
  flex: 1;
  min-width: 0;
}

.top10-card h4 {
  margin: 0 0 4px;
  font-size: 14px;
  color: #fff;
}

.top10-card h4 small {
  color: #95adc4;
  font-size: 12px;
  font-weight: 400;
}

.top10-card div {
  font-size: 12px;
  color: #9cb7d1;
  line-height: 1.4;
}

/* Filters */
.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.filters input,
.filters select {
  background: rgba(10, 18, 34, 0.9);
  color: #dcedff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 12px 12px;
  min-height: 44px;
  font-size: 14px;
  transition: all 0.2s ease;
}

.filters input:focus,
.filters select:focus {
  outline: none;
  border-color: rgba(78, 205, 196, 0.5);
  box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.1);
}

.filters input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.filter-apply-btn {
  min-height: 44px;
  font-weight: 600;
  background: linear-gradient(135deg, #00ffc8, #00aaff);
  border: none;
  color: #0a0a1a;
  transition: all 0.2s ease;
}

.filter-apply-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

/* Database Grid */
.database-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.db-card {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 14px;
  padding: 12px;
  border: 1px solid rgba(170, 213, 255, 0.18);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(11, 20, 35, 0.91), rgba(8, 14, 26, 0.88));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transition: all 0.25s ease;
}

.db-card:hover {
  transform: translateX(4px);
  border-color: rgba(78, 205, 196, 0.4);
}

.db-card img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid rgba(78, 205, 196, 0.15);
}

.db-card h4 {
  margin: 0 0 6px;
  font-size: 15px;
  color: #fff;
}

.db-card h4 small {
  color: #95adc4;
  font-size: 13px;
  font-weight: 400;
}

.db-card p {
  margin: 4px 0;
  color: #a8c5de;
  font-size: 13px;
  line-height: 1.4;
}

/* Enhanced stat categories */
.stat-category {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 6px;
  margin-bottom: 4px;
}

.stat-category.combat {
  background: rgba(233, 69, 96, 0.15);
  color: #e94560;
  border: 1px solid rgba(233, 69, 96, 0.3);
}

.stat-category.economy {
  background: rgba(255, 193, 7, 0.15);
  color: #ffc107;
  border: 1px solid rgba(255, 193, 7, 0.3);
}

.stat-category.progression {
  background: rgba(78, 205, 196, 0.15);
  color: #4ecdc4;
  border: 1px solid rgba(78, 205, 196, 0.3);
}

.stat-category.survival {
  background: rgba(156, 39, 176, 0.15);
  color: #9c27b0;
  border: 1px solid rgba(156, 39, 176, 0.3);
}

/* Pager */
.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.pager button {
  padding: 10px 20px;
  font-weight: 600;
}

.pager span {
  font-size: 14px;
  color: #adc8e2;
}

/* Animations */
@keyframes statsFadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 900px) {
  .player-stats-page {
    padding-top: 98px;
  }

  .stats-hero-panel {
    padding: 24px;
  }

  .podium-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .player-stats-page {
    padding: 90px 14px 48px;
  }

  .stats-hero-panel {
    padding: 20px;
    margin-bottom: 18px;
  }

  .stats-hero-subtitle {
    font-size: 14px;
  }

  .stats-pill-row {
    flex-direction: row;
    gap: 8px;
  }

  .stats-pill {
    font-size: 12px;
    padding: 6px 12px;
  }

  .top10-card {
    align-items: flex-start;
  }

  .db-card {
    grid-template-columns: 1fr;
  }

  .db-card img {
    width: 70px;
    height: 70px;
  }

  .filters {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .filters input,
  .filters select {
    min-height: 42px;
    font-size: 13px;
  }

  .player-kpis {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 420px) {
  .player-stats-page {
    padding: 86px 12px 40px;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .stats-pill-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .stats-pill {
    width: 100%;
  }

  .podium-card {
    padding: 14px;
  }

  .model-slot {
    height: 200px;
  }
}