/* ======================================================
   FALABELLA MÉXICO · APP SORTEOS
   Paleta de marca: Estilo Legendario (Oscuro y Dorado)
   ====================================================== */
:root {
  --fb-green: #3dae2b;          /* Verde Falabella (Pantone 361 C) */
  --fb-green-dark: #2c8c20;     /* Verde oscuro para hovers */
  --fb-green-light: #6bc959;    /* Verde claro para acentos */
  --fb-green-glow: #4deb36;     /* Verde brillante para animaciones */
  --fb-white: #FFFFFF;
  --fb-ink: #FFFFFF;            /* Texto en fondos oscuros (White) */
  --fb-ink-soft: rgba(255, 255, 255, 0.65);
  --fb-line: rgba(255, 255, 255, 0.12);
  --fb-surface: rgba(18, 14, 10, 0.65);
  --fb-surface-soft: rgba(28, 22, 16, 0.55);
  --fb-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
  --fb-shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.4);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  /* Ancho principal de la app (~35% más que el diseño original) */
  --app-max-width: 900px;
  /* Altura de cada nombre en la animación tipo ruleta */
  --slot-row-h: 132px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: var(--font-family);
  color: var(--fb-ink);
  background-color: #001a00;
  overflow-x: hidden;
}

body {
  background: 
    radial-gradient(ellipse at 50% -10%, rgba(30, 20, 8, 0.15) 0%, rgba(13, 10, 6, 0.4) 45%, rgba(5, 3, 2, 0.8) 100%),
    url('Rectangle-39.png');
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

.bg-overlay { display: none; }

/* =========================
   LAYOUT — Una sola columna
   ========================= */
.container {
  position: relative;
  z-index: 2;
  max-width: var(--app-max-width, 672px);
  margin: 0 auto;
  padding: 28px 18px 36px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 22px;
  min-height: 100vh;
}

.brand {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.logo {
  max-width: 220px;
  width: 60%;
  height: auto;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.45));
  animation: fadeDown 0.7s ease-out;
}

.title {
  font-size: clamp(24px, 4vw, 32px);
  margin: 4px 0 0;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: var(--fb-green);
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.55);
}

.subtitle {
  margin: 0;
  font-size: 14px;
  color: var(--fb-white);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
  max-width: min(624px, 100%);
  line-height: 1.5;
}

/* =========================
   PANEL & CARDS
   ========================= */
.panel {
  width: 100%;
  background: var(--fb-surface);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--fb-shadow);
  border: 1px solid rgba(255, 215, 0, 0.15);
  animation: fadeUp 0.6s ease-out;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

@media (min-width: 768px) {
  .grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.card {
  background: var(--fb-surface-soft);
  border: 1px solid var(--fb-line);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  margin: 0;
  color: var(--fb-ink);
}

.step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--fb-green);
  color: var(--fb-white);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(212, 175, 55, 0.4);
}

.hint {
  margin: 0;
  font-size: 13px;
  color: var(--fb-ink-soft);
  line-height: 1.45;
}

/* =========================
   INPUTS
   ========================= */
textarea {
  width: 100%;
  resize: vertical;
  min-height: 150px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--fb-line);
  background: rgba(0, 0, 0, 0.35);
  color: var(--fb-white);
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 14px;
  line-height: 1.55;
  transition: border-color 0.2s, box-shadow 0.2s;
}

textarea::placeholder { color: rgba(255, 255, 255, 0.4); }

textarea:focus {
  outline: none;
  border-color: #ffd700;
  box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.15);
}

input[type="number"] {
  width: 100%;
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.35);
  color: var(--fb-white);
  border: 1.5px solid var(--fb-line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  -moz-appearance: textfield;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"]:focus {
  outline: none;
  border-color: #ffd700;
  box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.15);
}

.winners-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.round-btn {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 50%;
  border: 1.5px solid var(--fb-line);
  background: rgba(0, 0, 0, 0.35);
  color: var(--fb-white);
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}
.round-btn:hover {
  background: var(--fb-green);
  border-color: var(--fb-green);
  color: var(--fb-white);
  transform: scale(1.05);
}
.round-btn:active { transform: scale(0.95); }

.options { display: flex; flex-direction: column; gap: 8px; }

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--fb-ink-soft);
  user-select: none;
}

.checkbox input {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid var(--fb-line);
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
}
.checkbox input:checked {
  background: var(--fb-green);
  border-color: var(--fb-green);
}
.checkbox input:checked::after {
  content: "";
  position: absolute;
  inset: 3px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") no-repeat center / 100%;
}

/* =========================
   BUTTONS
   ========================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--fb-green) 0%, var(--fb-green-dark) 100%);
  color: var(--fb-white);
  box-shadow: 0 8px 22px rgba(212, 175, 55, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(212, 175, 55, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--fb-white);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-ghost {
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
}
.btn-ghost:hover { color: var(--fb-white); background: rgba(255, 255, 255, 0.05); }

.btn-large { padding: 14px 22px; font-size: 16px; width: 100%; margin-top: 6px; }

/* =========================
   FILE UPLOAD ROW
   ========================= */
.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.file-name {
  font-size: 13px;
  color: var(--fb-ink-soft);
  font-style: italic;
}

.excel-sheet-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.excel-sheet-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--fb-ink);
}

.excel-sheet-select {
  min-width: 200px;
  max-width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 10px;
  border: 1px solid var(--fb-line);
  background: rgba(0, 0, 0, 0.35);
  color: var(--fb-white);
}

.counter {
  margin-top: auto;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.2);
  border-left: 3px solid var(--fb-green);
  border-radius: 6px;
  font-size: 14px;
  color: var(--fb-ink);
}
.counter span { font-weight: 800; color: var(--fb-green-dark); font-size: 18px; }

/* =========================
   REVEAL PANEL
   ========================= */
.reveal-panel {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.reveal-header h2 {
  margin: 0 0 4px;
  font-size: clamp(22px, 3.5vw, 28px);
  font-weight: 800;
  color: var(--fb-green-dark);
}
.reveal-subtitle { margin: 0; color: var(--fb-ink-soft); font-size: 14px; }

/* =========================
   STAGE GENÉRICO DE ANIMACIÓN
   ========================= */
.anim-stage {
  position: relative;
  width: 100%;
  min-height: 180px;
  margin: 4px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.anim-stage:has(.grid-anim-wrap) {
  align-items: flex-start;
  min-height: 120px;
}

/* =========================
   COUNTDOWN 3-2-1
   ========================= */
.countdown {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 200px;
}

.countdown-number {
  position: absolute;
  font-size: clamp(96px, 24vw, 160px);
  font-weight: 900;
  color: var(--fb-green);
  text-shadow:
    0 0 24px rgba(255, 215, 0, 0.8),
    0 0 60px rgba(212, 175, 55, 0.6),
    0 6px 0 rgba(0, 0, 0, 0.15);
  font-family: 'Segoe UI', sans-serif;
  letter-spacing: -4px;
  animation: countdownIn 0.9s cubic-bezier(0.22, 1.4, 0.36, 1) forwards;
}

.countdown-number.go {
  font-size: clamp(64px, 18vw, 120px);
  color: var(--fb-green);
  letter-spacing: 2px;
}

@keyframes countdownIn {
  0%   { opacity: 0; transform: scale(2.2); filter: blur(8px); }
  30%  { opacity: 1; transform: scale(1); filter: blur(0); }
  70%  { opacity: 1; transform: scale(1.05); }
  100% { opacity: 0; transform: scale(0.7); filter: blur(4px); }
}

/* =========================
   GANADOR FINAL (queda visible)
   ========================= */
.final-name-display {
  width: 100%;
  text-align: center;
  padding: 24px 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--fb-green) 0%, var(--fb-green-dark) 100%);
  color: var(--fb-white);
  border: 3px solid var(--fb-green-glow);
  box-shadow:
    0 0 50px rgba(255, 215, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  animation: finalReveal 0.6s cubic-bezier(0.22, 1.4, 0.36, 1) forwards;
  position: relative;
  overflow: hidden;
}

.final-name-display::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(60deg, transparent 40%, rgba(255, 255, 255, 0.25) 50%, transparent 60%);
  transform: translateX(-100%);
  animation: shineSweep 2.4s ease-in-out infinite;
  animation-delay: 0.6s;
  pointer-events: none;
}

.final-name-display .final-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 4px;
}

.final-name-display .final-name {
  display: block;
  font-size: clamp(26px, 5.5vw, 38px);
  font-weight: 900;
  letter-spacing: 0.5px;
  word-break: break-word;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.final-cuadrilla-tag {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.95;
  margin-bottom: 10px;
  text-align: center;
}

.final-name-display--batch {
  text-align: left;
  padding: 18px 16px;
}

.final-name-display--batch .final-label {
  text-align: center;
  margin-bottom: 12px;
}

.final-batch-names {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  padding-right: 4px;
}

.final-batch-row {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  align-items: center;
  font-weight: 800;
  font-size: 14px;
  line-height: 1.3;
}

.final-batch-n {
  text-align: right;
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
}

.final-batch-name {
  word-break: break-word;
}

@keyframes finalReveal {
  0%   { opacity: 0; transform: scale(0.6); }
  60%  { transform: scale(1.06); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes shineSweep {
  0%   { transform: translateX(-100%); }
  60%, 100% { transform: translateX(100%); }
}

/* =========================
   ANIMACIÓN 1: SLOT (Ruleta) — premium
   ========================= */
.slot {
  position: relative;
  width: 100%;
}

.slot-window {
  position: relative;
  height: var(--slot-row-h, 120px);
  border-radius: 18px;
  background:
    linear-gradient(180deg, #f6faf5 0%, #ffffff 50%, #f6faf5 100%);
  border: 3px solid var(--fb-green);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.2),
    inset 0 2px 4px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  /* IMPORTANTE: el carrete debe anclarse arriba. Si se usa center, los
     translateY no coinciden con “un nombre = una fila” y al final se ve vacío. */
  display: flex;
  align-items: flex-start;
  justify-content: center;
  transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
}

/* Línea central de selección bien marcada */
.slot-window::after {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  top: 50%;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--fb-green) 20%, var(--fb-green) 80%, transparent 100%);
  transform: translateY(-1px);
  z-index: 4;
  opacity: 0.35;
  pointer-events: none;
}

/* Fade suave en top y bottom para que los nombres se vean girar
   sin quedar tapados por gradientes muy opacos. */
.slot-window::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg,
      rgba(255, 255, 255, 0.32) 0%,
      rgba(255, 255, 255, 0) 14%,
      rgba(255, 255, 255, 0) 86%,
      rgba(255, 255, 255, 0.32) 100%);
  z-index: 3;
  pointer-events: none;
}

.slot-reel {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  flex-shrink: 0;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0.3px;
  color: var(--fb-ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.slot-reel .item {
  height: var(--slot-row-h, 120px);
  flex: 0 0 var(--slot-row-h, 120px);
  line-height: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  text-align: center;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-reel .item.final {
  color: var(--fb-green-dark);
  font-weight: 900;
}

/* Pointers laterales (tipo "fiel" indicando posición) */
.slot-pointer {
  position: absolute;
  top: 50%;
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  transform: translateY(-50%);
  z-index: 5;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
}
.slot-pointer.left {
  left: -2px;
  border-left: 14px solid var(--fb-green);
}
.slot-pointer.right {
  right: -2px;
  border-right: 14px solid var(--fb-green);
}

/* Pulso final cuando aterriza el ganador */
.slot.landed .slot-window {
  border-color: var(--fb-green-glow);
  box-shadow:
    0 0 0 4px rgba(255, 215, 0, 0.25),
    0 12px 36px rgba(212, 175, 55, 0.45),
    inset 0 2px 4px rgba(0, 0, 0, 0.06);
  animation: slotLandPulse 0.55s cubic-bezier(0.22, 1.4, 0.36, 1);
}

@keyframes slotLandPulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.025); }
  100% { transform: scale(1); }
}

/* =========================
   ANIMACIÓN 2: SOBRE CINEMATOGRÁFICO
   Estilo premios Oscar — el sobre se sacude y se rasga.
   ========================= */
.envelope-stage {
  position: relative;
  width: 100%;
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 900px;
}

.envelope {
  position: relative;
  width: min(280px, 80vw);
  aspect-ratio: 5 / 3;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.45));
  transform-style: preserve-3d;
  animation: envelopeEnter 0.7s cubic-bezier(0.22, 1.4, 0.36, 1) forwards;
}

.envelope-body {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #ffffff 0%, #f0f4ef 100%);
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

/* Banda decorativa diagonal (estilo air mail) */
.envelope-body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background:
    repeating-linear-gradient(45deg,
      var(--fb-green) 0px, var(--fb-green) 10px,
      var(--fb-white) 10px, var(--fb-white) 20px);
}
.envelope-body::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 8px;
  background:
    repeating-linear-gradient(45deg,
      var(--fb-green) 0px, var(--fb-green) 10px,
      var(--fb-white) 10px, var(--fb-white) 20px);
}

.envelope-stamp {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 56px;
  height: 56px;
  background:
    linear-gradient(135deg, var(--fb-green) 0%, var(--fb-green-dark) 100%);
  color: var(--fb-white);
  border: 2px dashed rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 9px;
  text-align: center;
  letter-spacing: 1.5px;
  padding: 4px;
  line-height: 1.2;
  transform: rotate(-8deg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 60%;
  background: linear-gradient(180deg, #ffffff 0%, #e5ebe2 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  transform: rotateX(0deg);
  transition: transform 0.6s cubic-bezier(0.5, 0, 0.5, 1);
  border-bottom: 1.5px solid rgba(0, 0, 0, 0.08);
  z-index: 2;
}

.envelope-seal {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle, #c84545 0%, #8b1f1f 80%);
  border: 2px solid #f0c0c0;
  transform: translate(-50%, -50%);
  box-shadow: 0 3px 10px rgba(139, 31, 31, 0.6), inset 0 -3px 6px rgba(0, 0, 0, 0.35);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 900;
  font-size: 11px;
  letter-spacing: 1px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.envelope-card {
  position: absolute;
  left: 50%;
  bottom: 8%;
  width: 88%;
  transform: translate(-50%, 0) translateZ(0);
  background: linear-gradient(135deg, #1c140c, #30261b);
  border-radius: 6px;
  border: 1px solid rgba(255, 215, 0, 0.4);
  padding: 16px 14px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 1;
  opacity: 0;
}

.envelope-card .card-label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  color: var(--fb-green-dark);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.envelope-card .card-name {
  display: block;
  font-size: clamp(16px, 4vw, 22px);
  font-weight: 900;
  color: var(--fb-ink);
  word-break: break-word;
}

@keyframes envelopeEnter {
  0%   { opacity: 0; transform: translateY(40px) scale(0.85) rotateX(20deg); }
  100% { opacity: 1; transform: translateY(0) scale(1) rotateX(0deg); }
}

/* Sacudida */
.envelope.shaking {
  animation: envelopeShake 0.07s linear infinite alternate;
}
@keyframes envelopeShake {
  from { transform: translate(-2px, -1px) rotate(-1.2deg); }
  to   { transform: translate(2px, 1px) rotate(1.2deg); }
}

/* Apertura */
.envelope.opening .envelope-flap {
  transform: rotateX(-180deg);
}
.envelope.opening .envelope-seal {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.3) rotate(-30deg);
}
.envelope.opening .envelope-card {
  animation: cardOut 0.9s cubic-bezier(0.22, 1.4, 0.36, 1) 0.35s forwards;
}

@keyframes cardOut {
  0%   { opacity: 0; transform: translate(-50%, 0) scale(0.9); }
  60%  { transform: translate(-50%, -55%) scale(1.04); }
  100% { opacity: 1; transform: translate(-50%, -60%) scale(1); }
}

/* =========================
   ANIMACIÓN 3: GRID (Cuadrícula) — premium con flip
   ========================= */
.grid-anim-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.grid-cuadrilla-heading {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 800;
  color: var(--fb-green-dark);
  text-align: center;
  line-height: 1.35;
}

.grid-pool-stats {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--fb-ink-soft);
  text-align: center;
  line-height: 1.45;
  padding: 2px 6px 0;
}

.grid-pool-stats strong {
  color: var(--fb-green-dark);
  font-weight: 800;
}

.grid-anim {
  width: 100%;
  display: grid;
  /* 5 columnas por fila (variable --cols desde JS, por defecto 5) */
  gap: 10px 14px;
  grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr));
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(20, 15, 10, 0.65); /* Base oscura */
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
  min-height: 0;
  perspective: 600px;
  overflow-x: visible;
  overflow-y: visible;
}

/* Tier specific grid borders and backgrounds */
.grid-anim--bronce {
  border-color: rgba(205, 127, 50, 0.45);
  background: linear-gradient(180deg, rgba(60, 28, 8, 0.8) 0%, rgba(30, 15, 5, 0.95) 100%);
  box-shadow: 0 8px 30px rgba(205, 127, 50, 0.15), inset 0 0 20px rgba(205, 127, 50, 0.1);
}
.grid-anim--plata {
  border-color: rgba(192, 192, 192, 0.4);
  background: linear-gradient(180deg, rgba(35, 35, 35, 0.8) 0%, rgba(15, 15, 15, 0.95) 100%);
  box-shadow: 0 8px 30px rgba(192, 192, 192, 0.15), inset 0 0 20px rgba(192, 192, 192, 0.1);
}
.grid-anim--oro {
  border-color: rgba(255, 215, 0, 0.4);
  background: linear-gradient(180deg, rgba(70, 50, 4, 0.8) 0%, rgba(30, 20, 2, 0.95) 100%);
  box-shadow: 0 8px 30px rgba(255, 215, 0, 0.15), inset 0 0 20px rgba(255, 215, 0, 0.1);
}
.grid-anim--diamante {
  border-color: rgba(226, 232, 240, 0.4);
  background: linear-gradient(180deg, rgba(45, 55, 72, 0.8) 0%, rgba(15, 23, 42, 0.95) 100%);
  box-shadow: 0 8px 30px rgba(226, 232, 240, 0.15), inset 0 0 20px rgba(226, 232, 240, 0.1);
}
.grid-anim--legendario {
  border-color: rgba(74, 222, 128, 0.4);
  background: linear-gradient(180deg, rgba(5, 40, 20, 0.8) 0%, rgba(2, 15, 8, 0.95) 100%);
  box-shadow: 0 8px 30px rgba(74, 222, 128, 0.15), inset 0 0 20px rgba(74, 222, 128, 0.1);
}

.grid-anim--dense {
  gap: 9px 12px;
  padding: 14px 16px;
}

.grid-anim--dense .grid-cell {
  font-size: 16px;
  padding: 10px 14px;
  min-height: 46px;
  border-radius: 11px;
  border-width: 2px;
}

.grid-anim--xdense {
  gap: 8px 11px;
  padding: 13px 15px;
}

.grid-anim--xdense .grid-cell {
  font-size: 15px;
  padding: 9px 13px;
  min-height: 44px;
  border-radius: 10px;
  border-width: 2px;
}

.grid-anim--xdense .grid-cell.winner {
  font-size: 17px;
}

.grid-anim--xxdense {
  gap: 8px 10px;
  padding: 12px 14px;
}

.grid-anim--xxdense .grid-cell {
  font-size: 14px;
  padding: 9px 12px;
  min-height: 42px;
  border-radius: 10px;
  border-width: 2px;
}

.grid-anim--xxdense .grid-cell.winner {
  font-size: 16px;
}

.grid-anim--multi-win .grid-cell.winner {
  transform: scale(1.06);
  font-size: inherit;
  box-shadow:
    0 0 24px rgba(255, 215, 0, 0.75),
    0 0 0 2px rgba(255, 215, 0, 0.35);
  animation: winnerPulseMulti 1.1s ease-out 1;
}

.grid-anim--bronce .grid-cell.winner { box-shadow: 0 0 24px rgba(205, 127, 50, 0.75), 0 0 0 2px rgba(205, 127, 50, 0.35); }
.grid-anim--plata .grid-cell.winner { box-shadow: 0 0 24px rgba(192, 192, 192, 0.75), 0 0 0 2px rgba(192, 192, 192, 0.35); }
.grid-anim--oro .grid-cell.winner { box-shadow: 0 0 24px rgba(255, 215, 0, 0.75), 0 0 0 2px rgba(255, 215, 0, 0.35); }
.grid-anim--diamante .grid-cell.winner { box-shadow: 0 0 24px rgba(226, 232, 240, 0.75), 0 0 0 2px rgba(226, 232, 240, 0.35); }
.grid-anim--legendario .grid-cell.winner { box-shadow: 0 0 24px rgba(184, 134, 11, 0.75), 0 0 0 2px rgba(184, 134, 11, 0.35); }

@keyframes winnerPulseMulti {
  0%   { transform: scale(1.02); }
  50%  { transform: scale(1.1); }
  100% { transform: scale(1.06); }
}

.grid-cell {
  background: rgba(0, 0, 0, 0.4);
  color: var(--fb-white);
  font-size: 17px;
  font-weight: 800;
  padding: 11px 16px;
  min-height: 50px;
  border-radius: 12px;
  border: 2px solid var(--fb-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  hyphens: none;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    transform 0.5s cubic-bezier(0.55, 0, 0.45, 1),
    opacity 0.4s ease,
    box-shadow 0.25s ease;
  transform-style: preserve-3d;
  backface-visibility: hidden;
}

.grid-cell.highlight {
  background: linear-gradient(135deg, var(--fb-green) 0%, var(--fb-green-dark) 100%);
  color: var(--fb-white);
  border-color: var(--fb-green-dark);
  transform: scale(1.1);
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.55);
  z-index: 2;
}

/* Eliminadas: flip + desvanecer */
.grid-cell.eliminated {
  opacity: 0;
  transform: rotateX(90deg) scale(0.7);
  pointer-events: none;
}

.grid-cell.winner {
  background: linear-gradient(135deg, var(--fb-green) 0%, var(--fb-green-glow) 100%);
  color: var(--fb-white);
  border-color: var(--fb-green-glow);
  font-weight: 900;
  font-size: 18px;
  border-width: 2px;
  transform: scale(1.25);
  box-shadow:
    0 0 50px rgba(255, 215, 0, 0.95),
    0 0 0 4px rgba(255, 215, 0, 0.3);
  z-index: 3;
  animation: winnerPulse 1.4s ease-out 1;
}

@keyframes winnerPulse {
  0%   { transform: scale(1.05); box-shadow: 0 0 18px rgba(255, 215, 0, 0.4); }
  50%  { transform: scale(1.32); box-shadow: 0 0 70px rgba(255, 215, 0, 1); }
  100% { transform: scale(1.25); box-shadow: 0 0 50px rgba(255, 215, 0, 0.85); }
}

/* =========================
   ANIMACIÓN 4: TÓMBOLA (Rueda SVG) — texto legible + hub detallado
   ========================= */
.tombola {
  position: relative;
  width: min(360px, 92vw);
  aspect-ratio: 1 / 1;
  margin: 4px auto;
  filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.35));
}

.tombola-wheel-svg {
  width: 100%;
  height: 100%;
  display: block;
  will-change: transform;
  transform-origin: 50% 50%;
}

.tombola-wheel-svg .slice-text {
  fill: var(--fb-white);
  font-family: var(--font-family);
  font-weight: 800;
  font-size: 4.5px;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.6);
  stroke-width: 0.3px;
  letter-spacing: 0.2px;
}

/* Puntero más realista (estilo gota) */
.tombola-pointer {
  position: absolute;
  top: -12px;
  left: 50%;
  width: 36px;
  height: 50px;
  transform: translateX(-50%);
  z-index: 4;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
  transition: transform 0.05s linear;
}
.tombola-pointer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #ffffff 0%, #e8eee5 70%, #b8c4b3 100%);
  clip-path: polygon(50% 100%, 0 30%, 18% 0, 82% 0, 100% 30%);
  border-radius: 6px 6px 0 0;
}
.tombola-pointer::after {
  content: "";
  position: absolute;
  top: 30%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fb-green);
  transform: translateX(-50%);
  box-shadow: 0 0 8px var(--fb-green-glow);
}

/* "Tick" cuando pasa cada slice */
.tombola-pointer.tick {
  transform: translateX(-50%) rotate(-12deg);
}

/* Hub central con detalle: gradiente + estrella */
.tombola-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle at 30% 30%, #b8ffa1 0%, var(--fb-green) 35%, var(--fb-green-dark) 100%);
  border: 4px solid var(--fb-white);
  box-shadow:
    0 0 24px rgba(255, 215, 0, 0.85),
    inset 0 -4px 8px rgba(0, 0, 0, 0.25),
    inset 0 4px 6px rgba(255, 255, 255, 0.4);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fb-white);
  font-size: 22px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* Anillo metálico exterior */
.tombola::before {
  content: "";
  position: absolute;
  inset: -2%;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    #d4d8d4 0%, #ffffff 12%, #b8bdb8 25%, #ffffff 37%,
    #d4d8d4 50%, #ffffff 62%, #b8bdb8 75%, #ffffff 87%, #d4d8d4 100%
  );
  z-index: -1;
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.3),
    inset 0 0 8px rgba(0, 0, 0, 0.25);
}

/* WINNERS GRID */
.winners-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-top: 6px;
}

.winner-card {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid transparent;
  text-align: center;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.7) translateY(20px);
  animation: winnerIn 0.6s cubic-bezier(0.22, 1.4, 0.36, 1) forwards;
}

.winner-card--bronce { border-color: rgba(205, 127, 50, 0.8); box-shadow: 0 10px 24px rgba(205, 127, 50, 0.22); }
.winner-card--plata  { border-color: rgba(192, 192, 192, 0.8); box-shadow: 0 10px 24px rgba(192, 192, 192, 0.22); }
.winner-card--oro    { border-color: rgba(255, 215, 0, 0.8); box-shadow: 0 10px 24px rgba(255, 215, 0, 0.22); }
.winner-card--diamante { border-color: rgba(226, 232, 240, 0.8); box-shadow: 0 10px 24px rgba(226, 232, 240, 0.22); }
.winner-card--legendario { border-color: rgba(184, 134, 11, 0.8); box-shadow: 0 10px 24px rgba(184, 134, 11, 0.22); }

.winner-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.15) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: shimmer 2.2s ease-in-out infinite;
  animation-delay: var(--shimmer-delay, 0s);
  pointer-events: none;
}

.winner-card--bronce::before { background: linear-gradient(45deg, transparent 30%, rgba(205, 127, 50, 0.25) 50%, transparent 70%); }
.winner-card--plata::before  { background: linear-gradient(45deg, transparent 30%, rgba(192, 192, 192, 0.25) 50%, transparent 70%); }
.winner-card--oro::before    { background: linear-gradient(45deg, transparent 30%, rgba(255, 215, 0, 0.25) 50%, transparent 70%); }
.winner-card--diamante::before { background: linear-gradient(45deg, transparent 30%, rgba(226, 232, 240, 0.25) 50%, transparent 70%); }
.winner-card--legendario::before { background: linear-gradient(45deg, transparent 30%, rgba(184, 134, 11, 0.25) 50%, transparent 70%); }

.winner-position {
  display: inline-block;
  background: var(--fb-green);
  color: var(--fb-white);
  font-weight: 800;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 1px;
  margin-bottom: 6px;
  text-transform: uppercase;
  box-shadow: 0 3px 10px rgba(212, 175, 55, 0.4);
}

.winner-card--bronce .winner-position { background: rgba(205, 127, 50, 0.9); box-shadow: 0 3px 10px rgba(205, 127, 50, 0.4); }
.winner-card--plata .winner-position  { background: rgba(192, 192, 192, 0.9); color: #111; box-shadow: 0 3px 10px rgba(192, 192, 192, 0.4); }
.winner-card--oro .winner-position    { background: rgba(255, 215, 0, 0.9); color: #111; box-shadow: 0 3px 10px rgba(255, 215, 0, 0.4); }
.winner-card--diamante .winner-position { background: rgba(226, 232, 240, 0.9); color: #000; box-shadow: 0 3px 10px rgba(226, 232, 240, 0.4); }
.winner-card--legendario .winner-position { background: rgba(184, 134, 11, 0.9); box-shadow: 0 3px 10px rgba(184, 134, 11, 0.4); }

.winner-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--fb-ink);
  word-break: break-word;
}

.reveal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 10px;
  width: 100%;
}

.reveal-actions .btn { flex: 1 1 180px; }

/* =========================
   TOAST
   ========================= */
.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(20, 15, 10, 0.95);
  color: var(--fb-white);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  border-left: 4px solid #ffd700;
  box-shadow: var(--fb-shadow-soft);
  z-index: 1000;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.error { border-left-color: #E5484D; color: #B91C1C; }

/* =========================
   CONFETTI
   ========================= */
#confettiCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

/* =========================
   FOOTER & HELPERS
   ========================= */
.footer {
  margin-top: auto;
  padding-top: 8px;
  font-size: 12px;
  color: var(--fb-white);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
  text-align: center;
  opacity: 0.9;
}

.hidden { display: none !important; }

/* ============================================================
   DRAW LOADER — tres puntos pulsantes
   ============================================================ */
.draw-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 0;
}
.draw-loader span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.7);
  animation: drawLoaderPulse 1.1s ease-in-out infinite;
}
.draw-loader span:nth-child(2) { animation-delay: 0.18s; }
.draw-loader span:nth-child(3) { animation-delay: 0.36s; }

@keyframes drawLoaderPulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.35; }
  40%           { transform: scale(1.2); opacity: 1; }
}

/* =========================
   ANIMATIONS
   ========================= */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes winnerIn {
  0% { opacity: 0; transform: scale(0.7) translateY(20px) rotate(-3deg); }
  60% { transform: scale(1.05) translateY(-4px) rotate(1deg); }
  100% { opacity: 1; transform: scale(1) translateY(0) rotate(0); }
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  60%, 100% { transform: translateX(100%); }
}

/* Mobile fine-tune */
@media (max-width: 480px) {
  .container { padding: 18px 12px 28px; }
  .panel { padding: 18px; }
  .card { padding: 14px; }
}

/* ============================================================
   HOME SCREEN
   ============================================================ */
.home-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  z-index: 100;
}

.home-bg-overlay {
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(ellipse at 50% -10%, rgba(30, 20, 8, 0.15) 0%, rgba(13, 10, 6, 0.4) 45%, rgba(5, 3, 2, 0.8) 100%),
    url('Rectangle-39.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  z-index: -1;
}

.home-content {
  max-width: 900px;
  width: 100%;
  padding: 48px 20px 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.home-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.home-logo {
  width: 180px;
  height: auto;
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.7));
  animation: fadeDown 0.7s ease-out;
}

.home-title {
  font-size: clamp(26px, 5vw, 38px);
  font-weight: 900;
  color: var(--fb-green);
  margin: 4px 0 0;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7);
  letter-spacing: 0.02em;
}

.home-subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
  margin: 0;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.home-hint {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.28);
  margin: -16px 0 0;
  letter-spacing: 0.08em;
}

/* Tier rows */
.tiers-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
}

.tiers-row--chests {
  max-width: 560px;
}

/* Tier cards */
.tier-card {
  position: relative;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 30px 20px 26px;
  border-radius: 20px;
  flex: 1;
  min-width: 152px;
  max-width: 220px;
  transition: transform 0.24s cubic-bezier(0.22, 1.4, 0.36, 1), box-shadow 0.24s ease, border-color 0.18s ease;
  overflow: hidden;
  text-align: center;
}

.tier-card:hover {
  transform: translateY(-8px) scale(1.04);
}

.tier-card:active {
  transform: translateY(-2px) scale(1.01);
}

.tier-card-glow {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  pointer-events: none;
}

/* Bronce */
.tier-bronce {
  background: linear-gradient(145deg, rgba(130, 65, 20, 0.55) 0%, rgba(60, 28, 8, 0.75) 100%);
  border: 1.5px solid rgba(205, 127, 50, 0.45);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}
.tier-bronce:hover { border-color: rgba(205, 127, 50, 0.75); box-shadow: 0 14px 36px rgba(205, 127, 50, 0.28); }
.tier-bronce .tier-card-glow { background: radial-gradient(ellipse at 50% 0%, rgba(205, 127, 50, 0.18) 0%, transparent 65%); }

/* Plata */
.tier-plata {
  background: linear-gradient(145deg, rgba(80, 80, 80, 0.55) 0%, rgba(35, 35, 35, 0.75) 100%);
  border: 1.5px solid rgba(192, 192, 192, 0.4);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}
.tier-plata:hover { border-color: rgba(220, 220, 220, 0.7); box-shadow: 0 14px 36px rgba(192, 192, 192, 0.2); }
.tier-plata .tier-card-glow { background: radial-gradient(ellipse at 50% 0%, rgba(192, 192, 192, 0.12) 0%, transparent 65%); }

/* Oro */
.tier-oro {
  background: linear-gradient(145deg, rgba(140, 100, 8, 0.55) 0%, rgba(70, 50, 4, 0.75) 100%);
  border: 1.5px solid rgba(255, 215, 0, 0.4);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}
.tier-oro:hover { border-color: rgba(255, 215, 0, 0.75); box-shadow: 0 14px 36px rgba(255, 215, 0, 0.25); }
.tier-oro .tier-card-glow { background: radial-gradient(ellipse at 50% 0%, rgba(255, 215, 0, 0.18) 0%, transparent 65%); }

/* Diamante */
.tier-diamante {
  background: linear-gradient(145deg, rgba(71, 85, 105, 0.55) 0%, rgba(30, 41, 59, 0.75) 100%);
  border: 1.5px solid rgba(226, 232, 240, 0.4);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}
.tier-diamante:hover { border-color: rgba(226, 232, 240, 0.75); box-shadow: 0 14px 36px rgba(226, 232, 240, 0.28); }
.tier-diamante .tier-card-glow { background: radial-gradient(ellipse at 50% 0%, rgba(226, 232, 240, 0.15) 0%, transparent 65%); }

/* Legendario */
.tier-legendario {
  background: linear-gradient(145deg, rgba(22, 101, 52, 0.55) 0%, rgba(5, 40, 20, 0.75) 100%);
  border: 1.5px solid rgba(74, 222, 128, 0.4);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}
.tier-legendario:hover { border-color: rgba(74, 222, 128, 0.75); box-shadow: 0 14px 36px rgba(74, 222, 128, 0.28); }
.tier-legendario .tier-card-glow { background: radial-gradient(ellipse at 50% 0%, rgba(74, 222, 128, 0.15) 0%, transparent 65%); }

/* Tier info labels */
.tier-preview { display: flex; align-items: center; justify-content: center; }
.tier-info { display: flex; flex-direction: column; align-items: center; gap: 7px; }

.tier-name {
  margin: 0;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.tier-winners-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 13px;
  border-radius: 999px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.tier-bronce .tier-winners-badge    { background: rgba(205,127,50,0.2);  color: #f5b060; border: 1px solid rgba(205,127,50,0.4); }
.tier-plata .tier-winners-badge     { background: rgba(200,200,200,0.15); color: #ddd;    border: 1px solid rgba(200,200,200,0.35); }
.tier-oro .tier-winners-badge       { background: rgba(255,215,0,0.18);   color: #ffd700; border: 1px solid rgba(255,215,0,0.38); }
.tier-diamante .tier-winners-badge  { background: rgba(226,232,240,0.15);  color: #e2e8f0; border: 1px solid rgba(226,232,240,0.35); }
.tier-legendario .tier-winners-badge{ background: rgba(74,222,128,0.15);  color: #4ade80; border: 1px solid rgba(74,222,128,0.35); }

.tier-participant-count {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.06em;
  min-height: 14px;
}

/* Overlay "Iniciar sorteo" al hacer hover */
.tier-start-overlay {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
  z-index: 2;
}
.tier-card:hover .tier-start-overlay { opacity: 1; }

/* ============================================================
   MINI INGOTS — in home tier cards
   ============================================================ */
.mini-ingot {
  position: relative;
  width: 96px;
  height: 46px;
  clip-path: polygon(8% 0%, 92% 0%, 100% 100%, 0% 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.55));
}

.mini-ingot span {
  font-family: 'Georgia', serif;
  font-weight: bold;
  font-size: 11px;
  letter-spacing: 0.12em;
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}

.mini-ingot-shine {
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 35%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.38) 0%, transparent 100%);
  border-radius: 0 0 60% 60%;
  pointer-events: none;
}

.ingot-bronce-mini {
  background: linear-gradient(135deg, #cd7f32 0%, #b87333 18%, #8b4513 48%, #6b3410 78%, #4a2508 100%);
  box-shadow: inset 0 -5px 10px rgba(30,15,5,0.65), inset 0 5px 10px rgba(205,127,50,0.3);
}
.ingot-bronce-mini span { color: #f5c080; }

.ingot-plata-mini {
  background: linear-gradient(135deg, #e8e8e8 0%, #c0c0c0 20%, #909090 48%, #606060 78%, #383838 100%);
  box-shadow: inset 0 -5px 10px rgba(40,40,40,0.65), inset 0 5px 10px rgba(255,255,255,0.2);
}
.ingot-plata-mini span { color: #f0f0f0; }

.ingot-oro-mini {
  background: linear-gradient(135deg, #ffd700 0%, #ffb800 18%, #d4a000 40%, #b8860b 60%, #8b6914 80%, #6b4e0a 100%);
  box-shadow: inset 0 -5px 10px rgba(74,54,8,0.65), inset 0 5px 10px rgba(255,223,100,0.38);
}
.ingot-oro-mini span { color: #fff8c0; }

/* ============================================================
   MINI CHESTS — in home tier cards
   ============================================================ */
.mini-chest {
  position: relative;
  width: 68px;
  height: 60px;
  filter: drop-shadow(0 5px 14px rgba(0, 0, 0, 0.65));
}

.mini-chest-lid {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 44%;
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: flex-start;
  overflow: hidden;
}

.mini-chest-lid-band {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 10px;
  border-radius: 8px 8px 0 0;
}

.mini-chest-body {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 59%;
  border-radius: 0 0 8px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-chest-lock {
  width: 18px;
  height: 18px;
  background: url('logo-fala-cofre.png') no-repeat center center / contain !important;
  border-radius: 0;
  box-shadow: none !important;
  opacity: 0.7;
}

/* Diamante mini chest */
.chest-diamante-mini .mini-chest-lid {
  background: linear-gradient(180deg, #64748b 0%, #334155 100%);
  border: 1.5px solid rgba(226, 232, 240, 0.65);
  box-shadow: 0 0 14px rgba(226, 232, 240, 0.35);
}
.chest-diamante-mini .mini-chest-lid-band {
  background: linear-gradient(90deg, #94a3b8, #f1f5f9, #94a3b8);
}
.chest-diamante-mini .mini-chest-body {
  background: linear-gradient(180deg, #475569 0%, #1e293b 100%);
  border: 1.5px solid rgba(148, 163, 184, 0.5);
}
.chest-diamante-mini .mini-chest-lock {
  filter: drop-shadow(0 0 4px rgba(226, 232, 240, 0.85));
}

/* Legendario mini chest */
.chest-legendario-mini .mini-chest-lid {
  background: linear-gradient(180deg, #5a4030 0%, #2a1a15 100%);
  border: 2px solid rgba(212, 160, 23, 0.8);
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.4);
}
.chest-legendario-mini .mini-chest-lid-band {
  background: linear-gradient(90deg, #8b7355, #ffd700, #8b7355);
}
.chest-legendario-mini .mini-chest-body {
  background: linear-gradient(180deg, #3a2820 0%, #0d0605 100%);
  border: 2px solid rgba(184, 134, 11, 0.65);
}
.chest-legendario-mini .mini-chest-lock {
  filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.95));
}

/* ============================================================
   RAFFLE SCREEN HEADER
   ============================================================ */
.raffle-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 0 16px;
  gap: 16px;
  position: relative;
}

.btn-back {
  position: absolute;
  left: 0;
  top: 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s;
  white-space: nowrap;
  font-family: var(--font-family);
  z-index: 10;
}
.btn-back:hover { background: rgba(255, 255, 255, 0.18); }

.raffle-logo {
  width: 420px;
  max-width: 80vw;
  height: auto;
  filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.85));
  margin: 20px 0 10px;
  transform: scale(1.05);
}

.tier-badge {
  padding: 6px 18px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.tier-badge--bronce    { background: rgba(205,127,50,0.22); color: #f5b060; border: 1.5px solid rgba(205,127,50,0.5); }
.tier-badge--plata     { background: rgba(200,200,200,0.18); color: #ddd;    border: 1.5px solid rgba(200,200,200,0.4); }
.tier-badge--oro       { background: rgba(255,215,0,0.18);   color: #ffd700; border: 1.5px solid rgba(255,215,0,0.42); }
.tier-badge--diamante  { background: rgba(226,232,240,0.15);  color: #e2e8f0; border: 1.5px solid rgba(226,232,240,0.42); }
.tier-badge--legendario{ background: rgba(184,134,11,0.22);  color: #f5d76e; border: 1.5px solid rgba(184,134,11,0.5); }

/* Winners fixed display */
.winners-fixed-display {
  width: 100%;
}

.winners-fixed-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: linear-gradient(135deg, rgba(212,175,55,0.1) 0%, rgba(212,175,55,0.05) 100%);
  border-radius: 14px;
  border: 1.5px solid rgba(212, 175, 55, 0.28);
}

.winners-fixed-num {
  font-size: 52px;
  font-weight: 900;
  color: var(--fb-green);
  line-height: 1;
  min-width: 56px;
  text-align: right;
}

.winners-fixed-label {
  font-size: 15px;
  color: var(--fb-ink-soft);
  font-weight: 600;
  line-height: 1.3;
}

/* ============================================================
   INGOT CELLS — raffle grid (Bronce / Plata / Oro)
   ============================================================ */
.grid-anim--ingot {
  background: linear-gradient(180deg, #1a1008 0%, #0d0805 100%) !important;
  border-color: rgba(180, 130, 60, 0.4) !important;
  gap: 10px 14px !important;
}

.ingot-cell {
  position: relative;
  clip-path: polygon(7% 0%, 93% 0%, 100% 100%, 0% 100%);
  min-height: 48px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: default;
  transition:
    transform 0.45s cubic-bezier(0.55, 0, 0.45, 1),
    opacity 0.4s ease,
    filter 0.3s ease;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.5));
}

/* Top shine */
.ingot-cell::before {
  content: '';
  position: absolute;
  top: 0; left: 8%; right: 8%;
  height: 34%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.38) 0%, transparent 100%);
  border-radius: 0 0 60% 60%;
  pointer-events: none;
  z-index: 2;
}

/* Top bevel */
.ingot-cell::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  pointer-events: none;
  z-index: 2;
}

.ingot-name {
  font-family: 'Georgia', 'Palatino', serif;
  font-weight: 700;
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  letter-spacing: 0.03em;
}

/* Bronce ingot */
.ingot-bronce {
  background: linear-gradient(135deg, #cd7f32 0%, #b87333 18%, #9a5c28 38%, #7a4018 58%, #5a2c10 78%, #3e1e08 100%);
  box-shadow: inset 0 -5px 12px rgba(30,15,5,0.7), inset 0 5px 12px rgba(205,127,50,0.32);
}
.ingot-bronce::after { background: linear-gradient(90deg, #6b3410, #d4882a, #6b3410); }
.ingot-bronce .ingot-name { color: #f5c080; }

/* Plata ingot */
.ingot-plata {
  background: linear-gradient(135deg, #e0e0e0 0%, #c0c0c0 20%, #909090 48%, #666 72%, #404040 88%, #282828 100%);
  box-shadow: inset 0 -5px 12px rgba(40,40,40,0.7), inset 0 5px 12px rgba(255,255,255,0.22);
}
.ingot-plata::after { background: linear-gradient(90deg, #606060, #e8e8e8, #606060); }
.ingot-plata .ingot-name { color: #f2f2f2; }

/* Oro ingot */
.ingot-oro {
  background: linear-gradient(135deg, #ffd700 0%, #ffbe00 16%, #dba800 34%, #b8860b 54%, #8b6914 72%, #6b4e0a 88%, #4a380a 100%);
  box-shadow: inset 0 -5px 12px rgba(74,54,8,0.7), inset 0 5px 12px rgba(255,230,100,0.42);
}
.ingot-oro::after { background: linear-gradient(90deg, #8b6914, #ffd700, #8b6914); }
.ingot-oro .ingot-name { color: #fffde0; }

/* States */
@keyframes ingotHighlightShake {
  0%, 100% { transform: scale(1.1) rotate(0deg); }
  25% { transform: scale(1.14) rotate(-2deg); }
  75% { transform: scale(1.14) rotate(2deg); }
}

.ingot-cell.highlight {
  z-index: 3;
  animation: ingotHighlightShake 0.25s ease-in-out infinite;
}

.ingot-bronce.highlight { filter: drop-shadow(0 0 20px rgba(220, 140, 60, 0.95)) brightness(1.35); }
.ingot-plata.highlight  { filter: drop-shadow(0 0 20px rgba(220, 220, 220, 0.95)) brightness(1.35); }
.ingot-oro.highlight    { filter: drop-shadow(0 0 24px rgba(255, 215, 0, 1)) brightness(1.4); }

.ingot-cell.eliminated {
  opacity: 0;
  transform: rotateX(90deg) scale(0.6) !important;
  pointer-events: none;
}

.ingot-bronce.winner {
  filter: drop-shadow(0 0 22px rgba(220, 140, 60, 0.95)) brightness(1.28);
  transform: scale(1.14) !important;
  animation: ingotWinPulse 1.4s ease-out 1;
  z-index: 3;
}
.ingot-plata.winner {
  filter: drop-shadow(0 0 22px rgba(220, 220, 220, 0.95)) brightness(1.28);
  transform: scale(1.14) !important;
  animation: ingotWinPulse 1.4s ease-out 1;
  z-index: 3;
}
.ingot-oro.winner {
  filter: drop-shadow(0 0 28px rgba(255, 215, 0, 1)) brightness(1.35);
  transform: scale(1.18) !important;
  animation: ingotWinPulse 1.4s ease-out 1;
  z-index: 3;
}

@keyframes ingotWinPulse {
  0%   { transform: scale(1.02) !important; }
  50%  { transform: scale(1.22) !important; }
  100% { transform: scale(1.14) !important; }
}

/* ============================================================
   CHEST REVEAL — raffle animation (Diamante / Legendario)
   ============================================================ */
.chest-reveal-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 45px 20px; /* Aumentado el row-gap para mayor separación vertical */
  justify-content: center;
  padding: 70px 20px 20px; /* Espacio extra arriba para que la tapa y nombre no se corten */
  width: 100%;
  border-radius: 18px;
}

.chest-reveal--diamante {
  background: linear-gradient(180deg, rgba(71, 85, 105, 0.5) 0%, rgba(15, 23, 42, 0.65) 100%);
  border: 1px solid rgba(226, 232, 240, 0.18);
}

.chest-reveal--legendary {
  background: linear-gradient(180deg, rgba(90, 64, 48, 0.5) 0%, rgba(42, 26, 21, 0.65) 100%);
  border: 1px solid rgba(212, 160, 23, 0.38);
}

.chest-reveal-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  gap: 10px;
  margin-top: 50px; /* Espacio mayor para que el popup y la tapa no se superpongan a la fila de arriba */
}

/* The raffle chest */
.raffle-chest {
  position: relative;
  width: 90px;
  height: 82px;
  cursor: default;
  perspective: 320px;
  flex-shrink: 0;
}

.chest-reveal--legendary .raffle-chest {
  width: 126px;
  height: 112px;
}

/* Glow that appears on open */
.chest-glow {
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s;
}
.raffle-chest.chest-open .chest-glow {
  opacity: 1;
  animation: chestGlowPulse 1.6s ease-out forwards;
}
.chest-diamante .chest-glow  { background: radial-gradient(circle, rgba(226, 232, 240, 0.55) 0%, transparent 70%); }
.chest-legendary .chest-glow { background: radial-gradient(circle, rgba(255, 215, 0, 0.55) 0%, transparent 70%); }

/* LID */
.chest-lid {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 44%;
  border-radius: 9px 9px 0 0;
  transform-origin: bottom center;
  transform: rotateX(0deg);
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2;
}
.raffle-chest.chest-open .chest-lid { transform: rotateX(-145deg); }

.chest-lid-top-band {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 11px;
  border-radius: 9px 9px 0 0;
}
.chest-lid-clasp {
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 11px;
  border-radius: 4px;
  z-index: 3;
}

/* BODY */
.chest-body {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 58%;
  border-radius: 0 0 9px 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.chest-body-band {
  position: absolute;
  bottom: 22%; left: 0; right: 0;
  height: 7px;
}
.chest-lock {
  width: 30px;
  height: 26px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.chest-lock-hole {
  width: 20px;
  height: 20px;
  background: url('logo-fala-cofre.png') no-repeat center center / contain !important;
  border-radius: 0;
  box-shadow: none !important;
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.8));
  opacity: 0.7;
}

/* Question mark floating inside chest */
.chest-question-mark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.35);
  z-index: 4;
  pointer-events: none;
  transition: opacity 0.3s;
}
.chest-reveal--legendary .chest-question-mark { font-size: 36px; }

/* === DIAMANTE chest colors === */
.chest-diamante .chest-lid {
  background: linear-gradient(180deg, #64748b 0%, #334155 100%);
  border: 2px solid rgba(226, 232, 240, 0.65);
  box-shadow: 0 0 18px rgba(226, 232, 240, 0.32);
}
.chest-diamante .chest-lid-top-band { background: linear-gradient(90deg, #94a3b8, #f1f5f9, #94a3b8); }
.chest-diamante .chest-lid-clasp    { background: radial-gradient(ellipse, #f1f5f9, #94a3b8); }
.chest-diamante .chest-body {
  background: linear-gradient(180deg, #475569 0%, #1e293b 100%);
  border: 2px solid rgba(148, 163, 184, 0.5);
  box-shadow: 0 0 14px rgba(226, 232, 240, 0.2), inset 0 4px 12px rgba(0,0,0,0.5);
}
.chest-diamante .chest-body-band { background: linear-gradient(180deg, #94a3b8, #64748b); }
.chest-diamante .chest-lock       { background: linear-gradient(145deg, #cbd5e1, #64748b); box-shadow: inset 0 1px 3px rgba(255,255,255,0.25); }
.chest-diamante .chest-lock-hole  { filter: drop-shadow(0 0 6px rgba(226, 232, 240, 0.9)); }

/* === LEGENDARIO chest colors === */
.chest-legendary .chest-lid {
  background: linear-gradient(180deg, #5a4030 0%, #2a1a15 100%);
  border: 2.5px solid rgba(212, 160, 23, 0.85);
  box-shadow: 0 0 24px rgba(255, 215, 0, 0.45);
}
.chest-legendary .chest-lid-top-band { background: linear-gradient(90deg, #8b7355, #ffd700, #c8a820, #ffd700, #8b7355); }
.chest-legendary .chest-lid-clasp    { background: radial-gradient(ellipse, #ffd700, #8b6914); box-shadow: 0 0 8px rgba(255,215,0,0.7); }
.chest-legendary .chest-body {
  background: linear-gradient(180deg, #3a2820 0%, #1a0d0a 100%);
  border: 2.5px solid rgba(184, 134, 11, 0.72);
  box-shadow: 0 0 22px rgba(212, 160, 23, 0.38), inset 0 4px 14px rgba(0,0,0,0.65);
}
.chest-legendary .chest-body-band { background: linear-gradient(180deg, #a08050, #6b4e0a); }
.chest-legendary .chest-lock      { background: linear-gradient(145deg, #c8a820, #6b4e0a); box-shadow: inset 0 1px 3px rgba(255,215,0,0.32); }
.chest-legendary .chest-lock-hole { filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.95)); }

/* Winner name that appears above the chest when opened */
.chest-winner-reveal {
  position: absolute;
  bottom: 85%;
  z-index: 10;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  padding: 4px 10px;
  border-radius: 9px;
  opacity: 0;
  transition: opacity 0.4s ease;
  max-width: 110px;
  word-break: break-word;
  line-height: 1.25;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}
.chest-reveal--legendary .chest-winner-reveal {
  font-size: 13px;
  max-width: 130px;
  padding: 5px 12px;
  border-radius: 10px;
}
.chest-reveal--diamante  .chest-winner-reveal { background: rgba(226,232,240,0.14); color: #e2e8f0; border: 1px solid rgba(226,232,240,0.32); }
.chest-reveal--legendary .chest-winner-reveal { background: rgba(255, 215, 0, 0.14); color: #ffd700; border: 1px solid rgba(255, 215, 0, 0.32); }

/* Shake animation */
.chest-shaking {
  animation: chestShake 0.4s cubic-bezier(.36,.07,.19,.97) both infinite;
}
@keyframes chestShake {
  0% { transform: translate(0, 0) rotate(0deg); }
  15% { transform: translate(-4px, -2px) rotate(-3deg); }
  30% { transform: translate(4px, 2px) rotate(3deg); }
  45% { transform: translate(-4px, 2px) rotate(-3deg); }
  60% { transform: translate(4px, -2px) rotate(3deg); }
  75% { transform: translate(-2px, -2px) rotate(-1.5deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes chestGlowPulse {
  0%   { opacity: 0; transform: scale(0.7); }
  40%  { opacity: 1; }
  100% { opacity: 0.55; transform: scale(1.1); }
}

@keyframes chestNameReveal {
  from { opacity: 0; transform: translateY(25px) scale(0.6); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
