/* ============================================================
   ACADEMIA DE CRACKS · Phone Frame (desktop) & Screen System
   ============================================================ */

/* Desktop stage: centers the phone */
.desktop-stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  z-index: 2;
}
.desktop-info {
  position: absolute;
  top: 32px; left: 32px;
  max-width: 320px;
  z-index: 3;
}
.desktop-info .tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--neon);
  color: var(--carbon);
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 100px;
  margin-bottom: 14px;
}
.desktop-info h2 { font-size: 28px; line-height: 1.05; margin-bottom: 12px; font-weight: 700; }
.desktop-info h2 span { color: var(--neon); }
.desktop-info p { font-size: 13px; color: var(--smoke-dim); line-height: 1.5; }
.desktop-info .hint {
  margin-top: 18px;
  padding: 12px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  font-size: 12px;
  color: var(--smoke-2);
  line-height: 1.5;
}
.desktop-info .hint b { color: var(--neon); }

/* Phone frame */
.phone {
  width: 390px;
  height: 844px;
  background: var(--carbon);
  border-radius: 56px;
  border: 12px solid #1a1a1a;
  box-shadow:
    0 0 0 2px #2a2a2a,
    0 60px 120px -20px rgba(0, 0, 0, 0.8),
    0 0 80px -20px rgba(30, 155, 255, 0.1);
  overflow: hidden;
  position: relative;
  z-index: 2;
}
/* Dynamic island / notch */
.phone::before {
  content: '';
  position: absolute;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  width: 110px; height: 30px;
  background: #000;
  border-radius: 100px;
  z-index: 100;
}

/* On narrow screens: remove frame, fill viewport */
@media (max-width: 880px) {
  .desktop-stage { padding: 0; min-height: 100vh; }
  .desktop-info { display: none; }
  .phone {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    border: 0;
    box-shadow: none;
  }
  .phone::before { display: none; }
}

/* ---- Screen System ----
   Regla canónica: una sola pantalla visible a la vez. La pantalla con
   .active aplica `display: flex`; el resto, `display: none`.
   La regla `.screen:not(.active)` de abajo es belt-and-suspenders:
   bloquea el bug clase "wrapper declara display directo" — pasó en
   iter 4 fase A con `.auth-screen { display: flex }` que pisaba el
   `display: none` base y mostraba todas las screens apiladas en boot.
   No quitar el :not(.active) sin entender este caso. */
.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  overflow: hidden;
  padding-top: 56px; /* notch space */
  /* min-height: 0 evita que el flex item .scroll empuje al .tabbar fuera
     del viewport cuando el contenido es más alto que la pantalla. Sin esto
     el flex item asume min-height: auto (= contenido) y rompe la columna. */
  min-height: 0;
}
.screen:not(.active) { display: none; }
.screen.active {
  display: flex;
  animation: screenIn 0.45s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes screenIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Bottom Tab Bar ---- */
.tabbar {
  flex-shrink: 0;
  display: flex;
  background: rgba(5, 5, 5, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--glass-border);
  /* padding-bottom respeta el home indicator de iPhone (safe-area). */
  padding: 8px 8px max(18px, env(safe-area-inset-bottom, 18px));
  position: relative;
  z-index: 20;
}
.tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--smoke-dim);
  cursor: pointer;
  padding: 8px 2px 4px;
  display: flex; flex-direction: column; align-items: center;
  gap: 4px;
  transition: color 0.2s;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-width: 0;
}
.tab span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--neon); }

/* ---- Launch splash (iter29): presencia de marca al abrir la app ---- */
.launch-splash {
  position: absolute;
  inset: 0;
  z-index: 9999;
  background:
    radial-gradient(ellipse at 50% 38%, rgba(30,155,255,0.18), transparent 60%),
    var(--carbon, #05080F);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  opacity: 1;
  transition: opacity 0.5s ease;
}
.launch-splash.hide { opacity: 0; pointer-events: none; }
.launch-splash .ls-mark {
  width: 124px; height: 124px;
  filter: drop-shadow(0 6px 30px var(--azul-glow, rgba(30,155,255,0.5)));
  animation: lsPop 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}
@keyframes lsPop {
  0%   { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}
.launch-splash .ls-word {
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.04em;
  color: var(--smoke, #f4f8ff);
  text-align: center;
  line-height: 1.1;
}
.launch-splash .ls-word span {
  display: block;
  font-size: 16px;
  color: var(--azul-bright, #54d6ff);
  margin-top: 2px;
}
.tab.center { position: relative; }
.tab.center .center-button {
  width: 56px; height: 56px;
  background: var(--neon);
  color: var(--carbon);
  border-radius: 50%;
  display: grid; place-items: center;
  margin-top: -22px;
  box-shadow: 0 8px 24px -4px var(--neon-glow);
}
.tab.center .center-button svg { width: 24px; height: 24px; }
.tab.center span { color: var(--neon); margin-top: 2px; }

/* ---- Tabbar responsive: viewports muy chicos (iPhone SE, S Ultra rotado, etc.) ---- */
@media (max-width: 380px) {
  .tabbar { padding-left: 4px; padding-right: 4px; }
  .tab { font-size: 8px; padding: 8px 1px 4px; gap: 3px; }
  .tab svg { width: 19px; height: 19px; }
  .tab.center .center-button { width: 48px; height: 48px; margin-top: -18px; }
  .tab.center .center-button svg { width: 22px; height: 22px; }
}
