/* OkiroSport — Keyframes y Efectos Visuales */

/* ════════════════════════════════════════════════════════════════ */
/* KEYFRAMES                                                        */
/* ════════════════════════════════════════════════════════════════ */

/* Orbe del splash — escala y opacidad */
@keyframes splashPulse {
  0%, 100% { opacity: 0.5; transform: scale(1);   }
  50%      { opacity: 1;   transform: scale(1.1); }
}

/* Pulso genérico — opacidad */
@keyframes pulse {
  0%, 100% { opacity: 1;   }
  50%      { opacity: 0.6; }
}

/* Entrada de sección revelando de izquierda a derecha */
@keyframes materialize {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0% 0 0);   }
}

/* Fade-in de puntos de carga IA */
@keyframes dp {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}

/* Cursor del typewriter */
@keyframes typewriterCursor {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

/* ════════════════════════════════════════════════════════════════ */
/* SECCIONES — show/hide con animación                              */
/* ════════════════════════════════════════════════════════════════ */

.sec {
  display: none;
}

/* animation dispara en el primer frame tras display:block — funciona en todos los navegadores */
.sec.active {
  display:   block;
  animation: sectionIn 200ms ease forwards;
}

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

.sec.materialize-enter {
  animation: materialize 300ms ease forwards;
}

/* ════════════════════════════════════════════════════════════════ */
/* SPLASH SCREEN                                                    */
/* ════════════════════════════════════════════════════════════════ */

#splash {
  position:        fixed;
  inset:           0;
  background:      #000;
  display:         flex;
  flex-direction:  column;
  align-items:     center;
  justify-content: center;
  z-index:         9999;
  animation:       splashFade 0.6s 1.4s forwards;
}

#splash::before {
  content:       '';
  position:      absolute;
  top:           30%;
  width:         200px;
  height:        200px;
  border-radius: 50%;
  background:    radial-gradient(circle, rgba(139, 77, 255, 0.6), transparent 70%);
  filter:        blur(40px);
  animation:     splashPulse 1.5s ease-in-out infinite;
}

#splash h1 {
  font-family:    var(--font-sans);
  font-size:      32px;
  font-weight:    700;
  letter-spacing: -0.5px;
  color:          var(--text-1);
  position:       relative;
  z-index:        2;
  text-shadow:    0 0 20px rgba(139, 77, 255, 0.5);
  margin:         0;
}

#splash h1 span {
  color: var(--brand);
}

#splash p {
  font-family:    var(--font-sans);
  font-size:      10px;
  letter-spacing: 3px;
  color:          var(--brand);
  font-weight:    600;
  margin-top:     8px;
  text-transform: uppercase;
  position:       relative;
  z-index:        2;
}

@keyframes splashFade {
  to { opacity: 0; visibility: hidden; }
}

/* ════════════════════════════════════════════════════════════════ */
/* LOADING DOTS (IA)                                                */
/* ════════════════════════════════════════════════════════════════ */

.dp {
  display: flex;
  gap:     4px;
  padding: 8px 0;
}

.dp span {
  display:       inline-block;
  width:         5px;
  height:        5px;
  border-radius: 50%;
  background:    var(--success);
  animation:     dp 1s infinite alternate;
}

.dp span:nth-child(2) { animation-delay: 0.2s; }
.dp span:nth-child(3) { animation-delay: 0.4s; }

/* ════════════════════════════════════════════════════════════════ */
/* MODAL DE MISIONES DIARIAS                                        */
/* ════════════════════════════════════════════════════════════════ */

#mission-overlay {
  position:                fixed;
  inset:                   0;
  z-index:                 10000;
  background:              rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter:         blur(8px);
  display:                 flex;
  align-items:             center;
  justify-content:         center;
  padding:                 20px;
  animation:               modalFade 0.3s ease forwards;
}

#mission-modal {
  background:              rgba(20, 20, 26, 0.85);
  -webkit-backdrop-filter: blur(60px) saturate(200%);
  backdrop-filter:         blur(60px) saturate(200%);
  border-radius:           var(--radius-xl);
  padding:                 28px;
  max-width:               380px;
  width:                   100%;
  position:                relative;
  overflow:                hidden;
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1.5px 0 rgba(0, 0, 0, 0.6),
    0 0 0 0.5px rgba(139, 77, 255, 0.3),
    0 24px 60px rgba(0, 0, 0, 0.8),
    0 0 32px rgba(139, 77, 255, 0.2);
  animation:               modalIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#mission-modal::before {
  content:        '';
  position:       absolute;
  top: 0; left: 5%; right: 5%;
  height:         1.5px;
  background:     linear-gradient(90deg, transparent, rgba(139, 77, 255,0.7), transparent);
  pointer-events: none;
}

/* Esquinas decorativas */
.mm-corner {
  position:   absolute;
  width:      12px;
  height:     12px;
  background: var(--brand);
  z-index:    3;
}

/* Cabecera del modal */
.mm-system-tag {
  font-family:    var(--font-sans);
  font-size:      10px;
  color:          var(--text-4);
  letter-spacing: 2px;
  margin-bottom:  8px;
}

.mm-title {
  font-family:    var(--font-sans);
  font-size:      13px;
  color:          var(--brand);
  letter-spacing: 2px;
  margin-bottom:  16px;
  min-height:     20px;
}

.mm-title-cursor {
  display:   inline-block;
  color:     var(--brand);
  animation: typewriterCursor 600ms step-end infinite;
}

/* Cuerpo */
.mm-body {
  font-family:   var(--font-sans);
  font-size:     12px;
  color:         var(--text-2);
  line-height:   1.6;
  margin-bottom: 20px;
}

.mm-no-data {
  color:          var(--text-4);
  text-align:     center;
  padding:        8px 0;
  letter-spacing: 1px;
}

/* Botones del modal */
.mm-btn-accept {
  width:          100%;
  height:         44px;
  background:     var(--brand);
  color:          #000;
  font-family:    var(--font-sans);
  font-weight:    700;
  font-size:      14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  border:         none;
  cursor:         pointer;
  margin-bottom:  8px;
  display:        block;
  border-radius:  var(--radius-md);
}

.mm-btn-accept:active {
  transform: scale(0.97);
}

.mm-btn-skip {
  width:          100%;
  height:         36px;
  background:     transparent;
  border:         none;
  box-shadow:     inset 0 0 0 0.5px var(--text-4);
  color:          var(--text-3);
  font-family:    var(--font-sans);
  font-size:      11px;
  cursor:         pointer;
  display:        block;
  border-radius:  var(--radius-sm);
}

#mission-modal.hiding {
  animation: modalIn 200ms ease reverse forwards;
}

@keyframes modalFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes modalIn {
  from {
    opacity:   0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity:   1;
    transform: scale(1) translateY(0);
  }
}

/* ── VENTANA DE ESTADO ─────────────────────────────────────────────
   Misma piel que el modal de misión: es el mismo "sistema" hablando. */
#estado-overlay {
  position:                fixed;
  inset:                   0;
  z-index:                 10000;
  background:              rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter:         blur(8px);
  display:                 flex;
  align-items:             center;
  justify-content:         center;
  padding:                 20px;
  animation:               modalFade 0.3s ease forwards;
}

#estado-modal {
  background:              rgba(20, 20, 26, 0.85);
  -webkit-backdrop-filter: blur(60px) saturate(200%);
  backdrop-filter:         blur(60px) saturate(200%);
  border-radius:           var(--radius-xl);
  padding:                 26px;
  max-width:               380px;
  width:                   100%;
  max-height:              calc(100vh - 40px);
  overflow-y:              auto;
  position:                relative;
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1.5px 0 rgba(0, 0, 0, 0.6),
    0 0 0 0.5px rgba(139, 77, 255, 0.3),
    0 24px 60px rgba(0, 0, 0, 0.8),
    0 0 32px rgba(139, 77, 255, 0.2);
  animation:               modalIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.est-cabecera {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  margin-bottom:   18px;
}

.est-rango { font-size: 22px; padding: 6px 16px; }

.est-lvl {
  font-family: var(--font-sans);
  font-size:   13px;
  color:       var(--text-2);
  text-align:  right;
}

.est-lvl span {
  display:     block;
  font-family: var(--font-mono);
  font-size:   10px;
  color:       var(--text-4);
  margin-top:  2px;
}

.est-sep {
  font-family:    var(--font-sans);
  font-size:      9px;
  font-weight:    700;
  letter-spacing: 2px;
  color:          var(--brand-soft);
  text-transform: uppercase;
  margin:         16px 0 8px;
  padding-top:    10px;
  border-top:     1px solid rgba(139, 77, 255, 0.14);
}

.est-fila {
  display:         flex;
  justify-content: space-between;
  align-items:     baseline;
  padding:         5px 0;
  font-family:     var(--font-sans);
  font-size:       12px;
}

.est-k { color: var(--text-3); }
.est-v { color: var(--text-2); font-family: var(--font-mono); }
.est-alto { color: var(--brand-soft); }

/* Desglose del XP de hoy: enseña qué suma, que es lo que nadie sabía */
.est-xp {
  list-style: none;
  margin:     6px 0 0;
  padding:    0;
}

.est-xp li {
  display:         flex;
  justify-content: space-between;
  font-family:     var(--font-sans);
  font-size:       11px;
  color:           var(--text-4);
  padding:         3px 0 3px 10px;
  border-left:     1px solid rgba(139, 77, 255, 0.2);
}

.est-xp li span:last-child { color: var(--brand-soft); font-family: var(--font-mono); }

.est-vacio {
  font-family: var(--font-sans);
  font-size:   11px;
  color:       var(--text-4);
  line-height: 1.5;
  margin:      6px 0 0;
}

/* La cabecera ahora responde al toque */
#hdr-brand, #xp-row, #hdr-right { cursor: pointer; }
#hdr-brand:active, #xp-row:active, #hdr-right:active { opacity: 0.7; }
