/* 2deIQ — estilo alegre "neo-brutal": papel crema, contornos de tinta, sombras duras y colores vivos */

:root {
  --paper: #FFF3E3;
  --paper-2: #FFE6C7;
  --ink: #1D1B26;
  --ink-soft: #57516A;
  --white: #FFFFFF;
  --orange: #FF6B35;
  --blue: #5B8BFF;
  --pink: #FF7EB6;
  --yellow: #FFC93C;
  --green: #2EC4A0;
  --lilac: #C4B2FF;
  --ok: #3DD68C;
  --ok-soft: #BDF5D6;
  --ko: #FF5757;
  --ko-soft: #FFC9C9;
  --line: 2.5px solid var(--ink);
  --lift: 0 4px 0 var(--ink);
  --lift-lg: 0 6px 0 var(--ink);
  --radius: 22px;
  --c: var(--orange); /* color del ejercicio activo */
  --font: "Bricolage Grotesque", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(rgba(29, 27, 38, .1) 1.2px, transparent 1.4px);
  background-size: 20px 20px;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  transition: background-color .35s ease;
}
body.is-colored {
  background-color: var(--c);
  background-image: radial-gradient(rgba(29, 27, 38, .16) 1.2px, transparent 1.4px);
}
#app {
  width: 100%;
  max-width: 520px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 16px calc(22px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
b { font-weight: 800; font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.ico { width: 1.2em; height: 1.2em; flex: none; }
.mascot { display: block; width: 100%; height: auto; overflow: visible; }
.mascot__eyes { transform-box: fill-box; transform-origin: center; animation: blink 4.5s infinite; }

/* ---------- Botones y piezas comunes ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 58px; padding: 0 24px;
  border: var(--line); border-radius: 18px; background: var(--white); box-shadow: var(--lift);
  font-size: 18px; font-weight: 800; letter-spacing: -.01em; text-align: center;
  transition: transform .08s ease, box-shadow .08s ease, filter .15s ease;
}
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--ink); }
.btn--primary { background: var(--orange); }
.btn--ink { background: var(--ink); color: var(--white); box-shadow: 0 5px 0 rgba(0, 0, 0, .32); }
.btn--ink:active { box-shadow: 0 0 0 rgba(0, 0, 0, .32); transform: translateY(5px); }
.btn--sm { min-height: 42px; padding: 0 16px; border-radius: 14px; font-size: 15px; box-shadow: 0 3px 0 var(--ink); }
.icon-btn {
  width: 46px; height: 46px; flex: none; display: grid; place-items: center;
  border: var(--line); border-radius: 14px; background: var(--white); box-shadow: 0 3px 0 var(--ink);
  font-size: 20px; transition: transform .08s ease, box-shadow .08s ease;
}
.icon-btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.panel { background: var(--white); border: var(--line); border-radius: 26px; box-shadow: var(--lift-lg); padding: 20px; }
.tag {
  display: inline-flex; align-items: center; padding: 4px 12px;
  border: 2px solid var(--ink); border-radius: 99px; background: var(--c);
  font-size: 13px; font-weight: 800;
}
.bar { height: 16px; border: var(--line); border-radius: 99px; background: var(--paper); overflow: hidden; }
.bar--sm { height: 12px; border-width: 2px; }
.bar__fill { height: 100%; background: var(--c); border-radius: 99px; }
.section-title { margin: 28px 2px 12px; font-size: 21px; font-weight: 800; letter-spacing: -.02em; }

/* ---------- Inicio ---------- */
.home { display: grid; grid-template-areas: "top" "hero" "games" "profile"; }
.home > * { animation: enter .45s ease both; }
.home > :nth-child(2) { animation-delay: .05s; }
.home > :nth-child(3) { animation-delay: .1s; }
.home > :nth-child(4) { animation-delay: .15s; }
.home.is-static > * { animation: none; }
.topbar { grid-area: top; display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 25px; font-weight: 800; letter-spacing: -.035em; }
.brand .mascot { width: 46px; flex: none; animation: bob 3s ease-in-out infinite; }
.brand__name { display: block; line-height: 1; }
.brand__tag { display: block; margin-top: 5px; font-size: 12.5px; font-weight: 700; letter-spacing: 0; color: var(--ink-soft); text-wrap: balance; }
.brand em {
  display: inline-block; margin-left: 3px; padding: 1px 6px 2px; transform: rotate(-4deg);
  border: var(--line); border-radius: 9px; background: var(--yellow); box-shadow: 0 2px 0 var(--ink);
  font-size: 19px; font-style: normal;
}
.top-actions { display: flex; gap: 8px; }
.chip-btn {
  height: 46px; display: flex; align-items: center; gap: 4px; padding: 0 12px 0 9px;
  border: var(--line); border-radius: 14px; background: var(--white); box-shadow: 0 3px 0 var(--ink);
  font-size: 19px; font-weight: 800;
}
.chip-btn.is-off .ico { filter: grayscale(1); opacity: .45; }
button.chip-btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }

/* ---------- Tu racha ---------- */
.streak__flame {
  width: 84px; height: 84px; margin: 0 auto 8px; display: grid; place-items: center;
  border: var(--line); border-radius: 50%; background: var(--yellow); box-shadow: 0 4px 0 var(--ink); font-size: 46px;
  animation: pop .45s cubic-bezier(.34, 1.56, .64, 1) both;
}
.streak__flame .ico { animation: pulse 1.6s ease-in-out infinite; }
.streak__flame.is-off { background: var(--white); }
.streak__flame.is-off .ico { filter: grayscale(1); opacity: .45; animation: none; }
.streak__week {
  width: fit-content; margin: 12px auto 0; padding: 5px 12px; border: 2px solid var(--ink); border-radius: 99px;
  background: var(--white); font-size: 13.5px; font-weight: 600; text-align: center;
}
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 16px; }
.cal__head { font-size: 12px; font-weight: 800; text-align: center; color: var(--ink-soft); }
.cal__day {
  aspect-ratio: 1; display: grid; place-items: center; border: 2px solid rgba(29, 27, 38, .18); border-radius: 10px;
  background: var(--white); font-size: 13px; font-weight: 700; color: var(--ink-soft);
}
.cal__day .ico { font-size: 20px; }
.cal__day.is-done { border-color: var(--ink); background: var(--paper-2); }
.cal__day.is-saved { border-color: var(--ink); border-style: dashed; background: #E3F5FE; }
.cal__day.is-future { opacity: .4; }
.cal__day.is-today { outline: 3px solid var(--orange); outline-offset: 1px; }
.streak__stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.streak__stats p {
  display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 10px 8px;
  border: 2px solid var(--ink); border-radius: 14px; background: var(--white); text-align: center;
}
.streak__stats small { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.streak__stats b { font-size: 19px; }
.streak__shield {
  display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px;
  border: 2px solid var(--ink); border-radius: 14px; background: #E3F5FE;
  font-size: 13.5px; font-weight: 600; line-height: 1.35;
}
.streak__shield .ico { flex: none; font-size: 26px; }
.streak__shield b { display: block; font-size: 15px; }
.streak__shield.is-ad { background: var(--lilac); }
.streak__go { width: 100%; margin-top: 16px; }

.home__hero { grid-area: hero; display: grid; gap: 14px; align-content: start; }
.hero {
  position: relative; padding: 20px; overflow: hidden;
  border: var(--line); border-radius: 26px; background: var(--lilac); box-shadow: var(--lift-lg);
}
.hero__mascot { position: absolute; top: 10px; right: -4px; width: 116px; transform: rotate(8deg); }
.hero__mascot .mascot { animation: bob 3s ease-in-out infinite; }
.eyebrow {
  display: inline-flex; padding: 3px 10px; border: 2px solid var(--ink); border-radius: 99px;
  background: var(--white); font-size: 13px; font-weight: 800;
}
.hero__title { max-width: 66%; margin-top: 10px; font-size: 31px; font-weight: 800; line-height: 1.05; letter-spacing: -.035em; }
.hero__title mark {
  display: inline-block; padding: 0 6px; transform: rotate(-3deg);
  border: var(--line); border-radius: 10px; background: var(--yellow); box-shadow: 0 3px 0 var(--ink); color: inherit;
}
.hero__lead { margin-top: 12px; font-size: 15.5px; font-weight: 600; line-height: 1.4; }
.perks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.perks li {
  display: flex; flex-direction: column; align-items: flex-start; padding: 10px 11px;
  border: 2px solid var(--ink); border-radius: 14px; background: var(--white);
}
.perks .ico { margin-bottom: 6px; font-size: 20px; color: var(--yellow); }
.perks b { font-size: 19px; line-height: 1; letter-spacing: -.02em; }
.perks span { margin-top: 3px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
/* Plan del día: una casilla por ejercicio; las hechas se pintan de su color con ✓ y la siguiente resalta */
.hero__sub { margin-top: 10px; font-size: 14.5px; font-weight: 600; line-height: 1.38; }
.plan { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.plan__item {
  position: relative; display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 7px 10px 7px 7px;
  border: 2px solid var(--ink); border-radius: 14px; background: var(--white);
  font-size: 14px; font-weight: 800; line-height: 1.1; letter-spacing: -.01em;
  transition: transform .08s ease, box-shadow .08s ease;
}
.plan__item:active { transform: translateY(2px); }
.plan__item.is-done { background: var(--c); }
.plan__item.is-next { box-shadow: 0 3px 0 var(--ink); }
.plan__art { flex: none; width: 36px; height: 36px; padding: 3px; border: 2px solid var(--ink); border-radius: 10px; background: var(--white); }
.plan__art svg { display: block; width: 100%; height: 100%; }
.plan__check {
  position: absolute; top: -8px; right: -7px; width: 24px; height: 24px; display: grid; place-items: center;
  border: 2px solid var(--ink); border-radius: 50%; background: var(--ok); font-size: 13px;
}
.plan__go { margin-left: auto; font-size: 13px; color: var(--orange); }
.hero__note { margin-top: 12px; font-size: 15px; font-weight: 600; line-height: 1.35; }
.hero .btn { width: 100%; margin-top: 14px; }

.level {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: var(--line); border-radius: 20px; background: var(--white); box-shadow: var(--lift);
}
.level__badge {
  flex: none; width: 54px; height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: var(--line); border-radius: 16px; background: var(--yellow);
  font-size: 24px; font-weight: 800; line-height: 1;
}
.level__badge small { font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 2px; }
.level__body { flex: 1; min-width: 0; --c: var(--orange); }
.level__top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 7px; font-size: 14px; font-weight: 700; }
.level__top span:last-child { color: var(--ink-soft); }

.install {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: var(--line); border-radius: 20px; background: var(--yellow); box-shadow: var(--lift);
  font-size: 14px; font-weight: 700; line-height: 1.3;
}
.install .ico { font-size: 22px; }
.install p { flex: 1; }

/* ---------- Cuenta (opcional) ---------- */
/* La foto de perfil no llega hasta el borde: queda un margen blanco por dentro, para que el borde de tinta y la sombra
   del botón se vean igual con cualquier foto (una foto oscura junto al borde lo hacía desaparecer) */
.account-btn { overflow: hidden; padding: 4px; }
.account-btn .avatar { overflow: hidden; border-radius: 8px; }
.avatar {
  position: relative; display: grid; place-items: center; width: 100%; height: 100%;
  background: var(--yellow); font-size: 19px; font-weight: 800;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.save { padding: 14px 16px; border: var(--line); border-radius: 20px; background: var(--white); box-shadow: var(--lift); }
.save__head { display: flex; align-items: flex-start; gap: 12px; }
.save__icon {
  flex: none; width: 46px; height: 46px; display: grid; place-items: center;
  border: var(--line); border-radius: 14px; background: var(--paper); font-size: 25px;
}
.save p { font-size: 14px; font-weight: 600; line-height: 1.38; }
.save b { display: block; margin-bottom: 2px; font-size: 16px; }
/* "Continuar con Google": un botón nuestro (oscuro, como los demás), con la "G" de Google en un círculo blanco */
.google-btn { width: 100%; margin-top: 14px; }
.google-btn .btn { width: 100%; }
.google-btn__logo { flex: none; width: 32px; height: 32px; padding: 6px; border-radius: 50%; background: var(--white); }
.save > .btn, .pro > .btn[data-login] { width: 100%; margin-top: 14px; }
.google-error { font-size: 13.5px; font-weight: 600; color: var(--ink-soft); text-align: center; }

/* Hoja de la cuenta: sube desde abajo en el móvil y sale centrada en pantallas grandes */
.sheet {
  width: 100%; max-width: 440px; max-height: 92dvh; margin: auto auto 0; overflow: auto;
  padding: 22px 20px calc(24px + env(safe-area-inset-bottom));
  border: var(--line); border-bottom: 0; border-radius: 28px 28px 0 0;
  background: var(--paper); color: var(--ink); box-shadow: 0 -4px 0 var(--ink);
  animation: sheet-in .3s cubic-bezier(.34, 1.3, .64, 1);
}
.sheet::backdrop { background: rgba(29, 27, 38, .5); }
.sheet__close { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; }
.sheet__mascot { width: 92px; margin: 0 auto 8px; }
.sheet__title { font-size: 26px; font-weight: 800; letter-spacing: -.03em; text-align: center; }
.sheet__text { margin-top: 8px; font-size: 15px; font-weight: 600; line-height: 1.4; text-align: center; }
.sheet__fine { margin-top: 14px; font-size: 12.5px; font-weight: 600; line-height: 1.35; color: var(--ink-soft); text-align: center; }
.sheet__fine a { text-decoration: underline; }

/* ---------- Entrar con el correo ---------- */
.link { display: inline; padding: 0; font: inherit; font-weight: 800; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.login-alt { display: block; margin: 12px auto 0; font-size: 14px; }
.hero__login { margin-top: 12px; font-size: 14px; font-weight: 600; text-align: center; color: var(--ink-soft); }
.sheet__or { display: flex; align-items: center; gap: 10px; margin-top: 16px; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.sheet__or::before, .sheet__or::after { content: ""; flex: 1; border-top: 2px solid rgba(29, 27, 38, .15); }
.login-form { display: grid; gap: 10px; margin-top: 14px; }
.login-form__label { font-size: 14px; font-weight: 700; line-height: 1.35; text-align: center; }
.login-form__row { display: flex; gap: 10px; }
.login-form__row .btn { flex: none; }
/* 16px como mínimo: con menos, el iPhone hace zoom al tocar el campo */
.field {
  width: 100%; min-width: 0; min-height: 52px; padding: 0 16px;
  border: var(--line); border-radius: 16px; background: var(--white); box-shadow: inset 0 2px 0 rgba(29, 27, 38, .06);
  font: inherit; font-size: 16px; font-weight: 600; color: var(--ink);
}
.field::placeholder { color: rgba(87, 81, 106, .6); }
.field:focus { outline: 3px solid var(--blue); outline-offset: 1px; }
.field--code { font-size: 22px; font-weight: 800; letter-spacing: .12em; text-align: center; }
.field[aria-invalid="true"] { border-color: var(--ko); background: #FFF5F5; animation: shake .35s ease; }
.form-error {
  display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px;
  border: 2px solid var(--ko); border-radius: 12px; background: var(--ko-soft);
  font-size: 14px; font-weight: 700; line-height: 1.35; color: var(--ink);
}
.form-error::before { content: "!"; flex: none; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--ko); color: var(--white); font-size: 13px; font-weight: 800; }
.sheet__user { display: flex; align-items: center; gap: 12px; padding-right: 48px; }
/* Igual que en el botón: margen blanco (el borde blanco) y el contorno de tinta por fuera (la sombra sin desenfoque) */
.sheet__user .avatar {
  flex: none; width: 54px; height: 54px; overflow: hidden; margin: 2.5px;
  border: 4px solid var(--white); border-radius: 18px; box-shadow: 0 0 0 2.5px var(--ink); font-size: 25px;
}
.sheet__user b { display: block; font-size: 18px; line-height: 1.15; }
.sheet__user small { display: block; margin-top: 3px; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); overflow-wrap: anywhere; }
.sheet__ok {
  display: flex; align-items: flex-start; gap: 10px; margin-top: 18px; padding: 12px 14px;
  border: 2px solid var(--ink); border-radius: 16px; background: var(--white);
  font-size: 14px; font-weight: 600; line-height: 1.38;
}
.sheet__ok .ico { font-size: 24px; }
.sheet__pro {
  display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 12px 14px;
  border: 2px solid var(--ink); border-radius: 16px; background: var(--lilac); box-shadow: 0 3px 0 var(--ink);
  font-size: 13.5px; font-weight: 600; line-height: 1.3;
}
.sheet__pro.is-on { background: var(--yellow); }
.sheet__pro .ico { font-size: 24px; }
.sheet__pro b { display: block; font-size: 16px; }
/* Disfraces de Sina y café, debajo de Pro */
.sheet__shop { margin-top: 10px; background: var(--white); }
.sheet__shop-art { width: 30px; flex: none; }
.sheet__shop-art .mascot { display: block; width: 100%; }
.sheet__btn { width: 100%; margin-top: 16px; }
.sheet__btn:disabled, .sheet__danger:disabled { opacity: .5; }
.sheet__danger {
  display: block; margin: 14px auto 0; padding: 6px;
  font-size: 14px; font-weight: 700; color: #B42318; text-decoration: underline; text-underline-offset: 3px;
}
@media (min-width: 600px) {
  .sheet { margin: auto; border-bottom: var(--line); border-radius: 28px; box-shadow: var(--lift-lg); padding-bottom: 24px; }
}
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }

.home__games { grid-area: games; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.game-card {
  position: relative; display: flex; flex-direction: column; min-height: 186px; padding: 14px;
  border: var(--line); border-radius: 24px; background: var(--c); box-shadow: var(--lift-lg);
  transition: transform .1s ease, box-shadow .1s ease;
}
.game-card:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--ink); }
.game-card__art {
  width: 66px; height: 66px; padding: 7px;
  border: var(--line); border-radius: 18px; background: var(--white); transform: rotate(-4deg);
}
.game-card:nth-child(even) .game-card__art { transform: rotate(4deg); }
.game-card:last-child:nth-child(odd) { grid-column: 1 / -1; min-height: 150px; }
.game-card__art svg { display: block; width: 100%; height: 100%; }
.game-card__name { margin-top: auto; padding-top: 14px; font-size: 20px; font-weight: 800; line-height: 1.05; letter-spacing: -.025em; }
.game-card__skill { margin-top: 3px; font-size: 13px; font-weight: 600; }
.game-card__best {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; padding: 3px 9px 3px 6px;
  border: 2px solid var(--ink); border-radius: 99px; background: var(--white); font-size: 13px; font-weight: 800;
}
.game-card__done {
  position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; display: grid; place-items: center;
  border: var(--line); border-radius: 50%; background: var(--white); font-size: 16px;
}

.share-card {
  position: relative; overflow: hidden; padding: 18px;
  border: var(--line); border-radius: 24px; background: var(--paper-2); box-shadow: var(--lift-lg);
}
.share-card__mascot { position: absolute; top: 8px; right: -14px; width: 106px; transform: rotate(-8deg); }
.share-card__title { max-width: 72%; text-wrap: balance; font-size: 22px; font-weight: 800; line-height: 1.08; letter-spacing: -.025em; }
.share-card__text { max-width: 70%; margin-top: 8px; font-size: 14.5px; font-weight: 600; line-height: 1.38; }
.share-card .btn { width: 100%; margin-top: 16px; }

/* Va como popover (UI.toast): top, right, margin, height y overflow anulan los estilos que trae el navegador */
.toast {
  position: fixed; top: auto; right: auto; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 50;
  translate: -50% 0; margin: 0; overflow: visible; height: auto;
  width: max-content; max-width: calc(100% - 32px); padding: 12px 18px;
  border: var(--line); border-radius: 16px; background: var(--ink); color: var(--white);
  box-shadow: 0 4px 0 rgba(0, 0, 0, .25); font-size: 15px; font-weight: 700; line-height: 1.35; text-align: center;
  animation: toast-in .35s cubic-bezier(.34, 1.56, .64, 1); transition: opacity .3s ease, transform .3s ease;
}
.toast.is-out { opacity: 0; transform: translateY(12px); }
/* Con una ventana abierta, arriba */
.toast--top { top: calc(16px + env(safe-area-inset-top)); bottom: auto; animation-name: toast-in-top; }
.toast--top.is-out { transform: translateY(-12px); }
@keyframes toast-in-top { from { opacity: 0; transform: translateY(-20px); } }

.home__profile { grid-area: profile; }
.profile { display: grid; gap: 14px; }
.skill > summary { list-style: none; cursor: pointer; }
.skill > summary::-webkit-details-marker { display: none; }
.skill__row { display: flex; align-items: center; gap: 10px; }
.skill__more {
  flex: none; width: 24px; height: 24px; display: grid; place-items: center;
  border: 2px solid var(--ink); border-radius: 8px; background: var(--white); font-size: 13px; transition: transform .2s ease;
}
.skill[open] .skill__more { transform: rotate(180deg); }
.skill__art { width: 40px; height: 40px; flex: none; padding: 4px; border: 2px solid var(--ink); border-radius: 12px; background: var(--c); }
.skill__art svg { display: block; width: 100%; height: 100%; }
.skill__body { flex: 1; min-width: 0; }
.skill__top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 14px; font-weight: 700; }
.skill__top span:last-child { flex: none; }
.skill__rank { margin-right: 4px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }

/* ---------- Gráficos de progreso (tu semana y cada habilidad) ---------- */
.chart__plot { position: relative; display: flex; height: 92px; margin-top: 22px; border-bottom: var(--line); }
.chart__col { flex: 1 1 0; display: flex; align-items: flex-end; justify-content: center; }
.chart__bar {
  position: relative; width: min(26px, 64%);
  border: 2px solid var(--ink); border-bottom: 0; border-radius: 8px 8px 0 0;
  background: color-mix(in srgb, var(--c) 35%, var(--white));
}
.chart__bar.is-now { background: var(--c); }
/* El número lleva el fondo de la tarjeta para leerse aunque cruce la línea del siguiente nivel */
.chart__bar b {
  position: absolute; bottom: 100%; left: 50%; translate: -50% -3px; padding: 0 3px; border-radius: 4px;
  background: var(--surface, var(--white)); font-size: 12.5px; line-height: 1; white-space: nowrap;
}
/* Línea del siguiente nivel */
.chart__goal { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--ink-soft); pointer-events: none; }
.chart__labels { display: flex; margin-top: 6px; }
.chart__labels span { flex: 1 1 0; text-align: center; font-size: 12px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.chart__labels .is-now { font-weight: 800; color: var(--ink); }
/* Las columnas crecen al aparecer: al entrar al inicio y al desplegar una habilidad (no al repintar el inicio) */
.home:not(.is-static) .skill[open] .chart__bar, .skill.is-opening .chart__bar {
  transform-origin: bottom; animation: grow .5s cubic-bezier(.34, 1.4, .64, 1) both; animation-delay: calc(var(--i) * 45ms);
}
.home:not(.is-static) .skill[open] .chart__bar b, .skill.is-opening .chart__bar b { animation: fade .2s both; animation-delay: calc(.35s + var(--i) * 45ms); }
@keyframes grow { from { transform: scaleY(0); } }
@keyframes fade { from { opacity: 0; } }

.trend { --surface: var(--paper); margin-top: 12px; padding: 12px 14px; border: 2px solid var(--ink); border-radius: 16px; background: var(--paper); }
.trend__title { font-size: 14px; font-weight: 800; }
.trend__note { margin-top: 3px; font-size: 13.5px; font-weight: 600; line-height: 1.35; color: var(--ink-soft); }
.trend__note a { color: var(--ink); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.trend__note b { color: var(--ink); }
.trend__up { padding: 1px 7px; border: 2px solid var(--ink); border-radius: 99px; background: var(--ok-soft); }
.trend__key { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.trend__key i { flex: none; width: 18px; border-top: 2px dashed var(--ink-soft); }
.trend__key b { color: var(--ink); }
/* Historial completo (Pro): se desliza de lado. min-width: 0 para que el gráfico ancho no ensanche la página */
.home__profile, .profile > .skill, .trend { min-width: 0; }
.chart-scroll { overflow-x: auto; margin: 0 -14px; padding: 0 14px; scrollbar-width: thin; }
/* Compárate con los demás (Pro) y su anuncio para quien no es Pro */
.trend__compare, .trend__pro {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px; padding: 8px 12px;
  border: 2px solid var(--ink); border-radius: 12px; background: var(--yellow);
  font-size: 13.5px; font-weight: 600; line-height: 1.3;
}
.trend__compare .ico, .trend__pro .ico { flex: none; font-size: 18px; }
.trend__compare.is-soon { background: var(--white); color: var(--ink-soft); }
.trend__pro { background: var(--lilac); }

/* ---------- Funciones Pro: insignia, plan y Sina ---------- */
.pro-chip {
  display: inline-flex; align-items: center; gap: 2px; margin-left: 4px; padding: 1px 7px; vertical-align: 1px;
  border: 2px solid var(--ink); border-radius: 99px; background: var(--yellow); font-size: 11.5px; font-weight: 800;
}
.hero__adjust { display: inline-flex; align-items: center; gap: 4px; margin-top: 12px; font-size: 13.5px; }
.hero__adjust .ico { font-size: 15px; }
.pro__hub { display: grid; gap: 10px; width: 100%; margin-top: 4px; }
.pro__tool {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; text-align: left;
  border: 2px solid var(--ink); border-radius: 16px; background: var(--paper); box-shadow: 0 3px 0 var(--ink);
  font-size: 13.5px; font-weight: 600; line-height: 1.3; color: var(--ink-soft);
}
.pro__tool:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.pro__tool b { display: block; font-size: 15.5px; color: var(--ink); }
.pro__tool > span:nth-child(2) { flex: 1; min-width: 0; }
.pro__tool-art {
  flex: none; width: 44px; height: 44px; display: grid; place-items: center;
  border: 2px solid var(--ink); border-radius: 12px; background: var(--white); font-size: 22px; color: var(--ink);
}
.pro__tool-art .mascot { width: 38px; }
.pro__tool > .ico { flex: none; font-size: 18px; color: var(--ink); }
.choice { display: grid; gap: 10px; margin-top: 16px; }
.choice__item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer;
  border: 2px solid var(--ink); border-radius: 16px; background: var(--white);
  font-size: 13.5px; font-weight: 600; line-height: 1.3; color: var(--ink-soft);
}
.choice__item b { display: block; font-size: 15.5px; color: var(--ink); }
.choice__item:has(input:checked) { background: var(--yellow); box-shadow: 0 3px 0 var(--ink); color: var(--ink); }
.choice input { width: 20px; height: 20px; flex: none; margin: 0; accent-color: var(--ink); }
.choice__games { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding: 0; border: 0; }
.choice__games legend { margin-bottom: 8px; padding: 0; font-size: 13.5px; font-weight: 700; }
.choice__game {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer;
  border: 2px solid var(--ink); border-radius: 14px; background: var(--white); font-size: 13.5px; font-weight: 700;
}
.choice__game:has(input:checked) { background: var(--c); }
.choice__art { width: 28px; height: 28px; flex: none; }
.choice__art svg { display: block; width: 100%; height: 100%; }
.choice__label { margin-top: 4px; font-size: 14px; font-weight: 800; }
.sina-preview { width: 120px; margin: 0 auto 6px; animation: pop .4s cubic-bezier(.34, 1.56, .64, 1) both; }
.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.picker__item {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; cursor: pointer;
  border: 2px solid var(--ink); border-radius: 14px; background: var(--white); font-weight: 700;
}
.picker__item input { position: absolute; opacity: 0; pointer-events: none; }
.picker__item:has(input:checked) { background: var(--yellow); box-shadow: 0 3px 0 var(--ink); }
.picker__item:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }
.picker__art { position: relative; width: 48px; }
.picker__item small { font-size: 11.5px; }
/* Lo que todavía no tienes: apagado y con un candado */
.picker__item.is-locked { cursor: default; border-style: dashed; background: transparent; }
.picker__item.is-locked .mascot { opacity: .45; filter: grayscale(.6); }
.picker__item.is-locked small { color: var(--ink-soft); }
.picker__art > .ico { position: absolute; right: -4px; bottom: -2px; width: 20px; height: 20px; }
.choice__label a { margin-left: 4px; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; color: var(--ink-soft); }
.habits { display: grid; gap: 14px; margin-top: 18px; }
.tip {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border: var(--line); border-radius: 22px; background: var(--white); box-shadow: var(--lift);
}
.tip .mascot { width: 58px; flex: none; }
.tip p { font-size: 14.5px; font-weight: 600; line-height: 1.38; }
.tip b { display: block; margin-bottom: 2px; font-size: 16px; }
/* Los textos bajo una tarjeta dejan aire: la sombra dura de la tarjeta ya se come 6px */
.footnote { margin-top: 24px; padding: 0 8px; text-align: center; font-size: 12.5px; font-weight: 600; line-height: 1.45; color: var(--ink-soft); text-wrap: balance; }

/* Enlaces legales al pie del inicio */
.legal { margin-top: 16px; text-align: center; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.legal a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Páginas de texto (privacidad y términos) ---------- */
.doc { width: 100%; max-width: 760px; margin: 0 auto; padding: calc(18px + env(safe-area-inset-top)) 16px calc(36px + env(safe-area-inset-bottom)); }
.doc__brand { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px; font-size: 24px; font-weight: 800; letter-spacing: -.035em; }
.doc__brand em {
  display: inline-block; margin-left: -4px; padding: 1px 6px 2px; transform: rotate(-4deg);
  border: var(--line); border-radius: 9px; background: var(--yellow); box-shadow: 0 2px 0 var(--ink);
  font-size: 18px; font-style: normal;
}
.doc__card { padding: 26px 22px 30px; border: var(--line); border-radius: 26px; background: var(--white); box-shadow: var(--lift-lg); }
.doc h1 { font-size: clamp(28px, 7vw, 38px); font-weight: 800; line-height: 1.08; letter-spacing: -.035em; }
.doc__date { margin-top: 6px !important; font-size: 14px !important; font-weight: 600; color: var(--ink-soft); }
.doc h2 { margin-top: 28px; font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.doc p, .doc li { margin-top: 10px; font-size: 16px; font-weight: 500; line-height: 1.55; }
.doc ul { margin: 0; padding-left: 22px; }
.doc li::marker { color: var(--orange); }
.doc b { font-weight: 800; }
.doc__card a, .doc__links a { text-decoration: underline; text-underline-offset: 3px; }
.doc .doc__links { margin-top: 30px; text-align: center; font-size: 15px; font-weight: 700; }
/* El texto para buscadores de index.html, dentro de #app: con JavaScript no se ve, porque la app lo reemplaza al
   arrancar (así no parpadea); sin JavaScript es la página */
#app > .doc { padding: 0; }
.js #app > .doc { visibility: hidden; }
.noscript { padding: 0 16px 28px; text-align: center; font-weight: 700; }

/* ---------- Pantallas de ejercicio ---------- */
.screen { flex: 1; display: flex; flex-direction: column; width: 100%; max-width: 460px; margin: 0 auto; animation: enter .35s ease both; }
.screen__top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.screen__title { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.stage { flex: 1; display: flex; flex-direction: column; }

/* ---------- 2deIQ Pro ---------- */
/* Sina asoma por encima de la tarjeta, a la altura del botón de volver (46 px + 14 de margen + 6 = los 66 que sube) */
.pro { display: flex; flex-direction: column; align-items: center; gap: 9px; margin-top: 6px; text-align: center; position: relative; padding-top: 60px; }
.pro__mascot { position: absolute; top: -66px; left: 50%; width: 124px; translate: -50% 0; animation: pop .5s cubic-bezier(.34, 1.56, .64, 1) both; }
.pro__mascot .mascot { animation: bob 2.6s ease-in-out infinite; }
.pro__badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px;
  border: 2px solid var(--ink); border-radius: 99px; background: var(--yellow); font-size: 13.5px; font-weight: 800;
}
.pro__title { font-size: 34px; font-weight: 800; line-height: 1.05; letter-spacing: -.035em; }
.pro__title mark {
  display: inline-block; padding: 0 8px; transform: rotate(-3deg);
  border: var(--line); border-radius: 10px; background: var(--lilac); box-shadow: 0 3px 0 var(--ink); color: inherit;
}
.pro__lead { font-size: 16px; font-weight: 600; line-height: 1.4; color: var(--ink-soft); }
.pro__lead b { color: var(--ink); }
.pro__notice {
  width: 100%; padding: 10px 14px; border: 2px solid var(--ink); border-radius: 14px; background: var(--paper-2);
  font-size: 14px; font-weight: 700; line-height: 1.35; text-align: left;
}
.pro__perks {
  display: grid; gap: 12px; width: 100%; margin: 6px 0 2px; padding: 14px 16px; list-style: none; text-align: left;
  border: 2px solid var(--ink); border-radius: 18px; background: var(--paper);
}
.pro__perks li { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; font-weight: 600; line-height: 1.35; color: var(--ink-soft); }
.pro__perks .ico { flex: none; width: 26px; height: 26px; padding: 4px; border: 2px solid var(--ink); border-radius: 50%; background: var(--ok); color: var(--ink); }
.pro__perks b { display: block; margin-bottom: 1px; font-size: 15.5px; color: var(--ink); }
.pro__price { margin-top: 6px; font-size: 15px; font-weight: 700; color: var(--ink-soft); }
.pro__price b { font-size: 30px; color: var(--ink); letter-spacing: -.02em; font-variant-numeric: normal; }
.pro__terms { font-size: 14px; font-weight: 700; }
.pro .btn { width: 100%; margin-top: 4px; }
.pro__login { font-size: 15px; font-weight: 700; line-height: 1.35; }
.pro__fine { font-size: 12.5px; font-weight: 600; line-height: 1.4; color: var(--ink-soft); }
.pro__fine a { text-decoration: underline; text-underline-offset: 2px; }
.pro--thanks { padding-bottom: 24px; }
.nowrap { white-space: nowrap; }
/* Disfraces de Sina: una tarjeta por paquete con sus 4 accesorios */
.shop__pack {
  display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; margin-top: 6px; padding: 14px 12px;
  border: 2px solid var(--ink); border-radius: 18px; background: var(--paper);
}
.shop__name { font-size: 18px; font-weight: 800; }
.shop__items { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; width: 100%; }
.shop__items figure { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 0; }
.shop__items .mascot { display: block; width: min(60px, 100%); }
.shop__items figcaption { font-size: 11.5px; font-weight: 700; line-height: 1.15; }
.shop__owned { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; }
.shop__owned .ico { width: 22px; height: 22px; padding: 3px; border: 2px solid var(--ink); border-radius: 50%; background: var(--ok); }
.shop__pack--both { background: var(--yellow); }
.shop__deal { font-size: 14px; font-weight: 600; }
.shop__deal b { display: block; font-size: 17px; }
/* Café: tres opciones, de un café a un desayuno */
.coffee__options { display: grid; gap: 10px; width: 100%; margin-top: 4px; }
/* Cada opción con un color de la paleta y el emoji en un cuadro blanco, como las tarjetas de los ejercicios */
.coffee__option {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; cursor: pointer; text-align: left;
  border: 2px solid var(--ink); border-radius: 16px; background: var(--yellow); box-shadow: 0 3px 0 var(--ink);
  font: inherit; font-size: 16px; color: var(--ink);
}
.coffee__option:nth-child(3n + 2) { background: var(--pink); }
.coffee__option:nth-child(3n + 3) { background: var(--blue); }
.coffee__option:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.coffee__option:disabled { opacity: .6; }
.coffee__option b { flex: 1; }
.coffee__icon {
  flex: none; display: grid; place-items: center; min-width: 46px; height: 42px; padding: 0 6px;
  border: 2px solid var(--ink); border-radius: 12px; background: var(--white); font-size: 20px; white-space: nowrap;
}
.coffee__price { flex: none; font-weight: 800; white-space: nowrap; }
.home__coffee {
  display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 18px;
  font-size: 14px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px;
}
.home__coffee .ico { width: 20px; height: 20px; }
.pro + .legal { margin-top: 28px; }

.intro { flex: 1; display: flex; flex-direction: column; gap: 18px; }
.intro__card { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding-top: 26px; }
.intro__art {
  width: 116px; height: 116px; padding: 14px; margin-bottom: 4px;
  border: var(--line); border-radius: 30px; background: var(--c); box-shadow: var(--lift);
  transform: rotate(-5deg); animation: wiggle 2.8s ease-in-out infinite;
}
.intro__art svg { display: block; width: 100%; height: 100%; }
.intro h1 { font-size: 36px; font-weight: 800; line-height: 1; letter-spacing: -.04em; }
.intro__desc { max-width: 32ch; font-size: 16px; font-weight: 500; line-height: 1.4; color: var(--ink-soft); }
.steps { width: 100%; display: grid; gap: 10px; margin: 6px 0 0; padding: 16px 0 0; border-top: 2px dashed var(--paper-2); list-style: none; text-align: left; counter-reset: paso; }
.steps li { display: flex; align-items: center; gap: 12px; font-size: 15.5px; font-weight: 600; line-height: 1.3; counter-increment: paso; }
.steps li::before {
  content: counter(paso); flex: none; width: 30px; height: 30px; display: grid; place-items: center;
  border: 2px solid var(--ink); border-radius: 50%; background: var(--c); font-size: 14px; font-weight: 800;
}
.intro__best { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-weight: 700; }
/* Llegaste con el enlace de "Retar a un amigo" (/logica?reto=230) */
.intro__challenge {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px;
  border: 2px solid var(--ink); border-radius: 14px; background: var(--yellow); box-shadow: 0 3px 0 var(--ink);
  font-size: 15.5px; font-weight: 700; line-height: 1.3; text-align: left; transform: rotate(-1.5deg);
}
.intro__challenge svg { flex: none; width: 20px; height: 20px; }
/* Nivel de IQ en el ejercicio (de IQ bajo a Genio) y, debajo, lo que falta para subir */
.rank {
  display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; margin-top: 12px; padding: 12px;
  border: 2px solid var(--ink); border-radius: 16px; background: var(--paper); text-align: center;
}
.rank__now { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.rank__badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px;
  border: 2px solid var(--ink); border-radius: 99px; background: var(--c); box-shadow: 0 2px 0 var(--ink);
  font-size: 16px; font-weight: 800;
}
.rank__badge .ico { color: var(--ink); }
.rank__next { font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
.rank__next b { color: var(--ink); }
/* Dificultad de las preguntas (sube con el nivel), separada por una línea */
.rank__diff {
  width: 100%; padding-top: 9px; border-top: 2px dashed rgba(29, 27, 38, .18);
  font-size: 13.5px; font-weight: 600; color: var(--ink-soft); text-wrap: balance;
}
.rank__diff b { color: var(--ink); }
.rank__diff .ico { width: 17px; height: 17px; margin-right: 3px; vertical-align: -3px; }
.intro .dock { margin-top: auto; }
.intro .btn { width: 100%; }
/* Botón principal fijo abajo: si la tarjeta no cabe en la pantalla (un iPhone con las barras de Safari), el botón se
   queda pegado al borde de abajo y la tarjeta pasa por detrás, con un degradado del color de la pantalla. Si cabe, no
   cambia nada. El fondo es sólido a propósito: Safari 26 pinta su barra flotante con el color de fondo de lo que va
   pegado abajo, y un fondo transparente lo pinta de negro. El degradado va aparte, encima (::before) */
.dock {
  position: sticky; bottom: 0; z-index: 3;
  margin: 0 -16px; padding: 6px 16px calc(12px + env(safe-area-inset-bottom));
  background-color: var(--c);
}
.dock::before {
  content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 24px;
  background: linear-gradient(to bottom, transparent, var(--c));
  pointer-events: none;
}

.countdown {
  margin: auto; width: 180px; height: 180px; display: grid; place-items: center;
  border: var(--line); border-radius: 50%; background: var(--white); box-shadow: var(--lift-lg);
  font-size: 100px; font-weight: 800; letter-spacing: -.04em;
  animation: pop .45s cubic-bezier(.34, 1.56, .64, 1) both;
}
.countdown.is-go { background: var(--yellow); font-size: 50px; }

/* Marcador superior */
.hud { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.timebar { flex: 1; height: 20px; border: var(--line); border-radius: 99px; background: var(--white); box-shadow: 0 3px 0 var(--ink); overflow: hidden; }
.timebar__fill { height: 100%; background: var(--ink); transform-origin: left; transition: transform .1s linear, background .3s; }
.timebar.is-low .timebar__fill { background: var(--ko); }
.pill {
  flex: none; min-width: 52px; height: 38px; padding: 0 11px; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  border: var(--line); border-radius: 12px; background: var(--white); box-shadow: 0 3px 0 var(--ink);
  font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.pill.is-low { background: var(--ko-soft); animation: pulse .5s ease infinite; }

/* Destellos de acierto y fallo */
.burst {
  position: absolute; top: 16%; left: 50%; z-index: 2; translate: -50% 0; pointer-events: none; white-space: nowrap;
  font-size: 34px; font-weight: 800; color: var(--white); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill;
  animation: burst .75s ease-out forwards;
}
.burst--ok { color: var(--ok); }
.burst--ko { color: var(--ko); }
.panel.is-ok { animation: flash-ok .4s ease; }
.panel.is-ko { animation: flash-ko .4s ease, shake .35s ease; }

/* Cálculo */
.problem { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; min-height: 200px; margin-bottom: 18px; }
.problem__stats { position: absolute; top: 14px; left: 14px; display: flex; gap: 6px; }
.mini {
  display: inline-flex; align-items: center; gap: 3px; padding: 2px 9px 2px 5px;
  border: 2px solid var(--ink); border-radius: 99px; font-size: 14px; font-weight: 800;
}
.mini--ok { background: var(--ok-soft); }
.mini--ko { background: var(--ko-soft); }
.combo {
  position: absolute; top: 14px; right: 14px; display: inline-flex; align-items: center; gap: 3px; padding: 2px 10px 2px 6px;
  border: 2px solid var(--ink); border-radius: 99px; background: var(--yellow); font-size: 14px; font-weight: 800;
  animation: pop .3s cubic-bezier(.34, 1.56, .64, 1);
}
.problem__q { font-size: clamp(46px, 14vw, 66px); font-weight: 800; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.problem__a {
  min-width: 130px; height: 66px; padding: 0 18px; display: grid; place-items: center;
  border: 2.5px dashed var(--ink); border-radius: 18px; background: var(--paper);
  font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.problem__a.has-value { border-style: solid; background: color-mix(in srgb, var(--c) 30%, var(--white)); }

/* Teclado numérico */
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: auto; }
.key {
  height: 64px; display: grid; place-items: center;
  border: var(--line); border-radius: 18px; background: var(--white); box-shadow: 0 4px 0 var(--ink);
  font-size: 30px; font-weight: 800; user-select: none; -webkit-user-select: none;
  transition: transform .06s ease, box-shadow .06s ease;
}
.key:active, .key.is-pressed { transform: translateY(4px); box-shadow: 0 0 0 var(--ink); }
.key--alt { background: var(--paper-2); font-size: 16px; }
.key--alt .ico { font-size: 22px; }
.keypad.is-disabled { pointer-events: none; }
.keypad.is-disabled .key { opacity: .5; }

/* Memoria */
.memory { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; min-height: 230px; margin-bottom: 18px; }
.memory__msg { font-size: 18px; font-weight: 800; text-align: center; }
.memory__digit {
  width: 150px; height: 150px; display: grid; place-items: center;
  border: var(--line); border-radius: 34px; background: var(--paper); box-shadow: var(--lift);
  font-size: 100px; font-weight: 800; line-height: 1;
}
.memory__digit.is-on { background: var(--c); animation: pop .25s cubic-bezier(.34, 1.56, .64, 1); }
.memory__dots { display: flex; gap: 6px; }
.memory__dots span { width: 12px; height: 12px; border: 2px solid var(--ink); border-radius: 50%; background: var(--white); }
.memory__dots span.is-done { background: var(--ink); }
.memory.is-input .memory__digit, .memory.is-input .memory__dots { display: none; }
/* Ronda al revés: el aviso se resalta para que nadie la haga en el orden normal por costumbre */
.memory.is-reverse .memory__msg { padding: 4px 12px; border: 2px solid var(--ink); border-radius: 99px; background: var(--yellow); }
.slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.slot {
  width: 44px; height: 56px; display: grid; place-items: center;
  border: var(--line); border-radius: 14px; background: var(--paper);
  font-size: 30px; font-weight: 800;
}
.slot.is-cursor { border-style: dashed; background: color-mix(in srgb, var(--c) 25%, var(--white)); }
.slot.is-filled { background: var(--white); box-shadow: 0 3px 0 var(--ink); }
.slot.is-ok { background: var(--ok-soft); }
.slot.is-ko { background: var(--ko-soft); }

/* Opción múltiple (lógica, cultura) */
.quiz { flex: 1; display: flex; flex-direction: column; gap: 16px; }
.quiz__card { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 14px; min-height: 180px; padding: 18px 16px; }
.quiz__card.is-new { animation: enter .3s ease both; }
.quiz__q { width: 100%; font-size: 24px; font-weight: 800; line-height: 1.18; letter-spacing: -.025em; }
/* Analogías: las tres palabras resaltadas, el resto más suave */
.analogy { font-weight: 600; line-height: 1.45; color: var(--ink-soft); }
.analogy b { font-weight: 800; color: var(--ink); }
.quiz__options { display: grid; gap: 10px; margin-top: auto; }
.quiz__options.is-compact { grid-template-columns: 1fr 1fr; }
.option {
  display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 10px 14px;
  border: var(--line); border-radius: 18px; background: var(--white); box-shadow: 0 4px 0 var(--ink);
  font-size: 17px; font-weight: 700; line-height: 1.2; text-align: left;
  transition: transform .06s ease, box-shadow .06s ease, background .15s ease, opacity .2s ease;
}
.option:active { transform: translateY(4px); box-shadow: 0 0 0 var(--ink); }
.option__key {
  flex: none; width: 32px; height: 32px; display: grid; place-items: center;
  border: 2px solid var(--ink); border-radius: 10px; background: var(--paper); font-size: 14px; font-weight: 800;
}
.is-compact .option { justify-content: center; min-height: 74px; font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.is-compact .option__key { display: none; }
.option:disabled { cursor: default; }
.option:disabled:not(.is-correct):not(.is-wrong) { opacity: .45; }
.option.is-correct { background: var(--ok); }
.option.is-wrong { background: var(--ko); animation: shake .35s ease; }
.option.is-correct .option__key, .option.is-wrong .option__key { background: var(--white); }
.series { width: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.series__n {
  min-width: 46px; height: 58px; padding: 0 7px; display: grid; place-items: center;
  border: var(--line); border-radius: 14px; background: var(--paper);
  font-size: clamp(19px, 5.6vw, 26px); font-weight: 800; font-variant-numeric: tabular-nums;
}
.series__n--ask { background: var(--c); animation: pulse 1.2s ease-in-out infinite; }
/* Nota al responder: dato curioso o la regla de la serie */
.quiz__note {
  width: 100%; padding: 12px 14px; border: 2px solid var(--ink); border-radius: 16px; background: var(--paper);
  animation: enter .25s ease both;
}
/* Sin sitio para las dos cosas (un teléfono): la nota ocupa el lugar de la pregunta, centrada bajo la etiqueta */
.quiz__card.is-noted { justify-content: flex-start; }
.quiz__card.is-noted .quiz__q { display: none; }
.quiz__card.is-noted .quiz__note { margin: auto 0; }
.quiz__note > b { display: block; margin-bottom: 3px; font-size: 13px; letter-spacing: .02em; text-transform: uppercase; }
.quiz__note p { font-size: 15.5px; font-weight: 600; line-height: 1.38; }
.quiz__next {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 7px 14px;
  border: 2px solid var(--ink); border-radius: 99px; background: var(--white); font-size: 14px; font-weight: 800;
}
.quiz__next .ico { font-size: 12px; }
/* La barra que se llena muestra cuánto falta para pasar sola */
.quiz__next::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--c);
  transform-origin: left; animation: wait var(--wait) linear both;
}
@keyframes wait { from { transform: scaleX(0); } }
/* Matrices */
.matrix { width: min(100%, 270px); display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 auto; }
.matrix__cell {
  aspect-ratio: 1; display: grid; place-items: center;
  border: 2px solid var(--ink); border-radius: 12px; background: var(--paper);
}
.matrix__cell svg { width: 84%; height: 84%; }
.matrix__cell--ask { background: var(--c); border-style: dashed; font-size: 34px; font-weight: 800; animation: pulse 1.2s ease-in-out infinite; }
.option .cell { display: block; width: 62px; height: 62px; }

/* Colores (Stroop) */
.stroop { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; min-height: 230px; margin-bottom: 18px; }
/* Las dos reglas se distinguen sin leer: la pregunta empieza distinto y, cuando toca leer ("¿Qué DICE?"), el panel se
   tiñe y la palabra sale dentro de un bocadillo (la palabra "habla"), justo donde se está mirando */
.stroop { transition: background-color .2s ease; }
.stroop.is-word { background: #FFF4CC; }
.stroop__rule {
  padding: 8px 18px; border: 2px solid var(--ink); border-radius: 99px; background: var(--paper);
  font-size: 18px; font-weight: 700; transition: background .2s ease;
}
.stroop__rule b { font-weight: 800; letter-spacing: .02em; }
.stroop__rule.is-word { background: var(--ink); color: var(--white); animation: pulse .6s ease 2; }
.stroop__word {
  font-size: clamp(40px, 13vw, 64px); font-weight: 800; letter-spacing: .02em; line-height: 1;
  -webkit-text-stroke: 2.5px var(--ink); paint-order: stroke fill;
}
.stroop__word.is-quoted {
  position: relative; max-width: 100%; padding: 16px 24px 18px; margin-bottom: 10px;
  border: var(--line); border-radius: 24px; background: var(--white); box-shadow: var(--lift);
  font-size: clamp(32px, 10.5vw, 54px);
}
/* El pico del bocadillo */
.stroop__word.is-quoted::after {
  content: ""; position: absolute; left: 32px; bottom: -14px; width: 22px; height: 22px;
  border-right: var(--line); border-bottom: var(--line); border-bottom-right-radius: 4px;
  background: var(--white); transform: skewX(-25deg) rotate(45deg);
}
.stroop__word.is-new { animation: pop .22s cubic-bezier(.34, 1.56, .64, 1); }
.stroop__options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: auto; }
.stroop__btn { justify-content: center; min-height: 72px; font-size: 17px; font-weight: 800; }
.stroop__btn.is-pressed { transform: translateY(4px); box-shadow: 0 0 0 var(--ink); }
.stroop__options.is-shuffled .option { animation: pop .3s cubic-bezier(.34, 1.56, .64, 1); }
.stroop__alert {
  position: absolute; left: 50%; bottom: 12px; translate: -50% 0; width: max-content; max-width: calc(100% - 24px);
  padding: 6px 12px; border-radius: 99px; background: var(--ink); color: var(--white);
  font-size: 14px; font-weight: 800; animation: toast-in .3s ease;
}
.swatch { width: 24px; height: 24px; flex: none; border: 2px solid var(--ink); border-radius: 50%; }

/* Giros: la figura que hay que girar y las opciones, todas del mismo tamaño */
.spin { width: 100%; display: grid; place-items: center; }
.spin .spin__fig { display: block; width: min(52vw, 180px); height: auto; }
.option .spin__fig { display: block; width: 86px; height: 86px; }

/* Resultado */
.result { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 20px; }
.result__card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 70px; padding-top: 64px; text-align: center; }
.result__mascot { position: absolute; top: -74px; left: 50%; width: 128px; translate: -50% 0; animation: pop .5s cubic-bezier(.34, 1.56, .64, 1) both; }
.result__mascot .mascot { animation: bob 2.6s ease-in-out infinite; }
.stars { display: flex; align-items: flex-end; gap: 4px; margin-bottom: 4px; }
.star { width: 46px; color: var(--paper-2); }
.star:nth-child(2) { width: 60px; margin-bottom: 10px; }
.star .ico { display: block; width: 100%; height: auto; }
.star.is-on { color: var(--yellow); animation: pop .5s cubic-bezier(.34, 1.56, .64, 1) var(--d) both; }
.result__label { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.result__score { margin-top: 6px; font-size: 92px; font-weight: 800; line-height: .85; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.result__unit { font-size: 16px; font-weight: 700; color: var(--ink-soft); }
.result__summary { margin-top: 6px; font-size: 15px; font-weight: 600; color: var(--ink-soft); }
.result__chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px 5px 8px;
  border: 2px solid var(--ink); border-radius: 99px; background: var(--white); font-size: 14px; font-weight: 800;
  animation: pop .4s cubic-bezier(.34, 1.56, .64, 1) .7s both;
}
.chip--xp { background: var(--yellow); }
.chip--record { background: var(--pink); }
.chip--level { background: var(--lilac); }
.chip--rank { background: var(--green); }
.btn--challenge { margin-top: 16px; background: var(--yellow); }
/* Trucos para la próxima (Cálculo mental): la cuenta y cómo resolverla de cabeza */
.result__tips {
  width: 100%; margin-top: 14px; padding: 12px 14px; text-align: left;
  border: 2px solid var(--ink); border-radius: 16px; background: var(--paper);
  animation: pop .4s cubic-bezier(.34, 1.56, .64, 1) .9s both;
}
.result__tips-title {
  display: flex; align-items: center; gap: 6px; margin-bottom: 6px;
  font-size: 12.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
}
.result__tips-title .ico { width: 20px; height: 20px; }
.result__tip + .result__tip { margin-top: 10px; padding-top: 10px; border-top: 2px dashed rgba(29, 27, 38, .18); }
.result__tip b { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.result__tip p { margin-top: 2px; font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--ink-soft); }
.result__actions { display: grid; grid-template-columns: 1fr 1.5fr; gap: 12px; }

/* ---------- Animaciones ---------- */
@keyframes enter { from { opacity: 0; transform: translateY(14px); } }
@keyframes pop { from { opacity: 0; transform: scale(.4); } }
@keyframes bob { 50% { transform: translateY(-5px); } }
@keyframes wiggle { 50% { transform: rotate(5deg); } }
@keyframes pulse { 50% { transform: scale(1.06); } }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes shake { 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
@keyframes burst { 0% { opacity: 0; transform: translateY(10px) scale(.6); } 25% { opacity: 1; transform: translateY(0) scale(1.15); } 100% { opacity: 0; transform: translateY(-60px) scale(1); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(20px); } }
@keyframes flash-ok { from { background: var(--ok-soft); } }
@keyframes flash-ko { from { background: var(--ko-soft); } }

/* ---------- Escritorio ---------- */
@media (min-width: 900px) {
  #app { max-width: 1080px; padding-top: 30px; }
  .home {
    grid-template-columns: minmax(340px, 400px) 1fr;
    grid-template-areas: "top top" "hero games" "profile games";
    grid-template-rows: auto auto 1fr;
    column-gap: 32px;
    align-items: start;
  }
  .home__games .section-title { margin-top: 0; }
  .grid { gap: 18px; }
  .game-card { min-height: 236px; padding: 18px; }
  .game-card__art { width: 84px; height: 84px; padding: 9px; }
  .game-card__name { font-size: 24px; }
  .game-card__skill { font-size: 14px; }
}
@media (hover: hover) {
  .game-card:hover { transform: translateY(-3px); box-shadow: 0 9px 0 var(--ink); }
  .btn:hover, .icon-btn:hover, .key:hover, .option:not(:disabled):hover { filter: brightness(1.04); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
