/* --- Cinematic Grandmaster Dashboard Theme --- */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;600;700;800&family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
  --gold: #DFB123;
  --gold-dark: #C99F1D;
  --bg-dark: var(--bg-primary);
  --text-white: var(--text-primary);
  --text-muted: var(--text-muted);
  --font-heading: "Playfair Display", serif;
  --font-body: "Poppins", sans-serif;
  --radius: 4px;
}

body {
  background: var(--bg-dark);
  color: var(--text-white);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

.hero-section {
  position: fixed;
  top: 90px !important;
  height: calc(100vh - 90px) !important;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: var(--site-bg, url('../assets/images/default-bg.jpg')) !important;
  background-size: cover;
  background-position: top center;
  z-index: -2;
}

.hero-overlay {
  position: fixed;
  top: 90px !important;
  height: calc(100vh - 90px) !important;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, rgba(10, 10, 10, 0.95) 0%, rgba(10, 10, 10, 0.7) 50%, rgba(10, 10, 10, 0.5) 100%);
  z-index: -1;
}

/* Layout */
.dashboard-container {
  padding: 120px 40px 60px 40px;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 10;
  min-height: calc(100vh - 300px);
}

/* Glassmorphism Feature Cards */
.feature-card {
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  transition: transform .3s, background .3s;
  box-shadow: var(--shadow);
}

.feature-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--gold);
}

/* Grid Structures */
.dash-hero-box {
  margin-bottom: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
}

.hero-content h1 {
  font-family: var(--font-heading);
  font-size: 48px;
  color: var(--text-primary) ;
  margin-bottom: 10px;
}

.hero-content p {
  color: var(--text-muted);
  font-size: 16px;
}

/* Stats Row */
.dash-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.dash-stat-card {
  display: flex;
  align-items: center;
  gap: 15px;
  text-align: left;
}

.dash-stat-card .icon {
  font-size: 28px;
  color: var(--gold);
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dash-stat-card .info .label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.dash-stat-card .info .value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary) ;
}

/* Lower Panels */
.dash-lower-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.dash-panel {
  text-align: left;
}

.dash-panel h3 {
  font-family: var(--font-heading);
  font-size: 20px;
  color: var(--text-primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
}

.dash-panel h3 i {
  color: var(--gold);
}

/* Performance Elements */
.chart-container {
  padding: 10px 0;
}

.perf-bar {
  display: flex;
  height: 25px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--bg-sunken);
}

.bar-win {
  background: #4caf50;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary) ;
  font-size: 11px;
  font-weight: 600;
}

.bar-draw {
  background: #ff9800;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary) ;
  font-size: 11px;
  font-weight: 600;
}

.bar-loss {
  background: #f44336;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary) ;
  font-size: 11px;
  font-weight: 600;
}

.perf-stats {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
  font-size: 13px;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
}

.dot-win {
  background: #4caf50;
}

.dot-draw {
  background: #ff9800;
}

.dot-loss {
  background: #f44336;
}

/* Leaderboard Elements */
.top-players-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lb-item {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  background: var(--bg-tertiary);
  border-radius: 4px;
}

.lb-rank {
  font-weight: 700;
  width: 30px;
  color: #888;
}

.lb-rank.rank-1 {
  color: #ffd700;
}

.lb-rank.rank-2 {
  color: #c0c0c0;
}

.lb-rank.rank-3 {
  color: #cd7f32;
}

.lb-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold);
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin-right: 15px;
}

.lb-name {
  flex-grow: 1;
  font-weight: 500;
}

.lb-points {
  font-weight: 700;
  color: var(--gold);
}

/* Buttons */
.btn-play {
  background: var(--gold);
  color: #111;
  padding: 12px 30px;
  font-size: 16px;
  font-weight: bold;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-play:hover {
  background: var(--gold-dark);
  transform: translateY(-2px);
}

/* --- Top Header Re-implemented --- */
.top-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 90px;
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(10px);
}

.logo-block {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-left: 0;
}

.logo-icon {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--gold);
  font-size: 26px;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-primary) ;
}

.logo-text .gold-text {
  color: var(--gold);
}

.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  margin: 0 20px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  height: 90px;
}

.nav-item:not(:last-child)::after {
  content: '•';
  position: absolute;
  right: -16px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
}

.nav-link {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: color .3s;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link:hover,
.nav-link.active {
  color: var(--gold);
  transform: scale(1.05);
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(15px);
  background: var(--bg-tertiary);
  min-width: 160px;
  padding: 10px 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  border: 1px solid var(--border-subtle);
}

.nav-item:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown-item {
  display: block;
  padding: 8px 20px;
  color: var(--text-secondary);
  font-size: 13px;
  text-decoration: none;
  transition: all 0.3s;
}

.dropdown-item:hover {
  color: var(--gold);
  background: var(--bg-card-hover);
  padding-left: 25px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-icon {
  color: rgba(255, 255, 255, 0.6);
  font-size: 18px;
  cursor: pointer;
  transition: color .3s;
  text-decoration: none;
}

.nav-icon:hover {
  color: var(--gold);
}

.donut-container {
  display: flex;
  align-items: center;
  gap: 40px;
  margin-top: 20px;
  padding: 10px 0;
}

.donut-chart {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: conic-gradient(var(--gold) 0% 0%, var(--bg-sunken) 0% 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut-chart::after {
  content: '';
  position: absolute;
  width: 84px;
  height: 84px;
  background: var(--bg-card);
  /* Matches feature card */
  border-radius: 50%;
}

.donut-percent {
  position: relative;
  z-index: 10;
  color: var(--gold);
  font-weight: bold;
  font-size: 18px;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #aaa;
}

.legend-val {
  color: var(--text-primary) ;
  font-weight: bold;
  font-size: 15px;
  margin-left: auto;
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN SYSTEM OVERRIDES
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  .top-header {
    padding: 0 20px !important;
    height: 80px !important;
  }

  .logo-text {
    font-size: 20px !important;
  }

  .nav-links {
    display: none !important;
  }

  #mobile-toggle-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  /* Hide gear, mail, bell — show only logo + avatar + hamburger */
  .nav-right>a.nav-icon {
    display: none !important;
  }

  .nav-right>div>.notif-btn {
    display: none !important;
  }

  .nav-right>div:has(.notif-btn) {
    display: none !important;
  }

  /* Keep avatar visible */
  #header-avatar-link {
    display: flex !important;
  }

  .dashboard-container {
    padding: 110px 24px 40px 24px;
  }

  .dash-hero-box {
    padding: 24px;
  }

  .hero-content h1 {
    font-size: 36px;
  }
}

@media (max-width: 992px) {
  .dash-lower-section {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 768px) {
  .top-header {
    padding: 0 16px !important;
    height: 70px !important;
  }

  .logo-text {
    font-size: 22px !important;
  }

  .hero-section,
  .hero-overlay {
    top: 0 !important;
    height: 100vh !important;
  }

  .dashboard-container {
    padding: 100px 16px 30px 16px;
  }

  .dash-hero-box {
    flex-direction: column-reverse;
    text-align: center;
    gap: 24px;
    padding: 24px 20px;
  }

  .hero-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-content h1 {
    font-size: 28px;
    line-height: 1.3;
  }

  .hero-content p {
    font-size: 14px;
  }

  .dash-hero-box .hero-image {
    flex: 0 0 auto !important;
    max-width: 180px;
    margin: 0 auto;
  }

  .dash-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
  }

  .dash-stat-card {
    padding: 20px 16px;
    gap: 12px;
  }

  .dash-stat-card .icon {
    font-size: 24px;
    width: 42px;
    height: 42px;
  }

  .dash-stat-card .info .value {
    font-size: 22px;
  }
}

@media (max-width: 480px) {
  .dashboard-container {
    padding: 90px 12px 24px 12px;
  }

  .dash-hero-box {
    padding: 20px 16px;
  }

  .hero-content h1 {
    font-size: 24px;
  }

  .dash-stats-grid {
    grid-template-columns: 1fr;
    /* Single column stack for maximum mobile readability */
    gap: 12px;
  }

  .donut-container {
    flex-direction: column;
    gap: 24px;
    align-items: center;
    text-align: center;
  }

  .donut-legend {
    width: 100%;
    max-width: 250px;
  }

  .feature-card {
    padding: 20px 16px;
  }
}

