/* Applying base fonts */
body {
  font-family: "Vazirmatn", sans-serif;
  background-color: #0c0a09;
}

/* Canvas background */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -10;
}

.font-minecraft {
  font-family: "Press Start 2P", cursive;
}

/* Custom styles for glowing effects */
.glow-red {
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.9), 0 0 20px rgba(239, 68, 68, 0.6);
}
.glow-blue {
  text-shadow: 0 0 8px rgba(59, 130, 246, 0.9), 0 0 20px rgba(59, 130, 246, 0.6);
}

/* Glassmorphism card with glow */
.glass-card {
  background: rgba(17, 24, 39, 0.5);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}
.glass-card:hover {
  border-color: rgba(239, 68, 68, 0.5); /* Red hover */
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.2);
}

/* --- Header Scroll Effect --- */
#main-header {
  transition: background-color 0.3s ease-in-out,
    backdrop-filter 0.3s ease-in-out, border-color 0.3s ease-in-out;
}
#main-header.scrolled {
  background: rgba(17, 24, 39, 0.5);
  backdrop-filter: blur(12px);
  border-color: rgba(255, 255, 255, 0.1);
}

/* --- Custom Range Slider --- */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  background: #334155;
  border-radius: 5px;
  outline: none;
  padding: 0;
  margin: 0;
}
input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 10px;
  cursor: pointer;
  background: linear-gradient(
    to left,
    #ef4444 var(--slider-progress, 10%),
    #475569 var(--slider-progress, 10%)
  );
  border-radius: 5px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 28px;
  width: 28px;
  border-radius: 50%;
  background: white;
  border: 4px solid #ef4444;
  cursor: pointer;
  margin-top: -9px;
  transition: transform 0.2s ease;
}
input[type="range"]:hover::-webkit-slider-thumb {
  transform: scale(1.1);
}

/* --- Button Click Animation --- */
.control-btn:active {
  transform: scale(0.9);
  transition: transform 0.1s ease-in-out;
}

/* Flowing down arrow animation */
@keyframes flow-down {
  0% {
    opacity: 0;
    transform: translateY(-15px);
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(15px);
  }
}
.scroll-flow-down i {
  animation: flow-down 2.2s infinite ease-in-out;
}
.scroll-flow-down i:nth-child(2) {
  animation-delay: 0.3s;
}
.scroll-flow-down i:nth-child(3) {
  animation-delay: 0.6s;
}

/* --- Live Indicator Animation --- */
.live-indicator {
  position: relative;
  width: 12px;
  height: 12px;
  background-color: #ef4444;
  border-radius: 50%;
}
.live-indicator::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #ef4444;
  border-radius: 50%;
  animation: pulse-wave 2s infinite;
}
@keyframes pulse-wave {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  100% {
    transform: scale(2.5);
    opacity: 0;
  }
}

/* --- DollarMine Card Pulse Animation --- */
@keyframes dollarmine-pulse-anim {
  0%,
  100% {
    transform: scale(1);
    box-shadow: none;
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.4);
  }
}
.dollarmine-pulse {
  animation: dollarmine-pulse-anim 0.4s ease-in-out;
}

/* --- Section Background --- */
.section-bg-wrapper {
  position: relative;
  overflow: hidden;
}
.section-bg-image {
  position: absolute;
  top: -20%;
  left: 0;
  right: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.3;
  z-index: -1;
  background-color: rgba(59, 130, 246, 0.2);
  background-blend-mode: overlay;
  filter: grayscale(80%);
  mask-image: linear-gradient(
    to bottom,
    black 0%,

    transparent 80%
  );
}

/* --- Modal Styles --- */
#auth-modal-overlay {
  transition: opacity 0.3s ease-in-out;
}
#auth-modal {
  transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}
#auth-modal-overlay.hidden #auth-modal {
  transform: scale(0.95);
  opacity: 0;
}
code {
  direction: ltr !important;
}

@keyframes end_crystal {
  0% {
    top: -30%;
    filter: grayscale(100%);
  }
  50% {
    top: -31%;
    filter: grayscale(20%);
  }
  100% {
    top: -30%;
    filter: grayscale(100%);
  }
}



/* --- Leaderboard Styles (New Gaming Design) --- */
@keyframes rank-glow {
  0% { box-shadow: 0 0 15px var(--glow-color); }
  50% { box-shadow: 0 0 25px var(--glow-color), 0 0 10px var(--glow-color) inset; }
  100% { box-shadow: 0 0 15px var(--glow-color); }
}

.leaderboard-container {
  border-top: 2px solid rgba(239, 68, 68, 0.6);
  background: radial-gradient(circle at top, rgba(239, 68, 68, 0.05), transparent 70%);
}

/* New Header Styles */
.leaderboard-header {
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  color: #94a3b8; /* text-slate-400 */
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.75rem;
}

.leaderboard-header .header-rank {
  /* width of rank item + margin */
  width: calc(2.75rem + 1rem);
  flex-shrink: 0;
  padding-right: 0.5rem; /* to align with center of rank number */
}

.leaderboard-header .header-name {
  flex-grow: 1;
  /* width of avatar + margin */
  padding-right: calc(44px + 1rem);
}

.leaderboard-header .header-stat {
  text-align: right;
}


.leaderboard-item {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.05) 0%, rgba(17, 24, 39, 0.1) 100%);
  border-radius: 0.5rem;
  border-left: 4px solid rgba(239, 68, 68, 0.4);
  transition: all 0.3s ease;
  transform: perspective(1000px); /* For 3D effect */
}

.leaderboard-item:hover {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.15) 0%, rgba(17, 24, 39, 0.2) 100%);
  border-left-color: #ef4444;
  transform: translateX(10px) rotateY(-1deg);
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.leaderboard-rank {
  font-family: "Press Start 2P", cursive;
  font-size: 1rem;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem; /* rounded-md */
  margin-left: 1rem;
  flex-shrink: 0;
  color: #fca5a5; /* text-red-300 */
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  clip-path: polygon(20% 0%, 80% 0%, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0% 80%, 0% 20%);
}

/* Special ranks */
.leaderboard-rank.rank-1 {
  background: linear-gradient(45deg, #fef08a, #facc15);
  color: #422006;
  border: none;
  --glow-color: rgba(250, 204, 21, 0.7);
  animation: rank-glow 2s infinite ease-in-out;
}
.leaderboard-rank.rank-2 {
  background: linear-gradient(45deg, #f1f5f9, #d1d5db);
  color: #1e293b;
  border: none;
  --glow-color: rgba(209, 213, 219, 0.6);
  animation: rank-glow 2.2s infinite ease-in-out;
}
.leaderboard-rank.rank-3 {
  background: linear-gradient(45deg, #fb923c, #d97706);
  color: #431407;
  border: none;
  --glow-color: rgba(217, 119, 6, 0.6);
  animation: rank-glow 2.4s infinite ease-in-out;
}

.leaderboard-avatar {
  width: 44px;
  height: 44px;
  border-radius: 0.375rem;
  margin-left: 1rem;
  background-color: #1f2937;
  image-rendering: pixelated;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-name {
  font-weight: 700;
  font-size: 1.125rem;
  color: #f3f4f6;
  flex-grow: 1;
  text-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.leaderboard-stat {
  font-family: "Press Start 2P", cursive;
  font-size: 0.9rem;
  color: #f87171; /* text-red-400 */
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
  direction: ltr;
}
