/* ============================================================
   game.css — Superposiciones sobre el área de juego
   ============================================================ */

/* ——— Aviso de mejora / max win ——— */

#upgrade-flash {
  position: absolute;
  top: 36%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  z-index: 40;
  font-family: var(--font-pixel);
  font-size: clamp(20px, 4.6vmin, 42px);
  color: #76FF03;
  text-shadow: 4px 4px 0 #000, 0 0 26px currentColor;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease, transform 0.34s cubic-bezier(0.18, 0.9, 0.32, 1.28);
  white-space: nowrap;
}

#upgrade-flash.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ——— Cartel de fin de ronda ——— */

.round-end {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.6);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;

  min-width: min(78vw, 340px);
  padding: 26px 40px;
  border-radius: 14px;
  border: 4px solid var(--gold);
  background: rgba(10, 10, 14, 0.9);
  backdrop-filter: blur(3px);

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.42s cubic-bezier(0.18, 0.9, 0.32, 1.24);
}

.round-end.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

#round-end-label {
  font-family: var(--font-pixel);
  font-size: clamp(10px, 1.9vmin, 15px);
  letter-spacing: 2px;
  color: var(--text-dim);
  text-shadow: var(--shadow-pixel);
}

/* Dibujado con la fuente bitmap AlumniBitmap desde js/ui.js */
#round-end-amount {
  height: clamp(28px, 5.4vmin, 48px);
  width: auto;
  max-width: 82vw;
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.9));
}

.round-end.win  { border-color: var(--gold); }
.round-end.win  #round-end-label  { color: var(--gold); }

.round-end.loss { border-color: #4A4A52; }

/* Premio grande: brillo pulsante */
.round-end.big {
  border-color: #FFE082;
  box-shadow: 0 0 46px rgba(255, 196, 0, 0.55);
  animation: bigWinPulse 1s ease-in-out infinite alternate;
}

@keyframes bigWinPulse {
  from { box-shadow: 0 0 30px rgba(255, 196, 0, 0.4); }
  to   { box-shadow: 0 0 62px rgba(255, 196, 0, 0.8); }
}

/* ——— Aviso breve (saldo insuficiente, etc.) ——— */

#toast {
  position: absolute;
  bottom: 26%;
  left: 50%;
  transform: translate(-50%, 14px);
  z-index: 60;

  padding: 12px 20px;
  border-radius: 10px;
  border: 2px solid var(--danger);
  background: rgba(10, 10, 14, 0.92);

  font-family: var(--font-pixel);
  font-size: clamp(8px, 1.5vmin, 11px);
  line-height: 1.6;
  text-align: center;
  white-space: nowrap;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease, transform 0.24s ease;
}

#toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 460px) {
  .round-end { padding: 20px 24px; min-width: 76vw; }
  #toast { white-space: normal; max-width: 82vw; }
}
