/* --- Command Effects: premium fullscreen animations --- */

/* ====== Fullscreen command overlay ====== */
.command-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  z-index: 300;
  background: rgba(0,0,0,.8);
  backdrop-filter: blur(10px);
  animation: cmdFadeIn 0.3s ease;
  pointer-events: none;
}
.command-overlay.exit {
  animation: cmdFadeOut 0.5s ease forwards;
}
@keyframes cmdFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes cmdFadeOut { from { opacity: 1; } to { opacity: 0; } }

/* Icon */
.cmd-icon {
  font-size: 5rem;
  line-height: 1;
  filter: drop-shadow(0 0 20px rgba(255,255,255,.3));
}

/* Title */
.cmd-title {
  font-family: 'Archivo Black', sans-serif;
  font-size: 3rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .1em;
  animation: cmdTitleIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.cmd-title-xl {
  font-family: 'Archivo Black', sans-serif;
  font-size: 8rem;
  font-weight: 900;
  line-height: 1;
  animation: cmdTitleIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes cmdTitleIn {
  from { transform: scale(0.3) rotate(-5deg); opacity: 0; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}

/* Subtitle */
.cmd-subtitle {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255,255,255,.8);
  text-align: center;
  max-width: 400px;
}

/* Bits badge */
.cmd-bits {
  font-size: .75rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.6);
  margin-top: 4px;
}

/* ====== Per-command colors ====== */

/* BOMBA - red/orange */
.command-bomba { background: radial-gradient(circle at center, rgba(239,68,68,.15), rgba(0,0,0,.85)); }
.command-bomba .cmd-title { color: #ef4444; text-shadow: 0 0 40px rgba(239,68,68,.5); }
.command-bomba .cmd-icon { animation: cmdBounce 0.5s ease; }

/* 5050 - blue */
.command-5050 { background: radial-gradient(circle, rgba(102,183,255,.12), rgba(0,0,0,.85)); }
.command-5050 .cmd-title { color: var(--blue); text-shadow: 0 0 40px rgba(102,183,255,.5); }
.command-5050 .cmd-icon { animation: cmdCut 0.6s ease; }

/* CAMBIO - purple */
.command-cambio { background: radial-gradient(circle, rgba(139,92,246,.12), rgba(0,0,0,.85)); }
.command-cambio .cmd-title { color: var(--violet); text-shadow: 0 0 40px rgba(139,92,246,.5); }
.command-cambio .cmd-icon { animation: cmdSpin 0.8s ease; }

/* RULETA - gold */
.command-ruleta { background: radial-gradient(circle, rgba(246,195,106,.12), rgba(0,0,0,.85)); }
.command-ruleta .cmd-title { color: var(--amber); text-shadow: 0 0 40px rgba(246,195,106,.5); }
.command-ruleta .cmd-icon { animation: cmdRuletaSpin 3.5s cubic-bezier(0.17, 0.67, 0.12, 0.99); }

/* DOBLE - gold gradient */
.command-doble { background: radial-gradient(circle, rgba(246,195,106,.15), rgba(0,0,0,.85)); }
.command-doble .cmd-title-xl {
  background: linear-gradient(135deg, #f6c36a, #ff5fa8, #66b7ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: cmdTitleIn 0.4s ease, cmdGlow 1.5s ease infinite;
}

/* CHAT POLL - twitch purple */
.command-chat-poll { background: radial-gradient(circle, rgba(145,70,255,.12), rgba(0,0,0,.85)); }
.command-chat-poll .cmd-title { color: #9146ff; text-shadow: 0 0 40px rgba(145,70,255,.5); }

/* RANDOM - gold chaos */
.command-random { background: radial-gradient(circle, rgba(251,191,36,.15), rgba(0,0,0,.85)); }
.command-random .cmd-title { color: #fbbf24; text-shadow: 0 0 40px rgba(251,191,36,.6); }
.command-random .cmd-icon { animation: cmdDiceRoll 0.8s ease; }

/* SWAP - purple exchange */
.command-swap { background: radial-gradient(circle, rgba(168,85,247,.15), rgba(0,0,0,.85)); }
.command-swap .cmd-title { color: #a855f7; text-shadow: 0 0 40px rgba(168,85,247,.5); }
.command-swap .cmd-icon { animation: cmdSwapSlide 0.8s ease; }

/* ESPEJO - cyan mirror */
.command-espejo { background: radial-gradient(circle, rgba(34,211,238,.12), rgba(0,0,0,.85)); }
.command-espejo .cmd-title { color: #22d3ee; text-shadow: 0 0 40px rgba(34,211,238,.5); }
.command-espejo .cmd-icon { animation: cmdMirror 1s ease infinite; }

/* REVERSA - red danger */
.command-reversa { background: radial-gradient(circle, rgba(239,68,68,.15), rgba(0,0,0,.85)); }
.command-reversa .cmd-title { color: #ef4444; text-shadow: 0 0 40px rgba(239,68,68,.6); }
.command-reversa .cmd-icon { animation: cmdReverse 0.8s ease; }

/* ====== Icon animations ====== */
@keyframes cmdBounce {
  0% { transform: translateY(-100px) scale(0.5); opacity: 0; }
  60% { transform: translateY(10px) scale(1.1); opacity: 1; }
  100% { transform: translateY(0) scale(1); }
}
@keyframes cmdCut {
  0% { transform: rotate(-45deg) scale(1.5); opacity: 0; }
  50% { transform: rotate(10deg) scale(1); opacity: 1; }
  100% { transform: rotate(0) scale(1); }
}
@keyframes cmdSpin {
  0% { transform: rotateY(0) scale(0.5); opacity: 0; }
  50% { transform: rotateY(180deg) scale(1.1); opacity: 1; }
  100% { transform: rotateY(360deg) scale(1); }
}
@keyframes cmdRuletaSpin {
  0% { transform: rotate(0); }
  100% { transform: rotate(1440deg); }
}
@keyframes cmdGlow {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(246,195,106,.3)); }
  50% { filter: drop-shadow(0 0 30px rgba(246,195,106,.6)); }
}
@keyframes cmdDiceRoll {
  0% { transform: rotate(0deg) scale(0.3); opacity: 0; }
  30% { transform: rotate(180deg) scale(1.3); opacity: 1; }
  60% { transform: rotate(360deg) scale(0.9); }
  100% { transform: rotate(720deg) scale(1); }
}
@keyframes cmdSwapSlide {
  0% { transform: translateX(-80px) scale(0.5); opacity: 0; }
  40% { transform: translateX(80px) scale(1.2); opacity: 1; }
  70% { transform: translateX(-20px) scale(1); }
  100% { transform: translateX(0) scale(1); }
}
/* Random result reveal */
.cmd-random-result {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 80px;
  justify-content: center;
}
.cmd-random-qmark {
  font-size: 3rem;
  font-weight: 900;
  color: #fbbf24;
  animation: cmdRandomShuffle 0.15s linear infinite;
}
.cmd-random-result.revealed .cmd-random-qmark { display: none; }
@keyframes cmdRandomShuffle {
  0% { content: '?'; transform: scale(1); }
  50% { transform: scale(1.2) rotate(10deg); }
  100% { transform: scale(1) rotate(-10deg); }
}
@keyframes cmdMirror {
  0%, 100% { transform: scaleX(1); }
  50% { transform: scaleX(-1); }
}
@keyframes cmdReverse {
  0% { transform: rotate(0deg) scale(0.5); opacity: 0; }
  50% { transform: rotate(180deg) scale(1.3); opacity: 1; }
  100% { transform: rotate(360deg) scale(1); }
}

/* ====== Explosion particles (bomba) ====== */
.cmd-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.particle {
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: 1.5rem;
  opacity: 0;
  animation: particleExplode 1s ease-out 0.7s forwards;
}
.particle-0  { --px: -120px; --py: -80px; }
.particle-1  { --px: 100px;  --py: -100px; }
.particle-2  { --px: -80px;  --py: 90px; }
.particle-3  { --px: 130px;  --py: 60px; }
.particle-4  { --px: -150px; --py: -20px; }
.particle-5  { --px: 50px;   --py: -130px; }
.particle-6  { --px: -30px;  --py: 120px; }
.particle-7  { --px: 140px;  --py: -50px; }
.particle-8  { --px: -100px; --py: 110px; }
.particle-9  { --px: 80px;   --py: 100px; }
.particle-10 { --px: -140px; --py: 40px; }
.particle-11 { --px: 110px;  --py: -110px; }

@keyframes particleExplode {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--px), var(--py)) scale(0); opacity: 0; }
}

/* ====== Chat Poll Overlay ====== */
.chat-poll-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 250;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(6px);
  animation: cmdFadeIn 0.3s ease;
}
.chat-poll-overlay.exit { animation: cmdFadeOut 0.5s ease forwards; }

.chat-poll-card {
  background: var(--glass-strong);
  border: 2px solid #9146ff;
  border-radius: var(--radius);
  padding: 24px 32px;
  min-width: 360px;
  max-width: 500px;
  box-shadow: 0 0 60px rgba(145,70,255,.2);
}

.chat-poll-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 800;
  font-size: 1.1rem;
  color: #9146ff;
  margin-bottom: 12px;
}
.chat-poll-emoji { font-size: 1.5rem; }
.chat-poll-timer {
  font-family: 'Orbitron', monospace;
  font-size: .9rem;
  color: var(--amber);
}

.chat-poll-question {
  font-size: .9rem;
  font-weight: 600;
  color: var(--txt);
  margin-bottom: 16px;
  line-height: 1.4;
}

.chat-poll-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-poll-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.chat-poll-label {
  font-weight: 800;
  font-size: 1rem;
  color: var(--muted);
  width: 20px;
  text-align: center;
}
.chat-poll-bar-bg {
  flex: 1;
  height: 28px;
  background: rgba(255,255,255,.06);
  border-radius: 6px;
  overflow: hidden;
}
.chat-poll-bar {
  height: 100%;
  background: linear-gradient(90deg, #9146ff, #bf7fff);
  border-radius: 6px;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 0;
}
.chat-poll-bar.winner {
  background: linear-gradient(90deg, var(--green), #5eead4);
  animation: cmdGlow 0.5s ease 3;
}
.chat-poll-count {
  font-weight: 700;
  font-size: .85rem;
  color: var(--txt);
  min-width: 28px;
  text-align: right;
}
.chat-poll-total {
  text-align: center;
  font-size: .75rem;
  color: var(--muted);
  margin-top: 10px;
}

/* ====== Small donation notification (non-command) ====== */
#donationEffectOverlay {
  position: fixed;
  top: 80px;
  right: 16px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 280px;
}
.donation-notification {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--glass-strong);
  border: 1px solid var(--stroke-2);
  backdrop-filter: blur(12px);
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s;
}
.donation-notification.show { transform: translateX(0); opacity: 1; }
.donation-notification.exit { transform: translateX(120%); opacity: 0; }
.donation-header { display: flex; justify-content: space-between; align-items: center; }
.donation-donor { font-weight: 700; font-size: .85rem; color: var(--txt); }
.donation-bits { font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: rgba(255,255,255,.1); color: var(--muted); }

/* ====== Mobile ====== */
@media (max-width: 640px) {
  .cmd-icon { font-size: 3.5rem; }
  .cmd-title { font-size: 2rem; }
  .cmd-title-xl { font-size: 5rem; }
  .cmd-subtitle { font-size: .85rem; }
  .chat-poll-card { min-width: auto; margin: 16px; padding: 16px 20px; }
  #donationEffectOverlay { top: auto; bottom: 80px; right: 8px; left: 8px; max-width: none; }
}
