/* ==========================================================================
   NeuroKids (Estilo Mattel / Fisher-Price) - Layout, Fondo Cielo y Navegación
   ========================================================================== */

.app-shell {
  width: 100%;
  max-width: 480px;
  height: 100dvh;
  background: var(--bg-sky);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-app);
}

/* Fondo Ilustrado Decorativo (Nubes, Estrellas y Destellos Flotantes) */
.sky-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.sky-cloud {
  position: absolute;
  opacity: 0.88;
  filter: drop-shadow(0 4px 6px rgba(14, 165, 233, 0.12));
  animation: cloudDrift 18s ease-in-out infinite alternate;
}

.sky-cloud.c1 { top: 68px; left: -18px; width: 115px; animation-duration: 16s; }
.sky-cloud.c2 { top: 150px; right: -22px; width: 130px; animation-duration: 21s; animation-delay: -5s; }
.sky-cloud.c3 { bottom: 135px; left: 10px; width: 95px; opacity: 0.72; animation-duration: 24s; animation-delay: -9s; }

@keyframes cloudDrift {
  0% { transform: translateX(0px) translateY(0px); }
  100% { transform: translateX(22px) translateY(-6px); }
}

.sky-star {
  position: absolute;
  animation: starTwinkle 2.8s ease-in-out infinite alternate;
}

.sky-star.s1 { top: 90px; right: 44px; width: 24px; animation-delay: 0s; }
.sky-star.s2 { top: 270px; left: 14px; width: 20px; animation-delay: 0.9s; }
.sky-star.s3 { bottom: 210px; right: 20px; width: 26px; animation-delay: 1.5s; }
.sky-star.s4 { top: 430px; right: 10px; width: 18px; animation-delay: 0.4s; }

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

/* Cabecera Superior estilo Juguete Brillante */
.app-header {
  padding: calc(10px + var(--safe-top)) 14px 12px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 4px solid var(--toy-yellow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  z-index: 15;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.12);
}

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

/* Logo con volumen de juguete bilateral (Dracky Bebé 3D) */
.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, #38bdf8 0%, #8b5cf6 52%, #ec4899 100%);
  padding: 2px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 0 #6d28d9, 0 6px 14px rgba(139, 92, 246, 0.35);
  overflow: hidden;
  cursor: pointer;
  animation: gentleFloat 3s ease-in-out infinite alternate;
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 13px;
  display: block;
}

@keyframes gentleFloat {
  0% { transform: translateY(0px) rotate(-2deg); }
  100% { transform: translateY(-3px) rotate(3deg); }
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-text h1 {
  font-size: 19px;
  font-weight: 900;
  line-height: 1.1;
  background: linear-gradient(135deg, #0284c7 0%, #7c3aed 55%, #db2777 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.4px;
}

.brand-text span {
  font-size: 10px;
  color: var(--toy-blue);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Chip de Perfil Infantil estilo Placa de Juguete */
.profile-chip-btn {
  background: #ffffff;
  border: 3px solid var(--toy-blue-bright);
  padding: 4px 10px 4px 5px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--toy-blue-bevel);
  transition: all 0.12s ease;
}

.profile-chip-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--toy-blue-bevel);
}

.profile-chip-avatar {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  background: var(--toy-yellow-soft);
  border: 2px solid var(--toy-yellow);
  display: grid;
  place-items: center;
  font-size: 17px;
}

.profile-chip-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
  text-align: left;
}

.profile-chip-name {
  font-size: 12px;
  font-weight: 900;
  color: var(--toy-blue-bevel);
  max-width: 70px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-chip-age {
  font-size: 9.5px;
  font-weight: 800;
  color: var(--muted);
}

/* Moneda / Medalla de Puntos */
.streak-pill {
  background: linear-gradient(180deg, #fef08a 0%, #facc15 100%);
  color: #713f12;
  padding: 7px 12px;
  border-radius: var(--radius-full);
  font-size: 12.5px;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 4px;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 0 var(--toy-yellow-bevel), 0 5px 10px rgba(202, 138, 4, 0.3);
  white-space: nowrap;
  animation: pulseGold 2.4s infinite ease-in-out;
}

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

/* Área Principal Scrollable SIN barra gris fea */
.app-main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 14px calc(86px + var(--safe-bottom));
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  position: relative;
  z-index: 2;
  scrollbar-width: none; /* Firefox */
}

.app-main::-webkit-scrollbar {
  display: none; /* Chrome / Edge / Safari */
}

.tab-view {
  display: none;
  animation: popIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

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

/* Barra de Navegación Inferior estilo Consola Fisher-Price */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-top: 4px solid var(--toy-blue-bright);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px 10px calc(8px + var(--safe-bottom));
  z-index: 20;
  box-shadow: 0 -6px 18px rgba(2, 132, 199, 0.14);
}

.nav-btn {
  background: transparent;
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  padding: 6px 4px;
  border-radius: 16px;
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-btn:active {
  transform: scale(0.9);
}

.nav-btn.active {
  background: var(--toy-yellow-soft);
  border-color: var(--toy-yellow);
  color: #854d0e;
  box-shadow: 0 3px 0 var(--toy-yellow-bevel);
  transform: translateY(-3px);
}

.nav-btn span.ico {
  font-size: 24px;
  line-height: 1;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-btn.active span.ico {
  transform: scale(1.16);
}

.nav-btn span.label {
  font-size: 11px;
  letter-spacing: -0.2px;
}
