:root {
  --ink: #4b4566;
  --ink-soft: #7a7396;
  --panel: #eeecfa;
  --row: #e3dff6;
  --row-done: #e9f1fd;
  --row-line: #cbc4ef;
  --pill: #d4cfec;
  --blue: #5b9be6;
  --blue-deep: #3f7fd1;
  --cyan: #4fe3e8;
  --gold: #f6c95c;
  --pink: #ff8fb8;
  --tile-a: #4c4669;
  --tile-b: #2e2a44;
  --back: #6d6fe2;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  font-family: "Baloo 2", "Nunito", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #43386f 0%, #6f5486 40%, #b9798a 75%, #e0a287 100%) fixed;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

button { font: inherit; color: inherit; cursor: pointer; }

/* ---------- Cielo con destellos ---------- */
.sky { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.sky i {
  position: absolute;
  width: var(--s); height: var(--s);
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 12px var(--c);
  opacity: 0;
  animation: twinkle var(--d) ease-in-out var(--delay) infinite, drift calc(var(--d) * 3) linear var(--delay) infinite;
}
.sky i.star { border-radius: 0; background: none; box-shadow: none; width: auto; height: auto; color: var(--c); font-size: var(--s); font-style: normal; }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.4); } 50% { opacity: .9; transform: scale(1); } }
@keyframes drift { to { translate: 0 -40px; } }

.frame {
  position: relative; z-index: 1;
  max-width: 880px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 16px 48px;
}

/* ---------- Cabecera ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; animation: drop .6s cubic-bezier(.2, 1.4, .4, 1) both; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-icon {
  width: 56px; height: 56px; object-fit: cover; border-radius: 16px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25), 0 0 0 3px rgba(255, 255, 255, .5);
  animation: bob 3s ease-in-out infinite;
}
h1 { margin: 0; font-size: clamp(1.6rem, 5vw, 2.3rem); font-weight: 800; color: #fff; line-height: 1; text-shadow: 0 3px 0 rgba(60, 40, 110, .45); }
h1 span { color: var(--gold); }
@keyframes bob { 50% { transform: translateY(-5px) rotate(-4deg); } }
@keyframes drop { from { opacity: 0; transform: translateY(-24px); } }

.mute {
  width: 48px; height: 48px; flex: none; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35);
  display: grid; place-items: center;
  transition: transform .2s, background .2s;
}
.mute:hover { background: rgba(255, 255, 255, .3); transform: scale(1.08) rotate(-6deg); }
.mute:active { transform: scale(.92); }
.mute svg { width: 24px; height: 24px; fill: #fff; stroke: #fff; stroke-width: 2; stroke-linecap: round; }
.mute .ico-off, .mute[aria-pressed="true"] .ico-on { display: none; }
.mute[aria-pressed="true"] .ico-off { display: block; }

/* ---------- Botones de cabecera y sección Utilidad ---------- */
.top-actions { display: flex; align-items: center; gap: 10px; }
.util-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 18px; border: 0; border-radius: 999px;
  background: linear-gradient(180deg, #ffe08a, #f6b93b);
  color: #5a3a00; font-weight: 800; font-size: 1.05rem;
  box-shadow: 0 4px 0 #c98a1c, 0 8px 18px rgba(0, 0, 0, .2);
  transition: transform .15s, filter .2s;
}
.util-btn svg { width: 22px; height: 22px; fill: #5a3a00; }
.util-btn:hover { filter: brightness(1.06); transform: translateY(-2px); }
.util-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #c98a1c; }
.util-btn[aria-pressed="true"] { background: linear-gradient(180deg, #fff, #e6e2fb); color: var(--ink); box-shadow: 0 4px 0 #b3acd9; }
.util-btn[aria-pressed="true"] svg { fill: var(--ink); }

.utility [hidden] { display: none !important; }
body.util-open .tabs, body.util-open .summary, body.util-open .board-wrap { display: none; }
.utility {
  margin-top: 22px; padding: 22px 18px;
  border-radius: 30px;
  background: var(--panel);
  box-shadow: 7px -7px 0 var(--gold), 0 18px 40px rgba(30, 15, 70, .35);
  animation: pop .45s cubic-bezier(.2, 1.4, .4, 1) both;
}
.util-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.util-head h2 { margin: 0; font-size: 1.6rem; font-weight: 800; }
.util-back { border: 0; border-radius: 999px; padding: 6px 16px; background: var(--pill); font-weight: 800; }
.util-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.util-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 20px; border: 2px solid var(--row-line); border-radius: 24px;
  background: var(--row); text-align: left;
  animation: row-in .5s cubic-bezier(.2, 1.3, .4, 1) both;
  transition: transform .2s, box-shadow .2s;
}
.util-card + .util-card { animation-delay: .08s; }
.util-card:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 10px 22px rgba(80, 60, 160, .2); }
.util-ico { font-size: 2.4rem; animation: bob 3s ease-in-out infinite; }
.util-card b { font-size: 1.2rem; }
.util-card small { color: var(--ink-soft); font-weight: 600; font-size: .95rem; }
.util-soon { display: grid; place-items: center; gap: 4px; min-height: 220px; text-align: center; animation: pop .4s both; }
.util-soon span { font-size: 3.5rem; animation: bob 3s ease-in-out infinite; }
.util-soon p { margin: 0; font-size: 1.15rem; }
/* Mapas Robo de huevos: selector de la puerta azul */
.egg-q { margin: 0 0 14px; font-size: 1.15rem; font-weight: 700; text-align: center; }
.egg-q .blue { color: #2f7fe0; } .egg-q .orange { color: #e07a20; }
.door-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 420px; margin: 0 auto; }
.door {
  position: relative; aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 2px solid #3a3a6a; border-radius: 18px;
  background: linear-gradient(180deg, #2c2c52, #1f1f3d); color: #fff; font-weight: 800;
  box-shadow: 0 4px 0 #15152b; transition: transform .15s, box-shadow .2s, border-color .2s;
  animation: pop .4s cubic-bezier(.2, 1.5, .4, 1) both;
}
button.door:hover { transform: translateY(-3px) scale(1.04); border-color: #5aa8ff; box-shadow: 0 6px 0 #15152b, 0 0 16px rgba(90, 168, 255, .6); }
button.door:active { transform: translateY(2px); }
.door.on { border-color: #5aa8ff; box-shadow: 0 0 0 3px #5aa8ff, 0 0 22px rgba(90, 168, 255, .9); }
.door b { font-size: .9rem; }
.door-n { position: absolute; top: 6px; right: 10px; font-size: .8rem; opacity: .6; }
.door-arrow { position: absolute; top: 4px; left: 10px; color: #5ad0ff; font-size: 1.1rem; }
.door-ico { font-size: 2rem; }
.door-ico.blue { filter: hue-rotate(190deg) saturate(2) brightness(1.2); }
.door.center { cursor: default; background: linear-gradient(180deg, #3a2a1a, #251a10); border-color: #8a5a20; }
.door.center b { color: #ffb050; }
.egg-result { margin-top: 16px; padding: 14px; border-radius: 18px; background: var(--row); text-align: center; animation: pop .35s both; }
.egg-result p { margin: 0 0 6px; }
.door-back {
  display: inline-block; margin-bottom: 8px; padding: 4px 12px;
  border: 0; border-radius: 999px; background: var(--pill);
  font-size: .9rem; font-weight: 700; color: var(--ink-soft);
  transition: background .2s, color .2s;
}
.door-back:hover { background: #c3bde6; color: var(--ink); }
.egg-result .orange { color: #e07a20; }
.entry-pick { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 12px; }
.entry {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px; border: 3px solid var(--row-line); border-radius: 16px; background: #fff;
  transition: transform .15s, border-color .2s, box-shadow .2s;
}
.entry img { width: 150px; height: 120px; object-fit: cover; border-radius: 10px; }
.entry:hover { transform: translateY(-3px) scale(1.03); border-color: #e07a20; }
.entry.on { border-color: #e07a20; box-shadow: 0 0 0 3px rgba(224, 122, 32, .3), 0 0 18px rgba(224, 122, 32, .5); }
.egg-map .zoom { background: #17142b; aspect-ratio: 16 / 9; }
.egg-result:has(.egg-map) { padding: 0; background: none; }
.egg-result .credit { margin-top: 4px; font-size: .75rem; opacity: .7; }

/* Planificador de Hogar */
.lvl-pick { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.lvl {
  min-width: 42px; height: 38px; border: 2px solid var(--row-line); border-radius: 12px;
  background: var(--row); font-weight: 800; font-size: 1rem;
  transition: transform .15s, background .2s;
}
.lvl:hover { transform: translateY(-2px); }
.lvl.empty { opacity: .5; }
.lvl.on { background: linear-gradient(180deg, #7dbaff, var(--blue-deep)); color: #fff; border-color: transparent; box-shadow: 0 3px 0 #2e62a8; opacity: 1; }
.zoom-wrap { position: relative; }
.zoom {
  position: relative; overflow: hidden; touch-action: none; cursor: grab;
  border-radius: 18px; background: #e8f0e4; aspect-ratio: 16 / 9;
  box-shadow: inset 0 0 0 2px var(--row-line);
  animation: pop .35s both;
}
.zoom:active { cursor: grabbing; }
.zoom img { display: block; width: 100%; height: 100%; object-fit: contain; transform-origin: 0 0; user-select: none; will-change: transform; }
.zoom-ctl { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 6px; }
.zoom-ctl button {
  width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .92); font-size: 1.2rem; font-weight: 800;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
}
.zoom-ctl button:hover { transform: scale(1.08); }
.credit { margin: 10px 0 0; font-size: .85rem; color: var(--ink-soft); }
.credit a { color: var(--blue-deep); font-weight: 700; }

@media (max-width: 620px) { .util-btn span { display: none; } .util-btn { width: 48px; padding: 0; justify-content: center; } }

/* ---------- Pestañas ---------- */
.tabs {
  position: relative;
  display: grid; grid-template-columns: repeat(3, 1fr);
  margin: 22px 0 14px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25);
  animation: drop .6s .08s cubic-bezier(.2, 1.4, .4, 1) both;
}
.tab {
  position: relative; z-index: 1;
  border: 0; background: none;
  padding: 10px 0;
  font-size: 1.15rem; font-weight: 800;
  color: rgba(255, 255, 255, .85);
  transition: color .3s, transform .15s;
}
.tab:active { transform: scale(.95); }
.tab[aria-selected="true"] { color: var(--ink); }
.tab-indicator {
  position: absolute; top: 5px; bottom: 5px; left: 5px;
  width: calc((100% - 10px) / 3);
  border-radius: 999px;
  background: linear-gradient(180deg, #fff, #e6e2fb);
  box-shadow: 0 4px 14px rgba(40, 20, 90, .3);
  transition: transform .45s cubic-bezier(.3, 1.5, .5, 1);
}
.tabs[data-active="weekly"] .tab-indicator { transform: translateX(100%); }
.tabs[data-active="events"] .tab-indicator { transform: translateX(200%); }

/* ---------- Resumen ---------- */
.summary {
  padding: 14px 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, .14);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .22);
  color: #fff;
  animation: drop .6s .16s cubic-bezier(.2, 1.4, .4, 1) both;
}
.summary-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.summary-label { font-weight: 700; font-size: 1.05rem; }
.summary-count { font-weight: 800; font-size: 1.3rem; }
.summary-count.bump { animation: bump .4s; }
@keyframes bump { 40% { transform: scale(1.35); color: var(--gold); } }

.bar { height: 14px; margin: 8px 0 10px; border-radius: 999px; background: rgba(30, 20, 70, .3); overflow: hidden; }
.bar-fill {
  height: 100%; width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--blue), var(--pink));
  background-size: 200% 100%;
  animation: flow 3s linear infinite;
  transition: width .7s cubic-bezier(.3, 1.3, .5, 1);
  box-shadow: 0 0 12px rgba(79, 227, 232, .7);
}
@keyframes flow { to { background-position: -200% 0; } }

.tally { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tally li {
  display: flex; align-items: center; gap: 4px;
  padding: 2px 10px 2px 3px;
  border-radius: 999px;
  background: rgba(30, 20, 70, .3);
  font-weight: 800; font-size: .95rem;
  animation: pop .4s cubic-bezier(.2, 1.6, .4, 1) both;
}
.tally img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.tally .empty { padding: 2px 10px; font-weight: 600; opacity: .8; }
.reset { font-size: .95rem; font-weight: 600; opacity: .9; }

/* ---------- Tablero ---------- */
.board-wrap {
  position: relative;
  margin-top: 18px;
  padding: 14px 14px 18px 0;
  border-radius: 34px;
  background: linear-gradient(160deg, #8a7af0, var(--back));
  box-shadow: 0 18px 40px rgba(30, 15, 70, .35);
}
.board {
  position: relative;
  margin-left: 14px;
  padding: 22px 18px;
  border-radius: 28px 70px 28px 28px;
  background: var(--panel);
  box-shadow: 7px -7px 0 var(--gold), 0 0 0 3px rgba(255, 255, 255, .7) inset;
  min-height: 200px;
}
.board.out-left { animation: out-left .22s ease-in forwards; }
.board.out-right { animation: out-right .22s ease-in forwards; }
@keyframes out-left { to { opacity: 0; transform: translateX(-40px); } }
@keyframes out-right { to { opacity: 0; transform: translateX(40px); } }

.group + .group { margin-top: 22px; }
.group-title {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 12px 6px;
  padding: 4px 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, #7d73e6, #a28af0);
  color: #fff; font-size: 1.05rem; font-weight: 800;
  box-shadow: 0 4px 0 #5d52c4;
  animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) both;
}
.group-title small { font-weight: 700; opacity: .85; }

/* ---------- Tarea ---------- */
.task {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px 12px 26px;
  border-radius: 46px;
  background: var(--row);
  border: 2px solid var(--row-line);
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  animation: row-in .55s cubic-bezier(.2, 1.3, .4, 1) calc(var(--i) * 70ms) both;
  transition: background .35s, border-color .35s, transform .2s, box-shadow .2s;
}
.task + .task { margin-top: 10px; }
.task[hidden] { display: none !important; }   /* el display:grid de .task no debe anular el ocultado */
.task:hover { transform: translateY(-2px) scale(1.01); box-shadow: 0 8px 18px rgba(80, 60, 160, .18); }
.task:active { transform: scale(.985); }
.task.done { background: var(--row-done); border-color: #b5d0f5; }
@keyframes row-in { from { opacity: 0; transform: translateX(50px) scale(.95); } }

.task::after { /* brillo al completar */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .85) 50%, transparent 65%);
  transform: translateX(-120%);
  pointer-events: none;
}
.task.shine::after { animation: shine .8s ease-out; }
@keyframes shine { to { transform: translateX(120%); } }

.task-text { margin: 0; font-size: 1.15rem; font-weight: 600; line-height: 1.25; }
.task-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.count {
  display: inline-block; min-width: 56px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--pill);
  font-size: 1.25rem; font-weight: 800; text-align: center;
}
.count.bump { animation: bump .4s; }
.minus {
  width: 30px; height: 30px; border: 0; border-radius: 50%;
  background: var(--pill); font-weight: 800; font-size: 1.2rem; line-height: 1;
  opacity: 0; pointer-events: none; transform: scale(.5);
  transition: opacity .2s, transform .25s cubic-bezier(.2, 1.6, .4, 1), background .2s;
}
.task.has-progress .minus { opacity: 1; pointer-events: auto; transform: none; }
.minus:hover { background: #c3bde6; }

.note { margin: 2px 0 0; font-size: .95rem; color: var(--ink-soft); font-weight: 600; }

/* Borde de fuego (canvas detrás de la fila, sobresale por abajo y por la derecha) */
.fire-wrap { position: relative; margin: 0 26px 22px 0; }
.fire-wrap + .task, .task + .fire-wrap { margin-top: 10px; }
.fire-wrap > .task { position: relative; z-index: 1; }
.fire { position: absolute; left: 0; top: -10px; width: calc(100% + 26px); height: calc(100% + 32px); z-index: 0; pointer-events: none; }
.task.important:not(.done) { border-color: #ffb04d; }

/* Tarea importante */
.task.important:not(.done) {
  border-color: var(--gold);
  background: linear-gradient(90deg, #fff4d6, var(--row) 70%);
  animation: row-in .55s cubic-bezier(.2, 1.3, .4, 1) calc(var(--i) * 70ms) both, glow 2.2s ease-in-out infinite;
}
@keyframes glow { 50% { box-shadow: 0 0 0 4px rgba(246, 201, 92, .45), 0 0 22px rgba(246, 201, 92, .55); } }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 0 10px; border-radius: 999px;
  background: linear-gradient(90deg, #ff9a6b, #ff6fa0);
  color: #fff; font-size: .9rem; font-weight: 800;
  animation: wiggle 2.2s ease-in-out infinite;
}
.task.done .badge { animation: none; background: #9fb9e0; }
@keyframes wiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-6deg) scale(1.08); } 92% { transform: rotate(5deg) scale(1.08); } }

/* Tarea de puntos (actividad diaria) */
.task.points { cursor: default; }
.task.points .rewards:empty { display: none; }
.count img { width: 24px; height: 24px; margin-right: 4px; border-radius: 50%; vertical-align: -5px; }
.pts-btn {
  height: 32px; padding: 0 14px;
  border: 0; border-radius: 999px;
  background: linear-gradient(180deg, #7dbaff, var(--blue-deep));
  color: #fff; font-weight: 800; font-size: 1rem;
  box-shadow: 0 3px 0 #2e62a8;
  transition: transform .12s, box-shadow .12s, filter .2s;
}
.pts-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.pts-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #2e62a8; }
.all-btn {
  height: 32px; padding: 0 14px;
  border: 0; border-radius: 999px;
  background: linear-gradient(180deg, #8ff0d0, #2fb98f);
  color: #fff; font-weight: 800; font-size: 1rem;
  box-shadow: 0 3px 0 #1f8a69;
  transition: transform .12s, box-shadow .12s, filter .2s, opacity .25s;
}
.all-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.all-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #1f8a69; }
.task.done .all-btn { display: none; }
.pts-btn.neg { background: var(--pill); color: var(--ink); box-shadow: 0 3px 0 #b3acd9; }

.milestones {
  --tile: 52px;
  position: relative;
  display: grid; grid-template-columns: repeat(var(--n, 5), 1fr);
  margin: 12px 0 2px;
}
.milestones.many { --tile: 40px; }
@media (max-width: 620px) { .milestones.many { --tile: 24px; } .milestones.many .ms span { font-size: .7rem; } }
.ms-track {
  position: absolute; left: 0; right: 0;
  top: calc(26px + var(--tile) / 2 - 5px);
  height: 10px; border-radius: 999px;
  background: var(--pill); overflow: hidden;
}
.ms-fill {
  height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
  box-shadow: 0 0 10px rgba(79, 227, 232, .8);
  transition: width .7s cubic-bezier(.3, 1.3, .5, 1);
}
.ms { position: relative; z-index: 1; justify-self: end; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ms span { height: 24px; font-weight: 800; font-size: 1rem; color: var(--ink-soft); transition: color .3s; }
.ms .reward { width: var(--tile); height: var(--tile); }
.ms.reached span { color: var(--blue-deep); }
.ms.reached .reward { box-shadow: 0 0 0 3px var(--cyan), 0 0 14px rgba(79, 227, 232, .8); animation: pop .45s cubic-bezier(.2, 1.8, .4, 1); }
.ms.reached .reward-check { opacity: 1; transform: none; }
.task:hover .ms .reward { transform: none; }
.ms { cursor: pointer; }
.ms:hover .reward { transform: translateY(-3px) scale(1.08) !important; }
/* Niveles (holosimulador): las recompensas van en los hitos */
.task.levels .rewards { display: none; }
.task.levels .ms span { font-size: .85rem; }
.task.levels .ms:last-child .reward { box-shadow: 0 0 0 2px #c9a3ff, 0 4px 10px rgba(30, 20, 60, .3); }

/* Cargas acumulables (esencia de nervadura) */
.task.charges { cursor: default; grid-template-columns: 1fr auto; }
.task.charges .rewards { display: none; }
.orbs { display: inline-flex; gap: 6px; padding: 2px 4px; }
.orb {
  width: 24px; height: 24px; border-radius: 50%;
  border: 3px solid #b9b2e6;
  background: transparent;
  transition: background .3s, border-color .3s, transform .4s cubic-bezier(.2, 1.8, .4, 1), box-shadow .3s;
}
.orb.full {
  border-color: #8fd8ff;
  background: radial-gradient(circle at 35% 30%, #fff 0 12%, #8ee6ff 30%, #3f8fe6 75%);
  box-shadow: 0 0 10px rgba(79, 180, 255, .8);
  animation: orb-pulse 2.4s ease-in-out infinite;
}
.orb.full:nth-child(2) { animation-delay: .3s; }
.orb.full:nth-child(3) { animation-delay: .6s; }
@keyframes orb-pulse { 50% { transform: scale(1.12); box-shadow: 0 0 16px rgba(79, 200, 255, 1); } }
.full-badge { display: none; }
.task.charges.overflow .full-badge { display: inline-flex; }
.task.charges.overflow { border-color: #ff8fb8; animation: row-in .55s cubic-bezier(.2, 1.3, .4, 1) calc(var(--i) * 70ms) both, glow-pink 2s ease-in-out infinite; }
@keyframes glow-pink { 50% { box-shadow: 0 0 0 4px rgba(255, 143, 184, .4), 0 0 22px rgba(255, 143, 184, .5); } }

/* ---------- Semanales: tema del pase (rosa) ---------- */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, #7a4a86 0%, #c9739e 45%, #f2a7b8 80%, #fbd3c4 100%);
  opacity: 0; transition: opacity .8s ease;
}
body[data-section="weekly"]::before { opacity: 1; }
body[data-section="weekly"] { --back: #e98bb4; --gold: #ffd1e3; --row: #f6e4f0; --row-line: #ebc3db; --pill: #f0d2e4; --panel: #fdf3f8; }
.board-wrap, .board, .group-title, .task { transition: background .6s, box-shadow .6s, border-color .6s; }
body[data-section="weekly"] .board-wrap { background: linear-gradient(160deg, #f4a3c4, var(--back)); }
body[data-section="weekly"] .group-title { background: linear-gradient(90deg, #d86d9d, #f29ac0); box-shadow: 0 4px 0 #b84f80; }

.hero {
  position: relative;
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px;
  margin: -4px 0 22px;
  padding: 20px 22px;
  border-radius: 26px;
  background: radial-gradient(circle at 85% 40%, #fff6fb 0 18%, transparent 45%), linear-gradient(120deg, #ffd9e8, #f7b8d3 55%, #e9a6e6);
  box-shadow: 0 10px 26px rgba(200, 90, 140, .3), inset 0 0 0 3px rgba(255, 255, 255, .7);
  overflow: hidden;
  animation: pop .6s cubic-bezier(.2, 1.5, .4, 1) both;
}
.hero::before { /* destellos que cruzan */
  content: "✦  ·  ✧    ✦   ·   ✧  ✦"; position: absolute; left: -10%; top: 12%;
  color: rgba(255, 255, 255, .9); font-size: 1.2rem; letter-spacing: 1rem; white-space: nowrap;
  animation: drift-x 9s linear infinite;
}
@keyframes drift-x { to { transform: translateX(40%); } }
.hero-text { position: relative; z-index: 1; color: #6a2f55; }
.hero-kicker { margin: 0; font-size: .9rem; font-weight: 800; letter-spacing: .08em; color: #c0457c; }
.hero h2 { margin: 0; font-size: clamp(1.5rem, 4.5vw, 2.1rem); font-weight: 800; line-height: 1.05; color: #fff; text-shadow: 0 3px 0 #d0679a, 0 0 18px rgba(255, 255, 255, .6); }
.hero-star { margin: 6px 0 0; font-size: 1.1rem; font-weight: 700; }
.hero-star strong { padding: 0 10px; border-radius: 999px; background: #fff; color: #d0548c; box-shadow: 0 3px 0 #f0a8c8; }
.hero-note { margin: 8px 0 0; font-size: .95rem; font-weight: 600; opacity: .85; }

.hero-art { position: relative; width: 190px; height: 190px; margin: -16px -8px -16px 0; display: grid; place-items: center; }
.hero-art canvas { position: absolute; inset: 0; width: 100%; height: 100%; animation: pop .6s cubic-bezier(.2, 1.5, .4, 1) both; }
.hero-fallback { font-size: 80px; color: #fff; text-shadow: 0 0 24px #ff8fc0; animation: bob 3s ease-in-out infinite; }
.hero.has-3d .hero-fallback, .hero.has-img .hero-fallback { display: none; }

/* Retrato oficial del protagonista */
.portrait, .halo, .tw { display: none; }
.hero.has-img .portrait, .hero.has-img .halo, .hero.has-img .tw { display: block; }
.hero { --rx: 0; --ry: 0; }
.portrait {
  position: relative; z-index: 1;
  width: 170px; height: 170px; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #fff 0 35%, #ffd6e8 70%, #f6a9cb);
  box-shadow: 0 0 0 4px #fff, 0 0 0 9px rgba(255, 255, 255, .45), 0 12px 30px rgba(200, 80, 140, .45), 0 0 40px rgba(255, 190, 220, .9);
  overflow: hidden;
  transform: perspective(600px) rotateX(calc(var(--rx) * -14deg)) rotateY(calc(var(--ry) * 18deg));
  transition: transform .25s ease-out;
  animation: float-portrait 3.4s ease-in-out infinite;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; transform: translate(calc(var(--ry) * -8px), calc(var(--rx) * -6px)) scale(1.08); transition: transform .25s ease-out; }
.portrait::after { /* brillo que barre el retrato */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, .55) 50%, transparent 60%);
  transform: translateX(-120%);
  animation: sheen 4.5s ease-in-out 1s infinite;
}
@keyframes sheen { 0%, 60% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
@keyframes float-portrait { 50% { translate: 0 -7px; } }
.halo {
  position: absolute; z-index: 2; top: 4px; left: 50%;
  width: 92px; height: 22px; margin-left: -46px;
  border: 4px solid #fff3a8; border-radius: 50%;
  box-shadow: 0 0 14px #fff3a8, inset 0 0 8px #fff3a8;
  animation: halo 3.4s ease-in-out infinite;
}
@keyframes halo { 50% { transform: translateY(-9px) rotate(-5deg); } }
.tw { position: absolute; z-index: 3; color: #fff; text-shadow: 0 0 10px #ff8fc0; animation: twinkle 2.4s ease-in-out infinite; }
.t1 { top: 18%; left: 2%; font-size: 22px; }
.t2 { bottom: 14%; right: 0; font-size: 18px; animation-delay: .8s; }
.t3 { top: 6%; right: 10%; font-size: 14px; animation-delay: 1.5s; }

@media (max-width: 620px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero-art { justify-self: center; grid-row: 1; width: 160px; height: 160px; margin: -12px 0 -8px; }
  .portrait { width: 140px; height: 140px; }
}

/* Retrato pequeño junto al nombre (alfas) */
.task-text .avatar {
  float: left; width: 58px; height: 58px; margin: 0 12px 0 -8px;
  border-radius: 16px; object-fit: cover;
  box-shadow: 0 0 0 3px #fff, 0 4px 12px rgba(80, 60, 160, .3);
  transition: transform .3s cubic-bezier(.2, 1.6, .4, 1);
}
.task:hover .avatar { transform: rotate(-6deg) scale(1.08); }
.task.done .avatar { filter: saturate(.6); }

/* Coste de una tarea */
.cost { margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cost span {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 10px 1px 4px; border-radius: 999px;
  background: rgba(120, 90, 200, .12);
  font-size: .9rem; font-weight: 700; color: var(--ink-soft);
}
.cost img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.cost b { color: var(--ink); }

/* ---------- Eventos: tema atardecer (naranja) ---------- */
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, #5a74c9 0%, #8fa8e8 35%, #f3a76b 75%, #ffcf8a 100%);
  opacity: 0; transition: opacity .8s ease;
}
body[data-section="events"]::after { opacity: 1; }
body[data-section="events"] { --back: #f0905a; --gold: #ffe0a8; --row: #fdeee2; --row-line: #f5cfb0; --pill: #f8dcc6; --panel: #fff7f0; }
body[data-section="events"] .board-wrap { background: linear-gradient(160deg, #ffb27a, var(--back)); }
body[data-section="events"] .group-title { background: linear-gradient(90deg, #f07a45, #ffa765); box-shadow: 0 4px 0 #c85a2c; }
.hero--sunset {
  background:
    radial-gradient(ellipse at 85% 30%, rgba(255, 240, 180, .7), transparent 50%),
    linear-gradient(120deg, #6c8fe0, #f39a63 60%, #ffcb7d);
  box-shadow: 0 10px 26px rgba(220, 110, 50, .35), inset 0 0 0 3px rgba(255, 255, 255, .6);
}
.hero--sunset .hero-text { color: #4a2a14; }
.hero--sunset .hero-kicker { color: #fff3d6; }
.hero--sunset h2 { text-shadow: 0 3px 0 #d9662d, 0 0 18px rgba(255, 220, 160, .8); }
.hero--sunset .hero-star strong { color: #d9662d; box-shadow: 0 3px 0 #ffc59a; }
.hero--sunset .portrait { box-shadow: 0 0 0 4px #fff, 0 0 0 9px rgba(255, 220, 170, .5), 0 12px 30px rgba(210, 100, 40, .45), 0 0 40px rgba(255, 200, 120, .9); }
.hero--sunset .halo { border-color: #ffd36b; box-shadow: 0 0 14px #ffb84d, inset 0 0 8px #ffb84d; }

/* Requisitos de la temática (Estrella Glamurosa) */
.glam-req { display: inline-flex; align-items: center; gap: 4px; margin: 2px 2px; padding: 1px 10px 1px 3px; border-radius: 999px; background: #dff0ff; color: #2a6ab8; font-weight: 800; }
.glam-req img { width: 22px; height: 22px; border-radius: 50%; }

/* Consejo destacado que aparece tras la primera acción */
.big-tip {
  display: none; align-items: center; gap: 14px;
  margin: 10px 0; padding: 14px 18px;
  border-radius: 22px;
  background: linear-gradient(120deg, #fff4c2, #ffe08a 50%, #fff4c2);
  background-size: 200% 100%;
  border: 3px solid #ffc83d;
  color: #5a3a00; font-weight: 600; line-height: 1.4;
  box-shadow: 0 0 0 4px rgba(255, 200, 61, .25), 0 10px 24px rgba(220, 150, 20, .3);
  animation: tip-in .7s cubic-bezier(.2, 1.6, .4, 1) both, ev-flow 4s linear infinite, tip-glow 2s ease-in-out infinite;
}
.group.tip-on .big-tip { display: flex; }
.big-tip img { width: 60px; height: 60px; flex: none; border-radius: 50%; animation: wiggle 2.2s ease-in-out infinite, bob 3s ease-in-out infinite; filter: drop-shadow(0 0 10px #ffd23d); }
.big-tip p { margin: 0; }
.big-tip b { color: #b45a00; }
@keyframes tip-in { from { opacity: 0; transform: translateY(-14px) scale(.9); } }
@keyframes tip-glow { 50% { box-shadow: 0 0 0 7px rgba(255, 200, 61, .35), 0 0 26px rgba(255, 190, 40, .8); } }

/* Cabecera del Descubrimiento de Aniimo: cielo */
.hero--sky {
  background: radial-gradient(ellipse at 80% 20%, rgba(255, 255, 255, .7), transparent 50%), linear-gradient(135deg, #3d8fd8, #8ed0f2 60%, #ffe58a);
  box-shadow: 0 10px 26px rgba(40, 120, 200, .35), inset 0 0 0 3px rgba(255, 255, 255, .7);
}
.hero--sky .hero-text { color: #eaf7ff; }
.hero--sky .hero-kicker { color: #fff3a8; }
.hero--sky h2 { text-shadow: 0 3px 0 #2368b0, 0 0 18px rgba(200, 240, 255, .8); }
.hero--sky .hero-star strong { color: #2a7ac8; box-shadow: 0 3px 0 #a8dcff; }
.hero--sky .portrait { box-shadow: 0 0 0 4px #fff, 0 0 0 9px rgba(255, 230, 120, .45), 0 12px 30px rgba(30, 90, 160, .45), 0 0 40px rgba(255, 230, 120, .9); }

/* Cabecera de las Islas Susurromarea: mar turquesa */
.hero--sea {
  background:
    radial-gradient(ellipse at 85% 20%, rgba(255, 255, 255, .6), transparent 45%),
    linear-gradient(135deg, #2a7fd6, #36c3d9 55%, #ff9fb8);
  box-shadow: 0 10px 26px rgba(30, 110, 180, .35), inset 0 0 0 3px rgba(255, 255, 255, .6);
}
.hero--sea .hero-text { color: #eafcff; }
.hero--sea .hero-kicker { color: #fff3a8; }
.hero--sea h2 { text-shadow: 0 3px 0 #1d5fa8, 0 0 18px rgba(170, 240, 255, .8); }
.hero--sea .hero-star strong { color: #1d6fc0; box-shadow: 0 3px 0 #a8dcff; }
.hero--sea .portrait { box-shadow: 0 0 0 4px #fff, 0 0 0 9px rgba(170, 240, 255, .45), 0 12px 30px rgba(20, 80, 150, .45), 0 0 40px rgba(120, 230, 255, .9); }
.hero--sea .halo { border-color: #bff6ff; box-shadow: 0 0 14px #6fe3ff, inset 0 0 8px #6fe3ff; }

/* Cabecera del Desfile nocturno: noche de calabazas */
.hero--night {
  background:
    radial-gradient(circle at 80% 18%, rgba(255, 240, 220, .55), transparent 22%),
    radial-gradient(ellipse at 20% 100%, rgba(255, 140, 50, .55), transparent 55%),
    linear-gradient(135deg, #3b2370, #6c3a9a 55%, #b5568f);
  box-shadow: 0 10px 26px rgba(60, 25, 100, .45), inset 0 0 0 3px rgba(255, 210, 160, .5);
}
.hero--night .hero-text { color: #f6e7ff; }
.hero--night .hero-kicker { color: #ffb36b; }
.hero--night h2 { text-shadow: 0 3px 0 #c45a1c, 0 0 20px rgba(255, 160, 80, .8); }
.hero--night .hero-star strong { color: #c45a1c; box-shadow: 0 3px 0 #ffc59a; }
.hero--night .portrait { box-shadow: 0 0 0 4px #ffd9b0, 0 0 0 9px rgba(255, 170, 90, .35), 0 12px 30px rgba(40, 15, 70, .6), 0 0 44px rgba(255, 140, 60, .85); }
.hero--night .halo { border-color: #ffb36b; box-shadow: 0 0 14px #ff8a3d, inset 0 0 8px #ff8a3d; }

/* Cabecera de evento legendario: aurora nocturna */
.hero--aurora {
  background:
    radial-gradient(ellipse at 20% 10%, rgba(120, 255, 220, .35), transparent 50%),
    radial-gradient(ellipse at 80% 0%, rgba(255, 140, 220, .45), transparent 55%),
    linear-gradient(135deg, #2b2463, #5b3b8f 55%, #c46aa8);
  box-shadow: 0 10px 26px rgba(60, 30, 110, .45), inset 0 0 0 3px rgba(255, 255, 255, .35);
}
.hero--aurora .hero-text { color: #f4e9ff; }
.hero--aurora .hero-kicker { color: #ffb3e6; }
.hero--aurora h2 { text-shadow: 0 3px 0 #7b3fa6, 0 0 22px rgba(255, 170, 240, .8); }
.hero--aurora .hero-star strong { color: #8a3fb0; box-shadow: 0 3px 0 #c9a3ff; }
.hero--aurora .portrait {
  background: radial-gradient(circle, #6b4aa8, #2b2463);
  box-shadow: 0 0 0 4px #ffd6f5, 0 0 0 9px rgba(255, 200, 245, .35), 0 12px 30px rgba(40, 20, 90, .6), 0 0 44px rgba(255, 150, 230, .9);
}
.hero--aurora .halo { border-color: #ffc4f0; box-shadow: 0 0 14px #ff9be0, inset 0 0 8px #ff9be0; }
.group .hero { margin-top: 0; }
.group + .group .hero { margin-top: 8px; }

/* Grupo opcional plegable */
.group-title-wrap { margin: 0; }
button.group-title { border: 0; cursor: pointer; transition: transform .15s, background .4s, box-shadow .4s; }
button.group-title:hover { transform: translateY(-1px); }
button.group-title:active { transform: translateY(2px); }
.group-title.optional { background: linear-gradient(90deg, #9a8fb8, #b7a6d6); box-shadow: 0 4px 0 #7a6e9c; }
.group-title em { font-style: normal; font-size: .8rem; padding: 0 8px; border-radius: 999px; background: rgba(255, 255, 255, .25); }
.chev { display: inline-block; transition: transform .3s cubic-bezier(.2, 1.6, .4, 1); }
.group.collapsed .chev { transform: rotate(-90deg); }

/* Grupo completado: verde y plegado */
.done-tag { display: none; }
.group-title em.event-tag {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 12px; margin-left: 2px;
  font-size: .95rem; font-weight: 800; letter-spacing: .06em;
  color: #6a3a00;
  background: linear-gradient(90deg, #ffe066, #ffb534, #ffe066);
  background-size: 200% 100%;
  box-shadow: 0 3px 0 #d08a12, 0 0 0 2px #fff6c2 inset, 0 0 14px rgba(255, 200, 60, .9);
  animation: ev-pulse 1.6s ease-in-out infinite, ev-flow 3s linear infinite;
}
.event-tag i { font-style: normal; color: #fff; text-shadow: 0 0 6px #ff9a00; animation: ev-spin 2.4s linear infinite; display: inline-block; }
.event-tag::after { /* destello que cruza */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .95) 50%, transparent 70%);
  transform: translateX(-130%);
  animation: ev-shine 2.2s ease-in-out infinite;
}
@keyframes ev-pulse { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.12) rotate(-2deg); box-shadow: 0 3px 0 #d08a12, 0 0 0 2px #fff6c2 inset, 0 0 24px rgba(255, 210, 60, 1); } }
@keyframes ev-flow { to { background-position: -200% 0; } }
@keyframes ev-spin { to { transform: rotate(360deg); } }
@keyframes ev-shine { 0%, 40% { transform: translateX(-130%); } 80%, 100% { transform: translateX(130%); } }
.group.complete .event-tag { animation: none; filter: saturate(.6); }
.group.complete .event-tag::after, .group.complete .event-tag i { animation: none; }
.group.complete .done-tag { display: inline; animation: pop .45s cubic-bezier(.2, 1.8, .4, 1); }
.group.complete .group-title, body[data-section="weekly"] .group.complete .group-title {
  background: linear-gradient(90deg, #36c79a, #7fe0bf); box-shadow: 0 4px 0 #23987a;
}

/* Barra de recompensas común a un grupo (holobatalla) */
.group-track { margin: 0 0 12px; padding: 12px 18px 14px; border-radius: 22px; background: linear-gradient(135deg, #2c3a8f, #4a5bd0); color: #fff; box-shadow: 0 6px 16px rgba(40, 50, 140, .3); }
.gt-head { display: flex; justify-content: space-between; align-items: center; font-weight: 800; }
.group-track .count { background: rgba(255, 255, 255, .18); color: #fff; }
.gt-bar { position: relative; height: 10px; margin: 14px 0 0; border-radius: 999px; background: rgba(255, 255, 255, .2); }
.gt-fill { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #ffe680, #ffb84d); box-shadow: 0 0 10px #ffd34d; transition: width .7s cubic-bezier(.3, 1.3, .5, 1); }
.gt-dot { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: #8fa0ff; border: 2px solid #fff; transition: background .3s, transform .3s; }
.gt-dot.reached { background: #ffd34d; transform: scale(1.25); }
.gt-sub { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin: 4px 0 0; font-size: .9rem; font-weight: 600; opacity: .9; }
.gt-sub img { width: 20px; height: 20px; border-radius: 50%; }
.gt-tiles { position: relative; height: 80px; margin-top: 10px; }
.gt-tile { position: absolute; top: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; transform: translateX(-50%); }
.gt-at { display: inline-flex; align-items: center; gap: 2px; padding: 0 6px; border-radius: 999px; background: rgba(255, 255, 255, .18); font-size: .8rem; font-weight: 800; white-space: nowrap; }
.gt-at img { width: 14px; height: 14px; border-radius: 50%; }
.gt-tile.reached .gt-at { background: #ffd34d; color: #5a3a00; }
.gt-tile .reward { width: 48px; height: 48px; }
.gt-tile:first-child { transform: translateX(-20%); }
.gt-tile:last-child { transform: translateX(-80%); }
.gt-tile.reached .reward { box-shadow: 0 0 0 3px #ffd34d, 0 0 14px rgba(255, 211, 77, .8); }
.gt-tile.reached .reward-check { opacity: 1; transform: none; }

/* Primergía */
.energy { margin-top: 8px; cursor: default; }
.en-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 800; }
.en-row img { width: 30px; height: 30px; border-radius: 50%; }
.en-input, .en-max {
  font: inherit; font-weight: 800; color: var(--ink);
  padding: 2px 10px; border-radius: 999px;
  border: 2px solid var(--row-line); background: #fff;
}
.en-input { width: 84px; text-align: center; font-size: 1.1rem; }
.en-input:focus, .en-max:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(91, 155, 230, .25); }
.en-full { margin-left: 4px; font-size: .95rem; color: var(--ink-soft); }
.en-spend { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.en-spend .pts-btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.omega-pop {
  margin-top: 8px; padding: 10px 12px; border-radius: 18px;
  background: #fff; border: 2px solid var(--row-line);
  box-shadow: 0 8px 20px rgba(80, 60, 160, .2);
  animation: pop .35s cubic-bezier(.2, 1.6, .4, 1) both;
}
.omega-pop p { margin: 0 0 8px; font-weight: 800; }
.omega-pop > div { display: flex; gap: 8px; flex-wrap: wrap; }
.omega-opt {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  width: 84px; padding: 6px; border: 2px solid var(--row-line); border-radius: 14px;
  background: var(--row); font-weight: 700; font-size: .85rem;
  transition: transform .15s, border-color .2s;
}
.omega-opt img { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; }
.omega-opt b { font-size: .8rem; color: var(--ink-soft); }
.omega-opt:hover:not(:disabled) { transform: translateY(-2px) scale(1.05); border-color: var(--blue); }
.omega-opt:disabled { opacity: .4; cursor: not-allowed; }
.en-pass { background: linear-gradient(180deg, #ffd36b, #e59a2f); box-shadow: 0 3px 0 #b8741c; }
.en-input.bump { animation: bump .4s; }
.en-bar { height: 10px; margin: 8px 0 6px; border-radius: 999px; background: var(--pill); overflow: hidden; }
.en-fill { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #6fd3ff, #3f7fd1); box-shadow: 0 0 10px rgba(79, 180, 255, .7); transition: width .6s cubic-bezier(.3, 1.3, .5, 1), background .4s; }
.en-tip { margin: 0; padding: 8px 12px; border-radius: 14px; background: rgba(91, 155, 230, .12); font-size: .95rem; font-weight: 600; line-height: 1.35; }
.en-tip b { color: var(--blue-deep); }
.en-alfas { margin-top: 6px; }
.en-alfas summary { cursor: pointer; font-weight: 800; color: var(--blue-deep); }
.en-alfas ul { margin: 6px 0 0; padding-left: 18px; }
.en-alfas li { margin: 2px 0; }
.task.energy.near-full .en-fill { background: linear-gradient(90deg, #ffd36b, #ff9a6b); }
.task.energy.near-full .en-full { color: #c26a1f; }
.task.energy.overflow { border-color: #ff8fb8; animation: row-in .55s cubic-bezier(.2, 1.3, .4, 1) calc(var(--i) * 70ms) both, glow-pink 2s ease-in-out infinite; }
.task.energy.overflow .en-fill { background: linear-gradient(90deg, #ff8fb8, #ff5c8a); }
.task.energy.overflow .en-full { color: #d0386c; }

/* Fases semanales de un evento */
.phases { margin: 0 0 12px; padding: 12px 14px; border-radius: 22px; background: linear-gradient(135deg, #3a3480, #6a5ad0); color: #fff; box-shadow: 0 6px 16px rgba(60, 40, 140, .3); }
.phases ol { display: flex; justify-content: space-between; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ph { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1; }
.ph img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px rgba(255, 255, 255, .5); transition: transform .3s; }
.ph b { font-size: .95rem; opacity: .75; }
.ph span { font-size: .78rem; font-weight: 800; white-space: nowrap; }
.ph--past img { filter: grayscale(.8) brightness(.8); opacity: .6; }
.ph--past::after { content: "✓"; position: absolute; top: 14px; font-weight: 800; font-size: 1.3rem; color: #8ff0d0; text-shadow: 0 1px 3px #000; }
.ph--now img { width: 66px; height: 66px; box-shadow: 0 0 0 3px #fff, 0 0 18px rgba(200, 170, 255, .95); animation: bob 3s ease-in-out infinite; }
.ph--now b { opacity: 1; padding: 0 10px; border-radius: 999px; background: #fff; color: #5a48c0; }
.phases p { margin: 8px 0 0; text-align: center; font-weight: 700; font-size: .92rem; opacity: .95; }
@media (max-width: 620px) { .ph img { width: 38px; height: 38px; } .ph--now img { width: 50px; height: 50px; } }

/* Evento temporal */
.event-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; padding: 8px 10px 8px 16px; border-radius: 16px; background: linear-gradient(90deg, #ffe1c2, #ffd0de); font-weight: 700; color: #8a4a3a; }
.event-hide, .event-show {
  border: 0; border-radius: 999px; padding: 4px 14px;
  background: #fff; color: #c0573c; font-weight: 800; font-size: .9rem;
  box-shadow: 0 3px 0 #f0b9a3; transition: transform .12s;
}
.event-hide:hover, .event-show:hover { transform: translateY(-1px); }
.event-show { display: block; margin: 18px auto 0; background: rgba(255, 255, 255, .7); color: var(--ink-soft); box-shadow: none; }
.task[data-id="ev-actividad"] { cursor: default; }

/* Grupo cerrado hoy (solo ciertos días) */
.lock-note {
  margin: 0 0 10px; padding: 8px 16px;
  border-radius: 16px;
  background: rgba(120, 100, 180, .12);
  font-weight: 700; color: var(--ink-soft);
}
.group.locked .task { filter: grayscale(.7); opacity: .6; cursor: not-allowed; }
.group.locked .task:hover { transform: none; box-shadow: none; }
.group.locked .group-title { background: linear-gradient(90deg, #a49bb8, #c2b8d4); box-shadow: 0 4px 0 #857b9c; }

/* Animación de plegado (filas de la rejilla de 1fr a 0fr) */
.group-body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .5s cubic-bezier(.4, 0, .2, 1), opacity .4s; }
.group-inner { min-height: 0; overflow: hidden; padding: 4px 6px 6px; margin: -4px -6px -6px; }
.group.collapsed .group-body { grid-template-rows: 0fr; opacity: 0; }
.group.collapsed + .group { margin-top: 12px; }
.group:has(.optional) .task { opacity: .95; }

/* Selector de rango */
.rank-pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 2px; cursor: default; }
.rank-pick img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px #fff, 0 4px 10px rgba(80, 60, 160, .25); animation: bob 3s ease-in-out infinite; }
.rank-pick select {
  font: inherit; font-weight: 700; color: var(--ink);
  padding: 4px 10px; border-radius: 999px;
  border: 2px solid var(--row-line); background: #fff;
  cursor: pointer;
}
.slots { font-size: .9rem; font-weight: 700; color: var(--ink-soft); }

/* Recompensas */
.rewards { display: flex; gap: 8px; }
.reward {
  position: relative;
  width: 64px; height: 64px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--tile-a), var(--tile-b));
  box-shadow: 0 4px 10px rgba(30, 20, 60, .3), inset 0 0 0 2px rgba(255, 255, 255, .08);
  overflow: hidden;
  transition: transform .25s cubic-bezier(.2, 1.6, .4, 1);
}
.reward img { width: 100%; height: 100%; object-fit: cover; opacity: .95; }
.reward span {
  position: absolute; right: 5px; bottom: 1px;
  color: #fff; font-weight: 800; font-size: 1rem;
  text-shadow: 0 1px 2px #000, 0 0 4px #000;
}
.task:hover .reward { transform: rotate(-4deg) scale(1.06); }
.task:hover .reward + .reward { transform: rotate(4deg) scale(1.06); }
.reward-check {
  position: absolute; inset: 0; margin: auto;
  width: 60%; height: 60%;
  fill: none; stroke: var(--cyan); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5));
  opacity: 0; transform: scale(.3);
  transition: opacity .2s, transform .35s cubic-bezier(.2, 1.8, .4, 1);
}
.task.done .reward-check { opacity: 1; transform: none; }
.task.done .reward + .reward .reward-check { transition-delay: .08s; }

/* Botón de check grande */
.check {
  width: 92px; height: 92px; flex: none;
  border: 0; padding: 0; background: none;
  border-radius: 50%;
  transition: transform .2s cubic-bezier(.2, 1.6, .4, 1);
}
.check:hover { transform: scale(1.07); }
.check:active { transform: scale(.88); }
.check svg { width: 100%; height: 100%; overflow: visible; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.check .track { stroke: #cfc9ef; stroke-width: 7; stroke-dasharray: 3 9; }
.check .ring {
  stroke: var(--blue); stroke-width: 9;
  stroke-dasharray: 88 100;
  stroke-dashoffset: calc(88 - 88 * var(--p, 0));
  transition: stroke-dashoffset .6s cubic-bezier(.3, 1.2, .5, 1), opacity .2s;
}
.task:not(.done):not(.has-progress) .ring { opacity: 0; }
.check .dot { fill: var(--blue); opacity: 0; transform-origin: 66px 14px; transform: scale(0); transition: opacity .2s .35s, transform .4s .35s cubic-bezier(.2, 2, .4, 1); }
.check .tick { stroke: var(--blue); stroke-width: 9; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset .4s cubic-bezier(.5, 0, .3, 1.2) .15s; }
.task:not(.done):hover .tick { stroke-dashoffset: 0; stroke: #cfc9ef; transition-delay: 0s; }
.task.done .tick { stroke-dashoffset: 0; }
.task.done .dot { opacity: 1; transform: none; }
.task.done .check svg { animation: stamp .5s cubic-bezier(.2, 1.8, .4, 1); }
@keyframes stamp { 0% { transform: scale(1.4) rotate(-10deg); } 100% { transform: none; } }

/* Vacío */
.empty-state { display: grid; place-items: center; gap: 6px; min-height: 220px; text-align: center; color: var(--ink-soft); animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.empty-state img { width: 84px; border-radius: 20px; animation: bob 3s ease-in-out infinite; }
.empty-state p { margin: 0; font-size: 1.15rem; font-weight: 700; }

/* Partículas y textos flotantes */
.spark {
  position: fixed; z-index: 50; pointer-events: none;
  width: 10px; height: 10px; margin: -5px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 10px var(--c);
  animation: spark .75s cubic-bezier(.1, .8, .3, 1) forwards;
}
.spark.star { border-radius: 0; background: none; box-shadow: none; width: auto; height: auto; color: var(--c); font-size: 18px; line-height: 1; }
@keyframes spark { to { transform: translate(var(--x), var(--y)) scale(.2) rotate(180deg); opacity: 0; } }

.float-num {
  position: fixed; z-index: 50; pointer-events: none;
  translate: -50% -50%;
  font-weight: 800; font-size: 1.3rem; color: #fff;
  text-shadow: 0 2px 0 var(--blue-deep), 0 0 8px rgba(0, 0, 0, .4);
  animation: float-up 1.1s cubic-bezier(.2, .8, .3, 1) forwards;
}
@keyframes float-up { 0% { opacity: 0; transform: translateY(0) scale(.5); } 20% { opacity: 1; transform: translateY(-10px) scale(1.15); } 100% { opacity: 0; transform: translateY(-60px) scale(1); } }

@keyframes pop { from { opacity: 0; transform: scale(.6); } }

/* Aviso */
.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 60;
  max-width: calc(100% - 32px);
  padding: 12px 22px;
  border-radius: 999px;
  background: linear-gradient(90deg, #7d73e6, #ff8fb8);
  color: #fff; font-weight: 800; font-size: 1.1rem; text-align: center;
  box-shadow: 0 10px 30px rgba(40, 20, 90, .45);
  transform: translate(-50%, 180%);
  visibility: hidden;
  transition: transform .5s cubic-bezier(.2, 1.5, .4, 1), visibility 0s .5s;
}
.toast.show { transform: translate(-50%, 0); visibility: visible; transition-delay: 0s; }

.confetti { position: fixed; inset: 0; z-index: 55; pointer-events: none; width: 100%; height: 100%; }

/* ---------- Móvil ---------- */
@media (max-width: 620px) {
  .task { grid-template-columns: 1fr auto; padding: 12px 10px 12px 20px; border-radius: 32px; }
  .rewards { grid-column: 1; grid-row: 2; }
  .check { grid-column: 2; grid-row: 1 / span 2; width: 76px; height: 76px; }
  .reward { width: 52px; height: 52px; }
  .reward span { font-size: .9rem; }
  .task.points .check { grid-row: 1; align-self: start; }
  .milestones { --tile: 34px; gap: 4px; }
  .ms span { font-size: .85rem; }
  .board { padding: 18px 12px; border-radius: 24px 48px 24px 24px; }
  .board-wrap { padding: 10px 10px 14px 0; }
  .board { margin-left: 10px; }
}

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