.container {
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.9) 0%,
    rgba(20, 26, 57, 0.8) 50%,
    rgba(0, 0, 0, 0.9) 100%
  ),
  url("/street2.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto !important;
  box-sizing: border-box;
  font-family: "Rubik", sans-serif;
}

.main {
  flex: 1;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem;
  position: relative;
  z-index: 1;
  overflow-x: hidden;
  overflow-y: visible !important;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.branding {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
  position: sticky;
  top: 0;
  z-index: 10;
  transition: all 0.3s ease;
}

.branding h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  margin-bottom: 2rem;
  background: linear-gradient(135deg, #4CAF50, #45a049);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  font-weight: 700;
  word-wrap: break-word;
}

.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.timeControls,
.modeControls {
  display: flex;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 25px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.controlButton {
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  padding: 12px 20px;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Rubik", sans-serif;
  min-width: 80px;
}

.controlButton.active {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
  transform: translateY(-1px);
}

.controlButton:hover:not(.active) {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

/* Remove the old modeButton styles and replace with enhanced styling for mode controls */
.modeControls .controlButton.active {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #000;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modeControls .controlButton:hover:not(.active) {
  background: rgba(255, 215, 0, 0.1);
  color: #FFD700;
}

.backButton {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  padding: 12px 24px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 25px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  text-decoration: none;
  font-family: "Rubik", sans-serif;
}

.backButton:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.3);
}

.statusMessage {
  margin: 20px 0;
  padding: 15px 20px;
  background: rgba(248, 215, 218, 0.9);
  color: #721c24;
  border: 1px solid rgba(245, 198, 203, 0.8);
  border-radius: 15px;
  text-align: center;
  font-size: 16px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  animation: slideIn 0.3s ease-out;
}

.warningMessage {
  margin: 20px 0;
  padding: 15px 20px;
  background: rgba(255, 193, 7, 0.9);
  color: #856404;
  border: 1px solid rgba(255, 193, 7, 0.8);
  border-radius: 15px;
  text-align: center;
  font-size: 16px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  animation: slideIn 0.3s ease-out;
}

.loadingMessage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin: 20px 0;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  backdrop-filter: blur(10px);
  animation: slideIn 0.3s ease-out;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid #4CAF50;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.leaderboardContainer {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: slideIn 0.5s ease-out;
  margin-bottom: 2rem;
}

.myRankCard {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(69, 160, 73, 0.2));
  padding: 1.5rem;
  margin: 1rem;
  margin-bottom: 0;
  border-radius: 15px;
  border: 2px solid rgba(76, 175, 80, 0.3);
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  overflow: hidden;
  animation: slideIn 0.4s ease-out;
  flex-shrink: 0;
}

.myRankCard::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: shimmer 2s infinite;
}

.rankBadge {
  background: rgba(76, 175, 80, 0.8);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 1.1rem;
  min-width: 60px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(76, 175, 80, 0.3);
}

.playerInfo {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.playerName {
  font-size: 1.2rem;
  font-weight: 600;
  color: white;
}

.playerScore {
  font-size: 1.4rem;
  font-weight: 700;
  color: #4CAF50;
}

.scoreType {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-left: 0.5rem;
}

.myRankLabel {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.leaderboardList {
  flex: 1;
  overflow-y: auto !important;
  padding: 1rem;
  min-height: 0;
}

.leaderboardList::-webkit-scrollbar {
  width: 8px;
}

.leaderboardList::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.leaderboardList::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

.leaderboardList::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

.leaderboardItem {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  margin-bottom: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 15px;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.05);
  animation: slideInItem 0.3s ease-out;
  animation-fill-mode: both;
}

.leaderboardItem:nth-child(1) { animation-delay: 0.1s; }
.leaderboardItem:nth-child(2) { animation-delay: 0.15s; }
.leaderboardItem:nth-child(3) { animation-delay: 0.2s; }
.leaderboardItem:nth-child(4) { animation-delay: 0.25s; }
.leaderboardItem:nth-child(5) { animation-delay: 0.3s; }

.leaderboardItem:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(8px) scale(1.02);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.1);
}

.topThree {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 165, 0, 0.05));
  border-color: rgba(255, 215, 0, 0.2);
}

.topThree:hover {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 165, 0, 0.1));
}

.rankNumber {
  width: 60px;
  text-align: center;
  font-weight: 700;
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.8);
}

.medal {
  font-size: 2rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.first { color: #FFD700; }
.second { color: #C0C0C0; }
.third { color: #CD7F32; }

.playerDetails {
  flex: 1;
  margin-left: 1rem;
}

.username {
  font-size: 1.1rem;
  font-weight: 500;
  color: white;
}

.scoreContainer {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.score {
  font-size: 1.3rem;
  font-weight: 700;
  color: #4CAF50;
}

.scoreLabel {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.bottomActions {
  padding: 1.5rem;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.exitButton {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(220, 53, 69, 0.2);
  color: #dc3545;
  padding: 12px 24px;
  border: 2px solid rgba(220, 53, 69, 0.3);
  border-radius: 25px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  font-family: "Rubik", sans-serif;
}

.exitButton:hover {
  background: rgba(220, 53, 69, 0.3);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

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

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInItem {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Responsive Design */
@media (max-width: 768px) {
  .main {
    padding: 1rem;
    min-height: 100vh;
  }

  .branding {
    padding: 1rem;
    margin-bottom: 1rem;
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .branding h1 {
    font-size: clamp(1.8rem, 6vw, 2.5rem);
    margin-bottom: 1rem;
  }

  .controls {
    flex-direction: column;
    gap: 0.75rem;
  }

  .timeControls,
  .modeControls {
    width: 100%;
    justify-content: center;
  }

  .leaderboardContainer {
    flex: 1;
    margin-bottom: 1rem;
    border-radius: 15px;
  }

  .leaderboardList {
    padding: 0.75rem;
  }

  .leaderboardItem {
    padding: 0.75rem 1rem;
  }

  .myRankCard {
    margin: 0.75rem;
    padding: 1rem;
    flex-direction: row;
    text-align: left;
    gap: 0.75rem;
  }

  .playerInfo {
    align-items: flex-start;
  }

  .rankNumber {
    width: 50px;
    font-size: 1rem;
  }

  .medal {
    font-size: 1.5rem;
  }

  .username {
    font-size: 1rem;
  }

  .score {
    font-size: 1.1rem;
  }

  .bottomActions {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .main {
    padding: 0.5rem;
  }

  .branding {
    padding: 0.75rem;
    margin-bottom: 0.75rem;
  }

  .branding h1 {
    font-size: clamp(1.5rem, 8vw, 2rem);
    margin-bottom: 0.75rem;
  }

  .leaderboardItem {
    padding: 0.75rem;
  }

  .rankNumber {
    width: 40px;
    font-size: 0.9rem;
  }

  .username {
    font-size: 0.95rem;
  }

  .score {
    font-size: 1rem;
  }

  .controlButton,
  .backButton {
    padding: 8px 14px;
    font-size: 12px;
  }

  .myRankCard {
    margin: 0.5rem;
    padding: 0.75rem;
  }

  .playerName {
    font-size: 1rem;
  }

  .playerScore {
    font-size: 1.2rem;
  }

  .leaderboardList {
    padding: 0.5rem;
  }
}

