/* ===== NAMI — Calistenia Japonesa — estilos ===== */
:root {
  --violet: #8b5cf6;
  --magenta: #ec4899;
  --grad: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  --coral: #e11d48;
  --coral-600: #be123c;
  --coral-soft: #3a1220;
  --bg: #0a060f;
  --bg-2: #140a1c;
  --surface: #170f20;
  --surface-2: #1f1429;
  --text: #f5f1fa;
  --text-soft: #ad9dc2;
  --border: #2c1f3a;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.45);
  --radius: 18px;
  --radius-sm: 12px;
  --maxw: 720px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
#app { max-width: var(--maxw); margin: 0 auto; min-height: 100vh; padding-bottom: 74px; }
a { color: var(--magenta); }

/* ===== Header / Home ===== */
.home-hero {
  padding: calc(22px + var(--safe-top)) 20px 24px;
  background: radial-gradient(120% 100% at 20% -10%, #3a1f5c 0%, transparent 55%),
              radial-gradient(120% 100% at 100% 0%, #4a1030 0%, transparent 50%),
              var(--bg-2);
  border-bottom: 1px solid var(--border);
}
.hero-badge {
  display: inline-block; background: rgba(236,72,153,.16); color: #f0abfc;
  font-size: 12px; font-weight: 700; letter-spacing: .3px;
  padding: 5px 12px; border-radius: 999px; margin-bottom: 10px;
}
.home-hero h1 { font-size: 28px; font-weight: 800; margin: 0 0 4px; letter-spacing: -.3px; }
.hero-sub { color: var(--text-soft); margin: 0 0 18px; font-size: 14.5px; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.hero-stat {
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  border-radius: 14px; padding: 10px 6px; text-align: center;
  display: flex; flex-direction: column; gap: 2px;
}
.hero-stat strong { font-size: 18px; font-weight: 800; }
.hero-stat span { font-size: 10.5px; color: var(--text-soft); text-transform: uppercase; letter-spacing: .4px; }
.progress-track { height: 9px; background: rgba(255,255,255,.1); border-radius: 999px; overflow: hidden; margin-bottom: 16px; }
.progress-fill { height: 100%; background: var(--grad); border-radius: 999px; transition: width .5s ease; }
.hero-cta {
  background: var(--coral); color: #fff; border: none; border-radius: 14px;
  padding: 15px 18px; font-size: 15.5px; font-weight: 700; cursor: pointer; width: 100%;
  box-shadow: 0 10px 24px rgba(225,29,72,.35);
}
.hero-cta:active { background: var(--coral-600); }
.hero-done { text-align: center; color: #f0abfc; font-weight: 700; font-size: 14.5px; margin: 0; }

/* ===== Lista de días ===== */
.content { padding: 18px 16px calc(40px + var(--safe-bottom)); }
.section-label {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px;
  color: var(--text-soft); margin: 22px 4px 6px;
}
.section-label:first-child { margin-top: 6px; }
.semana-nota { color: var(--text-soft); font-size: 13px; margin: 0 4px 12px; }

.dias-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 460px) { .dias-grid { grid-template-columns: repeat(3, 1fr); } }
.dia-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 13px 12px;
  box-shadow: var(--shadow); cursor: pointer; text-align: left;
  display: block; width: 100%; font: inherit; color: inherit;
  transition: transform .12s ease, border-color .12s ease;
}
.dia-card:active { transform: scale(.97); }
.dia-card.done { border-color: var(--magenta); background: linear-gradient(160deg, rgba(139,92,246,.14), rgba(236,72,153,.10)); }
.dia-card.locked { opacity: .45; cursor: default; }
.dia-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dia-n { font-size: 11px; font-weight: 700; color: var(--text-soft); text-transform: uppercase; letter-spacing: .3px; }
.dia-check { color: var(--magenta); font-weight: 800; font-size: 13px; }
.dia-lock { font-size: 12px; }
.dia-ico { font-size: 24px; margin-bottom: 4px; }
.dia-titulo { font-weight: 700; font-size: 13.5px; margin: 0 0 2px; line-height: 1.25; }
.dia-foco { font-size: 11.5px; color: var(--text-soft); margin: 0; }

/* ===== Vista de día ===== */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: calc(12px + var(--safe-top)) 14px 12px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.back-btn {
  border: none; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 12px; font-size: 14px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.topbar-title { font-size: 14px; font-weight: 700; color: var(--text-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dia-desc { color: var(--text-soft); font-size: 14px; margin: 2px 4px 4px; }

/* Botões */
.btn { background: var(--coral); color: #fff; border: none; border-radius: 12px;
  padding: 13px 18px; font-size: 15px; font-weight: 700; cursor: pointer; width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:active { background: var(--coral-600); }
.btn-sm { width: auto; padding: 8px 14px; font-size: 13.5px; border-radius: 10px; }
.btn-ghost { background: transparent; color: inherit; border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 12px; cursor: pointer; }
.btn-done { background: var(--surface-2); color: var(--magenta); border: 1px solid var(--magenta); }
.btn-link { background: var(--surface); color: var(--magenta); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px; font-weight: 700; text-decoration: none; text-align: center;
  display: block; }

.complete-bar { padding: 22px 4px calc(20px + var(--safe-bottom)); }

/* barra de instalación */
.install-bar {
  position: fixed; left: 12px; right: 12px; bottom: calc(78px + var(--safe-bottom));
  max-width: calc(var(--maxw) - 24px); margin: 0 auto;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  border-radius: 14px; padding: 12px 14px; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13.5px;
}
.install-bar > div { display: flex; gap: 8px; align-items: center; }
.install-bar[hidden] { display: none; }

.footer-note { text-align: center; color: var(--text-soft); font-size: 12px;
  padding: 8px 20px calc(30px + var(--safe-bottom)); }

.fade-in { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ===== Navegação inferior ===== */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  max-width: var(--maxw); margin: 0 auto;
  display: flex; justify-content: space-around;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-top: 1px solid var(--border);
  padding: 8px 6px calc(8px + var(--safe-bottom));
}
.nav-item {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: none; cursor: pointer;
  font-size: 11px; font-weight: 600; color: var(--text-soft); font-family: inherit;
  padding: 4px 2px; border-radius: 10px;
}
.nav-item .nav-ico { font-size: 19px; line-height: 1; height: 24px; display: flex; align-items: center; justify-content: center; }
.nav-item.active { color: var(--magenta); }
.nav-item.active .nav-ico { transform: scale(1.12); }

/* ===== Páginas Progreso ===== */
.page-head { padding: calc(24px + var(--safe-top)) 20px 4px; }
.page-head h1 { font-size: 26px; font-weight: 800; margin: 0; }
.page-sub { color: var(--text-soft); margin: 4px 0 0; font-size: 14.5px; }
.plan-nota { color: var(--text-soft); font-size: 12.5px; margin-top: 12px; text-align: center; }

.avatar-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px 18px; text-align: center;
}
.avatar-wrap { width: 168px; margin: 0 auto; }
.avatar-svg { width: 100%; height: auto; display: block; }
.avatar-title { font-size: 16.5px; font-weight: 800; margin: 6px 0 2px; }
.avatar-sub { font-size: 13px; color: var(--text-soft); margin: 0; }

.resumen-card {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 10px; margin-bottom: 4px;
}
.resumen-card > div { text-align: center; display: flex; flex-direction: column; gap: 2px; }
.resumen-card strong { font-size: 18px; font-weight: 800; }
.resumen-card span { font-size: 11px; color: var(--text-soft); }

/* ===== Histórico (calendario) ===== */
.cal-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px;
}
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-arrow {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  width: 32px; height: 32px; border-radius: 10px; font-size: 16px; cursor: pointer;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-head { margin-bottom: 4px; }
.cal-head span { font-size: 11px; font-weight: 700; color: var(--text-soft); }
.cal-day {
  position: relative; aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-size: 13px; border-radius: 10px; color: var(--text-soft);
}
.cal-day.today { background: var(--surface-2); color: var(--text); font-weight: 800; box-shadow: inset 0 0 0 1.5px var(--coral); }
.cal-day.done { background: var(--grad); color: #fff; font-weight: 700; }
.cal-day.done.today { box-shadow: inset 0 0 0 1.5px #fff; }
.cal-check { position: absolute; top: 1px; right: 3px; font-size: 8px; font-style: normal; }
.cal-empty { aspect-ratio: 1; }

/* ===== Tu semana ===== */
.week-card, .evo-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px;
}
.week-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.week-head strong { font-size: 14.5px; }
.week-head span { font-size: 12px; color: var(--text-soft); }
.week-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; }
.week-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.week-bar-wrap {
  width: 100%; height: 64px; background: var(--surface-2);
  border-radius: 8px; display: flex; align-items: flex-end; overflow: hidden;
}
.week-bar { width: 100%; height: 10%; border-radius: 8px; background: var(--border); transition: height .3s ease; }
.week-bar.full { height: 100%; background: var(--grad); }
.week-lbl { font-size: 10.5px; color: var(--text-soft); font-weight: 700; }
.week-col.hoy .week-lbl { color: var(--magenta); }

/* ===== Evolución del mes ===== */
.evo-bars { display: grid; grid-template-columns: repeat(9, 1fr); gap: 5px; align-items: end; }
.evo-col { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.evo-bar-wrap {
  width: 100%; height: 70px; display: flex; align-items: flex-end; justify-content: center;
}
.evo-bar { width: 78%; border-radius: 6px 6px 3px 3px; background: var(--grad); min-height: 4px; }
.evo-lbl { font-size: 10px; color: var(--text-soft); font-weight: 700; }

/* ===== Clases guiadas (vista de día) ===== */
.clase-player {
  background: #000; aspect-ratio: 16/9; width: 100%;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.clase-player iframe { width: 100%; height: 100%; border: 0; display: block; }
.clase-player video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.v-cargando {
  color: var(--text-soft); font-size: 13.5px; font-weight: 600;
  display: grid; place-items: center; width: 100%; height: 100%; text-align: center; padding: 0 20px;
}
.v-spin { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.35); pointer-events: none; }
.v-spin-ico {
  width: 42px; height: 42px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.3); border-top-color: #fff;
  animation: vspin .8s linear infinite;
}
@keyframes vspin { to { transform: rotate(360deg); } }

@media (orientation: landscape) and (max-height: 560px) {
  .clase-player { aspect-ratio: auto; height: 100vh; }
  .clase-player video { height: 100vh; }
}

.clase-bar {
  position: sticky; top: 0; z-index: 4;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border); padding: 12px 16px 14px;
}
.clase-prog { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.clase-prog-fill { height: 100%; background: var(--grad); border-radius: 999px; transition: width .3s ease; }
.clase-now { font-size: 14px; margin: 10px 0 12px; text-align: center; }
.clase-nav { display: flex; gap: 10px; }
.clase-nav .btn-ghost { flex: 0 0 auto; padding: 13px 16px; font-weight: 700; font-size: 14.5px; }
.clase-nav .btn-ghost[disabled] { opacity: .4; }
.clase-nav .btn { flex: 1; }

.seg-item {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 13px; margin-bottom: 7px; cursor: pointer; font: inherit; color: inherit;
}
.seg-item.actual { border-color: var(--magenta); background: linear-gradient(160deg, rgba(139,92,246,.14), rgba(236,72,153,.10)); }
.seg-n {
  flex: 0 0 26px; height: 26px; width: 26px; border-radius: 50%;
  background: var(--surface-2); display: grid; place-items: center;
  font-size: 12px; font-weight: 800; color: var(--text-soft);
}
.seg-item.actual .seg-n { background: var(--grad); color: #fff; }
.seg-ico { font-size: 17px; }
.seg-nombre { flex: 1; font-size: 14px; font-weight: 600; display: flex; flex-direction: column; }
.seg-tipo { font-size: 11.5px; font-weight: 500; color: var(--text-soft); }
