* { box-sizing: border-box; }
body {
  margin: 0; font-family: system-ui, Arial;
  background: #0b0f19; color: #e8ecff;
}
.wrap { max-width: 980px; margin: 0 auto; padding: 18px; }
.card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  padding: 14px;
  margin: 12px 0;
  transition: all 0.3s ease;
}
h1,h2 { margin: 0 0 10px 0; }
small { opacity: 0.8; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  background: #5b7cff;
  border: 0; color: #fff;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.2s ease;
}
.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(91, 124, 255, 0.3);
}
.btn:active:not(:disabled) {
  transform: translateY(0);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn.secondary { background: rgba(255,255,255,0.12); }
.btn.danger { background: #ff4d6d; }
.input, textarea, select {
  width: 100%;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  border-radius: 12px;
  padding: 10px;
  transition: all 0.2s ease;
  font-size: 1em;
}
.input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #5b7cff;
  background: rgba(0,0,0,0.5);
  box-shadow: 0 0 0 3px rgba(91, 124, 255, 0.2);
}
select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235b7cff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}
select option {
  background: #0b0f19;
  color: #e8ecff;
  padding: 8px;
}
select option:hover {
  background: #5b7cff;
  color: #fff;
}
textarea { min-height: 70px; resize: vertical; }
.kpi {
  display: inline-block;
  padding: 6px 10px;
  background: rgba(255,255,255,0.10);
  border-radius: 999px;
  margin-right: 8px;
}
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
hr { border: 0; border-top: 1px solid rgba(255,255,255,0.12); margin: 10px 0; }

/* Transiciones de fases */
[id$="Box"] {
  animation: phaseIn 0.6s ease-out;
}

@keyframes phaseIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade out para elementos que se ocultan */
@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

/* Pulse para elementos que necesitan atención */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.pulse {
  animation: pulse 2s infinite;
}

/* Estado revelado */
.revealed {
  animation: reveal 0.6s ease;
}

@keyframes reveal {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Transición de fase suave */
.phase-transition {
  animation: phaseTransition 0.4s ease;
}

@keyframes phaseTransition {
  0% {
    opacity: 0.5;
    transform: scale(0.98);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Overlay para countdown */
#countdownOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeInOverlay 0.3s ease;
}

@keyframes fadeInOverlay {
  from { 
    opacity: 0;
    background: rgba(0, 0, 0, 0);
  }
  to { 
    opacity: 1;
    background: rgba(0, 0, 0, 0.8);
  }
}

#countdownText {
  font-size: 150px;
  font-weight: 900;
  color: #5b7cff;
  text-shadow: 
    0 0 20px rgba(91, 124, 255, 0.9),
    0 0 40px rgba(91, 124, 255, 0.6),
    0 0 60px rgba(91, 124, 255, 0.4);
  animation: countdownPulse 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  letter-spacing: 10px;
  font-family: 'Impact', 'Arial Black', sans-serif;
  transform: scaleX(1.1) scaleY(1.2);
  margin: 0;
  line-height: 1;
}

@keyframes countdownPulse {
  0% {
    transform: scale(0.1) scaleX(1.1) scaleY(1.2);
    opacity: 0;
  }
  50% {
    transform: scale(1.3) scaleX(1.1) scaleY(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(1) scaleX(1.1) scaleY(1.2);
    opacity: 1;
  }
}

/* Toast notification */
.toast-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: #1a1f2e;
  border: 2px solid #5b7cff;
  border-radius: 12px;
  padding: 16px 20px;
  color: #e8ecff;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(91, 124, 255, 0.3);
  animation: slideIn 0.3s ease-out;
  pointer-events: auto;
  max-width: 400px;
  text-align: center;
}

.toast.error {
  border-color: #ff4d6d;
  box-shadow: 0 8px 24px rgba(255, 77, 109, 0.3);
}

.toast.warning {
  border-color: #ffc857;
  box-shadow: 0 8px 24px rgba(255, 200, 87, 0.3);
}

.toast.success {
  border-color: #2ecc71;
  box-shadow: 0 8px 24px rgba(46, 204, 113, 0.3);
}

@keyframes slideIn {
  from {
    transform: translateX(-50%) translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
  to {
    transform: translateX(-50%) translateY(100px);
    opacity: 0;
  }
}

/* Player button selector */
.player-btn {
  background: rgba(91, 124, 255, 0.1) !important;
  border: 2px solid transparent !important;
  padding: 15px !important;
  text-align: left !important;
  transition: all 0.2s ease !important;
  cursor: pointer !important;
  width: 100% !important;
}

.player-btn:hover:not(:disabled) {
  background: rgba(91, 124, 255, 0.2) !important;
  border-color: rgba(91, 124, 255, 0.5) !important;
}

.player-btn.selected {
  background: rgba(91, 124, 255, 0.4) !important;
  border-color: #5b7cff !important;
}
