/* ==========================================================================
   SUPER BRO'YA GYM - Estilos Principales
   Mobile-First, Arcade Fitness, Saiyan RPG Theme
   ========================================================================== */

:root {
  --bg-main: #070c1a;
  --bg-card: rgba(16, 26, 52, 0.88);
  --bg-card-hover: rgba(24, 38, 75, 0.95);
  --bg-card-inner: rgba(9, 16, 34, 0.85);
  --border-subtle: rgba(59, 130, 246, 0.2);
  --border-focus: #3b82f6;
  
  --gold-primary: #f59e0b;
  --gold-light: #fef08a;
  --gold-glow: rgba(245, 158, 11, 0.45);
  
  --blue-electric: #3b82f6;
  --blue-light: #60a5fa;
  --blue-glow: rgba(59, 130, 246, 0.4);

  --green-emerald: #10b981;
  --green-glow: rgba(16, 185, 129, 0.4);

  --red-accent: #ef4444;
  --red-god: #dc2626;
  --purple-legendary: #a855f7;
  --cyan-plat: #38bdf8;
  --silver-ultra: #f8fafc;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --nav-height: 68px;
  --header-height: 60px;
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.45);
  --font-display: 'Impact', 'Arial Black', sans-serif;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

/* ==========================================================================
   ELIMINAR FLECHAS MOLESTAS DE INPUTS NUMÉRICOS (SPIN BUTTONS)
   Permite escribir libremente sin que aparezca el selector por defecto
   ========================================================================== */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}

input[type="number"] {
  -moz-appearance: textfield !important;
  appearance: textfield !important;
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  background-color: #03060f;
  font-family: var(--font-sans);
  color: var(--text-main);
  line-height: 1.4;
  scroll-behavior: smooth;
  scroll-padding-bottom: 220px; /* Para que el teclado móvil nunca tape el input */
}

/* Cuando el teclado móvil está activo, ocultar nav inferior para dar espacio */
body.keyboard-active .bottom-nav {
  display: none !important;
}

body.keyboard-active .main-content {
  padding-bottom: 80px !important;
}

/* Contenedor Mobile Centrado */
#app-container {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background: radial-gradient(circle at 50% 0%, #172a54 0%, #091124 45%, #050914 100%);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.85);
  overflow-x: hidden;
}

/* HEADER */
.app-header {
  height: calc(var(--header-height) + env(safe-area-inset-top, 0px));
  min-height: calc(var(--header-height) + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: env(safe-area-inset-top, 0px) 16px 0 16px;
  background: rgba(7, 12, 26, 0.94);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border-subtle);
}

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

.brand-icon {
  width: 34px;
  height: 34px;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #ffffff 0%, #fef08a 40%, #f59e0b 80%, #ef4444 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.5));
}

.header-user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card-inner);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold-light);
  cursor: pointer;
}

.header-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1e293b;
  border: 1px solid var(--gold-primary);
  object-fit: cover;
}

/* MAIN CONTENT */
.main-content {
  flex: 1;
  padding: 16px 16px calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + 30px) 16px;
  overflow-y: auto;
}

.view-section {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.view-section.active {
  display: block;
}

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

/* CARDS */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.card.highlight {
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 8px 30px var(--gold-glow);
}

.card-title {
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ==========================================================================
   INPUTS CON STEPPER INTEGRADO (ESCRIBIR LIBREMENTE + BOTONES + / -)
   ========================================================================== */
.stepper-input-wrap {
  display: flex;
  align-items: center;
  background: #091124;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s;
}

.stepper-input-wrap:focus-within {
  border-color: var(--blue-electric);
  box-shadow: 0 0 10px var(--blue-glow);
}

.stepper-btn {
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: var(--gold-light);
  font-family: var(--font-display);
  font-size: 1.3rem;
  width: 44px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.stepper-btn:active {
  background: rgba(245, 158, 11, 0.25);
}

.stepper-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.25rem;
  text-align: center;
  padding: 10px 4px;
  outline: none;
  min-width: 0;
}

/* ONBOARDING & AUTH VIEW */
.auth-switch-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
  background: var(--bg-card-inner);
  padding: 4px;
  border-radius: var(--radius-md);
}

.auth-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.95rem;
  padding: 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab-btn.active {
  background: var(--blue-electric);
  color: #fff;
  box-shadow: 0 0 10px var(--blue-glow);
}

.imc-badge-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card-inner);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 16px;
}

.imc-val-badge {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--green-emerald);
}

/* HOME */
.hero-user-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hero-info { flex: 1; }

.hero-greeting {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.hero-level-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 1px;
  color: var(--gold-primary);
  text-shadow: 0 0 12px var(--gold-glow);
}

.hero-rank-sub {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--blue-light);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.hero-char-container {
  width: 120px;
  height: 120px;
  position: relative;
  flex-shrink: 0;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-char-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(245, 158, 11, 0.4));
  transition: transform 0.3s ease;
  overflow: visible;
}

.hero-char-img:hover { transform: scale(1.08); }

/* Barra de XP */
.xp-bar-wrapper { margin-top: 10px; }

.xp-bar-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.xp-track {
  width: 100%;
  height: 14px;
  background: #091124;
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.6);
  position: relative;
}

.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #fef08a);
  border-radius: var(--radius-full);
  box-shadow: 0 0 12px #f59e0b;
  width: 40%;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  margin-top: 10px;
}

/* BANNER ENTRENAMIENTO DE HOY */
.today-workout-card {
  background: linear-gradient(145deg, rgba(26, 46, 88, 0.95), rgba(12, 22, 45, 0.95));
  border: 1px solid rgba(96, 165, 250, 0.4);
}

.today-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.day-badge {
  font-family: var(--font-display);
  background: var(--blue-electric);
  color: #fff;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  letter-spacing: 1px;
}

.today-meta {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.today-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 1px;
  margin-bottom: 8px;
  color: #fff;
}

.today-desc {
  font-size: 0.88rem;
  color: #cbd5e1;
  margin-bottom: 16px;
}

.exercise-quick-preview {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 16px;
}

.quick-ex-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card-inner);
  border: 1px solid var(--border-subtle);
  padding: 6px 10px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.quick-ex-item img {
  width: 22px;
  height: 22px;
}

/* BOTONES ARCADE */
.btn-arcade {
  width: 100%;
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 1.5px;
  padding: 16px 20px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 6px 0 #047857, 0 10px 20px rgba(16, 185, 129, 0.4);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-transform: uppercase;
}

.btn-arcade:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #047857, 0 4px 10px rgba(16, 185, 129, 0.4);
}

.btn-arcade.gold {
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 6px 0 #b45309, 0 10px 20px var(--gold-glow);
}
.btn-arcade.gold:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #b45309, 0 4px 10px var(--gold-glow);
}

.btn-arcade.blue {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: 0 6px 0 #1d4ed8, 0 10px 20px var(--blue-glow);
}
.btn-arcade.blue:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #1d4ed8, 0 4px 10px var(--blue-glow);
}

.btn-secondary {
  width: 100%;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-subtle);
  color: #e2e8f0;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.2s;
}

.btn-secondary:hover { background: rgba(255, 255, 255, 0.12); }

/* SESIÓN EN VIVO */
.active-workout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.back-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.active-ex-progress-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
}

.prog-step {
  flex: 1;
  height: 6px;
  background: #1e293b;
  border-radius: var(--radius-full);
  transition: background 0.3s;
}
.prog-step.completed { background: var(--green-emerald); }
.prog-step.active {
  background: var(--gold-primary);
  box-shadow: 0 0 8px var(--gold-primary);
}

.workout-exercise-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 20px;
  margin-bottom: 16px;
  text-align: center;
}

.exercise-media-wrapper {
  width: 90px;
  height: 90px;
  margin: 0 auto 12px auto;
  background: #091124;
  border-radius: var(--radius-lg);
  padding: 8px;
  border: 1px solid var(--border-subtle);
}

.exercise-media-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.workout-exercise-name {
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.workout-exercise-muscle {
  font-size: 0.82rem;
  color: var(--blue-light);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.block-badge-pill {
  display: inline-block;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: var(--gold-light);
  font-size: 0.85rem;
  font-weight: 800;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
}

.set-target-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: var(--bg-card-inner);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 20px;
}

.target-box-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.target-box-val {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: #fff;
}

.target-box-val span {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-sans);
}

.set-input-row {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.set-input-group {
  flex: 1;
  text-align: left;
}

.set-input-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

/* XP POPUP */
.xp-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-family: var(--font-display);
  font-size: 2rem;
  padding: 12px 28px;
  border-radius: var(--radius-full);
  box-shadow: 0 10px 30px rgba(245, 158, 11, 0.7);
  pointer-events: none;
  opacity: 0;
  z-index: 1000;
  letter-spacing: 2px;
}

.xp-popup.animate {
  animation: floatUpXp 1.2s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

@keyframes floatUpXp {
  0% { opacity: 0; transform: translate(-50%, 0) scale(0.6); }
  25% { opacity: 1; transform: translate(-50%, -40px) scale(1.15); }
  80% { opacity: 1; transform: translate(-50%, -60px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -90px) scale(0.8); }
}

/* PROGRAMACIÓN */
.program-selector-wrap { margin-bottom: 12px; }

.program-selector-select {
  width: 100%;
  background: linear-gradient(145deg, #132247, #0b152d);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--gold-light);
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.5px;
  padding: 12px 14px;
  outline: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.saiyan-intensity-bar {
  background: var(--bg-card);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.saiyan-intensity-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--gold-light);
  display: flex;
  align-items: center;
  gap: 4px;
}

.intensity-chips-row {
  display: flex;
  gap: 6px;
}

.intensity-chip {
  background: var(--bg-card-inner);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.8rem;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.intensity-chip.active {
  background: var(--gold-primary);
  border-color: #fde047;
  color: #000;
  box-shadow: 0 0 10px var(--gold-glow);
}

.prog-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  background: var(--bg-card);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.prog-nav-arrow {
  background: none;
  border: none;
  color: var(--gold-primary);
  font-size: 1.4rem;
  font-weight: bold;
  cursor: pointer;
  padding: 4px 10px;
}

.prog-nav-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 1px;
}

.prog-nav-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

.week-days-strip {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.day-strip-btn {
  flex: 1;
  min-width: 52px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 4px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-muted);
}

.day-strip-btn .day-label {
  font-family: var(--font-display);
  font-size: 0.95rem;
  display: block;
  margin-bottom: 4px;
}

.day-strip-btn .day-status-icon { font-size: 1rem; }

.day-strip-btn.selected {
  background: rgba(59, 130, 246, 0.25);
  border-color: var(--blue-electric);
  color: #fff;
  box-shadow: 0 0 14px var(--blue-glow);
}

.day-strip-btn.done {
  border-color: var(--green-emerald);
  color: var(--green-emerald);
}

.day-strip-btn.rest { border-style: dashed; }

/* REST DAY */
.rest-day-hero {
  background: radial-gradient(circle at 50% 20%, rgba(16, 185, 129, 0.15) 0%, rgba(11, 21, 45, 0.95) 80%);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-lg);
  padding: 22px 18px;
  text-align: center;
  margin-bottom: 18px;
}

.rest-icon-large {
  width: 70px;
  height: 70px;
  margin: 0 auto 12px auto;
  filter: drop-shadow(0 4px 12px rgba(16, 185, 129, 0.4));
}

.rest-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: #fff;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.rest-options-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
  text-align: left;
}

.rest-option-card {
  background: var(--bg-card-inner);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.rest-option-card:hover {
  border-color: var(--green-emerald);
  background: rgba(16, 185, 129, 0.08);
  transform: translateX(3px);
}

.rest-option-card.blue:hover {
  border-color: var(--blue-electric);
  background: rgba(59, 130, 246, 0.08);
}

.rest-opt-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.rest-opt-info h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 2px;
}

.rest-opt-info p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.rest-opt-badge {
  font-family: var(--font-display);
  font-size: 0.82rem;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

/* EXERCISE ITEM */
.program-exercise-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 14px;
}

.prog-ex-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.prog-ex-top img {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: #091124;
  padding: 4px;
}

.prog-ex-info h4 {
  font-size: 1.05rem;
  font-weight: 800;
}

.prog-ex-info span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

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

.block-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card-inner);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  border-left: 3px solid var(--blue-electric);
}

.block-row.warmup { border-left-color: #f59e0b; }
.block-row.heavy { border-left-color: #ef4444; }

.block-name-tag {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-muted);
}

.block-reps-tag {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: #fff;
}

.block-calc-weight { text-align: right; }

.block-calc-weight .weight-sugg {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--gold-light);
}

.block-calc-weight .pct-rm {
  font-size: 0.72rem;
  color: var(--text-dim);
  display: block;
}

/* TRANSFORMACIONES SAIYAJIN */
.saiyan-transformations-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
}

.saiyan-form-card {
  background: var(--bg-card-inner);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
}

.saiyan-form-card.locked {
  opacity: 0.45;
  filter: grayscale(80%);
  cursor: not-allowed;
}

.saiyan-form-card.active-form {
  border-color: var(--gold-primary);
  background: rgba(245, 158, 11, 0.12);
  box-shadow: 0 0 16px var(--gold-glow);
}

.saiyan-form-card[data-form="ssj"].active-form {
  border-color: #f59e0b;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.6);
}

.saiyan-form-card[data-form="god"].active-form {
  border-color: #ef4444;
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.6);
  background: rgba(239, 68, 68, 0.12);
}

.saiyan-form-card[data-form="blue"].active-form {
  border-color: #38bdf8;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.6);
  background: rgba(56, 189, 248, 0.12);
}

.saiyan-form-card[data-form="ultra"].active-form {
  border-color: #ffffff;
  box-shadow: 0 0 22px rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.15);
}

.saiyan-form-thumb {
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  object-fit: contain;
}

.saiyan-form-info { flex: 1; }

.saiyan-form-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.8px;
  color: #fff;
}

.saiyan-form-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.saiyan-lock-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: #1e293b;
  color: #94a3b8;
}

.saiyan-equipped-badge {
  font-family: var(--font-display);
  font-size: 0.8rem;
  background: var(--gold-primary);
  color: #000;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

/* PROGRESO */
.stats-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 8px;
  text-align: center;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--gold-primary);
  margin-bottom: 2px;
}

.stat-lbl {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
}

.pr-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 10px;
}

.pr-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pr-left img {
  width: 36px;
  height: 36px;
}

.pr-name {
  font-weight: 800;
  font-size: 0.92rem;
}

.pr-val {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--gold-light);
}

.history-item {
  background: var(--bg-card-inner);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 8px;
  border-left: 3px solid var(--blue-electric);
}

.history-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.history-sets-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hist-set-pill {
  background: #172554;
  color: #bfdbfe;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

/* LOGROS */
.mastery-hero-card {
  background: radial-gradient(circle at 50% 30%, rgba(245, 158, 11, 0.25) 0%, rgba(15, 23, 42, 0.95) 75%);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  text-align: center;
  margin-bottom: 18px;
  box-shadow: 0 10px 35px var(--gold-glow);
}

.mastery-shield-preview {
  width: 140px;
  height: 160px;
  margin: 0 auto 12px auto;
  filter: drop-shadow(0 8px 20px var(--gold-glow));
}

.mastery-current-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--gold-light);
  letter-spacing: 1.5px;
  margin-bottom: 4px;
}

.mastery-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 14px;
}

.badges-tier-strip {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-top: 16px;
}

.tier-badge-card {
  flex: 1;
  background: var(--bg-card-inner);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 4px;
  text-align: center;
  transition: all 0.2s;
  position: relative;
}

.tier-badge-card.unlocked { border-color: var(--gold-primary); }

.tier-badge-card.locked {
  opacity: 0.45;
  filter: grayscale(80%);
}

.tier-badge-img {
  width: 44px;
  height: 50px;
  margin: 0 auto 6px auto;
}

.tier-badge-name {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.5px;
  color: #fff;
  white-space: nowrap;
}

.tier-badge-kg {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 700;
}

.tier-badge-status-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green-emerald);
}

/* PERFIL */
.onboarding-avatar-bubble {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.speech-bubble {
  flex: 1;
  background: #1e3a8a;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  position: relative;
  box-shadow: 0 4px 14px var(--blue-glow);
}

.speech-bubble::before {
  content: '';
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 8px 0 8px 8px;
  border-style: solid;
  border-color: transparent transparent transparent #1e3a8a;
}

.bubble-char {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

.bubble-char img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.char-picker-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.char-choice-card {
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.char-choice-card.selected {
  border-color: var(--gold-primary);
  box-shadow: 0 0 16px var(--gold-glow);
  background: rgba(245, 158, 11, 0.12);
}

.char-choice-img {
  width: 70px;
  height: 70px;
  margin: 0 auto 8px auto;
}

.char-choice-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 1px;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.option-btn {
  background: var(--bg-card-inner);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 6px;
  color: var(--text-muted);
  font-weight: 800;
  font-size: 0.82rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.option-btn.selected {
  background: var(--blue-electric);
  border-color: #60a5fa;
  color: #fff;
  box-shadow: 0 0 12px var(--blue-glow);
}

.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.text-input {
  width: 100%;
  background: #091124;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: #fff;
  font-size: 1rem;
  outline: none;
}

.text-input:focus { border-color: var(--blue-electric); }

/* BOTTOM NAV */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
  background: rgba(7, 12, 26, 0.95);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  z-index: 50;
  padding: 6px 4px env(safe-area-inset-bottom, 0px) 4px;
  transition: transform 0.2s;
}

.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.2s, transform 0.2s;
  padding: 6px 0;
}

.nav-tab-icon {
  font-size: 1.35rem;
  margin-bottom: 2px;
}

.nav-tab-label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.8px;
}

.nav-tab.active {
  color: var(--gold-primary);
  transform: translateY(-2px);
}

.nav-tab.active .nav-tab-icon {
  filter: drop-shadow(0 0 8px var(--gold-primary));
}

/* MODAL CELEBRACIÓN */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.94);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
  animation: modalFadeIn 0.3s ease-out;
}

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

.unlock-modal-box {
  width: 100%;
  max-width: 360px;
  background: radial-gradient(circle at 50% 20%, #1e3a8a 0%, #0b1329 80%);
  border: 2px solid var(--gold-primary);
  border-radius: var(--radius-lg);
  padding: 30px 20px;
  text-align: center;
  box-shadow: 0 0 50px var(--gold-glow);
  position: relative;
  overflow: hidden;
  animation: badgePop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes badgePop {
  0% { transform: scale(0.4) rotate(-10deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.modal-badge-shield {
  width: 150px;
  height: 180px;
  margin: 0 auto 16px auto;
  filter: drop-shadow(0 0 25px var(--gold-glow));
  animation: pulseShield 2s infinite ease-in-out;
}

@keyframes pulseShield {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.modal-char-preview {
  width: 100px;
  height: 100px;
  margin: 0 auto 10px auto;
}

.modal-subtitle {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--blue-light);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--gold-light);
  letter-spacing: 1.5px;
  margin-bottom: 6px;
  text-shadow: 0 0 16px var(--gold-glow);
}

.modal-xp-pill {
  display: inline-block;
  background: var(--gold-primary);
  color: #000;
  font-family: var(--font-display);
  font-size: 1.2rem;
  padding: 4px 18px;
  border-radius: var(--radius-full);
  margin-bottom: 20px;
  letter-spacing: 1px;
}

.text-center { text-align: center; }
.mt-10 { margin-top: 10px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }

/* ==========================================================================
   STEPPER INPUT WRAPPER (- / +) Y ENTRADA NUMÉRICA CÓMODA
   Permite escribir libremente tocando el número o ajustar con + y -
   ========================================================================== */
.stepper-input-wrap {
  display: flex;
  align-items: center;
  background: rgba(8, 14, 30, 0.95);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.stepper-input-wrap:focus-within {
  border-color: var(--gold-primary);
  box-shadow: 0 0 12px var(--gold-glow);
}

.stepper-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--gold-light);
  font-family: var(--font-display);
  font-size: 1.45rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
  transition: background 0.1s, transform 0.08s;
}

.stepper-btn:active {
  background: var(--gold-primary);
  color: #000;
  transform: scale(0.92);
}

.stepper-input-wrap input {
  flex: 1;
  width: 100%;
  border: none !important;
  background: transparent !important;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: #ffffff;
  padding: 8px 4px;
  outline: none;
  box-shadow: none !important;
  user-select: text !important;
  -webkit-user-select: text !important;
  pointer-events: auto !important;
  cursor: text;
}

/* ==========================================================================
   VISTA AUTH / ONBOARDING ("CREA TU PERSONAJE" & "INICIAR SESIÓN")
   ========================================================================== */
.auth-hero-bubble {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(16, 26, 52, 0.9) 100%);
  border: 1px solid var(--gold-primary);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 18px;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.15);
}

.auth-hero-avatar {
  width: 72px;
  height: 72px;
  filter: drop-shadow(0 0 10px var(--gold-glow));
  flex-shrink: 0;
  animation: pulseShield 3s infinite ease-in-out;
}

.auth-speech-bubble {
  position: relative;
  background: rgba(7, 12, 26, 0.85);
  border: 1px solid var(--gold-light);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.84rem;
  color: var(--text-main);
  line-height: 1.35;
}

.auth-tabs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
  background: rgba(10, 18, 38, 0.7);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.auth-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.88rem;
  letter-spacing: 1px;
  padding: 10px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.auth-tab-btn.active {
  background: var(--gold-primary);
  color: #000;
  box-shadow: 0 0 14px var(--gold-glow);
}

.imc-badge-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(9, 16, 34, 0.95);
  border: 1px dashed var(--border-focus);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-top: 12px;
  margin-bottom: 12px;
}

.imc-val-display {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--gold-light);
}

.imc-status-pill {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.2);
  color: var(--green-emerald);
  border: 1px solid var(--green-emerald);
  text-transform: uppercase;
}

.choice-pill-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 6px;
}

.choice-pill-btn {
  background: rgba(16, 26, 52, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  padding: 10px 8px;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.choice-pill-btn.selected {
  background: rgba(59, 130, 246, 0.25);
  border-color: var(--blue-light);
  color: #fff;
  box-shadow: 0 0 10px var(--blue-glow);
}

.days-picker-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.day-circle-btn {
  flex: 1;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(16, 26, 52, 0.7);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.day-circle-btn.selected {
  background: var(--gold-primary);
  color: #000;
  border-color: var(--gold-light);
  box-shadow: 0 0 10px var(--gold-glow);
}

/* ==========================================================================
   KI-AURA-WRAPPER — ANIMACIONES DE ENERGÍA POR FORMA SAIYAJIN
   Los personajes "sacan energía" con auras y rayos al mostrar transformaciones
   La intensidad sube en cada forma: base < SSJ < God < Blue < Ultra
   ========================================================================== */

/* Contenedor base para todos los personajes con animación */
.ki-aura-wrapper {
  position: relative;
  display: inline-block;
}

.ki-aura-wrapper::before,
.ki-aura-wrapper::after {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s;
}

/* ----- FORMA BASE (sin aura, quieto) ----- */
.ki-aura-wrapper.form-base::before {
  background: radial-gradient(circle, rgba(248, 250, 252, 0.08) 0%, transparent 70%);
  animation: pulseBase 4s ease-in-out infinite;
  opacity: 1;
}

@keyframes pulseBase {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.03); opacity: 0.7; }
}

/* ----- SUPER SAIYAJIN — Aura Dorada Eléctrica ----- */
.ki-aura-wrapper.form-ssj {
  filter: drop-shadow(0 0 12px rgba(245, 158, 11, 0.7))
          drop-shadow(0 0 30px rgba(245, 158, 11, 0.4));
  animation: pulseSSJWrapper 2s ease-in-out infinite;
}

@keyframes pulseSSJWrapper {
  0%, 100% { filter: drop-shadow(0 0 12px rgba(245, 158, 11, 0.7)) drop-shadow(0 0 28px rgba(245, 158, 11, 0.35)); }
  50% { filter: drop-shadow(0 0 20px rgba(254, 240, 138, 1)) drop-shadow(0 0 45px rgba(245, 158, 11, 0.6)); }
}

.ki-aura-wrapper.form-ssj::before {
  background: radial-gradient(circle, rgba(254, 240, 138, 0.35) 0%, rgba(245, 158, 11, 0.15) 55%, transparent 75%);
  animation: flareSSJBefore 2s ease-in-out infinite;
  opacity: 1;
  inset: -20px;
}

@keyframes flareSSJBefore {
  0%, 100% { transform: scale(1); opacity: 0.75; }
  50% { transform: scale(1.12); opacity: 1; }
}

.ki-aura-wrapper.form-ssj::after {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 60%);
  animation: sparkSSJAfter 1.2s ease-in-out infinite alternate;
  opacity: 1;
  inset: -5px;
}

@keyframes sparkSSJAfter {
  0% { opacity: 0.3; transform: scale(0.9) rotate(-3deg); }
  100% { opacity: 0.8; transform: scale(1.08) rotate(3deg); }
}

/* ----- SUPER SAIYAJIN DIOS — Aura Carmesí Divina ----- */
.ki-aura-wrapper.form-god {
  filter: drop-shadow(0 0 14px rgba(220, 38, 38, 0.9))
          drop-shadow(0 0 35px rgba(239, 68, 68, 0.5));
  animation: pulseGodWrapper 1.8s ease-in-out infinite;
}

@keyframes pulseGodWrapper {
  0%, 100% { filter: drop-shadow(0 0 14px rgba(220, 38, 38, 0.8)) drop-shadow(0 0 32px rgba(239, 68, 68, 0.4)); }
  50% { filter: drop-shadow(0 0 24px rgba(254, 240, 138, 0.9)) drop-shadow(0 0 55px rgba(239, 68, 68, 0.7)); }
}

.ki-aura-wrapper.form-god::before {
  background: radial-gradient(circle, rgba(254, 165, 165, 0.4) 0%, rgba(220, 38, 38, 0.2) 50%, transparent 75%);
  animation: flareGodBefore 1.8s ease-in-out infinite;
  opacity: 1;
  inset: -25px;
}

@keyframes flareGodBefore {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.16); opacity: 1; }
}

.ki-aura-wrapper.form-god::after {
  background: radial-gradient(circle, rgba(249, 115, 22, 0.25) 0%, transparent 65%);
  animation: sparkGodAfter 1s ease-in-out infinite alternate;
  opacity: 1;
  inset: -8px;
}

@keyframes sparkGodAfter {
  0% { opacity: 0.35; transform: scale(0.88) rotate(-5deg); }
  100% { opacity: 0.9; transform: scale(1.12) rotate(5deg); }
}

/* ----- SUPER SAIYAJIN BLUE — Aura Eléctrica Azul Divina ----- */
.ki-aura-wrapper.form-blue {
  filter: drop-shadow(0 0 16px rgba(2, 132, 199, 0.95))
          drop-shadow(0 0 38px rgba(56, 189, 248, 0.55));
  animation: pulseBlueWrapper 1.7s ease-in-out infinite;
}

@keyframes pulseBlueWrapper {
  0%, 100% { filter: drop-shadow(0 0 16px rgba(2, 132, 199, 0.8)) drop-shadow(0 0 35px rgba(56, 189, 248, 0.4)); }
  50% { filter: drop-shadow(0 0 28px rgba(255, 255, 255, 0.95)) drop-shadow(0 0 60px rgba(56, 189, 248, 0.8)); }
}

.ki-aura-wrapper.form-blue::before {
  background: radial-gradient(circle, rgba(186, 230, 253, 0.45) 0%, rgba(56, 189, 248, 0.22) 50%, transparent 75%);
  animation: flameBlueBefore 1.7s ease-in-out infinite;
  opacity: 1;
  inset: -28px;
}

@keyframes flameBlueBefore {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.18); opacity: 1; }
}

.ki-aura-wrapper.form-blue::after {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 60%);
  animation: sparkBlueAfter 0.85s ease-in-out infinite alternate;
  opacity: 1;
  inset: -6px;
}

@keyframes sparkBlueAfter {
  0% { opacity: 0.4; transform: scale(0.88) rotate(-6deg); }
  100% { opacity: 0.95; transform: scale(1.14) rotate(6deg); }
}

/* ----- ULTRA INSTINTO — Aura Divina Blanca/Plata (Máxima Intensidad) ----- */
.ki-aura-wrapper.form-ultra {
  filter: drop-shadow(0 0 20px rgba(255, 255, 255, 1))
          drop-shadow(0 0 45px rgba(147, 197, 253, 0.8))
          drop-shadow(0 0 80px rgba(168, 85, 247, 0.35));
  animation: pulseUltraWrapper 1.5s ease-in-out infinite;
}

@keyframes pulseUltraWrapper {
  0%, 100% {
    filter: drop-shadow(0 0 20px rgba(255,255,255,0.9))
            drop-shadow(0 0 42px rgba(147,197,253,0.7))
            drop-shadow(0 0 72px rgba(168,85,247,0.3));
  }
  50% {
    filter: drop-shadow(0 0 32px rgba(255,255,255,1))
            drop-shadow(0 0 70px rgba(147,197,253,1))
            drop-shadow(0 0 110px rgba(168,85,247,0.6));
  }
}

.ki-aura-wrapper.form-ultra::before {
  background: radial-gradient(circle,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(224, 242, 254, 0.3) 40%,
    rgba(147, 197, 253, 0.15) 65%,
    transparent 80%);
  animation: flameUltraBefore 1.5s ease-in-out infinite;
  opacity: 1;
  inset: -35px;
}

@keyframes flameUltraBefore {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.85; }
  33% { transform: scale(1.1) rotate(1deg); opacity: 1; }
  66% { transform: scale(1.2) rotate(-1deg); opacity: 0.9; }
}

.ki-aura-wrapper.form-ultra::after {
  background: radial-gradient(circle, rgba(168, 85, 247, 0.18) 0%, transparent 65%);
  animation: sparkUltraAfter 0.75s ease-in-out infinite alternate;
  opacity: 1;
  inset: -12px;
}

@keyframes sparkUltraAfter {
  0% { opacity: 0.4; transform: scale(0.85) rotate(-8deg); }
  100% { opacity: 1; transform: scale(1.18) rotate(8deg); }
}

/* Flotación universal del personaje (float up and down gently) */
.ki-aura-wrapper {
  animation: characterFloat 3s ease-in-out infinite;
}

@keyframes characterFloat {
  0%, 100% { transform: translateY(0px) scale(1); }
  50% { transform: translateY(-3px) scale(1.015); }
}

/* Mantener la flotación también con las formas SSJ activas */
.ki-aura-wrapper.form-ssj,
.ki-aura-wrapper.form-god,
.ki-aura-wrapper.form-blue,
.ki-aura-wrapper.form-ultra {
  animation: characterFloat 2.8s ease-in-out infinite,
             pulseSSJWrapper 2s ease-in-out infinite;
}

.ki-aura-wrapper.form-god {
  animation: characterFloat 2.5s ease-in-out infinite,
             pulseGodWrapper 1.8s ease-in-out infinite;
}

.ki-aura-wrapper.form-blue {
  animation: characterFloat 2.3s ease-in-out infinite,
             pulseBlueWrapper 1.7s ease-in-out infinite;
}

.ki-aura-wrapper.form-ultra {
  animation: characterFloat 2s ease-in-out infinite,
             pulseUltraWrapper 1.5s ease-in-out infinite;
}

/* ==========================================================================
   ESCUDOS 3D ESTILO LEAGUE OF LEGENDS CON GIRO DE 360 GRADOS
   ========================================================================== */
.shield-3d-stage {
  perspective: 1000px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  margin: 8px auto 6px auto;
  width: 210px;
  height: 245px;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
}

.shield-3d-card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Giro continuo 360 grados */
.shield-3d-card.spinning-auto {
  animation: rotate360Continuous 8s linear infinite;
}

/* Giro por toque/click rápido 360 grados */
.shield-3d-card.spin-tap {
  animation: rotate360Tap 1.1s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

@keyframes rotate360Continuous {
  0% { transform: rotateY(0deg); }
  100% { transform: rotateY(360deg); }
}

@keyframes rotate360Tap {
  0% { transform: rotateY(0deg) scale(1); }
  50% { transform: rotateY(180deg) scale(1.14); }
  100% { transform: rotateY(360deg) scale(1); }
}

.mastery-shield-preview {
  width: 190px;
  height: 225px;
  filter: drop-shadow(0 0 20px rgba(56, 189, 248, 0.4));
  pointer-events: none;
  object-fit: contain;
}

/* Fila de controles de giro del escudo */
.shield-controls-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}

.shield-spin-btn {
  background: rgba(16, 26, 52, 0.85);
  border: 1px solid var(--border-focus);
  color: var(--gold-light);
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}

.shield-spin-btn:active,
.shield-spin-btn.active {
  background: var(--gold-primary);
  color: #000;
  border-color: #fff;
  box-shadow: 0 0 12px var(--gold-glow);
}

/* ==========================================================================
   POPUP Y MODAL ARCADE SAIYAJIN (REEMPLAZO DE ALERTS Y CONFIRMS DEL NAVEGADOR)
   ========================================================================== */
.arcade-dialog-box {
  width: 100%;
  max-width: 350px;
  background: radial-gradient(circle at 50% 15%, #172a54 0%, #091024 75%, #050814 100%);
  border: 2px solid var(--gold-primary);
  border-radius: var(--radius-lg);
  padding: 24px 20px 20px 20px;
  text-align: center;
  box-shadow: 0 0 45px rgba(245, 158, 11, 0.4), 0 20px 40px rgba(0, 0, 0, 0.9);
  position: relative;
  overflow: hidden;
  animation: dialogPopIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes dialogPopIn {
  0% { transform: scale(0.65); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.arcade-dialog-glow-aura {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.35) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.arcade-dialog-avatar-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto 12px auto;
}

.arcade-dialog-avatar {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 12px var(--gold-glow));
}

.arcade-dialog-icon-pill {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--gold-primary);
  color: #000;
  font-size: 0.9rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #070c1a;
  box-shadow: 0 0 8px var(--gold-glow);
}

.arcade-dialog-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--blue-light);
  text-transform: uppercase;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.4);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 8px;
}

.arcade-dialog-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--gold-light);
  letter-spacing: 1px;
  margin-bottom: 8px;
  line-height: 1.2;
  text-shadow: 0 0 12px var(--gold-glow);
}

.arcade-dialog-msg {
  font-size: 0.88rem;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 20px;
  padding: 0 6px;
}

.arcade-dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.arcade-dialog-actions button {
  flex: 1;
  padding: 12px 10px;
  font-size: 0.92rem;
}

