body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    color: #343a40;
    overflow: auto; /* Ensure the body can scroll */
  }

  #bg-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
  }

  .content {
    position: relative;
    z-index: 1; /* Ensure content appears above the video */
  }

  h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #343a40;
  }

  .badge {
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 20px;
    white-space: nowrap;
    animation: pulse 1s infinite;
  }

  .badge-moderator {
    background-color: #f2f2f2;
    color: black;
  }

  .badge-rp {
    background-color: #7b2929;
    color: white;
  }


  .badge-accountbanned {
    background-color: #ff0000;
    color: white;
  }

  .badge-gold {
    background-color: gold;
    color: white;
  }

  .badge-silver {
    background-color: silver;
    color: white;
  }

  .badge-bronze {
    background-color: #cd7f32;
    color: white;
  }

  .badge:hover {
    transform: scale(1.05);
  }

  .badge-featured {
    background-color: #ffd700;
    color: #333;
    border: 2px solid #cc9900;
    animation: pulse 1.5s infinite;
  }

  .badge-epic {
    background-color: #ff4500;
    color: white;
    border: 2px solid #cc3300;
    animation: glow 1.5s infinite;
  }

  .badge-legendary {
    background: linear-gradient(135deg, #8a2be2, #6a1b9a); /* Diagonal gradient */
    color: white;
    border: 2px solid #6a1b9a; 
    border-radius: 12px; 
    padding: 6px 12px; /* Smaller padding */
    font-size: 14px; /* Reduced font size */
    font-weight: bold;
    text-transform: uppercase; 
    box-shadow: 0px 6px 12px rgba(106, 27, 154, 0.5); /* Slightly smaller shadow */
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out; 
    animation: bounce 1.5s infinite ease-in-out;
    position: relative;
    display: inline-block; /* Ensure it stays inline */
  }
  
  /* Glow effect */
  .badge-legendary::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.5); /* Glowing border */
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
  }
  
  .badge-legendary:hover::after {
    opacity: 1;
  }
  
  
  /* Sparkle animation */
  .badge-legendary::before {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: white; /* White sparkle */
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    animation: sparkle 3s infinite linear;
    z-index: 1;
  }
  
  /* Bounce Animation */
  @keyframes bounce {
    0%, 100% {
      transform: translateY(0);
    }
    40% {
      transform: translateY(-12px);
    }
    60% {
      transform: translateY(-6px);
    }
  }
  
  /* Sparkle Animation */
  @keyframes sparkle {
    0% {
      top: 0; 
      left: 0;
      opacity: 0;
    }
    25% {
      top: 0;
      left: 100%;
      opacity: 1;
    }
    50% {
      top: 100%;
      left: 100%;
      opacity: 0;
    }
    75% {
      top: 100%;
      left: 0;
      opacity: 1;
    }
    100% {
      top: 0; 
      left: 0;
      opacity: 0;
    }
  }
  
  /* Hover scale effect */
  .badge-legendary:hover {
    transform: translateY(-4px) scale(1.05); 
    box-shadow: 0px 10px 18px rgba(106, 27, 154, 0.7); 
  }
  
  

  .badge-mythic {
    background: linear-gradient(135deg, #14c5d6, #6beeff);
    color: white;
    border: 2px solid lightblue;
    animation: blueFlames 2s infinite, pulseGlow 1.5s ease-in-out infinite, rotateBadge 6s linear infinite;
    padding: 7px 14px; /* Adjusted padding */
    font-size: 0.8rem; /* Adjusted font size */
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.6), 0 0 20px rgba(0, 255, 255, 0.4), 0 0 30px rgba(0, 255, 255, 0.2);
    border-radius: 8px; /* Adjusted border-radius */
    position: relative;
    z-index: 1;
    overflow: hidden;
    
  }

  .badge-mythic::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
    animation: flicker 4s infinite ease-in-out;
    z-index: -1;
    opacity: 0.5;
  }

  @keyframes pulseGlow {
    0% {
      box-shadow: 0 0 15px rgba(0, 255, 255, 0.6), 0 0 30px rgba(0, 255, 255, 0.4), 0 0 50px rgba(0, 255, 255, 0.2);
    }
    50% {
      box-shadow: 0 0 20px rgba(0, 255, 255, 0.8), 0 0 40px rgba(0, 255, 255, 0.6), 0 0 70px rgba(0, 255, 255, 0.4);
    }
    100% {
      box-shadow: 0 0 15px rgba(0, 255, 255, 0.6), 0 0 30px rgba(0, 255, 255, 0.4), 0 0 50px rgba(0, 255, 255, 0.2);
    }
  }

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

  @keyframes blueFlames {
    0% {
      background: linear-gradient(135deg, #14c5d6, #6beeff);
    }
    50% {
      background: linear-gradient(135deg, #0fa3b6, #5bd9ff);
    }
    100% {
      background: linear-gradient(135deg, #14c5d6, #6beeff);
    }
  }

  @keyframes flicker {
    0%, 100% {
      opacity: 0.5;
    }
    50% {
      opacity: 1;
    }
  }

  @keyframes glow {
    0% {
      box-shadow: 0 0 5px #ff4500;
    }
    50% {
      box-shadow: 0 0 15px #ff4500;
    }
    100% {
      box-shadow: 0 0 5px #ff4500;
    }
  }

  @keyframes bounce {
    0%, 100% {
      transform: translateY(0);
    }
    50% {
      transform: translateY(-5px);
    }
  }

  .badge-featured::before,
  .badge-epic::before {
    content: '';
    display: block;
    width: 100%;
    height: 5px;
    background: repeating-linear-gradient(
      45deg,
      #606dbc,
      #606dbc 10px,
      #465298 10px,
      #465298 20px
    );
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 5px 5px 0 0;
  }

  .badge-featured::after,
  .badge-epic::after {
    content: '';
    display: block;
    width: 100%;
    height: 5px;
    background: repeating-linear-gradient(
      45deg,
      #606dbc,
      #606dbc 10px,
      #465298 10px,
      #465298 20px
    );
    position: absolute;
    bottom: 0;
    left: 0;
    border-radius: 0 0 5px 5px;
  }

  .badge-featured,
  .badge-epic {
    position: relative;
    overflow: hidden;
  }

  #leaderboard-container {
    max-width: 1000px;
    margin: 0 auto;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    animation: fadeIn 1s ease;
  }

  @keyframes fadeIn {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }

  #leaderboard {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-family: Arial, sans-serif;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  }
  
  #leaderboard th,
  #leaderboard td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: center;
    white-space: nowrap;
  }
  
  #leaderboard th {
    background-color: #ddd;
    color: black;
    font-weight: bold;
  }
  
  #leaderboard tr:nth-child(even) {
    background-color: #f9f9f9;
  }
  
  #leaderboard tr:hover {
    background-color: #f1f1f1;
  }
  
  #leaderboard th:first-child,
  #leaderboard td:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
  }
  
  #leaderboard th:last-child,
  #leaderboard td:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
  }
  

  .action-btn {
    appearance: button;
    background-color: #1899D6;
    border: solid transparent;
    border-radius: 5px; /* Match the old button's smaller radius */
    border-width: 0 0 4px;
    box-sizing: border-box;
    color: #FFFFFF;
    cursor: pointer;
    display: inline-block;
    font-family: din-round, sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.8px;
    line-height: 20px;
    margin: 0;
    outline: none;
    overflow: visible;
    padding: 8px 15px; /* Match old button's padding */
    text-align: center;
    text-transform: uppercase;
    touch-action: manipulation;
    transform: translateZ(0);
    transition: filter 0.2s;
    user-select: none;
    -webkit-user-select: none;
    vertical-align: middle;
    white-space: nowrap;
    width: auto; /* Match old button's flexible width */
    position: relative;
  }
  
  .action-btn:after {
    background-clip: padding-box;
    background-color: #1CB0F6;
    border: solid transparent;
    border-radius: 5px; /* Match old button's border-radius */
    border-width: 0 0 4px;
    bottom: -4px;
    content: "";
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    z-index: -1;
  }
  
  .action-btn,
  .action-btn:focus {
    user-select: auto;
  }
  
  .action-btn:hover:not(:disabled) {
    filter: brightness(1.1);
    -webkit-filter: brightness(1.1);
  }
  
  .action-btn:disabled {
    cursor: auto;
  }
  
  .action-btn:active {
    border-width: 4px 0 0;
    background: none;
  }  

  .loading {
    text-align: center;
    margin-top: 20px;
    display: none;
  }

  .spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #007bff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
  }

  @keyframes spin {
    to {
      transform: rotate(360deg);
    }
  }

  .animate {
    animation: scaleUp 0.5s ease;
  }

  @keyframes scaleUp {
    from {
      transform: scale(0);
    }
    to {
      transform: scale(1);
    }
  }


  .mobile-warning {
    display: none;
  }

  @media (max-width: 768px) {
    .mobile-warning {
      display: block;
      text-align: center;
      font-weight: bold;
      margin-bottom: 20px;
    }
  }


  .animate-fade {
    animation: animateFade 1s ease;
  }

  @keyframes animateFade {
    0% {
      opacity: 0;
    }
    100% {
      opacity: 1;
    }
  }

  .error-message {
    text-align: center;
    margin-top: 20px;
    padding: 10px;
    background-color: #dc3545;
    color: #fff;
    border-radius: 5px;
    font-weight: bold;
    white-space: pre-wrap;
  }


  .search-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
  }

  #search-bar {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    width: 300px;
    font-size: 16px;
    transition: border-color 0.3s ease;
  }

  #search-bar:focus {
    border-color: #007bff;
    outline: none;
  }

  .tooltip {
    position: relative;
    display: inline-block;
    cursor: pointer;
  }

  .tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 5px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
  }

  .tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
  }

  .sticky-header {
    position: sticky;
    top: 0;
    background-color: #fff;
    padding: 15px 20px;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    font-family: Arial, sans-serif;
    transition: box-shadow 0.3s ease, background-color 0.3s ease;
  }
  
  .sticky-header:hover {
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
    background-color: #f9f9f9;
  }
  

  .custom-scrollbar::-webkit-scrollbar {
    width: 10px;
  }

  .custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
  }

  .custom-scrollbar::-webkit-scrollbar-thumb {
    background: #888;
  }

  .custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #555;
  }

  .footer {
    text-align: center;
    padding: 20px;
    background: linear-gradient(to right, #4CAF50, #8BC34A);
    color: white;
    border-top: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1);
    font-family: Arial, sans-serif;
    transition: background 0.3s ease;
  }
  
  .footer:hover {
    background: linear-gradient(to right, #388E3C, #66BB6A);
  }
  

  .map-key {
    background-color: #f8f8f8;
    padding: 20px;
    text-align: center;
    border-top: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    color: #333;
    font-family: Arial, sans-serif;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }
  
  .map-key:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
  }
    
  
  .badge-item {
    display: inline-block;
    margin: 10px;
    text-align: center;
  }
  
  .merch-item {
    display: inline-block;
    margin: 10px;
    text-align: center;
  }
  .badge-item img {
    width: 50px;
    height: 50px;
    margin-bottom: 5px;
  }
  
  .badge-item p {
    margin: 0;
    font-size: 14px;
    color: #333;
  }

  .merch-item p {
    margin: 0;
    font-size: 14px;
    color: #333;
  }

  .merch-item img {
    width: 200px;
    height: 200px;
    margin-bottom: 5px;
  }

  .suspended-item img {
    width: 40px;
    height: 40px;
    margin-bottom: 5px;
  }
  
  .suspended-item p {
    margin: 0;
    font-size: 14px;
    color: #333;
  }

  .set-ahead-message {
    color: red;
    font-weight: bold;
    display: none;
  }

  .matches-container {
    max-height: 400px;
    overflow-y: auto;
}
.match-item {
    padding: 10px;
    border-bottom: 1px solid #ccc;
    cursor: pointer;
}
.match-item:hover {
    background-color: #f0f0f0;
}

.loading-overlay { 
  position: absolute; 
  top: 0; 
  left: 0; 
  right: 0; 
  bottom: 0; 
  background: rgba(255, 255, 255, 0.7); 
  display: none; 
  justify-content: center; 
  align-items: center; 
  z-index: 1000; 
}
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.feedback { font-size: 18px; margin-top: 10px; }
.correct { color: green; }
.incorrect { color: red; }
#controls { margin: 20px; }
label { margin: 0 10px; }

#myBoard {
  width: 400px; /* Slightly bigger than 300px */
  margin: 20px auto; /* Center the board horizontally */
  position: relative;
}

/* Optional: Adjust the size of the pieces to match the board */
#myBoard .piece {
  width: 50px; /* 400px / 8 squares = 50px per square */
  height: 50px;
  background-size: 50px; /* Ensure pieces scale properly */
}
.highlight-square {
  background-color: rgba(7, 164, 7, 0.5) !important; /* Semi-transparent green */
  transition: background-color 0.3s ease;
}
.promotion-popup {
  position: fixed;
  background: white;
  border: 2px solid #ccc;
  border-radius: 5px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  display: none;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.promotion-options {
  display: flex;
  gap: 5px;
  padding: 5px;
}

.promotion-options button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.promotion-options button img {
  width: 40px;
  height: 40px;
}

.promotion-options button:hover {
  transform: scale(1.1);
  transition: transform 0.2s ease;
}

@keyframes wavyBorder {
  0% { border-color: #ffcc00; }
  25% { border-color: #ff6666; }
  50% { border-color: #66ccff; }
  75% { border-color: #9966ff; }
  100% { border-color: #ffcc00; }
}

@keyframes glowText {
  0% { text-shadow: 0 0 5px #ffcc00, 0 0 10px #ffcc00, 0 0 20px #ffcc00; }
  50% { text-shadow: 0 0 10px #ff6666, 0 0 20px #ff6666, 0 0 30px #ff6666; }
  100% { text-shadow: 0 0 5px #ffcc00, 0 0 10px #ffcc00, 0 0 20px #ffcc00; }
}
