/* ===== Mementum ===== */
:root {
  --fondo: #0e1420;
  --fondo-2: #141d2e;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-borde: rgba(255, 255, 255, 0.09);
  --texto: #e8ecf4;
  --texto-suave: #9aa7bd;
  --acento: #8ab4f8;
  --acento-2: #b79ced;
  --dorado: #e6c98a;
  --verde: #9ad0b0;
  --radio: 18px;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background:
    radial-gradient(1100px 600px at 80% -10%, rgba(122, 90, 190, 0.22), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(60, 110, 180, 0.18), transparent 60%),
    linear-gradient(180deg, var(--fondo), var(--fondo-2));
  color: var(--texto);
  min-height: 100vh;
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Cielo estrellado completo (canvas) */
.cielo { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }

/* ===== Barra superior ===== */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 48px);
  backdrop-filter: blur(14px);
  background: rgba(14, 20, 32, 0.65);
  border-bottom: 1px solid var(--panel-borde);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  background: none; border: none; cursor: pointer; color: var(--texto);
}
.brand-mark { font-size: 1.3rem; color: var(--dorado); }
.brand-name {
  font-family: var(--serif); font-size: 1.45rem; font-weight: 500;
  letter-spacing: 0.04em;
}
.cuenta {
  display: flex; align-items: center; gap: 8px;
  background: rgba(138,180,248,.12); border: 1px solid rgba(138,180,248,.4);
  color: var(--texto); border-radius: 999px; padding: 7px 16px;
  font-family: var(--sans); font-size: 0.84rem; cursor: pointer;
  transition: all .25s; order: 3;
}
.cuenta:hover { background: rgba(138,180,248,.25); box-shadow: 0 0 18px rgba(138,180,248,.25); }
.cuenta img { width: 24px; height: 24px; border-radius: 50%; }
.nav { display: flex; gap: 4px; }
.nav button {
  background: none; border: none; cursor: pointer;
  color: var(--texto-suave); font-family: var(--sans); font-size: 0.88rem;
  padding: 8px 14px; border-radius: 999px; transition: all .25s;
}
.nav button:hover, .nav button.active { color: var(--texto); background: var(--panel); }

/* ===== Vistas ===== */
main { position: relative; z-index: 1; max-width: 980px; margin: 0 auto; padding: clamp(24px, 5vw, 56px) clamp(16px, 4vw, 32px) 80px; }
.view { display: none; }
.view.active { display: block; }
@keyframes aparecer { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Viaje entre vistas: solo transform + opacity (fluido en GPU) */
.view.saliendo, .view.active.entrando { will-change: transform, opacity; }
.view.saliendo {
  animation: salidaCosmos .75s cubic-bezier(.4, 0, .6, 1) both;
  pointer-events: none;
}
/* Ida: atraviesas el menú hacia adelante, sin prisa */
@keyframes salidaCosmos {
  to { opacity: 0; transform: scale(1.16); }
}
.view.active.entrando {
  animation: entradaCosmos 1.6s cubic-bezier(.25, .6, .35, 1) both;
}
/* La actividad llega flotando, respira a medias y se asienta */
@keyframes entradaCosmos {
  0% { opacity: 0; transform: scale(.72) translateY(34px); }
  45% { opacity: 1; transform: scale(1.022) translateY(-3px); }
  70% { transform: scale(.992) translateY(0); }
  100% { opacity: 1; transform: none; }
}
/* Regreso: te alejas — todo se contrae en lugar de avanzar */
body.nav-atras .view.saliendo { animation-name: salidaRetro; }
body.nav-atras .view.active.entrando { animation-name: entradaRetro; }
@keyframes salidaRetro {
  to { opacity: 0; transform: scale(.82); }
}
@keyframes entradaRetro {
  0% { opacity: 0; transform: scale(1.2); }
  50% { opacity: 1; transform: scale(.988); }
  72% { transform: scale(1.005); }
  100% { transform: none; }
}

/* Modo inmersivo: la actividad ocupa todo, la barra se retira */
.topbar { transition: transform .5s ease, opacity .5s ease; }
body.inmersivo .topbar { transform: translateY(-110%); opacity: 0; pointer-events: none; }
body.inmersivo main { padding-top: clamp(60px, 8vw, 80px); }
.volver {
  position: fixed; top: 14px; left: 14px; z-index: 30;
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(20, 28, 46, .7); backdrop-filter: blur(12px);
  border: 1px solid rgba(138,180,248,.4); color: var(--texto);
  font-size: 1.25rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateX(-60px) rotate(-180deg); pointer-events: none;
  transition: all .5s cubic-bezier(.16, .8, .3, 1);
  box-shadow: 0 0 24px rgba(138,180,248,.15);
}
body.inmersivo .volver { opacity: 1; transform: none; pointer-events: auto; }
.volver:hover { background: rgba(138,180,248,.25); box-shadow: 0 0 32px rgba(138,180,248,.4); }

.view-head { text-align: center; margin-bottom: 34px; }
.view-head h1, .hero h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(2.1rem, 5vw, 3.2rem); line-height: 1.15;
}
.view-head h1 {
  background: linear-gradient(115deg, #e8ecf4, var(--acento), var(--acento-2), var(--dorado), #e8ecf4);
  background-size: 320% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: fluir 10s ease-in-out infinite;
  filter: drop-shadow(0 0 22px rgba(138,180,248,.25));
}
.view-head p { color: var(--texto-suave); margin-top: 8px; max-width: 520px; margin-inline: auto; }

/* ===== Home ===== */
.hero { text-align: center; padding: clamp(20px, 6vw, 60px) 0 44px; }
.hero-kicker {
  text-transform: uppercase; letter-spacing: 0.28em; font-size: 0.75rem;
  color: var(--dorado); margin-bottom: 14px;
}
.hero h1 em {
  font-style: italic;
  background: linear-gradient(120deg, var(--acento), var(--acento-2), var(--dorado), var(--acento));
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: fluir 8s ease-in-out infinite;
}
@keyframes fluir { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.hero-sub { color: var(--texto-suave); margin-top: 14px; }
.hero-quote { margin-top: 34px; }
.hero-quote p { font-family: var(--serif); font-size: 1.25rem; font-style: italic; color: var(--texto); opacity: .9; }
.hero-quote cite { display: block; margin-top: 6px; font-style: normal; font-size: .82rem; color: var(--texto-suave); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.card {
  text-align: left; cursor: pointer; color: var(--texto);
  background: var(--panel); border: 1px solid var(--panel-borde);
  border-radius: var(--radio); padding: 26px 22px;
  transition: transform .3s, border-color .3s, background .3s;
  font-family: var(--sans);
}
.card { position: relative; overflow: hidden; }
.card::before {
  content: ""; position: absolute; inset: -60%;
  background: radial-gradient(circle at 30% 20%, rgba(138,180,248,.14), transparent 45%),
              radial-gradient(circle at 75% 80%, rgba(183,156,237,.14), transparent 45%);
  opacity: 0; transition: opacity .5s; pointer-events: none;
  animation: girar 14s linear infinite;
}
.card:hover::before { opacity: 1; }
@keyframes girar { to { transform: rotate(360deg); } }
.card:hover {
  transform: translateY(-6px) scale(1.015);
  border-color: rgba(138,180,248,.45);
  background: rgba(255,255,255,.08);
  box-shadow: 0 16px 50px rgba(100,120,220,.28), 0 0 40px rgba(183,156,237,.18);
}

/* Ilustración de fondo por actividad */
.card::after {
  content: ""; position: absolute; right: -18px; bottom: -18px;
  width: 150px; height: 150px; pointer-events: none;
  background: center / contain no-repeat;
  opacity: .38; transition: opacity .5s, transform .5s;
  animation: flotar 7s ease-in-out infinite;
}
.card:hover::after { opacity: .75; transform: scale(1.06) rotate(-2deg); }
@keyframes flotar { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.card:nth-child(2)::after { animation-delay: -1.2s; }
.card:nth-child(3)::after { animation-delay: -2.4s; }
.card:nth-child(4)::after { animation-delay: -3.6s; }
.card:nth-child(5)::after { animation-delay: -1.8s; }
.card:nth-child(6)::after { animation-delay: -3s; }
.card-gratitud::after { background-image: url("img/gratitud.svg"); }
.card-afirmaciones::after { background-image: url("img/afirmaciones.svg"); }
.card-meditacion::after { background-image: url("img/meditacion.svg"); }
.card-respiracion::after { background-image: url("img/respiracion.svg"); }
.card-lucido::after { background-image: url("img/lucido.svg"); }
.card-dormir::after { background-image: url("img/dormir.svg"); }
.card-grabovoi::after { background-image: url("img/grabovoi.svg"); }
.card:nth-child(7)::after { animation-delay: -4.2s; }
.card-grabovoi .card-cta { color: var(--dorado); }
.card h2, .card p, .card .card-cta { position: relative; z-index: 1; }
.card { min-height: 170px; padding-right: 90px; }
.card h2 { font-family: var(--serif); font-weight: 500; font-size: 1.4rem; margin-bottom: 6px; }
.card p { font-size: 0.86rem; color: var(--texto-suave); font-weight: 300; }
.card-cta { display: inline-block; margin-top: 14px; font-size: 0.82rem; color: var(--acento); }
.card-gratitud .card-cta { color: var(--verde); }
.card-afirmaciones .card-cta { color: var(--dorado); }
.card-respiracion .card-cta { color: var(--acento-2); }

/* ===== Paneles y formularios ===== */
.panel {
  background: var(--panel); border: 1px solid var(--panel-borde);
  border-radius: var(--radio); padding: 22px;
}
.panel-label { display: block; font-family: var(--serif); font-size: 1.25rem; margin-bottom: 10px; }
textarea {
  width: 100%; resize: vertical; border-radius: 12px;
  background: rgba(0,0,0,.25); border: 1px solid var(--panel-borde);
  color: var(--texto); font-family: var(--sans); font-weight: 300;
  font-size: 0.95rem; padding: 12px 14px; outline: none; transition: border-color .25s;
}
textarea:focus { border-color: var(--acento); }
.panel-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.panel-actions.center { justify-content: center; margin-top: 22px; }

.btn {
  cursor: pointer; border-radius: 999px; font-family: var(--sans);
  font-size: 0.9rem; font-weight: 500; padding: 10px 22px;
  transition: all .25s; border: 1px solid transparent;
}
.btn-primary { background: var(--acento); color: #0b1220; }
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-ghost { background: none; border-color: var(--panel-borde); color: var(--texto-suave); }
.btn-ghost:hover { color: var(--texto); border-color: rgba(255,255,255,.25); }
.btn-lg { padding: 13px 34px; font-size: 1rem; }

.racha { font-size: 0.82rem; color: var(--dorado); }

/* Entradas (gratitud / favoritas) */
.entradas { margin-top: 26px; display: flex; flex-direction: column; gap: 10px; }
.entrada {
  background: var(--panel); border: 1px solid var(--panel-borde);
  border-radius: 14px; padding: 14px 18px;
  display: flex; justify-content: space-between; gap: 14px; align-items: flex-start;
  animation: aparecer .35s ease both;
}
.entrada-fecha { font-size: 0.72rem; color: var(--texto-suave); text-transform: uppercase; letter-spacing: .08em; display: block; margin-bottom: 4px; }
.entrada p.txt { font-size: 0.94rem; white-space: pre-wrap; }
.entrada button {
  background: none; border: none; color: var(--texto-suave); cursor: pointer;
  font-size: 0.9rem; padding: 4px; border-radius: 8px; flex-shrink: 0;
}
.entrada button:hover { color: #e08a8a; }

/* ===== Chips ===== */
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 26px; }
.chip {
  cursor: pointer; border-radius: 999px; padding: 8px 18px;
  background: none; border: 1px solid var(--panel-borde);
  color: var(--texto-suave); font-family: var(--sans); font-size: 0.86rem; transition: all .25s;
}
.chip:hover { color: var(--texto); }
.chip.active { background: var(--acento); border-color: var(--acento); color: #0b1220; font-weight: 500; }
.chips.deshabilitado { opacity: .4; pointer-events: none; }
.btn:disabled { opacity: .55; cursor: default; transform: none; }

/* ===== Afirmaciones ===== */
.afirmacion-card { text-align: center; padding: clamp(36px, 7vw, 64px) 28px; }
.afirmacion-card p {
  font-family: var(--serif); font-size: clamp(1.5rem, 3.6vw, 2.1rem);
  font-style: italic; line-height: 1.4; transition: opacity .3s;
}
.afirmacion-card p.cambiando { opacity: 0; }

/* ===== Meditación ===== */
.medita-stage { display: flex; justify-content: center; margin: 10px 0 20px; }
.anillo { position: relative; width: min(280px, 70vw); }
.anillo svg { width: 100%; transform: rotate(-90deg); }
.anillo-fondo { fill: none; stroke: rgba(255,255,255,.08); stroke-width: 5; }
.anillo-progreso {
  fill: none; stroke: var(--acento); stroke-width: 5; stroke-linecap: round;
  stroke-dasharray: 565.48; stroke-dashoffset: 565.48;
  transition: stroke-dashoffset 1s linear;
}
.anillo-centro {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
}
.anillo-centro > span:first-child { font-size: clamp(2.2rem, 6vw, 3rem); font-weight: 200; font-variant-numeric: tabular-nums; }
.anillo-sub { font-size: 0.8rem; text-transform: uppercase; letter-spacing: .2em; color: var(--texto-suave); }

.toggle { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--texto-suave); font-size: 0.88rem; cursor: pointer; }
.toggle input { accent-color: var(--acento); width: 16px; height: 16px; cursor: pointer; }

.nota { text-align: center; color: var(--texto-suave); font-size: 0.88rem; max-width: 480px; margin: 26px auto 0; }

/* ===== Respiración ===== */
.tecnicas { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.tecnica {
  text-align: left; cursor: pointer; color: var(--texto);
  background: var(--panel); border: 1px solid var(--panel-borde);
  border-radius: var(--radio); padding: 20px; font-family: var(--sans);
  transition: transform .3s, border-color .3s;
}
.tecnica:hover { transform: translateY(-3px); border-color: rgba(255,255,255,.22); }
.tecnica h3 { font-family: var(--serif); font-weight: 500; font-size: 1.25rem; }
.tecnica .patron { font-size: 0.78rem; color: var(--acento-2); letter-spacing: .06em; margin: 4px 0 8px; }
.tecnica p.desc { font-size: 0.84rem; color: var(--texto-suave); font-weight: 300; }
.tecnica .uso { display: inline-block; margin-top: 10px; font-size: 0.74rem; padding: 3px 10px; border-radius: 999px; background: rgba(183,156,237,.12); color: var(--acento-2); }

.respira-stage { text-align: center; }
.respira-stage h2 { font-family: var(--serif); font-weight: 500; font-size: 1.8rem; margin-bottom: 24px; }
.respira-circulo-wrap {
  position: relative; width: min(300px, 72vw); aspect-ratio: 1;
  margin: 0 auto; display: flex; align-items: center; justify-content: center;
}
.respira-circulo {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle, rgba(138,180,248,.35), rgba(183,156,237,.15) 70%);
  border: 1px solid rgba(138,180,248,.4);
  transform: scale(0.55);
  transition: transform 4s ease-in-out;
  box-shadow: 0 0 60px rgba(138,180,248,.15);
}
.respira-texto { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 2px; }
#respira-fase { font-family: var(--serif); font-size: 1.5rem; font-style: italic; }
#respira-cuenta { font-size: 2rem; font-weight: 200; font-variant-numeric: tabular-nums; min-height: 1.2em; }

/* ===== Fondo mágico: auroras, orbes y estrella fugaz ===== */
.aurora { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; filter: blur(60px); }
.aurora-capa { position: absolute; border-radius: 50%; opacity: .5; mix-blend-mode: screen; }
.a1 {
  width: 60vw; height: 40vh; top: -12%; left: -8%;
  background: linear-gradient(135deg, #4a3d8f, #2b6cb0);
  animation: aurora1 22s ease-in-out infinite alternate;
}
.a2 {
  width: 50vw; height: 36vh; top: 30%; right: -14%;
  background: linear-gradient(135deg, #6b46a8, #b76ba3);
  animation: aurora2 28s ease-in-out infinite alternate;
}
.a3 {
  width: 55vw; height: 32vh; bottom: -12%; left: 18%;
  background: linear-gradient(135deg, #1f5f5b, #3d6cb0);
  animation: aurora3 25s ease-in-out infinite alternate;
}
@keyframes aurora1 { from { transform: translate(0,0) rotate(0deg) scale(1); } to { transform: translate(9vw,7vh) rotate(30deg) scale(1.25); } }
@keyframes aurora2 { from { transform: translate(0,0) rotate(0deg) scale(1.15); } to { transform: translate(-10vw,-6vh) rotate(-25deg) scale(0.9); } }
@keyframes aurora3 { from { transform: translate(0,0) scale(1); } to { transform: translate(-7vw,-5vh) scale(1.3); } }

.orbes { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.orbe {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(230,201,138,.9), rgba(230,201,138,.08) 60%, transparent);
  box-shadow: 0 0 18px rgba(230,201,138,.35);
  animation: orbita 18s ease-in-out infinite;
}
.o1 { width: 8px; height: 8px; top: 22%; left: 12%; animation-duration: 21s; }
.o2 { width: 5px; height: 5px; top: 60%; left: 84%; animation-duration: 17s; animation-delay: -6s;
  background: radial-gradient(circle at 35% 35%, rgba(138,180,248,.9), rgba(138,180,248,.08) 60%, transparent);
  box-shadow: 0 0 14px rgba(138,180,248,.4); }
.o3 { width: 6px; height: 6px; top: 78%; left: 22%; animation-duration: 24s; animation-delay: -11s;
  background: radial-gradient(circle at 35% 35%, rgba(183,156,237,.9), rgba(183,156,237,.08) 60%, transparent);
  box-shadow: 0 0 14px rgba(183,156,237,.4); }
.o4 { width: 4px; height: 4px; top: 38%; left: 68%; animation-duration: 15s; animation-delay: -4s; }
@keyframes orbita {
  0%,100% { transform: translate(0,0); opacity: .9; }
  25% { transform: translate(3vw,-4vh); opacity: .5; }
  50% { transform: translate(-2vw,-7vh); opacity: 1; }
  75% { transform: translate(-4vw,-2vh); opacity: .6; }
}

/* (la estrella fugaz ahora vive en el canvas del cielo) */

/* ===== Sueño lúcido ===== */
.panel-titulo { font-family: var(--serif); font-weight: 500; font-size: 1.35rem; margin-bottom: 4px; }
.panel-hint { font-size: 0.82rem; color: var(--texto-suave); margin-bottom: 12px; }
.panel-lucido { margin-top: 26px; border-color: rgba(183,156,237,.25);
  background: linear-gradient(160deg, rgba(183,156,237,.08), rgba(255,255,255,.03)); }
.entrada.lucida { border-color: rgba(230,201,138,.4);
  background: linear-gradient(160deg, rgba(230,201,138,.09), rgba(255,255,255,.03)); }
.card-lucido .card-cta { color: var(--acento-2); }
.card-dormir .card-cta { color: var(--verde); }

/* ===== Sueño profundo ===== */
.panel-sonidos { border-color: rgba(138,180,248,.22);
  background: linear-gradient(160deg, rgba(60,110,180,.10), rgba(255,255,255,.03)); }
.chips-label { align-self: center; font-size: 0.78rem; color: var(--texto-suave); margin-right: 4px; }
#sonido-chips .chip.active { background: var(--acento-2); border-color: var(--acento-2); animation: latido 3s ease-in-out infinite; }
@keyframes latido { 0%,100% { box-shadow: 0 0 0 0 rgba(183,156,237,.35); } 50% { box-shadow: 0 0 0 9px rgba(183,156,237,0); } }

.ritual { display: flex; flex-direction: column; gap: 8px; }
.ritual label {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  padding: 11px 14px; border-radius: 12px;
  background: rgba(0,0,0,.18); border: 1px solid var(--panel-borde);
  font-size: 0.92rem; transition: all .3s;
}
.ritual label:hover { border-color: rgba(255,255,255,.2); }
.ritual input { accent-color: var(--verde); width: 17px; height: 17px; cursor: pointer; flex-shrink: 0; }
.ritual label.hecho { opacity: .55; text-decoration: line-through; }

.panel-escaneo { border-color: rgba(154,208,176,.22);
  background: linear-gradient(160deg, rgba(154,208,176,.08), rgba(255,255,255,.03)); }
.escaneo-stage { min-height: 90px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 10px; }
#escaneo-frase {
  font-family: var(--serif); font-size: 1.3rem; font-style: italic;
  transition: opacity .8s; max-width: 420px;
}
#escaneo-frase.cambiando { opacity: 0; }

.enlace {
  background: none; border: none; cursor: pointer; padding: 0;
  color: var(--acento); font: inherit; text-decoration: underline;
}

/* ===== Meditaciones guiadas ===== */
.guiadas { margin-top: 44px; }
.guiadas-titulo {
  font-family: var(--serif); font-weight: 500; font-size: 1.6rem;
  text-align: center; margin-bottom: 6px;
}
#guiadas-lista { display: flex; flex-direction: column; gap: 10px; max-width: 560px; margin: 0 auto; }
.pista {
  background: var(--panel); border: 1px solid var(--panel-borde);
  border-radius: 16px; padding: 14px 18px; transition: border-color .3s, background .3s;
}
.pista.sonando {
  border-color: rgba(138,180,248,.45);
  background: linear-gradient(160deg, rgba(60,110,180,.12), rgba(255,255,255,.03));
}
.pista-fila { display: flex; align-items: center; gap: 14px; }
.pista-play {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(138,180,248,.5); background: rgba(138,180,248,.12);
  color: var(--texto); font-size: 1rem; cursor: pointer; transition: all .25s;
  display: flex; align-items: center; justify-content: center;
}
.pista-play:hover { background: var(--acento); color: #0b1220; }
.pista.sonando .pista-play { background: var(--acento); color: #0b1220; animation: latido 3s ease-in-out infinite; }
.pista-info { flex: 1; min-width: 0; }
.pista-info h3 { font-family: var(--serif); font-weight: 500; font-size: 1.15rem; }
.pista-info p { font-size: 0.8rem; color: var(--texto-suave); }
.pista-dur { font-size: 0.8rem; color: var(--texto-suave); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.pista-progreso { display: none; margin-top: 12px; align-items: center; gap: 10px; }
.pista.sonando .pista-progreso, .pista.pausada .pista-progreso { display: flex; }
.pista-barra {
  flex: 1; height: 5px; border-radius: 999px; background: rgba(255,255,255,.1);
  cursor: pointer; position: relative; overflow: hidden;
}
.pista-avance {
  position: absolute; inset: 0 100% 0 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--acento), var(--acento-2));
  transition: inset-inline-end .3s linear;
}
.pista-tiempo { font-size: 0.75rem; color: var(--texto-suave); font-variant-numeric: tabular-nums; flex-shrink: 0; }

/* ===== Números de Grabovoi ===== */
.panel-busqueda { border-color: rgba(230,201,138,.25);
  background: linear-gradient(160deg, rgba(230,201,138,.07), rgba(255,255,255,.03)); }
.buscador {
  width: 100%; border-radius: 999px; padding: 13px 20px;
  background: rgba(0,0,0,.28); border: 1px solid var(--panel-borde);
  color: var(--texto); font-family: var(--sans); font-weight: 300;
  font-size: 0.95rem; outline: none; transition: border-color .25s;
}
.buscador:focus { border-color: var(--dorado); }
.buscador::placeholder { color: var(--texto-suave); opacity: .7; }
.codigo { cursor: pointer; }
.codigo .numero {
  font-family: var(--serif); font-size: 1.35rem; letter-spacing: .12em;
  color: var(--dorado); display: block; margin-bottom: 2px;
  transition: text-shadow .3s;
}
.codigo:hover .numero { text-shadow: 0 0 18px rgba(230,201,138,.5); }
.codigo .para { font-size: 0.9rem; }
.codigo .cat {
  display: inline-block; margin-top: 6px; font-size: 0.7rem;
  padding: 2px 10px; border-radius: 999px;
  background: rgba(138,180,248,.12); color: var(--acento);
}
.codigo .copiado { font-size: 0.75rem; color: var(--verde); margin-left: 8px; opacity: 0; transition: opacity .3s; }
.codigo .copiado.ver { opacity: 1; }
.fav-btn {
  background: none; border: none; cursor: pointer; font-size: 1.25rem;
  color: var(--texto-suave); transition: color .25s, transform .25s; flex-shrink: 0;
  padding: 4px 8px;
}
.fav-btn:hover { transform: scale(1.2); color: var(--dorado); }
.fav-btn.activo { color: var(--dorado); }

/* Glow del círculo de respiración */
.respira-circulo { animation: brillo 6s ease-in-out infinite; }
@keyframes brillo {
  0%,100% { box-shadow: 0 0 60px rgba(138,180,248,.15); }
  50% { box-shadow: 0 0 90px rgba(183,156,237,.3); }
}

/* ===== Rutina diaria: banner ===== */
.rutina-banner {
  margin: 34px auto 0; max-width: 620px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 22px; border-radius: var(--radio); text-align: left;
  border: 1px solid rgba(230,201,138,.3);
  background: linear-gradient(140deg, rgba(230,201,138,.10), rgba(183,156,237,.07));
  animation: aparecer .6s ease both;
}
.rutina-banner-texto { display: flex; flex-direction: column; gap: 2px; }
.rutina-banner-texto strong { font-family: var(--serif); font-size: 1.2rem; font-weight: 500; }
.rutina-banner-texto span { font-size: .84rem; color: var(--texto-suave); }
.rutina-banner-botones { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) { .rutina-banner { flex-direction: column; align-items: stretch; text-align: center; } .rutina-banner-botones { justify-content: center; } }

/* ===== Overlays (onboarding y rutina) ===== */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 18px; overflow-y: auto;
  background: rgba(8, 12, 22, .82); backdrop-filter: blur(10px);
  animation: aparecer .35s ease both;
}
.overlay[hidden] { display: none; }
.overlay-caja {
  width: min(640px, 100%); max-height: 92vh; overflow-y: auto;
  background: linear-gradient(170deg, #141d2e, #101725);
  border: 1px solid var(--panel-borde); border-radius: 22px;
  padding: clamp(24px, 5vw, 42px);
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.ob-titulo { font-family: var(--serif); font-weight: 500; font-size: clamp(1.6rem, 4vw, 2.2rem); text-align: center; margin-bottom: 10px; }
.ob-texto { color: var(--texto-suave); text-align: center; max-width: 440px; margin: 0 auto 10px; }
.ob-guia { list-style: none; display: flex; flex-direction: column; gap: 10px; margin: 18px 0; }
.ob-guia li { padding: 10px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--panel-borde); font-size: .9rem; color: var(--texto-suave); }
.ob-guia strong { color: var(--texto); font-weight: 500; }
.ob-campo { margin: 20px 0; }
.ob-etiqueta { display: block; font-family: var(--serif); font-size: 1.1rem; margin-bottom: 10px; }
.ob-campo .chips { justify-content: flex-start; margin-bottom: 0; }
.hora-input {
  background: rgba(0,0,0,.28); border: 1px solid var(--panel-borde); color: var(--texto);
  border-radius: 12px; padding: 10px 16px; font-family: var(--sans); font-size: 1.05rem;
  outline: none; color-scheme: dark;
}
.hora-input:focus { border-color: var(--acento); }

/* ===== Ejecutor de rutina ===== */
.rutina-caja { display: flex; flex-direction: column; min-height: min(560px, 88vh); }
.rutina-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.rutina-dots { display: flex; gap: 8px; }
.rutina-dots span { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.15); transition: all .3s; }
.rutina-dots span.hecho { background: var(--verde); }
.rutina-dots span.actual { background: var(--dorado); transform: scale(1.3); box-shadow: 0 0 12px rgba(230,201,138,.5); }
.rutina-salir { background: none; border: none; color: var(--texto-suave); font-size: 1.1rem; cursor: pointer; padding: 6px 10px; border-radius: 10px; }
.rutina-salir:hover { color: var(--texto); background: var(--panel); }
#rutina-cuerpo { flex: 1; display: flex; flex-direction: column; justify-content: center; text-align: center; gap: 14px; }
.rp-kicker { text-transform: uppercase; letter-spacing: .25em; font-size: .72rem; color: var(--dorado); }
.rp-titulo { font-family: var(--serif); font-weight: 500; font-size: clamp(1.6rem, 4.5vw, 2.3rem); }
.rp-texto { color: var(--texto-suave); max-width: 460px; margin: 0 auto; font-size: .95rem; }
.rp-texto em { color: var(--texto); font-style: italic; }
#rutina-cuerpo textarea { max-width: 460px; margin: 6px auto 0; }
.rp-lista { display: flex; flex-direction: column; gap: 10px; max-width: 440px; margin: 8px auto; width: 100%; }
.rp-item {
  background: var(--panel); border: 1px solid var(--panel-borde); border-radius: 14px;
  padding: 12px 16px; text-align: center; animation: aparecer .4s ease both;
}
.rp-item .numero { font-family: var(--serif); font-size: 1.4rem; letter-spacing: .12em; color: var(--dorado); display: block; }
.rp-item .para { font-size: .82rem; color: var(--texto-suave); }
.rp-item.afirmacion { font-family: var(--serif); font-size: 1.2rem; font-style: italic; padding: 16px; }
.rp-reloj { font-size: clamp(2.6rem, 8vw, 3.6rem); font-weight: 200; font-variant-numeric: tabular-nums; }
.rp-estado { font-size: .8rem; text-transform: uppercase; letter-spacing: .2em; color: var(--texto-suave); }
.rp-final { font-size: 3rem; }
.rutina-pie { margin-top: 18px; display: flex; justify-content: center; gap: 10px; }

/* ===== Repetición en bucle ===== */
.repetir-btn { margin-top: 18px; }
.repetir-cuerpo {
  flex: 1; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 20px; min-height: 240px;
}
#repetir-texto {
  font-family: var(--serif); font-style: italic; line-height: 1.45;
  font-size: clamp(1.5rem, 4.5vw, 2.2rem); max-width: 520px;
  opacity: 1; transform: none;
  transition: opacity .9s ease, transform .9s ease;
}
#repetir-texto.cambiando { opacity: 0; transform: scale(.94) translateY(10px); }
.repetir-pie { text-align: center; margin-top: 10px; }

/* ===== Pie ===== */
.pie { text-align: center; padding: 30px; color: var(--texto-suave); font-size: 0.8rem; position: relative; z-index: 1; }

/* ===== Responsive ===== */
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: 4px; justify-content: center; padding-block: 10px; }
  .nav { flex-wrap: wrap; justify-content: center; }
  .nav button { padding: 6px 10px; font-size: 0.78rem; }
  .brand-name { font-size: 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.2s !important; }
}
