body, .leaderboard-modern {
  font-family: 'Montserrat', 'Cinzel', serif;
  background: #181c24;
  color: #f5f5f5;
  margin: 0;
  padding: 20px;
  min-height: 100vh;
}

.leaderboard-modern {
  margin: 40px auto 0 auto;
  padding: 32px 24px 40px 24px;
  background: #23283a;
  border-radius: 18px;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.18);
}

h1 {
  text-align: center;
  color: #ffd700;
  font-size: 2.5rem;
  margin-bottom: 18px;
  letter-spacing: 1px;
  font-weight: 700;
}

.leaderboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.last-update {
  font-size: 1rem;
  color: #bdbdbd;
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 500;
}

.last-update i {
  color: #ffd700;
  font-size: 1.1em;
}

.search-box {
  position: relative;
  width: 240px;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 0;
  background: none;
  border: none;
  padding: 0;
}

.search-label {
  font-size: 0.95rem;
  color: #bdbdbd;
  margin-bottom: 4px;
  display: block;
}

.search-input-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.search-box input {
  width: 100%;
  padding: 9px 36px 9px 14px;
  border-radius: 8px;
  border: none;
  background: #23283a;
  color: #fff;
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(31,38,135,0.07);
  outline: none;
  transition: background 0.2s;
}

.search-box input:focus {
  background: #23283a;
  border: 1.5px solid #ffd700;
}

.search-box button {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  background: none;
  border: none;
  padding: 0 10px;
  color: #ffd700;
  font-size: 1.1em;
  cursor: default;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-box i.fa-search {
  color: #ffd700;
  font-size: 1.1em;
  pointer-events: none;
}

/* Table Styling */
#leaderboard-table {
  width: 100%;
  min-width: 700px;
  max-width: 100vw;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
  border-radius: 12px;
  overflow: hidden;
  table-layout: auto;
  margin: 0 auto 24px auto;
  box-shadow: 0 2px 12px rgba(31,38,135,0.09);
}

#leaderboard-table thead tr {
  background: linear-gradient(90deg, #23283a 60%, #2d3347 100%);
}

#leaderboard-table thead th {
  position: sticky;
  top: 0;
  background: #23283a;
  z-index: 2;
  box-shadow: 0 2px 6px #181c2433;
  padding: 13px 10px;
  color: #ffd700;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #ffd70033;
  font-size: 1rem;
  white-space: nowrap;
}

#leaderboard-table th, #leaderboard-table td {
  padding: 13px 10px;
  text-align: center;
  font-size: 1rem;
  vertical-align: middle;
  white-space: nowrap;
  min-width: 90px;
}

#leaderboard-table th {
  color: #ffd700;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #ffd70033;
}

#leaderboard-table tbody tr {
  background: #23283a;
  transition: background 0.2s;
}

#leaderboard-table tbody tr:nth-child(even) {
  background: #23283aee;
}

#leaderboard-table tbody tr:hover {
  background: #2d3347;
}

#leaderboard-table td {
  color: #f5f5f5;
  font-weight: 500;
  border-bottom: 1px solid #23283a55;
}

#leaderboard-table td:first-child {
  font-weight: 700;
  color: #ffd700;
}

#leaderboard-table td:last-child {
  font-family: 'Montserrat', monospace;
}


.mini-stats-btn {
  background: #23283a;
  color: #ffd700;
  border: 1.5px solid #ffd70055;
  border-radius: 7px;
  padding: 7px 18px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 4px #181c2412;
  margin: 0 6px;
  transition: background 0.18s, color 0.18s, border 0.18s, transform 0.18s;
  outline: none;
  display: inline-block;
}
.mini-stats-btn:hover, .mini-stats-btn:focus {
  background: #ffd700;
  color: #23283a;
  border: 1.5px solid #ffd700;
  transform: scale(1.04);
}


.stats-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0; top: 0;
  width: 100vw; height: 100vh;
  background: rgba(24,28,36,0.85);
  justify-content: center;
  align-items: center;
  
  overflow-y: auto;
}

.stats-modal-content {
  background: #23283a;
  color: #f5f5f5;
  border-radius: 14px;
  padding: 32px 28px 24px 28px;
  width: 100%;
  max-width: 95vw;
  min-width: 320px;
  box-sizing: border-box;
  overflow-x: auto;
  box-shadow: 0 8px 32px #181c2444;
  position: relative;
  animation: leaderboard-fadein 0.5s;
 
  max-height: 90vh;
  overflow-y: auto;
}

.stats-modal-content h2 {
  color: #ffd700;
  text-align: center;
  margin-bottom: 18px;
  font-size: 1.4em;
}
.stats-modal-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stat-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #ffd70022;
  padding: 6px 0;
  font-size: 1.05em;
}
.close-modal {
  position: absolute;
  top: 12px;
  right: 18px;
  font-size: 1.7em;
  color: #ffd700;
  cursor: pointer;
  font-weight: bold;
  transition: color 0.2s;
}
.close-modal:hover {
  color: #fff;
}

/* Modal Chart (reuse .stats-modal) */
#chart-modal .stats-modal-content {
  background: #23283a;
  color: #f5f5f5;
  border-radius: 14px;
  padding: 32px 28px 24px 28px;
  max-width: 98vw;
  min-width: 350px;
}
#chart-modal h2 {
  color: #ffd700;
  text-align: center;
  margin-bottom: 18px;
  font-size: 1.4em;
}
#chart-modal .close-modal {
  position: absolute;
  top: 12px;
  right: 18px;
  font-size: 1.7em;
  color: #ffd700;
  cursor: pointer;
  font-weight: bold;
  transition: color 0.2s;
}
#chart-modal .close-modal:hover {
  color: #fff;
}
#leaderboard-chart {
  min-height: 220px;
  max-width: 100%;
}
#leaderboard-canvasjs-chart {
  display: none;
}

/* Loading Spinner */
.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 120px;
  background: transparent;
  position: absolute;
  width: 100%;
  left: 0;
  top: 0;
  z-index: 10;
}
.spinner {
  width: 48px;
  height: 48px;
  border: 5px solid #ffd70044;
  border-top: 5px solid #ffd700;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive Table Scroll */
@media (max-width: 1200px) {
  #leaderboard-table {
    min-width: 900px;
    font-size: 0.97rem;
  }
  .leaderboard-modern {
    overflow-x: auto;
  }
}
@media (max-width: 900px) {
  #leaderboard-table {
    min-width: 700px;
    font-size: 0.95rem;
  }
}
@media (max-width: 700px) {
  #leaderboard-table {
    min-width: 500px;
    font-size: 0.93rem;
  }
}
@media (max-width: 600px) {
  .leaderboard-modern {
    padding: 10px 2vw 20px 2vw;
    overflow-x: auto;
  }
  .leaderboard-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .search-box {
    width: 100%;
  }
  #leaderboard-table th, #leaderboard-table td {
    padding: 8px 4px;
    font-size: 0.95rem;
  }
  .last-update {
    font-size: 0.9rem;
  }
  #scrollToTopBtn {
    right: 12px;
    bottom: 12px;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }
}
@media (max-width: 420px) {
  #leaderboard-table th, #leaderboard-table td {
    font-size: 0.85rem;
    padding: 6px 2px;
  }
  #leaderboard-table {
    min-width: 400px;
  }
}


.leaderboard-fadein {
    animation: leaderboard-fadein 1.2s cubic-bezier(.23,1.02,.57,.98);
}

@keyframes leaderboard-fadein {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.98);
        filter: blur(2px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

.leaderboard-title-animate {
    animation: leaderboard-title-glow 2.5s infinite alternate, leaderboard-title-fadein 1.2s cubic-bezier(.23,1.02,.57,.98);
}

@keyframes leaderboard-title-glow {
    0% {
        text-shadow: 0 0 8px #ffd700, 0 0 16px #ffd70044;
    }
    100% {
        text-shadow: 0 0 24px #ffd700, 0 0 48px #ffd70077;
    }
}

@keyframes leaderboard-title-fadein {
    0% {
        opacity: 0;
        transform: translateY(-30px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


@keyframes row-fadein {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


#reset-zoom-btn {
  display: none !important;
}

/* Scroll to Top Button */
#scrollToTopBtn {
  display: none;
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 100;
  background: #23283aee;
  color: #ffd700;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 2rem;
  box-shadow: 0 2px 12px #181c2444;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
#scrollToTopBtn:hover {
  background: #ffd700;
  color: #23283a;
  transform: scale(1.08);
}

.leaderboard-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 18px 0 10px 0;
  gap: 0;
  flex-wrap: wrap;
}

/* Responsive modal for tablet and mobile */
@media (max-width: 700px) {
  .stats-modal-content {
    min-width: 0;
    max-width: 100vw;
    width: 98vw;
    padding: 10px 2vw 10px 2vw;
    font-size: 0.97rem;
    box-sizing: border-box;
    max-height: 92vh;
    overflow-y: auto;
  }
  .stats-modal-content h2 {
    font-size: 1.05em;
    word-break: break-word;
  }
  .stat-row {
    font-size: 0.97em;
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
    word-break: break-word;
  }
  
  .stats-modal-content .modal-btn-group,
  .stats-modal-content > div[style*="display:flex"][style*="justify-content:center"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    align-items: stretch !important;
    justify-content: center !important;
    width: 100% !important;
    margin-top: 12px !important;
    margin-bottom: 0 !important;
  }
  .mini-stats-btn {
    width: 100% !important;
    margin: 0 0 8px 0 !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    font-size: 1rem !important;
    padding: 12px 0 !important;
    display: block !important;
  }
}

@media (max-width: 480px) {
  .stats-modal-content {
    padding: 6px 1vw 6px 1vw;
    font-size: 0.91rem;
    min-width: 0;
    max-width: 100vw;
    width: 99vw;
    box-sizing: border-box;
    max-height: 96vh;
    overflow-y: auto;
  }
  .stats-modal-content h2 {
    font-size: 0.98em;
    word-break: break-word;
  }
  .stat-row {
    font-size: 0.91em;
    flex-direction: column;
    gap: 1px;
    align-items: flex-start;
    word-break: break-word;
  }
  .stats-modal-content .modal-btn-group,
  .stats-modal-content > div[style*="display:flex"][style*="justify-content:center"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 7px !important;
    align-items: stretch !important;
    justify-content: center !important;
    width: 100% !important;
    margin-top: 7px !important;
    margin-bottom: 0 !important;
  }
  .mini-stats-btn {
    width: 100% !important;
    margin: 0 0 7px 0 !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    font-size: 0.98rem !important;
    padding: 10px 0 !important;
    display: block !important;
  }
}

.vacation-mark {
  font-size: 0.95em;
  vertical-align: middle;
  margin-left: 3px;
  opacity: 0.7;
  user-select: none;
  pointer-events: none;
}
