/*
 * Medal-styled круглые pills для подсветки места 1/2/3.
 * Используются в competition.html leaderboard, slice-table и athlete.html timeline.
 *
 * Tailwind 4 utilities purge может не покрыть все нужные оттенки —
 * фиксируем явно через CSS variables. Светлая и тёмная темы одинаковы:
 * медальные цвета универсальны для recognisability.
 */

.place-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  font-feature-settings: "tnum";
  flex-shrink: 0;
}

.place-pill-sm {
  width: 24px;
  height: 24px;
  font-size: 11px;
}

.place-medal-1 {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.28), rgba(245, 158, 11, 0.18));
  color: #fde68a;
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.45);
}

.place-medal-2 {
  background: linear-gradient(135deg, rgba(226, 232, 240, 0.22), rgba(148, 163, 184, 0.18));
  color: #e2e8f0;
  box-shadow: inset 0 0 0 1px rgba(203, 213, 225, 0.4);
}

.place-medal-3 {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.32), rgba(180, 83, 9, 0.22));
  color: #fed7aa;
  box-shadow: inset 0 0 0 1px rgba(217, 119, 6, 0.45);
}

.place-other {
  background: rgba(255, 255, 255, 0.05);
  color: #9ca3af;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.place-empty {
  color: rgba(255, 255, 255, 0.3);
  font-weight: 400;
}

.place-registered {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 9999px;
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.35);
  font-size: 10px;
  font-weight: 600;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.place-registered::before {
  content: "●";
  font-size: 6px;
  color: #60a5fa;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Plавно переливающаяся иконка места — для последнего получившего score.
   Outer glow + scale + brightness pulse. Не перетирает inset box-shadow медалей.
   Используется через class animate-pulse-soft. */
.place-pill.animate-pulse-soft {
  animation: place-pill-shimmer 1.6s ease-in-out infinite;
  position: relative;
  z-index: 1;
}

@keyframes place-pill-shimmer {
  0%, 100% {
    transform: scale(1);
    filter: brightness(1) drop-shadow(0 0 0 rgba(248, 113, 113, 0));
  }
  50% {
    transform: scale(1.18);
    filter: brightness(1.5) drop-shadow(0 0 6px rgba(248, 113, 113, 0.85));
  }
}

/* Дополнительная световая обводка через ::after — не конфликтует с inset shadow медалей. */
.place-pill.animate-pulse-soft::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 9999px;
  border: 2px solid rgba(248, 113, 113, 0.9);
  animation: place-pill-ring 1.6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes place-pill-ring {
  0%, 100% {
    opacity: 0.4;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}
