/* ===== Event Rankings Styles ===== */
.event-rankings {
  min-height: 100vh;
  background: linear-gradient(135deg,
    var(--color-game-dark-bg, #0a0a0f),
    var(--color-game-dark-surface, #1a1a2e)
  );
}

/* ===== Page Header ===== */
.event-header {
  text-align: center;
  margin-bottom: 3rem;
}

.event-title {
  font-size: 3rem;
  font-weight: 700;
  color: white;
  margin-bottom: 1rem;
  text-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
}

.event-title-divider {
  width: 6rem;
  height: 4px;
  background: linear-gradient(90deg,
    var(--color-game-purple-500, #a855f7),
    var(--color-game-neon-cyan, #00ffff)
  );
  margin: 0 auto;
  border-radius: 2px;
}

.event-subtitle {
  font-size: 1.25rem;
  color: var(--color-game-purple-200, #e3d2ff);
  margin-top: 1rem;
}

/* ===== Live Indicator ===== */
.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 0.5rem;
  backdrop-filter: blur(10px);
}

.live-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

/* ===== Event Tabs ===== */
.event-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.event-tab {
  padding: 0.75rem 1.5rem;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 0.5rem;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.event-tab:hover {
  background: rgba(168, 85, 247, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(168, 85, 247, 0.3);
}

.event-tab.active {
  background: linear-gradient(135deg,
    var(--color-game-purple-600, #9333ea),
    var(--color-game-purple-700, #7c3aed)
  );
  border-color: var(--color-game-purple-500, #a855f7);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
}

/* ===== Event Info Grid ===== */
.event-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.event-info-item {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.event-info-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 1.5rem;
  backdrop-filter: blur(20px);
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.event-info-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* ===== Event Rules Styling ===== */
.rules-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.rule-item {
  opacity: 0;
  transform: translateY(20px);
  animation-fill-mode: forwards;
  animation-duration: 0.6s;
  animation-timing-function: ease-out;
}

.rule-card {
  position: relative;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.rule-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.rule-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}

.emoji-icon {
  font-size: 1.5rem;
  line-height: 1;
  display: block;
}

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

.rule-label {
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0.8;
  text-transform: capitalize;
}

.rule-value {
  font-weight: 600;
}

.rule-value-text {
  font-size: 1.1rem;
}

.job-tag {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}

.job-tag:hover {
  transform: scale(1.05);
}

.rule-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.rule-card:hover .rule-glow {
  opacity: 0.1;
}

/* Color Themes */
.rule-card-emerald {
  border-color: rgba(16, 185, 129, 0.3);
}

.rule-card-emerald:hover {
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.2);
}

.rule-icon-emerald {
  background: rgba(16, 185, 129, 0.2);
}

.emoji-icon.rule-icon-emerald {
  filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.5));
}

.rule-label {
  color: rgb(156, 163, 175);
}

.rule-value-emerald {
  color: rgb(52, 211, 153);
}

.rule-glow-emerald {
  background: linear-gradient(45deg, rgba(16, 185, 129, 0.3), rgba(52, 211, 153, 0.3));
}

.rule-card-blue {
  border-color: rgba(59, 130, 246, 0.3);
}

.rule-card-blue:hover {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 8px 32px rgba(59, 130, 246, 0.2);
}

.rule-icon-blue {
  background: rgba(59, 130, 246, 0.2);
}

.emoji-icon.rule-icon-blue {
  filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.5));
}

.rule-value-blue {
  color: rgb(96, 165, 250);
}

.rule-glow-blue {
  background: linear-gradient(45deg, rgba(59, 130, 246, 0.3), rgba(96, 165, 250, 0.3));
}

.rule-card-red {
  border-color: rgba(239, 68, 68, 0.3);
}

.rule-card-red:hover {
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 8px 32px rgba(239, 68, 68, 0.2);
}

.rule-icon-red {
  background: rgba(239, 68, 68, 0.2);
}

.emoji-icon.rule-icon-red {
  filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.5));
}

.rule-value-red {
  color: rgb(248, 113, 113);
}

.rule-glow-red {
  background: linear-gradient(45deg, rgba(239, 68, 68, 0.3), rgba(248, 113, 113, 0.3));
}

.rule-card-purple {
  border-color: rgba(147, 51, 234, 0.3);
}

.rule-card-purple:hover {
  border-color: rgba(147, 51, 234, 0.5);
  box-shadow: 0 8px 32px rgba(147, 51, 234, 0.2);
}

.rule-icon-purple {
  background: rgba(147, 51, 234, 0.2);
}

.emoji-icon.rule-icon-purple {
  filter: drop-shadow(0 0 8px rgba(147, 51, 234, 0.5));
}

.rule-value-purple {
  color: rgb(168, 85, 247);
}

.rule-glow-purple {
  background: linear-gradient(45deg, rgba(147, 51, 234, 0.3), rgba(168, 85, 247, 0.3));
}

.rule-card-indigo {
  border-color: rgba(99, 102, 241, 0.3);
}

.rule-card-indigo:hover {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.2);
}

.rule-icon-indigo {
  background: rgba(99, 102, 241, 0.2);
}

.emoji-icon.rule-icon-indigo {
  filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.5));
}

.rule-value-indigo {
  color: rgb(129, 140, 248);
}

.rule-glow-indigo {
  background: linear-gradient(45deg, rgba(99, 102, 241, 0.3), rgba(129, 140, 248, 0.3));
}

.rule-card-yellow {
  border-color: rgba(245, 158, 11, 0.3);
}

.rule-card-yellow:hover {
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 8px 32px rgba(245, 158, 11, 0.2);
}

.rule-icon-yellow {
  background: rgba(245, 158, 11, 0.2);
}

.emoji-icon.rule-icon-yellow {
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.5));
}

.rule-value-yellow {
  color: rgb(251, 191, 36);
}

.rule-glow-yellow {
  background: linear-gradient(45deg, rgba(245, 158, 11, 0.3), rgba(251, 191, 36, 0.3));
}

/* Animations */
@keyframes fade-slide-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-slide-right {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fade-slide-left {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fade-slide-down {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-scale {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fade-bounce {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(10px);
  }
  60% {
    opacity: 0.8;
    transform: scale(1.05) translateY(-5px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ===== Countdown Timer Enhanced ===== */
.countdown-container {
  text-align: center;
}

.countdown-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: white;
  margin-bottom: 1rem;
}

.countdown-timer {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  background: linear-gradient(135deg,
    rgba(239, 68, 68, 0.2),
    rgba(239, 68, 68, 0.1)
  );
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 0.5rem;
  backdrop-filter: blur(10px);
  min-width: 4rem;
  transition: all 0.3s ease;
}

.countdown-unit:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 20px rgba(239, 68, 68, 0.3);
}

.countdown-unit.critical {
  background: linear-gradient(135deg,
    rgba(239, 68, 68, 0.4),
    rgba(239, 68, 68, 0.2)
  );
  border-color: rgba(239, 68, 68, 0.6);
  animation: pulse-critical 1s ease-in-out infinite;
}

.countdown-number {
  font-size: 2rem;
  font-weight: 700;
  color: #ef4444;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
  transition: all 0.3s ease;
}

.countdown-unit.critical .countdown-number {
  color: #ff3333;
  text-shadow: 0 0 20px rgba(255, 51, 51, 0.8);
}

.countdown-label {
  font-size: 0.75rem;
  color: rgba(239, 68, 68, 0.8);
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Timer Container Enhanced */
.event-timer-container {
  position: relative;
  overflow: hidden;
}

.timer-header {
  display: flex;
  justify-content: between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.timer-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-indicator.active {
  background: rgba(34, 197, 94, 0.2);
  color: rgb(134, 239, 172);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-indicator.inactive {
  background: rgba(239, 68, 68, 0.2);
  color: rgb(252, 165, 165);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
}

.status-indicator.active .status-dot {
  background: rgb(74, 222, 128);
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.status-indicator.inactive .status-dot {
  background: rgb(248, 113, 113);
}

/* Progress Bar Enhanced */
.timer-progress {
  margin-bottom: 1.5rem;
}

.progress-bar {
  width: 100%;
  height: 0.5rem;
  background: rgba(71, 85, 105, 0.5);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, rgb(59, 130, 246), rgb(147, 51, 234));
  transition: width 1s ease-out;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shine 2s ease-in-out infinite;
}

.progress-fill.progress-critical {
  background: linear-gradient(90deg, rgb(239, 68, 68), rgb(251, 146, 60));
}

.progress-text {
  text-align: center;
  font-size: 0.875rem;
  color: rgb(148, 163, 184);
  margin-top: 0.5rem;
}

/* Animation Keyframes */
@keyframes pulse-critical {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
  }
}

@keyframes shine {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@keyframes confetti-fall {
  0% {
    transform: translateY(-100px) rotateZ(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(calc(100vh + 100px)) rotateZ(720deg);
    opacity: 0;
  }
}

@keyframes celebration-bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translate3d(0, 0, 0);
  }
  40%, 43% {
    transform: translate3d(0, -20px, 0);
  }
  70% {
    transform: translate3d(0, -10px, 0);
  }
  90% {
    transform: translate3d(0, -4px, 0);
  }
}

/* Timer States */
.timer-inactive, .timer-error {
  text-align: center;
  padding: 2rem 1.5rem;
  background: linear-gradient(135deg,
    rgba(71, 85, 105, 0.3),
    rgba(51, 65, 85, 0.3)
  );
  backdrop-filter: blur(20px);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 1rem;
  transition: all 0.3s ease;
}

.timer-inactive:hover, .timer-error:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.timer-ended, .event-finished {
  text-align: center;
  padding: 2rem;
  background: linear-gradient(135deg,
    rgba(34, 197, 94, 0.2),
    rgba(16, 185, 129, 0.1)
  );
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 1rem;
  backdrop-filter: blur(20px);
}

.finished-animation {
  position: relative;
  animation: celebration-bounce 2s ease-out;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  pointer-events: none;
  z-index: 1000;
}

/* Responsive Countdown */
@media (max-width: 768px) {
  .countdown-timer {
    grid-template-columns: repeat(2, 1fr);
    display: grid;
    gap: 0.75rem;
  }

  .countdown-unit {
    min-width: auto;
    padding: 0.75rem;
  }

  .countdown-number {
    font-size: 1.5rem;
  }

  .timer-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .countdown-number {
    font-size: 1.25rem;
  }

  .countdown-unit {
    padding: 0.5rem;
  }
}

/* ===== Event Status ===== */
.event-status {
  text-align: center;
  margin-bottom: 1rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-active {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-inactive {
  background: rgba(156, 163, 175, 0.1);
  color: #9ca3af;
  border: 1px solid rgba(156, 163, 175, 0.3);
}

/* ===== TOP 3 Players Podium ===== */
.top-players-section {
  margin-bottom: 3rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: white;
  text-align: center;
  margin-bottom: 2rem;
  text-shadow: 0 0 15px rgba(168, 85, 247, 0.5);
}

.podium-container {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
  align-items: end;
}

.podium-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
  border-radius: 1rem;
  backdrop-filter: blur(20px);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.podium-player::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.1));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.podium-player:hover::before {
  opacity: 1;
}

.podium-player:hover {
  transform: translateY(-10px) scale(1.02);
}

/* Podium Rankings */
.podium-first {
  background: linear-gradient(135deg,
    rgba(255, 215, 0, 0.2),
    rgba(255, 193, 7, 0.1)
  );
  border: 2px solid rgba(255, 215, 0, 0.4);
  animation: goldGlow 3s ease-in-out infinite;
  order: 2;
  transform: scale(1.1);
}

.podium-second {
  background: linear-gradient(135deg,
    rgba(192, 192, 192, 0.2),
    rgba(169, 169, 169, 0.1)
  );
  border: 2px solid rgba(192, 192, 192, 0.4);
  animation: silverGlow 3s ease-in-out infinite;
  order: 1;
}

.podium-third {
  background: linear-gradient(135deg,
    rgba(205, 127, 50, 0.2),
    rgba(184, 115, 51, 0.1)
  );
  border: 2px solid rgba(205, 127, 50, 0.4);
  animation: bronzeGlow 3s ease-in-out infinite;
  order: 3;
}

/* Player Avatar */
.player-avatar-container {
  position: relative;
  margin-bottom: 1rem;
}

.player-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid;
  object-fit: cover;
  transition: all 0.3s ease;
}

.podium-first .player-avatar {
  border-color: #ffd700;
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
}

.podium-second .player-avatar {
  border-color: #c0c0c0;
  box-shadow: 0 0 20px rgba(192, 192, 192, 0.5);
}

.podium-third .player-avatar {
  border-color: #cd7f32;
  box-shadow: 0 0 20px rgba(205, 127, 50, 0.5);
}

/* Crown for 1st place */
.crown {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2rem;
  animation: float 3s ease-in-out infinite;
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
}

/* Rank Badge */
.rank-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  border: 2px solid;
}

.rank-badge.rank-1 {
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #7c2d12;
  border-color: #ffd700;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

.rank-badge.rank-2 {
  background: linear-gradient(135deg, #c0c0c0, #e5e7eb);
  color: #374151;
  border-color: #c0c0c0;
  box-shadow: 0 0 10px rgba(192, 192, 192, 0.5);
}

.rank-badge.rank-3 {
  background: linear-gradient(135deg, #cd7f32, #d97706);
  color: #ffffff;
  border-color: #cd7f32;
  box-shadow: 0 0 10px rgba(205, 127, 50, 0.5);
}

/* Player Info */
.player-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.5rem;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.player-points {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  text-align: center;
}

.podium-first .player-points {
  color: #ffd700;
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
}

.podium-second .player-points {
  color: #c0c0c0;
  text-shadow: 0 0 10px rgba(192, 192, 192, 0.6);
}

.podium-third .player-points {
  color: #cd7f32;
  text-shadow: 0 0 10px rgba(205, 127, 50, 0.6);
}

.player-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

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

.stat-value {
  font-weight: 600;
  color: white;
}

/* ===== Other Players Table ===== */
.other-players-section {
  margin-top: 3rem;
}

.players-table-container {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  overflow: hidden;
  backdrop-filter: blur(20px);
}

.players-table {
  width: 100%;
  border-collapse: collapse;
}

.table-header {
  background: linear-gradient(135deg,
    rgba(168, 85, 247, 0.3),
    rgba(168, 85, 247, 0.1)
  );
}

.table-header th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.875rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.table-row {
  transition: all 0.3s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.table-row:hover {
  background: rgba(168, 85, 247, 0.1);
  transform: translateX(5px);
}

.table-cell {
  padding: 1rem;
  color: rgba(255, 255, 255, 0.9);
  vertical-align: middle;
  height: 60px; /* ارتفاع ثابت للخانات */
  box-sizing: border-box;
}

.rank-cell {
  font-weight: 700;
  color: var(--color-game-neon-cyan, #00ffff);
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
  width: 80px; /* عرض ثابت لعمود الترتيب */
}

.player-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.player-small-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(168, 85, 247, 0.5);
  object-fit: cover;
}

.points-cell {
  font-weight: 700;
  color: #22c55e;
  text-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

/* ===== No Events State ===== */
.no-events {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
}

.no-events-icon {
  font-size: 4rem;
  color: rgba(255, 255, 255, 0.3);
  margin-bottom: 1rem;
}

.no-events-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: white;
  margin-bottom: 0.5rem;
}

.no-events-description {
  color: rgba(255, 255, 255, 0.6);
}

/* ===== Optimization Info ===== */
.optimization-info {
  text-align: center;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.optimization-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 0.5rem;
  backdrop-filter: blur(10px);
}

.optimization-text {
  color: #93c5fd;
  font-size: 0.75rem;
}

/* ===== Player Ownership Styles ===== */

/* Ownership Badge for Podium Players */
.ownership-badge {
  position: absolute;
  top: -10px;
  left: -10px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  padding: 0.375rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  border: 2px solid rgba(16, 185, 129, 0.6);
  animation: ownershipPulse 2s ease-in-out infinite;
  z-index: 10;
}

.ownership-champion {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-color: rgba(245, 158, 11, 0.6);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.5);
  animation: championGlow 2s ease-in-out infinite;
}

/* Player Owned Styling for Podium */
.player-owned {
  position: relative;
  border: 3px solid transparent;
  background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05)),
                    linear-gradient(135deg, #10b981, #059669, #10b981);
  background-origin: border-box;
  background-clip: content-box, border-box;
  animation: ownedPlayerGlow 3s ease-in-out infinite;
}

.player-owned::before {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  background: linear-gradient(45deg, #10b981, #059669, #34d399, #10b981);
  border-radius: inherit;
  z-index: -1;
  opacity: 0.3;
  animation: rotatingBorder 4s linear infinite;
}

/* Table Row Owned Styling */
.table-row-owned {
  background: linear-gradient(90deg,
    rgba(16, 185, 129, 0.08) 0%,
    rgba(16, 185, 129, 0.03) 50%,
    rgba(16, 185, 129, 0.08) 100%);
  border-left: 3px solid #10b981;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(16, 185, 129, 0.2),
              inset 0 -1px 0 rgba(16, 185, 129, 0.2);
  animation: tableRowOwnedPulse 4s ease-in-out infinite;
}

.table-row-owned:hover {
  background: linear-gradient(90deg,
    rgba(16, 185, 129, 0.15) 0%,
    rgba(16, 185, 129, 0.08) 50%,
    rgba(16, 185, 129, 0.15) 100%);
  transform: translateX(3px);
  box-shadow: inset 0 1px 0 rgba(16, 185, 129, 0.3),
              inset 0 -1px 0 rgba(16, 185, 129, 0.3),
              0 4px 15px rgba(16, 185, 129, 0.2);
}

@keyframes tableRowOwnedPulse {
  0%, 100% {
    border-left-color: #10b981;
    box-shadow: inset 0 1px 0 rgba(16, 185, 129, 0.2),
                inset 0 -1px 0 rgba(16, 185, 129, 0.2);
  }
  50% {
    border-left-color: #34d399;
    box-shadow: inset 0 1px 0 rgba(16, 185, 129, 0.3),
                inset 0 -1px 0 rgba(16, 185, 129, 0.3);
  }
}



/* Rank Cell Owned */
.rank-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.owned-indicator {
  color: #10b981;
  font-size: 0.875rem;
  padding: 0.125rem 0.25rem;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 0.25rem;
  animation: ownedIndicatorPulse 2s ease-in-out infinite;
}

@keyframes ownedIndicatorPulse {
  0%, 100% {
    background: rgba(16, 185, 129, 0.1);
    transform: scale(1);
  }
  50% {
    background: rgba(16, 185, 129, 0.2);
    transform: scale(1.1);
  }
}

/* Player Info Owned */
.player-info-owned {
  position: relative;
  border-left: 3px solid #10b981;
  padding-left: 0.5rem;
  background: linear-gradient(90deg,
    rgba(16, 185, 129, 0.05) 0%,
    transparent 20%);
}

.player-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 48px; /* ارتفاع ثابت لمنع تحريك الصفوف */
  padding: 0.25rem 0; /* حشو منتظم */
  box-sizing: border-box; /* للتأكد من احتواء كل العناصر داخل الحدود */
}

/* Avatar Owned Styling */
.avatar-owned {
  border: 3px solid #10b981 !important;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.6) !important;
  animation: avatarOwnedGlow 3s ease-in-out infinite;
  position: relative;
}

.avatar-owned::after {
  content: '✨';
  position: absolute;
  top: -8px;
  right: -8px;
  font-size: 1rem;
  z-index: 10;
  animation: sparkleRotate 4s linear infinite;
}

@keyframes avatarOwnedGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.8);
    transform: scale(1.05);
  }
}

@keyframes sparkleRotate {
  0% {
    transform: rotate(0deg) scale(1);
  }
  25% {
    transform: rotate(90deg) scale(1.1);
  }
  50% {
    transform: rotate(180deg) scale(1);
  }
  75% {
    transform: rotate(270deg) scale(1.1);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

/* Player Name Wrapper */
.player-name-wrapper {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 1.5rem; /* ثابت لمنع تحريك الخانات */
}

.player-name-container {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.owned-player-name {
  color: #10b981 !important;
  font-weight: 700 !important;
  text-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

/* Your Character Badge */
.your-character-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.5rem;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border-radius: 0.375rem;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
  border: 1px solid rgba(16, 185, 129, 0.5);
  animation: yourCharBadgeGlow 3s ease-in-out infinite;
  white-space: nowrap;
}

.your-character-badge i {
  font-size: 0.7rem;
}

@keyframes yourCharBadgeGlow {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.5);
    transform: scale(1.02);
  }
}

.ownership-label {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  color: #10b981;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 2px;
}

/* ===== Ranking Change Animations ===== */

/* Rank Up Animation */
@keyframes rankUp {
  0% {
    transform: translateY(0) scale(1);
    background: rgba(34, 197, 94, 0.1);
  }
  25% {
    transform: translateY(-10px) scale(1.05);
    background: rgba(34, 197, 94, 0.3);
  }
  50% {
    transform: translateY(-5px) scale(1.02);
    background: rgba(34, 197, 94, 0.2);
  }
  75% {
    transform: translateY(-7px) scale(1.03);
    background: rgba(34, 197, 94, 0.25);
  }
  100% {
    transform: translateY(0) scale(1);
    background: rgba(34, 197, 94, 0.1);
  }
}

/* Rank Down Animation */
@keyframes rankDown {
  0% {
    transform: translateY(0) scale(1);
    background: rgba(239, 68, 68, 0.1);
  }
  25% {
    transform: translateY(10px) scale(0.95);
    background: rgba(239, 68, 68, 0.3);
  }
  50% {
    transform: translateY(5px) scale(0.98);
    background: rgba(239, 68, 68, 0.2);
  }
  75% {
    transform: translateY(7px) scale(0.97);
    background: rgba(239, 68, 68, 0.25);
  }
  100% {
    transform: translateY(0) scale(1);
    background: rgba(239, 68, 68, 0.1);
  }
}

/* New Entry Animation */
@keyframes newEntry {
  0% {
    opacity: 0;
    transform: translateX(-100%) scale(0.8);
    background: rgba(168, 85, 247, 0.1);
  }
  25% {
    opacity: 0.5;
    transform: translateX(-50%) scale(0.9);
    background: rgba(168, 85, 247, 0.3);
  }
  50% {
    opacity: 0.8;
    transform: translateX(-10%) scale(1.05);
    background: rgba(168, 85, 247, 0.2);
  }
  75% {
    opacity: 0.9;
    transform: translateX(5%) scale(1.02);
    background: rgba(168, 85, 247, 0.25);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
    background: transparent;
  }
}

/* Points Increase Animation */
@keyframes pointsIncrease {
  0% {
    color: inherit;
    text-shadow: none;
  }
  50% {
    color: #22c55e;
    text-shadow: 0 0 15px rgba(34, 197, 94, 0.8);
    transform: scale(1.1);
  }
  100% {
    color: inherit;
    text-shadow: none;
    transform: scale(1);
  }
}

/* ===== Ownership Animations ===== */

@keyframes ownershipPulse {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
    transform: scale(1.05);
  }
}

@keyframes championGlow {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.5);
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.8);
  }
  50% {
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.8);
    text-shadow: 0 0 20px rgba(245, 158, 11, 1);
  }
}

@keyframes ownedPlayerGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.5);
  }
}

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

@keyframes tableRowGlow {
  0%, 100% {
    box-shadow: inset 3px 0 0 #10b981;
  }
  50% {
    box-shadow: inset 3px 0 0 #10b981, 0 0 10px rgba(16, 185, 129, 0.2);
  }
}

@keyframes scanLine {
  0% {
    transform: translateX(-100%);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateX(100%);
    opacity: 0;
  }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-5px);
  }
  60% {
    transform: translateY(-3px);
  }
}

@keyframes heightPulse {
  0%, 100% {
    height: 80%;
    opacity: 0.7;
  }
  50% {
    height: 100%;
    opacity: 1;
  }
}

@keyframes avatarGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
  }
  50% {
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.8);
  }
}

/* ===== Animation Classes for JavaScript ===== */
.rank-up-animation {
  animation: rankUp 1.5s ease-out;
}

.rank-down-animation {
  animation: rankDown 1.5s ease-out;
}

.new-entry-animation {
  animation: newEntry 2s ease-out;
}

.points-increase-animation {
  animation: pointsIncrease 1s ease-out;
}

/* Highlight Animation for Real-time Updates */
.ranking-highlight {
  position: relative;
  overflow: hidden;
}

.ranking-highlight::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent);
  animation: shine 1.5s ease-out;
}

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

/* ===== Additional Animations for Enhanced Features ===== */

@keyframes sparkle {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(0) scale(0.5) rotate(0deg);
  }
  25% {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px) scale(0.8) rotate(90deg);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px) scale(1) rotate(180deg);
  }
  75% {
    opacity: 0.8;
    transform: translateX(-50%) translateY(-15px) scale(1.1) rotate(270deg);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px) scale(0.5) rotate(360deg);
  }
}

@keyframes floatUp {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  50% {
    opacity: 0.8;
    transform: translateY(-15px) scale(1.1);
  }
  100% {
    opacity: 0;
    transform: translateY(-30px) scale(1.2);
  }
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Enhanced Ownership Styles for Better Visibility */
.player-owned .player-avatar {
  position: relative;
  overflow: visible;
}

.player-owned .player-avatar::after {
  content: '👑';
  position: absolute;
  top: -8px;
  right: -8px;
  font-size: 1.2rem;
  z-index: 10;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  animation: crownBounce 3s ease-in-out infinite;
}

@keyframes crownBounce {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-3px) rotate(5deg);
  }
  50% {
    transform: translateY(-1px) rotate(-2deg);
  }
  75% {
    transform: translateY(-2px) rotate(3deg);
  }
}

/* Enhanced Table Row Animations */
.table-row-owned:hover {
  background: linear-gradient(90deg,
    rgba(16, 185, 129, 0.2) 0%,
    rgba(16, 185, 129, 0.1) 50%,
    rgba(16, 185, 129, 0.2) 100%);
  box-shadow: inset 4px 0 0 #10b981, 0 0 20px rgba(16, 185, 129, 0.4);
  transform: translateX(8px);
}

/* Pulsing effect for owned players in rankings */
.player-owned::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border: 2px solid #10b981;
  border-radius: inherit;
  animation: ownedPulse 2s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes ownedPulse {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.02);
  }
}

/* Special effects for champion owned player */
.podium-first.player-owned {
  position: relative;
  overflow: visible;
}

.podium-first.player-owned::before {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  background: linear-gradient(45deg, #ffd700, #ffed4e, #ffd700, #ffed4e);
  border-radius: inherit;
  z-index: -2;
  opacity: 0.4;
  animation: championGoldenGlow 4s ease-in-out infinite;
}

@keyframes championGoldenGlow {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1) rotate(0deg);
  }
  25% {
    opacity: 0.5;
    transform: scale(1.02) rotate(90deg);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.04) rotate(180deg);
  }
  75% {
    opacity: 0.5;
    transform: scale(1.02) rotate(270deg);
  }
}

/* ===== Responsive Design ===== */

/* Tablet */
@media (max-width: 1024px) {
  .event-title {
    font-size: 2.5rem;
  }

  .event-info-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .event-info-item {
    height: auto;
  }

  .rules-container {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .rule-card {
    padding: 1rem;
  }

  .rule-icon {
    width: 32px;
    height: 32px;
  }

  .podium-container {
    grid-template-columns: 1fr;
    gap: 1rem;
    max-width: 400px;
  }

  .podium-first {
    order: 1;
    transform: none;
  }

  .podium-second {
    order: 2;
  }

  .podium-third {
    order: 3;
  }

  .player-avatar {
    width: 100px;
    height: 100px;
  }

  .countdown-timer {
    gap: 0.5rem;
  }

  .countdown-unit {
    padding: 0.75rem;
    min-width: 3rem;
  }

  .countdown-number {
    font-size: 1.5rem;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .event-rankings {
    padding: 1rem;
  }

  .event-title {
    font-size: 2rem;
  }

  .event-subtitle {
    font-size: 1rem;
  }

  .event-tabs {
    flex-direction: column;
    gap: 0.5rem;
  }

  .event-tab {
    padding: 0.5rem 1rem;
    text-align: center;
  }

  .podium-player {
    padding: 1rem;
  }

  .player-avatar {
    width: 80px;
    height: 80px;
  }

  .player-name {
    font-size: 1rem;
  }

  .player-points {
    font-size: 1.25rem;
  }

  .player-stats {
    flex-direction: column;
    gap: 0.5rem;
  }

  .countdown-timer {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .countdown-unit {
    padding: 0.5rem;
    min-width: 2.5rem;
  }

  .countdown-number {
    font-size: 1.25rem;
  }

  .countdown-label {
    font-size: 0.625rem;
  }

  .players-table-container {
    overflow-x: auto;
  }

  .table-header th,
  .table-cell {
    padding: 0.75rem 0.5rem;
    font-size: 0.875rem;
  }

  .player-info {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .player-small-avatar {
    width: 32px;
    height: 32px;
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  .event-title {
    font-size: 1.75rem;
  }

  .countdown-timer {
    justify-content: center;
    max-width: 100%;
  }

  .countdown-unit {
    min-width: 2rem;
    padding: 0.25rem;
  }

  .countdown-number {
    font-size: 1rem;
  }

  .optimization-badge {
    padding: 0.25rem 0.5rem;
  }

  .optimization-text {
    font-size: 0.625rem;
  }
}

/* ===== RTL Support ===== */
[dir="rtl"] .player-info {
  flex-direction: row-reverse;
}

[dir="rtl"] .table-row:hover {
  transform: translateX(-5px);
}

[dir="rtl"] .crown {
  transform: translateX(50%);
}

/* ===== Dark Theme Enhancements ===== */
@media (prefers-color-scheme: dark) {
  .event-rankings {
    background: linear-gradient(135deg, #0a0a0f, #1a1a2e);
  }
}

/* ===== Print Styles ===== */
@media print {
  .event-rankings {
    background: white !important;
    color: black !important;
  }

  .podium-player,
  .event-info-card,
  .players-table-container {
    background: white !important;
    border: 1px solid #ccc !important;
  }

  .player-avatar,
  .player-small-avatar {
    filter: grayscale(100%);
  }
}
