/* ========================================
   Prize page — tab "Premio" del torneo. Total destacado + podio (oro/plata/
   bronce) con el desglose por puesto. Markup en
   app/views/tournaments/prize.html.erb.
   ======================================== */
.prize-page {
  /* Colores de medalla, locales a esta página (no hay tokens globales). */
  --silver:      #d8dee9;
  --silver-dim:  rgba(216, 222, 233, 0.14);
  --bronze:      #e0935a;
  --bronze-dim:  rgba(224, 147, 90, 0.16);

  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* ── Total destacado ── */
.prize-total {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 26px 20px;
  border: 1px solid var(--gold);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(130% 120% at 50% -10%, var(--gold-dim), transparent 65%),
    var(--bg-2);
  text-align: center;
  box-shadow: 0 0 40px var(--gold-dim);
}
/* Brillo diagonal que cruza la tarjeta una vez. */
.prize-total__shine {
  position: absolute;
  top: 0;
  left: -60%;
  width: 45%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.10), transparent);
  transform: skewX(-18deg);
  animation: prize-shine 4.5s ease-in-out 0.6s infinite;
}
.prize-total__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
}
.prize-total__label svg { flex: none; }
.prize-total__amount {
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink-bright);
  text-shadow: 0 2px 18px var(--gold-glow);
}

@keyframes prize-shine {
  0%   { left: -60%; }
  55%  { left: 130%; }
  100% { left: 130%; }
}
@media (prefers-reduced-motion: reduce) {
  .prize-total__shine { animation: none; display: none; }
}

/* ── Podio ── el 1° al centro y más alto; 2° izquierda, 3° derecha. */
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.podium__place {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex: 1 1 0;
  max-width: 150px;
  min-width: 0;
}
/* Orden visual: 2° · 1° · 3° */
.podium__place.-p1 { order: 2; }
.podium__place.-p2 { order: 1; }
.podium__place.-p3 { order: 3; }

/* Tarjeta flotante con medalla + monto, encima del escalón. */
.podium__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 12px 8px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
}
.podium__medal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
.podium__amount {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  color: var(--ink-bright);
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}

/* Escalón con el número de puesto. Alturas escalonadas por posición. */
.podium__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  border-radius: var(--radius) var(--radius) 0 0;
  border: 1px solid transparent;
  border-bottom: none;
}
.podium__rank {
  font-family: var(--font-scoreboard, inherit);
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  color: var(--bg);
}
.podium__ord {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bg);
  opacity: 0.75;
}

/* Alturas del podio. */
.podium__place.-p1 .podium__step { height: 116px; }
.podium__place.-p2 .podium__step { height: 90px; }
.podium__place.-p3 .podium__step { height: 70px; }

/* Medallas: oro / plata / bronce. */
.podium__place.-p1 .podium__card  { border-color: var(--gold); background: linear-gradient(160deg, var(--gold-dim), var(--card)); }
.podium__place.-p1 .podium__medal { background: var(--gold-dim); color: var(--gold); }
.podium__place.-p1 .podium__step  { background: linear-gradient(180deg, var(--amarilla), #e0a91e); }

.podium__place.-p2 .podium__card  { border-color: var(--silver); }
.podium__place.-p2 .podium__medal { background: var(--silver-dim); color: var(--silver); }
.podium__place.-p2 .podium__step  { background: linear-gradient(180deg, var(--silver), #aab3c2); }

.podium__place.-p3 .podium__card  { border-color: var(--bronze); }
.podium__place.-p3 .podium__medal { background: var(--bronze-dim); color: var(--bronze); }
.podium__place.-p3 .podium__step  { background: linear-gradient(180deg, var(--bronze), #b56f3b); }

/* ── Resto de puestos (4° en adelante) ── */
.prize-rest {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.prize-rest__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}
.prize-rest__pos {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
}
.prize-rest__amount {
  font-weight: 700;
  font-size: 14px;
  color: var(--fg-2);
  font-variant-numeric: tabular-nums;
}

/* ── Sin desglose: el ganador se lleva todo ── */
.prize-solo {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 20px;
  border: 1px solid var(--gold);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 130% at 50% 0%, var(--gold-dim), transparent 70%),
    var(--bg-2);
  text-align: center;
}
.prize-solo__glow {
  position: absolute;
  top: -40px;
  left: 50%;
  width: 200px;
  height: 200px;
  transform: translateX(-50%);
  background: radial-gradient(circle, var(--gold-glow), transparent 60%);
  pointer-events: none;
}
.prize-solo__trophy {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 1px solid var(--gold);
  color: var(--gold);
}
.prize-solo__caption {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.prize-solo__amount {
  font-size: 44px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink-bright);
  text-shadow: 0 2px 18px var(--gold-glow);
}

/* ── Nota de empate ── */
.prize-page__note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}
.prize-page__note svg { flex: none; margin-top: 2px; }

@media (min-width: 720px) {
  .prize-total__amount { font-size: 50px; }
  .podium__place { max-width: 170px; }
  .podium__place.-p1 .podium__step { height: 140px; }
  .podium__place.-p2 .podium__step { height: 108px; }
  .podium__place.-p3 .podium__step { height: 84px; }
  .podium__rank { font-size: 40px; }
}

/* ── Prize tag — chip dorado reutilizable (cards del home, boletería).
   Dorado sólido + texto oscuro: alto contraste tanto sobre las cards
   oscuras del home como sobre el ticket de papel claro de la boletería.
   Markup en app/views/shared/_prize_tag.html.erb. ── */
.prize-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--amarilla), #ffb800);
  color: var(--amarilla-ink);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 1px 6px var(--gold-glow);
}
.prize-tag svg { flex: none; }
.prize-tag b { font-weight: 800; }
.prize-tag i { font-style: normal; font-weight: 600; opacity: 0.7; }

/* ── Prize banner — barra clickeable en el "Resumen" del torneo, linkea al
   tab Premio. Markup en app/views/tournaments/show.html.erb. ── */
.prize-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  padding: 14px 16px;
  /* Borde dorado tenue (antes era oro sólido = muy cargado junto al CTA teal). */
  border: 1px solid color-mix(in srgb, var(--gold) 38%, transparent);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 180% at 0% 0%, var(--gold-dim), transparent 60%),
    var(--bg-2);
  text-decoration: none;
  transition: border-color 150ms, background 150ms;
}
.prize-banner:hover { background: var(--gold-dim); }

.prize-banner__ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--gold-dim);
  color: var(--gold);
}

.prize-banner__body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1 1 auto;
}
.prize-banner__amount {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--gold);
}
.prize-banner__label {
  font-size: 12.5px;
  color: var(--muted);
}

.prize-banner__go {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: none;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
}
.prize-banner__go svg { flex: none; }
