/* ═══════════════════════════════════════════════════════════
   WHO IS THE GOAT — Design System & Styles
   Light theme · Warm gold accents · Glassmorphism cards
   ═══════════════════════════════════════════════════════════ */

/* ────────── Custom Properties ────────── */
:root {
  /* Palette */
  --color-bg:           #f5f3ef;
  --color-surface:      #ffffff;
  --color-text:         #1a1a2e;
  --color-text-muted:   #6b7280;
  --color-border:       rgba(0, 0, 0, 0.06);

  /* Ronaldo — deep crimson/red */
  --color-ronaldo:      #c0272d;
  --color-ronaldo-glow: rgba(192, 39, 45, 0.25);
  --color-ronaldo-light:#fde8e8;

  /* Messi — royal blue/sky */
  --color-messi:        #3b82f6;
  --color-messi-glow:   rgba(59, 130, 246, 0.25);
  --color-messi-light:  #dbeafe;

  /* Accent gold */
  --color-accent:       #d4a017;
  --color-accent-light: #fef3c7;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 4rem;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.08);
  --shadow-card-hover: 0 16px 48px rgba(0, 0, 0, 0.12);
  --shadow-glow-ronaldo: 0 0 60px var(--color-ronaldo-glow);
  --shadow-glow-messi:   0 0 60px var(--color-messi-glow);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-base: 0.3s var(--ease-out);
}

/* ────────── Reset & Base ────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Outfit', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

/* ────────── Animated BG pattern ────────── */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background:
    radial-gradient(circle at 20% 20%, rgba(192,39,45,0.04) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(59,130,246,0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ═══════════════════ HERO ═══════════════════ */
.hero {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: var(--space-2xl) var(--space-lg) var(--space-xl);
}

.hero__trophy {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: var(--space-md);
  animation: trophyBounce 2s var(--ease-out) infinite;
}

@keyframes trophyBounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-12px) rotate(-3deg); }
  50% { transform: translateY(0) rotate(0deg); }
  75% { transform: translateY(-6px) rotate(2deg); }
}

.hero__title {
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--color-text);
}

.hero__accent {
  background: linear-gradient(135deg, var(--color-accent), #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__subtitle {
  margin-top: var(--space-md);
  font-size: clamp(0.95rem, 2vw, 1.2rem);
  color: var(--color-text-muted);
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

/* ═══════════════════ BATTLE ═══════════════════ */
.battle {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--space-lg) var(--space-2xl);
}

/* VS badge */
.battle__vs {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  width: 64px; height: 64px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--color-accent);
  background: var(--color-surface);
  border: 3px solid var(--color-accent-light);
  border-radius: var(--radius-full);
  box-shadow: 0 4px 20px rgba(212, 160, 23, 0.2);
  animation: vsPulse 3s ease-in-out infinite;
}

@keyframes vsPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(212,160,23,0.2); transform: translate(-50%,-50%) scale(1); }
  50% { box-shadow: 0 4px 40px rgba(212,160,23,0.35); transform: translate(-50%,-50%) scale(1.08); }
}

/* ═══════════════════ CARD ═══════════════════ */
.card {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-lg) var(--space-lg);
  text-align: center;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-border);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-4px);
}

/* Colored glow behind card */
.card__glow {
  position: absolute;
  top: -30%; left: -30%;
  width: 160%; height: 160%;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
  z-index: 0;
}

.card:hover .card__glow { opacity: 1; }

.card--ronaldo .card__glow {
  background: radial-gradient(circle, rgba(192,39,45,0.07) 0%, transparent 70%);
}
.card--messi .card__glow {
  background: radial-gradient(circle, rgba(59,130,246,0.07) 0%, transparent 70%);
}

/* Player image */
.card__img-wrapper {
  position: relative;
  z-index: 1;
  width: 140px; height: 140px;
  margin: 0 auto var(--space-lg);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 4px solid var(--color-border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.card--ronaldo:hover .card__img-wrapper {
  border-color: var(--color-ronaldo);
  box-shadow: var(--shadow-glow-ronaldo);
}
.card--messi:hover .card__img-wrapper {
  border-color: var(--color-messi);
  box-shadow: var(--shadow-glow-messi);
}

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

/* Name */
.card__name {
  position: relative;
  z-index: 1;
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.card--ronaldo .card__name span { color: var(--color-ronaldo); }
.card--messi   .card__name span { color: var(--color-messi); }

/* ═══════════════════ PROGRESS BAR ═══════════════════ */
.bar-track {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 48px;
  background: var(--color-bg);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-sm);
  border: 1px solid var(--color-border);
}

.bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: var(--space-md);
  min-width: 48px;
  width: 2%;
  transition: width 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

/* Shimmer animation */
.bar-fill::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.3) 50%,
    transparent 100%
  );
  animation: shimmer 2.5s ease-in-out infinite;
}

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

.bar-fill--ronaldo {
  background: linear-gradient(90deg, #c0272d, #e74c3c, #c0272d);
  background-size: 200% 100%;
  animation: barGradientSlide 3s ease infinite, barPulseRonaldo 2s ease-in-out infinite;
}

.bar-fill--messi {
  background: linear-gradient(90deg, #3b82f6, #60a5fa, #3b82f6);
  background-size: 200% 100%;
  animation: barGradientSlide 3s ease infinite, barPulseMessi 2s ease-in-out infinite;
}

@keyframes barGradientSlide {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes barPulseRonaldo {
  0%, 100% { box-shadow: 0 0 8px rgba(192,39,45,0.2); }
  50% { box-shadow: 0 0 20px rgba(192,39,45,0.4); }
}

@keyframes barPulseMessi {
  0%, 100% { box-shadow: 0 0 8px rgba(59,130,246,0.2); }
  50% { box-shadow: 0 0 20px rgba(59,130,246,0.4); }
}

.bar-fill__label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
  z-index: 1;
}

/* Amount text */
.card__amount {
  position: relative;
  z-index: 1;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
}

/* ═══════════════════ TIP INPUT + PAYPAL ═══════════════════ */
.card__actions {
  position: relative;
  z-index: 1;
}

.tip-input-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-xs);
}

.tip-input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  outline: none;
  transition: border-color var(--transition-base), box-shadow var(--transition-base), color 0.2s ease;
  margin-bottom: var(--space-md);
}

.tip-input-faded {
    opacity: 0.1 !important;
}

.tip-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-light);
}

.card--ronaldo .tip-input:focus {
  border-color: var(--color-ronaldo);
  box-shadow: 0 0 0 3px var(--color-ronaldo-light);
}

.card--messi .tip-input:focus {
  border-color: var(--color-messi);
  box-shadow: 0 0 0 3px var(--color-messi-light);
}

/* PayPal button container */
.paypal-container {
  margin-top: var(--space-sm);
  min-height: 55px;
}

/* ═══════════════════ FOOTER ═══════════════════ */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* ═══════════════════ TOAST ═══════════════════ */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: var(--color-text);
  color: #fff;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  z-index: 1000;
  opacity: 0;
  transition: transform 0.5s var(--ease-out), opacity 0.5s var(--ease-out);
  pointer-events: none;
}

.toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast--success { background: #059669; }
.toast--error   { background: #dc2626; }

/* ═══════════════════ CELEBRATION BURST ═══════════════════ */
@keyframes celebrateBurst {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

.card--celebrate {
  animation: celebrateBurst 0.6s var(--ease-out);
}

/* ═══════════════════ RESPONSIVE ═══════════════════ */
@media (max-width: 700px) {
  .battle {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .battle__vs {
    position: relative;
    top: auto; left: auto;
    transform: none;
    margin: calc(-1 * var(--space-xl)) auto;
  }

  .card { padding: var(--space-lg); }

  .hero { padding: var(--space-xl) var(--space-md) var(--space-lg); }
}

@media (max-width: 400px) {
  .card__img-wrapper { width: 110px; height: 110px; }
  .bar-track { height: 40px; }
}

/* ═══════════════════ LEADING BADGE ═══════════════════ */
.card__leading-badge {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  z-index: 2;
  background: linear-gradient(135deg, var(--color-accent), #f59e0b);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity var(--transition-base), transform var(--transition-base);
}

.card__leading-badge--visible {
  opacity: 1;
  transform: scale(1);
}
/* ═══════════════════ LEGEND GALLERY ═══════════════════ */
.legend-gallery {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 4px solid #000;
  border-radius: var(--radius-lg);
  background: #000;
}

/* ═══════════════════ MEDIA PLAYER CARD ═══════════════════ */
.media-placeholder {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 2px solid #000;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
}

.media-placeholder:hover .play-icon {
  transform: scale(1.1);
  color: #FDE047;
}

.play-icon {
  transition: transform 0.3s ease, color 0.3s ease;
  filter: drop-shadow(0 0 10px rgba(253, 224, 71, 0.4));
  animation: play-pulse 2s infinite ease-in-out;
}

@keyframes play-pulse {
  0%   { filter: drop-shadow(0 0 5px rgba(253, 224, 71, 0.2)); }
  50%  { filter: drop-shadow(0 0 20px rgba(253, 224, 71, 0.6)); }
  100% { filter: drop-shadow(0 0 5px rgba(253, 224, 71, 0.2)); }
}

.seek-bar {
  width: 100%;
  height: 4px;
  background: #333;
  margin-top: 12px;
  position: relative;
  border-radius: var(--radius-full);
}

.seek-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 30%;
  background: #FDE047;
  border-radius: var(--radius-full);
}

/* ═══════════════════ SKELETON LOADING ═══════════════════ */
.skeleton {
  background: #f1f5f9;
  background: linear-gradient(110deg, #f1f5f9 8%, #e2e8f0 18%, #f1f5f9 33%);
  border-radius: var(--radius-lg);
  background-size: 200% 100%;
  animation: 1.5s shine linear infinite;
}

@keyframes shine {
  to {
    background-position-x: -200%;
  }
}

.skeleton-text {
  height: 12px;
  width: 100%;
  margin-bottom: 8px;
}

.skeleton-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skeleton-info {
  flex: 1;
}

.skeleton-label {
  height: 10px;
  width: 40%;
  background: #e2e8f0;
  border-radius: 4px;
}
/* ═══════════════════ RIVALRY FLICKER ANIMATION ═══════════════════ */
.flicker-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.flicker-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.05s steps(1); /* Sharp switch */
}

/* Image 1 (Ronaldo) is visible on 0-50% */
.flicker-img-1 {
  animation: flicker-a 0.3s infinite steps(1);
}

/* Image 2 (Messi) is visible on 50-100% */
.flicker-img-2 {
  animation: flicker-b 0.3s infinite steps(1);
}

@keyframes flicker-a {
  0%, 49.9% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes flicker-b {
  0%, 49.9% { opacity: 0; }
  50%, 100% { opacity: 1; }
}
/* ═══════════════════ CUSTOM SCROLLBAR ═══════════════════ */
.custom-scrollbar::-webkit-scrollbar {
  width: 8px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: #f1f1f1;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #000;
  border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #333;
}
