/* La agenda de Clementina · estilos (tonos morados) */
:root {
  --bg: #f5efff;
  --bg2: #ede3ff;
  --card: #ffffff;
  --ink: #2e1065;
  --muted: #6d5a9c;
  --soft: #9a88c4;
  --line: #e6dafd;
  --lilac: #f1e9ff;
  --lilac2: #e4d4ff;
  --pri: #7c3aed;
  --pri-d: #5b21b6;
  --pri-dd: #4c1d95;
  --pri-l: #a78bfa;
  --mag: #c026d3;
  --pink: #ec4899;
  --gold: #f59e0b;
  --gold-l: #fde68a;
  --ok: #10b981;
  --ok-bg: #e7faf2;
  --warn: #e11d48;
  --warn-bg: #fff0f4;
  --r: 22px;
  --r-s: 14px;
  --shadow: 0 2px 0 rgba(76, 29, 149, .06), 0 10px 26px rgba(76, 29, 149, .10);
  --shadow-s: 0 1px 0 rgba(76, 29, 149, .05), 0 4px 12px rgba(76, 29, 149, .08);
  --grad: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 45%, #c026d3 100%);
  --grad-soft: linear-gradient(135deg, #f3e8ff 0%, #ede9fe 50%, #fae8ff 100%);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --nav-h: 72px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { color-scheme: light; }
body {
  margin: 0;
  font-family: 'Fredoka', 'Nunito', 'Trebuchet MS', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.35;
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 0% 0%, #ead9ff 0, transparent 38%),
    radial-gradient(circle at 100% 30%, #fbe3ff 0, transparent 34%),
    radial-gradient(circle at 20% 100%, #e3dcff 0, transparent 36%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 600; }
p { margin: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Estructura ---------- */
#app { max-width: 640px; margin: 0 auto; padding: 0 16px calc(var(--nav-h) + var(--safe-b) + 96px); }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px;
  margin: 0 -16px 6px;
  background: rgba(245, 239, 255, .86);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.topbar .who { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; background: none; border: 0; padding: 0; text-align: left; }
.topbar .hello { font-size: 13px; color: var(--muted); }
.topbar .name { font-size: 20px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  background: var(--grad); color: #fff; display: grid; place-items: center;
  font-size: 22px; font-weight: 600; overflow: hidden; border: 3px solid #fff; box-shadow: var(--shadow-s);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.star-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px 7px 10px;
  border-radius: 999px; border: 0; background: #fff; box-shadow: var(--shadow-s);
  font-weight: 600; font-size: 18px; color: #b45309;
}
.star-pill .st { font-size: 20px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 0; background: #fff; box-shadow: var(--shadow-s);
  display: grid; place-items: center; font-size: 20px; flex: none;
}

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; justify-content: center;
  padding: 8px 10px calc(8px + var(--safe-b));
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.nav-inner { display: flex; width: 100%; max-width: 640px; gap: 4px; }
.nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 2px; border-radius: 16px; text-decoration: none; color: var(--muted);
  font-size: 12.5px; font-weight: 500; transition: background .2s, color .2s, transform .15s;
}
.nav a .ic { font-size: 24px; line-height: 1; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.nav a.on { background: var(--lilac); color: var(--pri-d); font-weight: 600; }
.nav a.on .ic { transform: translateY(-2px) scale(1.15); }
.nav a:active { transform: scale(.94); }

.view { animation: viewIn .35s ease both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.sec { margin-top: 22px; }
.sec-h { display: flex; align-items: center; gap: 10px; margin: 0 2px 10px; }
.sec-h h2 { font-size: 20px; flex: 1; }
.sec-h .link { border: 0; background: none; color: var(--pri); font-weight: 600; font-size: 15px; padding: 4px 0; }
.page-title { display: flex; align-items: center; gap: 12px; margin: 8px 2px 4px; }
.page-title h1 { font-size: 28px; flex: 1; }
.page-title .big-emoji { font-size: 34px; }
.lead { color: var(--muted); margin: 0 2px 12px; }

/* ---------- Tarjetas ---------- */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; }
.card + .card { margin-top: 12px; }
.card.pad-l { padding: 20px; }
.card.lilac { background: var(--lilac); box-shadow: none; }
.hero {
  position: relative; overflow: hidden; color: #fff; background: var(--grad);
  border-radius: 28px; padding: 20px; box-shadow: 0 14px 30px rgba(124, 58, 237, .32);
}
.hero::before, .hero::after {
  content: ''; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .12); pointer-events: none;
}
.hero::before { width: 180px; height: 180px; right: -50px; top: -60px; }
.hero::after { width: 120px; height: 120px; left: -40px; bottom: -60px; }
.hero > * { position: relative; z-index: 1; }
.hero .date { font-size: 15px; opacity: .9; }
.hero .date::first-letter { text-transform: uppercase; }
.hero h1 { font-size: 26px; margin: 2px 0 12px; }
.hero-row { display: flex; align-items: center; gap: 16px; }
.hero .stat { font-size: 15px; opacity: .95; }
.hero .stat b { font-size: 22px; }

.ring { position: relative; width: 96px; height: 96px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .lbl { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font-weight: 600; line-height: 1.05; }
.ring .lbl small { display: block; font-size: 12px; font-weight: 500; opacity: .9; }
.ring circle { transition: stroke-dashoffset .8s cubic-bezier(.3, .9, .3, 1); }

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tile {
  border: 0; text-align: left; background: #fff; border-radius: var(--r); box-shadow: var(--shadow);
  padding: 14px; display: flex; flex-direction: column; gap: 6px; min-height: 100px;
  transition: transform .15s;
}
.tile:active { transform: scale(.97); }
.tile .te { font-size: 30px; }
.tile b { font-size: 17px; font-weight: 600; }
.tile span { font-size: 13.5px; color: var(--muted); }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Listas de tareas ---------- */
.checks { display: flex; flex-direction: column; gap: 10px; }
.check {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: #fff; border: 0; border-radius: 18px; padding: 12px 14px; box-shadow: var(--shadow-s);
  transition: transform .15s, background .25s;
}
.check:active { transform: scale(.98); }
.check .em { font-size: 28px; width: 40px; text-align: center; flex: none; }
.check .tx { flex: 1; min-width: 0; }
.check .tx b { display: block; font-weight: 500; font-size: 17px; }
.check .tx small { color: var(--muted); font-size: 13.5px; }
.check .box {
  width: 36px; height: 36px; border-radius: 12px; border: 3px solid var(--lilac2); flex: none;
  display: grid; place-items: center; color: #fff; font-size: 20px; font-weight: 700; transition: all .25s;
}
.check.done { background: var(--ok-bg); }
.check.done .tx b { text-decoration: line-through; text-decoration-color: rgba(16, 185, 129, .6); color: #476a5d; }
.check.done .box { background: var(--ok); border-color: var(--ok); animation: pop .4s cubic-bezier(.3, 1.8, .5, 1); }
.check.late { box-shadow: inset 0 0 0 2px #fecdd3, var(--shadow-s); }
.stars-tag { font-size: 13px; color: #b45309; font-weight: 600; white-space: nowrap; }
@keyframes pop { 0% { transform: scale(.4); } 100% { transform: scale(1); } }

.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px;
  background: var(--lilac); color: var(--pri-d); font-size: 13px; font-weight: 500; white-space: nowrap;
}
.chip.gold { background: #fef3c7; color: #92400e; }
.chip.ok { background: var(--ok-bg); color: #047857; }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.white { background: rgba(255, 255, 255, .22); color: #fff; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; margin: 0 -2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.pick {
  border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px;
  font-size: 15px; font-weight: 500; white-space: nowrap; transition: all .15s; color: var(--ink);
}
.pick.on { background: var(--pri); border-color: var(--pri); color: #fff; box-shadow: 0 4px 12px rgba(124, 58, 237, .3); }
.pick:active { transform: scale(.95); }

.seg { display: flex; background: var(--lilac2); border-radius: 16px; padding: 4px; gap: 4px; margin: 6px 0 14px; }
.seg button { flex: 1; border: 0; background: none; border-radius: 12px; padding: 10px; font-weight: 600; color: var(--pri-d); }
.seg button.on { background: #fff; box-shadow: var(--shadow-s); }

.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.days .pick { padding: 10px 0; text-align: center; border-radius: 14px; }
.day-tab small { display: block; font-size: 11px; opacity: .8; font-weight: 400; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 16px; padding: 13px 18px; font-weight: 600; font-size: 17px;
  background: var(--pri); color: #fff; box-shadow: 0 4px 0 var(--pri-dd), 0 8px 18px rgba(124, 58, 237, .25);
  transition: transform .1s, box-shadow .1s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--pri-dd), 0 4px 10px rgba(124, 58, 237, .2); }
.btn.block { width: 100%; }
.btn.light { background: var(--lilac); color: var(--pri-d); box-shadow: 0 4px 0 var(--lilac2); }
.btn.white { background: #fff; color: var(--pri-d); box-shadow: 0 4px 0 rgba(0, 0, 0, .12); }
.btn.gold { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #4a2500; box-shadow: 0 4px 0 #b45309, 0 8px 18px rgba(245, 158, 11, .35); }
.btn.ok { background: var(--ok); box-shadow: 0 4px 0 #047857; }
.btn.danger { background: var(--warn-bg); color: var(--warn); box-shadow: 0 4px 0 #fecdd3; }
.btn.sm { padding: 8px 14px; font-size: 15px; border-radius: 12px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.fab {
  position: fixed; right: max(16px, calc(50vw - 304px)); bottom: calc(var(--nav-h) + var(--safe-b) + 16px); z-index: 35;
  width: 62px; height: 62px; border-radius: 22px; border: 0; background: var(--grad); color: #fff;
  font-size: 34px; line-height: 1; box-shadow: 0 10px 24px rgba(124, 58, 237, .45); display: grid; place-items: center;
  transition: transform .15s;
}
.fab:active { transform: scale(.92); }
.add-row {
  width: 100%; border: 2px dashed var(--lilac2); background: rgba(255, 255, 255, .5); color: var(--pri);
  border-radius: 18px; padding: 14px; font-weight: 600;
}

/* ---------- Formularios (hoja inferior) ---------- */
.sheet-back {
  position: fixed; inset: 0; z-index: 60; background: rgba(46, 16, 101, .38);
  display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease;
}
.sheet {
  width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; overscroll-behavior: contain;
  background: #fff; border-radius: 28px 28px 0 0; padding: 10px 18px calc(22px + var(--safe-b));
  animation: up .32s cubic-bezier(.2, .9, .3, 1);
}
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--lilac2); margin: 0 auto 10px; }
.sheet h2 { font-size: 22px; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.sheet h2 .x { margin-left: auto; }
@media (min-width: 700px) {
  .sheet-back { align-items: center; }
  .sheet { border-radius: 28px; max-height: 86vh; }
}
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.field { margin-bottom: 14px; }
.field > label, .label { display: block; font-weight: 600; font-size: 15px; margin: 0 2px 6px; color: var(--pri-dd); }
.input {
  width: 100%; border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; background: #fff;
  font-size: 17px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--pri-l); box-shadow: 0 0 0 4px rgba(167, 139, 250, .2); }
textarea.input { min-height: 80px; resize: vertical; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; }
.form-actions .btn { flex: 1; }
.hint { font-size: 13.5px; color: var(--muted); margin: 6px 2px 0; }

.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.emoji-grid button {
  border: 2px solid transparent; background: var(--lilac); border-radius: 12px; font-size: 22px; padding: 6px 0;
}
.emoji-grid button.on { border-color: var(--pri); background: #fff; transform: scale(1.08); }
.color-row { display: flex; gap: 8px; flex-wrap: wrap; }
.color-row button { width: 36px; height: 36px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--line); }
.color-row button.on { box-shadow: 0 0 0 3px var(--ink); }

.ideas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ideas button { border: 0; background: var(--lilac); color: var(--pri-d); border-radius: 999px; padding: 6px 12px; font-size: 14px; }

/* ---------- Horario ---------- */
.timeline { position: relative; display: flex; flex-direction: column; gap: 10px; }
.act {
  display: flex; gap: 12px; align-items: stretch; background: #fff; border-radius: 18px; padding: 12px;
  box-shadow: var(--shadow-s); border: 0; text-align: left; width: 100%;
}
.act .bar { width: 6px; border-radius: 4px; flex: none; }
.act .tm { width: 56px; flex: none; font-weight: 600; font-size: 16px; }
.act .tm small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; }
.act .em { font-size: 28px; }
.act .tx { flex: 1; min-width: 0; }
.act .tx b { display: block; font-weight: 600; }
.act .tx small { color: var(--muted); font-size: 13.5px; }
.act.now { box-shadow: 0 0 0 3px var(--pri-l), var(--shadow-s); }
.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.week-grid .col { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.week-grid .hd { text-align: center; font-weight: 600; font-size: 13px; color: var(--muted); padding: 4px 0; border-radius: 10px; }
.week-grid .hd.today { background: var(--pri); color: #fff; }
.week-grid .blk { border-radius: 10px; padding: 5px 3px; font-size: 11px; text-align: center; color: #fff; line-height: 1.15; overflow: hidden; }
.week-grid .blk span { display: block; font-size: 18px; }

.task-grid { width: 100%; border-collapse: separate; border-spacing: 3px; }
.task-grid th { font-size: 12px; color: var(--muted); font-weight: 600; }
.task-grid th.today { color: var(--pri); }
.task-grid td.t { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.task-grid button { width: 100%; aspect-ratio: 1; max-width: 38px; border-radius: 10px; border: 2px solid var(--line); background: #fff; font-size: 15px; padding: 0; }
.task-grid button.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.task-grid button.off { background: transparent; border-style: dashed; opacity: .35; pointer-events: none; }
.task-grid button.future { opacity: .5; pointer-events: none; }

/* ---------- Deberes ---------- */
.hw {
  display: flex; gap: 12px; align-items: center; background: #fff; border-radius: 18px; padding: 12px 12px 12px 14px;
  box-shadow: var(--shadow-s); border-left: 6px solid var(--pri);
}
.hw .tx { flex: 1; min-width: 0; }
.hw .tx b { display: block; font-weight: 500; }
.hw .tx small { color: var(--muted); font-size: 13.5px; }
.hw .sub { font-size: 13px; font-weight: 600; }
.hw.done { opacity: .65; }
.hw.done .tx b { text-decoration: line-through; }
.hw .box { width: 38px; height: 38px; border-radius: 12px; border: 3px solid var(--lilac2); background: #fff; flex: none; display: grid; place-items: center; font-size: 20px; color: #fff; }
.hw.done .box { background: var(--ok); border-color: var(--ok); }
.list { display: flex; flex-direction: column; gap: 10px; }
.group-h { margin: 18px 4px 8px; font-weight: 600; color: var(--pri-dd); display: flex; gap: 8px; align-items: center; }
.group-h .n { background: var(--lilac2); border-radius: 999px; font-size: 13px; padding: 1px 9px; }
.subj-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.subj-pick button {
  border: 2px solid var(--line); background: #fff; border-radius: 16px; padding: 10px 6px; font-weight: 500; font-size: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.subj-pick button span { font-size: 24px; }
.subj-pick button.on { border-color: currentColor; box-shadow: 0 0 0 2px currentColor; }

/* ---------- Metas ---------- */
.goal { padding: 18px; }
.goal-top { display: flex; gap: 12px; align-items: flex-start; }
.goal-top .ge { font-size: 40px; line-height: 1; }
.goal-top h3 { font-size: 20px; }
.goal-why { color: var(--muted); font-size: 14.5px; margin-top: 2px; }
.prog { height: 16px; background: var(--lilac); border-radius: 999px; overflow: hidden; margin: 14px 0 6px; }
.prog > div { height: 100%; background: var(--grad); border-radius: 999px; transition: width .8s cubic-bezier(.3, .9, .3, 1); min-width: 16px; }
.prog.gold > div { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.prog-l { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--muted); }
.steps { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.steps li { display: flex; align-items: center; gap: 10px; }
.steps button.stp {
  flex: 1; display: flex; gap: 10px; align-items: center; border: 0; background: var(--lilac); border-radius: 12px;
  padding: 9px 12px; text-align: left; font-size: 15px;
}
.steps button.stp .b { width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--pri-l); background: #fff; flex: none; display: grid; place-items: center; font-size: 14px; color: #fff; }
.steps li.done button.stp { background: var(--ok-bg); }
.steps li.done button.stp .b { background: var(--ok); border-color: var(--ok); }
.steps li.done .t { text-decoration: line-through; color: #476a5d; }
.dots14 { display: flex; gap: 4px; margin-top: 12px; }
.dots14 i { flex: 1; height: 10px; border-radius: 5px; background: var(--lilac); }
.dots14 i.on { background: var(--pri); }
.goal.achieved { background: linear-gradient(135deg, #fffbeb, #fef3c7); }
.trophies { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.trophy { background: #fff; border-radius: 18px; padding: 12px; text-align: center; box-shadow: var(--shadow-s); }
.trophy .te { font-size: 34px; }
.trophy b { display: block; font-size: 14px; font-weight: 600; margin-top: 4px; }
.trophy small { color: var(--muted); font-size: 12px; }

/* ---------- Estiramientos ---------- */
.safety { background: linear-gradient(135deg, #fdf4ff, #f3e8ff); border-radius: var(--r); padding: 14px 16px; }
.safety ul { margin: 8px 0 0; padding-left: 20px; }
.safety li { margin: 3px 0; font-size: 15px; }
.sessions { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 520px) { .sessions { grid-template-columns: 1fr 1fr; } }
.session {
  border: 0; text-align: left; border-radius: var(--r); padding: 16px; color: #fff; position: relative; overflow: hidden;
  box-shadow: var(--shadow); min-height: 140px; display: flex; flex-direction: column; justify-content: flex-end;
  transition: transform .15s;
}
.session:active { transform: scale(.97); }
.session .fig { position: absolute; right: -6px; top: 4px; width: 130px; opacity: .95; }
.session b { font-size: 19px; font-weight: 600; position: relative; }
.session small { position: relative; opacity: .95; font-size: 13.5px; }
.session .done-badge { position: absolute; left: 12px; top: 12px; background: rgba(255, 255, 255, .25); padding: 2px 10px; border-radius: 999px; font-size: 13px; }
.poses { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pose { border: 0; background: #fff; border-radius: 18px; padding: 10px; box-shadow: var(--shadow-s); text-align: center; }
.pose .fig { background: var(--lilac); border-radius: 12px; }
.pose b { display: block; font-size: 14.5px; font-weight: 500; margin-top: 6px; }
.fig svg { width: 100%; height: auto; display: block; }

.player {
  position: fixed; inset: 0; z-index: 70; background: var(--grad); color: #fff; display: flex; flex-direction: column;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 18px calc(18px + var(--safe-b)); animation: fade .25s;
}
.player .top { display: flex; align-items: center; gap: 10px; }
.player .top .icon-btn { background: rgba(255, 255, 255, .2); color: #fff; box-shadow: none; }
.player .bars { display: flex; gap: 4px; flex: 1; }
.player .bars i { flex: 1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .25); }
.player .bars i.on { background: #fff; }
.player .stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; max-width: 560px; width: 100%; margin: 0 auto; }
.player .pfig { width: 100%; max-width: 420px; background: rgba(255, 255, 255, .95); border-radius: 26px; padding: 6px; }
.player h2 { font-size: 28px; }
.player .side { background: rgba(255, 255, 255, .22); padding: 4px 14px; border-radius: 999px; font-weight: 600; }
.player .inst { font-size: 17px; opacity: .96; max-width: 460px; }
.player .count { font-size: 64px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.player .ctrls { display: flex; gap: 12px; justify-content: center; align-items: center; }
.player .ctrls .icon-btn { width: 56px; height: 56px; font-size: 24px; }
.player .ctrls .play { width: 76px; height: 76px; font-size: 32px; background: #fff; color: var(--pri); }
.player.rest { background: linear-gradient(135deg, #6d28d9, #4c1d95); }

/* ---------- Premios ---------- */
.jar { text-align: center; padding: 22px 16px; }
.jar .big { font-size: 54px; font-weight: 700; color: #b45309; line-height: 1; }
.jar .big .st { display: inline-block; animation: twinkle 2.4s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { transform: rotate(-8deg) scale(1); } 50% { transform: rotate(8deg) scale(1.12); } }
.rewards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.reward { background: #fff; border-radius: var(--r); padding: 14px; box-shadow: var(--shadow-s); display: flex; flex-direction: column; gap: 8px; }
.reward .re { font-size: 38px; }
.reward b { font-weight: 500; font-size: 15.5px; flex: 1; }
.reward .cost { font-weight: 600; color: #b45309; }
.reward.can { box-shadow: 0 0 0 3px var(--gold-l), var(--shadow-s); }
.prize-card { background: linear-gradient(135deg, #fef3c7, #fde68a 60%, #fbcfe8); border-radius: 26px; padding: 18px; box-shadow: var(--shadow); }
.prize-card.won { animation: glow 1.8s ease-in-out infinite; }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, .5), var(--shadow); } 50% { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0), var(--shadow); } }
.ledger { list-style: none; padding: 0; margin: 0; }
.ledger li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line); font-size: 15px; }
.ledger li:last-child { border: 0; }
.ledger .p { color: var(--ok); font-weight: 600; white-space: nowrap; }
.ledger .m { color: var(--warn); font-weight: 600; white-space: nowrap; }

/* ---------- Semanas ---------- */
.chart { width: 100%; height: auto; display: block; }
.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cmp .card { text-align: center; padding: 14px 8px; }
.cmp .pct { font-size: 38px; font-weight: 700; color: var(--pri); line-height: 1.1; }
.wk { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.wk:last-child { border: 0; }
.wk .p { font-size: 22px; font-weight: 700; width: 64px; text-align: right; color: var(--pri); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
.badge { text-align: center; background: #fff; border-radius: 18px; padding: 12px 6px; box-shadow: var(--shadow-s); }
.badge .be { font-size: 34px; }
.badge b { display: block; font-size: 13px; font-weight: 600; margin-top: 4px; }
.badge small { display: block; font-size: 11.5px; color: var(--muted); }
.badge.locked { background: transparent; box-shadow: inset 0 0 0 2px var(--line); }
.badge.locked .be { filter: grayscale(1); opacity: .35; }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 12px; }
.week-strip .d { text-align: center; font-size: 12px; }
.week-strip .d i {
  display: grid; place-items: center; margin: 4px auto 0; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255, 255, 255, .2); font-style: normal; font-size: 15px; font-weight: 600;
}
.week-strip .d.full i { background: #fff; color: var(--pri); }
.week-strip .d.part i { background: rgba(255, 255, 255, .5); color: var(--pri-dd); }
.week-strip .d.today i { outline: 3px solid var(--gold-l); }

/* ---------- Cumpleaños ---------- */
.bday-hero { display: flex; gap: 16px; align-items: center; background: linear-gradient(135deg, #fdf2f8, #f3e8ff); }
.bday-photo {
  width: 84px; height: 84px; border-radius: 50%; overflow: hidden; flex: none; background: var(--grad); color: #fff;
  display: grid; place-items: center; font-size: 38px; border: 4px solid #fff; box-shadow: var(--shadow-s);
}
.bday-photo img { width: 100%; height: 100%; object-fit: cover; }
.bday-photo.sm { width: 54px; height: 54px; font-size: 26px; border-width: 3px; }
.bday-photo.lg { width: 120px; height: 120px; font-size: 54px; }
.bday { display: flex; gap: 12px; align-items: center; background: #fff; border-radius: 18px; padding: 10px 12px; box-shadow: var(--shadow-s); border: 0; width: 100%; text-align: left; }
.bday .tx { flex: 1; min-width: 0; }
.bday .tx b { display: block; font-weight: 600; }
.bday .tx small { color: var(--muted); font-size: 13.5px; }
.bday .left { text-align: center; font-size: 12px; color: var(--muted); min-width: 52px; }
.bday .left b { display: block; font-size: 22px; color: var(--pri); }
.bday.today { background: linear-gradient(135deg, #fde68a, #fbcfe8); }
.month-h { margin: 18px 4px 8px; font-weight: 600; color: var(--pri-dd); text-transform: capitalize; }
.photo-up { display: flex; align-items: center; gap: 14px; }
.photo-up label.btn { cursor: pointer; }

/* ---------- Papás ---------- */
.pinpad { display: grid; grid-template-columns: repeat(3, 72px); gap: 12px; justify-content: center; margin-top: 18px; }
.pinpad button { height: 72px; border-radius: 50%; border: 0; background: #fff; box-shadow: var(--shadow-s); font-size: 26px; font-weight: 600; }
.pindots { display: flex; gap: 12px; justify-content: center; margin-top: 16px; }
.pindots i { width: 16px; height: 16px; border-radius: 50%; background: var(--lilac2); }
.pindots i.on { background: var(--pri); }
.setting-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border: 0; }
.setting-row .grow b { display: block; font-weight: 500; }
.setting-row .grow small { color: var(--muted); font-size: 13.5px; }
input[type=range] { width: 100%; accent-color: var(--pri); }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; text-align: center; }
.login .logo { font-size: 74px; animation: bounce 2.2s ease-in-out infinite; }
.login h1 { font-size: 30px; margin: 8px 0 4px; color: var(--pri-dd); }
.login form { width: 100%; max-width: 360px; margin-top: 20px; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ---------- Avisos, toasts, efectos ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 20px); z-index: 90;
  transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 16px;
  font-weight: 500; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); max-width: calc(100vw - 32px); text-align: center;
  animation: toastIn .3s cubic-bezier(.3, 1.5, .5, 1);
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }
.alarm {
  position: fixed; left: 12px; right: 12px; top: calc(env(safe-area-inset-top, 0px) + 12px); z-index: 95; max-width: 520px; margin: 0 auto;
  background: #fff; border-radius: 22px; padding: 14px 16px; box-shadow: 0 16px 40px rgba(76, 29, 149, .35);
  display: flex; gap: 12px; align-items: center; animation: alarmIn .5s cubic-bezier(.3, 1.6, .5, 1);
  border: 3px solid var(--pri-l);
}
.alarm .ae { font-size: 36px; animation: ring .6s ease-in-out 3; }
.alarm .tx { flex: 1; }
.alarm .tx b { display: block; }
.alarm .tx small { color: var(--muted); }
@keyframes alarmIn { from { transform: translateY(-140%); } to { transform: none; } }
@keyframes ring { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-18deg); } 75% { transform: rotate(18deg); } }

.star-fly { position: fixed; z-index: 100; font-size: 26px; pointer-events: none; animation: fly .8s cubic-bezier(.5, 0, .7, 1) forwards; }
@keyframes fly { to { transform: translate(var(--dx), var(--dy)) scale(.5); opacity: .2; } }
#confetti { position: fixed; inset: 0; z-index: 99; pointer-events: none; }

.celebrate {
  position: fixed; inset: 0; z-index: 98; display: grid; place-items: center; background: rgba(46, 16, 101, .55);
  animation: fade .25s; padding: 20px;
}
.celebrate .box {
  background: #fff; border-radius: 30px; padding: 26px 22px; text-align: center; max-width: 360px; width: 100%;
  animation: popIn .5s cubic-bezier(.3, 1.6, .5, 1);
}
.celebrate .ce { font-size: 80px; line-height: 1; animation: bounce 1.6s ease-in-out infinite; }
.celebrate h2 { font-size: 26px; margin: 10px 0 6px; color: var(--pri-dd); }
.celebrate p { color: var(--muted); margin-bottom: 18px; }
@keyframes popIn { from { transform: scale(.5); opacity: 0; } to { transform: none; opacity: 1; } }
.gift { font-size: 96px; display: inline-block; animation: shake .5s ease-in-out infinite; cursor: pointer; }
@keyframes shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-10deg) scale(1.05); } 75% { transform: rotate(10deg) scale(1.05); } }

.empty { text-align: center; padding: 26px 16px; color: var(--muted); }
.empty .ee { font-size: 46px; display: block; margin-bottom: 6px; }
.tip { display: flex; gap: 10px; background: #fff; border-radius: 18px; padding: 12px 14px; box-shadow: var(--shadow-s); font-size: 15px; }
.tip .te { font-size: 26px; }
.loading { display: grid; place-items: center; min-height: 70vh; font-size: 54px; animation: bounce 1s infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
