/* Base styles */
body {
  font-family: 'Vazir', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  background: linear-gradient(to bottom, #d6dbdc, #ffffff);
  min-height: 100vh;
  direction: rtl;
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
}

/* Stats section */
.stats-container {
  width: 100%;
  max-width: 64rem;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 768px) {
  .stats-container {
    flex-direction: row;
    gap: 1rem;
  }
}

.stat-box {
  background-color: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  padding: 1rem;
  text-align: center;
  flex: 1;
}

.stat-box h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
}

.stat-box p {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2563eb;
}

/* Kiss area */
.kiss-area {
  position: relative;
  width: 100%;
  max-width: 64rem;
  aspect-ratio: 16/9;
  background-color: #e5e7eb;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  cursor: pointer;
}

.flag-background {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Kiss marks container */
#kiss-marks-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Leaderboard */
.leaderboard-container {
  width: 100%;
  max-width: 64rem;
  margin-top: 2rem;
  background-color: #f3f4f6;
  border-radius: 0.5rem;
  padding: 1.5rem;
}

.leaderboard-container h2 {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  color: #374151;
  margin-bottom: 1rem;
}

#leaderboard-list {
  max-height: 20rem;
  overflow-y: auto;
}

.leaderboard-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem;
  border-bottom: 1px solid #d1d5db;
}

.leaderboard-item span:first-child {
  font-weight: 700;
  color: #2563eb;
}

.leaderboard-item span:last-child {
  font-weight: 700;
  color: #16a34a;
}

/* Instructions */
.instructions {
  margin-top: 1rem;
  text-align: center;
  color: #4b5563;
  padding: 1rem;
}

/* Animation for kiss effect */
@keyframes kissEffect {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
  }
  10% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
  }
  20% {
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 1;
  }
  30% {
    transform: translate(-50%, -50%) scale(1.05);
    opacity: 1;
  }
  70% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
  }
}

.kiss-animation {
  position: absolute;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  animation: kissEffect 1.5s ease-out forwards;
  font-size: 24px;
  line-height: 1;
  z-index: 10;
}

.kiss-animation img {
  width: 30px;
  height: 30px;
  display: block;
}

/* Animation for the flag when kissed */
@keyframes flagKissed {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.flag.kissed {
  animation: flagKissed 0.3s ease;
}

/* Animation for the container shake effect */
@keyframes flagShake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
  20%, 40%, 60%, 80% { transform: translateX(2px); }
}

.flag-shake {
  animation: flagShake 0.4s ease-in-out;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .kiss-area {
    aspect-ratio: 4/3;
  }
  
  .stat-box h3 {
    font-size: 1rem;
  }
  
  .stat-box p {
    font-size: 1.25rem;
  }
  
  .leaderboard-container h2 {
    font-size: 1.25rem;
  }
}